> ## Documentation Index
> Fetch the complete documentation index at: https://zyfai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getHistory

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

## Signature

```typescript theme={null}
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?, assetType? }` |

## Returns

Transaction history with pagination

## Return Type

```typescript theme={null}
interface HistoryResponse {
  success: boolean;
  walletAddress: string;
  data: HistoryEntry[];
  total: number;
}
```

```typescript theme={null}
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;
}
```

```typescript theme={null}
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;
}
```

## Options

```typescript theme={null}
interface HistoryOptions {
  limit?: number;
  offset?: number;
  fromDate?: string;
  toDate?: string;
  assetType?: "usdc" | "eth" | "eurc";
}
```

`assetType` uses the same values as the rest of the SDK. Filter by asset when a chain has mixed USDC / WETH / EURC activity — otherwise the first page can be empty for the asset you care about.

## Example

```typescript theme={null}
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}`);
    });
  }
});

// Filter to WETH activity only
const wethHistory = await sdk.getHistory(walletAddress, 8453, {
  limit: 50,
  assetType: "eth",
});
```
