<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 NameField DescriptionTypeRequired or notNotes

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 NameField DescriptionType

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:

{
  "toChain": "TRON",
  "orderType": "",
  "fromTokenAmount": "4351589000000000000",
  "isNoGas": "0",
  "midTokenCode": "",
  "orderId": "",
  "fromChain": "BSC",
  "dexName": "Bridgers",
  "equipmentNo": "0x18fc9d463b1e40bd0ed7c1c1d79513",
  "source": "globalm",
  "toAddress": "TV21rLfdCU9kdQciTKStA9wkCieQtA9tcn",
  "toTokenAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "toTokenAmount": "1315.139317",
  "toTokenAmountWD": "1315139317",
  "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
  "fromAddress": "0x18fc9d463b1e40bd0ed7c1c1d79513af1b72db98",
  "slippage": "1",
  "hash": "0x574f4fe5908740034da25e0adca87bfb26f7e20b83bf3f6721a6a4c6b5e5bb78"
}

Output Example:

{
    "resCode": 100,
    "resMsg": "success",
    "data": {
        "txHash": "0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706",
        "fromTokenAddress": "0xa71edc38d189767582c38a3145b5873052c3e47a",
        "fromTokenSymbol": "USDT",
        "fromTokenUrl": "https://images.swft.pro/heco/0xa71edc38d189767582c38a3145b5873052c3e47a.png",
        "toTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
        "toTokenSymbol": "USDT",
        "toTokenUrl": "https://swap.swftcoin.com/swft-v3/images/coins/USDT(MATIC).png",
        "fromAmount": 48.026755,
        "toTokenAmount": 47.126755,
        "finalStatus": "pending",
        "createTime": "2022-03-02 15:56:29",
        "status": [
            {
                "chain": "HECO",
                "txHash": "0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706",
                "url": "https://hecoinfo.com/tx/0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706",
                "status": "pending"
            }
        ]
    }
}

Postman Call Example

Last updated