From b693b6967eca3d6b12527e2f1836c2de6b87c53f Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Thu, 26 Mar 2026 15:29:13 -0400 Subject: [PATCH 1/5] add sei payment method docs Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/cards.tsx | 22 ++++++ src/pages/payment-methods/index.mdx | 9 ++- src/pages/payment-methods/sei/charge.mdx | 87 ++++++++++++++++++++++++ src/pages/payment-methods/sei/index.mdx | 37 ++++++++++ vocs.config.ts | 8 +++ 5 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 src/pages/payment-methods/sei/charge.mdx create mode 100644 src/pages/payment-methods/sei/index.mdx diff --git a/src/components/cards.tsx b/src/components/cards.tsx index 0e25a18b..94fabebc 100644 --- a/src/components/cards.tsx +++ b/src/components/cards.tsx @@ -297,6 +297,28 @@ export function CardChargeCard() { ); } +export function SeiMethodCard() { + return ( + + ); +} + +export function SeiChargeCard() { + return ( + + ); +} + export function CustomMethodCard() { return ( + +```http +HTTP/1.1 402 Payment Required +WWW-Authenticate: Payment method="sei", intent="charge", ... ``` @@ -54,5 +60,6 @@ WWW-Authenticate: Payment method="solana", intent="charge", ... + diff --git a/src/pages/payment-methods/sei/charge.mdx b/src/pages/payment-methods/sei/charge.mdx new file mode 100644 index 00000000..451fd2e8 --- /dev/null +++ b/src/pages/payment-methods/sei/charge.mdx @@ -0,0 +1,87 @@ +--- +imageDescription: "One-time ERC-20 token transfers on Sei with sub-second on-chain settlement" +--- + +import { Cards } from 'vocs' +import { SpecCard } from '../../../components/SpecCard' + +# Sei charge [One-time ERC-20 token transfers on Sei] + +The Sei implementation of the [charge](/intents/charge) intent. + +The client submits an ERC-20 `transfer` transaction on Sei. The server verifies the transfer on-chain and returns the resource with a receipt. Settlement completes in ~400ms. + +This method is best for single API calls, content access, or one-off purchases paid with USDC or USDT on Sei. + +## Server + +Use `sei.charge` to gate endpoints behind ERC-20 token payments on Sei. + +```ts +import { Mppx } from 'mppx/server' +import { sei } from '@sei/mpp/server' + +const mppx = Mppx.create({ + methods: [sei.charge({ + recipient: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', + chainId: 1329, + })], + secretKey: process.env.MPP_SECRET_KEY!, +}) + +export async function handler(request: Request) { + const result = await mppx.charge({ + amount: '1.00', + currency: '0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F2', // USDC on Sei + })(request) + + if (result.status === 402) return result.challenge + + return result.withReceipt(Response.json({ data: '...' })) +} +``` + +## Credential types + +Sei charge supports two credential types: + +### `hash` + +The client broadcasts the transaction itself and presents the transaction hash. The server confirms the transfer on-chain before returning the resource. + +```http +Authorization: Payment credential_type="hash" credential="0xabc…123" +``` + +### `transaction` + +The client signs but does not broadcast. The signed transaction is sent to the server, which broadcasts it and waits for confirmation. + +```http +Authorization: Payment credential_type="transaction" credential="0xdef…456" +``` + +## Client + +Use `sei.charge` with `Mppx.create` to automatically handle Sei charge challenges. The client parses the challenge, signs an ERC-20 transfer, and retries with the credential. + +```ts +import { Mppx } from 'mppx/client' +import { sei } from '@sei/mpp/client' +import { privateKeyToAccount } from 'viem/accounts' + +const account = privateKeyToAccount('0xabc…123') + +const mppx = Mppx.create({ + methods: [sei.charge({ account })], + polyfill: false, +}) + +const response = await mppx.fetch('https://api.example.com/resource') +``` + +## Specification + + + + diff --git a/src/pages/payment-methods/sei/index.mdx b/src/pages/payment-methods/sei/index.mdx new file mode 100644 index 00000000..f6a13e6a --- /dev/null +++ b/src/pages/payment-methods/sei/index.mdx @@ -0,0 +1,37 @@ +--- +imageDescription: "ERC-20 stablecoin payments on Sei with sub-second finality" +--- + +# Sei [ERC-20 stablecoin payments on Sei] + +The Sei payment method enables MPP payments using ERC-20 stablecoins on [Sei](https://sei.io), an EVM-compatible L1 with ~400ms finality. Sei supports the **charge** intent for one-time payments settled directly on-chain. + +Because Sei is fully EVM-compatible, it works with standard Ethereum tooling—viem, ethers, and any ERC-20 wallet. + +## Why Sei + +Sei's architecture provides several properties useful for MPP: + +- **~400ms finality**—Deterministic confirmation in under half a second, no probabilistic waiting +- **EVM compatibility**—Standard ERC-20 transfers using existing Ethereum tooling +- **Low fees**—Transaction costs suitable for micropayments and per-request billing +- **USDC and USDT support**—Pay with widely-held stablecoins + +## Chain IDs + +| Network | Chain ID | +|---|---| +| Mainnet | `1329` | +| Testnet | `713715` | + +## Intents + + diff --git a/vocs.config.ts b/vocs.config.ts index 40e2218f..61d28df4 100644 --- a/vocs.config.ts +++ b/vocs.config.ts @@ -367,6 +367,14 @@ export default defineConfig({ { text: "Charge", link: "/payment-methods/solana/charge" }, ], }, + { + text: "Sei", + collapsed: true, + items: [ + { text: "Overview", link: "/payment-methods/sei" }, + { text: "Charge", link: "/payment-methods/sei/charge" }, + ], + }, { text: "Custom", link: "/payment-methods/custom" }, ], }, From 5a95af97fca8cde762eda7230b66b744bded4ac7 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Thu, 26 Mar 2026 15:43:02 -0400 Subject: [PATCH 2/5] fix USDC address typo, remove incorrect auth header examples Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pages/payment-methods/sei/charge.mdx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/pages/payment-methods/sei/charge.mdx b/src/pages/payment-methods/sei/charge.mdx index 451fd2e8..99b9dc38 100644 --- a/src/pages/payment-methods/sei/charge.mdx +++ b/src/pages/payment-methods/sei/charge.mdx @@ -32,7 +32,7 @@ const mppx = Mppx.create({ export async function handler(request: Request) { const result = await mppx.charge({ amount: '1.00', - currency: '0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F2', // USDC on Sei + currency: '0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F1', // USDC on Sei })(request) if (result.status === 402) return result.challenge @@ -49,18 +49,10 @@ Sei charge supports two credential types: The client broadcasts the transaction itself and presents the transaction hash. The server confirms the transfer on-chain before returning the resource. -```http -Authorization: Payment credential_type="hash" credential="0xabc…123" -``` - ### `transaction` The client signs but does not broadcast. The signed transaction is sent to the server, which broadcasts it and waits for confirmation. -```http -Authorization: Payment credential_type="transaction" credential="0xdef…456" -``` - ## Client Use `sei.charge` with `Mppx.create` to automatically handle Sei charge challenges. The client parses the challenge, signs an ERC-20 transfer, and retries with the credential. From 355f8e9643b001327a2a16e7d9eeeebf393cd14d Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Thu, 26 Mar 2026 15:52:31 -0400 Subject: [PATCH 3/5] update USDC address to native token from seiscan Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pages/payment-methods/sei/charge.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/payment-methods/sei/charge.mdx b/src/pages/payment-methods/sei/charge.mdx index 99b9dc38..1dea12de 100644 --- a/src/pages/payment-methods/sei/charge.mdx +++ b/src/pages/payment-methods/sei/charge.mdx @@ -32,7 +32,7 @@ const mppx = Mppx.create({ export async function handler(request: Request) { const result = await mppx.charge({ amount: '1.00', - currency: '0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F1', // USDC on Sei + currency: '0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392', // USDC on Sei })(request) if (result.status === 402) return result.challenge From 85857e0cdd3992eab6b7a2e4726a2ebf5ca5f49c Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Thu, 26 Mar 2026 16:03:38 -0400 Subject: [PATCH 4/5] reorder credential types to match spec Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pages/payment-methods/sei/charge.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/payment-methods/sei/charge.mdx b/src/pages/payment-methods/sei/charge.mdx index 1dea12de..8b367291 100644 --- a/src/pages/payment-methods/sei/charge.mdx +++ b/src/pages/payment-methods/sei/charge.mdx @@ -45,14 +45,14 @@ export async function handler(request: Request) { Sei charge supports two credential types: -### `hash` - -The client broadcasts the transaction itself and presents the transaction hash. The server confirms the transfer on-chain before returning the resource. - ### `transaction` The client signs but does not broadcast. The signed transaction is sent to the server, which broadcasts it and waits for confirmation. +### `hash` + +The client broadcasts the transaction itself and presents the transaction hash. The server confirms the transfer on-chain before returning the resource. + ## Client Use `sei.charge` with `Mppx.create` to automatically handle Sei charge challenges. The client parses the challenge, signs an ERC-20 transfer, and retries with the credential. From ed9ffe0a1033dd7192749635981600f446224315 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Thu, 26 Mar 2026 16:34:37 -0400 Subject: [PATCH 5/5] fix testnet chain ID to 1238 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pages/payment-methods/sei/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/payment-methods/sei/index.mdx b/src/pages/payment-methods/sei/index.mdx index f6a13e6a..6611c798 100644 --- a/src/pages/payment-methods/sei/index.mdx +++ b/src/pages/payment-methods/sei/index.mdx @@ -22,7 +22,7 @@ Sei's architecture provides several properties useful for MPP: | Network | Chain ID | |---|---| | Mainnet | `1329` | -| Testnet | `713715` | +| Testnet | `1238` | ## Intents