Send Transactions
Send already-signed Solana transactions to the network through FlashLand. Your transaction is forwarded unchanged: nothing is added to it, reordered or re-signed.
You pay for each send with a tip inside the transaction itself (see Pay the tip inside the transaction), so a transaction that does not land costs nothing.
Endpoint
POST https://send.flashland.dev/v1/transactions
GET https://send.flashland.dev/v1/healthAuthentication
Every send carries your API key as a bearer token. Find the key on the Send page of your dashboard. Treat it like a password. Keep it out of logs and client code.
Authorization: Bearer YOUR_API_KEYSend a transaction
The body is JSON with one field, transaction: the base64 of a fully signed legacy or versioned transaction, at most 1,232 bytes before encoding.
curl -sS https://send.flashland.dev/v1/transactions \
-H "Authorization: Bearer $SEND_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"transaction\":\"$TRANSACTION_BASE64\"}"const res = await fetch("https://send.flashland.dev/v1/transactions", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SEND_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ transaction: Buffer.from(tx.serialize()).toString("base64") }),
});
if (!res.ok) { const { error } = await res.json(); throw new Error(`${error.code}: ${error.message}`); }
console.log((await res.json()).signature);The receipt
{
"signature": "5Nx3...qT7w",
"accepted": true,
"duplicate": false,
"charged_lamports": 200000,
"balance_remaining_lamports": 49800000,
"payment_mode": "balance"
}| Field | Meaning |
|---|---|
signature | The transaction signature, read from the bytes you sent. |
accepted | The send was forwarded and acknowledged. It is not a landing guarantee: confirm the signature on chain. |
duplicate | The same signature was already accepted in the last 90 seconds. It is not forwarded or charged again. |
charged_lamports | What this send reserved from your balance. It settles when the transaction lands. |
balance_remaining_lamports | Your balance after this send. |
payment_mode | balance for a prepaid send. |
Amounts are in lamports (1 SOL = 1,000,000,000 lamports) at this store's price per send.
Regional endpoints
Send from the endpoint that suits you. Every endpoint reaches the same account and the same balance; use the QUIC endpoint where you can, it is the fastest way to send.
| Region | QUIC (fastest) | HTTPS |
|---|---|---|
| Frankfurt (default) | quic.flashland.dev:11000 | https://send.flashland.dev/v1/transactions |
| New York | quic.nyc.flashland.dev:11000 | https://send.nyc.flashland.dev/v1/transactions |
An endpoint that is not listed is not available yet.
More examples
The same send in Python:
import base64, os, requests
res = requests.post(
"https://send.flashland.dev/v1/transactions",
headers={"Authorization": f"Bearer {os.environ['SEND_API_KEY']}"},
json={"transaction": base64.b64encode(bytes(tx)).decode()},
timeout=10,
)
res.raise_for_status()
print(res.json()["signature"])Keep the connection open over HTTPS, so only the first send pays for the handshake:
import { Agent } from "undici";
const agent = new Agent({ keepAliveTimeout: 60_000, keepAliveMaxTimeout: 300_000, connections: 4, pipelining: 1 });
export async function send(tx: Uint8Array) {
const res = await fetch("https://send.flashland.dev/v1/transactions", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SEND_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ transaction: Buffer.from(tx).toString("base64") }),
// @ts-expect-error undici's dispatcher is not in the DOM fetch types
dispatcher: agent,
});
if (!res.ok) { const { error } = await res.json(); throw new Error(`${error.code}: ${error.message}`); }
return res.json();
}import base64, os, requests
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['SEND_API_KEY']}"
def send(tx: bytes):
res = session.post("https://send.flashland.dev/v1/transactions", json={"transaction": base64.b64encode(tx).decode()}, timeout=10)
res.raise_for_status()
return res.json()Pay the tip inside the transaction
Pay for a send with a SOL transfer (the tip) to the tip account, inside the transaction you sign. No deposit is needed, and a send paid this way is not charged to any balance: its receipt shows charged_lamports 0.
- Tip account:
YOUR_TIP_ADDRESS - Minimum: 0.0002 SOL (
200000lamports). There is no maximum; any amount at or above the minimum counts.
Step by step:
- Get your send address and API key from the Send page of your dashboard.
- Add one SOL transfer to the tip account, of at least the minimum, from a wallet that signs the transaction.
- Sign the transaction as usual and send it to
https://send.flashland.dev/v1/transactionswith your API key. - Check the Send page: once the transaction is final on chain, its activity shows the tip you paid.
Rules the relay checks:
- Exactly one transfer to the tip account in each transaction. A transaction with two is refused with
INVALID_TRANSACTION. - A plain System Program transfer as its own instruction, not one made from inside another program.
- The tip account in the transaction itself, not in an address lookup table. A tip the relay cannot see does not count.
- A tip below the minimum is refused with
PAYMENT_TOO_LOWand not sent, so nothing is paid. - A transaction without the tip is paid from your balance; with no balance it is refused with
INSUFFICIENT_BALANCE. - If the transaction does not land, or fails on chain, the tip is not paid. Solana still takes its network fee for a failed transaction.
import { Connection, PublicKey, SystemProgram, TransactionMessage, VersionedTransaction } from "@solana/web3.js";
const TIP_ACCOUNT = new PublicKey("YOUR_TIP_ADDRESS");
const MIN_TIP = 200000; // lamports = 0.0002 SOL. You can tip more.
// 1. Your own instructions, plus ONE transfer to the tip account, signed by the payer.
const instructions = [
...yourInstructions,
SystemProgram.transfer({ fromPubkey: payer.publicKey, toPubkey: TIP_ACCOUNT, lamports: MIN_TIP }),
];
// 2. Build and sign as usual. Keep the tip account out of address lookup tables.
const connection = new Connection(process.env.RPC_URL!);
const { blockhash } = await connection.getLatestBlockhash();
const message = new TransactionMessage({ payerKey: payer.publicKey, recentBlockhash: blockhash, instructions }).compileToV0Message();
const tx = new VersionedTransaction(message);
tx.sign([payer]);
// 3. Send it to your send address with your API key.
const res = await fetch("https://send.flashland.dev/v1/transactions", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SEND_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ transaction: Buffer.from(tx.serialize()).toString("base64") }),
});
if (!res.ok) {
const { error } = await res.json();
throw new Error(`${error.code}: ${error.message}`); // e.g. PAYMENT_TOO_LOW
}
console.log((await res.json()).signature);import base64, os, requests
from solana.rpc.api import Client
from solders.message import MessageV0
from solders.pubkey import Pubkey
from solders.system_program import TransferParams, transfer
from solders.transaction import VersionedTransaction
TIP_ACCOUNT = Pubkey.from_string("YOUR_TIP_ADDRESS")
MIN_TIP = 200000 # lamports = 0.0002 SOL. You can tip more.
# 1. Your own instructions, plus ONE transfer to the tip account, signed by the payer.
tip = transfer(TransferParams(from_pubkey=payer.pubkey(), to_pubkey=TIP_ACCOUNT, lamports=MIN_TIP))
instructions = [*your_instructions, tip]
# 2. Build and sign as usual. Keep the tip account out of address lookup tables.
blockhash = Client(os.environ["RPC_URL"]).get_latest_blockhash().value.blockhash
message = MessageV0.try_compile(payer.pubkey(), instructions, [], blockhash)
tx = VersionedTransaction(message, [payer])
# 3. Send it to your send address with your API key.
res = requests.post(
"https://send.flashland.dev/v1/transactions",
headers={"Authorization": f"Bearer {os.environ['SEND_API_KEY']}"},
json={"transaction": base64.b64encode(bytes(tx)).decode()},
timeout=10,
)
if not res.ok:
raise RuntimeError(res.json()["error"]) # e.g. PAYMENT_TOO_LOW
print(res.json()["signature"])Errors and retries
Any response other than HTTP 200 is an error object: {"error":{"code":"...","message":"..."}}.
| HTTP | Code | Meaning and what to do |
|---|---|---|
| 400 | INVALID_BASE64 | The transaction field is not valid base64. Fix and resend. |
| 400 | INVALID_TRANSACTION | The envelope is malformed or larger than 1,232 bytes. Not charged. |
| 401 | UNAUTHORIZED | No bearer key was sent. |
| 401 | INVALID_API_KEY | The key could not be decoded. Keys begin with usq_live_. |
| 402 | INSUFFICIENT_BALANCE | No credit left. Add SOL, then resend. |
| 402 | PAYMENT_TOO_LOW | The tip inside the transaction is below the minimum. Not sent, nothing paid. |
| 403 | ACCOUNT_DISABLED | The account is switched off. Contact support. |
| 409 | SUBMISSION_IN_PROGRESS | The same signature is already in flight. Wait for it; do not retry at once. |
| 503 | UPSTREAM_UNAVAILABLE | It could not be forwarded. Retry with backoff; any charge is reversed. |
Retrying the same signed bytes is safe: a signature accepted in the last 90 seconds is never charged twice. For the lowest latency, hold one connection open: see the QUIC guide where your store offers it, or reuse HTTPS connections.