CLI for Karma Launcher Presale SDK
npm install @karma3labs/presale-cliCommand-line interface for interacting with Karma Launcher presale contracts.
``bashFrom the cli directory
npm install
Configuration
Create a
.env file in the project root or cli directory:`env
Required
PRIVATE_KEY=0x...your_private_keyOptional - Network Configuration
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
BASE_RPC_URL=https://mainnet.base.orgOptional - Contract Addresses (defaults provided for Base Sepolia)
PRESALE_ADDRESS=0x1f0FB2ac6a3a4C6162159eEe26d86E06aB23ee12
KARMA_FACTORY_ADDRESS=0x129183B7CC4F23e115064590dA970BB3Abc3C500
USDC_ADDRESS=0x72338D8859884B4CeeAE68651E8B8e49812f2fEe
`Usage
$3
All commands support the following options:
-
-n, --network - Network to use (default: base-sepolia)
- --debug - Enable debug mode with detailed error output$3
`bash
Show current wallet address
karma wallet addressCheck USDC balance and allowance
karma wallet balance
karma wallet balance --address 0x...Approve USDC for presale contract
karma wallet approve 1000 # Approve 1000 USDC
karma wallet approve max # Approve unlimited
`$3
`bash
Get presale information
karma presale info Get user info for a presale
karma presale user-info
karma presale user-info --address 0x...Contribute USDC to a presale
karma presale contribute
karma presale contribute 1 100 # Contribute 100 USDC to presale #1
karma presale contribute 1 100 --no-approve # Skip approval stepWithdraw contribution from a presale
karma presale withdraw
karma presale withdraw 1 50 # Withdraw 50 USDC from presale #1Claim tokens and refund
karma presale claim
karma presale claim 1 # Claim from presale #1
`$3
`bash
Deploy token for a presale (presale must be ready)
karma token deploy
karma token deploy 1Get deployed token information
karma token info
karma token info 1
`$3
`bash
Show CLI information and quick start guide
karma infoList supported networks
karma networksShow version
karma --versionShow help
karma --help
karma presale --help
karma presale contribute --help
`Examples
$3
`bash
1. Check your wallet
karma wallet balance2. View presale details
karma presale info 13. Approve USDC (if needed)
karma wallet approve 5004. Contribute to presale
karma presale contribute 1 5005. Check your contribution
karma presale user-info 16. After presale ends and token is deployed, claim your tokens
karma presale claim 1
`$3
`bash
Base Sepolia (testnet) - default
karma presale info 1 --network base-sepoliaBase Mainnet
karma presale info 1 --network base
`Supported Networks
| Network | Chain ID | Description |
|---------|----------|-------------|
|
base-sepolia | 84532 | Base Sepolia Testnet (default) |
| base | 8453 | Base Mainnet |Development
`bash
Install dependencies
npm installBuild
npm run buildWatch mode
npm run devRun directly without global install
npm start -- presale info 1
or
node bin/karma.js presale info 1
`Troubleshooting
$3
Make sure you have a
.env file with your private key:`env
PRIVATE_KEY=0x...your_private_key_here
`$3
Use
karma networks to see supported networks. Make sure you're using a valid network name.$3
- Check your USDC balance:
karma wallet balance
- Check USDC allowance: karma wallet balance
- Enable debug mode for more details: karma --debug presale contribute 1 100Dependencies
-
@karma3labs/presale-sdk-evm - Karma Presale SDK
- commander - CLI framework
- chalk - Terminal styling
- ora - Spinners
- viem - Ethereum library
- dotenv` - Environment variablesMIT