getHistory
Get transaction history for a wallet with optional pagination and date filters.
Signature
getHistory(walletAddress: string, chainId: SupportedChainId, options?: HistoryOptions): Promise<HistoryResponse>
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
walletAddress | string | ✅ | Smart wallet address |
chainId | SupportedChainId | ✅ | Chain ID |
options | HistoryOptions | ❌ | Optional: { limit?, offset?, fromDate?, toDate? } |
Returns
Transaction history with pagination
Return Type
interface HistoryResponse {
success: boolean;
walletAddress: string;
data: HistoryEntry[];
total: number;
}
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}`);
});
}
});