{"id":13762031,"url":"https://github.com/near-examples/NFT","last_synced_at":"2025-05-10T14:31:06.837Z","repository":{"id":37211608,"uuid":"264035199","full_name":"near-examples/NFT","owner":"near-examples","description":"Example implementations of tokens to represent unique assets, such as collectibles or deeds, using the NEP-171 spec (similar to ERC-721) ","archived":false,"fork":false,"pushed_at":"2025-03-29T20:32:39.000Z","size":1553,"stargazers_count":376,"open_issues_count":0,"forks_count":282,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-29T21:26:55.098Z","etag":null,"topics":["cli","ready-to-use","rust"],"latest_commit_sha":null,"homepage":"https://nomicon.io/Standards/NonFungibleToken/Core.html","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/near-examples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-14T22:03:41.000Z","updated_at":"2025-03-29T20:32:43.000Z","dependencies_parsed_at":"2023-01-19T11:17:02.879Z","dependency_job_id":"8bad1bb0-9409-4534-a28f-2b3ef5863964","html_url":"https://github.com/near-examples/NFT","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/near-examples%2FNFT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/near-examples%2FNFT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/near-examples%2FNFT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/near-examples%2FNFT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/near-examples","download_url":"https://codeload.github.com/near-examples/NFT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253428247,"owners_count":21906877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","ready-to-use","rust"],"created_at":"2024-08-03T14:00:33.875Z","updated_at":"2025-05-10T14:31:06.831Z","avatar_url":"https://github.com/near-examples.png","language":"Rust","readme":"# Non-fungible Token (NFT) Example 🖼️ \n\n[![](https://img.shields.io/badge/⋈%20Examples-Basics-green)](https://docs.near.org/tutorials/welcome)\n[![](https://img.shields.io/badge/Contract-Rust-red)](contract-rs)\n\nThis repository contains an example implementation of a [non-fungible token] contract in Rust which uses [near-contract-standards] and workspaces-rs tests.\n\n  [non-fungible token]: https://nomicon.io/Standards/NonFungibleToken/README.html\n  [near-contract-standards]: https://github.com/near/near-sdk-rs/tree/master/near-contract-standards\n  [near-workspaces-rs]: https://github.com/near/near-workspaces-rs\n\n\u003e**Note**: If you'd like to learn how to create an NFT contract from scratch that explores every aspect of the [NEP-171](https://github.com/near/NEPs/blob/master/neps/nep-0171.md) standard including an NFT marketplace, check out the NFT [Zero to Hero Tutorial](https://docs.near.org/tutorials/nfts/introduction).\n\n\u003cbr /\u003e\n\n## How to Build Locally?\n\nInstall [`cargo-near`](https://github.com/near/cargo-near) and run:\n\n```bash\ncargo near build\n```\n\n\u003e Note: to avoid issues, be sure to update your Rust compiler with `rustup update stable`\n\n## How to Test Locally?\n\n```bash\ncargo test\n```\n\n## How to Deploy?\n\nTo deploy manually, install [`cargo-near`](https://github.com/near/cargo-near) and run:\n\n```bash\n# Create a new account\ncargo near create-dev-account\n\n# Deploy the contract on it\ncargo near deploy \u003caccount-id\u003e\n\n# Initialize the contract\nnear call \u003caccount-id\u003e new_default_meta '{\"owner_id\": \"\u003caccount-id\u003e\"}' --accountId \u003caccount-id\u003e\n```\n\n## Basic methods\n```bash\n# View metadata\nnear view \u003caccount-id\u003e nft_metadata\n\n# Mint a NFT\nnear call \u003caccount-id\u003e nft_mint '{\"token_id\": \"0\", \"token_owner_id\": \"\u003caccount-id\u003e\", \"token_metadata\": { \"title\": \"Olympus Mons\", \"description\": \"Tallest mountain in charted solar system\", \"media\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Olympus_Mons_alt.jpg/1024px-Olympus_Mons_alt.jpg\", \"copies\": 1}}' --accountId \u003caccount-id\u003e --deposit 0.1\n\n# View tokens for owner\nnear view \u003caccount-id\u003e nft_tokens_for_owner '{\"account_id\": \"\u003cowner_id\u003e\"}'\n\n# Transfer a NFT\nnear call \u003caccount-id\u003e nft_transfer '{\"token_id\": \"0\", \"receiver_id\": \"\u003creceiver-id\u003e\", \"memo\": \"transfer ownership\"}' --accountId \u003caccount-id\u003e --depositYocto 1\n```\n\n## Useful Links\n\n- [cargo-near](https://github.com/near/cargo-near) - NEAR smart contract development toolkit for Rust\n- [near CLI](https://near.cli.rs) - Iteract with NEAR blockchain from command line\n- [NEAR Rust SDK Documentation](https://docs.near.org/sdk/rust/introduction)\n- [NEAR Documentation](https://docs.near.org)\n- [NFT Zero to Hero Tutorial](https://docs.near.org/tutorials/nfts/introduction)\n- [NEAR StackOverflow](https://stackoverflow.com/questions/tagged/nearprotocol)\n- [NEAR Discord](https://near.chat)\n- [NEAR Telegram Developers Community Group](https://t.me/neardev)\n- NEAR DevHub: [Telegram](https://t.me/neardevhub), [Twitter](https://twitter.com/neardevhub)\n","funding_links":[],"categories":["Web3 and ZKP Framework","Projects"],"sub_categories":["NFT"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnear-examples%2FNFT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnear-examples%2FNFT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnear-examples%2FNFT/lists"}