TypeScript scripts for token launch, bonding curve trading, and Proof of Belief staking on Solana via the Printr chain-abstracted launchpad.
| Script | Command | What it does |
|---|---|---|
devnet-setup.ts |
npm run airdrop |
Generate wallet + request devnet SOL |
launch.ts |
npm run launch |
Quote → create token → sign → submit → poll |
trade.ts |
npm run trade |
Buy or sell on the DBC bonding curve |
stake.ts |
npm run stake |
Lock tokens in the Proof of Belief pool |
status.ts |
npm run status |
Check deployment & graduation progress |
# 1. Install dependencies
npm install
# 2. Copy and configure environment
cp .env.example .env
# 3. Generate a wallet and get free devnet SOL (no config needed)
npm run airdrop
# 4. Edit .env — set TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DESCRIPTION
# Leave SOLANA_NETWORK=devnet for testing
# 5. Launch your token
npm run launch
# 6. Check deployment status
npm run status
# 7. Buy some of your token on the bonding curve
# (TRADE_TOKEN_ID is auto-filled in .env after launch)
TRADE_DIRECTION=buy TRADE_AMOUNT_SOL=0.005 npm run trade
# 8. Stake your tokens to earn trading fees
npm run stakeYour Wallet
│
▼
POST /print/quote ──► Cost estimate (gas + x-chain fees + initial buy)
│
▼
POST /print ─────────► Unsigned SVM instruction payload
│ { mint_address, ixs[], lookup_table? }
▼
buildAndSignTx() ────► VersionedTransaction (v0 + ALT)
│
▼
Solana Mainnet/Devnet
│
▼
Printr backend polls on-chain, registers token, cascades to other chains via Axelar/LayerZero
│
▼
Token is LIVE on DBC bonding curve → tradeable immediately
│
▼ (when graduation threshold is hit)
Meteora DAMM v1/v2 ──► Post-graduation AMM (use Jupiter for trading)
- Axelar ITS + LayerZero v2 — cross-chain deployment
- Meteora Dynamic Bonding Curve (DBC) — pre-graduation AMM (
dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN) - Meteora DAMM v1/v2 — post-graduation AMM
- CAIP-2/CAIP-10 — chain + account identifiers (
solana:5eykt...:WalletAddress)
All configuration lives in .env. Full documentation is in .env.example.
| Variable | Description |
|---|---|
SOLANA_NETWORK |
devnet (testing) or mainnet-beta (production) |
SVM_WALLET_PRIVATE_KEY |
Base64-encoded secret key — auto-generated by npm run airdrop (base58 exports also work) |
PRINTR_API_KEY |
Partner API key (optional — public key used by default) |
TOKEN_NAME / TOKEN_SYMBOL |
Your token's name and ticker |
INITIAL_BUY_SOL |
SOL to spend on your creator buy |
FEE_SINK |
stake_pool enables staking rewards |
TRADE_TOKEN_ID |
Auto-filled after launch |
- Generates a new keypair if
SVM_WALLET_PRIVATE_KEYis missing - Requests up to 2 SOL from the devnet faucet
- Saves the key to
.envautomatically - Falls back to https://faucet.solana.com if the RPC faucet fails
- Calls
GET /print/quotefor cost breakdown - Encodes your token image to base64 (uses placeholder if file missing on devnet)
- Calls
POST /print→ receives raw Solana instructions - Builds a
VersionedTransaction(v0) with Address Lookup Table compression - Simulates, then signs + submits
- Polls
GET /tokens/{id}/deploymentsuntil all chains arelive - Auto-saves
TRADE_TOKEN_ID+TRADE_MINT_ADDRESSback to.env
- Reads
TRADE_TOKEN_IDfrom.env(or.last-token.json) - Verifies the token is
liveon Solana - Derives the DBC pool PDA from
curveProperties.basePairAddresses[0] - Builds a
swapQuoteToBase(buy) orswapBaseToQuote(sell) instruction - Simulates → sends
Note: Printr's Trading API is "coming soon". This script interacts with the Meteora DBC program directly, which is the same program Printr uses under the hood.
- Derives the
staking_poolandstaking_positionPDAs from the mint - Stakes tokens into the pool (locked, earning fees)
- Run with
STAKE_ACTION=claimto collect accumulated SOL rewards
Staking only works if the token was created with
FEE_SINK=stake_pool.
- Prints deployment status per chain
- Shows graduation percentage (100% = ready to migrate to Meteora DAMM)
- Lists recent Printr tokens if no token ID is set
| Devnet | Mainnet | |
|---|---|---|
| Network | SOLANA_NETWORK=devnet |
SOLANA_NETWORK=mainnet-beta |
| SOL cost | Free (faucet) | Real SOL |
| Printr API | Same preview API | Same preview API |
| Graduation threshold | $1,000 (beta) | $1,000 (beta) / $69,000 (prod) |
| DBC Program | Same address | Same address |
| Explorer | solscan.io?cluster=devnet | solscan.io |
printr-svm-scripts/
├── src/
│ ├── config.ts # Env loading, wallet, network constants
│ ├── api.ts # Typed Printr REST API client
│ ├── tx-builder.ts # SVM payload → VersionedTransaction
│ ├── devnet-setup.ts # Airdrop + wallet generation
│ ├── launch.ts # Token creation script
│ ├── trade.ts # Bonding curve buy/sell
│ ├── stake.ts # Proof of Belief staking + claim
│ └── status.ts # Deployment status checker
├── .env.example # All env vars documented
├── .env # Your local config (git-ignored)
├── .last-token.json # Auto-saved after launch (git-ignored)
├── token-image.png # Your token image (optional)
├── package.json
└── tsconfig.json
- Never commit
.envor.last-token.jsonto git — they contain your private key - On devnet, the auto-generated wallet is throwaway — generate a fresh one for mainnet
- Use environment-level secrets (GitHub Secrets, etc.) in CI/CD — not hardcoded keys
- The
PRINTR_API_KEYis optional; without it the public AI-integration key is used
Simulation failed on launch:
- Check you have enough SOL (
npm run airdrop) - Ensure your image is ≤ 500 KB and square
- The Printr preview API may have temporary issues — retry in a few minutes
Trade simulation failed:
- Token must be
live(checknpm run status) - The DBC pool PDAs are derived from
basePairAddresses[0]in the token metadata — ensure it's populated - After graduation, use Jupiter (https://jup.ag) instead
Stake simulation failed:
- Token must have been created with
FEE_SINK=stake_pool - You must hold tokens before staking (buy some first)
- The staking pool PDA must be initialized on-chain by Printr's backend
Airdrop failed:
- Devnet faucet has per-IP limits — try https://faucet.solana.com
- Or use:
solana airdrop 2 <YOUR_WALLET> --url devnet