Generate order information

After wallet sent the FROM currency, upload hash to get the order details

Endpoint usage

POST https://sswap.swft.pro/api/exchangeRecord/updateDataAndStatus

The fields with * are required, and the fields without * are optional

Request Body

NameTypeDescription

equipmentNo*

String

Equipment number (This field will be used as the unique identifier of the user, and the third parties can obtain it on their own, such as the first 32 characters of fromAddress, or a string of 32 random numbers and letters)

sourceType

String

Device type (H5/IOS/Android The field is optional, if it is requested directly through the API, it can be empty)

sourceFlag*

String

Source channel (Both sides need to agree on a name to represent the channel of the third parties)

hash*

String

Transaction hash

fromTokenAddress*

String

Contract address for the token to sell (It can be obtained from the address field in the currency list)

toTokenAddress*

String

Contract address for the token to receive (It can be obtained from the address field in the currency list)

fromAddress*

String

User address

toAddress*

String

receiving Address

fromTokenChain*

String

Network of the token to sell (It can be obtained from the chain field in the currency list, For details of the support chain, please refer to [Basic information])

toTokenChain*

String

Network of the token to received (It can be obtained from the chain field in the currency list, For details of the support chain, please refer to [Basic information])

fromTokenAmount*

String

Amount of token to sell (with precision, which can be obtained through the fromTokenAmount field in the quote endpoint)

amountOutMin*

String

Amount of token to receive (with precision, which can be obtained through the amountOutMin field in the quote endpoint)

fromCoinCode*

String

Token name for sell token (It can be obtained from the symbol field in the currency list)

toCoinCode*

String

Token name for receive token (It can be obtained from the symbol field in the currency list)

slippage

String

e.g. '0.1'

{
 "resCode":100,
 "resMsg":"success",
 "data":{
  "orderId":"..." // 订单号orderId
  }
}

Code example

// example
//You can get the order number through the swap interface
const params = {
    hash: '0x05920386bc07d71b58109fab0ab591c5e07d7b15f7a8d77c692fd735048d9dba', //  User sends token hash
    fromTokenAddress: '0x55d398326f99059ff775485246999027b3197955',
    toTokenAddress: '0xa71edc38d189767582c38a3145b5873052c3e47a',
    fromAddress:"0x19...",
    toAddress:"0x19...",
    fromTokenChain:"HECO",
    toTokenChain:"HECO",
    fromTokenAmount: "3293000000000000000",
    amountOutMin:"28891153244504185000",
    fromCoinCode:"HT(HECO)",
    toCoinCode:"USDT(HECO)"
}
const res = await axios.post('https://sswap.swft.pro/api/exchangeRecord/updateDataAndStatus',params)
console.log(res)

Postman

Last updated