curl -X POST https://api.dzap.io/v1/buildTx \
-H "Content-Type: application/json" \
-d '{
"sender": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"refundee": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"fromChain": 42161,
"gasless": false,
"data": [
{
"amount": "1000000",
"srcToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"destToken": "0x4200000000000000000000000000000000000006",
"toChain": 8453,
"protocol": "across",
"recipient": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"slippage": 1
}
]
}'
const request = {
sender: userAccount,
refundee: userAccount,
fromChain: 42161,
gasless: false,
data: [
{
amount: '1000000',
srcToken: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
destToken: '0x4200000000000000000000000000000000000006',
toChain: 8453,
protocol: 'across',
recipient: userAccount,
slippage: 1,
},
],
};
// Build only:
const buildResponse = await dzap.buildTradeTxn(request);
// Or build + sign + execute in one call:
const result = await dzap.trade({ request, signer });
{
"status": "success",
"txId": "0xabc123...",
"chainId": 42161,
"transaction": {
"from": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"data": "0x...",
"to": "0x1d46863e3592745008b5CbbAC12014F67329A9b8",
"value": "0",
"gasLimit": "350000"
},
"gasless": false,
"private": false,
"quotes": {
"across": {
"provider": "across",
"destAmount": "300000000000000",
"minDestAmount": "298500000000000",
"duration": "90"
}
},
"additionalInfo": {},
"updatedQuotes": {}
}
Trade API
Build Transaction
Turn a trade quote into ready-to-sign transaction calldata, for standard or gasless execution.
POST
/
v1
/
buildTx
curl -X POST https://api.dzap.io/v1/buildTx \
-H "Content-Type: application/json" \
-d '{
"sender": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"refundee": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"fromChain": 42161,
"gasless": false,
"data": [
{
"amount": "1000000",
"srcToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"destToken": "0x4200000000000000000000000000000000000006",
"toChain": 8453,
"protocol": "across",
"recipient": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"slippage": 1
}
]
}'
const request = {
sender: userAccount,
refundee: userAccount,
fromChain: 42161,
gasless: false,
data: [
{
amount: '1000000',
srcToken: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
destToken: '0x4200000000000000000000000000000000000006',
toChain: 8453,
protocol: 'across',
recipient: userAccount,
slippage: 1,
},
],
};
// Build only:
const buildResponse = await dzap.buildTradeTxn(request);
// Or build + sign + execute in one call:
const result = await dzap.trade({ request, signer });
{
"status": "success",
"txId": "0xabc123...",
"chainId": 42161,
"transaction": {
"from": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"data": "0x...",
"to": "0x1d46863e3592745008b5CbbAC12014F67329A9b8",
"value": "0",
"gasLimit": "350000"
},
"gasless": false,
"private": false,
"quotes": {
"across": {
"provider": "across",
"destAmount": "300000000000000",
"minDestAmount": "298500000000000",
"duration": "90"
}
},
"additionalInfo": {},
"updatedQuotes": {}
}
Takes the route(s) you selected from
Response - non-gasless (
Response - gasless (
/v1/quotes (via protocol) and returns transaction data ready to sign and submit.
Body
string
required
Wallet address sending the transaction.
string
required
Address to receive refunds.
integer
required
Source chain ID for every item in
data.boolean
required
false for standard execution; true for the gasless/intent flow.object[]
required
Array of trade legs to build.
Show data item
Show data item
string
required
Amount in the source token’s smallest unit.
string
required
Source token contract address.
integer
Source token decimals.
string
required
Destination token contract address.
integer
Destination token decimals.
integer
required
Destination chain ID.
string
required
Provider ID selected from the quote response (e.g.
recommendedSource).string
required
Address to receive the destination tokens.
number
required
Slippage tolerance, in percent.
object
Route-specific data echoed back from the quote.
string
Pre-signed permit data for the source token.
boolean
Request private/MEV-protected execution.
boolean
Skip gas estimation for a faster build.
boolean
Set
true if Permit2 approval already exists for every token in data.string
Required for Bitcoin-chain transactions only.
Response - non-gasless (gasless: false)
string
"success" when the build succeeds.string
Unique build/transaction ID - use for status polling and broadcasting.
integer
Chain where the transaction is to be executed.
object
Chain-specific payload - shape depends on the chain type.
Show transaction (evm)
Show transaction (evm)
Show transaction (HyperLiquid)
Show transaction (HyperLiquid)
object[]
Array of
{ domain, types, primaryType, message } typed-data payloads to sign.boolean
false.boolean
Echoes whether private/MEV-protected execution was used.
object
string
@deprecated - top-level mirror of transaction.data for EVM chains.string
@deprecated - top-level mirror of transaction.from.string
@deprecated - top-level mirror of transaction.to.string
@deprecated - top-level mirror of transaction.value.string
@deprecated - top-level mirror of transaction.gasLimit.object
{ blockhash, lastValidBlockHeight }, present for Solana transactions.object
{ inputs, outputs, feeRate }, present for Bitcoin transactions.object
{ paymentRequestType: "bolt11", paymentRequest, paymentExpiry }, present for Bitcoin Lightning.object
Record<string, Record<string, unknown>>.object
Record<string, string> - refreshed destination amounts keyed by pair ID.Response - gasless (gasless: true)
string
"success".string
Intent ID - pass to
/v1/gasless/executeTx once signed.object
object
Same shape as the non-gasless response above.
boolean
true.boolean
false.Examples
curl -X POST https://api.dzap.io/v1/buildTx \
-H "Content-Type: application/json" \
-d '{
"sender": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"refundee": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"fromChain": 42161,
"gasless": false,
"data": [
{
"amount": "1000000",
"srcToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"destToken": "0x4200000000000000000000000000000000000006",
"toChain": 8453,
"protocol": "across",
"recipient": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"slippage": 1
}
]
}'
const request = {
sender: userAccount,
refundee: userAccount,
fromChain: 42161,
gasless: false,
data: [
{
amount: '1000000',
srcToken: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',
destToken: '0x4200000000000000000000000000000000000006',
toChain: 8453,
protocol: 'across',
recipient: userAccount,
slippage: 1,
},
],
};
// Build only:
const buildResponse = await dzap.buildTradeTxn(request);
// Or build + sign + execute in one call:
const result = await dzap.trade({ request, signer });
{
"status": "success",
"txId": "0xabc123...",
"chainId": 42161,
"transaction": {
"from": "0x99BCEBf44433E901597D9fCb16E799a4847519f6",
"data": "0x...",
"to": "0x1d46863e3592745008b5CbbAC12014F67329A9b8",
"value": "0",
"gasLimit": "350000"
},
"gasless": false,
"private": false,
"quotes": {
"across": {
"provider": "across",
"destAmount": "300000000000000",
"minDestAmount": "298500000000000",
"duration": "90"
}
},
"additionalInfo": {},
"updatedQuotes": {}
}
Use the
txId to poll /v1/status once the transaction has been signed and sent.Last modified on July 29, 2026