Skip to main content
You can retrieve the transaction history for a wallet address by calling the getTransactionHistory function. This function fetches the transaction history for a specified wallet address and chain, returning a list of transactions along with a nextOffset for pagination.
Transaction history is currently only supported for embedded wallets on Solana mainnet (network ID 101). Responses are cached for 5 seconds.

Usage

import { getTransactionHistory } from '@dynamic-labs/client';

const { transactions, nextOffset } = await getTransactionHistory({
  address: 'CKEAuq1E7hUcrjDcu1xP6nax3YBvEhhq7qaCzDUkPNer',
  chain: 'SOL',
  networkId: 101, // Solana mainnet
  limit: 10,
});

console.log(transactions);

// Fetch next page if available
if (nextOffset) {
  const nextPage = await getTransactionHistory({
    address: 'CKEAuq1E7hUcrjDcu1xP6nax3YBvEhhq7qaCzDUkPNer',
    chain: 'SOL',
    networkId: 101,
    limit: 10,
    offset: nextOffset,
  });
}

Parameters

ParameterTypeRequiredDescription
addressStringYesThe wallet address to fetch transactions for
chainChainYesThe chain to query transactions for (e.g., SOL)
networkIdNumberYesThe network ID (e.g., 101 for Solana mainnet)
limitNumberNoMaximum number of transactions to return
offsetStringNoPagination offset from previous response

Response

The function returns a Promise that resolves to an object containing:
PropertyTypeDescription
transactionsArrayList of transaction objects
nextOffsetStringOffset to fetch the next page of transactions

Transaction object

Each transaction object contains:
PropertyTypeDescription
transactionHashStringThe transaction hash
blockNumberNumberBlock number of the transaction
transactionTimestampStringISO 8601 timestamp of the transaction
blockHashStringHash of the block containing the transaction
blockExplorerUrlsString[]URLs to view the transaction on block explorers
fromAddressStringSender address
toAddressStringRecipient address
labelsString[]Transaction type labels: sent, receive, or swap
assetTransfersArrayDetails of assets transferred in the transaction
chainNameStringThe blockchain type
networkIdNumberThe network ID

Asset transfer object

Each asset transfer contains:
PropertyTypeDescription
tokenAddressStringContract address of the token (empty for native tokens)
fromAddressStringSender address for this transfer
toAddressStringRecipient address for this transfer
amountNumberAmount transferred
metadataObjectToken metadata (name, symbol, decimals, imageUri)