cURL
# Agent endpoints require HMAC-SHA256 signing. See
# /get-started/authentication for the full payload + headers spec, or use
# the @relayerfi/agent-sdk which signs automatically.
curl -X POST https://api.relayer.fi/v1/agents/$AGENT_ID/sign-transaction \
-H "x-agent-id: $AGENT_ID" \
-H "x-agent-auth: $HMAC_SIGNATURE_HEX" \
-H "x-request-timestamp: $UNIX_TS" \
-H "Content-Type: application/json" \
-d '{
"unsignedTx": "<base64-solana-tx>"
}'import { RelayerSDK } from "@relayerfi/agent-sdk";
const sdk = new RelayerSDK({
agentId: process.env.RELAYER_AGENT_ID!,
agentSecret: process.env.RELAYER_AGENT_SECRET!,
apiUrl: "https://api.relayer.fi",
});
const response = await sdk.http.request("POST", `/agents/${sdk.agentId}/sign-transaction`, {
unsignedTx: base64SolanaTx,
});
// response.signature — base64 signature ready to submit to Solana RPCimport requests
url = "https://testnet.relayer.fi/v1/agents/{id}/sign-transaction"
payload = {
"action_type": "<string>",
"amount": "<string>",
"destination": "<string>",
"token_mint": "<string>",
"cluster": "devnet"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action_type: '<string>',
amount: '<string>',
destination: '<string>',
token_mint: '<string>',
cluster: 'devnet'
})
};
fetch('https://testnet.relayer.fi/v1/agents/{id}/sign-transaction', 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/agents/{id}/sign-transaction",
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([
'action_type' => '<string>',
'amount' => '<string>',
'destination' => '<string>',
'token_mint' => '<string>',
'cluster' => 'devnet'
]),
CURLOPT_HTTPHEADER => [
"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/agents/{id}/sign-transaction"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"token_mint\": \"<string>\",\n \"cluster\": \"devnet\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/agents/{id}/sign-transaction")
.header("Content-Type", "application/json")
.body("{\n \"action_type\": \"<string>\",\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"token_mint\": \"<string>\",\n \"cluster\": \"devnet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.relayer.fi/v1/agents/{id}/sign-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_type\": \"<string>\",\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"token_mint\": \"<string>\",\n \"cluster\": \"devnet\"\n}"
response = http.request(request)
puts response.read_bodyRuntime (HMAC)
Sign a Solana transaction for an agent
<!-- relayer:auth-badge:start -->
> **Auth: agent HMAC.** Called by the agent SDK at runtime with `x-agent-id`, `x-agent-auth`, `x-request-timestamp` headers. **Not callable from backend ApiKey.** See [Authentication → Agent HMAC](/get-started/authentication).
<!-- relayer:auth-badge:end -->
POST
/
agents
/
{id}
/
sign-transaction
cURL
# Agent endpoints require HMAC-SHA256 signing. See
# /get-started/authentication for the full payload + headers spec, or use
# the @relayerfi/agent-sdk which signs automatically.
curl -X POST https://api.relayer.fi/v1/agents/$AGENT_ID/sign-transaction \
-H "x-agent-id: $AGENT_ID" \
-H "x-agent-auth: $HMAC_SIGNATURE_HEX" \
-H "x-request-timestamp: $UNIX_TS" \
-H "Content-Type: application/json" \
-d '{
"unsignedTx": "<base64-solana-tx>"
}'import { RelayerSDK } from "@relayerfi/agent-sdk";
const sdk = new RelayerSDK({
agentId: process.env.RELAYER_AGENT_ID!,
agentSecret: process.env.RELAYER_AGENT_SECRET!,
apiUrl: "https://api.relayer.fi",
});
const response = await sdk.http.request("POST", `/agents/${sdk.agentId}/sign-transaction`, {
unsignedTx: base64SolanaTx,
});
// response.signature — base64 signature ready to submit to Solana RPCimport requests
url = "https://testnet.relayer.fi/v1/agents/{id}/sign-transaction"
payload = {
"action_type": "<string>",
"amount": "<string>",
"destination": "<string>",
"token_mint": "<string>",
"cluster": "devnet"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action_type: '<string>',
amount: '<string>',
destination: '<string>',
token_mint: '<string>',
cluster: 'devnet'
})
};
fetch('https://testnet.relayer.fi/v1/agents/{id}/sign-transaction', 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/agents/{id}/sign-transaction",
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([
'action_type' => '<string>',
'amount' => '<string>',
'destination' => '<string>',
'token_mint' => '<string>',
'cluster' => 'devnet'
]),
CURLOPT_HTTPHEADER => [
"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/agents/{id}/sign-transaction"
payload := strings.NewReader("{\n \"action_type\": \"<string>\",\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"token_mint\": \"<string>\",\n \"cluster\": \"devnet\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/agents/{id}/sign-transaction")
.header("Content-Type", "application/json")
.body("{\n \"action_type\": \"<string>\",\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"token_mint\": \"<string>\",\n \"cluster\": \"devnet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.relayer.fi/v1/agents/{id}/sign-transaction")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"action_type\": \"<string>\",\n \"amount\": \"<string>\",\n \"destination\": \"<string>\",\n \"token_mint\": \"<string>\",\n \"cluster\": \"devnet\"\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
Agent ID
Body
application/json
Action type (e.g., "payment", "transfer")
Amount in smallest unit (e.g., USDC micro-units as string)
Destination wallet address
SPL token mint address
Solana cluster (devnet or mainnet-beta)
Response
Transaction signed and broadcast (below threshold)
⌘I