Mainly

Send a transaction

Submit a signed transaction. Priority fees, retries, and confirmation are handled for you.

POST /transactions/send

Sending a transaction on raw Solana is a five-step dance: fetch a blockhash, estimate a priority fee, simulate, submit, then poll for confirmation — all while racing the ~60–90 second blockhash expiry, and knowing that a "successful" submit only means received, not landed. This endpoint does the whole dance.

Mainly never holds keys. You build and sign the transaction client-side (with your wallet adapter or SDK of choice), then submit the signed bytes here.

Request body

FieldTypeRequiredDescription
transactionstringYesThe fully signed transaction, base64-encoded.
priorityFeestring | numberNo"auto" (default), "low", "medium", "high", or a number in micro-lamports per compute unit. Only applied when the transaction doesn't already set its own compute budget.
confirmbooleanNoDefault true: the response waits until the transaction is confirmed (typically 1–3 s). false: returns immediately after submission.
skipPreflightbooleanNoDefault false. Preflight simulation catches most failures before you pay a fee — leave it on unless you're latency-critical.

Example

curl -X POST https://api.sarg.am/v1/solana/transactions/send \
  -H "Authorization: Bearer $MAINLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction": "AeF3...base64-encoded-signed-transaction...==",
    "priorityFee": "auto",
    "confirm": true
  }'
{
  "signature": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb",
  "status": "confirmed",
  "slot": 341197101,
  "fee": { "lamports": 5000, "sol": 0.000005 }
}

With "confirm": false you get {"signature": "...", "status": "submitted"} back in milliseconds and poll for the rest.

Polling for status

GET /transactions/{signature}/status
{
  "signature": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb",
  "status": "confirmed",
  "slot": 341197101,
  "error": null
}
statusMeaning
submittedSent to the network, not yet observed in a block.
confirmedVoted on by a supermajority — safe for most application logic.
finalizedIrreversible.
failedLanded on-chain but the program errored — error has details, and the fee was still charged.
expiredNever landed and its blockhash lapsed. It will never land; rebuild, re-sign, resubmit.

Errors

codeWhen
invalid_transactionThe body isn't a decodable base64 transaction, or signatures are missing/invalid.
simulation_failedPreflight failed — details.logs contains the program logs. No fee was paid.
blockhash_expiredThe blockhash was already stale on arrival. Fetch a fresh one, rebuild, re-sign.

Under the hood

Replaces getPriorityFeeEstimate, simulateTransaction, sendTransaction (with re-broadcast retries inside the blockhash validity window), and a getSignatureStatuses polling loop.

On this page