Query historical assets

Description

  • Method:HTTPS POST

  • Encoding: UTF-8

  • Path: https://api.blockin.ai/v2/mirror/user/chain_assets

  • Description: Query historical assets(including token list and protocol portfolios) on one chain by chain name, user address and mirror time or block height.

Request Header

Parameter
Required
Type
Description

Content-Type

Y

String

application/json

AccessKey

Y

String

1bdb01c947c54919b64d1fc6794atest

Request Parameters

Parameter
Required
Type
Description

mirror_time

N

Long

Historical timestamp you want to query. Mirror time needs to be accurate to the second.(Either block number or mirror time is required)

block_height

N

Long

Historical block height you want to query.(Either block number or mirror time is required)

chain_name

Y

String

Chain's name, only support single chain's name (abbr or full name). eg: eth,Ethereum. Enumeration

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

mirror_time

Long

Y

Historical timestamp(seconds) that you want to query.

chain_block

Map

N

The block height of the querying chains in response data.

tokens

List

Y

Token list data. Like this token_list

protocols

List

Y

Protocol portfolios data. Like this protocol_list

Request Sample

curl --request POST --url https://www.blockin.ai/v2/mirror/user/chain_assets --header 'AccessKey: 1bdb01c947c54919b64d1fc6794atest' --header 'content-type: application/json' --data '{ "chain_name": "eth", "mirror_time": 1688019180, "block_height": null, "address": "0x4d0e439ba905eb39aee88097433add619cf5257b" }'

Successful Response Sample

{
    "success": true,
    "data": {
         "mirror_time": 1688019180,
          "chain_block": {
            "BSC": 29517415
        },         
        "tokens":[...],
        "protocols":[...]
    },
    "error_code": null,
    "error_msg": null
}

Last updated