@glacislabs/stablegenie-zerodelta 2.0.0
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/LICENSE +21 -0
- package/README.md +157 -0
- package/dist/chunk-DSQ7MRF7.js +3107 -0
- package/dist/chunk-VL5MWEY2.js +1426 -0
- package/dist/core/index.cjs +1522 -0
- package/dist/core/index.d.cts +353 -0
- package/dist/core/index.d.ts +353 -0
- package/dist/core/index.js +1 -0
- package/dist/index.cjs +4491 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/mount-yTJi4VdA.d.ts +204 -0
- package/dist/mount-yqXrDBLc.d.cts +204 -0
- package/dist/mount.cjs +4481 -0
- package/dist/mount.d.cts +3 -0
- package/dist/mount.d.ts +3 -0
- package/dist/mount.js +2 -0
- package/dist/standalone.global.js +451 -0
- package/dist/verify-CaO0OD4Z.d.cts +351 -0
- package/dist/verify-CaO0OD4Z.d.ts +351 -0
- package/package.json +119 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { B as BankPayoutAccount, E as Eip1193Provider, a as ExchangeMode, L as LinkIdentity, M as MountConfig, P as PaymentIsland, b as PaymentIslandKind, c as PaymentIslandProps, S as SettlementMethod, d as StableGenieConfig, e as StableGenieExchange, f as StableGenieExchangeProps, g as StableGeniePay, h as StableGeniePayProps, i as StableGenieProvider, j as StableGenieSwap, k as StableGenieSwapProps, l as StableGenieTheme, m as SuccessInfo, n as SupportedAsset, o as darkTheme, p as lightTheme, q as mount, r as resolveTheme } from './mount-yqXrDBLc.cjs';
|
|
2
|
+
export { Engine, createEngine } from './core/index.cjs';
|
|
3
|
+
export { E as EngineConfig, P as Plan, R as RouteResult, S as SanitizedTxEntry, T as TxHistoryEntry, V as VerifyResult } from './verify-CaO0OD4Z.cjs';
|
|
4
|
+
import 'react';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { B as BankPayoutAccount, E as Eip1193Provider, a as ExchangeMode, L as LinkIdentity, M as MountConfig, P as PaymentIsland, b as PaymentIslandKind, c as PaymentIslandProps, S as SettlementMethod, d as StableGenieConfig, e as StableGenieExchange, f as StableGenieExchangeProps, g as StableGeniePay, h as StableGeniePayProps, i as StableGenieProvider, j as StableGenieSwap, k as StableGenieSwapProps, l as StableGenieTheme, m as SuccessInfo, n as SupportedAsset, o as darkTheme, p as lightTheme, q as mount, r as resolveTheme } from './mount-yTJi4VdA.js';
|
|
2
|
+
export { Engine, createEngine } from './core/index.js';
|
|
3
|
+
export { E as EngineConfig, P as Plan, R as RouteResult, S as SanitizedTxEntry, T as TxHistoryEntry, V as VerifyResult } from './verify-CaO0OD4Z.js';
|
|
4
|
+
import 'react';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { P as Plan, V as VerifyResult, R as RouteResult, S as SanitizedTxEntry } from './verify-CaO0OD4Z.js';
|
|
4
|
+
|
|
5
|
+
interface Eip1193Provider {
|
|
6
|
+
request(args: {
|
|
7
|
+
method: string;
|
|
8
|
+
params?: unknown[] | object;
|
|
9
|
+
}): Promise<unknown>;
|
|
10
|
+
on?(event: string, listener: (...args: any[]) => void): void;
|
|
11
|
+
removeListener?(event: string, listener: (...args: any[]) => void): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface StableGenieTheme {
|
|
15
|
+
mode: "light" | "dark";
|
|
16
|
+
accent: string;
|
|
17
|
+
accentText: string;
|
|
18
|
+
bg: string;
|
|
19
|
+
surface: string;
|
|
20
|
+
border: string;
|
|
21
|
+
text: string;
|
|
22
|
+
textMuted: string;
|
|
23
|
+
danger: string;
|
|
24
|
+
success: string;
|
|
25
|
+
radius: string;
|
|
26
|
+
radiusControl: string;
|
|
27
|
+
radiusCta: string;
|
|
28
|
+
font: string;
|
|
29
|
+
motionFast: string;
|
|
30
|
+
motionBase: string;
|
|
31
|
+
motionSlow: string;
|
|
32
|
+
motionDeliberate: string;
|
|
33
|
+
easeOutSoft: string;
|
|
34
|
+
easeInOut: string;
|
|
35
|
+
easeSpring: string;
|
|
36
|
+
}
|
|
37
|
+
declare const lightTheme: StableGenieTheme;
|
|
38
|
+
declare const darkTheme: StableGenieTheme;
|
|
39
|
+
declare function resolveTheme(theme?: Partial<StableGenieTheme>): StableGenieTheme;
|
|
40
|
+
|
|
41
|
+
interface SuccessInfo {
|
|
42
|
+
hash: string;
|
|
43
|
+
verdict: VerifyResult;
|
|
44
|
+
route: RouteResult;
|
|
45
|
+
}
|
|
46
|
+
/** Config shared by both widgets. Can be supplied per-widget as props or via StableGenieProvider. */
|
|
47
|
+
interface StableGenieConfig {
|
|
48
|
+
/** Request base. Default: `/api/widget/v1` (same-origin keyless proxy). */
|
|
49
|
+
apiBase?: string;
|
|
50
|
+
/** Optional viewer key (attached only to a same-origin / trusted base). */
|
|
51
|
+
apiKey?: string;
|
|
52
|
+
/** The single absolute origin permitted to receive `apiKey`, e.g. `https://pay.example.com`.
|
|
53
|
+
* Omit and no absolute origin is trusted — the key is same-origin only. Required alongside an
|
|
54
|
+
* absolute `apiBase`, otherwise the key is silently withheld (see core/config.ts). */
|
|
55
|
+
trustedApiOrigin?: string;
|
|
56
|
+
/** Host-injected EIP-1193 provider (e.g. the active wagmi connector). */
|
|
57
|
+
provider?: Eip1193Provider;
|
|
58
|
+
/** Per-chain RPC overrides for settlement verification / balances. */
|
|
59
|
+
rpcOverrides?: Record<number, string>;
|
|
60
|
+
theme?: Partial<StableGenieTheme>;
|
|
61
|
+
title?: string;
|
|
62
|
+
onQuote?: (plan: Plan) => void;
|
|
63
|
+
onSuccess?: (info: SuccessInfo) => void;
|
|
64
|
+
onError?: (error: Error) => void;
|
|
65
|
+
onTransaction?: (entry: SanitizedTxEntry) => void;
|
|
66
|
+
}
|
|
67
|
+
declare function StableGenieProvider({ children, ...config }: StableGenieConfig & {
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
}): react.JSX.Element;
|
|
70
|
+
|
|
71
|
+
type ExchangeMode = "exchange" | "onramp" | "offramp";
|
|
72
|
+
interface StableGenieExchangeProps extends StableGenieConfig {
|
|
73
|
+
mode?: ExchangeMode;
|
|
74
|
+
/** "pill" → ZeroDelta Link express checkout (the shared PaymentIsland). */
|
|
75
|
+
variant?: "compact" | "wide" | "pill";
|
|
76
|
+
/** Fixed widget height in px (content scrolls). Omit for fit-content. */
|
|
77
|
+
heightPx?: number;
|
|
78
|
+
/** Allowed asset universe. Defaults to the stables (USDC/USDT/USDE) — "stable exchange". */
|
|
79
|
+
assets?: SupportedAsset[];
|
|
80
|
+
defaultFromChainId?: number;
|
|
81
|
+
defaultFromAsset?: SupportedAsset;
|
|
82
|
+
defaultToChainId?: number;
|
|
83
|
+
defaultToAsset?: SupportedAsset;
|
|
84
|
+
defaultAmount?: string;
|
|
85
|
+
/** Optional explicit receiver (defaults to the payer). */
|
|
86
|
+
recipient?: string;
|
|
87
|
+
/** Default fiat currency for the on/off-ramp modes. */
|
|
88
|
+
fiatCurrency?: "USD" | "EUR" | "GBP" | "CHF";
|
|
89
|
+
}
|
|
90
|
+
declare function StableGenieExchange(props: StableGenieExchangeProps): react.JSX.Element;
|
|
91
|
+
|
|
92
|
+
type PaymentIslandKind = "pay" | "swap" | "exchange";
|
|
93
|
+
/** How the merchant wants to be settled. Set by the COMPANY embedding the widget, not the payer. */
|
|
94
|
+
type SettlementMethod = "stablecoin" | "bank";
|
|
95
|
+
/** A merchant payout account. Display-only: a human label, a masked tail, and a currency — never a
|
|
96
|
+
* full IBAN/account number, which the widget has no business touching. */
|
|
97
|
+
interface BankPayoutAccount {
|
|
98
|
+
/** e.g. "Santander" — the bank or payout provider shown on the card. */
|
|
99
|
+
bankName?: string;
|
|
100
|
+
/** Last 4 digits of the account, shown masked as "····4321". */
|
|
101
|
+
last4?: string;
|
|
102
|
+
/** ISO currency the merchant is paid out in, e.g. "EUR". */
|
|
103
|
+
currency?: string;
|
|
104
|
+
}
|
|
105
|
+
/** A returning payer's saved preferences (Stripe-Link semantics). CRYPTO PREFS ONLY — never a fiat
|
|
106
|
+
* preference. Opt-in, client-side (localStorage `zd-link-identity`), forgettable via the "…" menu. */
|
|
107
|
+
interface LinkIdentity {
|
|
108
|
+
email?: string;
|
|
109
|
+
walletAddress: string;
|
|
110
|
+
preferredAsset: SupportedAsset;
|
|
111
|
+
preferredChainId: number;
|
|
112
|
+
lastUsedAt: string;
|
|
113
|
+
}
|
|
114
|
+
interface PaymentIslandProps extends StableGenieConfig {
|
|
115
|
+
kind: PaymentIslandKind;
|
|
116
|
+
recipient?: string;
|
|
117
|
+
toChainId?: number;
|
|
118
|
+
toAsset?: SupportedAsset;
|
|
119
|
+
amount?: string;
|
|
120
|
+
fundingAssets?: SupportedAsset[];
|
|
121
|
+
/** What the MERCHANT is settled in — an INTEGRATOR choice, never the payer's. "stablecoin"
|
|
122
|
+
* (default) settles on-chain to `recipient`. "bank" is a fiat payout rail that is NOT shipped
|
|
123
|
+
* (see core/intent-schema: crypto-to-crypto only), so the card parks honestly instead of
|
|
124
|
+
* quoting a settlement the engine cannot perform. Pay/deposit only. */
|
|
125
|
+
settlement?: SettlementMethod;
|
|
126
|
+
/** The merchant's payout account, shown when `settlement === "bank"`. Display-only and
|
|
127
|
+
* deliberately NOT a full account number — the widget never handles bank credentials. */
|
|
128
|
+
bankAccount?: BankPayoutAccount;
|
|
129
|
+
mode?: ExchangeMode;
|
|
130
|
+
/** Allowed asset universe for the in-card From/To pickers. Defaults to the stables. */
|
|
131
|
+
assets?: SupportedAsset[];
|
|
132
|
+
defaultFromChainId?: number;
|
|
133
|
+
defaultFromAsset?: SupportedAsset;
|
|
134
|
+
defaultToChainId?: number;
|
|
135
|
+
defaultToAsset?: SupportedAsset;
|
|
136
|
+
defaultAmount?: string;
|
|
137
|
+
/** Start expanded (the card open). Ramp modes force this on — there is nothing to collapse to. */
|
|
138
|
+
defaultExpanded?: boolean;
|
|
139
|
+
/** Host persistence seam for the saved identity (in addition to localStorage). */
|
|
140
|
+
onIdentitySave?: (id: LinkIdentity) => void;
|
|
141
|
+
/** Called when the payer dismisses a settled receipt (collapse vs re-quote is the host's call). */
|
|
142
|
+
onDone?: () => void;
|
|
143
|
+
/** The money shown on the collapsed pill face, e.g. "$99.00". Defaults to the crypto amount. */
|
|
144
|
+
moneyDisplay?: string;
|
|
145
|
+
heightPx?: number;
|
|
146
|
+
}
|
|
147
|
+
declare function PaymentIsland(props: PaymentIslandProps): react.JSX.Element;
|
|
148
|
+
|
|
149
|
+
type SupportedAsset = "USDC" | "USDT" | "USDE" | "XAUT";
|
|
150
|
+
interface StableGeniePayProps extends StableGenieConfig {
|
|
151
|
+
/** The address that must receive the funds (the merchant / dApp deposit address). */
|
|
152
|
+
recipient: string;
|
|
153
|
+
/** The chain the funds must arrive on. */
|
|
154
|
+
toChainId: number;
|
|
155
|
+
/** The asset the recipient must receive. */
|
|
156
|
+
toAsset: SupportedAsset;
|
|
157
|
+
/** The exact amount the recipient must receive. */
|
|
158
|
+
amount: string;
|
|
159
|
+
/** Restrict which assets may FUND the payment (e.g. only USDC/USDT). The destination asset's
|
|
160
|
+
* direct transfer is always allowed. Display-side filter — never widens the engine's options. */
|
|
161
|
+
fundingAssets?: SupportedAsset[];
|
|
162
|
+
/** Fixed widget height in px (content scrolls). Omit for fit-content. */
|
|
163
|
+
heightPx?: number;
|
|
164
|
+
/** "pill" → ZeroDelta Link: a collapsed express-checkout button that morphs into a 1-click card
|
|
165
|
+
* (the shared PaymentIsland). Omit for the standard full card. */
|
|
166
|
+
variant?: "pill";
|
|
167
|
+
/** The money shown on the collapsed pill face, e.g. "$99.00" (pill variant only). */
|
|
168
|
+
moneyDisplay?: string;
|
|
169
|
+
/** Start the pill's 1-click card expanded instead of collapsed (pill variant only). */
|
|
170
|
+
defaultExpanded?: boolean;
|
|
171
|
+
/** How YOU (the integrator) want to be settled — never a payer choice. "stablecoin" (default)
|
|
172
|
+
* settles on-chain to `recipient`. "bank" is a roadmap rail, so the card parks with an honest
|
|
173
|
+
* coming-soon panel instead of quoting a settlement the engine cannot perform. Pill only. */
|
|
174
|
+
settlement?: SettlementMethod;
|
|
175
|
+
/** Your payout account, shown when `settlement === "bank"`. Display-only — pass a masked tail,
|
|
176
|
+
* never a full account number. Pill only. */
|
|
177
|
+
bankAccount?: BankPayoutAccount;
|
|
178
|
+
}
|
|
179
|
+
declare function StableGeniePay(props: StableGeniePayProps): react.JSX.Element;
|
|
180
|
+
|
|
181
|
+
interface StableGenieSwapProps extends StableGenieConfig {
|
|
182
|
+
defaultFromChainId?: number;
|
|
183
|
+
defaultFromAsset?: SupportedAsset;
|
|
184
|
+
defaultToChainId?: number;
|
|
185
|
+
defaultToAsset?: SupportedAsset;
|
|
186
|
+
defaultAmount?: string;
|
|
187
|
+
/** Optional explicit receiver (defaults to the payer). */
|
|
188
|
+
recipient?: string;
|
|
189
|
+
/** "pill" → ZeroDelta Link express checkout (the shared PaymentIsland). */
|
|
190
|
+
variant?: "pill";
|
|
191
|
+
}
|
|
192
|
+
declare function StableGenieSwap(props: StableGenieSwapProps): react.JSX.Element;
|
|
193
|
+
|
|
194
|
+
type MountConfig = ({
|
|
195
|
+
variant?: "pay";
|
|
196
|
+
} & Omit<StableGeniePayProps, "variant">) | ({
|
|
197
|
+
variant: "swap";
|
|
198
|
+
} & Omit<StableGenieSwapProps, "variant">) | ({
|
|
199
|
+
variant: "exchange";
|
|
200
|
+
} & Omit<StableGenieExchangeProps, "variant">);
|
|
201
|
+
/** Imperatively mount a widget into an element (for non-JSX / vanilla React hosts). Returns unmount. */
|
|
202
|
+
declare function mount(el: HTMLElement, config: MountConfig): () => void;
|
|
203
|
+
|
|
204
|
+
export { type BankPayoutAccount as B, type Eip1193Provider as E, type LinkIdentity as L, type MountConfig as M, PaymentIsland as P, type SettlementMethod as S, type ExchangeMode as a, type PaymentIslandKind as b, type PaymentIslandProps as c, type StableGenieConfig as d, StableGenieExchange as e, type StableGenieExchangeProps as f, StableGeniePay as g, type StableGeniePayProps as h, StableGenieProvider as i, StableGenieSwap as j, type StableGenieSwapProps as k, type StableGenieTheme as l, type SuccessInfo as m, type SupportedAsset as n, darkTheme as o, lightTheme as p, mount as q, resolveTheme as r };
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { P as Plan, V as VerifyResult, R as RouteResult, S as SanitizedTxEntry } from './verify-CaO0OD4Z.cjs';
|
|
4
|
+
|
|
5
|
+
interface Eip1193Provider {
|
|
6
|
+
request(args: {
|
|
7
|
+
method: string;
|
|
8
|
+
params?: unknown[] | object;
|
|
9
|
+
}): Promise<unknown>;
|
|
10
|
+
on?(event: string, listener: (...args: any[]) => void): void;
|
|
11
|
+
removeListener?(event: string, listener: (...args: any[]) => void): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface StableGenieTheme {
|
|
15
|
+
mode: "light" | "dark";
|
|
16
|
+
accent: string;
|
|
17
|
+
accentText: string;
|
|
18
|
+
bg: string;
|
|
19
|
+
surface: string;
|
|
20
|
+
border: string;
|
|
21
|
+
text: string;
|
|
22
|
+
textMuted: string;
|
|
23
|
+
danger: string;
|
|
24
|
+
success: string;
|
|
25
|
+
radius: string;
|
|
26
|
+
radiusControl: string;
|
|
27
|
+
radiusCta: string;
|
|
28
|
+
font: string;
|
|
29
|
+
motionFast: string;
|
|
30
|
+
motionBase: string;
|
|
31
|
+
motionSlow: string;
|
|
32
|
+
motionDeliberate: string;
|
|
33
|
+
easeOutSoft: string;
|
|
34
|
+
easeInOut: string;
|
|
35
|
+
easeSpring: string;
|
|
36
|
+
}
|
|
37
|
+
declare const lightTheme: StableGenieTheme;
|
|
38
|
+
declare const darkTheme: StableGenieTheme;
|
|
39
|
+
declare function resolveTheme(theme?: Partial<StableGenieTheme>): StableGenieTheme;
|
|
40
|
+
|
|
41
|
+
interface SuccessInfo {
|
|
42
|
+
hash: string;
|
|
43
|
+
verdict: VerifyResult;
|
|
44
|
+
route: RouteResult;
|
|
45
|
+
}
|
|
46
|
+
/** Config shared by both widgets. Can be supplied per-widget as props or via StableGenieProvider. */
|
|
47
|
+
interface StableGenieConfig {
|
|
48
|
+
/** Request base. Default: `/api/widget/v1` (same-origin keyless proxy). */
|
|
49
|
+
apiBase?: string;
|
|
50
|
+
/** Optional viewer key (attached only to a same-origin / trusted base). */
|
|
51
|
+
apiKey?: string;
|
|
52
|
+
/** The single absolute origin permitted to receive `apiKey`, e.g. `https://pay.example.com`.
|
|
53
|
+
* Omit and no absolute origin is trusted — the key is same-origin only. Required alongside an
|
|
54
|
+
* absolute `apiBase`, otherwise the key is silently withheld (see core/config.ts). */
|
|
55
|
+
trustedApiOrigin?: string;
|
|
56
|
+
/** Host-injected EIP-1193 provider (e.g. the active wagmi connector). */
|
|
57
|
+
provider?: Eip1193Provider;
|
|
58
|
+
/** Per-chain RPC overrides for settlement verification / balances. */
|
|
59
|
+
rpcOverrides?: Record<number, string>;
|
|
60
|
+
theme?: Partial<StableGenieTheme>;
|
|
61
|
+
title?: string;
|
|
62
|
+
onQuote?: (plan: Plan) => void;
|
|
63
|
+
onSuccess?: (info: SuccessInfo) => void;
|
|
64
|
+
onError?: (error: Error) => void;
|
|
65
|
+
onTransaction?: (entry: SanitizedTxEntry) => void;
|
|
66
|
+
}
|
|
67
|
+
declare function StableGenieProvider({ children, ...config }: StableGenieConfig & {
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
}): react.JSX.Element;
|
|
70
|
+
|
|
71
|
+
type ExchangeMode = "exchange" | "onramp" | "offramp";
|
|
72
|
+
interface StableGenieExchangeProps extends StableGenieConfig {
|
|
73
|
+
mode?: ExchangeMode;
|
|
74
|
+
/** "pill" → ZeroDelta Link express checkout (the shared PaymentIsland). */
|
|
75
|
+
variant?: "compact" | "wide" | "pill";
|
|
76
|
+
/** Fixed widget height in px (content scrolls). Omit for fit-content. */
|
|
77
|
+
heightPx?: number;
|
|
78
|
+
/** Allowed asset universe. Defaults to the stables (USDC/USDT/USDE) — "stable exchange". */
|
|
79
|
+
assets?: SupportedAsset[];
|
|
80
|
+
defaultFromChainId?: number;
|
|
81
|
+
defaultFromAsset?: SupportedAsset;
|
|
82
|
+
defaultToChainId?: number;
|
|
83
|
+
defaultToAsset?: SupportedAsset;
|
|
84
|
+
defaultAmount?: string;
|
|
85
|
+
/** Optional explicit receiver (defaults to the payer). */
|
|
86
|
+
recipient?: string;
|
|
87
|
+
/** Default fiat currency for the on/off-ramp modes. */
|
|
88
|
+
fiatCurrency?: "USD" | "EUR" | "GBP" | "CHF";
|
|
89
|
+
}
|
|
90
|
+
declare function StableGenieExchange(props: StableGenieExchangeProps): react.JSX.Element;
|
|
91
|
+
|
|
92
|
+
type PaymentIslandKind = "pay" | "swap" | "exchange";
|
|
93
|
+
/** How the merchant wants to be settled. Set by the COMPANY embedding the widget, not the payer. */
|
|
94
|
+
type SettlementMethod = "stablecoin" | "bank";
|
|
95
|
+
/** A merchant payout account. Display-only: a human label, a masked tail, and a currency — never a
|
|
96
|
+
* full IBAN/account number, which the widget has no business touching. */
|
|
97
|
+
interface BankPayoutAccount {
|
|
98
|
+
/** e.g. "Santander" — the bank or payout provider shown on the card. */
|
|
99
|
+
bankName?: string;
|
|
100
|
+
/** Last 4 digits of the account, shown masked as "····4321". */
|
|
101
|
+
last4?: string;
|
|
102
|
+
/** ISO currency the merchant is paid out in, e.g. "EUR". */
|
|
103
|
+
currency?: string;
|
|
104
|
+
}
|
|
105
|
+
/** A returning payer's saved preferences (Stripe-Link semantics). CRYPTO PREFS ONLY — never a fiat
|
|
106
|
+
* preference. Opt-in, client-side (localStorage `zd-link-identity`), forgettable via the "…" menu. */
|
|
107
|
+
interface LinkIdentity {
|
|
108
|
+
email?: string;
|
|
109
|
+
walletAddress: string;
|
|
110
|
+
preferredAsset: SupportedAsset;
|
|
111
|
+
preferredChainId: number;
|
|
112
|
+
lastUsedAt: string;
|
|
113
|
+
}
|
|
114
|
+
interface PaymentIslandProps extends StableGenieConfig {
|
|
115
|
+
kind: PaymentIslandKind;
|
|
116
|
+
recipient?: string;
|
|
117
|
+
toChainId?: number;
|
|
118
|
+
toAsset?: SupportedAsset;
|
|
119
|
+
amount?: string;
|
|
120
|
+
fundingAssets?: SupportedAsset[];
|
|
121
|
+
/** What the MERCHANT is settled in — an INTEGRATOR choice, never the payer's. "stablecoin"
|
|
122
|
+
* (default) settles on-chain to `recipient`. "bank" is a fiat payout rail that is NOT shipped
|
|
123
|
+
* (see core/intent-schema: crypto-to-crypto only), so the card parks honestly instead of
|
|
124
|
+
* quoting a settlement the engine cannot perform. Pay/deposit only. */
|
|
125
|
+
settlement?: SettlementMethod;
|
|
126
|
+
/** The merchant's payout account, shown when `settlement === "bank"`. Display-only and
|
|
127
|
+
* deliberately NOT a full account number — the widget never handles bank credentials. */
|
|
128
|
+
bankAccount?: BankPayoutAccount;
|
|
129
|
+
mode?: ExchangeMode;
|
|
130
|
+
/** Allowed asset universe for the in-card From/To pickers. Defaults to the stables. */
|
|
131
|
+
assets?: SupportedAsset[];
|
|
132
|
+
defaultFromChainId?: number;
|
|
133
|
+
defaultFromAsset?: SupportedAsset;
|
|
134
|
+
defaultToChainId?: number;
|
|
135
|
+
defaultToAsset?: SupportedAsset;
|
|
136
|
+
defaultAmount?: string;
|
|
137
|
+
/** Start expanded (the card open). Ramp modes force this on — there is nothing to collapse to. */
|
|
138
|
+
defaultExpanded?: boolean;
|
|
139
|
+
/** Host persistence seam for the saved identity (in addition to localStorage). */
|
|
140
|
+
onIdentitySave?: (id: LinkIdentity) => void;
|
|
141
|
+
/** Called when the payer dismisses a settled receipt (collapse vs re-quote is the host's call). */
|
|
142
|
+
onDone?: () => void;
|
|
143
|
+
/** The money shown on the collapsed pill face, e.g. "$99.00". Defaults to the crypto amount. */
|
|
144
|
+
moneyDisplay?: string;
|
|
145
|
+
heightPx?: number;
|
|
146
|
+
}
|
|
147
|
+
declare function PaymentIsland(props: PaymentIslandProps): react.JSX.Element;
|
|
148
|
+
|
|
149
|
+
type SupportedAsset = "USDC" | "USDT" | "USDE" | "XAUT";
|
|
150
|
+
interface StableGeniePayProps extends StableGenieConfig {
|
|
151
|
+
/** The address that must receive the funds (the merchant / dApp deposit address). */
|
|
152
|
+
recipient: string;
|
|
153
|
+
/** The chain the funds must arrive on. */
|
|
154
|
+
toChainId: number;
|
|
155
|
+
/** The asset the recipient must receive. */
|
|
156
|
+
toAsset: SupportedAsset;
|
|
157
|
+
/** The exact amount the recipient must receive. */
|
|
158
|
+
amount: string;
|
|
159
|
+
/** Restrict which assets may FUND the payment (e.g. only USDC/USDT). The destination asset's
|
|
160
|
+
* direct transfer is always allowed. Display-side filter — never widens the engine's options. */
|
|
161
|
+
fundingAssets?: SupportedAsset[];
|
|
162
|
+
/** Fixed widget height in px (content scrolls). Omit for fit-content. */
|
|
163
|
+
heightPx?: number;
|
|
164
|
+
/** "pill" → ZeroDelta Link: a collapsed express-checkout button that morphs into a 1-click card
|
|
165
|
+
* (the shared PaymentIsland). Omit for the standard full card. */
|
|
166
|
+
variant?: "pill";
|
|
167
|
+
/** The money shown on the collapsed pill face, e.g. "$99.00" (pill variant only). */
|
|
168
|
+
moneyDisplay?: string;
|
|
169
|
+
/** Start the pill's 1-click card expanded instead of collapsed (pill variant only). */
|
|
170
|
+
defaultExpanded?: boolean;
|
|
171
|
+
/** How YOU (the integrator) want to be settled — never a payer choice. "stablecoin" (default)
|
|
172
|
+
* settles on-chain to `recipient`. "bank" is a roadmap rail, so the card parks with an honest
|
|
173
|
+
* coming-soon panel instead of quoting a settlement the engine cannot perform. Pill only. */
|
|
174
|
+
settlement?: SettlementMethod;
|
|
175
|
+
/** Your payout account, shown when `settlement === "bank"`. Display-only — pass a masked tail,
|
|
176
|
+
* never a full account number. Pill only. */
|
|
177
|
+
bankAccount?: BankPayoutAccount;
|
|
178
|
+
}
|
|
179
|
+
declare function StableGeniePay(props: StableGeniePayProps): react.JSX.Element;
|
|
180
|
+
|
|
181
|
+
interface StableGenieSwapProps extends StableGenieConfig {
|
|
182
|
+
defaultFromChainId?: number;
|
|
183
|
+
defaultFromAsset?: SupportedAsset;
|
|
184
|
+
defaultToChainId?: number;
|
|
185
|
+
defaultToAsset?: SupportedAsset;
|
|
186
|
+
defaultAmount?: string;
|
|
187
|
+
/** Optional explicit receiver (defaults to the payer). */
|
|
188
|
+
recipient?: string;
|
|
189
|
+
/** "pill" → ZeroDelta Link express checkout (the shared PaymentIsland). */
|
|
190
|
+
variant?: "pill";
|
|
191
|
+
}
|
|
192
|
+
declare function StableGenieSwap(props: StableGenieSwapProps): react.JSX.Element;
|
|
193
|
+
|
|
194
|
+
type MountConfig = ({
|
|
195
|
+
variant?: "pay";
|
|
196
|
+
} & Omit<StableGeniePayProps, "variant">) | ({
|
|
197
|
+
variant: "swap";
|
|
198
|
+
} & Omit<StableGenieSwapProps, "variant">) | ({
|
|
199
|
+
variant: "exchange";
|
|
200
|
+
} & Omit<StableGenieExchangeProps, "variant">);
|
|
201
|
+
/** Imperatively mount a widget into an element (for non-JSX / vanilla React hosts). Returns unmount. */
|
|
202
|
+
declare function mount(el: HTMLElement, config: MountConfig): () => void;
|
|
203
|
+
|
|
204
|
+
export { type BankPayoutAccount as B, type Eip1193Provider as E, type LinkIdentity as L, type MountConfig as M, PaymentIsland as P, type SettlementMethod as S, type ExchangeMode as a, type PaymentIslandKind as b, type PaymentIslandProps as c, type StableGenieConfig as d, StableGenieExchange as e, type StableGenieExchangeProps as f, StableGeniePay as g, type StableGeniePayProps as h, StableGenieProvider as i, StableGenieSwap as j, type StableGenieSwapProps as k, type StableGenieTheme as l, type SuccessInfo as m, type SupportedAsset as n, darkTheme as o, lightTheme as p, mount as q, resolveTheme as r };
|