Get complete transaction history for any Solana wallet with balance changes for each transaction. Perfect for portfolio trackers, accounting tools, and analytics platforms.
The Wallet API is in Beta. Endpoints and response formats may change.
The Transaction History endpoint retrieves the complete transaction history for a Solana wallet using the Enhanced Transactions API. It returns human-readable, parsed transactions with balance changes for each transaction, in reverse chronological order (newest first).The endpoint returns up to 100 transactions per request, so pagination is manual. Use the before parameter with pagination.nextCursor to fetch the next page, and read pagination.hasMore to know when more results are available. Each request is a single API call and costs 100 credits.The tokenAccounts parameter controls whether transactions involving token accounts owned by the wallet are included:
balanceChanged (recommended): includes transactions that changed token account balances, filtering spam.
none: only direct wallet interactions.
all: all token account transactions, including spam.
The tokenAccounts filter relies on the owner field in token balance metadata, which was not available before slot 111,491,819 (~December 2022). Transactions involving token accounts active before this slot may be missing. See the getTransactionsForAddress tutorial for a workaround.
// Get only SWAP transactionsconst url = `https://api.helius.xyz/v1/wallet/${address}/history?api-key=YOUR_API_KEY&type=SWAP`;
// Exclude spam by only including transactions that changed token balancesconst url = `https://api.helius.xyz/v1/wallet/${address}/history?api-key=YOUR_API_KEY&tokenAccounts=balanceChanged`;// Only show direct wallet interactionsconst url = `https://api.helius.xyz/v1/wallet/${address}/history?api-key=YOUR_API_KEY&tokenAccounts=none`;
// Get only NFT sales that changed balancesconst url = `https://api.helius.xyz/v1/wallet/${address}/history?api-key=YOUR_API_KEY&type=NFT_SALE&tokenAccounts=balanceChanged`;
timestamp: Unix seconds. May be null for very recent transactions that haven’t been fully processed yet.
error: null for successful transactions; an error value for failed ones. Failed transactions still incur fees.
balanceChanges: how the wallet’s holdings changed in the transaction — a positive amount is tokens received, a negative amount is tokens sent or spent.
mint (within balanceChanges): token mint address, or "SOL" for native SOL.
amount (within balanceChanges): human-readable, already divided by decimals — -0.05 means −0.05 SOL, not −0.05 lamports. This endpoint does not include a raw amountRaw field.
Calculate what the balance was at a specific point in time:
const getHistoricalBalance = async (address, targetTimestamp) => { const transactions = await getAllTransactionHistory(address); // Filter to transactions before target date const relevantTxs = transactions.filter(tx => tx.timestamp <= targetTimestamp); // Sum all balance changes const balances = {}; relevantTxs.forEach(tx => { tx.balanceChanges.forEach(change => { if (!balances[change.mint]) { balances[change.mint] = 0; } balances[change.mint] += change.amount; }); }); console.log(`Historical balances as of ${new Date(targetTimestamp * 1000).toLocaleString()}:`); Object.entries(balances).forEach(([mint, balance]) => { console.log(`${mint}: ${balance}`); }); return balances;};// Example: Get balances on Jan 1, 2024getHistoricalBalance( "86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY", new Date("2024-01-01").getTime() / 1000);
For a single token’s exact balance at a point in time, the Historical Balance endpoint reads it directly from on-chain post-balances instead of summing changes client-side.