Coder Social home page Coder Social logo

spl-token-airdrop's Introduction

Metaplex collection airdrop CLI

This CLI was created to make collection holders snapshot and then do SPL tokens airdrop.

Before use CLI we have to build it first: cargo build

Then we can run this command and see what commands are available: ./target/debug/collection-airdrop

Output will be like:

Airdrop cli 0.1.0

CLI sub-commands

USAGE:

collection-airdrop [OPTIONS] <SUBCOMMAND>

OPTIONS:

-h, --help                       Print help information

    --payer-keypair <BASE 58>    Keypair in base 58 encoding [default: ]

    --sleep <MILLISECONDS>       Time to sleep between RPC requests [default: 700]

    --url <URL>                  RPC endpoint [default: https://api.mainnet-beta.solana.com]

-V, --version                    Print version information

SUBCOMMANDS:

airdrop               
help                  Print this message or the help of the given subcommand(s)
make-fake-snapshot    
make-snapshot  

Commands description

  1. make-snapshot - this command uses get_program_accounts(GPA) request to get list of pointed collection holders.

Command example:

    ./target/debug/collection-airdrop make-snapshot --collection <KEY> --collection-offset 402 --output-file ./snapshot.json

Pay attention that collection-offset argument can be different such as it depends on data saved in Metadata account.

As a result we'll get snapshot.json file with <wallet_address>: <amount of tokens from collection wallet holds>

  1. airdrop - this command runs a loop with spl_token::mint_to instructions. Also CLI will create new associated token account for every wallet.

Command example:

    ./target/debug/collection-airdrop --payer-keypair <PRIV_KEY_AS_BASE58_STR> airdrop --mint <MINT_PUB_KEY> --holders-list ./snapshot.json --one-to-wallet false

One-to-wallet argument tells CLI whether amount of minted SPL tokens should be equal to amount of NFTs from collection wallet has or not.

  1. make-fake-snapshot - it's just a test command so we can see what data we will receive after make-snapshot launch

Command example:

    ./target/debug/collection-airdrop make-fake-snapshot --amount-of-holders 5 --output-file ./fake-holders.json

spl-token-airdrop's People

Contributors

n00m4d avatar

Watchers

 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.