
JavaScript client integration
Typed, with no runtime dependencies. Calls the API from Node or the browser and checks callbacks in Node.
Read the API quick startRequirements
- Node 20+ or a browser with fetch. Callback signature verification requires Node and uses node:crypto.
- A gateway base URL, payout wallet and public callback URL. Public calls need no API key.
Install and configure
- Install @suawave/gateway-client in your application. It provides ESM, CommonJS and type declarations without runtime dependencies.
- Create GatewayClient with your baseUrl and use publicCreate with a ticker, payout address and a unique callback URL per order.
- Use publicQrCode, publicLogs, publicInfo, publicEstimate and conversion methods as needed to build your payment flow.
- On your Node server, import verifyCallbackSignature from @suawave/gateway-client/verify. Fetch and cache publicCallbackKey, then verify the exact full GET URL or raw POST body before applying a callback.
What the buyer sees
Your application renders the returned deposit address, token amount and QR code. The client does not add a storefront payment method or update orders automatically; you implement the payment screen and callback handler.
Payment behavior
- Amounts are decimal strings. Use the provided base-unit helpers for integer arithmetic instead of JavaScript number values.
- Each operation accepts a cancellation signal, and requests have a configurable timeout. Signature helpers stay in the Node-only verify entry point so the main client can be bundled for browsers.