Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 2.25 KB

README.md

File metadata and controls

64 lines (40 loc) · 2.25 KB

Non-Fungible Tokens (NFTs)

Open in Gitpod!

This repository includes NFT implementations in Rust and AssemblyScript for NEP#4

Rust

  1. Prerequisites:

If you are using Gitpod, you can skip this section! Your environment is already set up 🎉

  • Make sure Rust is installed per the prerequisites in near-sdk-rs
  • Make sure you have Node.js ≥ 12 installed (https://nodejs.org), then use it to install yarn: npm install --global yarn (or just npm i -g yarn)
  • Install dependencies: yarn install (or just yarn)
  1. Explore this contract

The source for this contract is in contract/src/lib.rs. It provides methods to manage access to tokens, transfer tokens, check access, and get token owner. The same file contains the unit tests for the contract as well.

  1. Building this contract

To build the rust version of the contract:

    npm run build:rs
  1. Running the tests To run the unit tests, run this command:
    npm run test:unit:rs

AssemblyScript

Using Gitpod? You can skip these setup steps!

To run this project locally:

  1. Prerequisites: Make sure you have Node.js ≥ 12 installed (https://nodejs.org), then use it to install yarn: npm install --global yarn (or just npm i -g yarn)
  2. Install dependencies: yarn install (or just yarn)

Now you can run all the AssemblyScript-related scripts listed in package.json! Scripts you might want to start with:

  • yarn test:unit:as: Runs all AssemblyScript tests with filenames ending in unit.spec
  • yarn build:as: Compiles the AssemblyScript contracts to Wasm binaries

Data collection

By using Gitpod in this project, you agree to opt-in to basic, anonymous analytics. No personal information is transmitted. Instead, these usage statistics aid in discovering potential bugs and user flow information.