<Swap> Interface
Obtain the swap information, call up the wallet to send the specified amount of the original token to the specified address according to the return content, and complete the dialogue.
Request Address: /api/commonSwap
API Address: https://api-swap.paths.finance
Request Method: POST
Request Parameters:
equipmentNo
Device number
string
Y
fromTokenAddress
Original token contract address
string
Y
toTokenAddress
Target token contract address
string
Y
fromAddress
Sender address
string
Y
toAddress
Recerver address
string
Y
amountOutMin
Min receiving amount
string
Y
routerPath
Swap route(multiQuote output param path), if no specific route, can set as null
array
Y
plarform like o3, and similar to uniswap must upload
amounts
Min amount receiving from all routes, if no specific route, can set as null
array
N
o3 must upload
dex
Swap platform name
string
Y
Use to distinguish usage channel
fromTokenChain
Oiginal chain
string
Y
toTokenChain
Target chain
string
Y
fromTokenAmount
Original token amount
string
Y
slippage
Slippage
decimal
Y
source
Unique ID of the channel
string
Y
isNoGas
Only the SWFT channel will valid, with the function of whether gas free or not
boolean
N
midTokenCode
Only the Glue channel will valid
string
N
Output parameter:
from
Call the contract request address
string
to
Called contract address
string
value
Call incoming amount
string
gas
Gas Limit
integer
gasPrice
Gas fee
string
data
Contract call data
string
noGasTxInfo
Only the SWFT channel, with the function of whether gas free or not
string
transferData
swap info
object
approveAddress
The Bridgers, Aggregator,Glue,CrossChainX channel will display, approve coin address
string
toType
Deposit coin type,0 (common address, no call data);1 (common address,have call data);2(contract address,have call data )
string
platformAddr
Only the SWFT channel,deposit address
string
Input example:
{
"equipmentNo": "0x76336d2903e8f6d62cc3f5d0528310",
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
"fromAddress": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
"toAddress": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
"amountOutMin": "30427649999999997",
"routerPath": [
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
100
],
"amounts": [],
"dex": "Aggregator",
"fromTokenChain": "BSC",
"toTokenChain": "BSC",
"fromTokenAmount": "30735000000000000",
"slippage": 1,
"source": "path"
}
Output example:
SWFT output example:
{
"resCode": "100",
"resMsg": "Success",
"data": {
"txData": {
"data": "0xa9059cbb000000000000000000000000e071f953ad560a509632b1f4b8a33d2c4d1d29fd000000000000000000000000000000000000000000000000d02ab486cedc0000",
"orderId": "89d3e07a-de18-4d50-99c2-651222b81212",
"swftCoinFeeRate": "0.001",
"xrpInfo": null,
"depositCoinAmt": "15",
"isDiscount": "N",
"orderState": "wait_deposits",
"developerId": "",
"depositCoinCode": "USDT(BSC)",
"kycUrl": "",
"dealFinishTime": null,
"chainFee": "0.001799",
"depositCoinFeeAmt": "0.045",
"refundDepositTxid": "",
"depositFeeRate": "0.003",
"fromAddress": "0xf5a4170c83d9267b9344eb284d3fc31329e72843",
"refundSwftAmt": "",
"depositTxid": "",
"receiveCoinCode": "BNB(BSC)",
"value": "0x0",
"receiveCoinAmt": "0.048217",
"swftCoinState": "",
"swftRefundAddr": "",
"detailState": "wait_deposit_send",
"burnRate": "0",
"changeType": "advanced",
"depositCoinFeeRate": "0.003",
"transactionId": "",
"refundAddr": "0xf5a4170c83d9267b9344eb284d3fc31329e72843",
"createTime": "2024-01-08 17:13:54",
"choiseFeeType": "3",
"destinationAddr": "0xF5a4170C83D9267B9344eb284D3fC31329e72843",
"platformAddr": "0xe071f953ad560a509632b1f4b8a33d2c4d1d29fd",
"to": "0x55d398326f99059ff775485246999027b3197955",
"instantRate": "0.003334454849",
"refundCoinMinerFee": "",
"refundCoinAmt": "",
"receiveSwftAmt": "7.49",
"depositCoinState": "wait_send",
"swftReceiveAddr": "",
"toType": "1",
"noGasTxInfo": "{\"gasLimit\":37920,\"data\":\"0xxxxx\",\"chainId\":56,\"to\":\"0xxxxx\",\"nonce\":51,\"gasPrice\":\"3150000000\"}"
}
}
}
Other example:
{
"resCode": "100",
"resMsg": "Success",
"data": {
"txData": {
"from": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
"to": "0x11111112542d85b3ef69ae05771c2dccff4faa26",
"value": "0x6d3151d52bf000",
"gas": 0,
"gasPrice": "15000000000",
"approveAddress": "",
"toType": "2",
"data": "0x7c025200000000000000000000000000baf9a5d4b0052359326a6cdab54babaa3a3a964300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000baf9a5d4b0052359326a6cdab54babaa3a3a964300000000000000000000000076336d2903e8f6d62cc3f5d05283108e3d2785e0000000000000000000000000000000000000000000000000006d3151d52bf000000000000000000000000000000000000000000000000000006bfe1cd8548f8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000a0102b2abb03234204dacba824c027f45aa6ccd700000000000000000000000000000000000000000000000000001bf40cc1d60000000000000000000000000000000000000000000000000000000000800000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d155dc86a1a0000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000076336d2903e8f6d62cc3f5d05283108e3d2785e0000000000000000000000000000000000000000000000000006d155dc86a1a0000000000000000000000000000000000000000000000000000000000cfee7c08"
}
}
}
Postman Call Example

Last updated