getSignatureFromTransaction

function getSignatureFromTransaction(transaction): Signature;

Given a transaction signed by its fee payer, this method will return the Signature that uniquely identifies it. This string can be used to look up transactions at a later date, for example on a Solana block explorer.

Parameters

ParameterType
transactionTransaction

Returns

Signature

Example

import { getSignatureFromTransaction } from '@solana/transactions';
 
const signature = getSignatureFromTransaction(tx);
console.debug(`Inspect this transaction at https://explorer.solana.com/tx/${signature}`);

Throws

with code SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING if the transaction's fee payer has not signed it.

See

getSignatureFromTransactionIfPresent if the transaction might legitimately not have been signed by its fee payer.

On this page