suioutkit 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +277 -0
- package/assets/flutterwave.png +0 -0
- package/assets/opay.png +0 -0
- package/assets/stripe.png +0 -0
- package/assets/stripe_c.jpeg +0 -0
- package/assets/sui.png +0 -0
- package/assets/suioutkit.png +0 -0
- package/dist/components/PaymentStatusUI.d.ts +7 -0
- package/dist/components/ProgressStepper.d.ts +10 -0
- package/dist/components/StatusBadge.d.ts +7 -0
- package/dist/components/modal.d.ts +50 -0
- package/dist/config/api.d.ts +5 -0
- package/dist/hooks/usePaymentStatus.d.ts +12 -0
- package/dist/hooks/usePolling.d.ts +13 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +51124 -0
- package/dist/types/index.d.ts +57 -0
- package/dist/utils/format.d.ts +12 -0
- package/dist/utils/http.d.ts +11 -0
- package/package.json +40 -0
- package/src/components/PaymentStatusUI.tsx +58 -0
- package/src/components/ProgressStepper.tsx +23 -0
- package/src/components/StatusBadge.tsx +22 -0
- package/src/components/modal.ts +992 -0
- package/src/components/style.css +751 -0
- package/src/config/api.ts +16 -0
- package/src/declarations.d.ts +1 -0
- package/src/hooks/usePaymentStatus.ts +40 -0
- package/src/hooks/usePolling.ts +46 -0
- package/src/index.ts +139 -0
- package/src/types/index.ts +69 -0
- package/src/utils/format.ts +27 -0
- package/src/utils/http.ts +64 -0
- package/tsconfig.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<div align="center">
|
|
3
|
+
<h1>SuiOutKit SDK</h1>
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://www.npmjs.com/package/suioutkit"><img src="https://img.shields.io/npm/v/suioutkit.svg" alt="npm version"/></a>
|
|
6
|
+
<a href="/LICENSE"><img src="https://img.shields.io/badge/License-GPLv3-blue.svg" alt="License: GPL v3"/></a>
|
|
7
|
+
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-typed-3178c6.svg" alt="TypeScript"/></a>
|
|
8
|
+
</p>
|
|
9
|
+
</h1>
|
|
10
|
+
|
|
11
|
+
Browser SDK for SuiOutKit checkout: create sessions, open a ready-made payment modal, or build a custom UI with helpers.
|
|
12
|
+
|
|
13
|
+
Uses the **hosted SuiOutKit API** at `https://api.suioutkit.xyz` by default (all routes under `/v1/`). The SDK does not perform settlement, treasury checks, or provider calls itself.
|
|
14
|
+
|
|
15
|
+
| Resource | Link |
|
|
16
|
+
|----------|------|
|
|
17
|
+
| Monorepo overview | [/README.md](/README.md) |
|
|
18
|
+
| Documentation | [/docs/README.md](/docs/README.md) |
|
|
19
|
+
| Live demo | [/demo/demo.html](/demo/demo.html) |
|
|
20
|
+
| Backend & operator setup | [/docs/developer-guide.md](/docs/developer-guide.md) |
|
|
21
|
+
|
|
22
|
+
## Table of contents
|
|
23
|
+
- [Install](#install)
|
|
24
|
+
- [Quick start](#quick-start)
|
|
25
|
+
- [Configuration](#configuration)
|
|
26
|
+
- [API reference](#api-reference)
|
|
27
|
+
- [Payment methods](#payment-methods)
|
|
28
|
+
- [Custom UI (no modal)](#custom-ui-no-modal)
|
|
29
|
+
- [Load from your backend](#load-from-your-backend)
|
|
30
|
+
- [Backend endpoints used by the SDK](#backend-endpoints-used-by-the-sdk)
|
|
31
|
+
- [Troubleshooting](#troubleshooting)
|
|
32
|
+
- [Publishing](#publishing)
|
|
33
|
+
- [License](#license)
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
```bash
|
|
37
|
+
npm install suioutkit
|
|
38
|
+
# or
|
|
39
|
+
yarn add suioutkit
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Peer environment:** Node 18+ to build; in the browser, any modern ESM-capable environment.
|
|
43
|
+
|
|
44
|
+
## Quick start
|
|
45
|
+
### React or bundler (recommended)
|
|
46
|
+
```tsx
|
|
47
|
+
import { SuiOutKit } from "suioutkit";
|
|
48
|
+
|
|
49
|
+
const sdk = new SuiOutKit({
|
|
50
|
+
merchantAddress: "0xYOUR_MERCHANT_SUI_ADDRESS",
|
|
51
|
+
// backendUrl optional - defaults to https://api.suioutkit.xyz
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export function PayButton() {
|
|
55
|
+
async function handlePay() {
|
|
56
|
+
const session = await sdk.initCheckout({
|
|
57
|
+
amount: 45000,
|
|
58
|
+
currency: "NGN",
|
|
59
|
+
metadata: { orderId: "ORDER-123" },
|
|
60
|
+
});
|
|
61
|
+
sdk.openModal(session, () => {
|
|
62
|
+
console.log("Modal closed");
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return <button type="button" onClick={handlePay}>Pay now</button>;
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### One-line button binding
|
|
71
|
+
```ts
|
|
72
|
+
sdk.wrapButton("#pay-btn", {
|
|
73
|
+
amount: 45000,
|
|
74
|
+
currency: "NGN",
|
|
75
|
+
metadata: { sku: "PRO-PLAN" },
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Updates the button label (e.g. `Pay ₦45,000`) and opens the modal on click.
|
|
80
|
+
|
|
81
|
+
### Vanilla HTML (serve SDK bundle)
|
|
82
|
+
For simple demos you can serve the built SDK bundle from any static host. Build the SDK with `npm run build` in `sdk/` and serve `sdk/dist/index.js` from your server. See the Developer Guide for recommended local and production setups: [/docs/developer-guide.md](/docs/developer-guide.md).
|
|
83
|
+
|
|
84
|
+
## Configuration
|
|
85
|
+
### `new SuiOutKit(config)`
|
|
86
|
+
|
|
87
|
+
| Option | Type | Required | Description |
|
|
88
|
+
|--------|------|----------|-------------|
|
|
89
|
+
| `merchantAddress` | `string` | Yes | Sui address that receives settlement |
|
|
90
|
+
| `backendUrl` | `string` | No | API origin (no trailing slash). Default: `https://api.suioutkit.xyz`. Use `http://localhost:5000` only for local development. |
|
|
91
|
+
|
|
92
|
+
### Network (crypto flows)
|
|
93
|
+
The modal reads `window.SuiOutKitNetwork` - set to `"mainnet"` or `"testnet"` before opening the modal if you need a specific network for wallet / outPay flows.
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<script>window.SuiOutKitNetwork = "testnet";</script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## API reference
|
|
100
|
+
### `initCheckout(options)`
|
|
101
|
+
Creates a checkout session on the backend.
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
const session = await sdk.initCheckout({
|
|
105
|
+
amount: 45000, // integer in major units (e.g. 45000 NGN)
|
|
106
|
+
currency: "NGN", // e.g. "NGN"
|
|
107
|
+
metadata?: { orderId: "ORDER-123" },
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Returns** `CheckoutSession` (includes at least):
|
|
112
|
+
|
|
113
|
+
| Field | Description |
|
|
114
|
+
|-------|-------------|
|
|
115
|
+
| `token` | Opaque session token for charge/crypto calls |
|
|
116
|
+
| `nonce` | Public session id for status polling |
|
|
117
|
+
| `amount`, `currency` | Checkout totals |
|
|
118
|
+
| `merchantAddress` | Normalized Sui address |
|
|
119
|
+
| `coinType` | Settlement coin type (from backend config) |
|
|
120
|
+
| `estimatedRate` | FX preview (NGN → token) when applicable |
|
|
121
|
+
| `packageId`, `cryptoRegistryId`, `cryptoRegistryName` | On-chain config for crypto paths |
|
|
122
|
+
|
|
123
|
+
Throws if the backend returns a non-OK response.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### `openModal(session, onClose?)`
|
|
128
|
+
Opens the built-in checkout modal (bank transfer, OPay, Stripe, Sui wallet, outPay).
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
const modal = sdk.openModal(session, () => {
|
|
132
|
+
// Called when the user closes the overlay
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Returns** `SuiOutKitModal` (internal handle). The modal loads styles from `{backendUrl}/style.css` automatically.
|
|
137
|
+
|
|
138
|
+
> **Note:** Theme, logo, and `allowedMethods` customization are not exposed on `openModal` today. Use [custom UI](#custom-ui-no-modal) or extend the modal in source if you need that.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### `wrapButton(selector, options)`
|
|
143
|
+
Binds checkout to a DOM button.
|
|
144
|
+
|
|
145
|
+
| Argument | Type | Description |
|
|
146
|
+
|----------|------|-------------|
|
|
147
|
+
| `selector` | `string` | CSS selector (e.g. `"#pay-btn"`) |
|
|
148
|
+
| `options.amount` | `number` | Checkout amount |
|
|
149
|
+
| `options.currency` | `string` | e.g. `"NGN"` |
|
|
150
|
+
| `options.metadata` | `object` | Optional passthrough to `initCheckout` |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### `confirmCryptoPayment(nonce, txDigest, method?)`
|
|
155
|
+
After the user pays via wallet/outPay in a **custom** flow, submit the transaction digest for backend verification and Walrus receipt handling.
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
const result = await sdk.confirmCryptoPayment(
|
|
159
|
+
session.nonce,
|
|
160
|
+
txDigest,
|
|
161
|
+
"sui_wallet" // or "outpay"
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
if (result.status === "success") {
|
|
165
|
+
console.log(result.txDigest, result.walrusBlobId);
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The built-in modal calls this internally for crypto paths.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
### Helper exports
|
|
174
|
+
For custom UIs without the modal:
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import {
|
|
178
|
+
SuiOutKit,
|
|
179
|
+
request,
|
|
180
|
+
formatNgn,
|
|
181
|
+
toTokenUnits,
|
|
182
|
+
formatToken,
|
|
183
|
+
createPolling,
|
|
184
|
+
} from "suioutkit";
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
| Export | Description |
|
|
188
|
+
|--------|-------------|
|
|
189
|
+
| `request(url, options?)` | `fetch` wrapper with timeout and JSON parsing |
|
|
190
|
+
| `formatNgn(amount)` | Format NGN with locale / `₦` fallback |
|
|
191
|
+
| `toTokenUnits(baseUnits, decimals?)` | Convert base units to float (default 9 decimals) |
|
|
192
|
+
| `formatToken(amount, decimals?, digits?)` | Display-friendly token amount string |
|
|
193
|
+
| `createPolling(fn, intervalMs)` | `{ start(), stop() }` interval helper |
|
|
194
|
+
|
|
195
|
+
**Example - poll settlement status:**
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
import { createPolling, request } from "suioutkit";
|
|
199
|
+
|
|
200
|
+
const poll = createPolling(async () => {
|
|
201
|
+
const status = await request(`${backendUrl}/v1/checkout/status/${nonce}`);
|
|
202
|
+
if (status.status === "SETTLED") {
|
|
203
|
+
poll.stop();
|
|
204
|
+
console.log(status.txDigest, status.walrusBlobId);
|
|
205
|
+
}
|
|
206
|
+
}, 3000);
|
|
207
|
+
|
|
208
|
+
poll.start();
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Example - Server-Sent Events** (React hook in repo, not published from package entry today):
|
|
212
|
+
|
|
213
|
+
The backend exposes `GET /v1/payments/stream/:nonce`. You can use `EventSource` directly or copy [`usePaymentStatus.ts`](src/hooks/usePaymentStatus.ts) into your app.
|
|
214
|
+
|
|
215
|
+
## Payment methods
|
|
216
|
+
The modal orchestrates these **charge** methods against the backend:
|
|
217
|
+
|
|
218
|
+
| Method | Provider | Notes |
|
|
219
|
+
|--------|----------|--------|
|
|
220
|
+
| `bank_transfer` | Flutterwave | Virtual account details shown in modal |
|
|
221
|
+
| `opay` | Flutterwave | Requires `phoneNumber` at charge time |
|
|
222
|
+
| `stripe` | Stripe | Card element; NGN minimum enforced server-side |
|
|
223
|
+
| `sui_wallet` | Sui + Payment Kit | Wallet connect via dApp Kit |
|
|
224
|
+
| `outpay` | Payment Kit QR | outPay flow |
|
|
225
|
+
|
|
226
|
+
Fiat methods depend on backend env configuration (Flutterwave / Stripe keys). Crypto methods require registry IDs on the backend.
|
|
227
|
+
|
|
228
|
+
## Custom UI (no modal)
|
|
229
|
+
1. `initCheckout` → keep `session.token` and `session.nonce`.
|
|
230
|
+
2. Optional: `GET /v1/checkout/validate/:nonce` for FX/settlement preview.
|
|
231
|
+
3. `POST /v1/checkout/charge` with `{ token, method, phoneNumber? }`.
|
|
232
|
+
4. Poll `GET /v1/checkout/status/:nonce` or use SSE `/v1/payments/stream/:nonce`.
|
|
233
|
+
5. For crypto: `POST /v1/checkout/crypto/intent` → wallet PTB → `confirmCryptoPayment`.
|
|
234
|
+
|
|
235
|
+
Charge and crypto endpoints are documented in [Backend API](/docs/guides/backend-api.md).
|
|
236
|
+
|
|
237
|
+
## Load from your backend
|
|
238
|
+
In production, either bundle the SDK with your app (`npm install suioutkit`) or serve the built `sdk/dist` statically from your web host. See the Developer Guide for recommended deployment patterns and backend integration: [/docs/developer-guide.md](/docs/developer-guide.md).
|
|
239
|
+
|
|
240
|
+
## Backend endpoints used by the SDK
|
|
241
|
+
All paths are relative to `backendUrl`.
|
|
242
|
+
|
|
243
|
+
| Method | Path | Used by |
|
|
244
|
+
|--------|------|---------|
|
|
245
|
+
| `POST` | `/v1/checkout/session` | `initCheckout` |
|
|
246
|
+
| `POST` | `/v1/checkout/charge` | Modal (fiat) |
|
|
247
|
+
| `GET` | `/v1/checkout/status/:nonce` | Modal polling |
|
|
248
|
+
| `GET` | `/v1/checkout/validate/:nonce` | Modal pre-flight |
|
|
249
|
+
| `POST` | `/v1/checkout/crypto/intent` | Modal (crypto) |
|
|
250
|
+
| `POST` | `/v1/checkout/crypto/confirm` | Modal / `confirmCryptoPayment` |
|
|
251
|
+
| `GET` | `/v1/payments/stream/:nonce` | Optional SSE (custom UI) |
|
|
252
|
+
|
|
253
|
+
Webhooks (`/v1/checkout/webhook`, `/v1/checkout/stripe-webhook`) are server-to-provider only.
|
|
254
|
+
|
|
255
|
+
## Troubleshooting
|
|
256
|
+
| Symptom | Likely cause |
|
|
257
|
+
|---------|----------------|
|
|
258
|
+
| `Failed to initialize checkout session` | Backend down, CORS, or missing `merchantAddress` |
|
|
259
|
+
| `409 Treasury insufficient` | Operator vault underfunded for FX settlement amount |
|
|
260
|
+
| Modal stuck on “waiting for settlement” | Webhook not reaching backend (Flutterwave hash, Stripe CLI, or ngrok) |
|
|
261
|
+
| Stripe card errors on small NGN amounts | Backend enforces ~$0.50 USD equivalent minimum |
|
|
262
|
+
| Crypto connect fails | Wrong `window.SuiOutKitNetwork` or registry env on backend |
|
|
263
|
+
| Styles missing | Backend not serving `/style.css` or wrong `backendUrl` |
|
|
264
|
+
|
|
265
|
+
See also [Developer Guide - Troubleshooting](/docs/developer-guide.md#troubleshooting).
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
## Security
|
|
270
|
+
- Only `merchantAddress` and `backendUrl` belong in browser code.
|
|
271
|
+
- Never embed operator keys, Flutterwave secrets, or Stripe secret keys in the client.
|
|
272
|
+
- Use **HTTPS** for `backendUrl` in production.
|
|
273
|
+
|
|
274
|
+
Report vulnerabilities through your project’s private security channel (do not file public issues with key material).
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
[GPL-3.0](/LICENSE) - Copyright (c) 2026 [The3rdWebLabs](https://github.com/the3rdweblabs) / [@CYBWithFlourish](https://github.com/CYBWithFlourish/)
|
|
Binary file
|
package/assets/opay.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/sui.png
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import "@mysten/dapp-kit-core/web";
|
|
2
|
+
import { CheckoutSession } from "../types/index.js";
|
|
3
|
+
export declare class SuiOutKitModal {
|
|
4
|
+
private overlay;
|
|
5
|
+
private session;
|
|
6
|
+
private backendUrl;
|
|
7
|
+
private pollInterval;
|
|
8
|
+
private walletConnectionUnsubscribe;
|
|
9
|
+
private onCloseCallback;
|
|
10
|
+
private cryptoIntent;
|
|
11
|
+
private dAppKit;
|
|
12
|
+
private paymentClient;
|
|
13
|
+
private stripeInstance;
|
|
14
|
+
private stripeElements;
|
|
15
|
+
constructor(session: CheckoutSession, backendUrl: string, onClose: () => void);
|
|
16
|
+
private injectStyles;
|
|
17
|
+
private renderIcons;
|
|
18
|
+
private createModal;
|
|
19
|
+
private renderSelectionPanel;
|
|
20
|
+
private handleCharge;
|
|
21
|
+
private renderLoadingPanel;
|
|
22
|
+
private renderBankTransferPanel;
|
|
23
|
+
private mountPaymentStatus;
|
|
24
|
+
private renderOPayFormPanel;
|
|
25
|
+
private renderOPayInstructionsPanel;
|
|
26
|
+
private handleStripePaymentPanel;
|
|
27
|
+
private renderStripeElementsPanel;
|
|
28
|
+
private handleCryptoPaymentPanel;
|
|
29
|
+
private renderCustomWalletListPanel;
|
|
30
|
+
private openStandardConnectWallet;
|
|
31
|
+
private getCompatibleWallets;
|
|
32
|
+
private renderWalletPickerPanel;
|
|
33
|
+
private ensureDAppKit;
|
|
34
|
+
private clearWalletConnectionWaiter;
|
|
35
|
+
private isFileOrigin;
|
|
36
|
+
private renderUnsupportedOriginPanel;
|
|
37
|
+
private renderWalletCard;
|
|
38
|
+
private renderNoSupportedWalletsPanel;
|
|
39
|
+
private renderPaymentConfirmPanel;
|
|
40
|
+
private executeWalletPayment;
|
|
41
|
+
private renderOutPayQRPanel;
|
|
42
|
+
private buildPaymentUri;
|
|
43
|
+
private loadCryptoIntent;
|
|
44
|
+
private ensurePaymentClient;
|
|
45
|
+
private renderSuccessPanel;
|
|
46
|
+
private renderErrorPanel;
|
|
47
|
+
private startPolling;
|
|
48
|
+
private stopPolling;
|
|
49
|
+
destroy(): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Production SuiOutKit API origin (versioned paths under /v1/). */
|
|
2
|
+
export declare const DEFAULT_API_ORIGIN = "http://localhost:5000";
|
|
3
|
+
/** API version prefix - all checkout and payment routes live under this path. */
|
|
4
|
+
export declare const API_V1_PREFIX = "/v1";
|
|
5
|
+
export declare function joinApiPath(origin: string, ...segments: string[]): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type PaymentUpdate = {
|
|
2
|
+
status?: "PENDING" | "PROCESSING" | "BANK_CONFIRMED" | "SETTLED" | "ERROR";
|
|
3
|
+
walrusBlobId?: string;
|
|
4
|
+
txDigest?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Hook to listen to backend payment status via Server‑Sent Events.
|
|
9
|
+
* Usage: const update = usePaymentStatus(session.nonce);
|
|
10
|
+
*/
|
|
11
|
+
export declare function usePaymentStatus(backendUrl: string, nonce: string): PaymentUpdate;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight framework-agnostic polling utility.
|
|
3
|
+
* Usage:
|
|
4
|
+
* const poll = createPolling(async () => { await fetchStatus() }, 5000);
|
|
5
|
+
* poll.start();
|
|
6
|
+
* poll.stop();
|
|
7
|
+
*/
|
|
8
|
+
export declare function createPolling(fn: () => Promise<void> | void, intervalMs: number): {
|
|
9
|
+
readonly start: () => void;
|
|
10
|
+
readonly stop: () => void;
|
|
11
|
+
readonly isRunning: () => boolean;
|
|
12
|
+
};
|
|
13
|
+
export default createPolling;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CheckoutSession, CheckoutSessionOptions, CryptoConfirmResponse } from "./types/index.js";
|
|
2
|
+
import { SuiOutKitModal } from "./components/modal.js";
|
|
3
|
+
export { DEFAULT_API_ORIGIN, API_V1_PREFIX } from "./config/api.js";
|
|
4
|
+
export declare class SuiOutKit {
|
|
5
|
+
private backendUrl;
|
|
6
|
+
private merchantAddress;
|
|
7
|
+
constructor(config: {
|
|
8
|
+
merchantAddress: string;
|
|
9
|
+
backendUrl?: string;
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Initializes a brand-new isolated checkout session from the backend.
|
|
13
|
+
*/
|
|
14
|
+
initCheckout(options: Omit<CheckoutSessionOptions, "merchantAddress">): Promise<CheckoutSession>;
|
|
15
|
+
/**
|
|
16
|
+
* Spawns the interactive RainbowKit-style checkout modal.
|
|
17
|
+
*/
|
|
18
|
+
openModal(session: CheckoutSession, onClose?: () => void): SuiOutKitModal;
|
|
19
|
+
/**
|
|
20
|
+
* Confirms a crypto payment after wallet execution by submitting the tx digest.
|
|
21
|
+
*/
|
|
22
|
+
confirmCryptoPayment(nonce: string, txDigest: string, method?: "sui_wallet" | "outpay"): Promise<CryptoConfirmResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Integrates dynamically with a targeted button on the merchant's landing page.
|
|
25
|
+
* Brands the button and isolates a unique checkout session per click.
|
|
26
|
+
*/
|
|
27
|
+
wrapButton(selector: string, options: {
|
|
28
|
+
amount: number;
|
|
29
|
+
currency: "NGN" | "SUI" | string;
|
|
30
|
+
metadata?: Record<string, any>;
|
|
31
|
+
}): void;
|
|
32
|
+
}
|
|
33
|
+
export { default as request } from "./utils/http.js";
|
|
34
|
+
export * from "./utils/format.js";
|
|
35
|
+
export { default as createPolling } from "./hooks/usePolling.js";
|