Get swap execution status
Retrieves the status of a swap transaction and returns the L1 transaction ID of the receiving transaction (toL1TxId). How toL1TxId is returned depends on whether toType is provided. If toType is not passed, toL1TxId is returned only when the pact has been finalized — intended for liquidity providers who need to track pact closure and collateral release. If toType is passed, toL1TxId may be returned before finalization: it returns the transaction indicating that the user has been paid — intended for integrators and others who need to confirm payment to the user. For BTC, LTC, and DOGE transactions, you can optionally provide receiverAddress alongside toType to check for unconfirmed transactions that may not yet be confirmed on the blockchain.
Query Parameters
The L1 transaction ID that initiated the swap. Should be passed withput "0x" prefix.
The C1 contract address for the source token.
The C2 contract address for the source token.
The C2 contract address for the destination token.
Backend URL. Default is https://api-cloud.coinweb.io/wallet. This URL is used to query the contract's claim storage to retrieve all orders.
uriThe receiver address on the destination L1 chain. Required only for BTC, LTC, and DOGE transactions. This address is used to check for incoming finalization transactions that may be unconfirmed on the blockchain. Allows tracking swap completion even when the finalization transaction is still pending confirmation.
The type of the destination blockchain. Required only for BTC, LTC, and DOGE transactions to determine which blockchain to query for the finalization transaction. Use "btc" for Bitcoin, "ltc" for Litecoin, or "doge" for Dogecoin. This parameter is used in conjunction with receiverAddress to check for unconfirmed transactions on the appropriate blockchain.
"eth" | "btc" | "ltc" | "doge" | "bnb" | "pol" | "trx" | "usdt_trx" | "usdt_bnb" | "usdc_bnb" | "usd1_bnb" | "wbtc_bnb" | "usdt_eth" | "wbtc_eth" | "usdc_eth" | "usd1_eth" | "usdt_pol" | "usdc_pol"Response Body
curl -X GET "https://api.pactswap.io/pactswap_cm/getSwapStatus?fromL1TxId=a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d&fromC1ContractId=0x6f20d1802288c90d2a044d3f7afae73fda261b27d85c0e01fdaaf3199b2c0e85&fromC2ContractId=0x6f20d1802288c90d2a044d3f7afae73fda261b27d85c0e01fdaaf3199b2c0e85&toC2ContractId=0x6f20d1802288c90d2a044d3f7afae73fda261b27d85c0e01fdaaf3199b2c0e85&backendUrl=https%3A%2F%2Fapi-cloud.coinweb.io%2Fwallet&receiverAddress=string&toType=eth"{
"toL1TxId": "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
"isRefund": true,
"pact": {
"id": "order-123-abc",
"baseAmount": "1000000000000000000",
"promisedL1Amount": "50000000",
"pactL1Amount": "50000000",
"minL1Amount": "40000000",
"collateral": "1000000000000000000",
"createdAt": 1704067200000,
"executionStatus": "ACTIVE",
"expirationDate": 1704153600000,
"l1Recipient": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"requestedOrderId": "order-123-abc",
"txId": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"chainData": {
"l1TxId": "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
"vout": 0
},
"history": {
"l1TxId": "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
"vout": 0
},
"executionInfo": {
"l1TxId": "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
"l1Amount": "50000000"
},
"affiliateFees": {
"affiliateFeesCweb": "100000000000000000",
"affiliateFeesToken": "50000000",
"affiliateFeesUsdt": "100000000000000000",
"affiliates": [
{
"affiliateId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"bips": 1
}
],
"token": "BNB",
"oracles": {
"fromToken": {
"decimals": 18,
"l2ContractId": "0x6f20d1802288c90d2a044d3f7afae73fda261b27d85c0e01fdaaf3199b2c0e85",
"rate": "100000000000000000",
"roundId": 1,
"token": "BNB"
},
"usdt": {
"decimals": 18,
"l2ContractId": "0x6f20d1802288c90d2a044d3f7afae73fda261b27d85c0e01fdaaf3199b2c0e85",
"rate": "100000000000000000",
"roundId": 1,
"token": "USDT"
}
}
}
}
}Was this documentation helpful? Any suggestions?