Overview

You can now buy a Megapot lottery ticket with a single API call using x402 or MPP via paysponge.com.

The new standards for machine-to-machine payments. This guide walks you through everything you need to get your first ticket purchased programmatically.

Or if you want to skip the Agent set up and buy directly from your terminal skip to here

Or use the CLI (even simpler)


URLs

x402: https://megapot.x402.paysponge.com (1 USDC on Base) MPP: https://megapot.mpp.paysponge.com (1 USDC.e on Tempo)


What you'll need


Step 1: Install the Sponge SDK

Open your terminal and run:

npm install @paysponge/sdk

Or if you're using Bun:

bun add @paysponge/sdk