Retrieve native balance
How to retrieve the native balance of a wallet.
Retrieve the native balance of a wallet by:
- The wallet
id
- The blockchain and wallet address
1. Get native balance by wallet id
id
Read how to get all token balances by wallet
id
.
Request Endpoint: reference
GET /api/wallets/{walletId}/balance
Parameter | Param Type | Description | Data Type | Mandatory |
---|---|---|---|---|
{walletId} | Path | The ID of the wallet | String | ✅ |
Example Request
GET /api/wallets/f21dc1e5-4253-487e-8927-3b5247437f99/balance
Response Body
{
"success": true,
"result": {
"available": true,
"secretType": "MATIC",
"balance": 0.2,
"gasBalance": 0.2,
"symbol": "MATIC",
"gasSymbol": "MATIC",
"rawBalance": "200000000000000000",
"rawGasBalance": "200000000000000000",
"decimals": 18
}
}
2. Get native balance by blockchain and wallet address
Read how to get all token balances by by blockchain and wallet address.
Request Endpoint: reference
GET /api/wallets/{secretType}/{walletAddress}/balance
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 | ✅ |
Example Request
GET /api/wallets/MATIC/0x8fC378e105F80d340489B28519cfEDaF8ecE1944/balance
Response Body
{
"success": true,
"result": {
"available": true,
"secretType": "MATIC",
"balance": 0.2,
"gasBalance": 0.2,
"symbol": "MATIC",
"gasSymbol": "MATIC",
"rawBalance": "200000000000000000",
"rawGasBalance": "200000000000000000",
"decimals": 18
}
}
Updated 4 months ago