Query total balance on all supported chains by user address

Description

  • Method: HTTPS GET

  • Encoding: UTF-8

  • Path: https://api.blockin.ai/v2/user/total_balance

  • Description: Query total balance on all supported chains by user address

Request Header

Parameter
Required
Type
Description

Content-Type

Y

String

application/json

AccessKey

Y

String

1bdb01c947c54919b64d1fc6794atest

Request Parameters

Parameter
Required
Type
Description

address

Y

String

User's address

Response

Public Response

Parameter
Required
Type
Description

success

Y

Boolean

Success Boolean

data

N

Object

Response object

error_code

N

String

Error code

error_msg

N

String

Error message

Response Content

Parameter
Required
Type
Description

total_usd_value

Y

BigDecimal

Price of all assets in a user's account

chain_list

Y

LIst<TotalBalanceDetail>

List of TotalBalanceDetail

TotalBalanceDetail Content

Parameter
Required
Type
Description

chain_abbr

Y

String

Chain's abbreviated

chain_id

Y

String

Chain's communityId

chain_name

Y

String

Chain's id

logo_url

Y

String

URL of the chain's logo image

native_token

Y

String

Chain's native token address

wrapped_token_address

Y

String

Chain's wrapped token address

usd_value

Y

BigDecimal

User's usd value on this chain

Request Sample

curl -H "Content-Type:application/json" -H "AccessKey:1bdb01c947c54919b64d1fc6794atest" -X GET "https://api.blockin.ai/v2/user/total_balance?address=0x5641519cc28def80d631baa28b949f17a6a22ad1&chain_name=all"

Successful Response Sample

{
    "success": true,
    "data": {
        "total_usd_value": 4323912.698718680063828265045139669684352,
        "chain_list": [
            {
                "chain_abbr": "bsc",
                "chain_id": 56,
                "chain_name": "BSC",
                "native_token": "BNB",
                "logo_url": "https://www.blockin.ai/image/chain/56.png",
                "wrapped_token_address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
                "usd_value": 1724742.20551841146061748953354000
            },
            {
                "chain_abbr": "eth",
                "chain_id": 1,
                "chain_name": "Ethereum",
                "native_token": "ETH",
                "logo_url": "https://www.blockin.ai/image/chain/1.png",
                "wrapped_token_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "usd_value": 2599170.493200268603210775511599669684352
            }
        ]
    },
    "error_code": null,
    "error_msg": null
}

Last updated