Skip to content

Sending Transactions via HTTP

Send Solana transactions through any lucum.io HTTP endpoint for fast, reliable landing.

Endpoint Format

POST http://<region>.lucum.io/?api-key=YOUR_API_KEY

See Endpoints & Regions for all available regions.

Tipping Requirement

All transactions must include a transfer of at least 0.001 SOL to one of the tip wallets:

Lucum3sDVsPmHnQVaRKGpLXVPQLhcUqJqmcN5Tn9xuR
Lucum2REE14nX1xBJee9RR24gMaM878icjigfuvWy7H
Lucum2g9HQeHdXEaENapK66C9bgprAMADsg1XijoW2m
Lucum3TJzgBRMZV5CgkmsH6jnE9YKa9ceAQDrUQQuA6
Lucum3TosrLyi8nwP9L9E6s9HWRTg8Y8kv67MjWpkKk
Lucum3yhZeqqXxW3yeTRheBRqwwXnr285HzTiyWKrgm
Lucum4XaQeeARcS4EwmJsGpjNWUNH75hAD2k7jsxSKD
Lucum4r22CCf5M5Zsj4PvhxYJ8CGz4QQMUCrL89Rupz
Lucum5FeurZkc7qrKadaWmzsZ6L1ig79EHGXJU65rPn
Lucum6s8rtKN5n7oWMm1h2Afm18DxWuA8Fgmraikxa3

Add this as a SOL transfer instruction in your transaction before sending.

Code Examples

JavaScript / TypeScript

js
import { Connection, Keypair, Transaction, SystemProgram, LAMPORTS_PER_SOL, PublicKey } from '@solana/web3.js'

const API_KEY = 'YOUR_API_KEY'
const LUCUM_URL = `http://fra.lucum.io/?api-key=${API_KEY}`

// Build your transaction
const connection = new Connection('https://api.mainnet-beta.solana.com')
const sender = Keypair.fromSecretKey(/* your key */)

const TIP_WALLET = new PublicKey('Lucum3sDVsPmHnQVaRKGpLXVPQLhcUqJqmcN5Tn9xuR')

const transaction = new Transaction().add(
  // Your instruction(s)
  SystemProgram.transfer({
    fromPubkey: sender.publicKey,
    toPubkey: recipientPubkey,
    lamports: 0.01 * LAMPORTS_PER_SOL,
  }),
  // Tip (minimum 0.001 SOL)
  SystemProgram.transfer({
    fromPubkey: sender.publicKey,
    toPubkey: TIP_WALLET,
    lamports: 0.001 * LAMPORTS_PER_SOL,
  })
)

const { blockhash } = await connection.getLatestBlockhash()
transaction.recentBlockhash = blockhash
transaction.feePayer = sender.publicKey
transaction.sign(sender)

// Send via lucum
const serialized = transaction.serialize()
const base64Tx = serialized.toString('base64')

const response = await fetch(LUCUM_URL, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ transaction: base64Tx }),
})

const result = await response.json()
console.log('Result:', result)

Python

python
import requests
import base64
from solders.keypair import Keypair
from solders.pubkey import Pubkey
from solders.system_program import TransferParams, transfer
from solana.rpc.api import Client
from solana.transaction import Transaction

API_KEY = "YOUR_API_KEY"
LUCUM_URL = f"http://fra.lucum.io/?api-key={API_KEY}"

# Build transaction
client = Client("https://api.mainnet-beta.solana.com")
sender = Keypair.from_base58_string("your_private_key")

TIP_WALLET = Pubkey.from_string("Lucum3sDVsPmHnQVaRKGpLXVPQLhcUqJqmcN5Tn9xuR")

tx = Transaction()
# Your instruction(s)
tx.add(transfer(TransferParams(
    from_pubkey=sender.pubkey(),
    to_pubkey=recipient_pubkey,
    lamports=10_000_000,
)))
# Tip (minimum 0.001 SOL)
tx.add(transfer(TransferParams(
    from_pubkey=sender.pubkey(),
    to_pubkey=TIP_WALLET,
    lamports=1_000_000,
)))

blockhash = client.get_latest_blockhash().value.blockhash
tx.recent_blockhash = blockhash
tx.fee_payer = sender.pubkey()
tx.sign(sender)

# Send via lucum
serialized = bytes(tx.serialize())
base64_tx = base64.b64encode(serialized).decode("utf-8")

response = requests.post(
    LUCUM_URL,
    headers={"Content-Type": "application/json"},
    json={"transaction": base64_tx},
)

print(response.json())

Rust

rust
use reqwest::Client;
use serde_json::json;
use solana_sdk::{
    signature::{Keypair, Signer},
    system_transaction,
};
use base64::Engine;

const API_KEY: &str = "YOUR_API_KEY";

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let sender = Keypair::new();
    let recipient = solana_sdk::pubkey!("RECIPIENT_PUBKEY");

    let rpc = solana_client::rpc_client::RpcClient::new("https://api.mainnet-beta.solana.com");
    let blockhash = rpc.get_latest_blockhash()?;

    let tip_wallet = solana_sdk::pubkey!("Lucum3sDVsPmHnQVaRKGpLXVPQLhcUqJqmcN5Tn9xuR");

    // Build transaction with your instruction + tip
    let tx = solana_sdk::transaction::Transaction::new_signed_with_payer(
        &[
            solana_sdk::system_instruction::transfer(&sender.pubkey(), &recipient, 10_000_000),
            solana_sdk::system_instruction::transfer(&sender.pubkey(), &tip_wallet, 1_000_000), // 0.001 SOL tip
        ],
        Some(&sender.pubkey()),
        &[&sender],
        blockhash,
    );
    let serialized = bincode::serialize(&tx)?;
    let base64_tx = base64::engine::general_purpose::STANDARD.encode(&serialized);

    let url = format!("http://fra.lucum.io/?api-key={}", API_KEY);

    let client = Client::new();
    let response = client
        .post(&url)
        .json(&json!({ "transaction": base64_tx }))
        .send()
        .await?;

    println!("{}", response.text().await?);
    Ok(())
}

cURL

bash
curl -X POST "http://fra.lucum.io/?api-key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "transaction": "BASE64_ENCODED_TRANSACTION" }'

Tips

  • Send to the endpoint closest to your server for lowest latency
  • Send to multiple endpoints in parallel for higher landing probability
  • Use a fresh blockhash — stale blockhashes cause drops
  • Consider QUIC for even faster delivery

Built with VitePress