sendTransaction
Submits a signed transaction to the cluster for processing.
This method does not alter the transaction in any way; it relays the transaction created by clients to the sequencer as-is.
If sequencer acknowledges that it receives this transaction, this method immediately succeeds. A successful response from this method does not guarantee the transaction is processed by the sequencer.
While the rpc service will reasonably retry to submit it, the transaction could
be rejected if transaction's recent_blockhash
(state root) expires before it lands.
Use getSignatureStatuses
to ensure a transaction is
processed and confirmed.
Before submitting, the following preflight checks are performed:
- The transaction signatures are verified
- The transaction is simulated against the RPC node's view of the chain state. Note that this will be at least 1 slot behind the current state of the sequencer. On failure an error will be returned. Preflight checks may be disabled if desired.
The returned signature is the first signature in the transaction, which is used to identify the transaction. This identifier can be easily extracted from the transaction data before submission.
Parameters
Transaction <string>
- Fully-signed Transaction, as encoded string.
Configuration <object>
- Configuration object containing the following optional fields:
encoding: <string>
- encoding format for the transaction data["base58", "base64"]
skipPreflight: <bool>
- whentrue
, skip the preflight transaction checksmaxRetries: <usize>
- Maximum number of times for the RPC node to retry sending the transaction to the leader. If this parameter not provided, the RPC node will retry the transaction until it is finalized or until the blockhash expires.
Result
<string>
- First Transaction Signature embedded in the transaction, as base-58
encoded string
Code sample
curl "https://testnet.atlas.xyz/?apikey=$ATLAS_API_KEY" -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38",
"method": "sendTransaction",
"params": [
"AQwTfezKk55wPzgUBki0pGdvc6gsElOctJJb1wROTslBF+qYqt1tFxTlotYYPDIkjrKu7gzMNUh5Srs1iewGuwgBAAED8bch+YQF1LfQjUbl7EkqfPll89tzBVQjzkYPAlqBzdRmEWCm56Iw6tvmkIFa7BMLivayaX6f4k/wuqamOmo3VwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAml0TuuCunpnUXudTv8kUzhBoNEVIO1U6xln6lzQlk/cBAgIAAQwCAAAAQEIPAAAAAAA=",
{
"encoding": "base64"
}
]
}
'
Response
{
"jsonrpc": "2.0",
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38",
"result": "F1Cyy6PFSduBCtPnX1RFtHgvMHSKD18SR9QbXKsAijSU7DcUk4XC6hZp4RyHLHC1kr3GKowMUMP8t5pGHV1PP3D"
}