<Add Swap Information> Interface
After the wallet send tokens, call this interface to generate the Transaction History
Request Address: /api/exchangeRecord/addTransData
API Address: https://api-swap.paths.finance
Request Method: POST
Request Parameter:
Field Name | Field Description | Type | Required or not | Notes |
---|---|---|---|---|
equipmentNo | Device ID | string | Y | |
fromTokenAddress | Original token contact address | string | Y | |
toTokenAddress | Target token contract address | string | Y | |
fromAddress | Sender address | string | Y | |
toAddress | Receiver address | string | Y | |
fromTokenAmount | Original token amount (with decimal) | string | Y | |
slippage | Max slippage, % | integer | Y | |
fromChain | Original chain | string | Y | |
toChain | Target chain | string | Y | |
hash | Transaction hash | string | Y | |
toTokenAmount | Target token amount, divided by decimal | decimal | Y | |
dexName | Swap platform name | string | Y | |
isNoGas | Whether to use no gas:0 (use);1 (no) | string | Y | |
midTokenCode | Only the Glue channel, commonSwap request Param midTokenCode | string | N | |
toTokenAmountWD | Only the Glue channel, target token amount(with decimal) | string | N | |
orderId | Order ID, if No fill with Null | string | N | |
orderType | Order type, such as no fill-in-the-null string | string | N | |
transferData | Swap customized process information, if no fill in null | string | N | Customized process, brought back by the swap interface |
source | Unique ID of the channel | string | N |
Output Parameter:
Field Name | Field Description | Type |
---|---|---|
txHash | Transaction hash | string |
fromTokenAddress | Original token contract address | string |
fromTokenSymbol | Original token symbol | string |
fromTokenUrl | Original token logo address | string |
toTokenAddress | Target contract address | string |
toTokenSymbol | Target token symbol | string |
toTokenUrl | Target token logo address | string |
fromAmount | Original token amount, divided by decimal | decimal |
toTokenAmount | Target token amount, divided by decimal | decimal |
finalStatus | Current status: pending:Processing, success:Succeed, fail: failed,wait_kyc:wait for kyc, wait_refund: wait for return, refund_complete: Return tokens | string |
createTime | Create time | string |
status | Swap status, first element is the original chain swap status, second element is the target chain swap status | array |
Input Example:
Output Example:
Postman Call Example
Last updated