Retrieve ERC20 token balance
How to retrieve the token balances for a wallet (ERC20 standard).
1. Get all token balances by wallet id
id
Request Endpoint: reference
GET /api/wallets/{walletId}/balance/tokens
Parameter | Param Type | Description | Data Type | Mandatory |
---|---|---|---|---|
{walletId} | Path | The ID of the wallet | String | ✅ |
Request Example
GET /api/wallets/f21dc1e5-4253-487e-8927-3b5247437f99/balance/tokens
Response Body
{
"success": true,
"result": [
{
"tokenAddress": "0xbe791e0e74fcc428ea7e01fbc754ef40a8e290e7",
"rawBalance": "10000000",
"balance": 10.0,
"decimals": 6,
"symbol": "USDC",
"type": "ERC20",
"transferable": true,
"name": "USD Coin (PoS)",
"possibleSpam": false
}
]
}
2. Get all token balances by blockchain and wallet address
Request Endpoint: reference
GET /api/wallets/{secretType}/{walletAddress}/balance/tokens
Parameter | Param Type | Description | Data Type | Mandatory |
---|---|---|---|---|
{secretType} | Path | Indication on which chain the balance should be fetched | String | ✅ |
{walletAddress} | Path | The address of the wallet | String | ✅ |
Request Example
GET /api/wallets/MATIC/0x8fC378e105F80d340489B28519cfEDaF8ecE1944/balance/tokens
Response Body
{
"success": true,
"result": [
{
"tokenAddress": "0xbe791e0e74fcc428ea7e01fbc754ef40a8e290e7",
"rawBalance": "10000000",
"balance": 10.0,
"decimals": 6,
"symbol": "USDC",
"type": "ERC20",
"transferable": true,
"name": "USD Coin (PoS)",
"possibleSpam": false
}
]
}
3. Get a specific token balance by wallet id
and token address
id
and token addressRequest Endpoint: reference
GET /api/wallets/{walletId}/balance/tokens/{token}
Parameter | Param Type | Description | Data Type | Mandatory |
---|---|---|---|---|
{walletId} | Path | The ID of the wallet | String | ✅ |
{token} | Path | Address of the token (contract) to fetch the balance for | String | ✅ |
Request Example
GET /api/wallets/f21dc1e5-4253-487e-8927-3b5247437f99/balance/tokens/0xbE791e0e74FcC428Ea7e01FBC754eF40A8e290E7
Response Body
{
"success": true,
"result": {
"tokenAddress": "0xbE791e0e74FcC428Ea7e01FBC754eF40A8e290E7",
"rawBalance": "10000000",
"balance": 10.0,
"decimals": 6,
"symbol": "USDC",
"type": "ERC20",
"transferable": true,
"name": "USD Coin (PoS)"
}
}
4. Get a specific token balance by blockchain, wallet address, and token address
Request Endpoint: reference
GET /api/wallets/{secretType}/{walletAddress}/balance/tokens/{token}
Parameter | Param Type | Description | Data Type | Mandatory |
---|---|---|---|---|
{secretType} | Path | Indication on which chain the balance should be fetched | String | ✅ |
{walletAddress} | Path | The address of the wallet | String | ✅ |
{token} | Path | Address of the token (contract) to fetch the balance for | String | ✅ |
Request Example
GET /api/wallets/MATIC/0x8fC378e105F80d340489B28519cfEDaF8ecE1944/balance/tokens/0xbE791e0e74FcC428Ea7e01FBC754eF40A8e290E7
Response Body
{
"success": true,
"result": {
"tokenAddress": "0xbE791e0e74FcC428Ea7e01FBC754eF40A8e290E7",
"rawBalance": "10000000",
"balance": 10.0,
"decimals": 6,
"symbol": "USDC",
"type": "ERC20",
"transferable": true,
"name": "USD Coin (PoS)"
}
}
Updated 4 months ago