This project mainly provides batch scripts commonly used in solana to facilitate on-chain operations.
Table of Contents
This project provides batch scripts for token and SOL operations
| Function | Type | Note |
|---|---|---|
| SOL batch distribution | SOL | Batch create wallet |
| Batch query SOL assets | SOL | |
| SOL aggregation | SOL | |
| Create Token | Token | |
| Token aggregation | Token | Close account when fully transferred out |
| Batch query Token assets | Token |
To use this project, you need to have nodejs environment or bun environment, and it is recommended to use bun
Here it is recommended to use bun as the runtime, and you can install bun using npm
- Bun
npm i bun -g
Use bun i to install dependencies, the current dependency situation is as follows
| Library | Purpose | Note |
|---|---|---|
@solana/web3.js |
Basic on-chain interaction | Official sdk |
@solana/spl-token |
token related | Official sdk |
@coral-xyz/anchor |
Smart contract call | anchor official sdk |
@metaplex-foundation/umi |
metadata operation related | Create and parse token metadata information |
@metaplex-foundation/umi-bundle-defaults |
metadata operation related | |
@metaplex-foundation/mpl-token-metadata |
metadata operation related | |
bip39 |
Mnemonic related support | Generate mnemonic |
bs58 |
Encoding | |
micro-ed25519-hdkey |
HD wallet derivation |
This project uses config.toml to configure parameters such as network, mnemonic, and private key.
network.rpcis used to configure the rpc node, and the configured rpc should be normal before executing the scriptwallet.mnemonicis used to configure the mnemonic, based on thephantomderivation path, after importingphantom, it can be used directly, which is convenient for managing a large number of walletswallet.privateKeyis used to configure the private key, which is used to configure the private key of the wallet, which is convenient for managing a small number of wallets
After completing the config.toml configuration, you can refer to the scripts in examples for writing, such as: use bun run examples/query-sol.ts