Coder Social home page Coder Social logo

metaboss's Introduction

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. 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. 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. Use with caution.

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

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. Use with caution.

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

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

metaboss's People

Contributors

samuelvanderwaal avatar oboxodo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.