curl --request POST \
--url https://router.raze.bot/tx/v1 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"payer": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"instructions": [
{
"programId": "11111111111111111111111111111111",
"accounts": [
{
"pubkey": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"isSigner": true,
"isWritable": true
},
{
"pubkey": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
"isSigner": false,
"isWritable": true
}
],
"data": "AgAAAAEAAAAAAAAA"
}
],
"blockhash": "6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD",
"config": {
"computeUnitLimit": 1000,
"loadedAccountsDataSizeLimit": 65536,
"priorityFeeLamports": 1000
}
}
'import requests
url = "https://router.raze.bot/tx/v1"
payload = {
"payer": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"instructions": [
{
"programId": "11111111111111111111111111111111",
"accounts": [
{
"pubkey": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"isSigner": True,
"isWritable": True
},
{
"pubkey": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
"isSigner": False,
"isWritable": True
}
],
"data": "AgAAAAEAAAAAAAAA"
}
],
"blockhash": "6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD",
"config": {
"computeUnitLimit": 1000,
"loadedAccountsDataSizeLimit": 65536,
"priorityFeeLamports": 1000
}
}
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({
payer: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
instructions: [
{
programId: '11111111111111111111111111111111',
accounts: [
{
pubkey: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
isSigner: true,
isWritable: true
},
{
pubkey: '5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9',
isSigner: false,
isWritable: true
}
],
data: 'AgAAAAEAAAAAAAAA'
}
],
blockhash: '6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD',
config: {
computeUnitLimit: 1000,
loadedAccountsDataSizeLimit: 65536,
priorityFeeLamports: 1000
}
})
};
fetch('https://router.raze.bot/tx/v1', 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://router.raze.bot/tx/v1",
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([
'payer' => '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
'instructions' => [
[
'programId' => '11111111111111111111111111111111',
'accounts' => [
[
'pubkey' => '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
'isSigner' => true,
'isWritable' => true
],
[
'pubkey' => '5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9',
'isSigner' => false,
'isWritable' => true
]
],
'data' => 'AgAAAAEAAAAAAAAA'
]
],
'blockhash' => '6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD',
'config' => [
'computeUnitLimit' => 1000,
'loadedAccountsDataSizeLimit' => 65536,
'priorityFeeLamports' => 1000
]
]),
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://router.raze.bot/tx/v1"
payload := strings.NewReader("{\n \"payer\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"instructions\": [\n {\n \"programId\": \"11111111111111111111111111111111\",\n \"accounts\": [\n {\n \"pubkey\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"isSigner\": true,\n \"isWritable\": true\n },\n {\n \"pubkey\": \"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9\",\n \"isSigner\": false,\n \"isWritable\": true\n }\n ],\n \"data\": \"AgAAAAEAAAAAAAAA\"\n }\n ],\n \"blockhash\": \"6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD\",\n \"config\": {\n \"computeUnitLimit\": 1000,\n \"loadedAccountsDataSizeLimit\": 65536,\n \"priorityFeeLamports\": 1000\n }\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://router.raze.bot/tx/v1")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payer\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"instructions\": [\n {\n \"programId\": \"11111111111111111111111111111111\",\n \"accounts\": [\n {\n \"pubkey\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"isSigner\": true,\n \"isWritable\": true\n },\n {\n \"pubkey\": \"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9\",\n \"isSigner\": false,\n \"isWritable\": true\n }\n ],\n \"data\": \"AgAAAAEAAAAAAAAA\"\n }\n ],\n \"blockhash\": \"6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD\",\n \"config\": {\n \"computeUnitLimit\": 1000,\n \"loadedAccountsDataSizeLimit\": 65536,\n \"priorityFeeLamports\": 1000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://router.raze.bot/tx/v1")
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 \"payer\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"instructions\": [\n {\n \"programId\": \"11111111111111111111111111111111\",\n \"accounts\": [\n {\n \"pubkey\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"isSigner\": true,\n \"isWritable\": true\n },\n {\n \"pubkey\": \"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9\",\n \"isSigner\": false,\n \"isWritable\": true\n }\n ],\n \"data\": \"AgAAAAEAAAAAAAAA\"\n }\n ],\n \"blockhash\": \"6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD\",\n \"config\": {\n \"computeUnitLimit\": 1000,\n \"loadedAccountsDataSizeLimit\": 65536,\n \"priorityFeeLamports\": 1000\n }\n}"
response = http.request(request)
puts response.read_body{
"swapTransaction": "gQEAAQ8AAABRSwQ+upVuTIeWwCCmtaVlhi4tMrqENO/XArof9oe9LgEDfowI…",
"txVersion": "v1",
"bytes": 236,
"instructions": 1
}Serialize a v1 transaction
Your own instructions, serialized exactly as given into an unsigned v1 (SIMD-0385)
transaction: nothing is inspected, reordered, added, signed, routed or sent. Use it to
assemble a swap you composed from /swap-instructions (plus your own instructions) without
writing a v1 encoder. The instruction JSON is the one /swap-instructions emits.
config.computeUnitLimit and config.loadedAccountsDataSizeLimit are required and
nonzero: in a v1 message an absent limit reads as zero at runtime, and the transaction
could not execute. Copy them from transactionConfig of the build, adding what your extra
instructions need. The router does not check the blockhash. Works on a router that is not ready.
Limits: 4,096 bytes, 64 instructions, 64 distinct account keys (413 wire_limit; nothing is truncated).
curl --request POST \
--url https://router.raze.bot/tx/v1 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"payer": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"instructions": [
{
"programId": "11111111111111111111111111111111",
"accounts": [
{
"pubkey": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"isSigner": true,
"isWritable": true
},
{
"pubkey": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
"isSigner": false,
"isWritable": true
}
],
"data": "AgAAAAEAAAAAAAAA"
}
],
"blockhash": "6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD",
"config": {
"computeUnitLimit": 1000,
"loadedAccountsDataSizeLimit": 65536,
"priorityFeeLamports": 1000
}
}
'import requests
url = "https://router.raze.bot/tx/v1"
payload = {
"payer": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"instructions": [
{
"programId": "11111111111111111111111111111111",
"accounts": [
{
"pubkey": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"isSigner": True,
"isWritable": True
},
{
"pubkey": "5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9",
"isSigner": False,
"isWritable": True
}
],
"data": "AgAAAAEAAAAAAAAA"
}
],
"blockhash": "6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD",
"config": {
"computeUnitLimit": 1000,
"loadedAccountsDataSizeLimit": 65536,
"priorityFeeLamports": 1000
}
}
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({
payer: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
instructions: [
{
programId: '11111111111111111111111111111111',
accounts: [
{
pubkey: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
isSigner: true,
isWritable: true
},
{
pubkey: '5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9',
isSigner: false,
isWritable: true
}
],
data: 'AgAAAAEAAAAAAAAA'
}
],
blockhash: '6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD',
config: {
computeUnitLimit: 1000,
loadedAccountsDataSizeLimit: 65536,
priorityFeeLamports: 1000
}
})
};
fetch('https://router.raze.bot/tx/v1', 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://router.raze.bot/tx/v1",
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([
'payer' => '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
'instructions' => [
[
'programId' => '11111111111111111111111111111111',
'accounts' => [
[
'pubkey' => '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
'isSigner' => true,
'isWritable' => true
],
[
'pubkey' => '5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9',
'isSigner' => false,
'isWritable' => true
]
],
'data' => 'AgAAAAEAAAAAAAAA'
]
],
'blockhash' => '6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD',
'config' => [
'computeUnitLimit' => 1000,
'loadedAccountsDataSizeLimit' => 65536,
'priorityFeeLamports' => 1000
]
]),
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://router.raze.bot/tx/v1"
payload := strings.NewReader("{\n \"payer\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"instructions\": [\n {\n \"programId\": \"11111111111111111111111111111111\",\n \"accounts\": [\n {\n \"pubkey\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"isSigner\": true,\n \"isWritable\": true\n },\n {\n \"pubkey\": \"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9\",\n \"isSigner\": false,\n \"isWritable\": true\n }\n ],\n \"data\": \"AgAAAAEAAAAAAAAA\"\n }\n ],\n \"blockhash\": \"6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD\",\n \"config\": {\n \"computeUnitLimit\": 1000,\n \"loadedAccountsDataSizeLimit\": 65536,\n \"priorityFeeLamports\": 1000\n }\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://router.raze.bot/tx/v1")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payer\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"instructions\": [\n {\n \"programId\": \"11111111111111111111111111111111\",\n \"accounts\": [\n {\n \"pubkey\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"isSigner\": true,\n \"isWritable\": true\n },\n {\n \"pubkey\": \"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9\",\n \"isSigner\": false,\n \"isWritable\": true\n }\n ],\n \"data\": \"AgAAAAEAAAAAAAAA\"\n }\n ],\n \"blockhash\": \"6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD\",\n \"config\": {\n \"computeUnitLimit\": 1000,\n \"loadedAccountsDataSizeLimit\": 65536,\n \"priorityFeeLamports\": 1000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://router.raze.bot/tx/v1")
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 \"payer\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"instructions\": [\n {\n \"programId\": \"11111111111111111111111111111111\",\n \"accounts\": [\n {\n \"pubkey\": \"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM\",\n \"isSigner\": true,\n \"isWritable\": true\n },\n {\n \"pubkey\": \"5tzFkiKscXHK5ZXCGbXZxdw7gTjjD1mBwuoFbhUvuAi9\",\n \"isSigner\": false,\n \"isWritable\": true\n }\n ],\n \"data\": \"AgAAAAEAAAAAAAAA\"\n }\n ],\n \"blockhash\": \"6ULNNrJUtsDgRFcEP462ebbxRMXo1HwtzY45WjG6D5vD\",\n \"config\": {\n \"computeUnitLimit\": 1000,\n \"loadedAccountsDataSizeLimit\": 65536,\n \"priorityFeeLamports\": 1000\n }\n}"
response = http.request(request)
puts response.read_body{
"swapTransaction": "gQEAAQ8AAABRSwQ+upVuTIeWwCCmtaVlhi4tMrqENO/XArof9oe9LgEDfowI…",
"txVersion": "v1",
"bytes": 236,
"instructions": 1
}