StableOps turns on-chain stablecoin transfers into familiar payment primitives: payment orders, deterministic status transitions, signed webhooks, retries, and confirmation tracking. You bring the receiving addresses or custody setup; StableOps watches supported chains, matches transfers, tracks confirmations, checks reorgs, and delivers webhook events to your application.
This SDK is intended for server-side TypeScript and JavaScript applications that create payment orders, query normalized chain events, manage webhook endpoints, and verify webhook signatures.
- Type-safe client for payment orders, events, and webhook endpoints.
- Built-in request retry behavior for transient failures.
- Explicit idempotency support for write operations.
- Constant-time webhook signature verification.
- In-process mock server for tests, examples, and local demos.
- Self-contained public types with no StableOps workspace dependencies.
- Dual CJS and ESM builds with generated TypeScript declarations.
- Node.js 20 or newer.
- A StableOps API key.
- A server-side environment. Do not expose your API key in browser code.
pnpm add @stableops/api-sdknpm install @stableops/api-sdkyarn add @stableops/api-sdkimport { StableOps } from '@stableops/api-sdk'
const stableops = new StableOps({
apiKey: process.env.STABLEOPS_API_KEY!,
})
const order = await stableops.paymentOrders.create(
{
merchantOrderId: 'order_123',
amount: '49.00',
settlementAsset: 'USDC',
acceptedAssets: [
{ chain: 'base-sepolia', asset: 'USDC' },
{ chain: 'ethereum-sepolia', asset: 'USDC' },
],
metadata: { customerId: 'cus_123', plan: 'pro_monthly' },
},
{ idempotencyKey: 'order_123:create' },
)
console.log(order.paymentInstructions)Webhook verification and the mock server use explicit Node-only subpath exports:
import { SIGNATURE_HEADER, verifySignature } from '@stableops/api-sdk/webhooks'
import { MockServer } from '@stableops/api-sdk/mock'The default @stableops/api-sdk entry does not import Node crypto or http
modules, so edge-compatible server runtimes can use the API client when they
provide fetch, AbortController, and crypto.randomUUID.
Return only the order id, amount, and paymentInstructions to your frontend.
The actual API key and order creation flow should stay on your server.
For complete guides, API references, payment lifecycle details, webhook verification, and wallet integration examples, see the official documentation:
- English docs: https://stableops.dev/en/docs
- Chinese docs: https://stableops.dev/zh/docs
This SDK supports:
- Chains: Ethereum, Base, Arbitrum, Polygon, TRON, Solana, and supported testnets.
- Assets: USDC and USDT.
StableOps may support a subset of chain/asset pairs per environment and organization configuration. Use the dashboard or API configuration for the source of truth in production.
This SDK is licensed under Apache-2.0. See LICENSE.