sendTransaction
The sendTransaction method submits a signed transaction to the cluster for processing. This is the primary method for broadcasting transactions to the Solana network, making it one of the most critical RPC methods for any application that performs on-chain operations.
After constructing and signing a transaction locally, it must be submitted to the network through this method. The RPC node receives the transaction, performs initial validation checks, and forwards it to the current leader validator for inclusion in a block. The method returns immediately with the transaction signature, but this doesn't guarantee the transaction has been processed or confirmed - only that it was accepted by the RPC node for forwarding.
This method is essential for wallets sending transfers, DEXes executing swaps, NFT platforms minting tokens, and any application performing on-chain state changes. Proper transaction submission requires understanding encoding options, preflight checks, and retry strategies. After submission, applications should use getSignatureStatuses or confirmTransaction to monitor the transaction's processing status.
Parameters
parameter | type | description |
|---|---|---|
transaction | string | Fully-signed transaction as an encoded string |
config | object | Optional configuration object |
config.encoding | string | Encoding for the transaction: 'base58' (slow) or 'base64' (default: 'base58') |
config.skipPreflight | boolean | If true, skip preflight transaction checks (default: false) |
config.preflightCommitment | string | Commitment level for preflight: 'processed', 'confirmed', or 'finalized' (default: 'finalized') |
config.maxRetries | number | Maximum number of times RPC node will retry sending transaction to leader (default: 5) |
config.minContextSlot | number | Optional. Minimum slot that the request can be evaluated at |
Return Object
field | type | description |
|---|---|---|
result | string | Transaction signature as base-58 encoded string. This is the first signature in the transaction, used to identify the transaction |
Request Example
Response Example
Tip: Use base64 encoding for better performance. Don't skip preflight checks in production - they catch errors before fees are charged. A successful response means the transaction was accepted, not confirmed. Monitor with getSignatureStatuses. If the transaction fails preflight, you'll get an error with simulation logs. The blockhash must be recent (get with getLatestBlockhash).