Post dexApprove API

This endpoint is used to initiate a token approval transaction for the DexExchange platform.

Endpoint: POST/dexApprove

Request Body: A JSON object containing dexApprove details.

Request Body Fields:

Field
Type
Description

tokenIdTo

string

Token identifier to which the swap is directed

tokenIdFrom

string

Token identifier from which the swap is initiated

addressFrom

string

Address from which the amount will be deducted

amount

number

Amount to be approved

swap

string

Swap identifier or type (example: ch)

route

object

Example request:

POST /dexApprove
Content-Type: application/json

{
  "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"
  }
}

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

Data info

to

string

Token identifier to which the swap is directed

from

string

Token identifier to which the swap is initiated

fromChain

object

ChainDTO fields explained:

Field
Type
Description

id

string

Chain ID

created

date-time

Chain created at

modified

date-time

Chain modified at

name

string

Chain name

shortName

string

Chain short name

addressValidation

string

Regex to validate the address

memoNeeded

boolean

Does the chain require a memo

hashUrl

string

Hash URL

explorerUrl

string

ExplorerURL

addressUrl

string

Address URL

icon

string

Icon URL

priority

number

Priority

kind

string

Chain kind

chainId

number

Chain ID

block

bigint

Block number

gasPrice

bigint

Gas Price

lastBaseFeePerGas

bigint

Last base fee per gas

maxFeePerGas

bigint

Max fee per gas

maxPriorityFeePerGas

bigint

Max priority fee per gas

enabled

boolean

Is chain enabled

shortNameV1

string

Chain short name v1

Last updated