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

# getTransfersByAddress

> 按地址查询解析的、可读的代币和本地 SOL 转账对象，支持通过铸币、时间、金额、交易方和分页进行筛选。

## 概览

`getTransfersByAddress` 返回涉及钱包地址的代币和本地 SOL 移动的解析、可读的转账对象。使用筛选器根据铸币、区块时间、金额、插槽、方向或交易方缩小结果范围。响应旨在提供准确的钱包活动视图、支付跟踪和余额对账，而无需重新实现 Solana 转账解析。

<Note>
  铸造和销毁转账是单向的。铸造具有`fromUserAccount: null`，只能作为收件人的入站转账返回。销毁具有`toUserAccount: null`，只能作为销毁所有者的出站转账返回。
</Note>

## 请求参数

<ParamField body="address" type="string" required>
  Base58编码的所有者钱包地址，用于查询转账。传递钱包所有者地址，而不是关联的代币账户（ATA）。
</ParamField>

<ParamField body="with" type="string">
  按对方地址过滤。仅返回与此地址相关的转账。
</ParamField>

<ParamField body="direction" type="string" default="any">
  根据查询地址的转账方向进行过滤。

  * `in`
  * `out`
  * `any`
</ParamField>

<ParamField body="mint" type="string">
  代币铸造地址。对于本地SOL，使用So11111111111111111111111111111111111111111，对于WSOL，使用So11111111111111111111111111111111111111112。
</ParamField>

<ParamField body="solMode" type="string" default="merged">
  SOL/WSOL显示模式。merged模式将WSOL视为本地SOL，并排除包装/解包行，使以SOL计价的历史更易于对账；separate模式将WSOL保留为独立的SPL代币铸造，并包括包装/解包行。

  * `merged`
  * `separate`
</ParamField>

<ParamField body="filters" type="object">
  用于金额、区块时间和插槽的附加过滤器。
</ParamField>

<ParamField body="filters.amount" type="object">
  范围比较过滤器。所有字段都是可选的，并且可以组合使用。
</ParamField>

<ParamField body="filters.amount.gt" type="number">
  大于。
</ParamField>

<ParamField body="filters.amount.gte" type="number">
  大于或等于。
</ParamField>

<ParamField body="filters.amount.lt" type="number">
  小于。
</ParamField>

<ParamField body="filters.amount.lte" type="number">
  小于或等于。
</ParamField>

<ParamField body="filters.blockTime" type="object">
  范围比较过滤器。所有字段都是可选的，并且可以组合使用。
</ParamField>

<ParamField body="filters.blockTime.gt" type="number">
  大于。
</ParamField>

<ParamField body="filters.blockTime.gte" type="number">
  大于或等于。
</ParamField>

<ParamField body="filters.blockTime.lt" type="number">
  小于。
</ParamField>

<ParamField body="filters.blockTime.lte" type="number">
  小于或等于。
</ParamField>

<ParamField body="filters.slot" type="object">
  范围比较过滤器。所有字段都是可选的，可以组合使用。
</ParamField>

<ParamField body="filters.slot.gt" type="number">
  大于。
</ParamField>

<ParamField body="filters.slot.gte" type="number">
  大于或等于。
</ParamField>

<ParamField body="filters.slot.lt" type="number">
  小于。
</ParamField>

<ParamField body="filters.slot.lte" type="number">
  小于或等于。
</ParamField>

<ParamField body="limit" type="number" default="100">
  要返回的最大传输数量。范围1到100。
</ParamField>

<ParamField body="paginationToken" type="string">
  用于分页的上一个响应的游标。
</ParamField>

<ParamField body="example" type="any" />

<ParamField body="commitment" type="string" default="finalized">
  数据承诺级别。

  * `finalized`
  * `confirmed`
</ParamField>

<ParamField body="minContextSlot" type="number">
  请求使用的最小上下文插槽（可选）。
</ParamField>

<ParamField body="sortOrder" type="string" default="desc">
  结果排序。

  * `asc`
  * `desc`
</ParamField>


## OpenAPI

````yaml zh/openapi/rpc-http/getTransfersByAddress.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    特定于转账的Solana历史API，用于通过地址查询解析的、可读的代币和本机SOL转账对象，并通过mint、时间、金额和交易对手进行过滤。旨在提供准确的钱包活动视图、支付跟踪和余额对账。
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: 主网RPC端点
  - url: https://devnet.helius-rpc.com
    description: 开发网RPC端点
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getTransfersByAddress
      description: >-
        返回解析后的、可读的代币和本机SOL转账对象，适用于钱包地址。此Helius
        RPC方法返回简洁的转账特定记录，而不是完整的交易负载，旨在用于准确的钱包活动视图、支付跟踪和余额核对。


        您可以通过铸币、区块时间、金额、槽位、方向和对手方进行筛选。
      operationId: getTransfersByAddress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  example: '2.0'
                  description: JSON-RPC协议版本。
                  default: '2.0'
                id:
                  type: string
                  example: '1'
                  description: 请求的唯一标识符。
                  default: '1'
                method:
                  type: string
                  enum:
                    - getTransfersByAddress
                  example: getTransfersByAddress
                  description: 要调用的RPC方法的名称。
                  default: getTransfersByAddress
                params:
                  type: array
                  description: 包含必需的钱包地址和可选配置对象的数组。
                  minItems: 1
                  maxItems: 2
                  prefixItems:
                    - type: string
                      description: 用于查询转账的Base58编码的所有者钱包地址。传递钱包所有者地址，而不是关联的代币账户（ATA）。
                      example: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                    - type: object
                      description: 可选的转账查询配置。
                      properties:
                        with:
                          type: string
                          description: 按对手方地址过滤。仅返回与此地址的转账。
                          example: 7hPhaUpydpvm8wtiS3k4LPZKUmivQRs7YQmpE1hFshHx
                        direction:
                          type: string
                          description: 根据相对于查询地址的转账方向进行过滤。
                          enum:
                            - in
                            - out
                            - any
                          default: any
                          example: in
                        mint:
                          type: string
                          description: >-
                            代币铸币地址。使用So11111111111111111111111111111111111111111表示本地SOL，使用So11111111111111111111111111111111111111112表示WSOL。
                          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        solMode:
                          type: string
                          description: >-
                            SOL/WSOL显示模式。merged模式将WSOL视为本地SOL，并排除包裹/解包行，以便更容易对SOL计价的历史进行核对；separate模式将WSOL保留为独立的SPL代币铸币，并包括包裹/解包行。
                          enum:
                            - merged
                            - separate
                          default: merged
                          example: merged
                        filters:
                          type: object
                          description: 用于金额、块时间和槽位的附加过滤器。
                          properties:
                            amount:
                              $ref: '#/components/schemas/TransferComparisonFilter'
                              description: 按原始转账金额过滤，而不是UI金额。
                            blockTime:
                              $ref: '#/components/schemas/TransferComparisonFilter'
                              description: 按Unix秒的块时间戳过滤。
                            slot:
                              $ref: '#/components/schemas/TransferComparisonFilter'
                              description: 按槽位号过滤。
                          additionalProperties: false
                        limit:
                          type: integer
                          description: 要返回的最大转账数量。范围1至100。
                          minimum: 1
                          maximum: 100
                          default: 100
                          example: 50
                        paginationToken:
                          type: string
                          description: 用于分页的上一个响应中的光标。
                        example: 315069220:308:2:1:splTransfer
                        commitment:
                          type: string
                          description: 数据承诺级别。
                          enum:
                            - finalized
                            - confirmed
                          default: finalized
                          example: finalized
                        minContextSlot:
                          type: integer
                          description: 用于请求的最小上下文槽（可选）。
                          example: 1000
                        sortOrder:
                          type: string
                          description: 结果排序。
                          enum:
                            - asc
                            - desc
                          default: desc
                          example: desc
                      additionalProperties: false
                  items: false
                  example:
                    - 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                    - mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                      limit: 50
                      sortOrder: desc
            example:
              jsonrpc: '2.0'
              id: '1'
              method: getTransfersByAddress
              params:
                - 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                - mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                  limit: 50
      responses:
        '200':
          description: 成功检索到指定地址的转账。
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                    example: '2.0'
                    description: JSON-RPC 协议版本。
                  id:
                    type: string
                    description: 与请求匹配的标识符。
                    example: '1'
                  result:
                    type: object
                    description: 转账数据和分页信息。
                    properties:
                      data:
                        type: array
                        description: 转账记录列表。
                        items:
                          $ref: '#/components/schemas/TokenTransfer'
                      paginationToken:
                        oneOf:
                          - type: string
                            description: 用于检索下一页结果的游标。
                          - type: 'null'
                        description: 用于下一页的游标，如果没有更多结果则为 null。
                        example: 315073428:35:1:0:splTransfer
              examples:
                transferResponse:
                  summary: 转账响应
                  value:
                    jsonrpc: '2.0'
                    id: '1'
                    result:
                      data:
                        - signature: >-
                            5GEX7Q3X5Q8yJGbKYoR7mtzQmG8tpoEwzjPgqVmn3y5xg3yKwqXcDdN5YVcc9V6vA4TuH5iM6FHRVhTxvz4AX2zG
                          slot: 315073428
                          blockTime: 1736159420
                          type: transfer
                          fromUserAccount: 7hPhaUpydpvm8wtiS3k4LPZKUmivQRs7YQmpE1hFshHx
                          toUserAccount: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                          fromTokenAccount: HcvK3EJ74iM9g11cUgsaPvLSrhCvCwcrWxBNd87LsC1x
                          toTokenAccount: CBcYniR9G9CN3zGMnwNE4SWbqkYWvCFVreEob9xHnQCY
                          mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                          amount: '2500000'
                          decimals: 6
                          uiAmount: '2.5'
                          confirmationStatus: finalized
                          transactionIdx: 35
                          instructionIdx: 1
                          innerInstructionIdx: 0
                      paginationToken: 315073428:35:1:0:splTransfer
        '400':
          description: 请求错误 - 请求参数无效或请求格式错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: 无效参数
                id: '1'
        '401':
          description: 未授权 - 无效或缺少API密钥。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: 未授权
                id: '1'
        '429':
          description: 请求过多 - 超过速率限制。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: 请求过多
                id: '1'
        '500':
          description: 内部服务器错误 - 服务器发生错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: 内部错误
                id: '1'
        '503':
          description: 服务不可用 - 服务暂时不可用。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: 服务不可用
                id: '1'
        '504':
          description: 网关超时 - 请求超时。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: 网关超时
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    TokenTransfer:
      type: object
      properties:
        signature:
          type: string
          description: Base58编码的交易签名。
          example: >-
            5GEX7Q3X5Q8yJGbKYoR7mtzQmG8tpoEwzjPgqVmn3y5xg3yKwqXcDdN5YVcc9V6vA4TuH5iM6FHRVhTxvz4AX2zG
        slot:
          type: integer
          description: 包含交易的插槽号。
          example: 315073428
        blockTime:
          type: integer
          description: 块的Unix时间戳（秒）。
          example: 1736159420
        type:
          type: string
          description: 解析的转移类型。
          enum:
            - transfer
            - mint
            - burn
            - wrap
            - unwrap
            - changeOwner
            - withdrawWithheldFee
          example: transfer
        fromUserAccount:
          oneOf:
            - type: string
            - type: 'null'
          description: 发送代币的钱包地址，或在没有发送者时为null。此字段始终存在。
          example: 7hPhaUpydpvm8wtiS3k4LPZKUmivQRs7YQmpE1hFshHx
        toUserAccount:
          oneOf:
            - type: string
            - type: 'null'
          description: 接收代币的钱包地址，或在没有接收者时为null。此字段始终存在。
          example: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
        fromTokenAccount:
          type: string
          description: 源代币账户。在不适用时省略，例如原生SOL转账。
          example: HcvK3EJ74iM9g11cUgsaPvLSrhCvCwcrWxBNd87LsC1x
        toTokenAccount:
          type: string
          description: 目标代币账户。在不适用时省略，例如原生SOL转账。
          example: CBcYniR9G9CN3zGMnwNE4SWbqkYWvCFVreEob9xHnQCY
        mint:
          type: string
          description: >-
            代币铸造地址。原生SOL使用So11111111111111111111111111111111111111111；当solMode为separate时，WSOL使用So11111111111111111111111111111111111111112。
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        amount:
          type: string
          description: 以字符串形式表示的原始转账金额，以保持精度。对于收取费用的Token-2022转账，这是接收方收到的金额。
          example: '2500000'
        feeAmount:
          type: string
          description: >-
            由Token-2022转账费用扩展暂扣的转账费用。仅在收取费用的转账中存在。对于收取费用的转账，来源被扣除金额加上feeAmount，而接收方被计入金额。
          example: '13450000'
        decimals:
          type: integer
          description: 代币小数位数。原生SOL使用9。
          example: 6
        uiAmount:
          type: string
          description: 人类可读的数量。
          example: '2.5'
        feeUiAmount:
          type: string
          description: 人类可读的费用数量。仅当 feeAmount 存在时才出现。
          example: '134.5'
        confirmationStatus:
          type: string
          description: 确认状态。
          enum:
            - finalized
            - confirmed
          example: finalized
        transactionIdx:
          type: integer
          description: 区块中交易的索引。
          example: 35
        instructionIdx:
          type: integer
          description: 交易中指令的索引。
          example: 1
        innerInstructionIdx:
          type: integer
          description: 内嵌指令中的索引。当转账为顶层时为零。
          example: 0
      required:
        - signature
        - slot
        - blockTime
        - type
        - fromUserAccount
        - toUserAccount
        - mint
        - amount
        - decimals
        - uiAmount
        - confirmationStatus
        - transactionIdx
        - instructionIdx
        - innerInstructionIdx
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: JSON-RPC协议版本。
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: 错误代码。
              example: -32602
            message:
              type: string
              description: 错误信息。
            data:
              type: object
              description: 有关错误的附加数据。
        id:
          type: string
          description: 与请求匹配的标识符。
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: 您的Helius API密钥。您可以在[仪表板](https://dashboard.helius.dev/api-keys)中免费获取一个。

````