> ## 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.

# getUserRecords

> 查询由 Solana 钱包所有者注册的公共屏蔽地址记录。

## 注册表记录

提供 1 到 100 个 Solana 所有者公钥。响应会按照请求顺序，在 `result.records` 中为每个所有者包含一个条目。如果在读取记录的时隙中，所有者没有注册表记录，则该条目为 `null`。

记录包含所有者采用 base58 编码的 nullifier 公钥和采用 base64 编码的查看公钥。查看公钥是一个带标签的 33 字节 X25519 密钥：先是 `0x04`，后跟一个规范的 32 字节 u 坐标。禁用合并时，`mergeEncryption` 为 `0`；对于 PoseidonCtrV1，则为 `1`。

记录从 Solana 中获取，所在时隙不早于 `context.slot`。这些是公开的注册密钥；有关钱包密钥处理方式，请参阅[屏蔽密钥对和加密](https://www.helius.dev/docs/zh/privacy/concepts/encryption.md)。

## 请求参数

**owners** `array` *required*

要在用户注册表中查询的 Solana 公钥。最多 100 个。


## OpenAPI

````yaml zh/openapi/privacy/getUserRecords.yaml POST /v1/spr/getUserRecords
openapi: 3.0.3
info:
  title: Solana 隐私环 API
  version: 0.51.2
  description: 用于加密状态、历史记录、证明和公共注册表记录的隐私索引器 JSON-RPC API。
servers:
  - url: https://devnet.helius-rpc.com
    description: 开发网 Solana 隐私环 API
security: []
paths:
  /v1/spr/getUserRecords:
    post:
      summary: getUserRecords
      description: 查找由 Solana 钱包所有者注册的公共隐匿地址记录。
      operationId: getUserRecords
      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:
                    - getUserRecords
                  default: getUserRecords
                params:
                  type: object
                  required:
                    - owners
                  properties:
                    owners:
                      type: array
                      items:
                        $ref: '#/components/schemas/SerializablePubkey'
                      description: 要在用户注册表中查找的 Solana 公钥。最多 100 个。
                      maxItems: 100
                      minItems: 1
                  additionalProperties: false
                  example:
                    owners:
                      - '11111111111111111111111111111111'
            example:
              jsonrpc: '2.0'
              id: '1'
              method: getUserRecords
              params:
                owners:
                  - '11111111111111111111111111111111'
        required: true
      responses:
        '200':
          description: JSON-RPC 响应。读取结果前请先检查错误。
          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
                    required:
                      - context
                      - records
                    properties:
                      context:
                        $ref: '#/components/schemas/Context'
                      records:
                        type: array
                        items:
                          type: object
                          description: 一条用户注册表记录，即 Solana 公钥发布的隐匿地址。
                          required:
                            - owner
                            - nullifierPubkey
                            - viewingPubkey
                            - mergeEncryption
                          properties:
                            mergeEncryption:
                              type: integer
                              format: uint8
                              description: >-
                                所有者为 `merge_transact` 接受的合并输出加密方案。0 表示禁用合并，1
                                表示选择 PoseidonCtrV1。选择某个方案后，任何调用者都可以按该方案合并此所有者的
                                UTXO。
                              minimum: 0
                            nullifierPubkey:
                              allOf:
                                - $ref: '#/components/schemas/Hash'
                              description: 钱包全局的作废符公钥。永不轮换。
                            owner:
                              $ref: '#/components/schemas/SerializablePubkey'
                            viewingPubkey:
                              allOf:
                                - $ref: '#/components/schemas/Base64String'
                              description: 带标签的 X25519 查看公钥（0x04 后跟一个规范的 32 字节 u 坐标）。
                          additionalProperties: false
                          nullable: true
                        description: |-
                          每个请求的所有者对应一个条目，并按请求顺序排列。如果在读取记录的槽位上所有者
                          没有注册表记录，则为 `null`；该槽位不会
                          早于 `context.slot`。
                    additionalProperties: false
              example:
                jsonrpc: '2.0'
                id: '1'
                result:
                  context:
                    slot: 4242
                    blockTime: 1730000000
                  records:
                    - 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:
    SerializablePubkey:
      type: string
      description: 使用 base58 编码的 Solana 公钥。
    Context:
      type: object
      required:
        - blockTime
        - slot
      properties:
        blockTime:
          type: integer
          format: int64
        slot:
          type: integer
          format: uint64
          description: 索引器已持久化的最高槽位，用于基于槽位的新鲜度检查。
          minimum: 0
    Hash:
      type: string
      description: 使用 base58 编码的 32 字节哈希值。
    Base64String:
      type: string
      description: 使用 base64 编码的字节字符串。
  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.