Skip to main content
Fetches an on-chain transaction by signature and commitment level. Returns the transaction’s state, execution slot, program logs, and any error details.
If the transaction has not yet reached the requested commitment level, the response may return an empty Transaction object. For real-time status tracking, use MonitorTransaction instead of polling GetTransaction.

Request

signature
Base58-encoded string
required
Transaction signature to look up. Returned by SubmitTransaction.
commitment_level
CommitmentLevel (enum)
Optional. Ledger state to query. A transaction visible at FINALIZED will also be visible at CONFIRMED and PROCESSED. Defaults to COMMITMENT_LEVEL_CONFIRMED.

Response

transaction
Transaction (object)
The transaction object. May be empty if the transaction has not yet reached the requested commitment level.

Code Examples

resp, err := client.GetTransaction(ctx, &transaction_v1.GetTransactionRequest{
    Signature: "YourTransactionSignature1111111111111111111",
})
if err != nil {
    log.Fatal(err)
}
txn := resp.Transaction
fmt.Printf("Slot: %d\n", txn.Slot)
if txn.MetaErrorMessage != "" {
    fmt.Printf("Execution error: %s\n", txn.MetaErrorMessage)
}