A native Solana program and CLI to launch SPL (legacy), SPL 2022 tokens, and standard NFT assets with metadata support.
Clone & Build
git clone <repository-url>
cd token-launch
cd program && cargo build-sbf
cd ../bin && cargo buildDeploy to Devnet
cd program
cargo build-sbf
solana program deploy target-program/deploy/token-launch.soRun Tests
cargo testAll commands are run from the bin directory:
-
Launch Assets using default metadata values
cd bin cargo run --bin cli launch --type spl-legacy cargo run --bin cli launch --type spl-2022 cargo run --bin cli launch --type nft -
SPL Legacy Token
cargo run --bin cli launch --type spl-legacy --name "My Token" --symbol "MYTOKEN" --decimals 6 --supply 1000000 --uri "https://example.com/metadata.json" --program-id <PROGRAM_ID> --rpc-url https://api.devnet.solana.com
-
SPL Token 2022
cargo run --bin cli launch --type spl-2022 --name "Advanced Token" --symbol "ADV" --decimals 9 --supply 1000000000 --uri "https://example.com/advanced-metadata.json" --program-id <PROGRAM_ID> --rpc-url https://api.devnet.solana.com
-
NFT
cargo run --bin cli launch --type nft --name "My NFT" --symbol "MYNFT" --uri "https://example.com/nft-metadata.json" --program-id <PROGRAM_ID> --rpc-url https://api.devnet.solana.com
Note: To pass custom
program-idandrpc-url, make sure to deploy the program accordingly. The CLI defaults to an already deployed devnet program. Also, It requires a funded wallet to be present at~/.config/solana/id.json
-
Get PDA
cargo run --bin cli get-pda --mint <MINT_PUBKEY> --program-id <PROGRAM_ID>
-
Validate Config
cargo run --bin cli validate --name "My Token" --symbol "MYTOKEN" --decimals 6 --uri "https://example.com/metadata.json"
Subcommands for cargo run --bin cli launch
--typeAsset type:spl-legacy,spl-2022,nft--nameName of token/NFT--symbolSymbol--decimalsNumber of decimals (0 for NFT)--supplyTotal supply (1 for NFT)--uriMetadata URI--program-idToken Launch program ID--rpc-urlSolana RPC endpoint
Run cargo run --bin cli launch --help for all options.
Rust Unit and Integration Tests
cargo test
# Or run specific integration tests:
cargo test bin/test/test_happy
cargo test bin/test/test_unhappy
cargo test bin/test/test_configsTypescript Tests
npm install && npm run test