Nifty Asset
Nifty Asset is a fully-featured digital asset standard for the SVM. It is lightweight and efficient, designed to offer a small footprint (compute units consumption) and be highly flexible. The main features of the standard are:
Single account to represent a digital asset.
Flexible on-chain representation: store as much or as little data using optional extensions.
Efficient zero-copy de-/serialization to minimize compute units utilization.
Full-featured standard, including royalty enforcement, delegates, lock/unlock, inscriptions and groups (collections).
Rust and JavaScript client SDKs.
Extensions can be combined to create a wide variety of non-fungible assets, from simple assets with links to off-chain data to fully on-chain assets. In addition to extensions, Nifty Asset follows the ⎘Proxy Pattern to provide developers a program interface to customize every aspect of the protocol – and it enables that without requiring direct changes to the program. The advantage of that is that developers have full flexibility to extend its behavior in an non-opiniated way. The only requirement is to implement the ⎘program interface.
The complete Nifty Asset documentation is available at: https://nifty-oss.org/docs/category/nifty-asset
Nifty CLI
Install from Source
Requires Rust to be installed:
Now you can install with pnpm
from the root directory of the nifty-asset
repository:
With Rust's cargo
:
Directly from crates.io:
To see all the available commands and usage suggestions run:
To see the help for a specific command, run the command with the --help
option, e.g.:
We install the Solana CLI which we use to set and configure both a default keypair and RPC node URL:
Now we can set the default keypair and Eclipse RPC node URL:
Nifty will use these values by default, but you can also pass them as options to the commands.
JavaScript Client
The Nifty Asset JS Client is a JavaScript client that provides a set of methods for interacting with the Nifty Asset program on the Solana Virtual Machine. This guide will help you get started with the Nifty Asset JS Client and show you how to use it with the Umi framework.
Requirements
Node.js version 18 or higher
NPM or other package manager (e.g., Yarn, PNPM)
TypeScript version 4.0 or higher installed
Solana CLI installed (for local development)
Umi
The Nifty Asset JS Client is built to work with the Umi framework. Umi is a lightweight JavaScript framework that is used to build Solana clients. Umi was built and is maintained by the Metaplex Foundation. The Nifty Asset JS Client is an Umi plugin that provides a set of methods for interacting with the Nifty Asset program.
Required Dependencies
To get started you will need to install the following libraries:
@metaplex-foundation/umi
: The core Umi framework npmjs.com@metaplex-foundation/umi-bundle-defaults
: Default plug-ins bundle for Umi npmjs.com@nifty-oss/asset
: The Nifty Asset JS Client npmjs.com
Add these dependencies to your project by running the following command:
Umi Configuration
To use the Nifty Asset JS Client, you will need to configure Umi to use the network of your choice (e.g., Eclipse Mainnet, Devnet, Testnet, or Local) and the Nifty Asset plugin. Create an instance of Umi with the createUmi
method, and pass in the network URL:
To configure Umi on other networks, simply replace the URL in the createUmi
method with the RPC endpoint of your choice.
RPC Endpoints
Nifty Asset is available on the following Eclipse networks:
Eclipse Mainnet
Eclipse Testnet
Eclipse Devnet
Replace the URL in your createUmi
method with the network of your choice.
Use Nifty Asset JS Client
To use the Nifty Asset JS Client, you will need to import the client and add it to your Umi instance using the .use()
this this:
The .use()
method registers the Nifty Asset plugin with the Umi instance, enabling access to the Nifty Asset methods.
You are all set and ready to start using the Nifty Asset JS Client with Umi. We will use this same structure throughout the documentation to demonstrate how to use the Nifty Asset JS Client with Umi, so take a moment to familiarize yourself with this setup. If you have any questions, please reach out to the Nifty Asset team on Discord.
Last updated