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

# GetBalance

> Get native or token balance for a wallet address.

Returns the balance for a wallet address—native token or a specific ERC-20/SPL token. Balance is a string for precision; use the token’s decimals to convert (e.g. ETH 18, USDC 6, SOL 9).


## OpenAPI

````yaml /openapi.json POST /v1/getBalance
openapi: 3.1.0
info:
  title: mpcvault.platform.v1
  version: 0.0.1
servers:
  - url: https://api.mpcvault.com
    description: MPCVault API Server
security:
  - ApiKeyAuth: []
tags:
  - name: mpcvault.platform.v1.PlatformAPI
paths:
  /v1/getBalance:
    post:
      tags:
        - mpcvault.platform.v1.PlatformAPI
      summary: GetBalance
      description: GetBalance returns the details of a asset balance.
      operationId: mpcvault.platform.v1.PlatformAPI.GetBalance
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/mpcvault.platform.v1.GetBalanceRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mpcvault.platform.v1.GetBalanceResponse'
components:
  schemas:
    mpcvault.platform.v1.GetBalanceRequest:
      type: object
      properties:
        networkType:
          $ref: '#/components/schemas/mpcvault.platform.v1.NetworkType'
          description: |-
            required:true
            symbol_value:"1"
            default:null
            comment:network_type is the type of the network.
        chainId:
          $ref: '#/components/schemas/google.protobuf.Int64Value'
          description: |-
            symbol_value:"137"
            default:null
            comment chain_id is the chain id of the network.
        walletAddress:
          type: string
          title: wallet_address
          description: |-
            required:true
            symbol_value:"8HrKVJeFNGSJ2T2wSU6MxfMvua2MYgwH1FbRsdfrgthj"
            default:null
            comment:wallet_address this is the wallet address.
        tokenAddress:
          $ref: '#/components/schemas/google.protobuf.StringValue'
          description: >-
            symbol_value:"0x71C7656EC7ab88bd32g47dgdhhssq245f6d8976F"

            default:null

            comment:token_address this is the token address,if not set, it will
            return the balance of the native token.
      additionalProperties: false
    mpcvault.platform.v1.GetBalanceResponse:
      type: object
      properties:
        balance:
          type: string
          title: balance
          description: |-
            symbol_value:0.12128
            comment:The balance is in the smallest denomination.
        error:
          $ref: '#/components/schemas/mpcvault.platform.v1.Error'
          description: comment:The error is null when success.
      additionalProperties: false
    mpcvault.platform.v1.NetworkType:
      type: string
      title: NetworkType
      enum:
        - NETWORK_TYPE_UNKNOWN
        - NETWORK_TYPE_EVM
        - NETWORK_TYPE_BITCOIN
        - NETWORK_TYPE_TRON
        - NETWORK_TYPE_APTOS
        - NETWORK_TYPE_SUI
        - NETWORK_TYPE_SOLANA
        - NETWORK_TYPE_TON
        - NETWORK_TYPE_STELLAR
    google.protobuf.Int64Value:
      oneOf:
        - type: string
        - type: number
      description: |-
        Wrapper message for `int64`.

         The JSON representation for `Int64Value` is JSON string.

         Not recommended for use in new APIs, but still useful for legacy APIs and
         has no plan to be removed.
    google.protobuf.StringValue:
      type: string
      description: |-
        Wrapper message for `string`.

         The JSON representation for `StringValue` is JSON string.

         Not recommended for use in new APIs, but still useful for legacy APIs and
         has no plan to be removed.
    mpcvault.platform.v1.Error:
      type: object
      allOf:
        - properties:
            message:
              type: string
              title: message
        - oneOf:
            - type: object
              properties:
                executeSigningRequestsErrorCode:
                  $ref: >-
                    #/components/schemas/mpcvault.platform.v1.ExecuteSigningRequestsErrorCode
              title: execute_signing_requests_error_code
              required:
                - executeSigningRequestsErrorCode
            - type: object
              properties:
                serviceErrorCode:
                  $ref: '#/components/schemas/mpcvault.platform.v1.ServiceErrorCode'
              title: service_error_code
              required:
                - serviceErrorCode
      additionalProperties: false
    mpcvault.platform.v1.ExecuteSigningRequestsErrorCode:
      type: string
      title: ExecuteSigningRequestsErrorCode
      enum:
        - EXECUTE_SIGNING_REQUESTS_ERROR_CODE_UNSPECIFIED
        - EXECUTE_SIGNING_REQUESTS_ERROR_CODE_INSUFFICIENT_FUNDS
        - EXECUTE_SIGNING_REQUESTS_ERROR_CODE_ALREADY_DENIED
    mpcvault.platform.v1.ServiceErrorCode:
      type: string
      title: ServiceErrorCode
      enum:
        - SERVICE_ERROR_CODE_UNSPECIFIED
        - SERVICE_ERROR_CODE_ORG_SUBSCRIBED_PLAN_LIMIT_EXCEED
        - SERVICE_ERROR_CODE_ORG_SUBSCRIBED_PLAN_EXPIRED
        - SERVICE_ERROR_CODE_ORG_SUBSCRIBED_PLAN_NOT_SUPPORT
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-mtoken
      description: Your API token. Required for all API requests.

````