Skip to main content
This example demonstrates integration using Crossmint Smart Wallets with x402 v2. Perfect for applications needing smart wallet features and account abstraction.

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

  1. Visit Crossmint Console
  2. Create a project
  3. Get your API key
  4. 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

Create base-send.ts:

4. Run the Example

Expected Output

How It Works

  1. Create Crossmint Account: Build a viem-compatible account that uses Crossmint’s signature API
  2. Register x402 EVM Scheme: Configure x402 client with the Crossmint signer
  3. Wrap Axios: Add x402 payment interceptor
  4. Send Payment: Make payment request
  5. Auto Signatures: Crossmint API handles message and typed data signing
  6. 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

Dependencies

Learn More