getConfirmedTransaction
Deprecated: This method is deprecated. Use
getTransactioninstead.
Returns transaction details for a confirmed transaction given its signature. This method has been deprecated in favor of getTransaction, which supports versioned transactions and provides a more consistent API surface. All new integrations should use getTransaction instead, and existing users should plan to migrate.
Parameters
| # | Type | Required | Description |
|---|---|---|---|
| 1 | string | Yes | Transaction signature (base-58 encoded) |
| 2 | object | No | Configuration object |
Configuration object fields:
| Field | Type | Description |
|---|---|---|
encoding | string | Transaction encoding: json, jsonParsed, base58, or base64 |
commitment | string | Commitment level: confirmed or finalized |
Response
Returns null if the transaction is not found. Otherwise returns an object:
| Field | Type | Description |
|---|---|---|
slot | u64 | The slot the transaction was processed in |
transaction | object | Transaction object (format depends on encoding) |
blockTime | `i64 | null` |
meta | `object | null` |
Code Examples
cURL
1curl http://[IP_ADDRESS]:[PORT] -X POST -H "Content-Type: application/json" -d '{
2 "jsonrpc": "2.0",
3 "id": 1,
4 "method": "getConfirmedTransaction",
5 "params": [
6 "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
7 { "encoding": "jsonParsed", "commitment": "confirmed" }
8 ]
9}'TypeScript
1const response = await fetch("http://[IP_ADDRESS]:[PORT]", {
2 method: "POST",
3 headers: { "Content-Type": "application/json" },
4 body: JSON.stringify({
5 jsonrpc: "2.0",
6 id: 1,
7 method: "getConfirmedTransaction",
8 params: [
9 "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
10 { encoding: "jsonParsed", commitment: "confirmed" }
11 ]
12 }),
13});
14const { result } = await response.json();
15console.log("Slot:", result.slot);Python
1import requests
2
3response = requests.post("http://[IP_ADDRESS]:[PORT]", json={
4 "jsonrpc": "2.0",
5 "id": 1,
6 "method": "getConfirmedTransaction",
7 "params": [
8 "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
9 {"encoding": "jsonParsed", "commitment": "confirmed"}
10 ]
11})
12result = response.json()["result"]
13print(f"Slot: {result['slot']}")Rust
1use reqwest::Client;
2use serde_json::json;
3
4#[tokio::main]
5async fn main() -> Result<(), Box<dyn std::error::Error>> {
6 let client = Client::new();
7 let res = client.post("http://[IP_ADDRESS]:[PORT]")
8 .json(&json!({
9 "jsonrpc": "2.0",
10 "id": 1,
11 "method": "getConfirmedTransaction",
12 "params": [
13 "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
14 {"encoding": "jsonParsed", "commitment": "confirmed"}
15 ]
16 }))
17 .send().await?
18 .text().await?;
19 println!("{}", res);
20 Ok(())
21}Example Response
1{
2 "jsonrpc": "2.0",
3 "result": {
4 "slot": 166974442,
5 "transaction": { "message": {}, "signatures": [] },
6 "meta": { "fee": 5000, "err": null },
7 "blockTime": 1681391935
8 },
9 "id": 1
10}