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 supported for embedded wallets on Solana and EVM networks. Responses are cached for 5 seconds.Solana: mainnet (network ID 101) and devnet (network ID 103). For devnet, we only retain 2 weeks of transaction history.EVM supported networks:
NetworkMainnet IDTestnet ID
Ethereum111155111 (Sepolia)
Optimism1011155420 (Sepolia)
Rootstock3031
BNB Smart Chain5697
Gnosis10010200 (Chiado)
Unichain1301301 (Sepolia)
Polygon13780001 (Mumbai), 80002 (Amoy)
zkSync Era324300 (Sepolia)
Shape36011011 (Sepolia)
World Chain4804801 (Sepolia)
Hyperliquid999998
Story15141315 (Aeneid)
Soneium18681946 (Minato)
Ronin2020202601 (Saigon)
Abstract274111124
ApeChain3313933111 (Curtis)
Arbitrum One42161421614 (Sepolia)
Arbitrum Nova42170
Celo4222011142220 (Sepolia)
Avalanche4311443113 (Fuji)
Robinhood Chain46630
Ink57073763373 (Sepolia)
Linea5914459141 (Sepolia)
Berachain8009480069 (Bepolia)
Blast81457168587773 (Sepolia)
Base845384532 (Sepolia)
Scroll534352534351 (Sepolia)
Zora7777777999999999 (Sepolia)

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 for Solana, EVM for EVM networks)
networkIdNumberYesThe network ID (e.g., 101 for Solana mainnet, 1 for Ethereum 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
transactionTypeStringEnhanced transaction type (e.g., TRANSFER, SWAP). Only present for Solana transactions.
sourceStringThe program or protocol that originated the transaction (e.g., SYSTEM_PROGRAM, JUPITER). Only present for Solana transactions.
descriptionStringHuman-readable description of the transaction. Only present for Solana transactions.
spamBooleanWhether the transaction is likely spam (e.g., dust attacks). Only present for Solana transactions.

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 in the token’s smallest unit (e.g., lamports for SOL, raw units for SPL tokens). Use metadata.decimals to convert to a human-readable value.
metadataObjectToken metadata (name, symbol, decimals, imageUri)