POST DEX Approve
Endpoint
POST /dexApprove
Request Body
{
"tokenIdTo": "6689b73ec90e45f3b3e51558",
"tokenIdFrom": "6689b73ec90e45f3b3e51553",
"addressFrom": "0x45CF73349a4895fabA18c0f51f06D79f0794898D",
"amount": 1,
"swap": "sw",
"route": {
"duration": 1,
"gas": "5387746374601800",
"quote": {
"integration": "debridge",
"type": "swap",
"bridgeFee": "29257969",
"bridgeFeeInNativeToken": "1000000000000000",
"amount": "657693444",
"decimals": 9,
"amountUSD": "94.905",
"bridgeFeeUSD": "4.221",
"bridgeFeeInNativeTokenUSD": "2.434",
"fees": [
{
"type": "bridge",
"amount": "29257969",
"amountUSD": "4.221",
"chainSlug": "solana",
"tokenSymbol": "SOL",
"tokenAddress": "11111111111111111111111111111111",
"decimals": 9,
"deductedFromSourceToken": true
},
{
"type": "bridge",
"amount": "1000000000000000",
"amountUSD": "2.434",
"chainSlug": "ethereum",
"tokenSymbol": "ETH",
"tokenAddress": "0x0000000000000000000000000000000000000000",
"decimals": 18,
"deductedFromSourceToken": false
},
{
"type": "gas",
"amount": "5387746374601800",
"amountUSD": "13.118",
"chainSlug": "ethereum",
"tokenSymbol": "ETH",
"tokenAddress": "0x0000000000000000000000000000000000000000",
"decimals": 18,
"deductedFromSourceToken": false
},
{
"type": "partner",
"amount": "200000",
"amountUSD": "0.200",
"chainSlug": "ethereum",
"tokenSymbol": "USDT",
"tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"decimals": 6,
"deductedFromSourceToken": true
}
]
},
"route": [
{
"bridge": "debridge",
"bridgeTokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"steps": ["allowance", "approve", "send"],
"name": "USDC",
"part": 100
}
],
"distribution": { "debridge": 1 },
"gasUSD": "13.118"
}
}
Request Fields
| Field | Type | Description |
|---|---|---|
tokenIdTo | string | Destination token identifier |
tokenIdFrom | string | Source token identifier |
addressFrom | string | Address from which the amount will be deducted |
amount | number | Approval amount |
swap | string | Swap type identifier (e.g., sw) |
route | object | Routing configuration (RouteDTO from dexQuote) |
Example Response
[
{
"data": "0x095ea7b300000000000000000000000072788af7fc87d14da73f94e353e52b76e230035b000000000000000000000000000000000000000000000000016345785d8a0000",
"to": "0x0000000000000000000000000000000000000000",
"from": "0x789",
"fromChain": {
"id": "667160411933f7647414f091",
"created": "2024-06-18T10:24:01.870Z",
"modified": "2024-09-04T13:41:54.131Z",
"name": "Ethereum",
"shortName": "ethereum",
"addressValidation": "^(0x)[0-9A-Fa-f]{40}$",
"explorerUrl": "https://etherscan.io/tx/{txHash}",
"addressUrl": "https://etherscan.io/tokens/{address}",
"kind": "evm",
"chainId": 1,
"block": "0",
"gasPrice": "0",
"lastBaseFeePerGas": "0",
"maxFeePerGas": "0",
"maxPriorityFeePerGas": "0",
"enabled": true,
"icon": "http://localhost:3000/assets/dexchains/667160411933f7647414f091.png"
}
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
data | string | Encoded transaction data (hex) to submit on-chain |
to | string | Target contract address |
from | string | Source token address |
fromChain | object | Source chain details (ChainDTO) |
ChainDTO Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique chain identifier |
created | string | Creation timestamp |
modified | string | Last modification timestamp |
name | string | Chain full name |
shortName | string | Chain abbreviation |
addressValidation | string | Regex for address validation |
memoNeeded | boolean | Whether memo is required |
explorerUrl | string | Block explorer URL format |
addressUrl | string | Token address URL format |
icon | string | Chain icon URL |
kind | string | Chain type (e.g., evm) |
chainId | number | Blockchain network ID |
block | bigint | Current block number |
gasPrice | bigint | Current gas price |
lastBaseFeePerGas | bigint | Recent base fee |
maxFeePerGas | bigint | Maximum fee ceiling |
maxPriorityFeePerGas | bigint | Priority fee limit |
enabled | boolean | Whether chain is active |
shortNameV1 | string | Legacy chain abbreviation |