Skip to main content
POST
/
buildTx
Build a transaction for swap or bridge
curl --request POST \
  --url https://api.dzap.io/v1/buildTx \
  --header 'Content-Type: application/json' \
  --data '{
  "fromChain": 42161,
  "integratorId": "dzap",
  "sender": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
  "refundee": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
  "disableEstimation": false,
  "data": [
    {
      "amount": "332999",
      "srcToken": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
      "srcDecimals": 6,
      "destToken": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
      "destDecimals": 6,
      "slippage": 0.9,
      "selectedRoute": "router",
      "recipient": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
      "toChain": 137,
      "additionalInfo": {}
    }
  ]
}'
{
  "status": "success",
  "data": "0x000000....",
  "to": "0xF708e11A7C94abdE8f6217B13e6fE39C8b9cC0a6",
  "from": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
  "chainId": 42161,
  "value": "0",
  "gasLimit": "982242",
  "additionalInfo": {}
}

Body

application/json
fromChain
integer
required

Source chain ID where the transaction will be executed

Example:

42161

integratorId
string
required

Integrator identifier used to identify the calling application

Example:

"dzap"

refundee
string<address>
required

Address to receive refunds in case of failed transactions

Example:

"0x99BCEBf44433E901597D9fCb16E799a4847519f6"

data
object[]
required

Array of transaction build details for each token pair to be swapped

sender
string<address>

User's wallet address that will send the transaction

Example:

"0x99BCEBf44433E901597D9fCb16E799a4847519f6"

disableEstimation
boolean

Whether to disable gas estimation and simulation for the transaction

Example:

false

Response

Successful response with transaction data

status
string
Example:

"success"

data
string

Encoded call data

to
string<address>
Example:

"0xF708e11A7C94abdE8f6217B13e6fE39C8b9cC0a6"

from
string<address>
Example:

"0x99BCEBf44433E901597D9fCb16E799a4847519f6"

chainId
integer
Example:

42161

value
string
Example:

"0"

gasLimit
string
Example:

"982242"

additionalInfo
object
Example:
{}
I