This repository includes a set of tool allowing users to handle certain operations such as:
- SPL token creation with metadata
- SPL token metadata update
- Add metadata to existing token
- Upload files to Arweave
- Extract Hashlist from Candy Machine or 1st Verified Creator
- Snapshot Holders
- Snapshot Metadata of NFTs
This tool set is made for SPL Tokens that follows The Fungible Standard of Metaplex (commonly referenced as Whitelist Token). Do not use it for NFTs as it is most likely to break NFT's structure.
⚠️ This repository has not been formally audited. Use it at your own risk.
git clone https://github.com/roguzh/Solana-NFT-SPL-Token-Tools.git && cd Solana-NFT-SPL-Token-Tools && yarn install
These options are required for all the features included in this tool set.
There are 2 ways to specify the keypair. You have to use one of them.
--private-key <private_key>--keypair <path_to_keypair_file>
RPC URL is required and none of the features can be executed without. RPC URL also defines the selected cluster.
--rpc-url <rpc_url>
This feature allows you to create an SPL token with specified options such as: token decimals, freeze, metadata.
This option sets the decimals of the created token. The default value is 0.
--decimals <number>
This options sets Freeze Authority of created token, to null. By default, provided keypair hold the Freeze Authority.
--disable-freeze
This option sets URI to the Metadata of the token. It follows The Fungible Standard of Metaplex. There are 2 ways to set the metadata and you have to use one of them:
--upload-metadata <name-of-file>: Use this option if you want to upload a local metadata file and use it for the token. Checkassets/example-metadata.json.--metadata-uri <uri>: Use this option if you want to use an existing URL to refer as metadata.
ts-node index.ts create-token-with-metadata
--private-key private_key_of_the_authority_wallet
--rpc-url https://api.devnet.solana.com
--decimals 0
--upload-metadata example-metadata.json
This feature allows you to update the metadata, name and symbol of an SPL token.
Address of the token you want to update its metadata. Provided wallet has to be the Update Authority else you will receive an error.
--token-address <mint-address>
This option sets URI to the Metadata of the token. It follows The Fungible Standard of Metaplex. There are 2 ways to set the metadata and you have to use one of them:
--upload-metadata <name-of-file>: Use this option if you want to upload a local metadata file and use it for the token. Checkassets/example-metadata.json.--metadata-uri <uri>: Use this option if you want to use an existing URL to refer as metadata.
ts-node index.ts update-existing-spl-metadata
--private-key private_key_of_the_authority_wallet
--rpc-url https://api.devnet.solana.com
--token-address token_address
--metadata-uri https://arweave.net/2jsnetZxCjK4juyQZS1Fpj_zc3oj1wB6tgV9mpzpFeM
This feature allows you to add metadata to existing token. This feature is supported only for tokens that follows The Fungible Standard of Metaplex
Address of the token you want to update its metadata. Provided wallet has to be the Update Authority else you will receive an error.
--token-address <mint-address>
This option sets URI to the Metadata of the token. It follows The Fungible Standard of Metaplex. There are 2 ways to set the metadata and you have to use one of them:
--upload-metadata <name-of-file>: Use this option if you want to upload a local metadata file and use it for the token. Checkassets/example-metadata.json.--metadata-uri <uri>: Use this option if you want to use an existing URL to refer as metadata.
ts-node index.ts add-metadata
--private-key private_key_of_the_authority_wallet
--rpc-url https://api.devnet.solana.com
--token-address token_address
--upload-metadata example-metadata.json
Allows you to upload file to Arweave.
Path to the file you want to update.
--file-path <path>
ts-node index.ts upload-file
--private-key private_key_of_the_authority_wallet
--rpc-url https://api.devnet.solana.com
--file-path assets/example-metadata.json
This feature allows users to extract hashlist of a collection (given Candy Machine or 1st verified creator address) using Metaplex JS SDK functions.
Address of the 1st verified creator of NFTs or the Candy Machine of the collection. Use one of the below options.
--creator-address <address>--candy-machine <address>
ts-node index.ts get-hashlist
--rpc-url https://api.devnet.solana.com
--candy-machine cm_v2_address
This feature allows users to snapshot holders of a given hashlist (json array formatted).
Path to the hashlist file
--hashlist-path <path>
If NFTs are staked in a Diamond Vault escrow wallet, you can pass escrow wallet and snapshot holders as well.
--diamond-vault-wallet <wallet-address>
ts-node index.ts snapshot-holders
--rpc-url https://api.devnet.solana.com
--hashlist-path hashlist.json
This feature allows users to snapshot all the metadata of a given hashlist (json array formatted).
Path to the hashlist file
--hashlist-path <path>
ts-node index.ts snapshot-metadata
--rpc-url https://api.devnet.solana.com
--hashlist-path hashlist.json