cURL
curl -X POST https://api.relayer.fi/v1/action/builders/crosschain-bridge \
-H "Authorization: ApiKey $RELAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fromChain": "base",
"toChain": "polygon",
"token": "USDC",
"amount": "100"
}'const response = await fetch("https://api.relayer.fi/v1/action/builders/crosschain-bridge", {
method: "POST",
headers: {
Authorization: `ApiKey ${process.env.RELAYER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
fromChain: "base",
toChain: "polygon",
token: "USDC",
amount: "100",
}),
});
// Returns metadata for a cross-chain bridge widget.import requests
url = "https://testnet.relayer.fi/v1/action/builders/crosschain-bridge"
payload = {
"title": "Bridge USDC",
"description": "Bridge USDC from Avalanche to Arbitrum",
"icon": "https://example.com/usdc-icon.png",
"url": "https://example.com/bridge",
"sourceChainId": 43114,
"destinationChainId": 42161,
"address": "0xb00D916688FEE4aB6646994104E1441446947fc9"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Bridge USDC',
description: 'Bridge USDC from Avalanche to Arbitrum',
icon: 'https://example.com/usdc-icon.png',
url: 'https://example.com/bridge',
sourceChainId: 43114,
destinationChainId: 42161,
address: '0xb00D916688FEE4aB6646994104E1441446947fc9'
})
};
fetch('https://testnet.relayer.fi/v1/action/builders/crosschain-bridge', 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://testnet.relayer.fi/v1/action/builders/crosschain-bridge",
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([
'title' => 'Bridge USDC',
'description' => 'Bridge USDC from Avalanche to Arbitrum',
'icon' => 'https://example.com/usdc-icon.png',
'url' => 'https://example.com/bridge',
'sourceChainId' => 43114,
'destinationChainId' => 42161,
'address' => '0xb00D916688FEE4aB6646994104E1441446947fc9'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://testnet.relayer.fi/v1/action/builders/crosschain-bridge"
payload := strings.NewReader("{\n \"title\": \"Bridge USDC\",\n \"description\": \"Bridge USDC from Avalanche to Arbitrum\",\n \"icon\": \"https://example.com/usdc-icon.png\",\n \"url\": \"https://example.com/bridge\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 42161,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://testnet.relayer.fi/v1/action/builders/crosschain-bridge")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Bridge USDC\",\n \"description\": \"Bridge USDC from Avalanche to Arbitrum\",\n \"icon\": \"https://example.com/usdc-icon.png\",\n \"url\": \"https://example.com/bridge\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 42161,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.relayer.fi/v1/action/builders/crosschain-bridge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Bridge USDC\",\n \"description\": \"Bridge USDC from Avalanche to Arbitrum\",\n \"icon\": \"https://example.com/usdc-icon.png\",\n \"url\": \"https://example.com/bridge\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 42161,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"metadata": {}
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}Widget Actions
Generate metadata for Crosschain Bridge application
Creates metadata configuration for bridging assets between different blockchain networks.
POST
/
action
/
builders
/
crosschain-bridge
cURL
curl -X POST https://api.relayer.fi/v1/action/builders/crosschain-bridge \
-H "Authorization: ApiKey $RELAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fromChain": "base",
"toChain": "polygon",
"token": "USDC",
"amount": "100"
}'const response = await fetch("https://api.relayer.fi/v1/action/builders/crosschain-bridge", {
method: "POST",
headers: {
Authorization: `ApiKey ${process.env.RELAYER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
fromChain: "base",
toChain: "polygon",
token: "USDC",
amount: "100",
}),
});
// Returns metadata for a cross-chain bridge widget.import requests
url = "https://testnet.relayer.fi/v1/action/builders/crosschain-bridge"
payload = {
"title": "Bridge USDC",
"description": "Bridge USDC from Avalanche to Arbitrum",
"icon": "https://example.com/usdc-icon.png",
"url": "https://example.com/bridge",
"sourceChainId": 43114,
"destinationChainId": 42161,
"address": "0xb00D916688FEE4aB6646994104E1441446947fc9"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'Bridge USDC',
description: 'Bridge USDC from Avalanche to Arbitrum',
icon: 'https://example.com/usdc-icon.png',
url: 'https://example.com/bridge',
sourceChainId: 43114,
destinationChainId: 42161,
address: '0xb00D916688FEE4aB6646994104E1441446947fc9'
})
};
fetch('https://testnet.relayer.fi/v1/action/builders/crosschain-bridge', 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://testnet.relayer.fi/v1/action/builders/crosschain-bridge",
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([
'title' => 'Bridge USDC',
'description' => 'Bridge USDC from Avalanche to Arbitrum',
'icon' => 'https://example.com/usdc-icon.png',
'url' => 'https://example.com/bridge',
'sourceChainId' => 43114,
'destinationChainId' => 42161,
'address' => '0xb00D916688FEE4aB6646994104E1441446947fc9'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://testnet.relayer.fi/v1/action/builders/crosschain-bridge"
payload := strings.NewReader("{\n \"title\": \"Bridge USDC\",\n \"description\": \"Bridge USDC from Avalanche to Arbitrum\",\n \"icon\": \"https://example.com/usdc-icon.png\",\n \"url\": \"https://example.com/bridge\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 42161,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://testnet.relayer.fi/v1/action/builders/crosschain-bridge")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Bridge USDC\",\n \"description\": \"Bridge USDC from Avalanche to Arbitrum\",\n \"icon\": \"https://example.com/usdc-icon.png\",\n \"url\": \"https://example.com/bridge\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 42161,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.relayer.fi/v1/action/builders/crosschain-bridge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Bridge USDC\",\n \"description\": \"Bridge USDC from Avalanche to Arbitrum\",\n \"icon\": \"https://example.com/usdc-icon.png\",\n \"url\": \"https://example.com/bridge\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 42161,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"metadata": {}
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"data": {},
"path": "<string>",
"traceId": "<string>"
}Authorizations
Use this format: ApiKey <your_api_key>
Body
application/json
Parameters for generating crosschain bridge metadata
The title of the Application
The description of the Application
The URL of the Application
The source chain ID for the cross-chain transfer
The destination chain ID for the cross-chain transfer
The recipient address for the cross-chain transfer
The icon URL of the Application
⌘I