PACT SWAP CMCompose swap tx by amount from GET
Compose swap tx by amount from
Compose swap tx by amount from.
Query Parameters
fromTypestring
From type.
Default
"eth"Value in
"eth" | "btc" | "ltc" | "bnb" | "trx" | "usdt_trx" | "usdt_bnb" | "usdc_bnb" | "usd1_bnb" | "usdt_eth" | "wbtc_eth" | "usdc_eth" | "usd1_eth"toTypestring
To type.
Default
"btc"Value in
"eth" | "btc" | "ltc" | "bnb" | "trx" | "usdt_trx" | "usdt_bnb" | "usdc_bnb" | "usd1_bnb" | "usdt_eth" | "wbtc_eth" | "usdc_eth" | "usd1_eth"toWalletAddressstring
To wallet address.
fromPublicKey?string
From public key. Only for fromType: btc
fromWalletAddressstring
From wallet address.
fromC1ContractIdstring
From C1 contract id.
fromC2ContractIdstring
From C2 contract id.
toC1ContractIdstring
To C1 contract id.
toC2ContractIdstring
To C2 contract id.
amountFromnumber
Amount from.
utxos?string
Utxos: {txid: string, vout: number, value: number}. Only for fromType: btc
backendUrl?string
Backend URL, default: https://api-cloud.coinweb.io/wallet
Format
uribotUrl?string
Bot url.
Format
uripresetnumber
Preset Id to Swap to to.
Response Body
curl -X GET "https://api.pactswap.io/pactswap_cm/composeSwapTxByAmountFrom?fromType=eth&toType=eth&toWalletAddress=string&fromPublicKey=string&fromWalletAddress=string&fromC1ContractId=string&fromC2ContractId=string&toC1ContractId=string&toC2ContractId=string&amountFrom=0&utxos=string&backendUrl=http%3A%2F%2Fexample.com&botUrl=http%3A%2F%2Fexample.com&preset=0"{
"rawTx": "string",
"chainId": 0,
"value": "string",
"to": "string",
"type": "string"
}Was this documentation helpful? Any suggestions?
Last updated on