Skip to content
New issue

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

Updates for the Taquito-based NFT tutorial #115

Merged
merged 29 commits into from
Oct 13, 2023

Conversation

timothymcmackin
Copy link
Collaborator

@timothymcmackin timothymcmackin commented Sep 20, 2023

Depends on #114.

Preview: https://docs-staging-git-feat-nft-taquito-tutorial-trili-tech.vercel.app/tutorials/create-an-nft/nft-taquito/

This is an update of the tutorial that creates a web app that mints NFTs. I've tried to simplify it and make the steps easier to follow.

TODOs:

  • Before merging this tutorial, make the trilitech/tutorial-applications repo public.
  • Come up with a way to make the diagram image expand so people can read it -- this may be able to wait till we're on a new platform -- I have this working in the new platform
  • Instructions for funding the user's wallet

Questions:

  • Is there a way to get the contract address later if I forget to copy it when I originate via the LIGO IDE?
  • I changed the counter tutorial from a main function to individual entrypoint functions because main() was deprecated. Should I do that here?
  • I removed the following details as too technical for the context; is that OK?

The id is returned by Taquito as a BigNumber, so you have to call .toNumber() first before being able to use it. Once we have the id, we can look for its metadata in the token_metadata bigmap. The value returned is a Michelson map and the metadata path is going to be stored at the empty key. Because the path is stored as bytes, we use bytes2Char() provided by the @taquito/utils package to convert the returned bytes into a string. To finish, we return an object with 2 properties: the token id and the IPFS hash of the metadata.

Note: although the standard requires us to store the IPFS hash in the following manner => ipfs://IPFS_HASH, there is no safeguard and any kind of data can be stored there, this is why we make a simple check with tokenInfo.slice(0, 7) === “ipfs://” using the ternary operator to verify that at least this condition is fulfilled.

The bind attribute in Svelte makes it very easy to store the input in a variable that we can use later when we want to pin the NFT to the IPFS. A click on the upload button will trigger the upload of the picture, its title, and description to the server.

We define 2 boolean variables called pinningMetadata and mintingToken that we will update according to the result of the different steps of the upload to give some visual feedback to the users in the UI.

@timothymcmackin timothymcmackin self-assigned this Sep 20, 2023
@vercel
Copy link

vercel bot commented Sep 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2023 1:39pm

Copy link
Collaborator

@claudebarde claudebarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comments I left, thank you!

@timothymcmackin
Copy link
Collaborator Author

@claudebarde Made updates; thanks for the corrections!

claudebarde
claudebarde previously approved these changes Sep 22, 2023
Base automatically changed from feat/nft-tutorial to staging October 9, 2023 12:49
@timothymcmackin timothymcmackin dismissed claudebarde’s stale review October 9, 2023 12:49

The base branch was changed.

Copy link
Contributor

@beatalipska beatalipska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 for me - wow!

@timothymcmackin timothymcmackin merged commit d8145da into staging Oct 13, 2023
@timothymcmackin timothymcmackin deleted the feat/nft-taquito-tutorial branch October 13, 2023 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants