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

# トークン残高の履歴を取得

> 過去のタイムスタンプ、日時、またはスロットで特定のトークンまたはネイティブSOLのウォレット残高を取得します。

各リクエストには**100クレジット**かかります。

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

<ParamField body="wallet" type="string" required default="GQUtvPx89ZNCwmvQqFmH59bJcU8fW8siETpaxod7Aydz">
  Solanaウォレットアドレス（base58エンコード）
</ParamField>

<ParamField body="mint" type="string" required default="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v">
  トークンミントアドレス。ネイティブSOLの場合は`So11111111111111111111111111111111111111111`を使用します。
</ParamField>

<ParamField body="time" type="number" default="1750000000">
  Unixタイムスタンプ（**秒**）。この時点での残高を返します。`time`、`datetime`、または`slot`のいずれかを正確に1つ指定してください。
</ParamField>

<ParamField body="datetime" type="string">
  日時文字列。受け入れられる形式：`2025-01-10`（UTC真夜中）、`2025-01-10 19:20:00`、
  `2025-01-10T19:20:00`（秒はオプション）、または明示的なタイムゾーンを持つもの
  (`2025-01-10T19:20:00Z`、`...+02:00`)。**明示的なタイムゾーンが含まれていない限りUTCとして解釈されます。** `time`、`datetime`、または`slot`のいずれかを正確に1つ指定してください。
</ParamField>

<ParamField body="slot" type="number">
  スロット番号。このスロットでの残高を返します。正確かつ決定論的です。`time`、`datetime`、または`slot`のいずれかを正確に1つ指定してください。
</ParamField>


## OpenAPI

````yaml ja/openapi/wallet-api/openapi.yaml GET /v1/wallet/{wallet}/balance-at
openapi: 3.0.3
info:
  title: Wallet API
  description: |
    Solanaのウォレットデータ（残高、取引履歴、転送、ID情報）を照会するための高性能なREST APIです。

    ## 認証

    すべてのリクエストには、以下のいずれかとして渡された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: ウォレットIDと既知のアドレスを検索
  - name: Balances
    description: トークンとNFTの残高を照会
  - name: History
    description: 取引履歴と残高の変動
  - name: Transfers
    description: トークン転送の活動
  - name: Funding
    description: ウォレットの資金に関する情報
paths:
  /v1/wallet/{wallet}/balance-at:
    get:
      tags:
        - Balances
      summary: 履歴残高を取得
      description: >
        指定された過去の時点での特定のトークン（またはネイティブSOL）のウォレット残高を取得します。Unixタイムスタンプ、日付文字列、またはスロット番号で指定します。


        バランスは、リクエストされた時点**以前またはその時点で**トークンを含むウォレットの最新の取引から読み取られます—でのポストトランザクションバランスで、次のトランザクションまで保持されています。推定値ではなく正確な値です。


        **正確に一つ**の`時間`、`日付時間`、または`スロット`を提供する必要があります。明示的なタイムゾーンがない場合の`日付時間`は
        **UTC** として解釈されます。正確で決定的な結果を得るには、`スロット`を使用してください —
        バリデーターが報告するブロック時間は数秒ずれる可能性があります。


        ネイティブSOLの場合、疑似ミント`So11111111111111111111111111111111111111111`を`ミント`として渡してください。


        リクエストされた時点以前の一致するアクティビティがないウォレットは **エラーではありません** -
        エンドポイントは`200`を返し、`balance: "0"`と`asOf: null`を示します。


        `balance`と`balanceRaw`は大きな値の精度損失を防ぐために **文字列**として返されます。
      operationId: getWalletBalanceAt
      parameters:
        - $ref: '#/components/parameters/WalletAddress'
        - name: mint
          in: query
          required: true
          description: >-
            トークンミントアドレス。ネイティブSOLの場合は`So11111111111111111111111111111111111111111`を使用してください。
          schema:
            type: string
            default: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        - name: time
          in: query
          description: >-
            **秒**単位のUnixタイムスタンプ。この時間におけるバランスを返します。`時間`、`日付時間`、または`スロット`のいずれか1つのみを提供してください。
          schema:
            type: integer
            default: 1750000000
            minimum: 0
          example: 1736536800
        - name: datetime
          in: query
          description: >
            日付時間文字列。受け入れられる形式: `2025-01-10`（UTC真夜中）、`2025-01-10
            19:20:00`、`2025-01-10T19:20:00`（秒はオプション）、または明示的なタイムゾーン付き（`2025-01-10T19:20:00Z`,
            `...+02:00`）。**明示的なタイムゾーンがない場合はUTCとして解釈されます。**
            `時間`、`日付時間`、または`スロット`のいずれか1つのみを提供してください。
          schema:
            type: string
          example: '2025-01-10 19:20:00'
        - name: slot
          in: query
          description: >-
            スロット番号。このスロット時点でのバランスを返します。正確で決定的です。`時間`、`日付時間`、または`スロット`のいずれか1つのみを提供してください。
          schema:
            type: integer
            minimum: 0
          example: 313000000
      responses:
        '200':
          description: 履歴残高を正常に取得しました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceAtResponse'
        '400':
          description: >-
            `ミント`が不足している; 無効なミント; `時間`/`日付時間`/`スロット`の0または複数; 非整数`時間`/`スロット`;
            または解析不能な`日付時間`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Exactly one of time, datetime, or slot must be provided
                code: 400
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: パス内の無効なウォレットアドレス
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          description: Upstream RPC error or timeout. Retryable with exponential backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: UPSTREAM_ERROR
                code: 502
                details: Upstream RPC request failed. Please retry.
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:
    BalanceAtResponse:
      type: object
      properties:
        wallet:
          type: string
          description: 問い合わせたウォレットアドレスのエコー
          example: 5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9
        mint:
          type: string
          description: 問い合わせたミントのエコー（ネイティブの場合はSOL疑似ミント）
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        isNative:
          type: boolean
          description: 結果がネイティブのSOLかどうか
          example: false
        balance:
          type: string
          description: >-
            人間が読める形式での金額（小数表記）**文字列**（大きな金額で精度が失われないようにするため、数値ではありません）。末尾のゼロは削除されます。
          example: '284961463.392936'
        balanceRaw:
          type: string
          description: 最小単位での正確な金額（SOLの場合はラメポート単位）、文字列として
          example: '284961463392936'
        decimals:
          type: integer
          description: トークンの小数点以下の桁数（SOLの場合9）
          example: 6
        requested:
          type: object
          description: クエリのエコー。`日時`が使用された場合、`時間`も解決済みのエポック秒数で設定され、UTC解釈が表示されます。
          properties:
            time:
              type: integer
              nullable: true
              description: エポック秒としてのリクエストされた時間（`日時`が使用された場合も設定）
              example: 1736536800
            slot:
              type: integer
              nullable: true
              description: '`スロット`が使用された際のリクエストされたスロット'
              example: null
            datetime:
              type: string
              nullable: true
              description: '`日時`が使用された際の元の日時文字列'
              example: null
          required:
            - time
            - slot
            - datetime
        asOf:
          type: object
          nullable: true
          description: >-
            残高が読み取られた取引。リクエストされた時点以前またはその時点でウォレットに一致する取引がなかった場合は **`null`** —
            残高は本当に`0`（ウォレットがその時点までトークンを保持していなかった）、エラーではありません。
          properties:
            slot:
              type: integer
              description: 取引のスロット
              example: 313000000
            blockTime:
              type: integer
              nullable: true
              description: 取引のブロック時間（Unix秒、nullの場合もあります）
              example: 1736536794
            signature:
              type: string
              description: 取引シグネチャ
              example: 5Cyy7Mh9nVgFq3T8wJp2sKxR4dE6bA1uZoNcLrXmYqUpon
          required:
            - slot
            - signature
      required:
        - wallet
        - mint
        - isNative
        - balance
        - balanceRaw
        - decimals
        - requested
        - asOf
    Error:
      type: object
      properties:
        error:
          type: string
          description: エラーメッセージ
          example: Invalid wallet address
        code:
          type: integer
          description: HTTPステータスコード
          example: 400
        details:
          type: string
          description: 追加のエラー詳細
          example: '''invalid-address'' is not a valid Solana address'
      required:
        - error
        - code
  responses:
    Unauthorized:
      description: APIキーが不足しているか無効です
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: API key required. Pass via ?api-key=xxx or X-Api-Key header
            code: 401
    RateLimited:
      description: レート制限が超過しました。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: RATE_LIMIT_EXCEEDED
            code: 429
            details: Too many requests. Retry after 2 seconds.
    InternalError:
      description: 一時的なサーバーエラー。指数バックオフで再試行可能です。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL_ERROR
            code: 500
            details: An unexpected error occurred. Please retry.
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: クエリパラメータとして渡されるAPIキー
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: リクエストヘッダーで渡されるAPIキー

````