Retrieve ERC20 token balance

How to retrieve the token balances for a wallet (ERC20 standard).

1. Get all token balances by wallet id

Request Endpoint: reference

GET /api/wallets/{walletId}/balance/tokens
ParameterParam TypeDescriptionData TypeMandatory
{walletId}PathThe ID of the walletStringโœ…

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
ParameterParam TypeDescriptionData TypeMandatory
{secretType}PathIndication on which chain the balance should be fetchedStringโœ…
{walletAddress}PathThe address of the walletStringโœ…

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

Request Endpoint: reference

GET /api/wallets/{walletId}/balance/tokens/{token}
ParameterParam TypeDescriptionData TypeMandatory
{walletId}PathThe ID of the walletStringโœ…
{token}PathAddress of the token (contract) to fetch the balance forStringโœ…

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}
ParameterParam TypeDescriptionData TypeMandatory
{secretType}PathIndication on which chain the balance should be fetchedStringโœ…
{walletAddress}PathThe address of the walletStringโœ…
{token}PathAddress of the token (contract) to fetch the balance forStringโœ…

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)"
    }
}