@rhinestone/deposit-modal 0.19.0 → 0.20.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.
Files changed (83) hide show
  1. package/README.md +154 -61
  2. package/dist/BankOnrampStep-3SNUX6V2.cjs +435 -0
  3. package/dist/BankOnrampStep-4D24HVHV.mjs +435 -0
  4. package/dist/{DepositModalReown-UITYXJ6W.cjs → DepositModalReown-7EHOJTFW.cjs} +21 -20
  5. package/dist/{DepositModalReown-XBNY6QCI.mjs → DepositModalReown-SYQ2SCHC.mjs} +6 -5
  6. package/dist/WithdrawModal-LLJLEYXZ.cjs +12 -0
  7. package/dist/WithdrawModal-LXDIT4UV.mjs +12 -0
  8. package/dist/{bearer-transport-CVHNBgoV.d.cts → bearer-transport-DZyeDG64.d.cts} +5 -1
  9. package/dist/{bearer-transport-CVHNBgoV.d.ts → bearer-transport-DZyeDG64.d.ts} +5 -1
  10. package/dist/{caip-BMi-9t09.d.cts → caip-nwFFL46o.d.cts} +2 -2
  11. package/dist/{caip-BMi-9t09.d.ts → caip-nwFFL46o.d.ts} +2 -2
  12. package/dist/{chunk-FTWKAJGN.mjs → chunk-2FOPO4N5.mjs} +1 -1
  13. package/dist/{chunk-EG4H7OMC.cjs → chunk-CIVFT5KR.cjs} +171 -130
  14. package/dist/{chunk-PYOC6K24.cjs → chunk-D3R3O4CY.cjs} +1 -1
  15. package/dist/chunk-E7IMWVMN.mjs +346 -0
  16. package/dist/chunk-EJDBIWNH.mjs +113 -0
  17. package/dist/chunk-FKJ6EJHH.cjs +346 -0
  18. package/dist/{chunk-LVCD6RHF.cjs → chunk-FVJKUTHF.cjs} +2 -2
  19. package/dist/{chunk-NITKDXHR.mjs → chunk-FW7ZMXQS.mjs} +849 -674
  20. package/dist/chunk-G264OM23.cjs +224 -0
  21. package/dist/chunk-IPHKBBUV.cjs +113 -0
  22. package/dist/{chunk-BIL4ENC3.mjs → chunk-IPKT3FU6.mjs} +73 -32
  23. package/dist/chunk-JPX4MEHV.mjs +19 -0
  24. package/dist/{chunk-HMUGY66O.cjs → chunk-KXSU24RU.cjs} +1569 -1019
  25. package/dist/{chunk-ISLVD5HQ.cjs → chunk-LVMNNMOZ.cjs} +10 -5
  26. package/dist/chunk-O5OW4S7L.cjs +19 -0
  27. package/dist/{chunk-5NWLS5BQ.mjs → chunk-OZPMRTW3.mjs} +1511 -961
  28. package/dist/{chunk-OCWSMLOP.cjs → chunk-PVFEZ3UG.cjs} +1164 -989
  29. package/dist/{chunk-ZGHVJ2XM.mjs → chunk-YQCRXJIL.mjs} +8 -3
  30. package/dist/chunk-YY4ZOAH5.mjs +224 -0
  31. package/dist/{chunk-X6N2XPTO.mjs → chunk-ZOJMB5TZ.mjs} +1 -1
  32. package/dist/compliance.cjs +4 -7
  33. package/dist/compliance.d.cts +26 -3
  34. package/dist/compliance.d.ts +26 -3
  35. package/dist/compliance.mjs +6 -9
  36. package/dist/constants-BQDxVNgr.d.cts +29 -0
  37. package/dist/constants-DjGQW5N5.d.ts +29 -0
  38. package/dist/constants.cjs +3 -37
  39. package/dist/constants.d.cts +4 -20
  40. package/dist/constants.d.ts +4 -20
  41. package/dist/constants.mjs +4 -38
  42. package/dist/deposit.cjs +7 -6
  43. package/dist/deposit.d.cts +5 -3
  44. package/dist/deposit.d.ts +5 -3
  45. package/dist/deposit.mjs +6 -5
  46. package/dist/embed.cjs +21 -20
  47. package/dist/embed.d.cts +3 -2
  48. package/dist/embed.d.ts +3 -2
  49. package/dist/embed.mjs +7 -6
  50. package/dist/index.cjs +8 -35
  51. package/dist/index.d.cts +5 -3
  52. package/dist/index.d.ts +5 -3
  53. package/dist/index.mjs +9 -36
  54. package/dist/onramp.cjs +4 -33
  55. package/dist/onramp.d.cts +51 -33
  56. package/dist/onramp.d.ts +51 -33
  57. package/dist/onramp.mjs +5 -34
  58. package/dist/polymarket.cjs +6 -6
  59. package/dist/polymarket.mjs +2 -2
  60. package/dist/ramp-types-HYWd7CW0.d.cts +108 -0
  61. package/dist/ramp-types-HYWd7CW0.d.ts +108 -0
  62. package/dist/styles.css +255 -0
  63. package/dist/{types-BOxa1DE-.d.ts → types-BEEMfNi2.d.cts} +24 -4
  64. package/dist/{types-BShYNpvO.d.cts → types-DQDUqzsZ.d.ts} +24 -4
  65. package/dist/withdraw.cjs +6 -5
  66. package/dist/withdraw.d.cts +4 -3
  67. package/dist/withdraw.d.ts +4 -3
  68. package/dist/withdraw.mjs +5 -4
  69. package/package.json +9 -17
  70. package/dist/WithdrawModal-DY6A55OA.mjs +0 -11
  71. package/dist/WithdrawModal-V42OK7L3.cjs +0 -11
  72. package/dist/chunk-ADEWTBSN.cjs +0 -19
  73. package/dist/chunk-EAGMY3QE.mjs +0 -962
  74. package/dist/chunk-OY5N3E6L.cjs +0 -962
  75. package/dist/chunk-PP4QE32S.mjs +0 -19
  76. package/dist/constants-BT4ctuHo.d.cts +0 -64
  77. package/dist/constants-D21ZdNOP.d.ts +0 -64
  78. package/dist/offramp.cjs +0 -25
  79. package/dist/offramp.d.cts +0 -28
  80. package/dist/offramp.d.ts +0 -28
  81. package/dist/offramp.mjs +0 -25
  82. package/dist/ramp-types-C6aUz4SZ.d.cts +0 -43
  83. package/dist/ramp-types-C6aUz4SZ.d.ts +0 -43
@@ -0,0 +1,435 @@
1
+ import {
2
+ BankIcon,
3
+ BodyHeader,
4
+ CheckIcon,
5
+ CopyIcon,
6
+ Spinner,
7
+ useLatestRef
8
+ } from "./chunk-YY4ZOAH5.mjs";
9
+ import {
10
+ createOnrampService
11
+ } from "./chunk-EJDBIWNH.mjs";
12
+ import {
13
+ getComplianceStatus,
14
+ startComplianceVerification
15
+ } from "./chunk-JPX4MEHV.mjs";
16
+ import {
17
+ ScopedRequestError
18
+ } from "./chunk-YQCRXJIL.mjs";
19
+ import "./chunk-ZOJMB5TZ.mjs";
20
+
21
+ // src/components/steps/BankOnrampStep.tsx
22
+ import { useCallback, useEffect, useMemo, useRef, useState as useState2 } from "react";
23
+
24
+ // src/core/noah-hosted.ts
25
+ var NOAH_HOSTED_ORIGINS = [
26
+ "https://checkout.noah.com",
27
+ "https://checkout.sandbox.noah.com"
28
+ ];
29
+ function isTrustedNoahHostedUrl(url) {
30
+ let parsed;
31
+ try {
32
+ parsed = new URL(url);
33
+ } catch {
34
+ return false;
35
+ }
36
+ return NOAH_HOSTED_ORIGINS.includes(parsed.origin);
37
+ }
38
+ function hostedSessionRemainingMs(expiresAt, now = Date.now()) {
39
+ if (!expiresAt) return null;
40
+ const expiry = Date.parse(expiresAt);
41
+ if (!Number.isFinite(expiry)) return null;
42
+ return Math.max(0, expiry - now);
43
+ }
44
+
45
+ // src/components/steps/BankDetailsView.tsx
46
+ import { useState } from "react";
47
+ import { jsx, jsxs } from "react/jsx-runtime";
48
+ var RAILS = { BankAch: "ACH", BankFedwire: "Wire", BankSwift: "SWIFT", BankSepa: "SEPA" };
49
+ function Detail({ label, value }) {
50
+ const [copied, setCopied] = useState(false);
51
+ const [failed, setFailed] = useState(false);
52
+ if (!value) return null;
53
+ async function copy() {
54
+ try {
55
+ await navigator.clipboard.writeText(value);
56
+ setCopied(true);
57
+ setFailed(false);
58
+ } catch {
59
+ setFailed(true);
60
+ }
61
+ }
62
+ return /* @__PURE__ */ jsxs("div", { className: "rs-bank-detail", children: [
63
+ /* @__PURE__ */ jsxs("div", { className: "rs-bank-detail-text", children: [
64
+ /* @__PURE__ */ jsx("div", { className: "rs-bank-detail-label", children: label }),
65
+ /* @__PURE__ */ jsx("div", { className: "rs-bank-detail-value", children: value }),
66
+ failed && /* @__PURE__ */ jsx("span", { role: "status", className: "rs-bank-detail-label", children: "Could not copy. Select the value to copy it." })
67
+ ] }),
68
+ /* @__PURE__ */ jsx("button", { type: "button", className: "rs-bank-copy", "aria-label": `Copy ${label.toLowerCase()}`, onClick: () => void copy(), children: copied ? /* @__PURE__ */ jsx(CheckIcon, { size: 16 }) : /* @__PURE__ */ jsx(CopyIcon, { size: 16 }) })
69
+ ] });
70
+ }
71
+ function BankDetailsView({ details }) {
72
+ const [selected, setSelected] = useState(0);
73
+ const rail = details.rails[selected] ?? details.rails[0];
74
+ const address = details.bankAddress;
75
+ const bankAddress = address && [address.street, address.street2, address.city, address.state, address.postCode, address.country].filter(Boolean).join(", ");
76
+ return /* @__PURE__ */ jsxs("div", { className: "rs-bank-native", children: [
77
+ /* @__PURE__ */ jsx("div", { className: "rs-bank-rails", role: "group", "aria-label": "Transfer method", children: details.rails.map((item, index) => /* @__PURE__ */ jsx(
78
+ "button",
79
+ {
80
+ type: "button",
81
+ className: "rs-bank-rail",
82
+ "aria-pressed": index === selected,
83
+ onClick: () => setSelected(index),
84
+ children: RAILS[item.type]
85
+ },
86
+ item.type
87
+ )) }),
88
+ /* @__PURE__ */ jsxs("p", { className: "rs-bank-detail-label", children: [
89
+ "Send ",
90
+ details.currency,
91
+ " using the selected transfer method."
92
+ ] }),
93
+ /* @__PURE__ */ jsxs("div", { className: "rs-bank-fields", children: [
94
+ /* @__PURE__ */ jsx(Detail, { label: "Account holder", value: details.accountHolderName }),
95
+ /* @__PURE__ */ jsx(Detail, { label: rail.type === "BankSepa" ? "IBAN" : "Account number", value: rail.accountNumber }),
96
+ /* @__PURE__ */ jsx(Detail, { label: rail.type === "BankAch" || rail.type === "BankFedwire" ? "Routing number" : "SWIFT / BIC", value: rail.bankCode }),
97
+ /* @__PURE__ */ jsx(Detail, { label: "Bank name", value: details.bankName }),
98
+ /* @__PURE__ */ jsx(Detail, { label: "Bank address", value: bankAddress }),
99
+ /* @__PURE__ */ jsx(Detail, { label: "Payment reference", value: details.reference })
100
+ ] }, rail.type),
101
+ details.reference && /* @__PURE__ */ jsx("p", { className: "rs-bank-detail-label", children: "Include this payment reference with your transfer." }),
102
+ /* @__PURE__ */ jsxs("div", { className: "rs-bank-fee", children: [
103
+ /* @__PURE__ */ jsxs("div", { className: "rs-bank-detail-label", children: [
104
+ "Last quoted fee \xB7 ",
105
+ new Date(details.capturedAt).toLocaleDateString()
106
+ ] }),
107
+ /* @__PURE__ */ jsxs("div", { children: [
108
+ rail.fee.base,
109
+ " ",
110
+ rail.fee.currency,
111
+ " + ",
112
+ rail.fee.percent,
113
+ "% \xB7 minimum ",
114
+ rail.fee.minimum,
115
+ " ",
116
+ rail.fee.currency
117
+ ] }),
118
+ /* @__PURE__ */ jsx("p", { className: "rs-bank-detail-label", children: "Fees may change before your transfer arrives." })
119
+ ] })
120
+ ] });
121
+ }
122
+
123
+ // src/components/steps/BankOnrampStep.tsx
124
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
125
+ var SAFE_ERROR = "Bank details are unavailable. Try again.";
126
+ var PENDING_ERROR = "Bank details are not ready yet. Check back shortly.";
127
+ var OPTIONS_ERROR = "Bank transfer options are unavailable. Try again.";
128
+ var VERIFICATION_POLL_MS = 5e3;
129
+ var MAX_TIMEOUT_MS = 2147483647;
130
+ function BankOnrampStep({
131
+ backendUrl,
132
+ smartAccount,
133
+ bankOnramp,
134
+ onError,
135
+ openExternally,
136
+ onUnavailable,
137
+ onJourney
138
+ }) {
139
+ const getSessionRef = useLatestRef(bankOnramp.getSession);
140
+ const sessionOptions = useMemo(
141
+ () => ({
142
+ backendUrl,
143
+ getSession: () => getSessionRef.current(smartAccount)
144
+ }),
145
+ [backendUrl, getSessionRef, smartAccount]
146
+ );
147
+ const service = useMemo(
148
+ () => createOnrampService(sessionOptions),
149
+ [sessionOptions]
150
+ );
151
+ const [availableForHistory, setAvailableForHistory] = useState2(false);
152
+ useEffect(() => {
153
+ onJourney?.({ source: availableForHistory ? service : null });
154
+ return () => onJourney?.(null);
155
+ }, [service, onJourney, availableForHistory]);
156
+ const [noOptions, setNoOptions] = useState2(false);
157
+ const [loading, setLoading] = useState2(true);
158
+ const [selectedAccount, setSelectedAccount] = useState2(
159
+ null
160
+ );
161
+ const [hostedUrl, setHostedUrl] = useState2(null);
162
+ const [bankDetails, setBankDetails] = useState2(
163
+ null
164
+ );
165
+ const [verificationExpired, setVerificationExpired] = useState2(false);
166
+ const [verificationExpiresAt, setVerificationExpiresAt] = useState2(null);
167
+ const [iframeLoaded, setIframeLoaded] = useState2(false);
168
+ const [externalOpened, setExternalOpened] = useState2(false);
169
+ const [error, setError] = useState2(null);
170
+ const [verifying, setVerifying] = useState2(null);
171
+ const requestGenerationRef = useRef(0);
172
+ const verificationResumedRef = useRef(false);
173
+ const isCurrentRequest = useCallback(
174
+ (generation) => requestGenerationRef.current === generation,
175
+ []
176
+ );
177
+ const startVerification = useCallback(async () => {
178
+ const session = await startComplianceVerification(sessionOptions);
179
+ if (session.status === "failed") return "declined";
180
+ if (!session.nextAction) return "reviewing";
181
+ if (!isTrustedNoahHostedUrl(session.nextAction.url)) return "reviewing";
182
+ if (openExternally) {
183
+ await openExternally(session.nextAction.url);
184
+ setExternalOpened(true);
185
+ return "action_required";
186
+ }
187
+ setHostedUrl(session.nextAction.url);
188
+ setVerificationExpiresAt(session.expiresAt);
189
+ setVerificationExpired(false);
190
+ setIframeLoaded(false);
191
+ return "action_required";
192
+ }, [openExternally, sessionOptions]);
193
+ const ensureVerified = useCallback(async () => {
194
+ const current = await getComplianceStatus(sessionOptions);
195
+ if (current.status === "approved") return "approved";
196
+ if (current.status === "declined") return "declined";
197
+ return startVerification();
198
+ }, [sessionOptions, startVerification]);
199
+ const loadAccounts = useCallback(async () => {
200
+ const generation = ++requestGenerationRef.current;
201
+ setLoading(true);
202
+ setError(null);
203
+ setNoOptions(false);
204
+ try {
205
+ const discover = () => service.getOptions().catch((error2) => {
206
+ if (error2 instanceof ScopedRequestError && error2.status === 404 && onUnavailable) {
207
+ if (isCurrentRequest(generation)) onUnavailable();
208
+ return null;
209
+ }
210
+ throw error2;
211
+ });
212
+ const available = await discover();
213
+ if (!available || !isCurrentRequest(generation)) return;
214
+ setAvailableForHistory(true);
215
+ const verification = await ensureVerified();
216
+ if (!isCurrentRequest(generation)) return;
217
+ if (verification !== "approved") {
218
+ setVerifying(verification);
219
+ return;
220
+ }
221
+ setVerifying(null);
222
+ setExternalOpened(false);
223
+ const [current, existing] = await Promise.all([
224
+ discover(),
225
+ service.listAccounts()
226
+ ]);
227
+ if (!current || !isCurrentRequest(generation)) return;
228
+ const [option] = current.options;
229
+ if (!option) {
230
+ setNoOptions(true);
231
+ return;
232
+ }
233
+ void selectOptionRef.current(
234
+ option,
235
+ existing.items.find(
236
+ (account) => account.status === "active" && account.currency === option.currency
237
+ )
238
+ );
239
+ } catch {
240
+ if (!isCurrentRequest(generation)) return;
241
+ setError(OPTIONS_ERROR);
242
+ onError?.(OPTIONS_ERROR, "BANK_ONRAMP_OPTIONS_FAILED");
243
+ } finally {
244
+ if (isCurrentRequest(generation)) setLoading(false);
245
+ }
246
+ }, [ensureVerified, isCurrentRequest, onError, onUnavailable, service]);
247
+ useEffect(() => {
248
+ setSelectedAccount(null);
249
+ setBankDetails(null);
250
+ setHostedUrl(null);
251
+ setExternalOpened(false);
252
+ void loadAccounts();
253
+ return () => {
254
+ requestGenerationRef.current += 1;
255
+ };
256
+ }, [loadAccounts]);
257
+ const openDetails = useCallback(
258
+ async (account) => {
259
+ const generation = ++requestGenerationRef.current;
260
+ setLoading(true);
261
+ setError(null);
262
+ setBankDetails(null);
263
+ try {
264
+ const { bankDetails: details } = await service.getAccountDetails(
265
+ account.id
266
+ );
267
+ if (!isCurrentRequest(generation)) return;
268
+ if (details.currency !== account.currency)
269
+ throw new Error("Bank currency mismatch");
270
+ setBankDetails(details);
271
+ } catch (error2) {
272
+ if (!isCurrentRequest(generation)) return;
273
+ const pending = error2 instanceof ScopedRequestError && error2.status === 409;
274
+ const message = pending ? PENDING_ERROR : SAFE_ERROR;
275
+ setError(message);
276
+ onError?.(
277
+ message,
278
+ pending ? "BANK_ONRAMP_DETAILS_PENDING" : "BANK_ONRAMP_DETAILS_FAILED"
279
+ );
280
+ } finally {
281
+ if (isCurrentRequest(generation)) setLoading(false);
282
+ }
283
+ },
284
+ [isCurrentRequest, onError, service]
285
+ );
286
+ const selectOption = useCallback(
287
+ async (option, account) => {
288
+ if (account) {
289
+ setSelectedAccount(account);
290
+ await openDetails(account);
291
+ return;
292
+ }
293
+ const generation = ++requestGenerationRef.current;
294
+ setLoading(true);
295
+ setError(null);
296
+ try {
297
+ const request = {
298
+ currency: option.currency,
299
+ optionId: option.optionId
300
+ };
301
+ const nextAccount = (await service.createAccount(request)).account;
302
+ if (!isCurrentRequest(generation)) return;
303
+ setSelectedAccount(nextAccount);
304
+ await openDetails(nextAccount);
305
+ } catch (error2) {
306
+ if (!isCurrentRequest(generation)) return;
307
+ if (error2 instanceof ScopedRequestError && error2.status === 409 && error2.code === "VERIFICATION_REQUIRED" && !verificationResumedRef.current) {
308
+ verificationResumedRef.current = true;
309
+ try {
310
+ const verification = await startVerification();
311
+ if (!isCurrentRequest(generation)) return;
312
+ setVerifying(verification);
313
+ setLoading(false);
314
+ return;
315
+ } catch {
316
+ if (!isCurrentRequest(generation)) return;
317
+ }
318
+ }
319
+ setError(SAFE_ERROR);
320
+ onError?.(SAFE_ERROR, "BANK_ONRAMP_SETUP_FAILED");
321
+ setLoading(false);
322
+ }
323
+ },
324
+ [isCurrentRequest, onError, openDetails, service, startVerification]
325
+ );
326
+ const selectOptionRef = useLatestRef(selectOption);
327
+ useEffect(() => {
328
+ if (verifying !== "action_required" || !hostedUrl) return;
329
+ const remaining = hostedSessionRemainingMs(
330
+ verificationExpiresAt ?? void 0
331
+ );
332
+ if (remaining === null) return;
333
+ if (remaining > MAX_TIMEOUT_MS) return;
334
+ const timer = setTimeout(() => setVerificationExpired(true), remaining);
335
+ return () => clearTimeout(timer);
336
+ }, [hostedUrl, verificationExpiresAt, verifying]);
337
+ useEffect(() => {
338
+ if (verifying !== "action_required" && verifying !== "reviewing") return;
339
+ let active = true;
340
+ const timer = setInterval(() => {
341
+ void (async () => {
342
+ try {
343
+ const status = await getComplianceStatus(sessionOptions);
344
+ if (!active) return;
345
+ if (status.status === "approved") {
346
+ setHostedUrl(null);
347
+ void loadAccounts();
348
+ } else if (status.status === "declined") {
349
+ setVerifying("declined");
350
+ }
351
+ } catch {
352
+ }
353
+ })();
354
+ }, VERIFICATION_POLL_MS);
355
+ return () => {
356
+ active = false;
357
+ clearInterval(timer);
358
+ };
359
+ }, [verifying, sessionOptions, loadAccounts]);
360
+ const restartVerification = useCallback(() => {
361
+ setVerificationExpired(false);
362
+ setVerificationExpiresAt(null);
363
+ setHostedUrl(null);
364
+ void loadAccounts();
365
+ }, [loadAccounts]);
366
+ const hostedFrameMounted = Boolean(hostedUrl) && !verificationExpired;
367
+ return /* @__PURE__ */ jsx2("div", { className: "rs-screen rs-bank-onramp", children: /* @__PURE__ */ jsxs2("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
368
+ !hostedFrameMounted && /* @__PURE__ */ jsx2(
369
+ BodyHeader,
370
+ {
371
+ icon: /* @__PURE__ */ jsx2(BankIcon, {}),
372
+ title: "Bank transfer",
373
+ subtitle: "Your bank transfer details"
374
+ }
375
+ ),
376
+ loading && /* @__PURE__ */ jsxs2("div", { className: "rs-loading-state", "aria-live": "polite", children: [
377
+ /* @__PURE__ */ jsx2(Spinner, {}),
378
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-title", children: "Preparing bank details\u2026" })
379
+ ] }),
380
+ !loading && error && /* @__PURE__ */ jsx2("div", { className: "rs-loading-state", "aria-live": "polite", children: /* @__PURE__ */ jsx2("div", { className: "rs-loading-title", children: error }) }),
381
+ !loading && !error && verifying === "declined" && /* @__PURE__ */ jsxs2("div", { className: "rs-loading-state", "aria-live": "polite", children: [
382
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-title", children: "Verification unsuccessful" }),
383
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-subtitle", children: "Your provider could not verify these details. Contact support to continue." })
384
+ ] }),
385
+ !loading && !error && verifying === "reviewing" && /* @__PURE__ */ jsxs2("div", { className: "rs-loading-state", "aria-live": "polite", children: [
386
+ /* @__PURE__ */ jsx2(Spinner, {}),
387
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-title", children: "Checking your details" }),
388
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-subtitle", children: "This usually takes a moment. You can close this and come back." })
389
+ ] }),
390
+ !loading && !error && verifying === "action_required" && externalOpened && /* @__PURE__ */ jsxs2("div", { className: "rs-loading-state", "aria-live": "polite", children: [
391
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-title", children: "Verification opened" }),
392
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-subtitle", children: "Finish verifying in your browser, then return here." })
393
+ ] }),
394
+ !loading && !error && verifying === "action_required" && verificationExpired && /* @__PURE__ */ jsxs2("div", { className: "rs-loading-state", "aria-live": "polite", children: [
395
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-title", children: "Verification expired" }),
396
+ /* @__PURE__ */ jsx2("div", { className: "rs-loading-subtitle", children: "That verification session timed out. Start a new one to pick up where you left off." }),
397
+ /* @__PURE__ */ jsx2("div", { className: "rs-screen-button-row", children: /* @__PURE__ */ jsx2(
398
+ "button",
399
+ {
400
+ type: "button",
401
+ className: "rs-button rs-button--primary",
402
+ onClick: restartVerification,
403
+ children: "Start again"
404
+ }
405
+ ) })
406
+ ] }),
407
+ !loading && !error && verifying === "action_required" && !verificationExpired && hostedUrl && /* @__PURE__ */ jsxs2("div", { className: "rs-bank-onramp-hosted", children: [
408
+ !iframeLoaded && /* @__PURE__ */ jsx2(
409
+ "div",
410
+ {
411
+ className: "rs-bank-onramp-frame-loading",
412
+ "aria-live": "polite",
413
+ children: /* @__PURE__ */ jsx2(Spinner, {})
414
+ }
415
+ ),
416
+ /* @__PURE__ */ jsx2(
417
+ "iframe",
418
+ {
419
+ title: "Verify your details",
420
+ src: hostedUrl,
421
+ sandbox: "allow-forms allow-scripts allow-same-origin",
422
+ referrerPolicy: "no-referrer",
423
+ allow: "camera; microphone; clipboard-write",
424
+ onLoad: () => setIframeLoaded(true)
425
+ }
426
+ )
427
+ ] }),
428
+ !loading && !error && !verifying && noOptions && /* @__PURE__ */ jsx2("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx2("div", { className: "rs-loading-title", children: "No bank transfer options are available." }) }),
429
+ !loading && !error && !verifying && selectedAccount && bankDetails && /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(BankDetailsView, { details: bankDetails }, selectedAccount.id) })
430
+ ] }) });
431
+ }
432
+ BankOnrampStep.displayName = "BankOnrampStep";
433
+ export {
434
+ BankOnrampStep
435
+ };
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkOCWSMLOPcjs = require('./chunk-OCWSMLOP.cjs');
5
- require('./chunk-LVCD6RHF.cjs');
4
+ var _chunkPVFEZ3UGcjs = require('./chunk-PVFEZ3UG.cjs');
5
+ require('./chunk-FVJKUTHF.cjs');
6
6
 
7
7
 
8
8
 
@@ -11,12 +11,13 @@ require('./chunk-LVCD6RHF.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkHMUGY66Ocjs = require('./chunk-HMUGY66O.cjs');
14
+ var _chunkKXSU24RUcjs = require('./chunk-KXSU24RU.cjs');
15
+ require('./chunk-G264OM23.cjs');
15
16
 
16
17
 
17
18
 
18
- var _chunkOY5N3E6Lcjs = require('./chunk-OY5N3E6L.cjs');
19
- require('./chunk-PYOC6K24.cjs');
19
+ var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
20
+ require('./chunk-D3R3O4CY.cjs');
20
21
 
21
22
  // src/DepositModalReown.tsx
22
23
  var _react = require('react');
@@ -44,7 +45,7 @@ var {
44
45
  unichain,
45
46
  katana,
46
47
  hyperEvm
47
- } = _chunkOCWSMLOPcjs.getReownDependencies.call(void 0, )[1];
48
+ } = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, )[1];
48
49
  var APPKIT_NETWORK_BY_ID = {
49
50
  [mainnet.id]: mainnet,
50
51
  [optimism.id]: optimism,
@@ -61,7 +62,7 @@ var APPKIT_NETWORK_BY_ID = {
61
62
  [katana.id]: katana,
62
63
  [hyperEvm.id]: hyperEvm
63
64
  };
64
- var EVM_NETWORKS = _chunkOY5N3E6Lcjs.SUPPORTED_CHAIN_IDS.map((chainId) => {
65
+ var EVM_NETWORKS = _chunkFKJ6EJHHcjs.SUPPORTED_CHAIN_IDS.map((chainId) => {
65
66
  const network = APPKIT_NETWORK_BY_ID[chainId];
66
67
  if (!network) {
67
68
  throw new Error(
@@ -76,7 +77,7 @@ function getAppKitNetwork(chainId) {
76
77
 
77
78
  // src/core/reown-theme.ts
78
79
  function mapTheme(theme) {
79
- const themeMode = _chunkHMUGY66Ocjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
80
+ const themeMode = _chunkKXSU24RUcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
80
81
  const themeVariables = {
81
82
  "--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
82
83
  };
@@ -93,7 +94,7 @@ function setAppKitTheme(appKit, theme) {
93
94
 
94
95
  // src/core/reown.tsx
95
96
  var _jsxruntime = require('react/jsx-runtime');
96
- var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkOCWSMLOPcjs.getReownDependencies.call(void 0, );
97
+ var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, );
97
98
  var {
98
99
  createAppKit,
99
100
  useAppKit,
@@ -109,14 +110,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
109
110
  const transports = {};
110
111
  for (const network of networks) {
111
112
  const id = Number(network.id);
112
- transports[id] = _viem.http.call(void 0, _chunkHMUGY66Ocjs.rpcUrlFor.call(void 0, rpcUrls, id));
113
+ transports[id] = _viem.http.call(void 0, _chunkKXSU24RUcjs.rpcUrlFor.call(void 0, rpcUrls, id));
113
114
  }
114
115
  return transports;
115
116
  }
116
117
  function getEvmRpcFingerprint(rpcUrls, networks) {
117
118
  return networks.map((network) => {
118
119
  const id = Number(network.id);
119
- return `${id}=${_nullishCoalesce(_chunkHMUGY66Ocjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
120
+ return `${id}=${_nullishCoalesce(_chunkKXSU24RUcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
120
121
  }).join("|");
121
122
  }
122
123
  var cachedAdapter = null;
@@ -174,7 +175,7 @@ function getOrCreateAdapter(projectId, enableSolana, theme, rpcUrls, runtimeChai
174
175
  function chainDisplayName(chainId) {
175
176
  const runtime = runtimeNetworkById.get(chainId);
176
177
  if (runtime) return runtime.name;
177
- return _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId);
178
+ return _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId);
178
179
  }
179
180
  function resolveAppKitNetwork(chainId) {
180
181
  return _nullishCoalesce(getAppKitNetwork(chainId), () => ( runtimeNetworkById.get(chainId)));
@@ -187,7 +188,7 @@ function ReownWalletProvider({
187
188
  backendUrl,
188
189
  children
189
190
  }) {
190
- const rpcUrls = _chunkHMUGY66Ocjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
191
+ const rpcUrls = _chunkKXSU24RUcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
191
192
  const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
192
193
  const overrides = _react.useMemo.call(void 0, () => {
193
194
  if (!rpcUrls) return void 0;
@@ -199,14 +200,14 @@ function ReownWalletProvider({
199
200
  return out;
200
201
  }, [rpcUrls]);
201
202
  const [state, setState] = _react.useState.call(void 0, () => {
202
- const primed = _chunkHMUGY66Ocjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
203
+ const primed = _chunkKXSU24RUcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
203
204
  return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
204
205
  });
205
206
  _react.useEffect.call(void 0, () => {
206
207
  let active = true;
207
- const primed = _chunkHMUGY66Ocjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
208
+ const primed = _chunkKXSU24RUcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
208
209
  setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
209
- _chunkHMUGY66Ocjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
210
+ _chunkKXSU24RUcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
210
211
  if (active) setState({ ready: true, chains });
211
212
  });
212
213
  return () => {
@@ -215,7 +216,7 @@ function ReownWalletProvider({
215
216
  }, [backendUrl, overrides]);
216
217
  _react.useEffect.call(void 0, () => {
217
218
  setAppKitTheme(appKitReact.modal, theme);
218
- return _chunkHMUGY66Ocjs.followSystemAppearance.call(void 0,
219
+ return _chunkKXSU24RUcjs.followSystemAppearance.call(void 0,
219
220
  _optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
220
221
  () => setAppKitTheme(appKitReact.modal, theme)
221
222
  );
@@ -279,7 +280,7 @@ function useReownWalletSession() {
279
280
  await switchChainAsync({ chainId });
280
281
  }
281
282
  } catch (err) {
282
- if (_chunkHMUGY66Ocjs.isUnsupportedChainSwitchError.call(void 0, err)) {
283
+ if (_chunkKXSU24RUcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
283
284
  throw new Error(
284
285
  `Switch to ${chainDisplayName(chainId)} in your wallet to continue`
285
286
  );
@@ -292,7 +293,7 @@ function useReownWalletSession() {
292
293
 
293
294
  // src/DepositModalReown.tsx
294
295
 
295
- var [appKitReact2, , , , solanaAdapterReact] = _chunkOCWSMLOPcjs.getReownDependencies.call(void 0, );
296
+ var [appKitReact2, , , , solanaAdapterReact] = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, );
296
297
  var { useAppKitProvider } = appKitReact2;
297
298
  var { useAppKitConnection } = solanaAdapterReact;
298
299
  function DepositModalWithReown(props) {
@@ -314,7 +315,7 @@ function DepositModalWithReown(props) {
314
315
  reown.disconnect();
315
316
  }, [reown.disconnect]);
316
317
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
317
- _chunkOCWSMLOPcjs.DepositModalInner,
318
+ _chunkPVFEZ3UGcjs.DepositModalInner,
318
319
  {
319
320
  ...props,
320
321
  walletSession: reownWithSolana,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  DepositModalInner,
3
3
  getReownDependencies
4
- } from "./chunk-NITKDXHR.mjs";
5
- import "./chunk-FTWKAJGN.mjs";
4
+ } from "./chunk-FW7ZMXQS.mjs";
5
+ import "./chunk-2FOPO4N5.mjs";
6
6
  import {
7
7
  followSystemAppearance,
8
8
  isUnsupportedChainSwitchError,
@@ -11,12 +11,13 @@ import {
11
11
  resolveThemeMode,
12
12
  rpcUrlFor,
13
13
  useStableRpcUrls
14
- } from "./chunk-5NWLS5BQ.mjs";
14
+ } from "./chunk-OZPMRTW3.mjs";
15
+ import "./chunk-YY4ZOAH5.mjs";
15
16
  import {
16
17
  SUPPORTED_CHAIN_IDS,
17
18
  getChainName
18
- } from "./chunk-EAGMY3QE.mjs";
19
- import "./chunk-X6N2XPTO.mjs";
19
+ } from "./chunk-E7IMWVMN.mjs";
20
+ import "./chunk-ZOJMB5TZ.mjs";
20
21
 
21
22
  // src/DepositModalReown.tsx
22
23
  import { useCallback, useMemo as useMemo2 } from "react";
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkCIVFT5KRcjs = require('./chunk-CIVFT5KR.cjs');
5
+ require('./chunk-KXSU24RU.cjs');
6
+ require('./chunk-G264OM23.cjs');
7
+ require('./chunk-FKJ6EJHH.cjs');
8
+ require('./chunk-D3R3O4CY.cjs');
9
+
10
+
11
+
12
+ exports.WithdrawModal = _chunkCIVFT5KRcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkCIVFT5KRcjs.buildWithdrawAnalyticsSessionProperties;
@@ -0,0 +1,12 @@
1
+ import {
2
+ WithdrawModal,
3
+ buildWithdrawAnalyticsSessionProperties
4
+ } from "./chunk-IPKT3FU6.mjs";
5
+ import "./chunk-OZPMRTW3.mjs";
6
+ import "./chunk-YY4ZOAH5.mjs";
7
+ import "./chunk-E7IMWVMN.mjs";
8
+ import "./chunk-ZOJMB5TZ.mjs";
9
+ export {
10
+ WithdrawModal,
11
+ buildWithdrawAnalyticsSessionProperties
12
+ };
@@ -8,7 +8,11 @@ interface CustomerSessionOptions {
8
8
  }
9
9
  declare class ScopedRequestError extends Error {
10
10
  readonly status: number;
11
- constructor(status: number);
11
+ /** Machine-readable refusal from the error body, e.g. `VERIFICATION_REQUIRED`. */
12
+ readonly code?: string | undefined;
13
+ constructor(status: number,
14
+ /** Machine-readable refusal from the error body, e.g. `VERIFICATION_REQUIRED`. */
15
+ code?: string | undefined);
12
16
  }
13
17
 
14
18
  export { type CustomerSessionOptions as C, ScopedRequestError as S, type CustomerSession as a };
@@ -8,7 +8,11 @@ interface CustomerSessionOptions {
8
8
  }
9
9
  declare class ScopedRequestError extends Error {
10
10
  readonly status: number;
11
- constructor(status: number);
11
+ /** Machine-readable refusal from the error body, e.g. `VERIFICATION_REQUIRED`. */
12
+ readonly code?: string | undefined;
13
+ constructor(status: number,
14
+ /** Machine-readable refusal from the error body, e.g. `VERIFICATION_REQUIRED`. */
15
+ code?: string | undefined);
12
16
  }
13
17
 
14
18
  export { type CustomerSessionOptions as C, ScopedRequestError as S, type CustomerSession as a };
@@ -3,8 +3,8 @@
3
3
  * is USDC-only and requires an EOA recipient. It has no node of its own and
4
4
  * must never be used as an EVM RPC target.
5
5
  *
6
- * 1337 is the modal's INTERNAL key for HyperCore in the bundled registry, the
7
- * display tables and the icon map, shared by the source and destination paths.
6
+ * 1337 is the modal's INTERNAL key for HyperCore in the display tables and the
7
+ * icon map, shared by the source and destination paths.
8
8
  * It is not a chain id anyone can dial and it never reaches the backend —
9
9
  * `targetChainToCaip2` is the only thing that answers what does.
10
10
  *