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

# 錢包 - 餘額變動

> 取得錢包餘額變動紀錄，支援篩選和分頁



## OpenAPI

````yaml /zh-Hant/api-reference/openapi-data-zh-Hant.yaml GET /v2/wallet/{chain}/{walletAddress}/balance-updates
openapi: 3.1.0
info:
  title: Services API
  description: Services API
  contact:
    name: AI
    email: ai@sx.ai
  license:
    name: MIT
  version: '1.0'
servers:
  - url: https://api.chainstream.io
    description: Production
security:
  - bearer_auth: []
  - api_key_auth: []
tags:
  - name: Blockchain
    description: 區塊鏈相關操作
  - name: Token
    description: 代幣相關操作
  - name: Trade
    description: 交易相關操作
  - name: Wallet
    description: 錢包相關操作
  - name: Dex
    description: DEX 相關操作
  - name: Ranking
    description: 排行榜相關操作
  - name: DexPool
    description: DEX 池子相關操作
  - name: Watchlist
    description: 關注列表相關操作
  - name: KYT
    description: KYT 相關操作
  - name: Webhook
    description: Webhook 相關操作
  - name: RedPacket
    description: 紅包相關操作
  - name: IPFS
    description: IPFS 相關操作
  - name: DexScreener
    description: DexScreener 相關操作
paths:
  /v2/wallet/{chain}/{walletAddress}/balance-updates:
    get:
      tags:
        - Wallet
      summary: 錢包 - 餘額變動
      description: 取得錢包餘額變動紀錄，支援篩選和分頁
      operationId: get.balance.updates
      parameters:
        - name: chain
          in: path
          description: 支援網路列表中的鏈名稱
          required: true
          schema:
            $ref: '#/components/schemas/ChainSymbol'
          example: sol
        - name: walletAddress
          in: path
          description: 錢包地址
          required: true
          schema:
            type: string
          example: MJKqp326RZCHnAAbew9MDdui3iCKWco7fsK9sVuZTX2
        - name: cursor
          in: query
          description: 分頁游標
          required: false
          schema:
            type: string
          example: eyJpZCI6IjEyMyJ9
        - name: limit
          in: query
          description: 每頁回傳結果數量
          required: false
          schema:
            type: integer
            format: int64
            default: 20
          example: 20
        - name: direction
          in: query
          description: 分頁方向（next 或 prev）
          required: false
          schema:
            oneOf:
              - $ref: '#/components/schemas/PageDirection'
            default: next
          example: next
        - name: tokenAddress
          in: query
          description: 代幣地址
          required: false
          schema:
            type: string
          example: FBmHMoWzwJB3g9GCSNTn1ZyvgkuZs7c8GTgNDoJNpump
        - name: timeFrom
          in: query
          description: 開始時間戳（Unix 秒級時間戳）
          required: false
          schema:
            type: integer
            format: int64
          example: 1705312800000
        - name: timeTo
          in: query
          description: 結束時間戳（Unix 秒級時間戳）
          required: false
          schema:
            type: integer
            format: int64
          example: 1705399200000
        - name: type
          in: query
          description: 餘額類型篩選（SOL 為原生代幣，SPL 為代幣）
          required: false
          schema:
            $ref: '#/components/schemas/BalanceTokenType'
          example: SPL
        - name: changeType
          in: query
          description: 餘額變動方向篩選（INCREASE 或 DECREASE）
          required: false
          schema:
            $ref: '#/components/schemas/BalanceChangeType'
          example: INCREASE
      responses:
        '200':
          description: 成功回應
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageResponse_BalanceUpdate'
components:
  schemas:
    ChainSymbol:
      type: string
      description: Supported blockchain chains
      enum:
        - sol
        - eth
        - bsc
    PageDirection:
      type: string
      description: Pagination direction
      enum:
        - next
        - prev
    BalanceTokenType:
      type: string
      description: Balance token type
      enum:
        - SOL
        - SPL
    BalanceChangeType:
      type: string
      description: Balance change type
      enum:
        - INCREASE
        - DECREASE
    PageResponse_BalanceUpdate:
      type: object
      description: Generic pagination response
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            description: Balance update record
            required:
              - blockHash
              - blockHeight
              - blockTimestamp
              - transactionSignature
              - index
              - tokenAddress
              - tokenAccountAddress
              - accountOwnerAddress
              - preBalance
              - preBalanceInNative
              - preBalanceInUsd
              - postBalance
              - postBalanceInNative
              - postBalanceInUsd
              - balanceChange
              - balanceChangeInNative
              - balanceChangeInUsd
              - type
              - changeType
            properties:
              accountOwnerAddress:
                type: string
                description: 帳戶所有者錢包地址
              balanceChange:
                type: string
                description: 餘額變動量
              balanceChangeInNative:
                type: string
                description: 餘額變動量（原生代幣計）
              balanceChangeInUsd:
                type: string
                description: 餘額變動量（USD 計）
              blockHash:
                type: string
                description: 區塊雜湊
              blockHeight:
                type: integer
                format: int64
                description: 區塊高度
              blockSlot:
                type:
                  - integer
                  - 'null'
                format: int64
                description: 區塊 Slot 編號
              blockTimestamp:
                type: integer
                format: int64
                description: 區塊時間戳（毫秒）
              changeType:
                $ref: '#/components/schemas/BalanceChangeType'
                description: 餘額變動方向（INCREASE 或 DECREASE）
              index:
                type: integer
                format: int64
                description: 交易指令索引
              postBalance:
                type: string
                description: 交易後餘額
              postBalanceInNative:
                type: string
                description: 交易後餘額（原生代幣計）
              postBalanceInUsd:
                type: string
                description: 交易後餘額（USD 計）
              preBalance:
                type: string
                description: 交易前餘額
              preBalanceInNative:
                type: string
                description: 交易前餘額（原生代幣計）
              preBalanceInUsd:
                type: string
                description: 交易前餘額（USD 計）
              tokenAccountAddress:
                type: string
                description: 代幣帳戶地址
              tokenAddress:
                type: string
                description: 代幣合約地址
              transactionSignature:
                type: string
                description: 交易簽名
              type:
                $ref: '#/components/schemas/BalanceTokenType'
                description: 代幣類型（SOL 為原生代幣，SPL 為代幣）
          description: Page data
        endCursor:
          type:
            - string
            - 'null'
          description: Cursor for the end of current page
          example: eyJpZCI6ImVuZCJ9
        hasNext:
          type: boolean
          description: Whether there is a next page
          example: false
        hasPrev:
          type: boolean
          description: Whether there is a previous page
          example: false
        startCursor:
          type:
            - string
            - 'null'
          description: Cursor for the start of current page
          example: eyJpZCI6InN0YXJ0In0=
        total:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Total number of items matching the query (not just the current
            page).

            When `None`, the caller should treat it as unknown
            (backward-compatible).
          example: 564094
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    api_key_auth:
      type: apiKey
      in: header
      name: X-API-KEY

````