diff --git a/docs/3.tutorials/nfts/minting-nfts.md b/docs/3.tutorials/nfts/minting-nfts.md index 4129d7ef65..640f313e83 100644 --- a/docs/3.tutorials/nfts/minting-nfts.md +++ b/docs/3.tutorials/nfts/minting-nfts.md @@ -138,19 +138,21 @@ self.owner_by_id.insert(&token_id, &owner_id); To build your contract run the following command in your terminal which builds your contract using Rust's `cargo`. ```bash -./scripts/build.sh +cargo near build ``` This will generate WASM binaries into your `res/` directory. This WASM file is the smart contract we'll be deploying onto the NEAR blockchain. -> **Tip:** If you run into errors make sure you have [Rust installed](/build/smart-contracts/quickstart#prerequisites) and are in the root directory of the NFT example. +:::tip +If you run into errors make sure you have [Rust installed](/build/smart-contracts/quickstart#prerequisites) and are in the root directory of the NFT example. +::: ### Testing the contract {#testing-the-contract} Written in the smart contract there are pre-written tests that you can run. Run the following command in your terminal to perform these simple tests to verify that your contract code is working. ```bash -cargo test -- --nocapture +cargo test ``` > **Note:** the more complex simulation tests aren't performed with this command but you can find them in `tests/sim`. @@ -399,14 +401,12 @@ Finally, if you are new to Rust and want to dive into smart contract development **_Happy minting!_** 🪙 -## Blockcraft - a Practical Extension - -If you'd like to learn how to use Minecraft to mint NFTs and copy/paste builds across different worlds while storing all your data on-chain, be sure to check out our [Minecraft tutorial](/tutorials/nfts/minecraft-nfts) - -## Versioning for this article {#versioning-for-this-article} +:::note Versioning for this article At the time of this writing, this example works with the following versions: - cargo: `cargo 1.54.0 (5ae8d74b3 2021-06-22)` - rustc: `rustc 1.54.0 (a178d0322 2021-07-26)` - near-cli: `2.1.1` + +::: diff --git a/docs/3.tutorials/nfts/simple-nft-minting-example.md b/docs/3.tutorials/nfts/simple-nft-minting-example.md deleted file mode 100644 index fd68d09eea..0000000000 --- a/docs/3.tutorials/nfts/simple-nft-minting-example.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -id: minting-nft-frontend -title: Minting NFT Front-end -sidebar_label: Minting Front-end ---- -import {Github} from "@site/src/components/codetabs" - -# NFT Minting Front-end - -> In this tutorial you'll learn how to create a simple NFT front-end and mint a "Go Team" NFT on the NEAR blockchain straight from your web browser. - -## App Overview - -The app is fairly simple: the user signs in and hits the Mint NFT button. Once the user hits the mint button, a "Go Team" NFT is minted and sent to their NEAR Wallet. - -![Front-end](/docs/assets/nfts/nft-mint-frontend.png) - -## Smart Contract code - -The code for the NFT smart contract can be found in the [Zero to Hero NFT tutorial](/tutorials/nfts/introduction)'s [GitHub repository](https://github.com/near-examples/nft-tutorial/tree/main/nft-contract/src), under the `main` branch. - -The contract methods used in this application are as follows: - -- `nft_mint`: Function used to mint tokens. -- `check_token`: Custom function created to check for the existence of a token. This helps to ensure one token per user. - -## Front-end - -The front-end of the contract was implemented using `create-near-app`. [React Bootstrap](https://react-bootstrap.github.io/) was used for the styling of the application. - -To bootstrap your React front-end, run the following command on your terminal: - -```sh -npx create-near-app --frontend react --contract rust -``` - -Then, simply import the contract files from the `main` branch, and you'll have the needed structure to run the application. - -### Start - -Upon mounting the application's components, the app checks for the existence of a non-fungible token. - - - -If no prior NFT has been minted, the mint button will be available for use. - -### Mint button - -Here is the function behind the mint button. The meta data has been filled out for the user already: - -- `token_id` is set by the user's account id, -- and the `media` link is hard-coded to a `goteam-gif.gif` hosted on IPFS. - - - -After hitting the Mint NFT button the user will be able to check out the newly minted NFT at [wallet.testnet.near.org](https://testnet.mynearwallet.com//?tab=collectibles), under the Wallet's `Collectibles` tab. - -## Final remarks - -You can find the complete application repository [on GitHub](https://github.com/near-examples/nft-tutorial-frontend) to clone and run. -In the configuration folder you can see that this smart contract has been deployed to `nft-frontend-simple-mint.blockhead.testnet`: - - - -You can also check out the [explorer link here](https://testnet.nearblocks.io/address/nft-frontend-simple-mint.blockhead.testnet) to see how many individuals have been minting their own _Go Team_ NFTs. _**Happy Minting!**_ - -:::tip -Clone and run this example from https://github.com/near-examples/nft-tutorial-frontend -::: diff --git a/website/sidebars.js b/website/sidebars.js index dbe450b550..5813ff7333 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -400,12 +400,6 @@ const sidebar = { { "Non-Fungible Tokens (NFT)": [ "tutorials/nfts/minting-nfts", - "tutorials/nfts/minting-nft-frontend", - { - "type": "link", - "label": "Building a Frontend", - "href": "https://github.com/near-examples/nft-tutorial-frontend" - }, { "type": "html", "value": "
"