Skip to main content
POST
/
v1
/
wallets
/
{wallet_id}
/
rpc
curl --request POST \
  --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'privy-app-id: <privy-app-id>' \
  --data '{
  "method": "getBalance",
  "network": "MAINNET"
}'
{
  "method": "getBalance",
  "data": {
    "balance": "239170",
    "token_balances": {
      "btknrt1x9helfvakyz8y53lzwt2wjen7d30ft6skpu69eydvndqt5uxsr4q0zvugn": {
        "balance": "999999910",
        "token_metadata": {
          "raw_token_identifier": "316f9fa59db10472523f1396a74b33f362f4af50b079a2e48d64da05d38680ea",
          "token_public_key": "025bd027cd332a40e21f16cb6e9c6aee9ac11e3dff9508081b64fa8b27658b18b6",
          "token_name": "Merica",
          "token_ticker": "USA",
          "decimals": 6,
          "max_supply": "21000000000000"
        }
      }
    },
    "encoding": "hex"
  }
}
curl --request POST \
  --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'privy-app-id: <privy-app-id>' \
  --data '{
  "method": "getBalance",
  "network": "MAINNET"
}'
{
  "method": "getBalance",
  "data": {
    "balance": "239170",
    "token_balances": {
      "btknrt1x9helfvakyz8y53lzwt2wjen7d30ft6skpu69eydvndqt5uxsr4q0zvugn": {
        "balance": "999999910",
        "token_metadata": {
          "raw_token_identifier": "316f9fa59db10472523f1396a74b33f362f4af50b079a2e48d64da05d38680ea",
          "token_public_key": "025bd027cd332a40e21f16cb6e9c6aee9ac11e3dff9508081b64fa8b27658b18b6",
          "token_name": "Merica",
          "token_ticker": "USA",
          "decimals": 6,
          "max_supply": "21000000000000"
        }
      }
    },
    "encoding": "hex"
  }
}

Headers

privy-app-id
string
required
ID of your Privy app.
privy-authorization-signature
string
Request authorization signature. If multiple signatures are required, they should be comma separated.
privy-request-expiry
string
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the request must be processed.

Path Parameters

wallet_id
string
required
ID of the wallet to get.
These wallet methods are modeled after the Spark Wallet SDK. For more information about this wallet method, check out the Spark Wallet documentation.

Body

method
string
required
Available options: getBalance
network
string
required
Available options: MAINNET, REGTEST

Returns

method
enum<string>
required
Available options: getBalance
data
object
required
The balance and token holdings of the wallet.