SDK Reference/getHistory()
getHistory()
Returns the transaction history for all cards issued by the agent wallet.
Signature
client.getHistory(options?: HistoryOptions): Promise<Transaction[]>Transaction fields
| Field | Type | Description |
|---|---|---|
| id | string | Transaction ID |
| cardId | string | Card that was charged |
| amount | number | Charged amount in cents |
| merchant | string | Merchant domain |
| status | string | approved | declined |
| timestamp | number | Unix timestamp |
Example
history.ts
const history = await client.getHistory({ limit: 25 })
history.forEach(tx => {
const status = tx.status === 'approved' ? '✓' : '✗'
console.log(`${status} ${tx.merchant} — $${(tx.amount / 100).toFixed(2)}`)
})