Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/components/cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,28 @@ export function CardChargeCard() {
);
}

export function SeiMethodCard() {
return (
<Card
description="ERC-20 stablecoin payments on Sei with sub-second finality"
icon="lucide:link"
title="Sei"
to="/payment-methods/sei"
/>
);
}

export function SeiChargeCard() {
return (
<Card
description="One-time ERC-20 payments settled on Sei"
icon="lucide:link"
title="Sei charge"
to="/payment-methods/sei/charge"
/>
);
}

export function CustomMethodCard() {
return (
<Card
Expand Down
9 changes: 8 additions & 1 deletion src/pages/payment-methods/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ imageDescription: "Available payment methods in MPP and how to choose the right
---

import { Cards, Tab, Tabs } from 'vocs'
import { TempoMethodCard, CardMethodCard, LightningMethodCard, SolanaMethodCard, StripeMethodCard, CustomMethodCard } from '../../components/cards'
import { TempoMethodCard, CardMethodCard, LightningMethodCard, SolanaMethodCard, SeiMethodCard, StripeMethodCard, CustomMethodCard } from '../../components/cards'

# Payment methods [Available methods and how to choose one]

Expand Down Expand Up @@ -42,6 +42,12 @@ WWW-Authenticate: Payment method="lightning", intent="charge", ...
```http
HTTP/1.1 402 Payment Required
WWW-Authenticate: Payment method="solana", intent="charge", ...
```
</Tab>
<Tab title="Sei">
```http
HTTP/1.1 402 Payment Required
WWW-Authenticate: Payment method="sei", intent="charge", ...
```
</Tab>
</Tabs>
Expand All @@ -54,5 +60,6 @@ WWW-Authenticate: Payment method="solana", intent="charge", ...
<CardMethodCard />
<LightningMethodCard />
<SolanaMethodCard />
<SeiMethodCard />
<CustomMethodCard />
</Cards>
79 changes: 79 additions & 0 deletions src/pages/payment-methods/sei/charge.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
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: '0xe15fc38f6d8c56af07bbcbe3baf5708a2bf42392', // 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:

### `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.

```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

<Cards>
<SpecCard to="https://paymentauth.org/draft-sei-charge-00" />
</Cards>
37 changes: 37 additions & 0 deletions src/pages/payment-methods/sei/index.mdx
Original file line number Diff line number Diff line change
@@ -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 | `1238` |

## Intents

<div className="vocs:grid vocs:grid-cols-1 vocs:md:grid-cols-2 vocs:gap-4">
<a href="/payment-methods/sei/charge" className="vocs:relative vocs:flex vocs:flex-col vocs:space-y-2 vocs:rounded-md vocs:bg-surfaceTint/70 vocs:border vocs:border-primary vocs:p-4 vocs:no-underline vocs:transition-colors vocs:hover:bg-surfaceTint">
<div className="vocs:size-8 vocs:flex vocs:items-center vocs:justify-center vocs:rounded-lg vocs:border vocs:border-primary vocs:bg-surface vocs:text-accent">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>
</div>
<div className="vocs:text-[15px] vocs:font-medium vocs:text-heading">Sei charge</div>
<div className="vocs:text-sm vocs:leading-relaxed vocs:text-secondary">One-time ERC-20 payments settled on Sei</div>
</a>
</div>
8 changes: 8 additions & 0 deletions vocs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
],
},
Expand Down
Loading