Send a transaction
Submit a signed transaction. Priority fees, retries, and confirmation are handled for you.
POST /transactions/sendSending 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
| Field | Type | Required | Description |
|---|---|---|---|
transaction | string | Yes | The fully signed transaction, base64-encoded. |
priorityFee | string | number | No | "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. |
confirm | boolean | No | Default true: the response waits until the transaction is confirmed (typically 1–3 s). false: returns immediately after submission. |
skipPreflight | boolean | No | Default 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
}status | Meaning |
|---|---|
submitted | Sent to the network, not yet observed in a block. |
confirmed | Voted on by a supermajority — safe for most application logic. |
finalized | Irreversible. |
failed | Landed on-chain but the program errored — error has details, and the fee was still charged. |
expired | Never landed and its blockhash lapsed. It will never land; rebuild, re-sign, resubmit. |
Errors
code | When |
|---|---|
invalid_transaction | The body isn't a decodable base64 transaction, or signatures are missing/invalid. |
simulation_failed | Preflight failed — details.logs contains the program logs. No fee was paid. |
blockhash_expired | The 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.