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

# getTokenAccounts

> Truy xuất tất cả tài khoản token SPL thuộc sở hữu của một địa chỉ ví, bao gồm số dư token, địa chỉ mint và siêu dữ liệu tài khoản, có hỗ trợ phân trang

## Tham số yêu cầu

<ParamField body="mint" type="string">
  Khóa địa chỉ mint.
</ParamField>

<ParamField body="owner" type="string">
  Khóa địa chỉ chủ sở hữu.
</ParamField>

<ParamField body="page" type="number">
  Trang kết quả cần trả về.
</ParamField>

<ParamField body="limit" type="number">
  Số lượng tài sản tối đa cần trả về.
</ParamField>

<ParamField body="cursor" type="string">
  Con trỏ dùng để phân trang.
</ParamField>

<ParamField body="before" type="string">
  Trả về các kết quả trước con trỏ được chỉ định.
</ParamField>

<ParamField body="after" type="string">
  Trả về các kết quả sau con trỏ được chỉ định.
</ParamField>

<ParamField body="options" type="object" />

<ParamField body="options.showZeroBalance" type="boolean">
  Nếu là true, hiển thị các tài khoản có số dư token bằng 0.
</ParamField>


## OpenAPI

````yaml vi/openapi/das-api/getTokenAccounts.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: Điểm cuối RPC Mainnet
  - url: https://devnet.helius-rpc.com
    description: Điểm cuối RPC Devnet
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getTokenAccounts
      description: Trả về danh sách tài khoản token cho một mint và chủ sở hữu nhất định.
      operationId: rpc
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Phiên bản của giao thức JSON-RPC.
                  default: '2.0'
                id:
                  type: string
                  description: ID dùng để nhận dạng yêu cầu.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getTokenAccounts
                  description: Tên của phương thức cần gọi.
                  default: getTokenAccounts
                params:
                  type: object
                  default:
                    owner: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                  properties:
                    mint:
                      type: string
                      description: Khóa địa chỉ mint.
                      example: string
                    owner:
                      type: string
                      description: Khóa địa chỉ của chủ sở hữu.
                      example: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                    page:
                      type: integer
                      description: Trang kết quả cần trả về.
                      example: 1
                    limit:
                      type: integer
                      description: Số lượng tài sản tối đa cần trả về.
                      example: 100
                    cursor:
                      type: string
                      description: Con trỏ dùng để phân trang.
                    before:
                      type: string
                      description: Trả về các kết quả trước con trỏ được chỉ định.
                    after:
                      type: string
                      description: Trả về các kết quả sau con trỏ được chỉ định.
                    options:
                      type: object
                      properties:
                        showZeroBalance:
                          type: boolean
                          description: >-
                            Nếu là true, hiển thị các tài khoản có số dư token
                            bằng 0.
      responses:
        '200':
          description: Phản hồi thành công
          content:
            application/json:
              schema:
                type: object
                properties:
                  last_indexed_slot:
                    type: integer
                    description: >-
                      Tất cả dữ liệu cho đến và bao gồm slot này đều được đảm
                      bảo đã được lập chỉ mục.
                    example: 365750752
                  total:
                    type: integer
                    description: Số lượng kết quả tìm thấy cho yêu cầu.
                    example: 2
                  limit:
                    type: integer
                    description: Số lượng kết quả tối đa được yêu cầu.
                    example: 100
                  cursor:
                    type: string
                    description: Con trỏ dùng để phân trang.
                  token_accounts:
                    type: array
                    description: Một mảng các tài khoản token.
                    items:
                      type: object
                      properties:
                        address:
                          type: string
                          description: Địa chỉ của tài khoản token.
                        mint:
                          type: string
                          description: Địa chỉ của tài khoản mint.
                        owner:
                          type: string
                          description: Địa chỉ của chủ sở hữu tài khoản token.
                        amount:
                          type: integer
                          description: Số lượng token trong tài khoản.
                        delegated_amount:
                          type: integer
                          description: Số lượng token được ủy quyền trong tài khoản.
                        frozen:
                          type: boolean
                          description: Cho biết tài khoản có bị đóng băng hay không.
                        burnt: false
        '400':
          description: >-
            Yêu cầu không hợp lệ. Máy chủ không thể hiểu yêu cầu do cú pháp
            không hợp lệ.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: -32602
                      message:
                        type: string
                        example: Tham số yêu cầu không hợp lệ.
                  id:
                    type: string
                    example: '1'
        '401':
          description: >-
            Chưa được xác thực. Máy khách phải tự xác thực để nhận phản hồi được
            yêu cầu.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: -32001
                      message:
                        type: string
                        example: >-
                          Xác thực không thành công. Khóa API bị thiếu hoặc
                          không hợp lệ.
                  id:
                    type: string
                    example: '1'
        '403':
          description: Bị cấm. Máy khách không có quyền truy cập vào nội dung.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: -32003
                      message:
                        type: string
                        example: Bạn không có quyền truy cập tài nguyên này.
                  id:
                    type: string
                    example: '1'
        '404':
          description: Không tìm thấy. Máy chủ không thể tìm thấy tài nguyên được yêu cầu.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: -32004
                      message:
                        type: string
                        example: Không tìm thấy tài nguyên được yêu cầu.
                  id:
                    type: string
                    example: '1'
        '429':
          description: >-
            Quá nhiều yêu cầu. Người dùng đã gửi quá nhiều yêu cầu trong một
            khoảng thời gian nhất định.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: -32029
                      message:
                        type: string
                        example: Đã vượt quá giới hạn tốc độ. Vui lòng thử lại sau.
                  id:
                    type: string
                    example: '1'
        '500':
          description: >-
            Lỗi máy chủ nội bộ. Máy chủ đã gặp phải một tình huống mà máy chủ
            không biết cách xử lý.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    example: '2.0'
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: -32000
                      message:
                        type: string
                        example: Đã xảy ra lỗi không mong muốn trên máy chủ.
                  id:
                    type: string
                    example: '1'
      security:
        - ApiKeyQuery: []
components:
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Khóa API Helius của bạn. Bạn có thể nhận khóa miễn phí trong [bảng điều
        khiển](https://dashboard.helius.dev/api-keys).

````