@cmdoss/suipay-seller
v0.1.1
Published
SuiPay seller SDK — verify a gateway delivery proof, or mint and settle a 402 yourself.
Downloads
238
Keywords
Readme
@cmdoss/suipay-seller
Seller SDK for SuiPay. Two entries:
| Import | What it is |
| --- | --- |
| @cmdoss/suipay-seller | requireProof / requireProofForServices — JWKS check that a gateway receipt paid this request |
| @cmdoss/suipay-seller/paid | createSeller — mint a dual-dialect 402 and settle in-process |
Do not publish or depend on @cmdoss/suipay-core. Wire types are bundled.
Verify a gateway proof
import { requireProof } from '@cmdoss/suipay-seller';
const { middleware } = requireProof({
jwksUrl: 'https://gateway.example/.well-known/jwks.json',
issuer: 'https://gateway.example',
audience: 'https://api.example/paid',
});Self-host mint and settle
import { createSeller } from '@cmdoss/suipay-seller/paid';
const seller = createSeller({
chain,
secret: process.env.OFFER_SECRET!,
payTo: '0x…',
packageId: '0x…',
baseUrl: 'http://localhost:4400',
decimals: 9,
});
app.get('/paid/quote', seller.paid({ price: '1000000', asset: '0x2::sui::SUI' }));Publishing to npm is an owner step. Do not run npm publish from CI.
