
Product
Socket for ClickUp Is Now Available
Create ClickUp tasks from Socket alerts, automate ticketing with custom rules, and keep alert and task status synchronized.
@suimpp/mpp
Advanced tools
Sui USDC payment method for the Machine Payments Protocol (MPP). Accept and make payments on any API — the first MPP implementation on Sui.
Migrated from
@mppsui/mpp. If you were using the old package, switch your imports to@suimpp/mpp.
The Machine Payments Protocol is an open standard by Stripe and Tempo Labs for agent-to-service payments. When a server returns HTTP 402 Payment Required, the client pays automatically and retries — no API keys, no subscriptions, no human approval.
@suimpp/mpp adds Sui USDC as a payment method. It works with any MPP-compatible client or server via the mppx SDK.
npm install @suimpp/mpp mppx
Add payments to any API in 5 lines:
import { sui } from '@suimpp/mpp/server';
import { Mppx } from 'mppx';
const SUI_USDC = '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC';
const mppx = Mppx.create({
methods: [sui({ currency: SUI_USDC, recipient: '0xYOUR_ADDRESS' })],
});
export const GET = mppx.charge({ amount: '0.01' })(
() => Response.json({ data: 'paid content' })
);
No webhooks. No Stripe dashboard. No KYC. USDC arrives directly in your wallet.
import { sui } from '@suimpp/mpp/client';
import { Mppx } from 'mppx/client';
import { SuiGrpcClient } from '@mysten/sui/grpc';
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
const client = new SuiGrpcClient({
baseUrl: 'https://fullnode.mainnet.sui.io:443',
network: 'mainnet',
});
const signer = Ed25519Keypair.deriveKeypair('your mnemonic');
const mppx = Mppx.create({
methods: [sui({ client, signer })],
});
const response = await mppx.fetch('https://api.example.com/resource');
// If the API returns 402, mppx pays automatically via Sui USDC.
If you're using the t2000 SDK, payments are even simpler:
import { T2000 } from '@t2000/sdk';
const agent = await T2000.create({ pin: 'my-secret' });
const result = await agent.pay({
url: 'https://api.example.com/generate',
body: { prompt: 'a sunset' },
maxPrice: 0.05,
});
// Handles 402 → pay → retry automatically.
// Safeguards enforced (max per tx, daily limits).
t2000 pay https://api.example.com/data --max-price 0.10
t2000 pay https://api.example.com/analyze \
--method POST \
--data '{"text":"hello"}' \
--max-price 0.05
Agent API Server
│ │
│── GET /resource ────────>│
│<── 402 Payment Required ─│
│ {amount, currency, │
│ recipient} │
│ │
│── USDC transfer on Sui ──│ (~400ms finality)
│ │
│── GET /resource ────────>│
│ + payment credential │── verify TX on-chain via gRPC
│ (Sui tx digest) │
│<── 200 OK + data ────────│
No facilitator. No intermediary. The server verifies the Sui transaction directly via gRPC.
sui(options)Creates a Sui payment method for the server.
import { sui } from '@suimpp/mpp/server';
const method = sui({
currency: SUI_USDC, // Sui coin type (e.g. USDC)
recipient: '0xYOUR_ADDR', // Where payments are sent
decimals: 6, // Optional: currency decimals (default: 6)
rpcUrl: '...', // Optional: custom gRPC endpoint
network: 'mainnet', // Optional: 'mainnet' | 'testnet' | 'devnet'
registryUrl: 'https://suimpp.dev/api/report', // Optional: report payments to suimpp.dev
});
Verification checks:
sui(options)Creates a Sui payment method for the client.
import { sui } from '@suimpp/mpp/client';
const method = sui({
client: grpcClient, // Any Sui client (SuiGrpcClient, etc.)
signer: ed25519Keypair, // Signer from @mysten/sui/cryptography
decimals: 6, // Optional: currency decimals (default: 6)
execute: async (tx) => { // Optional: custom execution (gas sponsor, etc.)
return myGasManager.execute(tx);
},
});
| Option | Type | Required | Description |
|---|---|---|---|
client | ClientWithCoreApi | Yes | Any Sui client implementing the core API |
signer | Signer | Yes | Any Signer from @mysten/sui/cryptography — Ed25519Keypair works |
decimals | number | No | Decimal places for the currency (default: 6) |
execute | (tx: Transaction) => Promise<{ digest: string }> | No | Override transaction execution (e.g. gas sponsor/manager) |
The client uses the coinWithBalance intent to automatically resolve, merge, and split coins for the exact payment amount, then signs and broadcasts the transaction (or delegates to execute if provided).
SUI_USDC_TYPEThe Sui coin type for Circle-issued USDC on mainnet.
import { SUI_USDC_TYPE } from '@suimpp/mpp';
// '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC'
parseAmountToRaw(amount, decimals)Converts a string amount to BigInt raw units without floating-point math.
parseAmountToRaw('0.01', 6); // 10000n
parseAmountToRaw('1.50', 6); // 1500000n
MPP is chain-agnostic. We chose Sui because agent payments need:
| Sui | |
|---|---|
| Finality | ~400ms |
| Gas | <$0.001 per payment |
| USDC | Circle-issued, native |
| Verification | Direct gRPC — no facilitator |
pnpm --filter @suimpp/mpp test # 13 tests
pnpm --filter @suimpp/mpp typecheck
MIT — see LICENSE
FAQs
Sui USDC payment method for the Machine Payments Protocol (MPP)
The npm package @suimpp/mpp receives a total of 148 weekly downloads. As such, @suimpp/mpp popularity was classified as not popular.
We found that @suimpp/mpp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Create ClickUp tasks from Socket alerts, automate ticketing with custom rules, and keep alert and task status synchronized.

Product
Create and manage Asana tasks directly from Socket alerts, with manual task creation, automated ticketing rules, and two-way sync.

Security News
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.