GET transfers of NFTs for a given contract and other parameters.
GET
1const Moralis = require("moralis").default;2const { EvmChain } = require("@moralisweb3/common-evm-utils");3const { config } = require("dotenv");4 5// Inject environment variables6config();7 8const runApp = async () => {9 await Moralis.start({10 apiKey: process.env.MORALIS_API_KEY,11 // ...and any other configuration12 });13 14 const address = "0xCAFFA4b5F72a44C75F796E94F22dEBd6369F04FC";15 16 const chain = EvmChain.PALM;17 18 const response = await Moralis.EvmApi.nft.getNFTContractTransfers({19 address,20 chain,21 });22 23 console.log(response.toJSON());24};25 26runApp();
1import Moralis from "moralis";2import {3 EvmChain,4 GetNFTContractTransfersResponseAdapter,5} from "@moralisweb3/common-evm-utils";6import { config } from "dotenv";7 8// Inject environment variables9config();10 11const runApp = async () => {12 await Moralis.start({13 apiKey: process.env.MORALIS_API_KEY,14 // ...and any other configuration15 });16 17 const address: string = "0xCAFFA4b5F72a44C75F796E94F22dEBd6369F04FC";18 19 const chain: EvmChain = EvmChain.PALM;20 21 const response: GetNFTContractTransfersResponseAdapter =22 await Moralis.EvmApi.nft.getNFTContractTransfers({23 address,24 chain,25 });26 27 console.log(response.toJSON());28};29 30runApp();
1[2 {3 block_number: "9102825",4 block_timestamp: "2022-12-01T21:32:43.000Z",5 block_hash:6 "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9",7 transaction_hash:8 "0xd29bf009da6ffdd67d2706f085bc99fb951d014514e8dc9730b836535b73de42",9 transaction_index: 7,10 log_index: 0,11 value: "0",12 contract_type: "ERC721",13 transaction_type: "Single",14 token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc",15 token_id: "281157276333746452260471326132308240906",16 from_address: "0x0000000000000000000000000000000000000000",17 to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65",18 amount: "1",19 verified: 1,20 operator: null,21 },22 {23 block_number: "9102825",24 block_timestamp: "2022-12-01T21:32:43.000Z",25 block_hash:26 "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9",27 transaction_hash:28 "0x65e3447779581df2cbb919decf5b3677b2dc416de8a1c23f4c9bbb3c39e7f833",29 transaction_index: 6,30 log_index: 0,31 value: "0",32 contract_type: "ERC721",33 transaction_type: "Single",34 token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc",35 token_id: "65097749733583456106785090648525729608",36 from_address: "0x0000000000000000000000000000000000000000",37 to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65",38 amount: "1",39 verified: 1,40 operator: null,41 },42 {43 block_number: "9102825",44 block_timestamp: "2022-12-01T21:32:43.000Z",45 block_hash:46 "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9",47 transaction_hash:48 "0xfb1b27e20147ed92d3a82dd6cd6fa883e6f51e0e1ee7a9fb81d1fab182c4ca78",49 transaction_index: 5,50 log_index: 0,51 value: "0",52 contract_type: "ERC721",53 transaction_type: "Single",54 token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc",55 token_id: "244157372458411156870136815790339173378",56 from_address: "0x0000000000000000000000000000000000000000",57 to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65",58 amount: "1",59 verified: 1,60 operator: null,61 },62 {63 block_number: "9102825",64 block_timestamp: "2022-12-01T21:32:43.000Z",65 block_hash:66 "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9",67 transaction_hash:68 "0x549ff5521a2b1cc12e7faf21ca09c18bb2077850281706e268014b2aad57b531",69 transaction_index: 4,70 log_index: 0,71 value: "0",72 contract_type: "ERC721",73 transaction_type: "Single",74 token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc",75 token_id: "130950274337472215324705282371518642782",76 from_address: "0x0000000000000000000000000000000000000000",77 to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65",78 amount: "1",79 verified: 1,80 operator: null,81 },82 {83 block_number: "9102825",84 block_timestamp: "2022-12-01T21:32:43.000Z",85 block_hash:86 "0x1ee2d33120f4ed1976ed6852c8d68a3e783e28ccec09794232ea9cbbb3c508f9",87 transaction_hash:88 "0x2e6120564b92db7c8801d34138aeba1233b5bf548ffdd84d2fa67c284d303e17",89 transaction_index: 3,90 log_index: 0,91 value: "0",92 contract_type: "ERC721",93 transaction_type: "Single",94 token_address: "0xcaffa4b5f72a44c75f796e94f22debd6369f04fc",95 token_id: "98224603389739941676113421312587779238",96 from_address: "0x0000000000000000000000000000000000000000",97 to_address: "0x3831d7373b0ef450d91c49db50360a939b8baf65",98 amount: "1",99 verified: 1,100 operator: null,101 },102];