We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem:
The tests of the 'Introduction to Ethereum Swarm 8. Mint NFT' course cannot run because of the following error:
Wrong solution! Should correctly mint NFT Error: Cannot find module '@agorapp/contracts' Require stack: - /app/packages/swarm-docker-runner/userspace/code/main.ts - /app/packages/runner-common/src/services/JavaScriptUserspace.ts - /app/packages/runner-common/src/index.ts - /app/packages/swarm-docker-runner/src/modules/courses/introToSwarm.ts - /app/packages/swarm-docker-runner/src/main.ts
My code:
import { Bee } from '@ethersphere/bee-js'; import { NftContractWrapper } from '@agorapp/contracts'; const bee = new Bee('https://api.gateway.ethswarm.org'); export async function main( nftFaucetContractAddress: string, imgPostageStampId: string, imgFile: string, postageStampId: string, recipient: string, ) { await uploadNftImage(imgPostageStampId, imgFile) await prepareNftMetadata(imgPostageStampId, imgFile) const nftFaucetContract = new NftContractWrapper(nftFaucetContractAddress); const imgUri = await uploadNftImage(imgPostageStampId, imgFile); const tokenUri = await prepareNftMetadata(postageStampId, imgUri); const mintedTx = await nftFaucetContract.mintNft(recipient, tokenUri); return {transactionHash: mintedTx.transactionHash}; } export async function uploadNftImage(imgPostageStampId: string, imgFile: string) { const res = await bee.uploadFile(imgPostageStampId, imgFile); return 'bzz://'.concat(res.reference); } export async function prepareNftMetadata(postageStampId: string, imgUri: string) { const metadata = { name: 'My NFT', description: 'My NFT description', image: imgUri, }; const metadataStr = JSON.stringify(metadata); const res = await bee.uploadData(postageStampId, metadataStr); return { reference: res.reference, tokenUri: 'bzz://'.concat(res.reference), }; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem:
The tests of the 'Introduction to Ethereum Swarm 8. Mint NFT' course cannot run because of the following error:
My code:
The text was updated successfully, but these errors were encountered: