Skip to main content
POST
/
v2
/
swap
/
bytecode
Generate transaction bytecode
curl --request POST \
  --url https://api.deframe.io/v2/swap/bytecode \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "quoteId": "550e8400-e29b-41d4-a716-446655440000",
  "originAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "destinationAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "rawQuote": "<unknown>"
}
'
{
  "chainId": 1,
  "transactionData": [
    {
      "chainId": 1,
      "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "data": "0x...",
      "value": "0",
      "from": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
    }
  ]
}

Authorizations

x-api-key
string
header
required

API key for authentication. Obtain from your Deframe dashboard.

Body

application/json
quoteId
string
required

Quote ID from /v2/swap/quote

Example:

"550e8400-e29b-41d4-a716-446655440000"

originAddress
string
required

Address executing the swap on origin chain

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

destinationAddress
string
required

Address receiving tokens on destination chain

Example:

"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

rawQuote
any | null

Raw quote data from the quote response

Response

Bytecode generated successfully

chainId
number
required
Example:

1

transactionData
object[]
required