@rhinestone/deposit-modal 0.0.0-dev-20261007110258 → 0.0.0-dev-20261007134011

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 (38) hide show
  1. package/dist/{BankOnrampStep-BK5LRY36.cjs → BankOnrampStep-OS4SNALH.cjs} +11 -11
  2. package/dist/{BankOnrampStep-7ERDUT5O.mjs → BankOnrampStep-P4NPBC6J.mjs} +4 -4
  3. package/dist/{DepositModalReown-NXC723GF.mjs → DepositModalReown-AAMUOMFA.mjs} +3 -3
  4. package/dist/{DepositModalReown-CLI7VUYY.cjs → DepositModalReown-LXLSOE7L.cjs} +16 -16
  5. package/dist/{WithdrawModal-V6TV4KCD.mjs → WithdrawModal-3OXEYM3Y.mjs} +3 -3
  6. package/dist/WithdrawModal-KDHPED2J.cjs +12 -0
  7. package/dist/{chunk-TQ2DIVRK.mjs → chunk-2KQ3LQMQ.mjs} +1 -1
  8. package/dist/{chunk-BTOOJ3FR.mjs → chunk-3OIRUVVZ.mjs} +76 -26
  9. package/dist/{chunk-2WUNYCRE.cjs → chunk-42OKN6HU.cjs} +1 -1
  10. package/dist/{chunk-4D5GMWN3.cjs → chunk-4WR753KQ.cjs} +420 -456
  11. package/dist/{chunk-ZDBJ2RVB.mjs → chunk-CFZ7WGTD.mjs} +1 -1
  12. package/dist/{chunk-ADDVK2HR.cjs → chunk-FYP2UORT.cjs} +3 -3
  13. package/dist/{chunk-B6MPB7DP.cjs → chunk-IU5UYYL7.cjs} +2 -2
  14. package/dist/{chunk-ILNKHM6Y.cjs → chunk-IY42S54N.cjs} +2 -2
  15. package/dist/{chunk-QJBZBBLF.cjs → chunk-KYDSN5AX.cjs} +320 -270
  16. package/dist/{chunk-5QYPSYWR.mjs → chunk-NMLBAGMQ.mjs} +1 -1
  17. package/dist/{chunk-5KOHMY5O.mjs → chunk-NO4FA4UR.mjs} +1 -1
  18. package/dist/{chunk-DC2KPZ2C.mjs → chunk-PGOXN4RD.mjs} +1 -1
  19. package/dist/{chunk-5TGNRFUO.mjs → chunk-WDOTS7AW.mjs} +68 -104
  20. package/dist/{chunk-2SCJBXG3.cjs → chunk-YUL74367.cjs} +58 -58
  21. package/dist/compliance.cjs +4 -4
  22. package/dist/compliance.mjs +3 -3
  23. package/dist/constants.cjs +2 -2
  24. package/dist/constants.d.cts +1 -1
  25. package/dist/constants.d.ts +1 -1
  26. package/dist/constants.mjs +1 -1
  27. package/dist/deposit.cjs +4 -4
  28. package/dist/deposit.mjs +3 -3
  29. package/dist/embed.cjs +14 -14
  30. package/dist/embed.mjs +4 -4
  31. package/dist/index.cjs +5 -5
  32. package/dist/index.mjs +4 -4
  33. package/dist/onramp.cjs +4 -4
  34. package/dist/onramp.mjs +3 -3
  35. package/dist/withdraw.cjs +4 -4
  36. package/dist/withdraw.mjs +3 -3
  37. package/package.json +1 -1
  38. package/dist/WithdrawModal-OCOQDAGA.cjs +0 -12
@@ -8,15 +8,15 @@
8
8
  var _chunkG264OM23cjs = require('./chunk-G264OM23.cjs');
9
9
 
10
10
 
11
- var _chunkILNKHM6Ycjs = require('./chunk-ILNKHM6Y.cjs');
11
+ var _chunkIY42S54Ncjs = require('./chunk-IY42S54N.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkADDVK2HRcjs = require('./chunk-ADDVK2HR.cjs');
15
+ var _chunkFYP2UORTcjs = require('./chunk-FYP2UORT.cjs');
16
16
 
17
17
 
18
- var _chunkB6MPB7DPcjs = require('./chunk-B6MPB7DP.cjs');
19
- require('./chunk-2WUNYCRE.cjs');
18
+ var _chunkIU5UYYL7cjs = require('./chunk-IU5UYYL7.cjs');
19
+ require('./chunk-42OKN6HU.cjs');
20
20
 
21
21
  // src/components/steps/BankOnrampStep.tsx
22
22
  var _react = require('react');
@@ -145,7 +145,7 @@ function BankOnrampStep({
145
145
  [backendUrl, getSessionRef, smartAccount]
146
146
  );
147
147
  const service = _react.useMemo.call(void 0,
148
- () => _chunkILNKHM6Ycjs.createOnrampService.call(void 0, sessionOptions),
148
+ () => _chunkIY42S54Ncjs.createOnrampService.call(void 0, sessionOptions),
149
149
  [sessionOptions]
150
150
  );
151
151
  const [availableForHistory, setAvailableForHistory] = _react.useState.call(void 0, false);
@@ -175,7 +175,7 @@ function BankOnrampStep({
175
175
  []
176
176
  );
177
177
  const startVerification = _react.useCallback.call(void 0, async () => {
178
- const session = await _chunkADDVK2HRcjs.startComplianceVerification.call(void 0, sessionOptions);
178
+ const session = await _chunkFYP2UORTcjs.startComplianceVerification.call(void 0, sessionOptions);
179
179
  if (session.status === "failed") return "declined";
180
180
  if (!session.nextAction) return "reviewing";
181
181
  if (!isTrustedNoahHostedUrl(session.nextAction.url)) return "reviewing";
@@ -191,7 +191,7 @@ function BankOnrampStep({
191
191
  return "action_required";
192
192
  }, [openExternally, sessionOptions]);
193
193
  const ensureVerified = _react.useCallback.call(void 0, async () => {
194
- const current = await _chunkADDVK2HRcjs.getComplianceStatus.call(void 0, sessionOptions);
194
+ const current = await _chunkFYP2UORTcjs.getComplianceStatus.call(void 0, sessionOptions);
195
195
  if (current.status === "approved") return "approved";
196
196
  if (current.status === "declined") return "declined";
197
197
  return startVerification();
@@ -203,7 +203,7 @@ function BankOnrampStep({
203
203
  setNoOptions(false);
204
204
  try {
205
205
  const discover = () => service.getOptions().catch((error2) => {
206
- if (error2 instanceof _chunkB6MPB7DPcjs.ScopedRequestError && error2.status === 404 && onUnavailable) {
206
+ if (error2 instanceof _chunkIU5UYYL7cjs.ScopedRequestError && error2.status === 404 && onUnavailable) {
207
207
  if (isCurrentRequest(generation)) onUnavailable();
208
208
  return null;
209
209
  }
@@ -270,7 +270,7 @@ function BankOnrampStep({
270
270
  setBankDetails(details);
271
271
  } catch (error2) {
272
272
  if (!isCurrentRequest(generation)) return;
273
- const pending = error2 instanceof _chunkB6MPB7DPcjs.ScopedRequestError && error2.status === 409;
273
+ const pending = error2 instanceof _chunkIU5UYYL7cjs.ScopedRequestError && error2.status === 409;
274
274
  const message = pending ? PENDING_ERROR : SAFE_ERROR;
275
275
  setError(message);
276
276
  _optionalChain([onError, 'optionalCall', _4 => _4(
@@ -304,7 +304,7 @@ function BankOnrampStep({
304
304
  await openDetails(nextAccount);
305
305
  } catch (error2) {
306
306
  if (!isCurrentRequest(generation)) return;
307
- if (error2 instanceof _chunkB6MPB7DPcjs.ScopedRequestError && error2.status === 409 && error2.code === "VERIFICATION_REQUIRED" && !verificationResumedRef.current) {
307
+ if (error2 instanceof _chunkIU5UYYL7cjs.ScopedRequestError && error2.status === 409 && error2.code === "VERIFICATION_REQUIRED" && !verificationResumedRef.current) {
308
308
  verificationResumedRef.current = true;
309
309
  try {
310
310
  const verification = await startVerification();
@@ -340,7 +340,7 @@ function BankOnrampStep({
340
340
  const timer = setInterval(() => {
341
341
  void (async () => {
342
342
  try {
343
- const status = await _chunkADDVK2HRcjs.getComplianceStatus.call(void 0, sessionOptions);
343
+ const status = await _chunkFYP2UORTcjs.getComplianceStatus.call(void 0, sessionOptions);
344
344
  if (!active) return;
345
345
  if (status.status === "approved") {
346
346
  setHostedUrl(null);
@@ -8,15 +8,15 @@ import {
8
8
  } from "./chunk-YY4ZOAH5.mjs";
9
9
  import {
10
10
  createOnrampService
11
- } from "./chunk-ZDBJ2RVB.mjs";
11
+ } from "./chunk-CFZ7WGTD.mjs";
12
12
  import {
13
13
  getComplianceStatus,
14
14
  startComplianceVerification
15
- } from "./chunk-5QYPSYWR.mjs";
15
+ } from "./chunk-NMLBAGMQ.mjs";
16
16
  import {
17
17
  ScopedRequestError
18
- } from "./chunk-DC2KPZ2C.mjs";
19
- import "./chunk-5KOHMY5O.mjs";
18
+ } from "./chunk-PGOXN4RD.mjs";
19
+ import "./chunk-NO4FA4UR.mjs";
20
20
 
21
21
  // src/components/steps/BankOnrampStep.tsx
22
22
  import { useCallback, useEffect, useMemo, useRef, useState as useState2 } from "react";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DepositModalInner,
3
3
  getReownDependencies
4
- } from "./chunk-5TGNRFUO.mjs";
4
+ } from "./chunk-WDOTS7AW.mjs";
5
5
  import "./chunk-2FOPO4N5.mjs";
6
6
  import {
7
7
  followSystemAppearance,
@@ -11,13 +11,13 @@ import {
11
11
  resolveThemeMode,
12
12
  rpcUrlFor,
13
13
  useStableRpcUrls
14
- } from "./chunk-BTOOJ3FR.mjs";
14
+ } from "./chunk-3OIRUVVZ.mjs";
15
15
  import "./chunk-YY4ZOAH5.mjs";
16
16
  import {
17
17
  SUPPORTED_CHAIN_IDS,
18
18
  getChainName
19
19
  } from "./chunk-E7IMWVMN.mjs";
20
- import "./chunk-5KOHMY5O.mjs";
20
+ import "./chunk-NO4FA4UR.mjs";
21
21
 
22
22
  // src/DepositModalReown.tsx
23
23
  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 _chunk4D5GMWN3cjs = require('./chunk-4D5GMWN3.cjs');
4
+ var _chunk4WR753KQcjs = require('./chunk-4WR753KQ.cjs');
5
5
  require('./chunk-FVJKUTHF.cjs');
6
6
 
7
7
 
@@ -11,13 +11,13 @@ require('./chunk-FVJKUTHF.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkQJBZBBLFcjs = require('./chunk-QJBZBBLF.cjs');
14
+ var _chunkKYDSN5AXcjs = require('./chunk-KYDSN5AX.cjs');
15
15
  require('./chunk-G264OM23.cjs');
16
16
 
17
17
 
18
18
 
19
19
  var _chunkFKJ6EJHHcjs = require('./chunk-FKJ6EJHH.cjs');
20
- require('./chunk-2WUNYCRE.cjs');
20
+ require('./chunk-42OKN6HU.cjs');
21
21
 
22
22
  // src/DepositModalReown.tsx
23
23
  var _react = require('react');
@@ -45,7 +45,7 @@ var {
45
45
  unichain,
46
46
  katana,
47
47
  hyperEvm
48
- } = _chunk4D5GMWN3cjs.getReownDependencies.call(void 0, )[1];
48
+ } = _chunk4WR753KQcjs.getReownDependencies.call(void 0, )[1];
49
49
  var APPKIT_NETWORK_BY_ID = {
50
50
  [mainnet.id]: mainnet,
51
51
  [optimism.id]: optimism,
@@ -77,7 +77,7 @@ function getAppKitNetwork(chainId) {
77
77
 
78
78
  // src/core/reown-theme.ts
79
79
  function mapTheme(theme) {
80
- const themeMode = _chunkQJBZBBLFcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
80
+ const themeMode = _chunkKYDSN5AXcjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
81
81
  const themeVariables = {
82
82
  "--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
83
83
  };
@@ -94,7 +94,7 @@ function setAppKitTheme(appKit, theme) {
94
94
 
95
95
  // src/core/reown.tsx
96
96
  var _jsxruntime = require('react/jsx-runtime');
97
- var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunk4D5GMWN3cjs.getReownDependencies.call(void 0, );
97
+ var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunk4WR753KQcjs.getReownDependencies.call(void 0, );
98
98
  var {
99
99
  createAppKit,
100
100
  useAppKit,
@@ -110,14 +110,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
110
110
  const transports = {};
111
111
  for (const network of networks) {
112
112
  const id = Number(network.id);
113
- transports[id] = _viem.http.call(void 0, _chunkQJBZBBLFcjs.rpcUrlFor.call(void 0, rpcUrls, id));
113
+ transports[id] = _viem.http.call(void 0, _chunkKYDSN5AXcjs.rpcUrlFor.call(void 0, rpcUrls, id));
114
114
  }
115
115
  return transports;
116
116
  }
117
117
  function getEvmRpcFingerprint(rpcUrls, networks) {
118
118
  return networks.map((network) => {
119
119
  const id = Number(network.id);
120
- return `${id}=${_nullishCoalesce(_chunkQJBZBBLFcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
120
+ return `${id}=${_nullishCoalesce(_chunkKYDSN5AXcjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
121
121
  }).join("|");
122
122
  }
123
123
  var cachedAdapter = null;
@@ -188,7 +188,7 @@ function ReownWalletProvider({
188
188
  backendUrl,
189
189
  children
190
190
  }) {
191
- const rpcUrls = _chunkQJBZBBLFcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
191
+ const rpcUrls = _chunkKYDSN5AXcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
192
192
  const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
193
193
  const overrides = _react.useMemo.call(void 0, () => {
194
194
  if (!rpcUrls) return void 0;
@@ -200,14 +200,14 @@ function ReownWalletProvider({
200
200
  return out;
201
201
  }, [rpcUrls]);
202
202
  const [state, setState] = _react.useState.call(void 0, () => {
203
- const primed = _chunkQJBZBBLFcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
203
+ const primed = _chunkKYDSN5AXcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
204
204
  return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
205
205
  });
206
206
  _react.useEffect.call(void 0, () => {
207
207
  let active = true;
208
- const primed = _chunkQJBZBBLFcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
208
+ const primed = _chunkKYDSN5AXcjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
209
209
  setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
210
- _chunkQJBZBBLFcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
210
+ _chunkKYDSN5AXcjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
211
211
  if (active) setState({ ready: true, chains });
212
212
  });
213
213
  return () => {
@@ -216,7 +216,7 @@ function ReownWalletProvider({
216
216
  }, [backendUrl, overrides]);
217
217
  _react.useEffect.call(void 0, () => {
218
218
  setAppKitTheme(appKitReact.modal, theme);
219
- return _chunkQJBZBBLFcjs.followSystemAppearance.call(void 0,
219
+ return _chunkKYDSN5AXcjs.followSystemAppearance.call(void 0,
220
220
  _optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
221
221
  () => setAppKitTheme(appKitReact.modal, theme)
222
222
  );
@@ -280,7 +280,7 @@ function useReownWalletSession() {
280
280
  await switchChainAsync({ chainId });
281
281
  }
282
282
  } catch (err) {
283
- if (_chunkQJBZBBLFcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
283
+ if (_chunkKYDSN5AXcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
284
284
  throw new Error(
285
285
  `Switch to ${chainDisplayName(chainId)} in your wallet to continue`
286
286
  );
@@ -293,7 +293,7 @@ function useReownWalletSession() {
293
293
 
294
294
  // src/DepositModalReown.tsx
295
295
 
296
- var [appKitReact2, , , , solanaAdapterReact] = _chunk4D5GMWN3cjs.getReownDependencies.call(void 0, );
296
+ var [appKitReact2, , , , solanaAdapterReact] = _chunk4WR753KQcjs.getReownDependencies.call(void 0, );
297
297
  var { useAppKitProvider } = appKitReact2;
298
298
  var { useAppKitConnection } = solanaAdapterReact;
299
299
  function DepositModalWithReown(props) {
@@ -315,7 +315,7 @@ function DepositModalWithReown(props) {
315
315
  reown.disconnect();
316
316
  }, [reown.disconnect]);
317
317
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
318
- _chunk4D5GMWN3cjs.DepositModalInner,
318
+ _chunk4WR753KQcjs.DepositModalInner,
319
319
  {
320
320
  ...props,
321
321
  walletSession: reownWithSolana,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WithdrawModal,
3
3
  buildWithdrawAnalyticsSessionProperties
4
- } from "./chunk-TQ2DIVRK.mjs";
5
- import "./chunk-BTOOJ3FR.mjs";
4
+ } from "./chunk-2KQ3LQMQ.mjs";
5
+ import "./chunk-3OIRUVVZ.mjs";
6
6
  import "./chunk-YY4ZOAH5.mjs";
7
7
  import "./chunk-E7IMWVMN.mjs";
8
- import "./chunk-5KOHMY5O.mjs";
8
+ import "./chunk-NO4FA4UR.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 _chunkYUL74367cjs = require('./chunk-YUL74367.cjs');
5
+ require('./chunk-KYDSN5AX.cjs');
6
+ require('./chunk-G264OM23.cjs');
7
+ require('./chunk-FKJ6EJHH.cjs');
8
+ require('./chunk-42OKN6HU.cjs');
9
+
10
+
11
+
12
+ exports.WithdrawModal = _chunkYUL74367cjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkYUL74367cjs.buildWithdrawAnalyticsSessionProperties;
@@ -40,7 +40,7 @@ import {
40
40
  useTokenPrices,
41
41
  useWithdrawAnalyticsEmitter,
42
42
  warnRemovedProps
43
- } from "./chunk-BTOOJ3FR.mjs";
43
+ } from "./chunk-3OIRUVVZ.mjs";
44
44
  import {
45
45
  BodyHeader,
46
46
  ChevronDownIcon,
@@ -45,7 +45,7 @@ import {
45
45
  import {
46
46
  MODAL_VERSION,
47
47
  serviceHeaders
48
- } from "./chunk-5KOHMY5O.mjs";
48
+ } from "./chunk-NO4FA4UR.mjs";
49
49
 
50
50
  // src/components/ui/Modal.tsx
51
51
  import {
@@ -423,6 +423,54 @@ function catalogExplorerTxUrl(chain, txHash) {
423
423
  return `${chain.explorer.url}${chain.explorer.txPath}${txHash}`;
424
424
  }
425
425
 
426
+ // src/core/hosted-order.ts
427
+ var RANK = {
428
+ awaiting_payment: 0,
429
+ paying: 1,
430
+ paid: 2,
431
+ sent: 3
432
+ };
433
+ function hostedOrderState(order) {
434
+ const { receipt, conversion, delivery } = order.stages;
435
+ const deliveryTxHash = "txHash" in delivery ? delivery.txHash : null;
436
+ const outcome = order.status === "refunded" ? "refunded" : order.status === "failed" && !deliveryTxHash ? receipt.status === "failed" && receipt.reason === "cancelled" ? "cancelled" : "failed" : null;
437
+ const progress = deliveryTxHash ? "sent" : receipt.status === "completed" || conversion.status !== "not_started" ? "paid" : receipt.status === "processing" || receipt.status === "on_hold" ? "paying" : "awaiting_payment";
438
+ return { progress, outcome, deliveryTxHash };
439
+ }
440
+ function hostedOrderStateFromSwapped(status, txHash) {
441
+ const deliveryTxHash = txHash ?? null;
442
+ switch (status) {
443
+ case "payment_pending":
444
+ return { progress: "awaiting_payment", outcome: null, deliveryTxHash };
445
+ case "wallet_order_registered":
446
+ case "wallet_order_confirmed":
447
+ return { progress: "paying", outcome: null, deliveryTxHash };
448
+ case "order_completed":
449
+ return {
450
+ progress: deliveryTxHash ? "sent" : "paid",
451
+ outcome: null,
452
+ deliveryTxHash
453
+ };
454
+ case "order_broadcasted":
455
+ return { progress: "sent", outcome: null, deliveryTxHash };
456
+ case "order_cancelled":
457
+ return { progress: "awaiting_payment", outcome: "cancelled", deliveryTxHash };
458
+ default:
459
+ return null;
460
+ }
461
+ }
462
+ function mergeHostedOrderState(previous, next) {
463
+ if (!previous) return next;
464
+ return {
465
+ progress: RANK[next.progress] >= RANK[previous.progress] ? next.progress : previous.progress,
466
+ outcome: next.outcome ?? previous.outcome,
467
+ deliveryTxHash: next.deliveryTxHash ?? previous.deliveryTxHash
468
+ };
469
+ }
470
+ function hasReached(state, progress) {
471
+ return state ? RANK[state.progress] >= RANK[progress] : false;
472
+ }
473
+
426
474
  // src/core/deposit-asset-helpers.ts
427
475
  function getAssetId(asset) {
428
476
  return `${asset.chainId}:${asset.token.toLowerCase()}`;
@@ -1855,20 +1903,10 @@ function createDepositService(baseUrl, options) {
1855
1903
  }
1856
1904
  };
1857
1905
  }
1858
- var SWAPPED_ORDER_STATUSES = /* @__PURE__ */ new Set([
1859
- "payment_pending",
1860
- "order_completed",
1861
- "order_broadcasted",
1862
- "order_cancelled"
1863
- ]);
1864
1906
  function swappedOrderFromView(orderId, raw) {
1865
1907
  if (!raw || typeof raw !== "object") return null;
1866
1908
  const view = raw;
1867
- if (view.provider !== "swapped") return null;
1868
- const status = view.providerStatus;
1869
- if (typeof status !== "string" || !SWAPPED_ORDER_STATUSES.has(status)) {
1870
- return null;
1871
- }
1909
+ if (view.provider !== "swapped" || !isOrderShape(view)) return null;
1872
1910
  const number = (v) => {
1873
1911
  const n = typeof v === "string" && v.trim() ? Number(v) : v;
1874
1912
  return typeof n === "number" && Number.isFinite(n) ? n : null;
@@ -1882,10 +1920,9 @@ function swappedOrderFromView(orderId, raw) {
1882
1920
  const usdNet = number(view.fiat?.usd?.net);
1883
1921
  return {
1884
1922
  orderId,
1885
- status,
1923
+ ...hostedOrderState(view),
1886
1924
  orderCrypto: text(view.crypto?.asset),
1887
1925
  orderCryptoAmount: text(view.crypto?.amount),
1888
- transactionId: text(view.stages?.delivery?.txHash),
1889
1926
  receivedAt: text(view.updatedAt),
1890
1927
  paidAmountUsd: usdTotal ?? usdNet,
1891
1928
  paidAmountEur: number(view.fiat?.eur?.total) ?? number(view.fiat?.eur?.net),
@@ -1893,6 +1930,19 @@ function swappedOrderFromView(orderId, raw) {
1893
1930
  paymentMethod: railName(view.rail?.method ?? view.rail?.connection)
1894
1931
  };
1895
1932
  }
1933
+ var ORDER_STATUSES = /* @__PURE__ */ new Set([
1934
+ "pending",
1935
+ "processing",
1936
+ "completed",
1937
+ "failed",
1938
+ "refunded"
1939
+ ]);
1940
+ function isOrderShape(view) {
1941
+ const stages = view.stages;
1942
+ return ORDER_STATUSES.has(view.status) && ["receipt", "conversion", "delivery"].every(
1943
+ (name) => typeof stages?.[name]?.status === "string"
1944
+ );
1945
+ }
1896
1946
  function parseAssetItem(raw, fields) {
1897
1947
  if (!raw || typeof raw !== "object") return void 0;
1898
1948
  const record = raw;
@@ -3497,7 +3547,6 @@ function toRecoverableDeposit(row, options = {}) {
3497
3547
  return {
3498
3548
  depositId: row.id,
3499
3549
  signer,
3500
- destinationPrefill: signer,
3501
3550
  depositAddress: row.depositAddress,
3502
3551
  sourceChainId,
3503
3552
  targetChainId,
@@ -5674,7 +5723,6 @@ function RecoveryReviewScreen({
5674
5723
  amountRaw,
5675
5724
  txHash,
5676
5725
  defaultDestination,
5677
- destinationHint,
5678
5726
  depositAddress,
5679
5727
  submitting,
5680
5728
  onSubmit,
@@ -5689,9 +5737,7 @@ function RecoveryReviewScreen({
5689
5737
  decimals
5690
5738
  });
5691
5739
  const explorerTxUrl = useExplorerTxUrl();
5692
- const [destination, setDestination] = useState7(
5693
- defaultDestination ?? ""
5694
- );
5740
+ const [destination, setDestination] = useState7(defaultDestination ?? "");
5695
5741
  const isSelfDestination = isDepositSelfDestination(
5696
5742
  { depositAddress },
5697
5743
  destination
@@ -5777,7 +5823,7 @@ function RecoveryReviewScreen({
5777
5823
  placeholder: "0x\u2026",
5778
5824
  value: destination,
5779
5825
  onChange: (e) => setDestination(e.target.value),
5780
- hint: destinationHint,
5826
+ hint: `An address you control on ${chainName}.`,
5781
5827
  error: isSelfDestination ? selfDestinationError : destination.length > 0 && !destinationValid ? "Enter a valid address" : void 0
5782
5828
  }
5783
5829
  ),
@@ -5816,6 +5862,7 @@ function HistoryRecoveryFlow({
5816
5862
  const [outcome, setOutcome] = useState8(null);
5817
5863
  const [error, setError] = useState8(null);
5818
5864
  const [retryable, setRetryable] = useState8(false);
5865
+ const [destination, setDestination] = useState8();
5819
5866
  const lastFailureRef = useRef5(null);
5820
5867
  useEffect9(() => {
5821
5868
  if (entrySource === "history_row") {
@@ -5832,7 +5879,8 @@ function HistoryRecoveryFlow({
5832
5879
  deposit.token
5833
5880
  );
5834
5881
  const submit = useCallback6(
5835
- async (destination) => {
5882
+ async (destination2) => {
5883
+ setDestination(destination2);
5836
5884
  setPhase("submitting");
5837
5885
  onSubmittingChange(true);
5838
5886
  analytics.completeStep("review");
@@ -5845,14 +5893,14 @@ function HistoryRecoveryFlow({
5845
5893
  chainId: deposit.targetChainId,
5846
5894
  depositId: deposit.depositId,
5847
5895
  signer: deposit.signer,
5848
- destination,
5896
+ destination: destination2,
5849
5897
  signRecovery,
5850
5898
  debug
5851
5899
  });
5852
5900
  setOutcome({
5853
5901
  // No destination to reconcile: it is inside the signed struct, so the
5854
5902
  // processor cannot have paid anywhere else.
5855
- destination,
5903
+ destination: destination2,
5856
5904
  txHash: result.transactionHash,
5857
5905
  symbol,
5858
5906
  amountDisplay: formatRecoveryAmount(
@@ -5953,8 +6001,7 @@ function HistoryRecoveryFlow({
5953
6001
  token: deposit.token,
5954
6002
  amountRaw: deposit.amountRaw,
5955
6003
  txHash: deposit.sourceTxHash,
5956
- defaultDestination: deposit.destinationPrefill,
5957
- destinationHint: "Prefilled with the account this deposit was for. Editable.",
6004
+ defaultDestination: destination,
5958
6005
  depositAddress: deposit.depositAddress,
5959
6006
  submitting,
5960
6007
  onSubmit: submit,
@@ -6099,7 +6146,7 @@ function HistoryOverlay({
6099
6146
  () => ({
6100
6147
  presentation: inline ? "inline" : "overlay",
6101
6148
  overlay_close_enabled: !inline && Boolean(closeOnOverlayClick),
6102
- prefills: { transaction_hash: false, refund_destination: true }
6149
+ prefills: { transaction_hash: false, refund_destination: false }
6103
6150
  }),
6104
6151
  [inline, closeOnOverlayClick]
6105
6152
  );
@@ -8478,6 +8525,9 @@ export {
8478
8525
  SOLANA_TOKENS,
8479
8526
  resolveSolanaToken,
8480
8527
  isNativeSol,
8528
+ hostedOrderStateFromSwapped,
8529
+ mergeHostedOrderState,
8530
+ hasReached,
8481
8531
  getAssetId,
8482
8532
  chainIdsByValue,
8483
8533
  portfolioToAssets,
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/core/version.ts
2
- var MODAL_VERSION = "0.0.0-dev-20261007110258";
2
+ var MODAL_VERSION = "0.0.0-dev-20261007134011";
3
3
  var SERVICE_HEADERS = {
4
4
  "Content-Type": "application/json",
5
5
  "x-deposit-modal-version": MODAL_VERSION