# 使用 Alchemy SDK 与链上数据交互 **Published by:** [Superobin](https://paragraph.com/@rlog/) **Published on:** 2022-10-05 **URL:** https://paragraph.com/@rlog/alchemy-sdk ## Content 使用 Alchemy SDK 可以方便的让你的 dapp 与链上进行数据交互引入 sdknpm 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 介绍可查看这里: https://docs.alchemy.com/reference/alchemy-sdk-quickstart ## Publication Information - [Superobin](https://paragraph.com/@rlog/): Publication homepage - [All Posts](https://paragraph.com/@rlog/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@rlog): Subscribe to updates - [Twitter](https://twitter.com/rlog): Follow on Twitter