@rhinestone/deposit-modal 0.20.1 → 0.21.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.
Files changed (53) hide show
  1. package/README.md +42 -17
  2. package/dist/{BankOnrampStep-4D24HVHV.mjs → BankOnrampStep-JTU7WS5R.mjs} +22 -12
  3. package/dist/{BankOnrampStep-3SNUX6V2.cjs → BankOnrampStep-QCPISCAQ.cjs} +34 -24
  4. package/dist/{DepositModalReown-SYQ2SCHC.mjs → DepositModalReown-FJBSF4VL.mjs} +5 -3
  5. package/dist/{DepositModalReown-7EHOJTFW.cjs → DepositModalReown-QJ6O2FWY.cjs} +18 -16
  6. package/dist/{WithdrawModal-LXDIT4UV.mjs → WithdrawModal-CB7RNEPI.mjs} +3 -3
  7. package/dist/WithdrawModal-E2BTWJV7.cjs +12 -0
  8. package/dist/{chunk-ZOJMB5TZ.mjs → chunk-2D3J53PX.mjs} +1 -1
  9. package/dist/{chunk-KXSU24RU.cjs → chunk-4O2UGFFT.cjs} +71 -62
  10. package/dist/{chunk-IPKT3FU6.mjs → chunk-7CHQA2OZ.mjs} +1 -1
  11. package/dist/chunk-ADEWTBSN.cjs +19 -0
  12. package/dist/{chunk-O5OW4S7L.cjs → chunk-AV3SA7TW.cjs} +3 -3
  13. package/dist/{chunk-FW7ZMXQS.mjs → chunk-B2LUWNFX.mjs} +179 -96
  14. package/dist/{chunk-PVFEZ3UG.cjs → chunk-CAIRS4LK.cjs} +449 -366
  15. package/dist/{chunk-LVMNNMOZ.cjs → chunk-CG3JKPUF.cjs} +2 -2
  16. package/dist/{chunk-JPX4MEHV.mjs → chunk-CXEQFRX4.mjs} +1 -1
  17. package/dist/chunk-PP4QE32S.mjs +19 -0
  18. package/dist/{chunk-YQCRXJIL.mjs → chunk-PZIKRYMO.mjs} +1 -1
  19. package/dist/{chunk-CIVFT5KR.cjs → chunk-U7NYYT4Q.cjs} +58 -58
  20. package/dist/{chunk-OZPMRTW3.mjs → chunk-UNXUOV3F.mjs} +39 -30
  21. package/dist/{chunk-D3R3O4CY.cjs → chunk-VQAV6ESI.cjs} +1 -1
  22. package/dist/{chunk-EJDBIWNH.mjs → chunk-WK2ELRL3.mjs} +5 -16
  23. package/dist/{chunk-IPHKBBUV.cjs → chunk-X425VJFY.cjs} +10 -21
  24. package/dist/compliance.cjs +4 -4
  25. package/dist/compliance.mjs +3 -3
  26. package/dist/constants.cjs +2 -2
  27. package/dist/constants.d.cts +1 -1
  28. package/dist/constants.d.ts +1 -1
  29. package/dist/constants.mjs +1 -1
  30. package/dist/deposit.cjs +6 -4
  31. package/dist/deposit.d.cts +2 -2
  32. package/dist/deposit.d.ts +2 -2
  33. package/dist/deposit.mjs +5 -3
  34. package/dist/embed.cjs +16 -14
  35. package/dist/embed.d.cts +1 -1
  36. package/dist/embed.d.ts +1 -1
  37. package/dist/embed.mjs +6 -4
  38. package/dist/index.cjs +7 -5
  39. package/dist/index.d.cts +1 -1
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.mjs +6 -4
  42. package/dist/onramp.cjs +5 -4
  43. package/dist/onramp.mjs +4 -3
  44. package/dist/server.cjs +12 -8
  45. package/dist/server.mjs +11 -7
  46. package/dist/{types-BEEMfNi2.d.cts → types-BrxDZNEr.d.cts} +20 -10
  47. package/dist/{types-DQDUqzsZ.d.ts → types-DCUB4DY8.d.ts} +20 -10
  48. package/dist/withdraw.cjs +4 -4
  49. package/dist/withdraw.d.cts +2 -2
  50. package/dist/withdraw.d.ts +2 -2
  51. package/dist/withdraw.mjs +3 -3
  52. package/package.json +3 -3
  53. package/dist/WithdrawModal-LLJLEYXZ.cjs +0 -12
package/README.md CHANGED
@@ -338,7 +338,7 @@ frame-src https://widget.swapped.com https://sandbox.swapped.com https://connect
338
338
  ### Bank transfer accounts (Noah)
339
339
 
340
340
  > **Preview.** Your proxy must forward these on the customer bearer before you ship
341
- > a modal with `bankOnramp`: `GET /compliance/status`, `POST /compliance/verification`,
341
+ > a modal with `virtualAccountOnramp` and `getCustomerSession`: `GET /compliance/status`, `POST /compliance/verification`,
342
342
  > `GET /onramp/options`, `POST`/`GET /onramp/accounts`,
343
343
  > `GET /onramp/accounts/:id[/details]` and `GET /onramp/orders[/:id]`. A missing one
344
344
  > 404s at the proxy. [`deposit-widget-proxy`](https://github.com/rhinestonewtf/deposit-widget-proxy)
@@ -347,7 +347,7 @@ frame-src https://widget.swapped.com https://sandbox.swapped.com https://connect
347
347
  > The prop is opt-in and inert unless you pass it. Treat it as unstable until
348
348
  > this note is removed.
349
349
 
350
- Pass `bankOnramp` to use reusable USD/EUR account details when Noah is provisioned
350
+ Pass `virtualAccountOnramp` to use reusable USD/EUR account details when Noah is provisioned
351
351
  for your organization. Integrator KYB happens directly with Noah; Rhinestone
352
352
  enables provisioning after Noah confirms it. Card and Apple Pay continue through Swapped. A customer who has
353
353
  not been verified is taken through hosted verification first; an existing active
@@ -366,16 +366,21 @@ either, the customer returns to the Cash methods with a notice and the row hidde
366
366
  A successful response keeps Noah exclusive, even when no currencies are available.
367
367
  Authentication and service errors show a retry instead of switching providers.
368
368
 
369
- Bank transfers appear in History, including transfers that never become chain
370
- deposits. The History icon stays available during Noah verification and bank details;
369
+ With `getCustomerSession`, History lists the deposit account's bank, card and
370
+ exchange orders, including payments that never become chain deposits. It asks for
371
+ a **resume-only** session (`{ resumeOnly: true }`), so viewing History never creates
372
+ a customer or binds the account; until the user has set up bank transfer for this
373
+ account there is no customer, and History shows deposits only. Card or exchange
374
+ checkouts that never took payment are not listed.
375
+ The History icon stays available during Noah verification and bank details;
371
376
  new activity adds a dot without navigating away.
372
- Opening History acknowledges that activity and clears the bank notification;
373
- only a subsequent new transfer or stage change adds it again.
374
- After entering the bank journey, History refreshes `GET /onramp/orders?provider=noah` every 30 seconds while the modal
377
+ Opening History acknowledges that activity and clears the notification;
378
+ only a subsequent new order or stage change adds it again.
379
+ History refreshes `GET /onramp/orders` every 30 seconds while the modal
375
380
  is open and visible, and on focus or opening History. Discovery continues after a
376
- transfer finishes so the next one is detected. A linked deposit shares the entry
381
+ payment finishes so the next one is detected. A linked deposit shares the entry
377
382
  and shows final settlement separately from the provider's delivery.
378
- Each bank-transfer entry shows its amount, date and latest status rather than
383
+ Each entry shows its amount, date and latest status rather than
379
384
  individual provider stages. "Settled" means crypto reached the deposit account;
380
385
  "Completed" requires the linked deposit's final settlement to complete.
381
386
  Expanded fiat entries use the same explorer links as crypto History: the
@@ -384,18 +389,38 @@ chain. No on-chain link is shown for a fiat-only or sub-fee transfer.
384
389
 
385
390
  ```tsx
386
391
  <DepositModal
387
- bankOnramp={{
388
- supportUrl: "https://your-app.example/support", // Optional bank-transfer help.
389
- getSession: (smartAccount) =>
390
- authenticatedSessionClient.getCustomerSession({ smartAccount }),
392
+ virtualAccountOnramp={{ supportUrl: "https://your-app.example/support" }} // Optional help link.
393
+ getCustomerSession={async (smartAccount, options) => {
394
+ const response = await fetch("/api/customer-session", {
395
+ method: "POST",
396
+ credentials: "same-origin",
397
+ // Forward `options`: History's `resumeOnly` keeps it from binding the account.
398
+ body: JSON.stringify({ smartAccount, ...options }),
399
+ });
400
+ // Keep the refusal's code, so the modal can explain it.
401
+ if (!response.ok) {
402
+ const { code } = await response.json().catch(() => ({}));
403
+ throw Object.assign(new Error("Customer session unavailable"), { code });
404
+ }
405
+ return response.json();
391
406
  }}
392
407
  // ...
393
408
  />
394
409
  ```
395
410
 
396
- `getSession` must call your authenticated server endpoint, which mints a
397
- short-lived customer session with `createCustomerSessionHandler`. It is called
398
- for every request; do not put the Rhinestone API key in the browser.
411
+ `getCustomerSession` must call your authenticated server endpoint, which mints a
412
+ short-lived customer session with `createCustomerSessionHandler`, which reads
413
+ `resumeOnly` from the request body and forwards it. It is called
414
+ for every request; do not put the Rhinestone API key in the browser. Bank
415
+ transfer through virtual accounts requires it: without `getCustomerSession`,
416
+ `virtualAccountOnramp` is ignored (with one console warning). Card and exchange
417
+ never depend on the session. A session that throws, is malformed or is refused
418
+ is an error on the bank step, with the back chevron; it never switches provider.
419
+ The only hand-over to Swapped's bank transfer is the processor's "not served"
420
+ for the customer (or a project without virtual accounts). A refusal with
421
+ `ACCOUNT_CHANGE_REQUIRES_MIGRATION` (the user's deposit account changed after
422
+ verification) says bank transfer is unavailable for this account instead of
423
+ offering a retry.
399
424
 
400
425
  Bank instructions render inside the modal from `GET /onramp/accounts/:id/details`
401
426
  on the customer bearer: separate transfer rails (SWIFT, ACH, Wire, SEPA), copy
@@ -406,7 +431,7 @@ application. A `409` means the account predates snapshot capture and the
406
431
  processor backfill has not run; the customer is told to check back. Only identity
407
432
  verification uses Noah's hosted page.
408
433
 
409
- `bankOnramp` enables Cash when `fiatMethods` is omitted. When an exact
434
+ `virtualAccountOnramp` enables Cash when `fiatMethods` is omitted. When an exact
410
435
  `fiatMethods` subset is provided, it must include
411
436
  `{ "bank-transfer": true }`. The proxy must forward the `/onramp/options`,
412
437
  `/onramp/accounts` and `/onramp/orders` customer routes with the bearer token
@@ -8,15 +8,16 @@ import {
8
8
  } from "./chunk-YY4ZOAH5.mjs";
9
9
  import {
10
10
  createOnrampService
11
- } from "./chunk-EJDBIWNH.mjs";
11
+ } from "./chunk-WK2ELRL3.mjs";
12
+ import "./chunk-PP4QE32S.mjs";
12
13
  import {
13
14
  getComplianceStatus,
14
15
  startComplianceVerification
15
- } from "./chunk-JPX4MEHV.mjs";
16
+ } from "./chunk-CXEQFRX4.mjs";
16
17
  import {
17
18
  ScopedRequestError
18
- } from "./chunk-YQCRXJIL.mjs";
19
- import "./chunk-ZOJMB5TZ.mjs";
19
+ } from "./chunk-PZIKRYMO.mjs";
20
+ import "./chunk-2D3J53PX.mjs";
20
21
 
21
22
  // src/components/steps/BankOnrampStep.tsx
22
23
  import { useCallback, useEffect, useMemo, useRef, useState as useState2 } from "react";
@@ -125,18 +126,23 @@ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
125
126
  var SAFE_ERROR = "Bank details are unavailable. Try again.";
126
127
  var PENDING_ERROR = "Bank details are not ready yet. Check back shortly.";
127
128
  var OPTIONS_ERROR = "Bank transfer options are unavailable. Try again.";
129
+ var ACCOUNT_ERROR = "Bank transfer isn't available for this account.";
130
+ var SESSION_REFUSALS = /* @__PURE__ */ new Set([
131
+ "ACCOUNT_CHANGE_REQUIRES_MIGRATION",
132
+ "ACCOUNT_ALREADY_LINKED"
133
+ ]);
128
134
  var VERIFICATION_POLL_MS = 5e3;
129
135
  var MAX_TIMEOUT_MS = 2147483647;
130
136
  function BankOnrampStep({
131
137
  backendUrl,
132
138
  smartAccount,
133
- bankOnramp,
139
+ getCustomerSession,
134
140
  onError,
135
141
  openExternally,
136
142
  onUnavailable,
137
143
  onJourney
138
144
  }) {
139
- const getSessionRef = useLatestRef(bankOnramp.getSession);
145
+ const getSessionRef = useLatestRef(getCustomerSession);
140
146
  const sessionOptions = useMemo(
141
147
  () => ({
142
148
  backendUrl,
@@ -148,11 +154,10 @@ function BankOnrampStep({
148
154
  () => createOnrampService(sessionOptions),
149
155
  [sessionOptions]
150
156
  );
151
- const [availableForHistory, setAvailableForHistory] = useState2(false);
152
157
  useEffect(() => {
153
- onJourney?.({ source: availableForHistory ? service : null });
154
- return () => onJourney?.(null);
155
- }, [service, onJourney, availableForHistory]);
158
+ onJourney?.(true);
159
+ return () => onJourney?.(false);
160
+ }, [onJourney]);
156
161
  const [noOptions, setNoOptions] = useState2(false);
157
162
  const [loading, setLoading] = useState2(true);
158
163
  const [selectedAccount, setSelectedAccount] = useState2(
@@ -211,7 +216,6 @@ function BankOnrampStep({
211
216
  });
212
217
  const available = await discover();
213
218
  if (!available || !isCurrentRequest(generation)) return;
214
- setAvailableForHistory(true);
215
219
  const verification = await ensureVerified();
216
220
  if (!isCurrentRequest(generation)) return;
217
221
  if (verification !== "approved") {
@@ -236,8 +240,14 @@ function BankOnrampStep({
236
240
  (account) => account.status === "active" && account.currency === option.currency
237
241
  )
238
242
  );
239
- } catch {
243
+ } catch (error2) {
240
244
  if (!isCurrentRequest(generation)) return;
245
+ const code = error2?.code;
246
+ if (typeof code === "string" && SESSION_REFUSALS.has(code)) {
247
+ setError(ACCOUNT_ERROR);
248
+ onError?.(ACCOUNT_ERROR, "BANK_ONRAMP_SESSION_REFUSED");
249
+ return;
250
+ }
241
251
  setError(OPTIONS_ERROR);
242
252
  onError?.(OPTIONS_ERROR, "BANK_ONRAMP_OPTIONS_FAILED");
243
253
  } finally {
@@ -8,15 +8,16 @@
8
8
  var _chunkG264OM23cjs = require('./chunk-G264OM23.cjs');
9
9
 
10
10
 
11
- var _chunkIPHKBBUVcjs = require('./chunk-IPHKBBUV.cjs');
11
+ var _chunkX425VJFYcjs = require('./chunk-X425VJFY.cjs');
12
+ require('./chunk-ADEWTBSN.cjs');
12
13
 
13
14
 
14
15
 
15
- var _chunkO5OW4S7Lcjs = require('./chunk-O5OW4S7L.cjs');
16
+ var _chunkAV3SA7TWcjs = require('./chunk-AV3SA7TW.cjs');
16
17
 
17
18
 
18
- var _chunkLVMNNMOZcjs = require('./chunk-LVMNNMOZ.cjs');
19
- require('./chunk-D3R3O4CY.cjs');
19
+ var _chunkCG3JKPUFcjs = require('./chunk-CG3JKPUF.cjs');
20
+ require('./chunk-VQAV6ESI.cjs');
20
21
 
21
22
  // src/components/steps/BankOnrampStep.tsx
22
23
  var _react = require('react');
@@ -125,18 +126,23 @@ function BankDetailsView({ details }) {
125
126
  var SAFE_ERROR = "Bank details are unavailable. Try again.";
126
127
  var PENDING_ERROR = "Bank details are not ready yet. Check back shortly.";
127
128
  var OPTIONS_ERROR = "Bank transfer options are unavailable. Try again.";
129
+ var ACCOUNT_ERROR = "Bank transfer isn't available for this account.";
130
+ var SESSION_REFUSALS = /* @__PURE__ */ new Set([
131
+ "ACCOUNT_CHANGE_REQUIRES_MIGRATION",
132
+ "ACCOUNT_ALREADY_LINKED"
133
+ ]);
128
134
  var VERIFICATION_POLL_MS = 5e3;
129
135
  var MAX_TIMEOUT_MS = 2147483647;
130
136
  function BankOnrampStep({
131
137
  backendUrl,
132
138
  smartAccount,
133
- bankOnramp,
139
+ getCustomerSession,
134
140
  onError,
135
141
  openExternally,
136
142
  onUnavailable,
137
143
  onJourney
138
144
  }) {
139
- const getSessionRef = _chunkG264OM23cjs.useLatestRef.call(void 0, bankOnramp.getSession);
145
+ const getSessionRef = _chunkG264OM23cjs.useLatestRef.call(void 0, getCustomerSession);
140
146
  const sessionOptions = _react.useMemo.call(void 0,
141
147
  () => ({
142
148
  backendUrl,
@@ -145,14 +151,13 @@ function BankOnrampStep({
145
151
  [backendUrl, getSessionRef, smartAccount]
146
152
  );
147
153
  const service = _react.useMemo.call(void 0,
148
- () => _chunkIPHKBBUVcjs.createOnrampService.call(void 0, sessionOptions),
154
+ () => _chunkX425VJFYcjs.createOnrampService.call(void 0, sessionOptions),
149
155
  [sessionOptions]
150
156
  );
151
- const [availableForHistory, setAvailableForHistory] = _react.useState.call(void 0, false);
152
157
  _react.useEffect.call(void 0, () => {
153
- _optionalChain([onJourney, 'optionalCall', _ => _({ source: availableForHistory ? service : null })]);
154
- return () => _optionalChain([onJourney, 'optionalCall', _2 => _2(null)]);
155
- }, [service, onJourney, availableForHistory]);
158
+ _optionalChain([onJourney, 'optionalCall', _ => _(true)]);
159
+ return () => _optionalChain([onJourney, 'optionalCall', _2 => _2(false)]);
160
+ }, [onJourney]);
156
161
  const [noOptions, setNoOptions] = _react.useState.call(void 0, false);
157
162
  const [loading, setLoading] = _react.useState.call(void 0, true);
158
163
  const [selectedAccount, setSelectedAccount] = _react.useState.call(void 0,
@@ -175,7 +180,7 @@ function BankOnrampStep({
175
180
  []
176
181
  );
177
182
  const startVerification = _react.useCallback.call(void 0, async () => {
178
- const session = await _chunkO5OW4S7Lcjs.startComplianceVerification.call(void 0, sessionOptions);
183
+ const session = await _chunkAV3SA7TWcjs.startComplianceVerification.call(void 0, sessionOptions);
179
184
  if (session.status === "failed") return "declined";
180
185
  if (!session.nextAction) return "reviewing";
181
186
  if (!isTrustedNoahHostedUrl(session.nextAction.url)) return "reviewing";
@@ -191,7 +196,7 @@ function BankOnrampStep({
191
196
  return "action_required";
192
197
  }, [openExternally, sessionOptions]);
193
198
  const ensureVerified = _react.useCallback.call(void 0, async () => {
194
- const current = await _chunkO5OW4S7Lcjs.getComplianceStatus.call(void 0, sessionOptions);
199
+ const current = await _chunkAV3SA7TWcjs.getComplianceStatus.call(void 0, sessionOptions);
195
200
  if (current.status === "approved") return "approved";
196
201
  if (current.status === "declined") return "declined";
197
202
  return startVerification();
@@ -203,7 +208,7 @@ function BankOnrampStep({
203
208
  setNoOptions(false);
204
209
  try {
205
210
  const discover = () => service.getOptions().catch((error2) => {
206
- if (error2 instanceof _chunkLVMNNMOZcjs.ScopedRequestError && error2.status === 404 && onUnavailable) {
211
+ if (error2 instanceof _chunkCG3JKPUFcjs.ScopedRequestError && error2.status === 404 && onUnavailable) {
207
212
  if (isCurrentRequest(generation)) onUnavailable();
208
213
  return null;
209
214
  }
@@ -211,7 +216,6 @@ function BankOnrampStep({
211
216
  });
212
217
  const available = await discover();
213
218
  if (!available || !isCurrentRequest(generation)) return;
214
- setAvailableForHistory(true);
215
219
  const verification = await ensureVerified();
216
220
  if (!isCurrentRequest(generation)) return;
217
221
  if (verification !== "approved") {
@@ -236,10 +240,16 @@ function BankOnrampStep({
236
240
  (account) => account.status === "active" && account.currency === option.currency
237
241
  )
238
242
  );
239
- } catch (e3) {
243
+ } catch (error2) {
240
244
  if (!isCurrentRequest(generation)) return;
245
+ const code = _optionalChain([error2, 'optionalAccess', _3 => _3.code]);
246
+ if (typeof code === "string" && SESSION_REFUSALS.has(code)) {
247
+ setError(ACCOUNT_ERROR);
248
+ _optionalChain([onError, 'optionalCall', _4 => _4(ACCOUNT_ERROR, "BANK_ONRAMP_SESSION_REFUSED")]);
249
+ return;
250
+ }
241
251
  setError(OPTIONS_ERROR);
242
- _optionalChain([onError, 'optionalCall', _3 => _3(OPTIONS_ERROR, "BANK_ONRAMP_OPTIONS_FAILED")]);
252
+ _optionalChain([onError, 'optionalCall', _5 => _5(OPTIONS_ERROR, "BANK_ONRAMP_OPTIONS_FAILED")]);
243
253
  } finally {
244
254
  if (isCurrentRequest(generation)) setLoading(false);
245
255
  }
@@ -270,10 +280,10 @@ function BankOnrampStep({
270
280
  setBankDetails(details);
271
281
  } catch (error2) {
272
282
  if (!isCurrentRequest(generation)) return;
273
- const pending = error2 instanceof _chunkLVMNNMOZcjs.ScopedRequestError && error2.status === 409;
283
+ const pending = error2 instanceof _chunkCG3JKPUFcjs.ScopedRequestError && error2.status === 409;
274
284
  const message = pending ? PENDING_ERROR : SAFE_ERROR;
275
285
  setError(message);
276
- _optionalChain([onError, 'optionalCall', _4 => _4(
286
+ _optionalChain([onError, 'optionalCall', _6 => _6(
277
287
  message,
278
288
  pending ? "BANK_ONRAMP_DETAILS_PENDING" : "BANK_ONRAMP_DETAILS_FAILED"
279
289
  )]);
@@ -304,7 +314,7 @@ function BankOnrampStep({
304
314
  await openDetails(nextAccount);
305
315
  } catch (error2) {
306
316
  if (!isCurrentRequest(generation)) return;
307
- if (error2 instanceof _chunkLVMNNMOZcjs.ScopedRequestError && error2.status === 409 && error2.code === "VERIFICATION_REQUIRED" && !verificationResumedRef.current) {
317
+ if (error2 instanceof _chunkCG3JKPUFcjs.ScopedRequestError && error2.status === 409 && error2.code === "VERIFICATION_REQUIRED" && !verificationResumedRef.current) {
308
318
  verificationResumedRef.current = true;
309
319
  try {
310
320
  const verification = await startVerification();
@@ -312,12 +322,12 @@ function BankOnrampStep({
312
322
  setVerifying(verification);
313
323
  setLoading(false);
314
324
  return;
315
- } catch (e4) {
325
+ } catch (e3) {
316
326
  if (!isCurrentRequest(generation)) return;
317
327
  }
318
328
  }
319
329
  setError(SAFE_ERROR);
320
- _optionalChain([onError, 'optionalCall', _5 => _5(SAFE_ERROR, "BANK_ONRAMP_SETUP_FAILED")]);
330
+ _optionalChain([onError, 'optionalCall', _7 => _7(SAFE_ERROR, "BANK_ONRAMP_SETUP_FAILED")]);
321
331
  setLoading(false);
322
332
  }
323
333
  },
@@ -340,7 +350,7 @@ function BankOnrampStep({
340
350
  const timer = setInterval(() => {
341
351
  void (async () => {
342
352
  try {
343
- const status = await _chunkO5OW4S7Lcjs.getComplianceStatus.call(void 0, sessionOptions);
353
+ const status = await _chunkAV3SA7TWcjs.getComplianceStatus.call(void 0, sessionOptions);
344
354
  if (!active) return;
345
355
  if (status.status === "approved") {
346
356
  setHostedUrl(null);
@@ -348,7 +358,7 @@ function BankOnrampStep({
348
358
  } else if (status.status === "declined") {
349
359
  setVerifying("declined");
350
360
  }
351
- } catch (e5) {
361
+ } catch (e4) {
352
362
  }
353
363
  })();
354
364
  }, VERIFICATION_POLL_MS);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DepositModalInner,
3
3
  getReownDependencies
4
- } from "./chunk-FW7ZMXQS.mjs";
4
+ } from "./chunk-B2LUWNFX.mjs";
5
5
  import "./chunk-2FOPO4N5.mjs";
6
6
  import {
7
7
  followSystemAppearance,
@@ -11,13 +11,15 @@ import {
11
11
  resolveThemeMode,
12
12
  rpcUrlFor,
13
13
  useStableRpcUrls
14
- } from "./chunk-OZPMRTW3.mjs";
14
+ } from "./chunk-UNXUOV3F.mjs";
15
15
  import "./chunk-YY4ZOAH5.mjs";
16
+ import "./chunk-PP4QE32S.mjs";
17
+ import "./chunk-PZIKRYMO.mjs";
16
18
  import {
17
19
  SUPPORTED_CHAIN_IDS,
18
20
  getChainName
19
21
  } from "./chunk-E7IMWVMN.mjs";
20
- import "./chunk-ZOJMB5TZ.mjs";
22
+ import "./chunk-2D3J53PX.mjs";
21
23
 
22
24
  // src/DepositModalReown.tsx
23
25
  import { useCallback, useMemo as useMemo2 } from "react";
@@ -1,7 +1,7 @@
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 _chunkPVFEZ3UGcjs = require('./chunk-PVFEZ3UG.cjs');
4
+ var _chunkCAIRS4LKcjs = require('./chunk-CAIRS4LK.cjs');
5
5
  require('./chunk-FVJKUTHF.cjs');
6
6
 
7
7
 
@@ -11,13 +11,15 @@ require('./chunk-FVJKUTHF.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkKXSU24RUcjs = require('./chunk-KXSU24RU.cjs');
14
+ var _chunk4O2UGFFTcjs = require('./chunk-4O2UGFFT.cjs');
15
15
  require('./chunk-G264OM23.cjs');
16
+ require('./chunk-ADEWTBSN.cjs');
17
+ require('./chunk-CG3JKPUF.cjs');
16
18
 
17
19
 
18
20
 
19
21
  var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
20
- require('./chunk-D3R3O4CY.cjs');
22
+ require('./chunk-VQAV6ESI.cjs');
21
23
 
22
24
  // src/DepositModalReown.tsx
23
25
  var _react = require('react');
@@ -45,7 +47,7 @@ var {
45
47
  unichain,
46
48
  katana,
47
49
  hyperEvm
48
- } = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, )[1];
50
+ } = _chunkCAIRS4LKcjs.getReownDependencies.call(void 0, )[1];
49
51
  var APPKIT_NETWORK_BY_ID = {
50
52
  [mainnet.id]: mainnet,
51
53
  [optimism.id]: optimism,
@@ -77,7 +79,7 @@ function getAppKitNetwork(chainId) {
77
79
 
78
80
  // src/core/reown-theme.ts
79
81
  function mapTheme(theme) {
80
- const themeMode = _chunkKXSU24RUcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
82
+ const themeMode = _chunk4O2UGFFTcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
81
83
  const themeVariables = {
82
84
  "--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
83
85
  };
@@ -94,7 +96,7 @@ function setAppKitTheme(appKit, theme) {
94
96
 
95
97
  // src/core/reown.tsx
96
98
  var _jsxruntime = require('react/jsx-runtime');
97
- var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, );
99
+ var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkCAIRS4LKcjs.getReownDependencies.call(void 0, );
98
100
  var {
99
101
  createAppKit,
100
102
  useAppKit,
@@ -110,14 +112,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
110
112
  const transports = {};
111
113
  for (const network of networks) {
112
114
  const id = Number(network.id);
113
- transports[id] = _viem.http.call(void 0, _chunkKXSU24RUcjs.rpcUrlFor.call(void 0, rpcUrls, id));
115
+ transports[id] = _viem.http.call(void 0, _chunk4O2UGFFTcjs.rpcUrlFor.call(void 0, rpcUrls, id));
114
116
  }
115
117
  return transports;
116
118
  }
117
119
  function getEvmRpcFingerprint(rpcUrls, networks) {
118
120
  return networks.map((network) => {
119
121
  const id = Number(network.id);
120
- return `${id}=${_nullishCoalesce(_chunkKXSU24RUcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
122
+ return `${id}=${_nullishCoalesce(_chunk4O2UGFFTcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
121
123
  }).join("|");
122
124
  }
123
125
  var cachedAdapter = null;
@@ -188,7 +190,7 @@ function ReownWalletProvider({
188
190
  backendUrl,
189
191
  children
190
192
  }) {
191
- const rpcUrls = _chunkKXSU24RUcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
193
+ const rpcUrls = _chunk4O2UGFFTcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
192
194
  const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
193
195
  const overrides = _react.useMemo.call(void 0, () => {
194
196
  if (!rpcUrls) return void 0;
@@ -200,14 +202,14 @@ function ReownWalletProvider({
200
202
  return out;
201
203
  }, [rpcUrls]);
202
204
  const [state, setState] = _react.useState.call(void 0, () => {
203
- const primed = _chunkKXSU24RUcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
205
+ const primed = _chunk4O2UGFFTcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
204
206
  return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
205
207
  });
206
208
  _react.useEffect.call(void 0, () => {
207
209
  let active = true;
208
- const primed = _chunkKXSU24RUcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
210
+ const primed = _chunk4O2UGFFTcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
209
211
  setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
210
- _chunkKXSU24RUcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
212
+ _chunk4O2UGFFTcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
211
213
  if (active) setState({ ready: true, chains });
212
214
  });
213
215
  return () => {
@@ -216,7 +218,7 @@ function ReownWalletProvider({
216
218
  }, [backendUrl, overrides]);
217
219
  _react.useEffect.call(void 0, () => {
218
220
  setAppKitTheme(appKitReact.modal, theme);
219
- return _chunkKXSU24RUcjs.followSystemAppearance.call(void 0,
221
+ return _chunk4O2UGFFTcjs.followSystemAppearance.call(void 0,
220
222
  _optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
221
223
  () => setAppKitTheme(appKitReact.modal, theme)
222
224
  );
@@ -280,7 +282,7 @@ function useReownWalletSession() {
280
282
  await switchChainAsync({ chainId });
281
283
  }
282
284
  } catch (err) {
283
- if (_chunkKXSU24RUcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
285
+ if (_chunk4O2UGFFTcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
284
286
  throw new Error(
285
287
  `Switch to ${chainDisplayName(chainId)} in your wallet to continue`
286
288
  );
@@ -293,7 +295,7 @@ function useReownWalletSession() {
293
295
 
294
296
  // src/DepositModalReown.tsx
295
297
 
296
- var [appKitReact2, , , , solanaAdapterReact] = _chunkPVFEZ3UGcjs.getReownDependencies.call(void 0, );
298
+ var [appKitReact2, , , , solanaAdapterReact] = _chunkCAIRS4LKcjs.getReownDependencies.call(void 0, );
297
299
  var { useAppKitProvider } = appKitReact2;
298
300
  var { useAppKitConnection } = solanaAdapterReact;
299
301
  function DepositModalWithReown(props) {
@@ -315,7 +317,7 @@ function DepositModalWithReown(props) {
315
317
  reown.disconnect();
316
318
  }, [reown.disconnect]);
317
319
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
318
- _chunkPVFEZ3UGcjs.DepositModalInner,
320
+ _chunkCAIRS4LKcjs.DepositModalInner,
319
321
  {
320
322
  ...props,
321
323
  walletSession: reownWithSolana,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WithdrawModal,
3
3
  buildWithdrawAnalyticsSessionProperties
4
- } from "./chunk-IPKT3FU6.mjs";
5
- import "./chunk-OZPMRTW3.mjs";
4
+ } from "./chunk-7CHQA2OZ.mjs";
5
+ import "./chunk-UNXUOV3F.mjs";
6
6
  import "./chunk-YY4ZOAH5.mjs";
7
7
  import "./chunk-E7IMWVMN.mjs";
8
- import "./chunk-ZOJMB5TZ.mjs";
8
+ import "./chunk-2D3J53PX.mjs";
9
9
  export {
10
10
  WithdrawModal,
11
11
  buildWithdrawAnalyticsSessionProperties
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkU7NYYT4Qcjs = require('./chunk-U7NYYT4Q.cjs');
5
+ require('./chunk-4O2UGFFT.cjs');
6
+ require('./chunk-G264OM23.cjs');
7
+ require('./chunk-FKJ6EJHH.cjs');
8
+ require('./chunk-VQAV6ESI.cjs');
9
+
10
+
11
+
12
+ exports.WithdrawModal = _chunkU7NYYT4Qcjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkU7NYYT4Qcjs.buildWithdrawAnalyticsSessionProperties;
@@ -1,5 +1,5 @@
1
1
  // src/core/version.ts
2
- var MODAL_VERSION = "0.20.1";
2
+ var MODAL_VERSION = "0.21.0";
3
3
  var SERVICE_HEADERS = {
4
4
  "Content-Type": "application/json",
5
5
  "x-deposit-modal-version": MODAL_VERSION