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

# 获取钱包转账

> 分页检索Solana钱包地址的所有代币和SOL转账。

每次请求消耗 **100 点数**。

## 请求参数

<ParamField body="wallet" type="string" required default="GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz">
  Solana 钱包地址（base58 编码）
</ParamField>

<ParamField body="limit" type="number" default="50">
  返回的最大转账数量
</ParamField>

<ParamField body="cursor" type="string">
  上一个响应的分页游标
</ParamField>


## OpenAPI

````yaml zh/openapi/wallet-api/openapi.yaml GET /v1/wallet/{wallet}/transfers
openapi: 3.0.3
info:
  title: Wallet API
  description: |
    一个高性能的REST API，用于查询Solana钱包数据，包括余额、交易记录、转账和身份信息。

    ## 认证

    所有请求都需要通过以下方式传递API密钥：
    - 查询参数：`?api-key=YOUR_API_KEY`
    - 头：`X-Api-Key: YOUR_API_KEY`
  version: 1.0.0
  contact:
    name: API支持
    url: https://helius.dev
servers:
  - url: https://api.helius.xyz
    description: 生产服务器
security:
  - ApiKeyQuery: []
  - ApiKeyHeader: []
tags:
  - name: Identity
    description: 查找钱包身份和已知地址
  - name: Balances
    description: 查询代币和NFT余额
  - name: History
    description: 交易历史和余额变动
  - name: Transfers
    description: 代币转账活动
  - name: Funding
    description: 钱包资金信息
paths:
  /v1/wallet/{wallet}/transfers:
    get:
      tags:
        - Transfers
      summary: 获取代币转账
      description: |
        检索钱包的所有代币转账活动，包括发件人/收件人信息。
        按照时间倒序返回转账记录（最新的在前）。
      operationId: getWalletTransfers
      parameters:
        - $ref: '#/components/parameters/WalletAddress'
        - name: limit
          in: query
          description: 返回的转账记录最大数量
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: cursor
          in: query
          description: 从上一个响应中的分页游标
          schema:
            type: string
      responses:
        '200':
          description: 成功检索到转账历史
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransfersResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    WalletAddress:
      name: wallet
      in: path
      required: true
      description: Solana 钱包地址（base58 编码）
      schema:
        type: string
        pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
        default: GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz
      example: GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz
  schemas:
    TransfersResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Transfer'
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - data
        - pagination
    Transfer:
      type: object
      properties:
        signature:
          type: string
          description: 交易签名
          example: 5wHu1qwD7Jsj3xqWjdSEJmYr3Q5f5RjXqjqQJ7jqEj7jqEj7jqEj7jqEj7jqEj7jqE
        timestamp:
          type: integer
          description: Unix时间戳（以秒为单位）
          example: 1704067200
        direction:
          type: string
          enum:
            - in
            - out
          description: 相对于钱包的转账方向
          example: in
        counterparty:
          type: string
          description: 转账中的另一方（如果为 'in'，则为发送方；如果为 'out'，则为接收方）
          example: HXsKP7wrBWaQ8T2Vtjry3Nj3oUgwYcqq9vrHDM12G664
        mint:
          type: string
          description: 代币铸造地址（SOL 的地址为 So11111111111111111111111111111111111111112）
          example: So11111111111111111111111111111111111111112
        symbol:
          type: string
          nullable: true
          description: 已知的代币符号
          example: SOL
        amount:
          type: number
          description: 转账金额（人类可读，按小数位划分）
          example: 1.5
        amountRaw:
          type: string
          description: 以最小单位表示的原始转账金额（SOL 为 lamports，SPL 代币为原始代币金额）
          example: '1500000000'
        decimals:
          type: integer
          description: 代币小数位数
          example: 9
      required:
        - signature
        - timestamp
        - direction
        - counterparty
        - mint
        - amount
        - amountRaw
        - decimals
    Pagination:
      type: object
      properties:
        hasMore:
          type: boolean
          description: 是否有更多结果可用
          example: true
        nextCursor:
          type: string
          nullable: true
          description: 用于获取下一页结果的游标
          example: 5wHu1qwD7Jsj3xqWjdSEJmYr3Q5f5RjXqjqQJ7jqEj7jqEj7jqEj7jqEj7jqEj7jqE
      required:
        - hasMore
    Error:
      type: object
      properties:
        error:
          type: string
          description: 错误信息
          example: 无效的钱包地址
        code:
          type: integer
          description: HTTP状态代码
          example: 400
        details:
          type: string
          description: 附加错误详情
          example: '''invalid-address'' 不是有效的 Solana 地址'
      required:
        - error
        - code
  responses:
    BadRequest:
      description: 无效的请求参数
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 无效的钱包地址
            code: 400
            details: '''invalid-address''不是有效的Solana地址'
    Unauthorized:
      description: 缺少或无效的API密钥
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 需要API密钥。通过?api-key=xxx或X-Api-Key头传递
            code: 401
    RateLimited:
      description: 超出速率限制。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: RATE_LIMIT_EXCEEDED
            code: 429
            details: 请求过多。请在 2 秒后重试。
    InternalError:
      description: 临时服务器错误。可以使用指数退避重试。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL_ERROR
            code: 500
            details: 发生意外错误。请重试。
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: 作为查询参数传递的API密钥
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 在请求头中传递的API密钥

````