Get Transfers by Contract
GET
transfers of NFTs for a given contract and other parameters.
Query Params | Description |
---|---|
chain | The chain to query |
address (required) | The address of the wallet |
const Moralis = require("moralis").default;const { EvmChain } = require("@moralisweb3/common-evm-utils");const { config } = require("dotenv");
// Inject environment variablesconfig();
const runApp = async () => { await Moralis.start({ apiKey: process.env.MORALIS_API_KEY, // ...and any other configuration });
const address = "0xCAFFA4b5F72a44C75F796E94F22dEBd6369F04FC";
const chain = EvmChain.PALM;
const response = await Moralis.EvmApi.nft.getNFTContractTransfers({ address, chain, });
console.log(response.toJSON());};
runApp();
import Moralis from "moralis";import { EvmChain, GetNFTContractTransfersResponseAdapter,} from "@moralisweb3/common-evm-utils";import { config } from "dotenv";
// Inject environment variablesconfig();
const runApp = async () => { await Moralis.start({ apiKey: process.env.MORALIS_API_KEY, // ...and any other configuration });
const address: string = "0xCAFFA4b5F72a44C75F796E94F22dEBd6369F04FC";
const chain: EvmChain = EvmChain.PALM;
const response: GetNFTContractTransfersResponseAdapter = await Moralis.EvmApi.nft.getNFTContractTransfers({ address, chain, });
console.log(response.toJSON());};
runApp();
[ { block_number: "9102825", block_timestamp: "2022-12-01T21:32:43.000Z", block_hash: "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9", transaction_hash: "0xd29bf009da6ffdd67d2706f085bc99fb951d014514e8dc9730b836535b73de42", transaction_index: 7, log_index: 0, value: "0", contract_type: "ERC721", transaction_type: "Single", token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc", token_id: "281157276333746452260471326132308240906", from_address: "0x0000000000000000000000000000000000000000", to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65", amount: "1", verified: 1, operator: null, }, { block_number: "9102825", block_timestamp: "2022-12-01T21:32:43.000Z", block_hash: "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9", transaction_hash: "0x65e3447779581df2cbb919decf5b3677b2dc416de8a1c23f4c9bbb3c39e7f833", transaction_index: 6, log_index: 0, value: "0", contract_type: "ERC721", transaction_type: "Single", token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc", token_id: "65097749733583456106785090648525729608", from_address: "0x0000000000000000000000000000000000000000", to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65", amount: "1", verified: 1, operator: null, }, { block_number: "9102825", block_timestamp: "2022-12-01T21:32:43.000Z", block_hash: "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9", transaction_hash: "0xfb1b27e20147ed92d3a82dd6cd6fa883e6f51e0e1ee7a9fb81d1fab182c4ca78", transaction_index: 5, log_index: 0, value: "0", contract_type: "ERC721", transaction_type: "Single", token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc", token_id: "244157372458411156870136815790339173378", from_address: "0x0000000000000000000000000000000000000000", to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65", amount: "1", verified: 1, operator: null, }, { block_number: "9102825", block_timestamp: "2022-12-01T21:32:43.000Z", block_hash: "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9", transaction_hash: "0x549ff5521a2b1cc12e7faf21ca09c18bb2077850281706e268014b2aad57b531", transaction_index: 4, log_index: 0, value: "0", contract_type: "ERC721", transaction_type: "Single", token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc", token_id: "130950274337472215324705282371518642782", from_address: "0x0000000000000000000000000000000000000000", to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65", amount: "1", verified: 1, operator: null, }, { block_number: "9102825", block_timestamp: "2022-12-01T21:32:43.000Z", block_hash: "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9", transaction_hash: "0x2e6120564b92db7c8801d34138aeba1233b5bf548ffdd84d2fa67c284d303e17", transaction_index: 3, log_index: 0, value: "0", contract_type: "ERC721", transaction_type: "Single", token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc", token_id: "98224603389739941676113421312587779238", from_address: "0x0000000000000000000000000000000000000000", to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65", amount: "1", verified: 1, operator: null, },];