RPC
Transactions
Send, simulate, and inspect transaction data on Surfnet
These methods handle the creation, simulation, and inspection of transactions on the blockchain. They are essential for executing state changes, estimating fees, checking transaction outcomes, and monitoring transaction lifecycles.
getSignatureStatuses
Returns the signature statuses for a given signature.
Parameters
| Name | Type | Description |
|---|---|---|
signatures* | array[string] | An array of transaction signatures to query, as base-58 encoded strings. |
config | object | Configuration object for the query. |
â”” searchTransactionHistory | boolean | Whether to search the transaction history. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | array<any> |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "getSignatureStatuses", "params": { "signatures": [ "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW" ], "config": { "searchTransactionHistory": true } }}requestAirdrop
Requests an airdrop to a given address.
Parameters
| Name | Type | Description |
|---|---|---|
pubkey* | string | The public key of the account to receive the airdrop, as a base-58 encoded string. |
lamports* | integer | The amount of lamports to airdrop. |
config | object | Configuration object for the query. |
â”” commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
Result
| Field | Type | Description |
|---|---|---|
result | string | requestAirdrop - Requests an airdrop to a given address |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "requestAirdrop", "params": { "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", "lamports": 1000000000, "config": { "commitment": "Processed" } }}sendTransaction
Sends a transaction to the cluster.
Parameters
| Name | Type | Description |
|---|---|---|
transaction* | string | The signed transaction, as a base-64 encoded string. |
config | object | Configuration object for the query. |
â”” encoding | string | The encoding for the transaction. |
â”” maxRetries | integer | The maximum number of retries for the transaction. |
â”” minContextSlot | integer | The minimum context slot for the transaction. |
â”” preflightCommitment | string | The commitment level for the preflight check. |
â”” skipPreflight | boolean | Whether to skip the preflight check. |
Result
| Field | Type | Description |
|---|---|---|
result | string | sendTransaction - Sends a transaction to the cluster |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "sendTransaction", "params": { "transaction": "<some-transaction>", "config": { "encoding": "binary", "maxRetries": 0, "minContextSlot": 123456789, "preflightCommitment": "Processed", "skipPreflight": true } }}simulateTransaction
Simulates a transaction.
Parameters
| Name | Type | Description |
|---|---|---|
transaction* | string | The transaction to simulate, as a base-64 encoded string. |
config | object | Configuration object for the query. |
â”” accounts | object | Accounts to return in the simulation result. |
â”” addresses | array[string] | An array of account addresses to return, as base-58 encoded strings. |
â”” encoding | string | Encoding for the account data. |
â”” commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
â”” encoding | string | Encoding for the transaction data. |
â”” innerInstructions | boolean | Whether to include inner instructions in the simulation result. |
â”” minContextSlot | integer | Mincontextslot |
â”” replaceRecentBlockhash | boolean | Whether to replace the recent blockhash with a new one. |
â”” sigVerify | boolean | Whether to verify transaction signatures. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | object | |
â”” accounts | array | |
â”” err | object | |
â”” errorType | string | Error type |
â”” message | string | Error message |
â”” innerInstructions | array | |
â”” logs | array | |
â”” replacementBlockhash | object | |
â”” blockhash | string | |
â”” lastValidBlockHeight | integer | |
â”” returnData | object | |
â”” data | array<string> | Returned data |
â”” programId | string | Program ID that returned the data |
â”” unitsConsumed | integer |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "simulateTransaction", "params": { "transaction": "<some-transaction>", "config": { "accounts": { "addresses": [ "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri" ], "encoding": "binary" }, "commitment": "Processed", "encoding": "binary", "innerInstructions": true, "minContextSlot": 123456789, "replaceRecentBlockhash": true, "sigVerify": true } }}getTransaction
Returns the transaction for a given signature.
Parameters
| Name | Type | Description |
|---|---|---|
signature* | string | The transaction signature to query, as a base-58 encoded string. |
config | object | Configuration object for the query. |
â”” commitment | object | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'. |
â”” commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
â”” maxSupportedTransactionVersion | integer | The maximum transaction version to support. |
Result
| Field | Type | Description |
|---|---|---|
blockTime | integer | Block time |
meta | object | Transaction metadata |
â”” computeUnitsConsumed | integer | Compute units consumed |
â”” err | object | Transaction error |
â”” errorType | string | Error type |
â”” message | string | Error message |
â”” fee | integer | Transaction fee |
â”” innerInstructions | array | Inner instructions |
â”” logMessages | array | Log messages |
â”” postBalances | array<integer> | Account balances after transaction |
â”” postTokenBalances | array | Post token balances |
â”” preBalances | array<integer> | Account balances before transaction |
â”” preTokenBalances | array | Pre token balances |
â”” returnData | object | Return data |
â”” data | array<string> | Returned data |
â”” programId | string | Program ID that returned the data |
slot | integer | The transaction slot |
transaction | object | The encoded transaction |
â”” message | object | Transaction message |
â”” accountKeys | array<string> | List of account keys |
â”” addressTableLookups | array | List of address table lookups |
â”” instructions | array<InstructionSchema> | List of instructions |
â”” [] | object | Array item |
â”” accounts | array<integer> | Account indices |
â”” data | string | Instruction data |
â”” programIdIndex | integer | Program ID index |
â”” numReadonlySignedAccounts | integer | Number of readonly signed accounts |
â”” numReadonlyUnsignedAccounts | integer | Number of readonly unsigned accounts |
â”” numRequiredSignatures | integer | Number of required signatures |
â”” recentBlockhash | string | Recent blockhash |
â”” signatures | array<string> | List of signatures |
version | integer | Transaction version |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "getTransaction", "params": { "signature": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW", "config": { "commitment": { "commitment": "Processed" }, "maxSupportedTransactionVersion": 0 } }}getSignaturesForAddress
Returns the signatures for a given address.
Parameters
| Name | Type | Description |
|---|---|---|
address* | string | The address to query for transaction signatures, as a base-58 encoded string. |
before | string | Start searching backwards from this transaction signature. |
limit | integer | The maximum number of signatures to return. |
until | string | Search until this transaction signature. |
Result
| Field | Type | Description |
|---|---|---|
result | array<RpcConfirmedTransactionStatusWithSignature> | getSignaturesForAddress - Returns signatures for an address |
â”” [] | object | Array item |
â”” blockTime | integer | |
â”” confirmationStatus | object | |
â”” status | string | Confirmation level |
â”” err | object | |
â”” errorType | string | Error type |
â”” message | string | Error message |
â”” memo | string | |
â”” signature | string | |
â”” slot | integer |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress", "params": { "address": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", "before": "<some-before>", "limit": 0, "until": "<some-until>" }}getFeeForMessage
Returns the fee for a given message.
Parameters
| Name | Type | Description |
|---|---|---|
message* | string | The message to calculate the fee for, as a base-64 encoded string. |
config | object | Configuration object for the query. |
â”” commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
â”” minContextSlot | integer | The minimum context slot for the context. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | integer |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "getFeeForMessage", "params": { "message": "<some-message>", "config": { "commitment": "Processed", "minContextSlot": 123456789 } }}getStakeMinimumDelegation
Returns the stake minimum delegation.
Parameters
| Name | Type | Description |
|---|---|---|
config | object | Configuration object for the query. |
â”” commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
â”” minContextSlot | integer | The minimum context slot for the context. |
Result
| Field | Type | Description |
|---|---|---|
context | object | |
â”” apiVersion | string | The API version |
â”” slot | integer | The current slot |
value | integer |
Example
{ "jsonrpc": "2.0", "id": 1, "method": "getStakeMinimumDelegation", "params": { "config": { "commitment": "Processed", "minContextSlot": 123456789 } }}