cURL
curl -X POST https://api.relayer.fi/v1/action/builders/crosschain-transfer \
-H "Authorization: ApiKey $RELAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fromChain": "base",
"toChain": "arbitrum",
"token": "USDC",
"to": "0xRecipient...",
"amount": "50"
}'const response = await fetch("https://api.relayer.fi/v1/action/builders/crosschain-transfer", {
method: "POST",
headers: {
Authorization: `ApiKey ${process.env.RELAYER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
fromChain: "base",
toChain: "arbitrum",
token: "USDC",
to: recipientAddress,
amount: "50",
}),
});import requests
url = "https://testnet.relayer.fi/v1/action/builders/crosschain-transfer"
payload = {
"title": "Transfer AVAX to ETH",
"description": "Transfer AVAX from Avalanche and receive ETH on Ethereum",
"icon": "https://example.com/transfer-icon.png",
"url": "https://example.com/transfer",
"sourceChainId": 43114,
"destinationChainId": 1,
"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: 'Transfer AVAX to ETH',
description: 'Transfer AVAX from Avalanche and receive ETH on Ethereum',
icon: 'https://example.com/transfer-icon.png',
url: 'https://example.com/transfer',
sourceChainId: 43114,
destinationChainId: 1,
address: '0xb00D916688FEE4aB6646994104E1441446947fc9'
})
};
fetch('https://testnet.relayer.fi/v1/action/builders/crosschain-transfer', 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-transfer",
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' => 'Transfer AVAX to ETH',
'description' => 'Transfer AVAX from Avalanche and receive ETH on Ethereum',
'icon' => 'https://example.com/transfer-icon.png',
'url' => 'https://example.com/transfer',
'sourceChainId' => 43114,
'destinationChainId' => 1,
'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-transfer"
payload := strings.NewReader("{\n \"title\": \"Transfer AVAX to ETH\",\n \"description\": \"Transfer AVAX from Avalanche and receive ETH on Ethereum\",\n \"icon\": \"https://example.com/transfer-icon.png\",\n \"url\": \"https://example.com/transfer\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 1,\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-transfer")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Transfer AVAX to ETH\",\n \"description\": \"Transfer AVAX from Avalanche and receive ETH on Ethereum\",\n \"icon\": \"https://example.com/transfer-icon.png\",\n \"url\": \"https://example.com/transfer\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 1,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.relayer.fi/v1/action/builders/crosschain-transfer")
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\": \"Transfer AVAX to ETH\",\n \"description\": \"Transfer AVAX from Avalanche and receive ETH on Ethereum\",\n \"icon\": \"https://example.com/transfer-icon.png\",\n \"url\": \"https://example.com/transfer\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 1,\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 Transfer application
Creates metadata configuration for transferring native tokens across different blockchain networks. Converts native currency from source chain to native currency on destination chain (e.g., AVAX -> ETH, AVAX -> MATIC).
POST
/
action
/
builders
/
crosschain-transfer
cURL
curl -X POST https://api.relayer.fi/v1/action/builders/crosschain-transfer \
-H "Authorization: ApiKey $RELAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fromChain": "base",
"toChain": "arbitrum",
"token": "USDC",
"to": "0xRecipient...",
"amount": "50"
}'const response = await fetch("https://api.relayer.fi/v1/action/builders/crosschain-transfer", {
method: "POST",
headers: {
Authorization: `ApiKey ${process.env.RELAYER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
fromChain: "base",
toChain: "arbitrum",
token: "USDC",
to: recipientAddress,
amount: "50",
}),
});import requests
url = "https://testnet.relayer.fi/v1/action/builders/crosschain-transfer"
payload = {
"title": "Transfer AVAX to ETH",
"description": "Transfer AVAX from Avalanche and receive ETH on Ethereum",
"icon": "https://example.com/transfer-icon.png",
"url": "https://example.com/transfer",
"sourceChainId": 43114,
"destinationChainId": 1,
"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: 'Transfer AVAX to ETH',
description: 'Transfer AVAX from Avalanche and receive ETH on Ethereum',
icon: 'https://example.com/transfer-icon.png',
url: 'https://example.com/transfer',
sourceChainId: 43114,
destinationChainId: 1,
address: '0xb00D916688FEE4aB6646994104E1441446947fc9'
})
};
fetch('https://testnet.relayer.fi/v1/action/builders/crosschain-transfer', 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-transfer",
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' => 'Transfer AVAX to ETH',
'description' => 'Transfer AVAX from Avalanche and receive ETH on Ethereum',
'icon' => 'https://example.com/transfer-icon.png',
'url' => 'https://example.com/transfer',
'sourceChainId' => 43114,
'destinationChainId' => 1,
'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-transfer"
payload := strings.NewReader("{\n \"title\": \"Transfer AVAX to ETH\",\n \"description\": \"Transfer AVAX from Avalanche and receive ETH on Ethereum\",\n \"icon\": \"https://example.com/transfer-icon.png\",\n \"url\": \"https://example.com/transfer\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 1,\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-transfer")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Transfer AVAX to ETH\",\n \"description\": \"Transfer AVAX from Avalanche and receive ETH on Ethereum\",\n \"icon\": \"https://example.com/transfer-icon.png\",\n \"url\": \"https://example.com/transfer\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 1,\n \"address\": \"0xb00D916688FEE4aB6646994104E1441446947fc9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.relayer.fi/v1/action/builders/crosschain-transfer")
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\": \"Transfer AVAX to ETH\",\n \"description\": \"Transfer AVAX from Avalanche and receive ETH on Ethereum\",\n \"icon\": \"https://example.com/transfer-icon.png\",\n \"url\": \"https://example.com/transfer\",\n \"sourceChainId\": 43114,\n \"destinationChainId\": 1,\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 native token transfer 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
Generate metadata for Native Token Transfer applicationGenerate metadata for Crosschain Bridge application
⌘I