To get a transaction’s details using the NodeJS SDK, use the getTransaction method from the Privy client:

getTransaction: (input: {id: string}) => Promise<WalletApiTransactionResponseType>;

Usage

const transaction = await privy.walletApi.getTransaction({
  id: 'insert-transaction-id'
});
console.log(transaction);

Parameters

id
string
required

ID of the transaction to fetch details for.

Returns

transaction
WalletApiTransactionResponseType
id
string

ID for the transaction.

walletId
string

ID for the wallet that sent the transaction.

caip2
string

CAIP-2 chain ID for the network the transaction was broadcasted on.

transactionHash
string

Hash for the transaction.

status
'broadcasted' | 'confirmed' | 'execution_reverted'

Current status of the transaction.

  • 'broadcasted' refers to when a transaction has been submitted to the network but has not yet been included in a block
  • 'confirmed' refers to when a transaction has been included in a block that has been confirmed on the network.
  • 'execution_reverted' refers to when a transaction has reverted in execution.