get_transfers_for_owner
Retrieve NFT transfer history for a specific wallet address to track asset movements and ownership changes across ERC721 and ERC1155 tokens.
Instructions
Get NFT transfers for an owner
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | The wallet address to get transfers for | |
| pageKey | No | Key for pagination | |
| fromBlock | No | Starting block number for the query | |
| toBlock | No | Ending block number for the query | |
| order | No | Order of results (ascending or descending) | |
| tokenType | No | Type of token (ERC721 or ERC1155) | |
| contractAddresses | No | List of contract addresses to filter by |
Implementation Reference
- index.ts:657-699 (registration)Registration of the 'get_transfers_for_owner' tool in the ListToolsRequestSchema handler, defining name, description, and input schema.{ name: "get_transfers_for_owner", description: "Get NFT transfers for an owner", inputSchema: { type: "object", properties: { owner: { type: "string", description: "The wallet address to get transfers for", }, pageKey: { type: "string", description: "Key for pagination", }, fromBlock: { type: "number", description: "Starting block number for the query", }, toBlock: { type: "number", description: "Ending block number for the query", }, order: { type: "string", enum: ["asc", "desc"], description: "Order of results (ascending or descending)", }, tokenType: { type: "string", enum: ["ERC721", "ERC1155"], description: "Type of token (ERC721 or ERC1155)", }, contractAddresses: { type: "array", items: { type: "string", }, description: "List of contract addresses to filter by", }, }, required: ["owner"], }, },
- index.ts:76-78 (schema)TypeScript type definition for the tool's parameters, extending Alchemy SDK's GetTransfersForOwnerOptions with required owner field.type GetTransfersForOwnerParams = GetTransfersForOwnerOptions & { owner: string; };
- index.ts:229-244 (helper)Helper function to validate input parameters for the get_transfers_for_owner tool.const isValidGetTransfersForOwnerParams = ( args: any ): args is GetTransfersForOwnerParams => { return ( typeof args === "object" && args !== null && typeof args.owner === "string" && (args.pageKey === undefined || typeof args.pageKey === "string") && (args.fromBlock === undefined || typeof args.fromBlock === "number") && (args.toBlock === undefined || typeof args.toBlock === "number") && (args.order === undefined || typeof args.order === "string") && (args.tokenType === undefined || typeof args.tokenType === "string") && (args.contractAddresses === undefined || Array.isArray(args.contractAddresses)) ); };
- index.ts:39-51 (schema)Import of Alchemy SDK type GetTransfersForOwnerOptions used for the tool schema.import type { GetNftsForOwnerOptions, GetNftMetadataOptions, AssetTransfersParams, GetNftSalesOptions, GetContractsForOwnerOptions, GetOwnersForNftOptions, GetTransfersForContractOptions, GetTransfersForOwnerOptions, TransactionReceiptsParams, GetTokensForOwnerOptions, GetBaseNftsForContractOptions, } from "alchemy-sdk";