Crates.io | nifty-cli |
lib.rs | nifty-cli |
version | 0.1.0 |
source | src |
created_at | 2024-02-27 13:47:28.289348 |
updated_at | 2024-04-18 20:14:25.743856 |
description | CLI for the Nifty Asset program. |
homepage | https://nifty-oss.org |
repository | https://github.com/nifty-oss/cli |
max_upload_size | |
id | 1155121 |
size | 421,062 |
A CLI for interacting with the Nifty asset program.
Via install script:
bash <(curl -sSf https://raw.githubusercontent.com/nifty-oss/cli/main/scripts/install.sh)
From source:
cargo install --path .
Burns an asset, closing the account reclaiming all rent.
Usage: nifty burn [OPTIONS] <ASSET> [RECIPIENT]
Arguments:
<ASSET> The asset to burn
[RECIPIENT] The recipient to receive reclaimed rent. Defaults to the signer
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Examples:
No recipient specified, so reclaimed rent goes to the signing keypair:
nifty burn 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP
Recipient specified and receives reclaimed rent:
nifty burn 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP 9Z3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP
Create an asset with extension data
Usage: nifty mint [OPTIONS] <ASSET_FILE_PATH>
Arguments:
<ASSET_FILE_PATH>
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Create a batch of assets with extension data
Usage: nifty mint-batch [OPTIONS] <ASSET_FILES_DIR>
Arguments:
<ASSET_FILES_DIR>
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Creates a new asset.
Usage: nifty create [OPTIONS] --name <NAME>
Options:
-k, --keypair-path <KEYPAIR_PATH>
Path to the keypair file
-n, --name <NAME>
The name of the asset
-a, --asset-keypair-path <ASSET_KEYPAIR_PATH>
Path to the mint keypair file
-r, --rpc-url <RPC_URL>
RPC URL for the Solana cluster
--immutable
Create the asset as immutable
-o, --owner <OWNER>
Owner of the created asset, defaults to authority pubkey
-h, --help
Print help
Examples:
Create a mutable asset:
nifty create --name "My Asset"
Create an immutable asset:
nifty create --name "My Immutable Asset" --immutable
Create an asset with a specific owner:
nifty create --name "My Asset" --owner 9Z3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP
Create an asset from an existing keypair file:
nifty create --name "My Asset" --asset-keypair-path /path/to/asset-keypair.json
Decodes an asset into a human readable format.
Usage: nifty decode [OPTIONS] <ASSET>
Arguments:
<ASSET>
Options:
-f, --field <FIELD> The field to decode. If not specified, the entire asset will be decoded
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Example:
nifty decode 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP
Decode a specific field:
nifty decode 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP --field state
prints only the state information of the asset.
Set a delegate on an asset with specific roles
Usage: nifty approve [OPTIONS] <ASSET> <DELEGATE>
Arguments:
<ASSET> The asset to delegate
<DELEGATE> The address to delegate to
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-R, --role <ROLE> The role for the delegate to have: "burn", "lock", "transfer". Specify each one separately: --role burn --role lock --role transfer
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Example:
```bash
nifty approve 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP 9Z3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP --role burn --role lock
Revoke a delegate from an asset
Revoke a delegate from an asset
Usage: nifty revoke [OPTIONS] <ASSET>
Arguments:
<ASSET> The asset to revoke the delegate from
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-R, --role <ROLE> The roles to revoke: "burn", "lock", "transfer". Specify each one separately: --role burn --role lock --role transfer
--all Revoke all roles from the delegate and clear it
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Lock an asset, preventing any actions to be performed on it.
Usage: nifty lock [OPTIONS] <ASSET> [DELEGATE_KEYPAIR_PATH]
Arguments:
<ASSET> The asset to lock
[DELEGATE_KEYPAIR_PATH] Path to the delegate keypair file. Defaults to the signer
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Example:
nifty lock 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP
The keypair used must be the delegate of the asset.
Unlock an asset, allowing actions to be performed on it.
Usage: nifty unlock [OPTIONS] <ASSET> [DELEGATE_KEYPAIR_PATH]
Arguments:
<ASSET> The asset to unlock
[DELEGATE_KEYPAIR_PATH] Path to the delegate keypair file. Defaults to the signer
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Example:
nifty unlock 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP
The keypair used must be the delegate of the asset.
Transfers an asset to a new owner.
Usage: nifty transfer [OPTIONS] <ASSET> <RECIPIENT>
Arguments:
<ASSET> The asset to transfer
<RECIPIENT> The recipient of the asset
Options:
-k, --keypair-path <KEYPAIR_PATH> Path to the keypair file
-r, --rpc-url <RPC_URL> RPC URL for the Solana cluster
-h, --help Print help
Example:
nifty transfer 92D3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP 9Z3tDoqtREj3Exkr5ws9UPawG3yhaEwjSP4J5GumuRP