@aalu1418/sponsored-erc721 中文文档教程
Sponsored ERC-721
与 Conflux 网络上赞助的 NFT 交互的包 要
Setup Instructions
npm install @aalu1418/sponsored-erc721
获得完整功能,请确保还部署此处描述的相应合约:https://github.com/Conflux-Network-Global/sponsored-erc721
Functionality
需要 .env
工作目录中的文件。
PRIVATE_KEY=<conflux private key>
Commands
//initialize connection
//input: conflux network endpoint, NFT address
//output: nft object
const nft = new NFT("http://test.confluxrpc.org", "0x8aa092e0660c59eab456efdbd39ae8d158e9a95b");
//mint NFT to user address
//input: user address, NFT id
//output: conflux network transaction hash
const tx = await nft.mint("0x18e33e342b0f3fFE0b0193950FE9F2e0378a81Ee", 1);
console.log("Mint TX hash:", tx.transactionHash);
//get NFT assets for specific user address
//input: address
//output: array of NFT ids
const list = await nft.getAssets("0x18e33e342b0f3fFE0b0193950FE9F2e0378a81Ee")
console.log("Assets:", list);
Sponsored ERC-721
Package for interacting with sponsored NFTs on Conflux network
Setup Instructions
npm install @aalu1418/sponsored-erc721
For full functionality make sure to also deploy corresponding contracts described here: https://github.com/Conflux-Network-Global/sponsored-erc721
Functionality
Requires a .env
file in the working directory.
PRIVATE_KEY=<conflux private key>
Commands
//initialize connection
//input: conflux network endpoint, NFT address
//output: nft object
const nft = new NFT("http://test.confluxrpc.org", "0x8aa092e0660c59eab456efdbd39ae8d158e9a95b");
//mint NFT to user address
//input: user address, NFT id
//output: conflux network transaction hash
const tx = await nft.mint("0x18e33e342b0f3fFE0b0193950FE9F2e0378a81Ee", 1);
console.log("Mint TX hash:", tx.transactionHash);
//get NFT assets for specific user address
//input: address
//output: array of NFT ids
const list = await nft.getAssets("0x18e33e342b0f3fFE0b0193950FE9F2e0378a81Ee")
console.log("Assets:", list);
更多
你可能也喜欢
- 20scoops 中文文档教程
- 3d-viewer-encode 中文文档教程
- @0ti.me/tiny-pfp 中文文档教程
- @0xaio/react-dev-utils 中文文档教程
- @10up/babel-preset-default 中文文档教程
- @12stonechurch/react-native-chromecast 中文文档教程
- @20i/cognito-react 中文文档教程
- @3test/wanchain-order-gateway 中文文档教程
- @42.nl/ui-core-submit-button 中文文档教程
- @4geit/rct-data-table-component 中文文档教程