Code Monkey home page Code Monkey logo

spl-airdrop's Introduction

SPL airdrop tool

Send SOL and SPL tokens from a wallet to many wallets, enabling to thaw/freeze upon sending.

Requirements

  • Node 16+

Have all the SOL/SPL in a wallet, use the keypair to sign and pay for fees. The tool will do the required checks, create token accounts on receiver wallet (if required) and freeze/thaw when specified.

Setup

npm install

Recomendations

  • Use a fresh keypair, would avoid other transactions happening that can affect the verification step. Not a requirement, but a recommendation.
  • Use a custom RPC to send these, increases the chances to succeed.

Building recipients list file

You can create either a JSON, CSV or TSV file with 3 properties:

  • Recipient (Solana wallet)
  • Address (SPL mint address or "SOL" for sending SOL)
  • Amount (decimal value, the tool handles the lamports conversion)

Airdrop SOL/SPL

Ensure to have enough SOL/SPL tokens in the keypair specified according to what amounts were written in the list file. SPL tokens might require creating token accounts that cost 0.0204 SOL each (paid by the keypair wallet).

Usage: node airdrop.js send [options]

Options:
    -k, --keypair <path>    keypair for wallet holding the SOL to send
    -r, --rpc <string>      rpc to use
    -l, --list <path>       json, csv or tsv file containing the recipients
    -f, --freeze            SPL only, freeze token account after sending, keypair must be the freeze authority for the mint

Verify airdrop

After the airdrop finishes, you can check which transactions went through and obtain the list of pending. Allow a couple minutes before the other process ends, to ensure the transactions reached the confirmed commit phase. Use the same rpc as the send (when possible) to ensure you're getting the latest info from what you've sent.

This process will obtain and parse all the transactions that were sent from the keypair used.

Currently, the process can only manage up to 100 airdrops, need to work on obtaining more of them to avoid rpc rate limiting.

Usage: node aidrop.js sent [options]

Options:
    -k, --keypair <path>    keypair for wallet holding the SOL to send
    -r, --rpc <string>      rpc to use
    -l, --list <path>       json, csv or tsv file containing what should have been sent
    -c, --count <int>       Number of last transactions for the keypair to consider. This is important if you have reused the wallet to past airdrops, ideally, you could use the list size for this value
    -s, --sent-list <path>  output file with the amount each wallet has received
    -o, --output <path>     output file with the pending balances to be sent, in the format of the extension (json, csv or tsv)

Take note on the count option, such value can drift from what was sent vs what should've sent, as there's no way to tell for the process to know which transactions succeded (from the send) and what others are from previous airdrops (or even deposits for the setup for the current airdrop).

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.