> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getEncryptedUtxosByTags

> ビュータグまたは特定のリングに一致する暗号化済み UTXO 出力を取得します。

## 暗号化済み出力

このメソッドを使用して、クライアント側で復号するための暗号化済み UTXO を取得します。ウォレットは出力を復号し、各資産の未使用額を合計してプライベート残高を算出します。

これは、アドレスが所有する SPL Token アカウントを返す Solana の [`getTokenAccountsByOwner`](https://solana.com/docs/rpc/http/gettokenaccountsbyowner) に相当します。プライベート残高は Solana アカウントではなく UTXO に保存されるため、専用の RPC メソッドが必要です。詳しくは、[プライベートステートと UTXO](https://www.helius.dev/docs/ja/privacy/concepts/utxo.md) を参照してください。

このメソッドは、一致する出力を `result.data` に Solana トランザクションごとにグループ化して返します。各エントリには、トランザクションの `slot` と `signature` が含まれます。出力には、暗号文、ビュータグ、コミットメント、ツリー ID、リーフインデックスが含まれます。

レスポンスには、すでに使用済みである可能性のある過去の出力も含まれます。使用可能残高を算出するには、ウォレットで Nullifier を追跡する必要があります。[プライベート残高ガイド](https://www.helius.dev/docs/ja/privacy/guides/read-balance.md)を参照してください。

空の `tags` 配列を指定する場合は `ringProgramId` が必要であり、そのリングから出力を選択します。両方を指定した場合、出力はタグとリングの両方に一致する必要があります。

ページ制限、継続トークン、増分読み取りについては、[ページネーションと鮮度](https://www.helius.dev/docs/ja/api-reference/privacy.md#ページネーション)を参照してください。

## リクエストパラメータ

**filters** `object`

スロットの範囲です。上限なしの読み取りが最新状態に追いついた後で再開するには、`slot.gt` を最後のページの `context.slot` に設定します。

**filters.slot** `object`

読み取り対象のスロット範囲です。指定した範囲条件は AND で結合されます。

**filters.slot.gt** `number`

このスロットより後のトランザクションのみを含めます。

**filters.slot.gte** `number`

このスロット以降のトランザクションのみを含めます。

**filters.slot.lt** `number`

このスロットより前のトランザクションのみを含めます。

**filters.slot.lte** `number`

このスロット以前のトランザクションのみを含めます。

**limit** `number` (default: 1000)

1 ページあたりの Solana トランザクションの最大数です。1〜1,000 の範囲で指定します。

**minContextSlot** `number`

この読み取りに必要な、永続化済みインデクサーの最小スロットです。インデクサーが遅れている場合は、JSON-RPC エラー -32016 を返します。

**paginationToken** `string`

前のレスポンスから取得した継続トークンです。同じタグ、リング、スロットフィルターとともに、変更せずに渡してください。

**ringProgramId** `string`

このプログラム ID によって認可されたリングに結果を限定します。tags が空の場合は必須です。

**tags** `array` *required*

Base58 でエンコードされた 32 バイトのビュータグです。最大 1,000 個です。空の配列を指定する場合は ringProgramId が必要であり、そのリングが選択されます。


## OpenAPI

````yaml ja/openapi/privacy/getEncryptedUtxosByTags.yaml POST /v1/spr/getEncryptedUtxosByTags
openapi: 3.0.3
info:
  title: Solana Privacy Rings API
  version: 0.51.2
  description: 暗号化された状態、履歴、証明、公開レジストリレコードに対応するプライバシーインデクサー JSON-RPC API です。
servers:
  - url: https://devnet.helius-rpc.com
    description: Devnet Solana Privacy Rings API
security: []
paths:
  /v1/spr/getEncryptedUtxosByTags:
    post:
      summary: getEncryptedUtxosByTags
      description: ビュータグまたは特定のリングに一致する、暗号化された UTXO 出力を取得します。
      operationId: getEncryptedUtxosByTags
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                id:
                  type: string
                  description: リクエストを識別するための ID です。
                  default: '1'
                jsonrpc:
                  type: string
                  description: JSON-RPC プロトコルのバージョンです。
                  enum:
                    - '2.0'
                  default: '2.0'
                method:
                  type: string
                  description: 呼び出すメソッドです。URL パスの最後のセグメントと一致する必要があります。
                  enum:
                    - getEncryptedUtxosByTags
                  default: getEncryptedUtxosByTags
                params:
                  type: object
                  required:
                    - tags
                  properties:
                    filters:
                      allOf:
                        - $ref: '#/components/schemas/HistoryFilters'
                      description: >-
                        スロットの範囲です。上限なしの読み取りが最新状態に追いついた後に再開するには、`slot.gt` を前ページの
                        `context.slot` に設定します。
                    limit:
                      type: integer
                      format: uint64
                      maximum: 1000
                      minimum: 1
                      nullable: true
                      default: 1000
                      description: 1 ページあたりの Solana トランザクションの最大数です。1～1,000 の範囲で指定します。
                    minContextSlot:
                      type: integer
                      format: uint64
                      minimum: 0
                      nullable: true
                      description: >-
                        この読み取りに必要な、インデクサーが永続化した最小スロットです。インデクサーが遅れている場合は JSON-RPC
                        エラー -32016 を返します。
                    paginationToken:
                      type: string
                      description: >-
                        前のレスポンスから取得した継続トークンです。同じタグ、リング、スロットフィルターを使用し、変更せずに渡してください。
                      nullable: true
                    ringProgramId:
                      type: string
                      description: 結果を、このプログラム ID によって承認されたリングに限定します。tags が空の場合は必須です。
                      nullable: true
                    tags:
                      type: array
                      items:
                        $ref: '#/components/schemas/Hash'
                      description: >-
                        Base58 でエンコードされた 32 バイトのビュータグです。最大 1,000
                        個です。空の配列を指定する場合は ringProgramId が必要で、そのリングが選択されます。
                      maxItems: 1000
                  additionalProperties: false
                  example:
                    tags:
                      - '11111111111111111111111111111112'
                    limit: 100
            example:
              jsonrpc: '2.0'
              id: '1'
              method: getEncryptedUtxosByTags
              params:
                tags:
                  - '11111111111111111111111111111112'
                limit: 100
        required: true
      responses:
        '200':
          description: JSON-RPC レスポンスです。result を読み取る前に error を確認してください。
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
                  id:
                    type: string
                    description: リクエスト ID です。
                  jsonrpc:
                    type: string
                    description: JSON-RPC プロトコルのバージョンです。
                    enum:
                      - '2.0'
                  result:
                    type: object
                    description: gTFA 形式のページネーションを使用する、履歴読み取りの範囲が限定された 1 ページです。
                    required:
                      - context
                      - data
                      - paginationToken
                    properties:
                      context:
                        $ref: '#/components/schemas/Context'
                      data:
                        type: array
                        items:
                          type: object
                          description: 1 件の Solana トランザクションに含まれる、条件に一致したすべての出力です。
                          required:
                            - slot
                            - signature
                            - outputs
                          properties:
                            outputs:
                              type: array
                              items:
                                $ref: '#/components/schemas/EncryptedUtxoMatch'
                            signature:
                              $ref: '#/components/schemas/SerializableSignature'
                            slot:
                              type: integer
                              format: uint64
                              minimum: 0
                          additionalProperties: false
                      outputTreeId:
                        type: integer
                        format: uint16
                        description: 一時停止されていない最新の状態ツリー ID です。利用できない場合は省略されます。
                        minimum: 0
                      paginationToken:
                        type: string
                        description: >-
                          次のページ用のトークンです。一致する結果がそれ以上ない場合は null です。`lt` または `lte`
                          の境界がない読み取りが最新状態に追いついた場合、後で `filters.slot.gt` をこのページの
                          `context.slot`
                          に設定して再開します。上限が設定された読み取りでは、その上限までのスロットのみが対象になります。
                        nullable: true
              example:
                jsonrpc: '2.0'
                id: '1'
                result:
                  context:
                    slot: 4242
                    blockTime: 1730000000
                  data: []
                  paginationToken: null
        '400':
          description: >-
            実行前に拒否されました。メソッドとパスの不一致、メソッドフィールドの重複、またはバッチリクエストでは -32601
            が返されます。読み取れない、またはサイズが大きすぎる本文では -32600 が返されます。
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: リクエスト ID です。本文が単一の JSON-RPC 呼び出しでない場合は null です。
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '429':
          description: レート制限を超過しました。
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: リクエスト ID です。本文が単一の JSON-RPC 呼び出しでない場合は null です。
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
        '500':
          description: 内部サーバーエラーです。
          content:
            application/json:
              schema:
                type: object
                required:
                  - jsonrpc
                  - id
                  - error
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: string
                    nullable: true
                    description: リクエスト ID です。本文が単一の JSON-RPC 呼び出しでない場合は null です。
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
                      data:
                        type: object
                        additionalProperties: true
      security:
        - ApiKeyQuery: []
components:
  schemas:
    HistoryFilters:
      type: object
      description: 履歴クエリ用のオプションのスロット範囲です。
      properties:
        slot:
          $ref: '#/components/schemas/SlotFilter'
      additionalProperties: false
    Hash:
      type: string
      description: Base58 でエンコードされた 32 バイトのハッシュです。
    Context:
      type: object
      required:
        - blockTime
        - slot
      properties:
        blockTime:
          type: integer
          format: int64
        slot:
          type: integer
          format: uint64
          description: スロットに基づいて最新性を確認するための、インデクサーが永続化した最大スロットです。
          minimum: 0
    EncryptedUtxoMatch:
      type: object
      required:
        - slot
        - txSignature
        - txViewingPk
        - salt
        - outputSlot
      properties:
        outputSlot:
          $ref: '#/components/schemas/RingsOutputSlot'
        salt:
          type: string
          description: すべての出力暗号文で共有される、トランザクションレベルの AES ソルトです。
          nullable: true
        slot:
          type: integer
          format: uint64
          minimum: 0
        txSignature:
          $ref: '#/components/schemas/SerializableSignature'
        txViewingPk:
          type: string
          description: Base64 でエンコードされたバイト文字列です。
          nullable: true
    SerializableSignature:
      type: string
      description: Base58 でエンコードされた 64 バイトの Solana トランザクション署名です。
    SlotFilter:
      type: object
      description: 読み取り対象のスロット範囲です。指定した範囲は AND 条件で組み合わされます。
      properties:
        gt:
          type: integer
          format: uint64
          minimum: 0
          nullable: true
          description: このスロットより後のトランザクションのみを含めます。
        gte:
          type: integer
          format: uint64
          minimum: 0
          nullable: true
          description: このスロット以降のトランザクションのみを含めます。
        lt:
          type: integer
          format: uint64
          minimum: 0
          nullable: true
          description: このスロットより前のトランザクションのみを含めます。
        lte:
          type: integer
          format: uint64
          minimum: 0
          nullable: true
          description: このスロット以前のトランザクションのみを含めます。
      additionalProperties: false
    RingsOutputSlot:
      type: object
      required:
        - viewTag
        - outputContext
        - payload
      properties:
        outputContext:
          $ref: '#/components/schemas/RingsOutputContext'
        payload:
          $ref: '#/components/schemas/Base64String'
        viewTag:
          $ref: '#/components/schemas/Hash'
    RingsOutputContext:
      type: object
      required:
        - hash
        - tree
        - treeId
        - leafIndex
      properties:
        hash:
          $ref: '#/components/schemas/Hash'
        leafIndex:
          type: integer
          format: uint64
          minimum: 0
        tree:
          allOf:
            - $ref: '#/components/schemas/SerializablePubkey'
          description: 状態ツリーアカウントです。treeId を優先してください。ツリーアカウントは treeId から導出されます。
          deprecated: true
        treeId:
          type: integer
          format: uint16
          description: 出力のコミットメントのハッシュ化に使用される、生のツリー ID です。
          minimum: 0
    Base64String:
      type: string
      description: Base64 でエンコードされたバイト文字列です。
    SerializablePubkey:
      type: string
      description: Base58 でエンコードされた Solana 公開鍵です。
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: Helius API キーです。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.