get_transfers_for_contract
Retrieve NFT transfer history for a specific contract address to track ownership changes and transaction activity.
Instructions
Get transfers for an NFT contract
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contractAddress | Yes | The contract address of the NFT collection | |
| 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) |
Implementation Reference
- index.ts:622-656 (registration)Tool registration including name, description, and detailed input schema for validating parameters like contractAddress, pagination, block range, order, and token type.name: "get_transfers_for_contract", description: "Get transfers for an NFT contract", inputSchema: { type: "object", properties: { contractAddress: { type: "string", description: "The contract address of the NFT collection", }, 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)", }, }, required: ["contractAddress"], }, },
- index.ts:73-75 (schema)TypeScript type definition for the tool parameters, extending Alchemy SDK's GetTransfersForContractOptions and requiring contractAddress.type GetTransfersForContractParams = GetTransfersForContractOptions & { contractAddress: string; };
- index.ts:214-227 (helper)Parameter validation helper function that checks if input arguments conform to GetTransfersForContractParams type for use in handler.const isValidGetTransfersForContractParams = ( args: any ): args is GetTransfersForContractParams => { return ( typeof args === "object" && args !== null && typeof args.contractAddress === "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") ); };
- index.ts:46-46 (schema)Import of Alchemy SDK type GetTransfersForContractOptions used in parameter type definition.GetTransfersForContractOptions,