Skip to main content

getHistory

Get transaction history for a wallet with optional pagination and date filters.

Signature

getHistory(walletAddress: string, chainId: SupportedChainId, options?: HistoryOptions): Promise<HistoryResponse>

Parameters

ParameterTypeRequiredDescription
walletAddressstringSmart wallet address
chainIdSupportedChainIdChain ID
optionsHistoryOptionsOptional: { limit?, offset?, fromDate?, toDate? }

Returns

Transaction history with pagination

Return Type

interface HistoryResponse {
success: boolean;
walletAddress: string;
data: HistoryEntry[];
total: number;
}
interface HistoryEntry {
id?: string;
action?: string;
date?: string;
strategy?: string;
positions?: HistoryPosition[];
chainId?: number;
transactionHash?: string;
destinationChainId?: number;
sourceChains?: number[];
crosschain?: boolean;
rebalance?: boolean;
zkProofIpfsHash?: string;
validationRegistryTxHash?: string;
validationRegistryChainId?: number;
validationRegistryAddress?: string;
}
interface HistoryPosition {
pool?: string;
amount?: string;
token_id?: string;
token_icon?: string;
amountInUSD?: string;
protocol_id?: string;
token_symbol?: string;
protocol_icon?: string;
protocol_name?: string;
}

Example

const history = await sdk.getHistory("0x...", 8453, {
limit: 50,
fromDate: "2024-01-01",
toDate: "2024-01-31"
});
history.data.forEach(entry => {
console.log(`Action: ${entry.action}, Date: ${entry.date}`);
if (entry.positions) {
entry.positions.forEach(pos => {
console.log(` ${pos.protocol_name} - ${pos.amount} ${pos.token_symbol}`);
});
}
});