You can use this API to retrieve a list of all tokens and their respective balances associated with a user's wallet address on the desired blockchain
Typescript (SDK) Node.js (Axios) Bash (cURL)
Copy const walletDetails = await rango.balance({
blockchain: "BSC",
address: "0xeb2629a2734e272bcc07bda959863f316f4bd4cf"
})
Copy const response = await axios.get('https://api.rango.exchange/basic/balance', {
params: {
'blockchain': 'BSC',
'address': '0xeb2629a2734e272bcc07bda959863f316f4bd4cf',
'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
}
});
Copy curl --request GET \
--url 'https://api.rango.exchange/basic/balance?blockchain=BSC&address=0xeb2629a2734e272bcc07bda959863f316f4bd4cf&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'
API Definition SDK Models (Typescript)
blockchain
* String
Description: The desired blockchain.
address
* String
Description: User wallet address for the desired blockchain.
Copy export type WalletAddress = {
blockchain: string
address: string
};
API Definition SDK Models (Typescript) Sample Response
wallets
Description: List of wallet assets
Copy export type WalletDetailsResponse = {
wallets: WalletDetail[]
}
export type WalletDetail = {
failed: boolean
blockChain: string
address: string
balances: AssetAndAmount[] | null
explorerUrl: string
}
export type AssetAndAmount = {
amount: Amount
asset: Asset
}
export type Amount = {
amount: string
decimals: number
}
export type Asset = {
blockchain: string
address: string | null
symbol: string
}
Copy {
"wallets": [
{
"blockChain": "BSC",
"address": "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
"failed": false,
"explorerUrl": "https://bscscan.com/address/0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
"balances": [
{
"asset": {
"blockchain": "BSC",
"symbol": "BNB",
"address": null
},
"amount": {
"amount": "911814661733430075",
"decimals": 18
}
}
]
}
]
}