The Metaplex NFT-standard Swiss Army Knife tool.

Overview

Metaboss

The Solana Metaplex NFT 'Swiss Army Knife' tool. Current supported features:

  • Decode NFT mint account metadata
  • Get a list of mint accounts for a given candy machine ID or update authority
  • Get a snapshot of current NFT holders for a given candy machine ID or update authority
  • Set update authority on a single NFT or list of NFTs
  • Update all data fields for a single NFT or list of NFTs

Planned features:

  • Use Solana config for default RPC
  • Get snapshot of holders who initially minted from a candy machine, whether or not they currently hold the token
  • Get snapshots based on verified creators

Suggestions and PRs welcome!

Install From Source

Install Rust.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Clone the source:

git clone [email protected]:samuelvanderwaal/metaboss.git

Change directory and check out the develop branch:

cd metaboss
git checkout develop

Install or build with Rust:

cargo install --path ./

or

cargo build --release

Binaries

  • Linux
  • Windows

Options

-r, --rpc The RPC endpoint to use for commands. Defaults to https://api.devnet.solana.com.

Usage

metaboss -r https://api.mainnet-beta.solana.com <SUBCOMMAND>

Please don't abuse public APIs or you may get rate-limited. If you have heavy work to do, use a private RPC such as from QuickNode or Triton.

Subcommands

Decode

Decode a single NFT mint account metadata into a JSON file.

Usage

metaboss decode --mint-account <MINT_ACCOUNT> -o <OUPUT_DIRECTORY>

The command will write the metadata JSON file to the output directory with the mint account as the name: e.g. CQNKXw1rw2eWwi812Exk4cKUjKuomZ2156STGRyXd2Mp.json. The output option defaults to the current directory.

Decode All

Decode a list of NFT mint accounts metadata into a JSON file.

Usage

metaboss decode_all --json-file <JSON_FILE> -o <OUPUT_DIRECTORY>

The JSON file should be an array of mint accounts to be decoded:

["xSy...", "Cnb..." ...]

The command will write each metadata JSON file to the output directory as a separate file with the mint account as the name: e.g. CQNKXw1rw2eWwi812Exk4cKUjKuomZ2156STGRyXd2Mp.json. The output option defaults to the current directory.

Help

Displays list of commands and options for the program.

Get Mints

Get mint accounts for a candy machine or an update authority. Specify either a candy machine id, or an update authority, but not both and at least one.

Usage

metaboss get_mints --candy-machine-id <CANDY_MACHINE_ID> -o <OUTPUT_DIRECTORY>

or

metaboss get_mints --update_authority <UPDATE_AUTHORITY> -o <OUTPUT_DIRECTORY>

This creates a JSON file named: <CANDY_MACHINE_ID/UPDATE_AUTHORITY>_mint_accounts.json in the specified output directory. The JSON file contains an array of mint accounts.

Set Update Authority

Warning: This command modifies your NFT and is for advanced users. Ensure you understand what the command does and how it affects your NFT. Use with caution.

Set the update authority on a single NFT's metadata account.

Usage

metaboss set_update_authority --keypair <PATH_TO_KEYPAIR> --mint-account <MINT_ACCOUNT> --new-update-authority <NEW_UPDATE_AUTHORITY>

Outputs a TxId to the command line so you can check the result.

Set Update Authority All

Warning: This command modifies your NFT and is for advanced users. Ensure you understand what the command does and how it affects your NFT. Use with caution.

Set the update authority on a list NFT's metadata accounts.

Usage

metaboss set_update_authority_all --keypair <PATH_TO_KEYPAIR> --json-file <PATH_TO_JSON_FILE>

The JSON file should be an array of objects with mint_account and new_update_authority:

[
    {
        "mint_account": "CQNKXw1rw2eWwi812Exk4cKUjKuomZ2156STGRyXd2Mp",
        "new_update_authority": "42NevAWA6A8m9prDvZRUYReQmhNC3NtSZQNFUppPJDRB"
    },
    {
        "mint_account": "9pVUWcAje2HphJqXKwkhsehGnPM7RFt5syqUK99tLMFM",
        "new_update_authority": "42NevAWA6A8m9prDvZRUYReQmhNC3NtSZQNFUppPJDRB"
    }
]

Outputs a TxId to the command line so you can check the result.

Update NFT

Warning: This command modifies your NFT and is for advanced users. Ensure you understand what the command does and how it affects your NFT. Use with caution.

Update all Data fields on a single NFT's metadata account by reading new values for it from a URI JSON file.

Warning: If your NFT was minted from a candy machine, this command will remove your candy machine as a creator. If you do not wish to do this, do not use this command. The next release will have a more granular update option.

Usage

metaboss update_nft --keypair <PATH_TO_KEYPAIR> --mint-account <MINT_ACCOUNT> --new-uri <NEW_URI>

Outputs a TxId to the command line so you can check the result.

Update NFT All

Warning: This command modifies your NFT and is for advanced users. Ensure you understand what the command does and how it affects your NFT. Use with caution.

Update all Data fields on a list of NFTs' metadata accounts by reading new values for it from provided new URIs.

Warning: If your NFTs were minted from a candy machine, this command will remove your candy machine as a creator. If you do not wish to do this, do not use this command. The next release will have a more granular update option.

metaboss update_nft_all --keypair <PATH_TO_KEYPAIR> --json-file <PATH_TO_JSON_FILE>

The JSON file should be an array of objects with mint_account and new_uri fields, where the new_uri is an already existing JSON file stored at the URI:

[
    {
        "mint_account": "CQNKXw1rw2eWwi812Exk4cKUjKuomZ2156STGRyXd2Mp",
        "new_uri": "https://arweave.net/FPGAv1XnyZidnqquOdEbSY6_ES735ckcDTdaAtI7GFw"
    },
    {
        "mint_account": "9pVUWcAje2HphJqXKwkhsehGnPM7RFt5syqUK99tLMFM",
        "new_uri": "https://arweave.net/N36gZYJ6PEH8OE11i0MppIbPG4VXKV4iuQw1zaq3rls"
    }
]

Snapshot

Get a snapshot of current holders of NFTs specifying an NFT collection by either candy machine ID or update authority. Specify either a candy machine id, or or an update authority, but not both and at least one.

Usage

metaboss snapshot --candy-machine-id <CANDY_MACHINE_ID> -o <OUTPUT_DIRECTORY>

or

metaboss snapshot --update_authority <UPDATE_AUTHORITY> -o <OUTPUT_DIRECTORY>

Creates a snapshot.json file in the output directory consisting of an array of objects containing owner_wallet, token_address and mint_account fields.

[
    {
        "owner_wallet": "BJD9JeKEnGU9mqqagoovTsDSr1bSZQSy8pHS8hHmjve6",
        "token_address": "BqNz4yh9q7z4N2cAdaqMCk7Y9oLF93Pcwc6hBMBRfLtc"
    },
    {
        "owner_wallet": "BJD9JeKEnGU9mqqagoovTsDSr1bSZQSy8pHS8hHmjve6",
        "token_address": "3rDbzaZJ79pz7HPR4cTABxnpGJpeKJuMf32SPfFHvNUg"
    }
]

Example Usage

Update a list of mint accounts with new URIs:

metaboss update_nft_all -k ~/.config/solana/devnet.json --json-file new_uri.json

The JSON file should be an array of mint_accounts and new_uris. Example:

[
    {
        "mint_account": "CQNKXw1rw2eWwi812Exk4cKUjKuomZ2156STGRyXd2Mp",
        "new_uri": "https://arweave.net/FPGAv1XnyZidnqquOdEbSY6_ES735ckcDTdaAtI7GFw"
    },
    {
        "mint_account": "9pVUWcAje2HphJqXKwkhsehGnPM7RFt5syqUK99tLMFM",
        "new_uri": "https://arweave.net/N36gZYJ6PEH8OE11i0MppIbPG4VXKV4iuQw1zaq3rls"
    }
]

Update a single NFT with a new update_authority:

metaboss set_update_authority -k ~/.config/solana/devnet.json --mint-account CQNKXw1rw2eWwi812Exk4cKUjKuomZ2156STGRyXd2Mp --new-update-authority 42NevAWA6A8m9prDvZRUYReQmhNC3NtSZQNFUppPJDRB
Comments
  • Metaboss not defaulting to cluster

    Metaboss not defaulting to cluster

    image

    Metaboss version: 0.3.1

    Error Message: [2021-12-10T18:54:31Z ERROR metaboss] Could not find a valid Solana-CLI config file. Please specify a RPC manually with '-r' or set up your Solana-CLI config file.

    Command: metaboss snapshot mints -c 5sBU6EEvBJjMKs3qpLSVhRuYcTbWYhsswnnNTYZq9zwk

    bug 
    opened by triviatroy 18
  • update_nft command throwing an error.

    update_nft command throwing an error.

    Hi, I'm running the update_nft command and getting the following error.

    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/parse.rs:11:34
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    I have created the NFT using the Metaplex Candy Machine.

    I have been able to use the script to run decode and get_mints without issues.

    opened by jamesturnernz 18
  • Unable to update data in 0.6.0

    Unable to update data in 0.6.0

    Hello! Long time user here, really appreciate the hard work you've put into this project. Thank you!

    I'm writing because I appear to be unable to update my token data using v0.6.0 of metaboss.

      metaboss update data -l debug \
        -r [REDACTED] \
        -k [REDACTED] \
        -a $nft \
        -n data/$nft.json
    

    Yields the following message:

    [2022-04-24T01:51:28Z DEBUG solana_client::rpc_client] -32002 Transaction simulation failed: Error processing Instruction 0: Failed to serialize or deserialize account data: Unknown
    [2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   1: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]
    [2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   2: Program log: (Deprecated as of 1.1.0) Instruction: Update Metadata Accounts
    [2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   3: Program log: Error: BorshIoError
    [2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   4: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 8654 of 200000 compute units
    [2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]   5: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: Failed to serialize or deserialize account data: Unknown
    [2022-04-24T01:51:28Z DEBUG solana_client::rpc_client]
    

    Two things stand out to me here:

    1. "Error processing Instruction 0: Failed to serialize or deserialize account data: Unknown"
    2. "Program log: (Deprecated as of 1.1.0) Instruction: Update Metadata Accounts"

    My guess is that number 2 is causing number 1 by virtue of the fact that data is not being serialized due to the fact that updating metadata is deprecated?

    Should I take the error message at face value and invoke a different method to update token data?

    Any guidance you can provide would be much appreciated! Thank you again for your hard work!

    opened by nonfungible-dev 17
  • No token accounts error - Snapshot Holders

    No token accounts error - Snapshot Holders

    Hi!

    I just started getting this error today, whereas yesterday was working fine. Doesn't matter if you use the CMID or Update Authority

    image

    Any ideas? This happens for ALL accounts.

    opened by k666-bit 16
  • Questions on update data

    Questions on update data

    Hi, I have an NFT that was created by candy machine before but it had a spelling error in one of the traits. I suppose I have to put in the additional data for <YOUR_CANDY_MACHINE_ID>. But what is <KEYPAIR_CREATOR>? Must its 'share' be 50? thanks!

    opened by edwinzeng2005 14
  • Can't install metaboss

    Can't install metaboss

    I do cargo install metaboss and get this error

    Updating crates.io index
    

    Installing metaboss v0.6.0 error: failed to compile metaboss v0.6.0, intermediate artifacts can be found at /tmp/cargo-install9mlnkF

    Caused by: failed to select a version for the requirement anchor-lang = "^0.19.0" candidate versions found which didn't match: 0.24.2 location searched: crates.io index required by package anchor-client v0.19.0 ... which satisfies dependency anchor-client = "^0.19.0" of package metaboss v0.6.0

    opened by babyfrogs 12
  • Issue: RPC response error -32002

    Issue: RPC response error -32002

    Hello,

    1- Trying to do a 'metaboss update data'

    [2021-12-05T12:44:00Z DEBUG reqwest::connect] starting new connection: https://api.mainnet-beta.solana.com/ [2021-12-05T12:44:01Z DEBUG reqwest::async_impl::client] response '200 OK' for https://api.mainnet-beta.solana.com/ [2021-12-05T12:44:01Z DEBUG reqwest::async_impl::client] response '200 OK' for https://api.mainnet-beta.solana.com/ [2021-12-05T12:44:01Z DEBUG reqwest::async_impl::client] response '200 OK' for https://api.mainnet-beta.solana.com/ [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] -32002 Transaction simulation failed: Error processing Instruction 0: Program failed to complete [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] 1: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1] [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] 2: Program log: Instruction: Update Metadata Accounts [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] 3: Program log: libstd rust_begin_panic [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] 4: Program log: panicked at 'index out of bounds: the len is 0 but the index is 0', program/src/utils.rs:773:9 [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] 5: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 200000 of 200000 compute units [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] 6: Program failed to complete: BPF program panicked [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client] 7: Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: Program failed to complete [2021-12-05T12:44:01Z DEBUG solana_client::rpc_client]

    opened by kobyle69 12
  • Metaboss update creator-all all NFTs fail to update

    Metaboss update creator-all all NFTs fail to update

    Updating NFTs. . . 180/180 updates failed. Retrying. . . Updating NFTs. . . 180/180 updates failed. Retrying. . . Updating NFTs. . . 180/180 updates failed. Retrying. . . Updating NFTs. . . 180/180 updates failed. Retrying. . . Updating NFTs. . . 180/180 updates failed. Retrying. . . Updating NFTs. . . Reached max retries. Writing remaining items to cache. Done!

    PLS HELP SIR :< tried different RPCs, seems like this one works the best: https://rpc.ankr.com/solana but still it always fails

    opened by ZenRepublic 10
  • Suggestion: replace most calls to getProgramAccounts with lighter getTokenLargestAccounts

    Suggestion: replace most calls to getProgramAccounts with lighter getTokenLargestAccounts

    I have a new recommendation for a possible improvement in metaboss. Been wanting to actually make a PR for it for a couple weeks already but I'm facing reality and I don't have the Rust experience needed to do it in < 1 hour (yet) nor the time to spend more than that 😅. So I'll throw a suggestion in here for someone else to try it.

    Reading a bunch of chats on different Discord servers (but mostly #rpc-support on GenesysGo's Discord) consensus seems to be that getProgramAccounts calls are very expensive.

    I have my own TypeScript-based script to fetch a list of holders because I needed to do more than what metaboss does but I did my initial code looking at metaboss', so it follows a similar logic.

    When getting a holders snapshot, the current code performs a getProgramAccounts call to fetch the list of all NFTs from a CM (or Authority). That's as best as it can get AFAIK. But then, for each NFT, it makes a new getProgramAccounts call to fetch the associated token account and grab the owner address from there.

    I figured I could use getTokenLargestAccounts and grab the first element from the list instead of calling gPA. The downside is that this function only gets me the address of the associated token account. But I collect all the ATAs for each NFT, then split them in chunks of 50 each and make a single getMultipleAccounts call to get the rest of the data and then I can grab the owner from there.

    I made those changes to my TypeScript metaboss-like code and it worked beautifully last week. I'm told by GenesysGo's support team that those calls are way lighter than gPA so I thought I'd suggest this as an alternative implementation. In total, I'm making a just few more RPC calls, but hopefully lighter ones.

    Thoughts?

    opened by oboxodo 10
  • Error: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: Program failed to complete [6 log messages]

    Error: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: Program failed to complete [6 log messages]

    Hey guys, I need your assistance with this error. I've been trying to update the external url of my minted token but I keep getting this. What am I doing wrong ? Also, how can I see the log files? Thanks

    opened by Alaarhi 10
  • snapshot unlisted holders

    snapshot unlisted holders

    Is there a way to snapshot unlisted holders of NFTs from a candy machine?

    I've been using tools like sol-nft.tools and solanatools.dev but I can't seem to differentiate the difference between marketplace wallets and regular wallets

    opened by adamtimlo 10
  • Add Snapshot option for Metaplex Sugar Airdrop.

    Add Snapshot option for Metaplex Sugar Airdrop.

    Sugar Airdrop tool requires a specific JSON format for the airdrop list.

    It will not run if it isn't in the correct format.

    This is the format that it requires the JSON file to be in.

                {
                "address1": number_of_tokens,
                "address2": number_of_tokens
                }
    

    It also looks for the JSON file name to be

    airdrop_list.json

    So defaulting the .json output to that filename would be a good bonus too.

    Attached is an example airdrop_list.json that follows the above criteria.

    airdrop_list_json_example

    opened by xjbar 0
  • missing field `rentEpoch`

    missing field `rentEpoch`

    Hello there,

    While doing a collections migrate command I had the following error showing:

    metaboss collections migrate -k keypair.json -c <CMV2_ID> --mint-address <COLLECTION_MINT_ADDRESS> -T 300
    Using candy machine id to fetch mint list. . .
    Error: missing field `rentEpoch`
    
    Caused by:
        missing field `rentEpoch`
    

    I tried re building the code and running a snapshot command instead but got the same error. The weird thing is that I was using the same exact command in the morning and it was working. Not sure what changed.

    Hope you can help.

    Best regards,

    opened by Jrejoire 5
  • [Feature] Bulk NFT Mint

    [Feature] Bulk NFT Mint

    Goal

    Metaboss is able to bulk mint NFTs by reading metadata json and media assets from a directory on the workstation.

                         #[default: ~/nfts]        #[default: cache.json]
    metaboss bulk_mint --upload-directory=~/nfts --cache-file=~./cache.json
    

    Strategy

    Metaboss follows a similar flow to sugar where it reads a directory of metadata json and media assets. Metaboss reads the directory, uploads media assets, completes the metadata json, submits mint NFT transactions to Solana using wallet configured on the workstation, and tracks the success of nfts making it on chain through a cache file.

    Sugar References

    opened by kespinola 0
Releases(v0.12.1)
Owner
Samuel Vanderwaal
Samuel Vanderwaal
A new, simple NFT standard for Solana

New Solana NFT Standard Current Issues The current NFT spec is pretty bad for a few reasons: every NFT requires multiple accounts (3+) the token accou

null 38 Oct 20, 2022
Dfinity's fungible token standard. Any PRs and comments are welcome,collaborate with us to build this standard

Dfinity's fungible token standard. Any PRs and comments are welcome,collaborate with us to build this standard

Deland Labs 46 Nov 7, 2022
Metaplex is a protocol built on top of Solana that allows: Creating/Minting non-fungible tokens;

Metaplex is a protocol built on top of Solana that allows: Creating/Minting non-fungible tokens; Starting a variety of auctions for primary/secondary

Metaplex Foundation 3.2k Jan 4, 2023
A solana program designed to mint Metaplex compliant NFTs.

Solana Minter My program used to mint Amoebits & Amoebit Minis. I wrote it from scratch using the hello-world program as an example & base. Features C

vlawmz 35 Sep 22, 2022
C++ `std::unique_ptr` that represents each object as an NFT on the Ethereum blockchain

C++ `std::unique_ptr` that represents each object as an NFT on the Ethereum blockchain

null 1.9k Dec 28, 2022
Substrate NFT !ink smart contract base

Substrate !ink NFT simple implementation This is a simple working version of base NFT smart contract written using latest (as of this date) !ink 3.0.0

POLK4.NET 14 Dec 3, 2022
Drop-in Access Control via NFT Ownership

niftygate - Signature-Based Authenticating Proxy What is it? niftygate is a proxy for HTTP services, that validates signatures, providing an AuthN lay

Chris Olstrom 70 Jan 3, 2023
NFT & Marketplace Contracts with royalties and fungible token support. Sample React app included.

NFT Market Reference Implementation A PoC backbone for NFT Marketplaces on NEAR Protocol. Reference Changelog Changelog Progress: basic purchase of NF

NEAR App Examples 156 Apr 28, 2022
Bespoke toolkit for Non-fungible token (NFT) technology 🚀

Bespoke toolkit for Non-fungible token (NFT) technology ?? What is Onft? Instead of forcing a consensus algorithm or peer networking on you, Onft prov

Owez 5 Jan 9, 2022
Examples and helpers to build NFT contracts on CosmWasm

CosmWasm NFTS This repo is the official repository to work on all NFT standard and examples in the CosmWasm ecosystem. cw721 and cw721-base were moved

CosmWasm 147 Jan 4, 2023
This is the Repo used to learn blockchain development in conjusction with the CyberGen NFT Project.

Environment Setup Install Rust from https://rustup.rs/ Install Solana from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-to

null 1 Nov 3, 2021
The NFT smart contract powering xyz on Terra

xyz NFT Contract This repository contains the core NFT smart contract that implements xyz, a base layer for metaverses on the Terra blockchain. The xy

null 16 Sep 25, 2022
A PoC backbone for NFT Marketplaces on NEAR Protocol

NFT Market Reference Implementation A PoC backbone for NFT Marketplaces on NEAR Protocol. Reference Changelog Changelog Progress: basic purchase of NF

null 9 May 26, 2022
Solana NFT generative artwork program

resin Solana NFT generative artwork program Installation Depends on imagemagick for art generation, which can be installed here: https://imagemagick.o

null 4 Jun 24, 2022
All the data an IC app needs to make seamless experiences, accessible directly on the IC. DAB is an open internet service for NFT, Token, Canister, and Dapp registries.

DAB ?? Overview An Internet Computer open internet service for data. All the data an IC app needs to make a seamless experience, accessible directly o

Psychedelic 58 Oct 6, 2022
OpenID login for wallets owning an nft.

nft-login OIDC login for wallets owning an nft. context Non fungible tokens are a proof for a digital ownership. This ownership can be used to give ac

NFT Login 49 Dec 2, 2022
Example of a SC coded in RUST that can safely perform any swaps of tokens (NFT, SFT, ESDT, MetaESDT)

Elrond-NFT-Trading Example of a Smart Contract (SC) coded in RUST, that can perform any swaps of tokens (NFT, SFT, ESDT, MetaESDT) The idea P2P swaps

Sia 3 May 17, 2022
Solana NFT marketplace boilerplate with anchor & react & candy-machine-cli

The Heros NFT Marketplace Boilerplate project is designed to let users fork, customize, and deploy their own nft marketplace app to a custom domain, ultra fast.

null 30 Dec 15, 2022
NFT mixing program on solana chain

Mixture_machine Core logic of composing NFT Compose of NFT As you invoke compose_nft function with 2 or more child NFTs, child NFTs are locked in to M

Jay Soh 7 Dec 12, 2022