get_recent_transactions
Retrieve recent transaction history for an agent wallet to monitor blockchain activity and track financial operations.
Instructions
Get recent transactions for the agent wallet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of transactions to return (default: 10) |
Implementation Reference
- src/index.ts:169-180 (handler)MCP tool handler for 'get_recent_transactions': parses arguments, calls wallet method, formats response as JSON.case "get_recent_transactions": { const { limit = 10 } = args as { limit?: number }; const transactions = await wallet.getRecentTransactions(limit); return { content: [ { type: "text", text: JSON.stringify(transactions, null, 2), }, ], }; }
- src/index.ts:65-78 (registration)Tool registration including name, description, and input schema definition.{ name: "get_recent_transactions", description: "Get recent transactions for the agent wallet.", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of transactions to return (default: 10)", }, }, required: [], }, },
- src/wallet.ts:211-223 (helper)Implements the core logic: fetches recent transaction signatures via Solana RPC and maps to simplified TransactionInfo objects.async getRecentTransactions(limit: number = 10): Promise<TransactionInfo[]> { const signatures = await this.connection.getSignaturesForAddress( this.keypair.publicKey, { limit } ); return signatures.map((sig) => ({ signature: sig.signature, timestamp: sig.blockTime, status: sig.err ? "failed" : "success", type: "transaction", })); }
- src/wallet.ts:49-54 (schema)Type definition for transaction information returned by the tool.export interface TransactionInfo { signature: string; timestamp: number | null | undefined; status: "success" | "failed"; type: string; }