@rhinestone/deposit-modal 0.0.0-dev-20261007123232 → 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-37WGJIO4.cjs → BankOnrampStep-OS4SNALH.cjs} +11 -11
  2. package/dist/{BankOnrampStep-JUFVAVIS.mjs → BankOnrampStep-P4NPBC6J.mjs} +4 -4
  3. package/dist/{DepositModalReown-6GHQQNMW.mjs → DepositModalReown-AAMUOMFA.mjs} +3 -3
  4. package/dist/{DepositModalReown-UBVBTDF3.cjs → DepositModalReown-LXLSOE7L.cjs} +16 -16
  5. package/dist/{WithdrawModal-A3IW3SXX.mjs → WithdrawModal-3OXEYM3Y.mjs} +3 -3
  6. package/dist/WithdrawModal-KDHPED2J.cjs +12 -0
  7. package/dist/{chunk-ITLGT5C5.mjs → chunk-2KQ3LQMQ.mjs} +1 -1
  8. package/dist/{chunk-GCXBWEVD.mjs → chunk-3OIRUVVZ.mjs} +67 -14
  9. package/dist/{chunk-E6LUVX6Q.cjs → chunk-42OKN6HU.cjs} +1 -1
  10. package/dist/{chunk-HKWTABVW.cjs → chunk-4WR753KQ.cjs} +420 -456
  11. package/dist/{chunk-B4THBLY7.mjs → chunk-CFZ7WGTD.mjs} +1 -1
  12. package/dist/{chunk-INWUGACR.cjs → chunk-FYP2UORT.cjs} +3 -3
  13. package/dist/{chunk-3VTLHPMC.cjs → chunk-IU5UYYL7.cjs} +2 -2
  14. package/dist/{chunk-5PS2QNOU.cjs → chunk-IY42S54N.cjs} +2 -2
  15. package/dist/{chunk-MD6EFUBO.cjs → chunk-KYDSN5AX.cjs} +311 -258
  16. package/dist/{chunk-FYNIS26C.mjs → chunk-NMLBAGMQ.mjs} +1 -1
  17. package/dist/{chunk-WVSX6PLI.mjs → chunk-NO4FA4UR.mjs} +1 -1
  18. package/dist/{chunk-UGIKPKMY.mjs → chunk-PGOXN4RD.mjs} +1 -1
  19. package/dist/{chunk-UUGROFL6.mjs → chunk-WDOTS7AW.mjs} +68 -104
  20. package/dist/{chunk-GDOFONYI.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-3AAAZV34.cjs +0 -12
@@ -8,15 +8,15 @@
8
8
  var _chunkG264OM23cjs = require('./chunk-G264OM23.cjs');
9
9
 
10
10
 
11
- var _chunk5PS2QNOUcjs = require('./chunk-5PS2QNOU.cjs');
11
+ var _chunkIY42S54Ncjs = require('./chunk-IY42S54N.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkINWUGACRcjs = require('./chunk-INWUGACR.cjs');
15
+ var _chunkFYP2UORTcjs = require('./chunk-FYP2UORT.cjs');
16
16
 
17
17
 
18
- var _chunk3VTLHPMCcjs = require('./chunk-3VTLHPMC.cjs');
19
- require('./chunk-E6LUVX6Q.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
- () => _chunk5PS2QNOUcjs.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 _chunkINWUGACRcjs.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 _chunkINWUGACRcjs.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 _chunk3VTLHPMCcjs.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 _chunk3VTLHPMCcjs.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 _chunk3VTLHPMCcjs.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 _chunkINWUGACRcjs.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-B4THBLY7.mjs";
11
+ } from "./chunk-CFZ7WGTD.mjs";
12
12
  import {
13
13
  getComplianceStatus,
14
14
  startComplianceVerification
15
- } from "./chunk-FYNIS26C.mjs";
15
+ } from "./chunk-NMLBAGMQ.mjs";
16
16
  import {
17
17
  ScopedRequestError
18
- } from "./chunk-UGIKPKMY.mjs";
19
- import "./chunk-WVSX6PLI.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-UUGROFL6.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-GCXBWEVD.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-WVSX6PLI.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 _chunkHKWTABVWcjs = require('./chunk-HKWTABVW.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 _chunkMD6EFUBOcjs = require('./chunk-MD6EFUBO.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-E6LUVX6Q.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
- } = _chunkHKWTABVWcjs.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 = _chunkMD6EFUBOcjs.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] = _chunkHKWTABVWcjs.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, _chunkMD6EFUBOcjs.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(_chunkMD6EFUBOcjs.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 = _chunkMD6EFUBOcjs.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 = _chunkMD6EFUBOcjs.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 = _chunkMD6EFUBOcjs.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
- _chunkMD6EFUBOcjs.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 _chunkMD6EFUBOcjs.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 (_chunkMD6EFUBOcjs.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] = _chunkHKWTABVWcjs.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
- _chunkHKWTABVWcjs.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-ITLGT5C5.mjs";
5
- import "./chunk-GCXBWEVD.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-WVSX6PLI.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-GCXBWEVD.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-WVSX6PLI.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;
@@ -8475,6 +8525,9 @@ export {
8475
8525
  SOLANA_TOKENS,
8476
8526
  resolveSolanaToken,
8477
8527
  isNativeSol,
8528
+ hostedOrderStateFromSwapped,
8529
+ mergeHostedOrderState,
8530
+ hasReached,
8478
8531
  getAssetId,
8479
8532
  chainIdsByValue,
8480
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-20261007123232";
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