Headless TypeScript scripts demonstrating Crossmint wallets with server signers via @crossmint/wallets-sdk. No browser, no React — just Node.js.
This quickstart uses the V1 SDK's two-tier signer architecture with server signers for both recovery and operational signing, ideal for backend services and AI agents.
Learn how to:
- Create a wallet with server recovery + server operational signer
- View balances and fund with staging tokens
- Transfer tokens to a recipient
- View transfer activity history
- List, add, and manage signers
- Prepare-only transactions and approve them separately
- Run the complete wallet lifecycle in one script
@crossmint/wallets-sdk:1.0.7
- Clone the repository:
git clone https://github.com/crossmint/wallets-server-quickstart.git && cd wallets-server-quickstart- Install dependencies:
pnpm install- Set up environment variables:
cp .env.template .env- Fill in your
.env:
| Variable | Required | Notes |
|---|---|---|
CROSSMINT_SERVER_API_KEY |
Yes | Server-side API key (sk_...). Get one here. Scopes: wallets.read, wallets.create, wallets:transactions.create, wallets:transactions.sign, wallets:balance.read, wallets.fund. |
RECOVERY_SIGNER_SECRET |
Yes | Secret for the recovery signer. Get one using our generation tool here |
WALLET_SIGNER_SECRET |
Yes | Secret for the wallet (operational) signer. Get one using our generation tool here |
CHAIN |
No | Default: base-sepolia |
WALLET_ADDRESS |
Individual scripts only | Set after running create-wallet. Not needed for full-flow. |
Run the complete wallet lifecycle in one execution:
pnpm full-flowThis creates a wallet, lists signers, funds it, checks balances, transfers tokens, loads activity, tests prepare-only + approve, and verifies wallet retrieval.
For targeted testing, run individual scripts. Most require WALLET_ADDRESS to be set in .env (run create-wallet first).
pnpm create-wallet # Create a new wallet
pnpm get-wallet # Retrieve existing wallet
pnpm wallet-info # Show wallet details + signers
pnpm balance # Check balances
pnpm balance --fund # Fund with staging tokens first
pnpm transfer <recipient> [token] [amount] # Send tokens
pnpm activity # View transfer history
pnpm signers # List registered signers
pnpm signers add-server <secret> # Add a server signer
pnpm signers use <locator> # Switch active signer
pnpm signers check-recovery # Check if recovery is needed
pnpm approval prepare <recipient> [token] [amount] # Prepare unsigned transaction
pnpm approval approve-tx <transactionId> # Approve a transaction
pnpm approval approve-sig <signatureId> # Approve a signature| # | File | Purpose |
|---|---|---|
| 00 | 00-config.ts |
Shared SDK init, env var loading, getExistingWallet() helper |
| 01 | 01-create-wallet.ts |
Create wallet with server recovery + server operational signer |
| 02 | 02-get-wallet.ts |
Retrieve existing wallet by address |
| 03 | 03-wallet-display.ts |
Show wallet details and registered signers |
| 04 | 04-balance.ts |
Check balances, optionally fund with --fund |
| 05 | 05-transfer.ts |
Send tokens to a recipient |
| 06 | 06-activity.ts |
View successful transfer history |
| 07 | 07-signers.ts |
List/add/use signers, check recovery |
| 08 | 08-approval.ts |
Prepare-only transactions and approve them |
| 09 | 09-full-flow.ts |
Complete lifecycle in one execution |
This quickstart uses server signers — deterministic key pairs derived from a secret string, managed entirely server-side. The V1 SDK's two-tier signer model provides:
- Recovery signer (
RECOVERY_SIGNER_SECRET): High-security signer for wallet recovery - Operational signer (
WALLET_SIGNER_SECRET): Day-to-day transaction signing
Both signers are server-type, meaning no browser or user interaction is required. This makes it ideal for:
- Backend services and APIs
- AI agents that need to manage wallets programmatically
- Automated payment flows
- Testing and development scripts
- Create a production API key.
- Use strong, unique secrets for
RECOVERY_SIGNER_SECRETandWALLET_SIGNER_SECRET. - Store secrets securely (e.g., environment variables, secrets manager).
