使用 Alchemy SDK 可以方便的让你的 dapp 与链上进行数据交互
引入 sdk
npm install alchemy-sdk import { Network, Alchemy } from 'alchemy-sdk'; // Optional Config object, but defaults to demo api-key and eth-mainnet. const settings = { apiKey: 'demo', // Replace with your Alchemy API Key. network: Network.ETH_MAINNET, // Replace with your network. }; const alchemy = new Alchemy(settings);使用 api 读取 nft 数据
alchemy.nft.getNftsForOwner('vitalik.eth').then(res => { console.log(res); });
更多关于 Alchemy 介绍可查看这里:
