@rhinestone/deposit-modal 0.0.0-dev-20260907094837 → 0.0.0-dev-20260910165410

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.
@@ -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 _chunkRIAZY53Acjs = require('./chunk-RIAZY53A.cjs');
4
+ var _chunkPZVU3JDLcjs = require('./chunk-PZVU3JDL.cjs');
5
5
 
6
6
 
7
7
 
@@ -10,8 +10,8 @@ var _chunkRIAZY53Acjs = require('./chunk-RIAZY53A.cjs');
10
10
 
11
11
 
12
12
 
13
- var _chunkKXNQLIQ4cjs = require('./chunk-KXNQLIQ4.cjs');
14
- require('./chunk-Q7EMR7LH.cjs');
13
+ var _chunkYNDHOII2cjs = require('./chunk-YNDHOII2.cjs');
14
+ require('./chunk-5TUOUPDB.cjs');
15
15
  require('./chunk-LVCD6RHF.cjs');
16
16
 
17
17
 
@@ -44,7 +44,7 @@ var {
44
44
  unichain,
45
45
  katana,
46
46
  hyperEvm
47
- } = _chunkRIAZY53Acjs.getReownDependencies.call(void 0, )[1];
47
+ } = _chunkPZVU3JDLcjs.getReownDependencies.call(void 0, )[1];
48
48
  var APPKIT_NETWORK_BY_ID = {
49
49
  [mainnet.id]: mainnet,
50
50
  [optimism.id]: optimism,
@@ -76,7 +76,7 @@ function getAppKitNetwork(chainId) {
76
76
 
77
77
  // src/core/reown-theme.ts
78
78
  function mapTheme(theme) {
79
- const themeMode = _chunkKXNQLIQ4cjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
79
+ const themeMode = _chunkYNDHOII2cjs.resolveThemeMode.call(void 0, _optionalChain([theme, 'optionalAccess', _ => _.mode])) === "light" ? "light" : "dark";
80
80
  const themeVariables = {
81
81
  "--apkt-accent": _optionalChain([theme, 'optionalAccess', _2 => _2.ctaColor])
82
82
  };
@@ -93,7 +93,7 @@ function setAppKitTheme(appKit, theme) {
93
93
 
94
94
  // src/core/reown.tsx
95
95
  var _jsxruntime = require('react/jsx-runtime');
96
- var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkRIAZY53Acjs.getReownDependencies.call(void 0, );
96
+ var [appKitReact, appKitNetworks, wagmiAdapter, solanaAdapter] = _chunkPZVU3JDLcjs.getReownDependencies.call(void 0, );
97
97
  var {
98
98
  createAppKit,
99
99
  useAppKit,
@@ -109,14 +109,14 @@ function buildTransports(rpcUrls, networks = EVM_NETWORKS) {
109
109
  const transports = {};
110
110
  for (const network of networks) {
111
111
  const id = Number(network.id);
112
- transports[id] = _viem.http.call(void 0, _chunkKXNQLIQ4cjs.rpcUrlFor.call(void 0, rpcUrls, id));
112
+ transports[id] = _viem.http.call(void 0, _chunkYNDHOII2cjs.rpcUrlFor.call(void 0, rpcUrls, id));
113
113
  }
114
114
  return transports;
115
115
  }
116
116
  function getEvmRpcFingerprint(rpcUrls, networks) {
117
117
  return networks.map((network) => {
118
118
  const id = Number(network.id);
119
- return `${id}=${_nullishCoalesce(_chunkKXNQLIQ4cjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
119
+ return `${id}=${_nullishCoalesce(_chunkYNDHOII2cjs.rpcUrlFor.call(void 0, rpcUrls, id), () => ( ""))}`;
120
120
  }).join("|");
121
121
  }
122
122
  var cachedAdapter = null;
@@ -187,7 +187,7 @@ function ReownWalletProvider({
187
187
  backendUrl,
188
188
  children
189
189
  }) {
190
- const rpcUrls = _chunkKXNQLIQ4cjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
190
+ const rpcUrls = _chunkYNDHOII2cjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
191
191
  const [queryClient] = _react.useState.call(void 0, () => new (0, _reactquery.QueryClient)());
192
192
  const overrides = _react.useMemo.call(void 0, () => {
193
193
  if (!rpcUrls) return void 0;
@@ -199,14 +199,14 @@ function ReownWalletProvider({
199
199
  return out;
200
200
  }, [rpcUrls]);
201
201
  const [state, setState] = _react.useState.call(void 0, () => {
202
- const primed = _chunkKXNQLIQ4cjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
202
+ const primed = _chunkYNDHOII2cjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
203
203
  return { ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) };
204
204
  });
205
205
  _react.useEffect.call(void 0, () => {
206
206
  let active = true;
207
- const primed = _chunkKXNQLIQ4cjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
207
+ const primed = _chunkYNDHOII2cjs.peekRuntimeChains.call(void 0, backendUrl, overrides);
208
208
  setState({ ready: primed !== null, chains: _nullishCoalesce(primed, () => ( [])) });
209
- _chunkKXNQLIQ4cjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
209
+ _chunkYNDHOII2cjs.primeRuntimeChains.call(void 0, backendUrl, overrides).then((chains) => {
210
210
  if (active) setState({ ready: true, chains });
211
211
  });
212
212
  return () => {
@@ -215,7 +215,7 @@ function ReownWalletProvider({
215
215
  }, [backendUrl, overrides]);
216
216
  _react.useEffect.call(void 0, () => {
217
217
  setAppKitTheme(appKitReact.modal, theme);
218
- return _chunkKXNQLIQ4cjs.followSystemAppearance.call(void 0,
218
+ return _chunkYNDHOII2cjs.followSystemAppearance.call(void 0,
219
219
  _optionalChain([theme, 'optionalAccess', _7 => _7.mode]),
220
220
  () => setAppKitTheme(appKitReact.modal, theme)
221
221
  );
@@ -279,7 +279,7 @@ function useReownWalletSession() {
279
279
  await switchChainAsync({ chainId });
280
280
  }
281
281
  } catch (err) {
282
- if (_chunkKXNQLIQ4cjs.isUnsupportedChainSwitchError.call(void 0, err)) {
282
+ if (_chunkYNDHOII2cjs.isUnsupportedChainSwitchError.call(void 0, err)) {
283
283
  throw new Error(
284
284
  `Switch to ${chainDisplayName(chainId)} in your wallet to continue`
285
285
  );
@@ -292,7 +292,7 @@ function useReownWalletSession() {
292
292
 
293
293
  // src/DepositModalReown.tsx
294
294
 
295
- var [appKitReact2, , , , solanaAdapterReact] = _chunkRIAZY53Acjs.getReownDependencies.call(void 0, );
295
+ var [appKitReact2, , , , solanaAdapterReact] = _chunkPZVU3JDLcjs.getReownDependencies.call(void 0, );
296
296
  var { useAppKitProvider } = appKitReact2;
297
297
  var { useAppKitConnection } = solanaAdapterReact;
298
298
  function DepositModalWithReown(props) {
@@ -314,7 +314,7 @@ function DepositModalWithReown(props) {
314
314
  reown.disconnect();
315
315
  }, [reown.disconnect]);
316
316
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
317
- _chunkRIAZY53Acjs.DepositModalInner,
317
+ _chunkPZVU3JDLcjs.DepositModalInner,
318
318
  {
319
319
  ...props,
320
320
  walletSession: reownWithSolana,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DepositModalInner,
3
3
  getReownDependencies
4
- } from "./chunk-HEOO64YL.mjs";
4
+ } from "./chunk-TGWDF3MW.mjs";
5
5
  import {
6
6
  followSystemAppearance,
7
7
  isUnsupportedChainSwitchError,
@@ -10,8 +10,8 @@ import {
10
10
  resolveThemeMode,
11
11
  rpcUrlFor,
12
12
  useStableRpcUrls
13
- } from "./chunk-HWIWQPW5.mjs";
14
- import "./chunk-TYO3HW3A.mjs";
13
+ } from "./chunk-LU66AKMH.mjs";
14
+ import "./chunk-JBH6EPNM.mjs";
15
15
  import "./chunk-FTWKAJGN.mjs";
16
16
  import {
17
17
  SUPPORTED_CHAIN_IDS,
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkZL4V5JY5cjs = require('./chunk-ZL4V5JY5.cjs');
5
+ require('./chunk-YNDHOII2.cjs');
6
+ require('./chunk-5TUOUPDB.cjs');
7
+ require('./chunk-OY5N3E6L.cjs');
8
+
9
+
10
+
11
+ exports.WithdrawModal = _chunkZL4V5JY5cjs.WithdrawModal; exports.buildWithdrawAnalyticsSessionProperties = _chunkZL4V5JY5cjs.buildWithdrawAnalyticsSessionProperties;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  WithdrawModal,
3
3
  buildWithdrawAnalyticsSessionProperties
4
- } from "./chunk-FXN3WQSG.mjs";
5
- import "./chunk-HWIWQPW5.mjs";
6
- import "./chunk-TYO3HW3A.mjs";
4
+ } from "./chunk-3VG2F47U.mjs";
5
+ import "./chunk-LU66AKMH.mjs";
6
+ import "./chunk-JBH6EPNM.mjs";
7
7
  import "./chunk-EAGMY3QE.mjs";
8
8
  export {
9
9
  WithdrawModal,
@@ -44,7 +44,7 @@ import {
44
44
  useTokenPrices,
45
45
  useWithdrawAnalyticsEmitter,
46
46
  warnRemovedProps
47
- } from "./chunk-HWIWQPW5.mjs";
47
+ } from "./chunk-LU66AKMH.mjs";
48
48
  import {
49
49
  NATIVE_TOKEN_ADDRESS,
50
50
  getChainIcon,
@@ -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-20260907094837";
2
+ var MODAL_VERSION = "0.0.0-dev-20260910165410";
3
3
  var SERVICE_HEADERS = {
4
4
  "Content-Type": "application/json",
5
5
  "x-deposit-modal-version": MODAL_VERSION
@@ -1,5 +1,5 @@
1
1
  // src/core/version.ts
2
- var MODAL_VERSION = "0.0.0-dev-20260907094837";
2
+ var MODAL_VERSION = "0.0.0-dev-20260910165410";
3
3
  var SERVICE_HEADERS = {
4
4
  "Content-Type": "application/json",
5
5
  "x-deposit-modal-version": MODAL_VERSION
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MODAL_VERSION,
3
3
  serviceHeaders
4
- } from "./chunk-TYO3HW3A.mjs";
4
+ } from "./chunk-JBH6EPNM.mjs";
5
5
  import {
6
6
  CHAIN_DISPLAY_ORDER,
7
7
  HYPERCORE_CHAIN_ID,
@@ -3062,19 +3062,37 @@ function filterVisibleDeposits(deposits) {
3062
3062
  }
3063
3063
 
3064
3064
  // src/core/history-badge.ts
3065
- function deriveHistoryBadge(deposits, { recipient, canRecover }) {
3065
+ var RECOVERY_INDICATOR_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
3066
+ function deriveHistoryBadgeState(deposits, {
3067
+ recipient,
3068
+ canRecover,
3069
+ evaluatedAt = Date.now()
3070
+ }) {
3066
3071
  const visible = filterVisibleDeposits(deposits);
3067
3072
  if (canRecover) {
3068
- const needsYou = visible.filter(
3069
- (row) => toRecoverableDeposit(row, { recipient }) !== null
3070
- ).length;
3071
- if (needsYou > 0) return { state: "needs-you", count: needsYou };
3073
+ let count = 0;
3074
+ let nextExpiryAt = null;
3075
+ for (const row of visible) {
3076
+ if (toRecoverableDeposit(row, { recipient }) === null) continue;
3077
+ const expiryAt = Date.parse(row.createdAt ?? "") + RECOVERY_INDICATOR_WINDOW_MS;
3078
+ if (!(evaluatedAt < expiryAt)) continue;
3079
+ count += 1;
3080
+ nextExpiryAt = nextExpiryAt === null ? expiryAt : Math.min(nextExpiryAt, expiryAt);
3081
+ }
3082
+ if (count > 0) {
3083
+ return {
3084
+ badge: { state: "needs-you", count },
3085
+ nextExpiryAt
3086
+ };
3087
+ }
3072
3088
  }
3073
3089
  const inProgress = visible.filter(
3074
3090
  (row) => isInFlight(normalizeStatus(row.status, row.isSpam))
3075
3091
  ).length;
3076
- if (inProgress > 0) return { state: "progress", count: inProgress };
3077
- return null;
3092
+ return {
3093
+ badge: inProgress > 0 ? { state: "progress", count: inProgress } : null,
3094
+ nextExpiryAt: null
3095
+ };
3078
3096
  }
3079
3097
  function historyBadgeAriaLabel(badge) {
3080
3098
  if (!badge) return "Deposit history";
@@ -5409,6 +5427,7 @@ function HistoryOverlay({
5409
5427
 
5410
5428
  // src/components/history/useHistoryPanel.ts
5411
5429
  import { useCallback as useCallback7, useEffect as useEffect11, useMemo as useMemo7, useRef as useRef8, useState as useState9 } from "react";
5430
+ var MAX_TIMEOUT_MS = 2147483647;
5412
5431
  function sortByCreatedAtDesc(items) {
5413
5432
  return [...items].sort((a, b) => {
5414
5433
  const at = a.createdAt ? Date.parse(a.createdAt) : 0;
@@ -5486,10 +5505,23 @@ function useHistoryPanel({
5486
5505
  },
5487
5506
  [recipient, service]
5488
5507
  );
5489
- const badge = useMemo7(
5490
- () => deriveHistoryBadge(deposits, { recipient, canRecover }),
5491
- [deposits, recipient, canRecover]
5492
- );
5508
+ const badgeState2 = deriveHistoryBadgeState(deposits, {
5509
+ recipient,
5510
+ canRecover
5511
+ });
5512
+ const badge = badgeState2.badge;
5513
+ useEffect11(() => {
5514
+ if (!isOpen || badgeState2.nextExpiryAt === null) return;
5515
+ const delay = Math.min(
5516
+ badgeState2.nextExpiryAt - Date.now(),
5517
+ MAX_TIMEOUT_MS
5518
+ );
5519
+ const timeout = setTimeout(
5520
+ () => setDeposits((current) => current.slice()),
5521
+ delay
5522
+ );
5523
+ return () => clearTimeout(timeout);
5524
+ }, [isOpen, badgeState2.nextExpiryAt]);
5493
5525
  const openPanel = useCallback7(() => {
5494
5526
  setIsPanelOpen(true);
5495
5527
  analytics?.visitOpened(badge);