Get all wallet balances [Private]
View available user wallet balances in terms of available assets.
Method name: | /v2/balance |
Request type: | POST |
To call private endpoints, you need to get a JWT token or an API key for authentication.
Here you can learn in detail how to successfully authenticate.
View available user wallet balances in terms of available assets.
Balances are also presented in terms of the current available balance of funds, funds in reserve (in processing), hold balance (temporarily unavailable for use), reference balance (if applicable), and the balance of funds currently in settlement.
The deposit address and memo tag (if applicable) are returned along with the balance for the crypto assets if they were generated previously.
Exemplary request
const url = BASE_URL;
const path = "/v2/balance";
const body = {
walletId: "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5",
assets: ["USDT", "BTC"]
};
const options = {
method: "POST",
headers: {
accept: "application/json",
"Content-Type": "application/json",
"Authorization": `Bearer ${data.accessToken}` // data.accessToken - generated a JWT token via /v2/auth/login.
},
body: JSON.stringify(body),
};
fetch(url + path, options)
.then((response) => response.json())
.then((showResponse) => console.log(showResponse.data));
import requests
url = BASE_URL
path = "/v2/balance"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer " + data.accessToken # data.accessToken - generated a JWT token via /v2/auth/login.
}
body = {
"walletId": "1f44b1c7-9fd4-4d20-b9a4-7aca3646d0d5",
"assets": ["USDT", "BTC"]
}
request = requests.post(url + path, headers=headers, json=body)
print(request.json())
How to call private endpoints here
Response
{
"data": [
{
"balance": "0", // Account balance.
"asset": "BTC", // Asset balance.
"holdBalance": "0", // Balance of funds in processing.
"lockBalance": "0", // Balance of funds are blocked according to AML policy.
"referralBalance": "0", // Balance from the referral system.
"depositAddress": {
"BTC": {
"address": "bc1q4curzl6agt0l3zvc3ermrzuesm2f9nevm9rll0", // Deposit address.
"memo": null // Memo of the cryptocurrency withdrawal address.
}
}
},
{
"balance": "0.64",
"asset": "USDT",
"holdBalance": "0",
"lockBalance": "0",
"referralBalance": "0",
"depositAddress": {
"TRX": { "address": "TW6fBsVChypHoN3xFXpizHFJNQa7b1wRWc", "memo": null }
}
}
]
}
Updated about 2 months ago