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

# getTokenSupply

> getTokenSupply trả về tổng nguồn cung của bất kỳ token SPL nào trên Solana dưới dạng số lượng thô, kèm số chữ số thập phân và chuỗi thân thiện với giao diện người dùng — dùng để tính vốn hóa thị trường và lượng token lưu hành.

## Tham số yêu cầu

<ParamField body="address" type="string" required>
  Địa chỉ mint token Solana cần truy xuất các chỉ số nguồn cung (mã định danh duy nhất của token SPL).
</ParamField>

<ParamField body="commitment" type="string">
  Mức commitment cho yêu cầu.

  * `confirmed`
  * `finalized`
  * `processed`
</ParamField>


## OpenAPI

````yaml vi/openapi/rpc-http/getTokenSupply.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API phân tích tokenomics để truy xuất các chỉ số về lượng lưu hành hiện tại
    và tổng nguồn cung của bất kỳ token SPL hoặc tài sản có thể thay thế nào
    trên blockchain Solana.
  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: getTokenSupply
      description: >
        Truy xuất các chỉ số toàn diện về nguồn cung token cho bất kỳ token SPL
        nào trên blockchain Solana.

        API tokenomics thiết yếu này cung cấp dữ liệu chính xác theo thời gian
        thực về nguồn cung token

        đang lưu hành, tổng lượng đúc và cấu hình chữ số thập phân. Đây là dữ
        liệu quan trọng đối với bảng điều khiển phân tích token,

        ứng dụng DeFi, phép tính vốn hóa thị trường, chỉ số giao thức và nền
        tảng giao dịch cần

        thông tin đáng tin cậy về nguồn cung token. Hỗ trợ mọi loại token SPL,
        bao gồm token có thể thay thế và

        token cộng đồng, với định dạng thập phân phù hợp để hiển thị chính xác.
      operationId: getTokenSupply
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Phiên bản giao thức JSON-RPC.
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Mã định danh duy nhất cho yêu cầu.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getTokenSupply
                  description: Tên của phương thức RPC cần gọi.
                  example: getTokenSupply
                  default: getTokenSupply
                params:
                  type: array
                  description: Các tham số để truy vấn nguồn cung token.
                  default:
                    - 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          Địa chỉ mint token Solana dùng để truy xuất các chỉ số
                          nguồn cung (mã định danh duy nhất của token SPL).
                        example: 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
                      - type: object
                        description: Đối tượng cấu hình.
                        properties:
                          commitment:
                            type: string
                            description: Mức cam kết cho yêu cầu.
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
      responses:
        '200':
          description: Đã truy xuất nguồn cung token thành công.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: Phiên bản giao thức JSON-RPC.
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Mã định danh khớp với yêu cầu.
                    example: '1'
                  result:
                    type: object
                    description: Thông tin ngữ cảnh và chi tiết nguồn cung token.
                    properties:
                      context:
                        type: object
                        description: Ngữ cảnh của phản hồi.
                        properties:
                          slot:
                            type: integer
                            description: Slot nơi dữ liệu được truy xuất.
                            example: 1114
                      value:
                        type: object
                        description: Chi tiết nguồn cung token.
                        properties:
                          amount:
                            type: string
                            description: >-
                              Tổng nguồn cung token Solana thô dưới dạng chuỗi
                              số nguyên chính xác, không có định dạng thập phân.
                            example: '100000'
                          decimals:
                            type: integer
                            description: >-
                              Số chữ số thập phân do token xác định để biểu diễn
                              nguồn cung chính xác.
                            example: 2
                          uiAmount:
                            type: number
                            description: >-
                              Nguồn cung token ở định dạng dễ đọc với định dạng
                              thập phân phù hợp (không còn được khuyến nghị).
                            example: 1000
                          uiAmountString:
                            type: string
                            description: >-
                              Dạng biểu diễn chuỗi chuẩn của tổng nguồn cung
                              token với số chữ số thập phân chính xác.
                            example: '1000'
              examples:
                responseExample:
                  value:
                    jsonrpc: '2.0'
                    id: '1'
                    result:
                      context:
                        slot: 1114
                      value:
                        amount: '100000'
                        decimals: 2
                        uiAmount: 1000
                        uiAmountString: '1000'
        '400':
          description: >-
            Yêu cầu không hợp lệ - Tham số yêu cầu không hợp lệ hoặc yêu cầu
            không đúng định dạng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Không được phép - Khóa API không hợp lệ hoặc bị thiếu.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Quá nhiều yêu cầu - Đã vượt quá giới hạn tốc độ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Lỗi máy chủ nội bộ - Đã xảy ra lỗi trên máy chủ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Dịch vụ không khả dụng - Dịch vụ tạm thời không khả dụng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Hết thời gian chờ cổng kết nối - Yêu cầu đã hết thời gian chờ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway timeout
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: Phiên bản giao thức JSON-RPC.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Mã lỗi.
              example: -32602
            message:
              type: string
              description: Thông báo lỗi.
            data:
              type: object
              description: Dữ liệu bổ sung về lỗi.
        id:
          type: string
          description: Mã định danh khớp với yêu cầu.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Khóa API Helius của bạn. Bạn có thể nhận miễn phí trong [bảng điều
        khiển](https://dashboard.helius.dev/api-keys).

````