async function main() {
const latestBlock = await alchemy.core.getBlockNumber();
console.log("The latest block number is", latestBlock);
const getTransfers = alchemy.core.getAssetTransfers({
fromBlock: 15944276,
toBlock: "latest",
contractAddresses: ["0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"],
excludeZeroValue: true,
category: ["erc721"],
});
console.log(getTransfers);
}
Foloing alchemy tutiroal with above code. This is suppose to search a contract by its addrress given a block range.
But from the output I always get this result.
Promise { <pending> }
Seems the call is async that I need to wait for longer? What's the better way to achieve this? Thank you.
Reference: https://docs.alchemy.com/reference/using-the-alchemy-sdk