openapi: 3.0.3
info:
  title: FastNEAR API - V1 Account FT
  version: 3.0.3
  description: Fetch an account's fungible token balance rows, each with contract ID, balance, and last-update block height.
paths:
  /v1/account/{account_id}/ft:
    get:
      description: Fetch an account's fungible token balance rows, each with contract ID, balance, and last-update block height.
      operationId: account_ft_v1
      parameters:
        - description: NEAR account ID to inspect.
          example: here.tg
          in: path
          name: account_id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              example:
                account_id: here.tg
                tokens:
                  - balance: "1000000000000000000000000"
                    contract_id: wrap.near
                    last_update_block_height: null
              schema:
                $ref: "#/components/schemas/V1FtResponse"
          description: Indexed fungible token rows for the requested account
        "400":
          content:
            application/json:
              schema:
                type: string
          description: Bad Request
        "403":
          content:
            text/plain:
              example: Invalid API key
              schema:
                type: string
          description: The supplied API key was not recognized.
        "500":
          content:
            application/json:
              schema:
                type: string
          description: Internal Server Error
      summary: Lookup indexed fungible token rows for an account
      tags:
        - fungible-tokens
servers:
  - description: Mainnet
    url: https://api.fastnear.com
  - description: Testnet
    url: https://test.api.fastnear.com
security:
  - {}
  - BearerAuth: []
  - ApiKeyAuth: []
components:
  schemas:
    TokenRow:
      additionalProperties: false
      properties:
        balance:
          nullable: true
          type: string
        contract_id:
          type: string
        last_update_block_height:
          format: uint64
          minimum: 0
          nullable: true
          type: integer
      required:
        - contract_id
        - last_update_block_height
        - balance
      type: object
    V1FtResponse:
      additionalProperties: false
      properties:
        account_id:
          type: string
        tokens:
          items:
            $ref: "#/components/schemas/TokenRow"
          type: array
      required:
        - account_id
        - tokens
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: FastNEAR API key as the `apiKey` query parameter. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history.
      in: query
      name: apiKey
      type: apiKey
    BearerAuth:
      description: "FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs."
      scheme: bearer
      type: http
