getSignaturesForAddress
Returns confirmed transaction signatures for transactions that reference the supplied address in accountKeys, newest first.
Request
Send a JSON-RPC 2.0 POST request with method: "getSignaturesForAddress". The params array takes a base-58 encoded account address and an optional configuration object.
curl · JSON-RPCjson
{ "jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress", "params": [ "Vote111111111111111111111111111111111111111", { "commitment": "finalized", "limit": 1 } ]}@solana/kit
kit.tsts
import { address, createSolanaRpc } from "@solana/kit"; const rpc_url = "https://rpc.openinfra.sh";const rpc = createSolanaRpc(rpc_url); let addr = address("Vote111111111111111111111111111111111111111"); let signaturesForConfig = { limit: 1}; let signatures = await rpc .getSignaturesForAddress(addr, signaturesForConfig) .send(); console.log(signatures);@solana/web3.js
web3.tsts
import { Connection, PublicKey, type SignaturesForAddressOptions} from "@solana/web3.js"; const connection = new Connection("https://rpc.openinfra.sh", "confirmed"); let signaturesOptions: SignaturesForAddressOptions = { limit: 1}; let address = new PublicKey("Vote111111111111111111111111111111111111111");let signatures = await connection.getSignaturesForAddress( address, signaturesOptions); console.log(signatures);Rust
main.rsrs
use anyhow::Result;use solana_client::{ nonblocking::rpc_client::RpcClient, rpc_client::GetConfirmedSignaturesForAddress2Config,};use solana_commitment_config::CommitmentConfig;use solana_sdk::pubkey; #[tokio::main]async fn main() -> Result<()> { let client = RpcClient::new_with_commitment( String::from("https://rpc.openinfra.sh"), CommitmentConfig::confirmed(), ); let address = pubkey!("Vote111111111111111111111111111111111111111"); let signatures_for_config = GetConfirmedSignaturesForAddress2Config { before: None, until: None, limit: Some(1), commitment: CommitmentConfig::finalized().into(), }; let signatures = client .get_signatures_for_address_with_config(&address, signatures_for_config) .await?; println!("{:#?}", signatures); Ok(())}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| address | string | Yes | Account address as base-58 encoded string. |
| config | object | No | Optional configuration object. See fields below. |
| config.commitment | string | No | Desired finality level. Accepted values: confirmed, finalized (default). processed is not accepted by this method. |
| config.minContextSlot | number | No | The minimum slot at which the request may be evaluated. |
| config.limit | usize | No | Maximum transaction signatures to return (between 1 and 1,000). Defaults to 1,000. |
| config.before | string | No | Start searching backwards from this transaction signature. If not provided, the search starts from the top of the highest max confirmed block. |
| config.until | string | No | Search until this transaction signature, if found before limit is reached. |
commitment values
| Value | Description |
|---|---|
| confirmed | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. More stable than processed, but a weaker guarantee than finalized. |
| finalized | Return data from the highest slot that the cluster recognizes as finalized. The slot has reached maximum vote lockout in validators' vote towers and is recognized by at least two-thirds of active stake. This is the strongest commitment level. |
minContextSlot example
{ "minContextSlot": 341197000 }before example
{ "before": "5h6xBEauJ3PK6SWCz5Qq8DbD4t7VDdaRhfvsRrHBhXX2x4dLZxN1YhJpN96CBvs1BgqsSVqSogn8CA9nVddrzNRs"}until example
{ "until": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb"}Response
response.jsonjson
{ "jsonrpc": "2.0", "result": [ { "signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv", "slot": 114, "err": null, "memo": null, "blockTime": null, "confirmationStatus": "finalized" } ], "id": 1}The result is an array of transaction signature information objects, ordered from newest to oldest transaction.
| Field | Type | Description |
|---|---|---|
| signature | string | Transaction signature as a base-58 encoded string. |
| slot | u64 | The slot that contains the block with the transaction. |
| err | object | string | null | Error if the transaction failed; null if the transaction succeeded. When returned as an object it is a transaction error enum payload rather than a fixed JSON schema. |
| memo | string | null | Memo associated with the transaction; null if no memo is present. |
| blockTime | i64 | null | Estimated production time as a Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available. |
| confirmationStatus | string | null | The transaction's cluster confirmation status: processed, confirmed, or finalized. |