Pact Swap

Compose swap tx by amount to


Compose swap tx by amount to.

GET
/pactswap_cm/composeSwapTxByAmountTo

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.

amountTonumber

Amount to.

utxos?string

Utxos: {txid: string, vout: number, value: number}. Only for fromType: btc

backendUrl?string

Backend URL, default: https://api-cloud.coinweb.io/wallet

Formaturi
botUrl?string

Bot url.

Formaturi
presetnumber

Preset Id to Swap to to.

Response Body

curl -X GET "https://api.pactswap.io/pactswap_cm/composeSwapTxByAmountTo?fromType=eth&toType=eth&toWalletAddress=string&fromPublicKey=string&fromWalletAddress=string&fromC1ContractId=string&fromC2ContractId=string&toC1ContractId=string&toC2ContractId=string&amountTo=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