Overview
Integrate Snack Money payments using Crossmintβs smart wallet infrastructure with x402 v2, using Crossmintβs API for signing operations.Features
- β Base network support
- β Smart wallet infrastructure - Account abstraction
- β API-based signing - Secure signature requests
- β Developer-controlled signing - Full control
- β x402 v2 integration - Latest protocol
Prerequisites
- Node.js 18+
- Crossmint account (Sign up)
- Crossmint API key
- Smart wallet with USDC balance on Base
Installation
Quick Start
1. Get Crossmint Credentials
- Visit Crossmint Console
- Create a project
- Get your API key
- Create a smart wallet
2. Set Up Environment
Create a.env file:
Important: The
SMART_WALLET_ADDRESS should have USDC balance on Base network.3. Implement Payment
Createbase-send.ts:
4. Run the Example
Expected Output
How It Works
- Create Crossmint Account: Build a viem-compatible account that uses Crossmintβs signature API
- Register x402 EVM Scheme: Configure x402 client with the Crossmint signer
- Wrap Axios: Add x402 payment interceptor
- Send Payment: Make payment request
- Auto Signatures: Crossmint API handles message and typed data signing
- Success: Receive confirmation and receipt
Why Crossmint?
Benefits
- Smart Wallets: Advanced wallet capabilities
- Account Abstraction: Gasless transactions, batching
- Viem Compatible: Standard interface
- Developer Controlled: Full control over signing
- Easy Integration: Simple SDK
Best For
- Apps needing smart wallet features
- Account abstraction requirements
- Gasless transactions
- Advanced wallet operations
Smart Wallet Features
Gasless Transactions
Transaction Batching
Supported Platforms
Error Handling
Wallet Management
Check Balance
Get Wallet Info
Full Example Repository
View on GitHub β Includes:- Complete implementation
- Smart wallet setup
- Configuration guide
- Detailed README
Next Steps
- Try axios - Simplest integration
- Crossmint Docs - Learn more
- API Reference - Complete API docs