Skip to navigation

Test the mock onramp

Validate your integration with mobile-money simulation and Base Sepolia USDC

View as Markdown

The mock onramp follows the production HTTP contract while replacing the live fiat provider with a short simulated payment delay. Settlement sends test USDC from a server-controlled wallet on Base Sepolia.

Use a dedicated test wallet only. Never provide a recovery phrase, mainnet private key, or customer key.

Prerequisites

  • A local checkout of the Ramps API
  • Firebase development credentials and Data Connect configuration
  • A dedicated Base Sepolia wallet funded with test ETH and test USDC
  • Bun installed locally

Configure the service

NODE_ENV=development
FIREBASE_PROFILE=dev
ONRAMP_MODE=mock
BASE_SEPOLIA_RPC_URL=https://base-sepolia-rpc.publicnode.com
MOCK_ONRAMP_PRIVATE_KEY=0x_your_dedicated_test_private_key
MOCK_ONRAMP_MAX_USDC=20
MOCK_ONRAMP_PAYMENT_DELAY_MS=2000
MOCK_ONRAMP_SETTLEMENT_DELAY_MS=3000

The mock accepts a 32-byte hexadecimal MetaMask private key with or without the 0x prefix. It rejects recovery phrases, production mode, non-USDC assets, non-Base-Sepolia networks, invalid addresses, and amounts above the configured limit.

Test from the interactive reference

1

Start the API

Run bun run dev from the ramps-v2 repository.

2

Open Scalar

Visit http://localhost:3000/openapi and select the local development server.

3

Open Create an onramp

The request body is pre-filled with a KES mobile-money to Base Sepolia USDC example.

4

Use your recipient address

Replace the placeholder destination address, choose a unique idempotency-key, and send the request.

5

Check the result

Query POST /onramp/status until the transaction reaches complete and includes the Base Sepolia hash.

A successful HTTP response initially reports processing. The token transfer happens asynchronously after the settlement delay.