@rhinestone/deposit-modal 0.14.0 → 0.14.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 (40) hide show
  1. package/README.md +6 -12
  2. package/dist/{ClaimModal-SEKNWRMA.mjs → ClaimModal-GDFENSLV.mjs} +5 -5
  3. package/dist/ClaimModal-L3FUBI5U.cjs +13 -0
  4. package/dist/{DepositModalReown-Q2JMLT47.mjs → DepositModalReown-2EVV64OA.mjs} +29 -27
  5. package/dist/{DepositModalReown-46LPVFB6.cjs → DepositModalReown-GAD45GIC.cjs} +76 -74
  6. package/dist/WithdrawModal-FAQH35NG.cjs +12 -0
  7. package/dist/{WithdrawModal-5ICGD4HJ.mjs → WithdrawModal-IKUHF5CF.mjs} +4 -4
  8. package/dist/{chunk-7ICSHJFE.cjs → chunk-4J5ADVIN.cjs} +71 -67
  9. package/dist/{chunk-KTUVSKR4.mjs → chunk-5Q5CSVKF.mjs} +74 -32
  10. package/dist/{chunk-LZFRL2AL.cjs → chunk-62UCV2LG.cjs} +3 -3
  11. package/dist/{chunk-X2IPAPXU.cjs → chunk-7AZFT2MV.cjs} +8 -8
  12. package/dist/{chunk-MTFJSE52.cjs → chunk-A6JPBMYY.cjs} +65 -65
  13. package/dist/{chunk-6KG642KH.cjs → chunk-AQVJUXSG.cjs} +1 -1
  14. package/dist/{chunk-PKML3XVS.mjs → chunk-GZ4GQ5MC.mjs} +2 -2
  15. package/dist/{chunk-V2OBGLJD.cjs → chunk-HAQOFI3D.cjs} +90 -60
  16. package/dist/{chunk-K4H6TGBE.mjs → chunk-LMG46EP2.mjs} +1 -1
  17. package/dist/{chunk-YCQZJQO6.cjs → chunk-NQMC5VKQ.cjs} +343 -301
  18. package/dist/{chunk-CFKC77SV.mjs → chunk-QACOOLOE.mjs} +3 -3
  19. package/dist/{chunk-WUJIKCFU.mjs → chunk-R5UQ3TN4.mjs} +1 -1
  20. package/dist/{chunk-IN77XSWO.mjs → chunk-UX35GYLM.mjs} +59 -29
  21. package/dist/{chunk-ZEO6ADM3.mjs → chunk-VALXN5IO.mjs} +2 -2
  22. package/dist/{chunk-7SR7ENVJ.mjs → chunk-XCTRKCNM.mjs} +6 -2
  23. package/dist/{chunk-YWMWI7PZ.cjs → chunk-YP7QVKQ6.cjs} +53 -53
  24. package/dist/claim.cjs +6 -6
  25. package/dist/claim.mjs +5 -5
  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 -6
  31. package/dist/deposit.mjs +5 -5
  32. package/dist/embed.cjs +18 -18
  33. package/dist/embed.mjs +8 -8
  34. package/dist/index.cjs +9 -9
  35. package/dist/index.mjs +8 -8
  36. package/dist/withdraw.cjs +5 -5
  37. package/dist/withdraw.mjs +4 -4
  38. package/package.json +7 -6
  39. package/dist/ClaimModal-IKTJU43Y.cjs +0 -13
  40. package/dist/WithdrawModal-VP6PMIRO.cjs +0 -12
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  RecoveryError,
3
3
  submitSignedRecovery
4
- } from "./chunk-ZEO6ADM3.mjs";
4
+ } from "./chunk-VALXN5IO.mjs";
5
5
  import {
6
6
  ListRow
7
- } from "./chunk-WUJIKCFU.mjs";
7
+ } from "./chunk-R5UQ3TN4.mjs";
8
8
  import {
9
9
  AlertTriangleIcon,
10
10
  AnalyticsSession,
@@ -32,7 +32,7 @@ import {
32
32
  useExplorerTxUrl,
33
33
  useLatestRef,
34
34
  useStableRpcUrls
35
- } from "./chunk-IN77XSWO.mjs";
35
+ } from "./chunk-UX35GYLM.mjs";
36
36
  import {
37
37
  getChainIcon,
38
38
  getChainName,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CdnIcon,
3
3
  ChevronRightIcon
4
- } from "./chunk-IN77XSWO.mjs";
4
+ } from "./chunk-UX35GYLM.mjs";
5
5
 
6
6
  // src/components/ui/ListRow.tsx
7
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MODAL_VERSION,
3
3
  serviceHeaders
4
- } from "./chunk-K4H6TGBE.mjs";
4
+ } from "./chunk-LMG46EP2.mjs";
5
5
  import {
6
6
  CHAIN_DISPLAY_ORDER,
7
7
  HYPERCORE_CHAIN_ID,
@@ -2894,8 +2894,12 @@ var FLUSH_DELAY_MS = 5e3;
2894
2894
  var MAX_BODY_BYTES = 48 * 1024;
2895
2895
  var TOKEN_REFRESH_MARGIN_MS = 6e4;
2896
2896
  var TOKEN_TIMEOUT_MS = 3e3;
2897
+ var CLOSE_MINT_WAIT_MS = 1500;
2897
2898
  var MAX_ATTEMPTS = 3;
2898
2899
  var MAX_BACKOFF_MS = 3e4;
2900
+ var IDLE = 0;
2901
+ var CLOSING = 1;
2902
+ var DISMISSAL = 2;
2899
2903
  var ENVELOPE_FIELDS = /* @__PURE__ */ new Set([
2900
2904
  "type",
2901
2905
  "timestamp",
@@ -2930,8 +2934,9 @@ function createIngestTransport(options) {
2930
2934
  let timer = null;
2931
2935
  let sending = false;
2932
2936
  let disposed = false;
2933
- let pendingTerminal = false;
2934
- let terminalRequested = false;
2937
+ let pendingRun = false;
2938
+ let urgency = IDLE;
2939
+ let minting = null;
2935
2940
  let mintAbort = null;
2936
2941
  const sleepers = /* @__PURE__ */ new Set();
2937
2942
  function report(reason, status) {
@@ -3013,7 +3018,7 @@ function createIngestTransport(options) {
3013
3018
  signal: controller?.signal
3014
3019
  });
3015
3020
  } catch {
3016
- if (!terminalRequested) {
3021
+ if (urgency !== DISMISSAL) {
3017
3022
  mintFailures += 1;
3018
3023
  mintBackoffUntil = now() + backoff(mintFailures);
3019
3024
  }
@@ -3045,19 +3050,28 @@ function createIngestTransport(options) {
3045
3050
  report("token_unavailable", response.status);
3046
3051
  }
3047
3052
  }
3048
- async function ensureToken() {
3053
+ function startMint() {
3054
+ if (!minting) {
3055
+ minting = mintToken().finally(() => {
3056
+ minting = null;
3057
+ });
3058
+ }
3059
+ return minting;
3060
+ }
3061
+ async function ensureToken(maxWaitMs) {
3049
3062
  if (mintUnavailable) return;
3050
3063
  if (token && token.expiresAt - now() > TOKEN_REFRESH_MARGIN_MS) return;
3051
3064
  if (now() < mintBackoffUntil) return;
3052
- await mintToken();
3065
+ const pending = startMint();
3066
+ await (maxWaitMs === void 0 ? pending : Promise.race([pending, sleep(maxWaitMs)]));
3053
3067
  }
3054
- async function deliver(batch, isTerminal) {
3068
+ async function deliver(batch) {
3055
3069
  if (!fetchImpl) return drop(batch, "unsupported");
3056
3070
  let attempt = 0;
3057
3071
  let refreshed = false;
3058
3072
  let unattributed = false;
3059
3073
  for (; ; ) {
3060
- const terminal = isTerminal || terminalRequested;
3074
+ const terminal = urgency === DISMISSAL;
3061
3075
  attempt += 1;
3062
3076
  const headers = {
3063
3077
  "Content-Type": "application/json"
@@ -3084,7 +3098,7 @@ function createIngestTransport(options) {
3084
3098
  token = null;
3085
3099
  if (!refreshed && !terminal) {
3086
3100
  refreshed = true;
3087
- await mintToken();
3101
+ await startMint();
3088
3102
  if (token) continue;
3089
3103
  }
3090
3104
  if (!unattributed) {
@@ -3104,33 +3118,47 @@ function createIngestTransport(options) {
3104
3118
  return drop(batch, "rejected", status);
3105
3119
  }
3106
3120
  }
3107
- async function run(requestedTerminal) {
3108
- if (requestedTerminal) terminalRequested = true;
3121
+ function escalate(level) {
3122
+ if (level <= urgency) return;
3123
+ urgency = level;
3124
+ if (level === DISMISSAL) interruptForUnload();
3125
+ }
3126
+ function onDismissal(event) {
3127
+ if (event.type === "pagehide" || document.visibilityState === "hidden") {
3128
+ escalate(DISMISSAL);
3129
+ }
3130
+ }
3131
+ function dismissalGuard(attach) {
3132
+ if (typeof window === "undefined" || typeof document === "undefined") return;
3133
+ const bind = attach ? "addEventListener" : "removeEventListener";
3134
+ window[bind]("pagehide", onDismissal);
3135
+ document[bind]("visibilitychange", onDismissal);
3136
+ }
3137
+ async function run(level) {
3138
+ escalate(level);
3109
3139
  if (sending) {
3110
- if (requestedTerminal) {
3111
- pendingTerminal = true;
3112
- interruptForUnload();
3113
- }
3140
+ pendingRun = true;
3114
3141
  return;
3115
3142
  }
3116
3143
  sending = true;
3117
3144
  try {
3118
3145
  while (queue.length > 0) {
3119
- const terminal = requestedTerminal || terminalRequested;
3120
3146
  const batch = takeBatch();
3121
- if (!terminal) await ensureToken();
3122
- await deliver(batch, terminal);
3123
- if (!terminal && disposed) break;
3147
+ if (urgency !== DISMISSAL) {
3148
+ await ensureToken(urgency === CLOSING ? CLOSE_MINT_WAIT_MS : void 0);
3149
+ }
3150
+ await deliver(batch);
3124
3151
  }
3125
3152
  } finally {
3126
3153
  sending = false;
3127
3154
  }
3128
- if (pendingTerminal) {
3129
- pendingTerminal = false;
3130
- await run(true);
3155
+ if (pendingRun) {
3156
+ pendingRun = false;
3157
+ await run(urgency);
3131
3158
  return;
3132
3159
  }
3133
- if (!disposed && queue.length === 0) terminalRequested = false;
3160
+ if (!disposed) urgency = IDLE;
3161
+ else dismissalGuard(false);
3134
3162
  }
3135
3163
  function clearFlushTimer() {
3136
3164
  if (timer !== null) {
@@ -3142,35 +3170,37 @@ function createIngestTransport(options) {
3142
3170
  if (timer !== null || disposed) return;
3143
3171
  timer = setTimeout(() => {
3144
3172
  timer = null;
3145
- void run(false);
3173
+ void run(IDLE);
3146
3174
  }, FLUSH_DELAY_MS);
3147
3175
  }
3148
3176
  return {
3149
3177
  enqueue(event) {
3150
3178
  if (disposed) return;
3151
3179
  queue.push(toWireEvent(event));
3180
+ if (sequence === 1) void ensureToken();
3152
3181
  if (queue.length > MAX_QUEUE) {
3153
3182
  dropped += queue.length - MAX_QUEUE;
3154
3183
  queue.splice(0, queue.length - MAX_QUEUE);
3155
3184
  }
3156
3185
  if (queue.length >= MAX_BATCH) {
3157
3186
  clearFlushTimer();
3158
- void run(false);
3187
+ void run(IDLE);
3159
3188
  } else {
3160
3189
  scheduleFlush();
3161
3190
  }
3162
3191
  },
3163
3192
  flush(flushOptions) {
3164
- const terminal = flushOptions?.terminal ?? false;
3165
- if (disposed && !terminal) return;
3193
+ const dismissal = flushOptions?.terminal ?? false;
3194
+ if (disposed && !dismissal) return;
3166
3195
  clearFlushTimer();
3167
- void run(terminal);
3196
+ void run(dismissal ? DISMISSAL : IDLE);
3168
3197
  },
3169
3198
  dispose() {
3170
3199
  if (disposed) return;
3171
3200
  disposed = true;
3172
3201
  clearFlushTimer();
3173
- void run(true);
3202
+ dismissalGuard(true);
3203
+ void run(CLOSING);
3174
3204
  }
3175
3205
  };
3176
3206
  }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  debugError,
3
3
  debugLog
4
- } from "./chunk-IN77XSWO.mjs";
4
+ } from "./chunk-UX35GYLM.mjs";
5
5
  import {
6
6
  serviceHeaders
7
- } from "./chunk-K4H6TGBE.mjs";
7
+ } from "./chunk-LMG46EP2.mjs";
8
8
 
9
9
  // src/core/recovery.ts
10
10
  var RECOVER_DOMAIN = {
@@ -24,7 +24,7 @@ import {
24
24
  tokenAmountToNumber,
25
25
  useExplorerTxUrl,
26
26
  useLatestRef
27
- } from "./chunk-IN77XSWO.mjs";
27
+ } from "./chunk-UX35GYLM.mjs";
28
28
  import {
29
29
  NATIVE_TOKEN_ADDRESS,
30
30
  SOLANA_MAINNET_CAIP2,
@@ -932,6 +932,7 @@ function ProcessingStep({
932
932
  const onErrorRef = useLatestRef(onError);
933
933
  const explorerTxUrl = useExplorerTxUrl();
934
934
  const initialTerminalEventRef = useRef2(null);
935
+ const completedDirectTransferTxHashRef = useRef2(null);
935
936
  const [state, setState] = useState4(() => {
936
937
  if (directTransfer) return { type: "complete" };
937
938
  const initial = getInitialProcessingState(
@@ -967,7 +968,10 @@ function ProcessingStep({
967
968
  [txHash]
968
969
  );
969
970
  useEffect3(() => {
970
- if (!directTransfer) return;
971
+ if (!directTransfer || completedDirectTransferTxHashRef.current === txHash) {
972
+ return;
973
+ }
974
+ completedDirectTransferTxHashRef.current = txHash;
971
975
  const completedAt = Date.now();
972
976
  updatePhaseTimings(() => ({
973
977
  startedAt: startTimeRef.current,
@@ -1,10 +1,10 @@
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 _chunkX2IPAPXUcjs = require('./chunk-X2IPAPXU.cjs');
4
+ var _chunk7AZFT2MVcjs = require('./chunk-7AZFT2MV.cjs');
5
5
 
6
6
 
7
- var _chunkLZFRL2ALcjs = require('./chunk-LZFRL2AL.cjs');
7
+ var _chunk62UCV2LGcjs = require('./chunk-62UCV2LG.cjs');
8
8
 
9
9
 
10
10
 
@@ -32,7 +32,7 @@ var _chunkLZFRL2ALcjs = require('./chunk-LZFRL2AL.cjs');
32
32
 
33
33
 
34
34
 
35
- var _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
35
+ var _chunkHAQOFI3Dcjs = require('./chunk-HAQOFI3D.cjs');
36
36
 
37
37
 
38
38
 
@@ -69,7 +69,7 @@ var Input = _react.forwardRef.call(void 0,
69
69
  }
70
70
  ),
71
71
  error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-input-error", children: [
72
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.AlertTriangleIcon, { className: "rs-input-error-icon" }),
72
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.AlertTriangleIcon, { className: "rs-input-error-icon" }),
73
73
  error
74
74
  ] })
75
75
  ] });
@@ -85,7 +85,7 @@ Input.displayName = "Input";
85
85
 
86
86
 
87
87
  function claimFailureReasonForError(error) {
88
- if (!(error instanceof _chunkX2IPAPXUcjs.RecoveryError)) return "refund_failed";
88
+ if (!(error instanceof _chunk7AZFT2MVcjs.RecoveryError)) return "refund_failed";
89
89
  switch (error.code) {
90
90
  case "SIGNATURE_INVALID":
91
91
  return "signature_invalid";
@@ -253,7 +253,7 @@ function ClaimAnalyticsControllerProvider({
253
253
  children,
254
254
  controllerRef
255
255
  }) {
256
- const emit = _chunkV2OBGLJDcjs.useClaimAnalyticsEmitter.call(void 0, );
256
+ const emit = _chunkHAQOFI3Dcjs.useClaimAnalyticsEmitter.call(void 0, );
257
257
  const controller = _react.useMemo.call(void 0, () => createClaimAnalyticsController(emit), [emit]);
258
258
  if (controllerRef) controllerRef.current = controller;
259
259
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ClaimAnalyticsControllerContext.Provider, { value: controller, children });
@@ -278,7 +278,7 @@ function describeDeposit(row) {
278
278
  const symbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, row.token, chainId);
279
279
  const raw = BigInt(_nullishCoalesce(_nullishCoalesce(row.sourceAmount, () => ( row.amount)), () => ( "0")));
280
280
  const human = Number(_viem.formatUnits.call(void 0, raw, decimals));
281
- const amount = _nullishCoalesce(_chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, human, symbol), () => ( _viem.formatUnits.call(void 0, raw, decimals)));
281
+ const amount = _nullishCoalesce(_chunkHAQOFI3Dcjs.formatTokenAmount.call(void 0, human, symbol), () => ( _viem.formatUnits.call(void 0, raw, decimals)));
282
282
  return {
283
283
  chainId,
284
284
  symbol,
@@ -399,17 +399,17 @@ function ClaimModal({
399
399
  debug,
400
400
  onUiState
401
401
  }) {
402
- _chunkV2OBGLJDcjs.checkBackendUrl.call(void 0, "ClaimModal", backendUrl);
402
+ _chunkHAQOFI3Dcjs.checkBackendUrl.call(void 0, "ClaimModal", backendUrl);
403
403
  const modalRef = _react.useRef.call(void 0, null);
404
- const onReadyRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onReady);
405
- const onLifecycleRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onLifecycle);
406
- const onErrorRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onError);
404
+ const onReadyRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onReady);
405
+ const onLifecycleRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onLifecycle);
406
+ const onErrorRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onError);
407
407
  const analyticsControllerRef = _react.useRef.call(void 0, null);
408
408
  const lastSubmitFailureRef = _react.useRef.call(void 0, null);
409
409
  const previousOpenRef = _react.useRef.call(void 0, isOpen);
410
- const rpcUrls = _chunkV2OBGLJDcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
410
+ const rpcUrls = _chunkHAQOFI3Dcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
411
411
  const service = _react.useMemo.call(void 0,
412
- () => _chunkV2OBGLJDcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:claim" }),
412
+ () => _chunkHAQOFI3Dcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:claim" }),
413
413
  [backendUrl, debug]
414
414
  );
415
415
  const [state, dispatch] = _react.useReducer.call(void 0, claimReducer, INITIAL_STATE);
@@ -418,7 +418,7 @@ function ClaimModal({
418
418
  isOpenRef.current = isOpen;
419
419
  _react.useEffect.call(void 0, () => {
420
420
  if (!isOpen || !modalRef.current) return;
421
- return _chunkV2OBGLJDcjs.applyTheme.call(void 0, modalRef.current, theme);
421
+ return _chunkHAQOFI3Dcjs.applyTheme.call(void 0, modalRef.current, theme);
422
422
  }, [isOpen, theme]);
423
423
  _react.useEffect.call(void 0, () => {
424
424
  if (isOpen) {
@@ -477,7 +477,7 @@ function ClaimModal({
477
477
  dispatch({ type: "back" });
478
478
  }, [state.step]);
479
479
  const canGoBack = state.step === "select" || state.step === "review" || state.step === "failed";
480
- const onUiStateRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onUiState);
480
+ const onUiStateRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onUiState);
481
481
  _react.useEffect.call(void 0, () => {
482
482
  _optionalChain([onUiStateRef, 'access', _22 => _22.current, 'optionalCall', _23 => _23({
483
483
  screen: state.step,
@@ -486,8 +486,8 @@ function ClaimModal({
486
486
  })]);
487
487
  }, [state.step, canGoBack, goBack, onUiStateRef]);
488
488
  const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _24 => _24.showBackButton]), () => ( true));
489
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
490
- _chunkV2OBGLJDcjs.Modal,
489
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
490
+ _chunkHAQOFI3Dcjs.Modal,
491
491
  {
492
492
  isOpen,
493
493
  onClose: handleModalDismiss,
@@ -495,7 +495,7 @@ function ClaimModal({
495
495
  inline,
496
496
  closeOnOverlayClick,
497
497
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
498
- _chunkV2OBGLJDcjs.AnalyticsSession,
498
+ _chunkHAQOFI3Dcjs.AnalyticsSession,
499
499
  {
500
500
  modal: "claim",
501
501
  sessionProperties: buildClaimAnalyticsSessionProperties({
@@ -517,7 +517,7 @@ function ClaimModal({
517
517
  className: "rs-modal-header-back",
518
518
  "aria-label": "Go back",
519
519
  onClick: goBack,
520
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronLeftIcon, {})
520
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronLeftIcon, {})
521
521
  }
522
522
  ) }),
523
523
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -528,7 +528,7 @@ function ClaimModal({
528
528
  disabled: state.step === "processing",
529
529
  className: "rs-modal-close",
530
530
  "aria-label": "Close",
531
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CloseIcon, {})
531
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {})
532
532
  }
533
533
  ) })
534
534
  ] }),
@@ -687,7 +687,7 @@ function ClaimBody({
687
687
  chain: sourceChainId
688
688
  })]);
689
689
  try {
690
- const result = await _chunkX2IPAPXUcjs.submitSignedRecovery.call(void 0, {
690
+ const result = await _chunk7AZFT2MVcjs.submitSignedRecovery.call(void 0, {
691
691
  backendUrl,
692
692
  chainId: sourceChainId,
693
693
  depositId: deposit.id,
@@ -703,7 +703,7 @@ function ClaimBody({
703
703
  const refundedRaw = BigInt(
704
704
  _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(result.amount, () => ( deposit.sourceAmount)), () => ( deposit.amount)), () => ( "0"))
705
705
  );
706
- const amountDisplay = _nullishCoalesce(_chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, Number(_viem.formatUnits.call(void 0, refundedRaw, decimals)), symbol), () => ( _viem.formatUnits.call(void 0, refundedRaw, decimals)));
706
+ const amountDisplay = _nullishCoalesce(_chunkHAQOFI3Dcjs.formatTokenAmount.call(void 0, Number(_viem.formatUnits.call(void 0, refundedRaw, decimals)), symbol), () => ( _viem.formatUnits.call(void 0, refundedRaw, decimals)));
707
707
  dispatch({
708
708
  type: "complete",
709
709
  txHash: result.transactionHash,
@@ -734,9 +734,9 @@ function ClaimBody({
734
734
  })]);
735
735
  } catch (err) {
736
736
  if (!isCurrentOperation()) return;
737
- const recoveryError = err instanceof _chunkX2IPAPXUcjs.RecoveryError ? err : void 0;
737
+ const recoveryError = err instanceof _chunk7AZFT2MVcjs.RecoveryError ? err : void 0;
738
738
  const status = _optionalChain([recoveryError, 'optionalAccess', _29 => _29.status]);
739
- const message = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _30 => _30.message]), () => ( _chunkV2OBGLJDcjs.formatUserError.call(void 0,
739
+ const message = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _30 => _30.message]), () => ( _chunkHAQOFI3Dcjs.formatUserError.call(void 0,
740
740
  err instanceof Error ? err.message : "Recovery failed"
741
741
  )));
742
742
  const retryable = _nullishCoalesce(_optionalChain([recoveryError, 'optionalAccess', _31 => _31.retryable]), () => ( true));
@@ -807,7 +807,7 @@ function LookupStep({
807
807
  onResults(deposits);
808
808
  } catch (err) {
809
809
  if (!isCurrentOperation()) return;
810
- const message = _chunkV2OBGLJDcjs.formatUserError.call(void 0,
810
+ const message = _chunkHAQOFI3Dcjs.formatUserError.call(void 0,
811
811
  err instanceof Error ? err.message : "Lookup failed"
812
812
  );
813
813
  analytics.failure("lookup_failed", true, "lookup");
@@ -829,9 +829,9 @@ function LookupStep({
829
829
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
830
830
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
831
831
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
832
- _chunkV2OBGLJDcjs.BodyHeader,
832
+ _chunkHAQOFI3Dcjs.BodyHeader,
833
833
  {
834
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HandCoinsIcon, {}),
834
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HandCoinsIcon, {}),
835
835
  title: "Claim a deposit",
836
836
  subtitle: "Get funds from a failed deposit sent back to you on the source chain."
837
837
  }
@@ -846,9 +846,9 @@ function LookupStep({
846
846
  error: trimmed.length > 0 && !validTxHash ? "Enter a valid transaction hash" : void 0
847
847
  }
848
848
  ),
849
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
849
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
850
850
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
851
- _chunkV2OBGLJDcjs.Button,
851
+ _chunkHAQOFI3Dcjs.Button,
852
852
  {
853
853
  onClick: handleLookup,
854
854
  loading,
@@ -859,7 +859,7 @@ function LookupStep({
859
859
  }
860
860
  )
861
861
  ] }),
862
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
862
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
863
863
  ] });
864
864
  }
865
865
  function SelectStep({
@@ -869,9 +869,9 @@ function SelectStep({
869
869
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
870
870
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
871
871
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
872
- _chunkV2OBGLJDcjs.BodyHeader,
872
+ _chunkHAQOFI3Dcjs.BodyHeader,
873
873
  {
874
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CoinsIcon, {}),
874
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CoinsIcon, {}),
875
875
  title: "Select a deposit",
876
876
  subtitle: "This transaction produced multiple deposits. Choose the one to claim."
877
877
  }
@@ -880,7 +880,7 @@ function SelectStep({
880
880
  const { symbol, amount, chainName } = describeDeposit(row);
881
881
  const eligible = isEligible(row);
882
882
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
883
- _chunkLZFRL2ALcjs.ListRow,
883
+ _chunk62UCV2LGcjs.ListRow,
884
884
  {
885
885
  leadingMedia: _chunk4KCSH4T3cjs.tokenIconUrl.call(void 0, symbol),
886
886
  title: `${amount} ${symbol}`,
@@ -893,7 +893,7 @@ function SelectStep({
893
893
  );
894
894
  }) })
895
895
  ] }),
896
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
896
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
897
897
  ] });
898
898
  }
899
899
  function ReviewStep({
@@ -904,7 +904,7 @@ function ReviewStep({
904
904
  }) {
905
905
  const analytics = useClaimAnalyticsController();
906
906
  const { chainId, symbol, amount, chainName, chainIcon } = describeDeposit(deposit);
907
- const explorerTxUrl = _chunkV2OBGLJDcjs.useExplorerTxUrl.call(void 0, );
907
+ const explorerTxUrl = _chunkHAQOFI3Dcjs.useExplorerTxUrl.call(void 0, );
908
908
  const [destination, setDestination] = _react.useState.call(void 0, _nullishCoalesce(defaultRefundDestination, () => ( "")));
909
909
  const destinationValid = _viem.isAddress.call(void 0, destination);
910
910
  _react.useEffect.call(void 0, () => {
@@ -915,9 +915,9 @@ function ReviewStep({
915
915
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
916
916
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
917
917
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
918
- _chunkV2OBGLJDcjs.BodyHeader,
918
+ _chunkHAQOFI3Dcjs.BodyHeader,
919
919
  {
920
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HandCoinsIcon, {}),
920
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.HandCoinsIcon, {}),
921
921
  title: "Review refund",
922
922
  subtitle: "This returns the funds on the source chain. It does not retry the original bridge."
923
923
  }
@@ -931,14 +931,14 @@ function ReviewStep({
931
931
  " ",
932
932
  symbol
933
933
  ] }),
934
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol }) })
934
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol }) })
935
935
  ] })
936
936
  ] }),
937
937
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
938
938
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
939
939
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
940
940
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
941
- chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: chainIcon }) })
941
+ chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: chainIcon }) })
942
942
  ] })
943
943
  ] }),
944
944
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
@@ -955,7 +955,7 @@ function ReviewStep({
955
955
  rel: "noreferrer",
956
956
  children: [
957
957
  short,
958
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ExternalLinkIcon, {})
958
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ExternalLinkIcon, {})
959
959
  ]
960
960
  }
961
961
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: short });
@@ -973,7 +973,7 @@ function ReviewStep({
973
973
  }
974
974
  ),
975
975
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
976
- _chunkV2OBGLJDcjs.Button,
976
+ _chunkHAQOFI3Dcjs.Button,
977
977
  {
978
978
  onClick: () => destinationValid && onSubmit(destination),
979
979
  loading: submitting,
@@ -984,7 +984,7 @@ function ReviewStep({
984
984
  }
985
985
  )
986
986
  ] }),
987
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
987
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
988
988
  ] });
989
989
  }
990
990
  function ResultStep({
@@ -995,13 +995,13 @@ function ResultStep({
995
995
  onRetry
996
996
  }) {
997
997
  const success = !!result;
998
- const explorerTxUrl = _chunkV2OBGLJDcjs.useExplorerTxUrl.call(void 0, );
998
+ const explorerTxUrl = _chunkHAQOFI3Dcjs.useExplorerTxUrl.call(void 0, );
999
999
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
1000
1000
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
1001
1001
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1002
- _chunkV2OBGLJDcjs.BodyHeader,
1002
+ _chunkHAQOFI3Dcjs.BodyHeader,
1003
1003
  {
1004
- icon: success ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.AlertTriangleIcon, {}),
1004
+ icon: success ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.AlertTriangleIcon, {}),
1005
1005
  variant: success ? "success" : "error",
1006
1006
  title: success ? "Refund submitted" : "Refund failed",
1007
1007
  subtitle: success ? "Your funds are being returned on the source chain." : void 0
@@ -1016,7 +1016,7 @@ function ResultStep({
1016
1016
  " ",
1017
1017
  result.symbol
1018
1018
  ] }),
1019
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: result.symbol }) })
1019
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: result.symbol }) })
1020
1020
  ] })
1021
1021
  ] }),
1022
1022
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
@@ -1037,22 +1037,22 @@ function ResultStep({
1037
1037
  rel: "noreferrer",
1038
1038
  children: [
1039
1039
  short,
1040
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ExternalLinkIcon, {})
1040
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ExternalLinkIcon, {})
1041
1041
  ]
1042
1042
  }
1043
1043
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: short });
1044
1044
  })()
1045
1045
  ] })
1046
- ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
1046
+ ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
1047
1047
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen-button-row", children: success ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1048
- onReset && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { variant: "outline", onClick: onReset, fullWidth: true, children: "Claim another deposit" }),
1049
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
1048
+ onReset && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Button, { variant: "outline", onClick: onReset, fullWidth: true, children: "Claim another deposit" }),
1049
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Button, { onClick: onClose, fullWidth: true, children: "Done" })
1050
1050
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1051
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
1052
- onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { onClick: onRetry, fullWidth: true, children: "Try again" })
1051
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
1052
+ onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Button, { onClick: onRetry, fullWidth: true, children: "Try again" })
1053
1053
  ] }) })
1054
1054
  ] }),
1055
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
1055
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
1056
1056
  ] });
1057
1057
  }
1058
1058
 
package/dist/claim.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYWMWI7PZcjs = require('./chunk-YWMWI7PZ.cjs');
4
- require('./chunk-X2IPAPXU.cjs');
5
- require('./chunk-LZFRL2AL.cjs');
6
- require('./chunk-V2OBGLJD.cjs');
7
- require('./chunk-6KG642KH.cjs');
3
+ var _chunkYP7QVKQ6cjs = require('./chunk-YP7QVKQ6.cjs');
4
+ require('./chunk-7AZFT2MV.cjs');
5
+ require('./chunk-62UCV2LG.cjs');
6
+ require('./chunk-HAQOFI3D.cjs');
7
+ require('./chunk-AQVJUXSG.cjs');
8
8
  require('./chunk-4KCSH4T3.cjs');
9
9
 
10
10
 
11
- exports.ClaimModal = _chunkYWMWI7PZcjs.ClaimModal;
11
+ exports.ClaimModal = _chunkYP7QVKQ6cjs.ClaimModal;
package/dist/claim.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ClaimModal
3
- } from "./chunk-CFKC77SV.mjs";
4
- import "./chunk-ZEO6ADM3.mjs";
5
- import "./chunk-WUJIKCFU.mjs";
6
- import "./chunk-IN77XSWO.mjs";
7
- import "./chunk-K4H6TGBE.mjs";
3
+ } from "./chunk-QACOOLOE.mjs";
4
+ import "./chunk-VALXN5IO.mjs";
5
+ import "./chunk-R5UQ3TN4.mjs";
6
+ import "./chunk-UX35GYLM.mjs";
7
+ import "./chunk-LMG46EP2.mjs";
8
8
  import "./chunk-VUATPOWJ.mjs";
9
9
  export {
10
10
  ClaimModal