### Output Example: Order Response Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/upload-order.md Example JSON response for a created order. Contains transaction hash, token details, amounts, final status, creation time, and an array of per-chain swap statuses with transaction URLs. ```json { "resCode": 100, "resMsg": "success", "data": { "txHash": "0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706", "fromTokenAddress": "0xa71edc38d189767582c38a3145b5873052c3e47a", "fromTokenSymbol": "USDT", "fromTokenUrl": "https://images.swft.pro/heco/0xa71edc38d189767582c38a3145b5873052c3e47a.png", "toTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", "toTokenSymbol": "USDT", "toTokenUrl": "https://swap.swftcoin.com/swft-v3/images/coins/USDT(MATIC).png", "fromAmount": 48.026755, "toTokenAmount": 47.126755, "finalStatus": "pending", "createTime": "2022-03-02 15:56:29", "status": [ { "chain": "HECO", "txHash": "0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706", "url": "https://hecoinfo.com/tx/0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706", "status": "pending" } ] } } ``` -------------------------------- ### Request example for /api/commonSwap Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/swap.md JSON object with required fields for a swap request, including equipmentNo, token addresses, amounts, slippage, and route information. The example uses BSC chain and a specific routerPath. ```json { "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" } ``` -------------------------------- ### Query documentation index with ask parameter Source: https://metapath.gitbook.io/metapath-api/llms.txt Perform an HTTP GET request to the documentation index with the ask parameter and optional goal parameter to get a direct answer. The ask parameter should be specific and self-contained, while goal describes the broader end goal. ```http GET https://metapath.gitbook.io/metapath-api/api-introduction.md?ask=&goal= ``` -------------------------------- ### Input Example: Order Creation Request Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/upload-order.md Example JSON payload for creating a cross-chain swap order. Includes chain identifiers, token addresses, amounts, slippage, and a hash. The 'status' field is an array of per-chain swap statuses. ```json { "toChain": "TRON", "orderType": "", "fromTokenAmount": "4351589000000000000", "isNoGas": "0", "midTokenCode": "", "orderId": "", "fromChain": "BSC", "dexName": "Bridgers", "equipmentNo": "0x18fc9d463b1e40bd0ed7c1c1d79513", "source": "globalm", "toAddress": "TV21rLfdCU9kdQciTKStA9wkCieQtA9tcn", "toTokenAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "toTokenAmount": "1315.139317", "toTokenAmountWD": "1315139317", "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "fromAddress": "0x18fc9d463b1e40bd0ed7c1c1d79513af1b72db98", "slippage": "1", "hash": "0x574f4fe5908740034da25e0adca87bfb26f7e20b83bf3f6721a6a4c6b5e5bb78" } ``` -------------------------------- ### Request example for /api/multiQuote Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/request-quote.md Example request to the /api/multiQuote endpoint. The payload specifies source flag, token addresses, amounts, chains, user and destination addresses, and slippage. Use this to fetch multi-channel price quotes. ```postman_json https://api-swap.paths.finance/api/multiQuote { "sourceFlag":"path", "fromTokenAddress":"0x55d398326f99059ff775485246999027b3193195", "toTokenAddress":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f", "fromTokenAmount":"1000000000000000000", "fromTokenChain":"BSC", "toTokenChain":"POLYGON", "equipmentNo":"0x76336d2903e8f6d62cc3f5d0528310", "userAddr":"0x76336d2903e8f6d62cc3f5d05283108e3d2785e0", "toAddress":"0x76336d2903e8f6d62cc3f5d05283108e3d2785e0", "slippage": 1 } ``` -------------------------------- ### Response Example: With Chain Parameter Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/get-coin-list.md Shows the JSON response when a chain parameter is provided. The tokens field is an array of token objects for that chain, and quoteSwitch is true. ```json // has a chain parameter Return { "resCode": "100", "resMsg": "Success", "data": { "tokens": [ { "symbol": "BNB", "name": "BNB", "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png", "isCrossEnable": false }, { "symbol": "USDT", "name": "Tether USD", "address": "0x55d398326f99059ff775485246999027b3197955", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xdac17f958d2ee523a2206206994597c13d831ec7.png", "isCrossEnable": false }, { "symbol": "WBNB", "name": "Wrapped BNB", "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png", "isCrossEnable": false } ], "quoteSwitch": true } } ``` -------------------------------- ### POST /api/getBaseInfo Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/get-coin-list.md Retrieves the list of supported chains and their corresponding tokens. Use this endpoint to get the available swap pairs for the aggregator. ```APIDOC ## POST /api/getBaseInfo ### Description Get information of the supported chains, and the corresponding tokens: for users to choose a swap pair. ### Method POST ### Endpoint /api/getBaseInfo ### Parameters #### Query Parameters - **chain** (string) - Optional - Blockchain Name. Referring to [Major Blockchain Name Conventions](/metapath-api/api-introduction/chain-info.md). ### Request Example https://api-swap.paths.finance/api/getBaseInfo ### Response #### Success Response (200) - **tokens** (object or array) - Token Info List. Returns an Object when no chain parameter is provided; returns an Array when a chain parameter is provided. - **quoteSwitch** (bool) - The price inquiry switch currently set to True. #### Response Example (no chain parameter) ```json { "resCode": "100", "resMsg": "Success", "data": { "tokens": { "ETH": [ { "symbol": "ETH", "name": "Ethereum Token", "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "decimals": 18, "logoURI": "https://swap.swftcoin.com/swft-v3/images/coins/ETH.png", "isCrossEnable": true }, { "symbol": "WETH", "name": "Wrapped Ether", "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png", "isCrossEnable": true }, { "symbol": "LINK", "name": "ChainLink Token", "address": "0x514910771af9ca656af840dff83e8264ecf986ca", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0x514910771af9ca656af840dff83e8264ecf986ca.png", "isCrossEnable": false } ] }, "quoteSwitch": true } } ``` #### Response Example (with chain parameter) ```json { "resCode": "100", "resMsg": "Success", "data": { "tokens": [ { "symbol": "BNB", "name": "BNB", "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png", "isCrossEnable": false }, { "symbol": "USDT", "name": "Tether USD", "address": "0x55d398326f99059ff775485246999027b3197955", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xdac17f958d2ee523a2206206994597c13d831ec7.png", "isCrossEnable": false }, { "symbol": "WBNB", "name": "Wrapped BNB", n "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png", "isCrossEnable": false } ], "quoteSwitch": true } } ``` ``` -------------------------------- ### Response example: JSON response Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/swap.md This is a response example for the Metapath API, showing a JSON object with transaction details. It includes fields such as resCode, resMsg, and data with nested transaction data. The response contains information about the transaction, including addresses, amounts, and status. ```json { "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\"}" } } } ``` -------------------------------- ### Response Example: No Chain Parameter Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/get-coin-list.md Shows the JSON response when the chain parameter is omitted. The tokens field is an object keyed by chain name, and quoteSwitch is true. ```json // no chain parameter Return { "resCode": "100", "resMsg": "Success", "data": { "tokens": { "ETH": [ { "symbol": "ETH", "name": "Ethereum Token", "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "decimals": 18, "logoURI": "https://swap.swftcoin.com/swft-v3/images/coins/ETH.png", "isCrossEnable": true }, { "symbol": "WETH", "name": "Wrapped Ether", "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png", "isCrossEnable": true }, { "symbol": "LINK", "name": "ChainLink Token", "address": "0x514910771af9ca656af840dff83e8264ecf986ca", "decimals": 18, "logoURI": "https://images.swft.pro/inch1/0x514910771af9ca656af840dff83e8264ecf986ca.png", "isCrossEnable": false } ] }, "quoteSwitch": true } } ``` -------------------------------- ### Request Quote API Response JSON Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/request-quote.md Example response from the Request Quote API. Contains an array of transaction data objects with fields such as receiveTokenAmount, fee, fromChain, toChain, dex, and crossDetails. The response includes a resCode of '100' and resMsg 'Success'. ```json { "data": { "txData": [ { "receiveTokenAmount": "322.005045", "fee": 0.003, "fromChain": "BSC", "dexAddress": "0x6406df225a87d7ec187e11044257fec2ca0a354c", "path": [], "approveAddress": "0xA962FCA0Cd10a52c9D1Bc377a852bbF3230f4669", "dex": "Glue", "depositMin": "10.0", "bridgeFee": "0.19390214", "midDex": "Aggregator", "toChain": "POLYGON", "estimatedTime": 2, "gasFee": "0.001125", "fromTokenAmount": "1000000000000000000", "depositMax": "2731187", "midTokenCode": "USDT(BSC)", "gasFeeToken": "BNB", "toTokenDecimal": 6, "feeToken": "BNB", "logoUrl": "https://images.swft.pro/dex/glue.png", "bridgeFeeToken": "USDT", "toTokenAmount": "322.005045", "fromTokenDecimal": 18, "midDexLogo": "https://images.swft.pro/dex/path.png", "midTokenAmount": "323.16845238", "dexDisplayName": "Glue", "crossDetails": { "from": { "path": "", "dex": "" }, "to": { "path": "", "dex": "" } } }, { "estimatedTime": 1, "fromTokenAmount": "1000000000000000000", "depositMax": "92.635479", "amountOutMin": "320488535", "noGasDepositMin": null, "receiveTokenAmount": 320.48853469318186, "fee": "0.003", "toTokenDecimal": 6, "kycInfo": { "cnUrl": "https://swap.swftcoin.com/swft-v3/swft-v3-m/kyc/kyc.html?lang=cn&equipmentNo=0xf5a4170c83d9267b9344eb284d3fc3", "enUrl": "https://swap.swftcoin.com/swft-v3/swft-v3-m/kyc/kyc.html?lang=en&equipmentNo=0xf5a4170c83d9267b9344eb284d3fc3", "isDapp": false, "status": false }, "feeToken": "USDT(MATIC)", "contractAddress": "", "dexName": "SWFT", "isSupportNoGas": false, "logoUrl": "https://images.swft.pro/dex/SWFT.png", "toTokenAmount": 320.48853469318186, "path": [], "fromTokenDecimal": 18, "dex": "SWFT", "depositMin": "0.04675", "noGasDepositMin": null, "chainFee": "1", "dexStatus": "" } ] }, "resCode": "100", "resMsg": "Success" } ``` -------------------------------- ### POST /api/multiQuote Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/request-quote.md Retrieves a list of possible swap routes and their pricing details for a given token pair across chains. ```APIDOC ## [POST] /api/multiQuote ### Description Returns an array of channel prices for a token swap, including estimated output amounts, fees, and route details. ### Method POST ### Endpoint https://api-swap.paths.finance/api/multiQuote ### Parameters #### Request Body - **sourceFlag** (string) - Required - Source flag (e.g., "path") - **fromTokenAddress** (string) - Required - Address of the source token - **toTokenAddress** (string) - Required - Address of the target token - **fromTokenAmount** (string) - Required - Amount of source token (in smallest unit, e.g., wei) - **fromTokenChain** (string) - Required - Chain of the source token (e.g., "BSC") - **toTokenChain** (string) - Required - Chain of the target token (e.g., "POLYGON") - **equipmentNo** (string) - Required - Equipment identifier - **userAddr** (string) - Required - User's wallet address - **toAddress** (string) - Required - Destination address for the swap - **slippage** (number) - Required - Maximum slippage percentage (e.g., 1 for 1%) ### Request Example ```json { "sourceFlag":"path", "fromTokenAddress":"0x55d398326f99059ff775485246999027b3197955", "toTokenAddress":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f", "fromTokenAmount":"1000000000000000000", "fromTokenChain":"BSC", "toTokenChain":"POLYGON", "equipmentNo":"0x76336d2903e8f6d62cc3f5d0528310", "userAddr":"0x76336d2903e8f6d62cc3f5d05283108e3d2785e0", "toAddress":"0x76336d2903e8f6d62cc3f5d05283108e3d2785e0", "slippage": 1 } ``` ### Response #### Success Response (200) The response is an array of objects, each representing a channel price with the following fields: - **fromTokenAmount** (integer) - Original token amount, times decimal - **fromTokenDecimal** (integer) - Original token decimal - **toTokenAmount** (decimal) - Target token amount, divided by decimal - **toTokenDecimal** (integer) - Target token decimal - **dex** (string) - Swap platform - **fee** (decimal) - Transaction fee, same as original token - **feeToken** (string) - Transaction fee settlement token symbol - **receiveTokenAmount** (decimal) - Estimated target token receiving amount, divided by decimal - **logoUrl** (string) - Swap platform logo - **depositMax** (decimal) - Max original token (only for channels with deposit scope) - **depositMin** (decimal) - Min original token (only for channels with deposit scope) - **kycInfo** (object) - KYC-related info (only when channels require KYC) - **isSupportNoGas** (boolean) - Whether gas-free is supported (SWFT channel only) - **estimatedTime** (decimal) - Estimated time: 1 (1-3 min), 2 (1-10 min), 3 (5-30 min) - **path** (array) - Swap path list - **contractAddress** (string) - Swap address (Bridgers and Aggregator channels only) - **approveAddress** (string) - Approve address (Glue channel only) - **dexAddress** (string) - Swap address (Glue channel only) #### Response Example ```json [ { "fromTokenAmount": 1000000000000000000, "fromTokenDecimal": 18, "toTokenAmount": 1234567890.123456, "toTokenDecimal": 18, "dex": "PancakeSwap", "fee": 0.01, "feeToken": "BNB", "receiveTokenAmount": 1234567890.123456, "logoUrl": "https://example.com/logo.png", "depositMax": 1000.0, "depositMin": 0.1, "kycInfo": { "required": false, "linkEn": "https://example.com/kyc/en", "linkZh": "https://example.com/kyc/zh" }, "isSupportNoGas": true, "estimatedTime": 1, "path": ["0x...", "0x..."], "contractAddress": "0x...", "approveAddress": "0x...", "dexAddress": "0x..." } ] ``` ``` -------------------------------- ### POST /api/multiQuote Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/request-quote.md Obtains swap route information for a given token pair. This endpoint allows users to fetch available swap routes with details like route name and logo, enabling them to choose a preferred route. ```APIDOC ## POST /api/multiQuote ### Description Obtain swap route information of select swap pair (route name, logo, swap pair information, etc.) : for users to choose a swap route ### Method POST ### Endpoint /api/multiQuote ### Parameters #### Request Body - **equipmentNo** (string) - Required - Device ID. Referring to code in [General Instruction](/metapath-api/api-introduction/general-instruction.md) - **fromTokenAddress** (string) - Required - Original token contract address - **toTokenAddress** (string) - Required - Target token contract address - **fromTokenAmount** (integer) - Required - Original token amount, times amount after decimal - **fromTokenChain** (string) - Required - Original token chain. Referring to [Major Blockchain Name Conventions ](/metapath-api/api-introduction/chain-info.md) - **toTokenChain** (string) - Required - Target token chain. Referring to [Major Blockchain Name Conventions ](/metapath-api/api-introduction/chain-info.md) - **userAddr** (string) - Required - Sender address - **toAddress** (string) - Required - Receiver address - **slippage** (decimal) - Required - Acceptable slippage %, only integer, like 1 is 1% - **source** (string) - Required - Unique ID of the channel ### Request Example { "equipmentNo": "string", "fromTokenAddress": "string", "toTokenAddress": "string", "fromTokenAmount": 0, "fromTokenChain": "string", "toTokenChain": "string", "userAddr": "string", "toAddress": "string", "slippage": 0, "source": "string" } ### Response #### Success Response (200) - **route name** (string) - Description not provided - **logo** (string) - Description not provided - **swap pair information** (object) - Description not provided #### Response Example { "route name": "string", "logo": "string", "swap pair information": {} } ``` -------------------------------- ### Upload Order Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/upload-order.md Submits a cross-chain swap order with specified parameters. Returns transaction details and status information. ```APIDOC ## Upload Order ### Description Submits a cross-chain swap order with specified parameters. Returns transaction details and status information. ### Method POST ### Endpoint /upload-order ### Parameters #### Request Body - **toChain** (string) - Required - Target blockchain network (e.g., "TRON") - **orderType** (string) - Optional - Type of order - **fromTokenAmount** (string) - Required - Original token amount in smallest units (e.g., wei) - **isNoGas** (string) - Optional - Flag indicating whether gas is not provided ("0" or "1") - **midTokenCode** (string) - Optional - Middle token code if applicable - **orderId** (string) - Optional - Order identifier - **fromChain** (string) - Required - Source blockchain network (e.g., "BSC") - **dexName** (string) - Required - DEX name (e.g., "Bridgers") - **equipmentNo** (string) - Required - Equipment number (wallet address) - **source** (string) - Required - Source identifier (e.g., "globalm") - **toAddress** (string) - Required - Target wallet address - **toTokenAddress** (string) - Required - Target token contract address - **toTokenAmount** (string) - Required - Target token amount in decimal format - **toTokenAmountWD** (string) - Required - Target token amount in smallest units - **fromTokenAddress** (string) - Required - Source token contract address - **fromAddress** (string) - Required - Source wallet address - **slippage** (string) - Required - Slippage tolerance percentage - **hash** (string) - Required - Transaction hash ### Request Example ```json { "toChain": "TRON", "orderType": "", "fromTokenAmount": "4351589000000000000", "isNoGas": "0", "midTokenCode": "", "orderId": "", "fromChain": "BSC", "dexName": "Bridgers", "equipmentNo": "0x18fc9d463b1e40bd0ed7c1c1d79513", "source": "globalm", "toAddress": "TV21rLfdCU9kdQciTKStA9wkCieQtA9tcn", "toTokenAddress": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "toTokenAmount": "1315.139317", "toTokenAmountWD": "1315139317", "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", "fromAddress": "0x18fc9d463b1e40bd0ed7c1c1d79513af1b72db98", "slippage": "1", "hash": "0x574f4fe5908740034da25e0adca87bfb26f7e20b83bf3f6721a6a4c6b5e5bb78" } ``` ### Response #### Success Response (200) - **resCode** (number) - Response code (100 indicates success) - **resMsg** (string) - Response message - **data** (object) - Response data containing: - **txHash** (string) - Transaction hash - **fromTokenAddress** (string) - Original token contract address - **fromTokenSymbol** (string) - Original token symbol - **fromTokenUrl** (string) - Original token logo URL - **toTokenAddress** (string) - Target token contract address - **toTokenSymbol** (string) - Target token symbol - **toTokenUrl** (string) - Target token logo URL - **fromAmount** (decimal) - Original token amount (divided by decimal) - **toTokenAmount** (decimal) - Target token amount (divided by decimal) - **finalStatus** (string) - Current status: pending, success, fail, wait_kyc, wait_refund, refund_complete - **createTime** (string) - Creation timestamp - **status** (array) - Swap status array with elements containing: - **chain** (string) - Chain name - **txHash** (string) - Transaction hash - **url** (string) - Transaction URL - **status** (string) - Status of that chain's swap #### Response Example ```json { "resCode": 100, "resMsg": "success", "data": { "txHash": "0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706", "fromTokenAddress": "0xa71edc38d189767582c38a3145b5873052c3e47a", "fromTokenSymbol": "USDT", "fromTokenUrl": "https://images.swft.pro/heco/0xa71edc38d189767582c38a3145b5873052c3e47a.png", "toTokenAddress": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", "toTokenSymbol": "USDT", "toTokenUrl": "https://swap.swftcoin.com/swft-v3/images/coins/USDT(MATIC).png", "fromAmount": 48.026755, "toTokenAmount": 47.126755, "finalStatus": "pending", "createTime": "2022-03-02 15:56:29", "status": [ { "chain": "HECO", "txHash": "0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706", "url": "https://hecoinfo.com/tx/0x25bfd589d00e41a66e01ed3ad7c7b4b5765619cbb34232f33ee47fd6c5c09706", "status": "pending" } ] } } ``` ``` -------------------------------- ### POST /api/commonSwap Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/swap.md Obtains swap information and calls the wallet to send the specified amount of the original token to the specified address. The response contains contract call data needed to complete the swap. ```APIDOC ## POST /api/commonSwap ### Description 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. ### Method POST ### Endpoint /api/commonSwap ### Parameters #### Request Body - **equipmentNo** (string) - Required - Device number - **fromTokenAddress** (string) - Required - Original token contract address - **toTokenAddress** (string) - Required - Target token contract address - **fromAddress** (string) - Required - Sender address - **toAddress** (string) - Required - Receiver address - **amountOutMin** (string) - Required - Min receiving amount - **routerPath** (array) - Required - Swap route (multiQuote output param path), if no specific route, can set as null. Platforms like o3, and similar to uniswap must upload. - **amounts** (array) - Optional - Min amount receiving from all routes, if no specific route, can set as null. o3 must upload. - **dex** (string) - Required - Swap platform name, used to distinguish usage channel - **fromTokenChain** (string) - Required - Original chain - **toTokenChain** (string) - Required - Target chain - **fromTokenAmount** (string) - Required - Original token amount - **slippage** (decimal) - Required - Slippage - **source** (string) - Required - Unique ID of the channel - **isNoGas** (boolean) - Optional - Only the SWFT channel will be valid, with the function of whether gas free or not - **midTokenCode** (string) - Optional - Only the Glue channel will be valid ### Request Example ```json { "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" } ``` ### Response #### Success Response - **from** (string) - Call the contract request address - **to** (string) - Called contract address - **value** (string) - Call incoming amount - **gas** (integer) - Gas Limit - **gasPrice** (string) - Gas fee - **data** (string) - Contract call data - **noGasTxInfo** (string) - Only the SWFT channel, with the function of whether gas free or not - **transferData** (object) - swap info - **approveAddress** (string) - The Bridgers, Aggregator, Glue, CrossChainX channel will display, approve coin address - **toType** (string) - Deposit coin type, 0 (common address, no call data); 1 (common address, have call data); 2 (contract address, have call data) - **platformAddr** (string) - Only the SWFT channel, deposit address #### Response Example (Not provided in source) ``` -------------------------------- ### POST /api/exchangeRecord/getTransData Source: https://metapath.gitbook.io/metapath-api/cross-platform-aggregator-api/get-order-list.md This endpoint retrieves the transaction history for a given address, paginated. ```APIDOC ## [POST] /api/exchangeRecord/getTransData ### Description Get the Transaction History of the corresponding address in separate pages. ### Method POST ### Endpoint /api/exchangeRecord/getTransData ### Parameters #### Request Body - **fromAddress** (string) - Required - User address - **pageSize** (integer) - Required - Number in page - **pageNo** (integer) - Required - Page ### Response #### Success Response (200) - **Transaction history** (array) - The transaction history of the corresponding address ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.