Skip to main content
POST
/
v1
/
instructions
/
build-ccip
Build CCIP token bridge instructions
curl --request POST \
  --url https://api.biconomy.io/v1/instructions/build-ccip \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "srcToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "dstToken": "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
  "srcChainId": 8453,
  "dstChainId": 10,
  "ownerAddress": "0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a",
  "amount": {
    "type": "runtimeErc20Balance",
    "tokenAddress": "<unknown>",
    "targetAddress": "0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a",
    "constraints": {
      "gte": "1000000",
      "lte": "10000000",
      "eq": "5000000"
    }
  },
  "gasLimit": "50000"
}
'
import requests

url = "https://api.biconomy.io/v1/instructions/build-ccip"

payload = {
"srcToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"dstToken": "0x94b008aa00579c1307b0ef2c499ad98a8ce58e58",
"srcChainId": 8453,
"dstChainId": 10,
"ownerAddress": "0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a",
"amount": {
"type": "runtimeErc20Balance",
"tokenAddress": "<unknown>",
"targetAddress": "0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a",
"constraints": {
"gte": "1000000",
"lte": "10000000",
"eq": "5000000"
}
},
"gasLimit": "50000"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
srcToken: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',
dstToken: '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58',
srcChainId: 8453,
dstChainId: 10,
ownerAddress: '0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a',
amount: {
type: 'runtimeErc20Balance',
tokenAddress: '<unknown>',
targetAddress: '0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a',
constraints: {gte: '1000000', lte: '10000000', eq: '5000000'}
},
gasLimit: '50000'
})
};

fetch('https://api.biconomy.io/v1/instructions/build-ccip', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.biconomy.io/v1/instructions/build-ccip",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'srcToken' => '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',
'dstToken' => '0x94b008aa00579c1307b0ef2c499ad98a8ce58e58',
'srcChainId' => 8453,
'dstChainId' => 10,
'ownerAddress' => '0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a',
'amount' => [
'type' => 'runtimeErc20Balance',
'tokenAddress' => '<unknown>',
'targetAddress' => '0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a',
'constraints' => [
'gte' => '1000000',
'lte' => '10000000',
'eq' => '5000000'
]
],
'gasLimit' => '50000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.biconomy.io/v1/instructions/build-ccip"

payload := strings.NewReader("{\n \"srcToken\": \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"dstToken\": \"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58\",\n \"srcChainId\": 8453,\n \"dstChainId\": 10,\n \"ownerAddress\": \"0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a\",\n \"amount\": {\n \"type\": \"runtimeErc20Balance\",\n \"tokenAddress\": \"<unknown>\",\n \"targetAddress\": \"0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a\",\n \"constraints\": {\n \"gte\": \"1000000\",\n \"lte\": \"10000000\",\n \"eq\": \"5000000\"\n }\n },\n \"gasLimit\": \"50000\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.biconomy.io/v1/instructions/build-ccip")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"srcToken\": \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"dstToken\": \"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58\",\n \"srcChainId\": 8453,\n \"dstChainId\": 10,\n \"ownerAddress\": \"0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a\",\n \"amount\": {\n \"type\": \"runtimeErc20Balance\",\n \"tokenAddress\": \"<unknown>\",\n \"targetAddress\": \"0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a\",\n \"constraints\": {\n \"gte\": \"1000000\",\n \"lte\": \"10000000\",\n \"eq\": \"5000000\"\n }\n },\n \"gasLimit\": \"50000\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.biconomy.io/v1/instructions/build-ccip")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"srcToken\": \"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913\",\n \"dstToken\": \"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58\",\n \"srcChainId\": 8453,\n \"dstChainId\": 10,\n \"ownerAddress\": \"0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a\",\n \"amount\": {\n \"type\": \"runtimeErc20Balance\",\n \"tokenAddress\": \"<unknown>\",\n \"targetAddress\": \"0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a\",\n \"constraints\": {\n \"gte\": \"1000000\",\n \"lte\": \"10000000\",\n \"eq\": \"5000000\"\n }\n },\n \"gasLimit\": \"50000\"\n}"

response = http.request(request)
puts response.read_body
{
  "instructions": [
    {
      "calls": [
        {
          "to": "0x1111111254EEB25477B68fb85Ed929f73A960582",
          "value": "0",
          "functionSig": "transfer(address,uint256)",
          "inputParams": [
            {
              "fetcherType": 0,
              "paramData": "0x742d35C9a91B1D5b5D24Dc30e8F0dF8E84b5d1c4",
              "constraints": []
            }
          ],
          "outputParams": [
            {
              "fetcherType": 0,
              "paramData": "0x"
            }
          ],
          "gasLimit": "100000"
        }
      ],
      "chainId": 1,
      "isComposable": true
    }
  ],
  "simulationTokenOverrides": [
    {
      "tokenAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "accountAddress": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
      "chainId": 8453,
      "balance": "12345678901234567890"
    }
  ]
}
{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}
{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
]
}

Authorizations

X-API-Key
string
header
required

API Key required to access Supertransaction API. Example: mee_2w3mXCuyt4xVXDRCZ5k5Lhgs

Body

application/json

Body

Object containing the CCIP token bridging field, including source/destination tokens and chains, user address, amount, execution mode, and slippage tolerance.

srcToken
string
required

Source token EVM address. Must be a valid checksummed Ethereum address.

Example:

"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"

dstToken
string
required

Destination token EVM address. Must be a valid checksummed Ethereum address.

Example:

"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58"

srcChainId
number
required

The source chain ID for the swap or token bridging. Use a supported chain ID number.

Example:

8453

dstChainId
number
required

The destination chain ID for the swap or token bridging. Use a supported chain ID number.

Example:

10

ownerAddress
string
required

EOA wallet address which is going to be used as a owner of orchestrator account

Example:

"0x742d35cc6639cb8d4b5d1c5d7b8b5e2e7c0c7a8a"

amount
object
required

Schema for specifying a runtime ERC20 balance check, including the target address, token address, and optional constraints.

mode
enum<string>
required
Available options:
smart-account,
eoa,
eoa-7702
gasLimit
string

Gas limit for the CCIP token bridging

Example:

"50000"

Response

200

instructions
object[]
required

Array of MEE instructions ready for execution

simulationTokenOverrides
object[]