SwapHistory

Get list of user's swap history

Get the user's swap history

GET https://api-prod.chainhop.net/chainhop/getHistory

Example: https://api-prod.chainhop.net/chainhop/getHistory?addr=0x725efda82634351deae8ca28f05df5a58938d5f6&page_size=1

Path Parameters

NameTypeDescription

addr*

String

User's wallet address

page_size*

Number

Number of the history list

next_page_token

String

Timestamp

{
   "history":[
      {
         "swap_id":"0xe4870c17eea34dd780ceb36e4e74723630403afea82c3f46539785a2b1f3ad8e",
         "amount_in":{
            "token":{
               "chain_id":"1",
               "symbol":"USDT",
               "address":"0xdAC17F958D2ee523a2206206994597C13D831ec7",
               "decimals":6,
               "name":"Tether USD",
               "logo_uri":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png"
            },
            "amount":"15000000"
         },
         "amount_out":{
            "token":{
               "chain_id":"56",
               "symbol":"USDT",
               "address":"0x55d398326f99059fF775485246999027B3197955",
               "decimals":18,
               "name":"Binance Pegged USDT",
               "logo_uri":"https://tokens.pancakeswap.finance/images/0x55d398326f99059fF775485246999027B3197955.png"
            },
            "amount":"14500000000000000000"
         },
         "create_ts":"1663255681369",
         "src_block_tx_link":"https://etherscan.io/tx/0xc9ce187d8473c9da1c3e6e923aa2c30368082450d96ca10ac23322c4235bf970",
         "dst_block_tx_link":"https://bscscan.com/tx/0x29c362a4687a412f99af24b26aa22ff13dc0eb321eaa76a505cc8e3e33addebc",
         "swap_status":"SS_DST_COMPLETED",
         "cbr_transfer_id":"42cbd7e983a83093bf5354bf14a66b3b9b04f1d12b7ba14a999c666294604d0a",
         "bridge_type":"anyswap",
         "swap_type":"ST_CROSS_CHAIN_TO_USR",
         "update_ts":"1663255681369"
      }
   ],
   "next_page_token":"1663255681369",
   "current_size":"1",
   "total_size":"254"
}

Request Parameters

NameTypeDescription

addr

String

User's wallet address

page_size

Number

The size of history items

next_page_token

String

Next page token

Response Parameters

NameTypeDescription

history

history list

next_page_token

String

Next page token for another request

current_size

String

Current history list size

total_size

String

Total size of history items for this user

SwapHistory

NameTypeDescription

swap_id

String

Unique key for swap

amount_in

Sending assets before swap

amount_out

Receiving assets after swap

src_block_tx_link

String

Source chain transaction link

dst_block_tx_link

String

Destination chain transaction link

swap_status

SwapStatus

Swap status

create_ts

String

Timestamp for swap creation

cbr_transfer_id

String

cBridge transfer id if cBridge is involved

bridge_type

String

bridge type

update_ts

String

Timestamp for latest swap update

TokenAmount

NameTypeDescription

token

Token info

amount

String

Amount with token decimals

SwapType

ValueDescription

ST_UNKNOWN

Placeholder

ST_CROSS_CHAIN

Destination chain swap after bridging

ST_DIRECT

Same Chain Token Swap

ST_CROSS_CHAIN_TO_USR

No destination chain swap after bridging

Last updated