@rhinestone/deposit-modal 0.1.65 → 0.1.67

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 (34) hide show
  1. package/dist/{DepositModalReown-Y4M3RA73.mjs → DepositModalReown-EYIV6APK.mjs} +3 -3
  2. package/dist/{DepositModalReown-6ZMLUWWD.cjs → DepositModalReown-UPYZN2XA.cjs} +4 -4
  3. package/dist/{WithdrawModalReown-HVBMAUPM.mjs → WithdrawModalReown-6VYKKKJN.mjs} +3 -3
  4. package/dist/{WithdrawModalReown-WJ5SHBV4.cjs → WithdrawModalReown-WHPQDJJJ.cjs} +4 -4
  5. package/dist/{chunk-RKRF7ANK.mjs → chunk-5FDIQNJJ.mjs} +22 -19
  6. package/dist/{chunk-4CZ7W3RS.cjs → chunk-FLVSQDP4.cjs} +181 -132
  7. package/dist/{chunk-GAHX5RAT.mjs → chunk-IUW3SJQT.mjs} +103 -54
  8. package/dist/{chunk-MGV75YLV.cjs → chunk-LTLFJPHO.cjs} +106 -103
  9. package/dist/{chunk-R6U6BHCV.cjs → chunk-MUWVDVY4.cjs} +13 -1
  10. package/dist/{chunk-IYZGLNY6.mjs → chunk-NFE5ZLD3.mjs} +1171 -374
  11. package/dist/{chunk-CIXHTOO3.mjs → chunk-SDZKKUCJ.mjs} +13 -1
  12. package/dist/{chunk-OWV4KVBM.cjs → chunk-UDKZWFCM.cjs} +1251 -454
  13. package/dist/constants.cjs +2 -2
  14. package/dist/constants.mjs +1 -1
  15. package/dist/deposit.cjs +4 -4
  16. package/dist/deposit.d.cts +2 -2
  17. package/dist/deposit.d.ts +2 -2
  18. package/dist/deposit.mjs +3 -3
  19. package/dist/index.cjs +5 -5
  20. package/dist/index.d.cts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.mjs +4 -4
  23. package/dist/reown.cjs +5 -5
  24. package/dist/reown.d.cts +1 -1
  25. package/dist/reown.d.ts +1 -1
  26. package/dist/reown.mjs +4 -4
  27. package/dist/styles.css +696 -34
  28. package/dist/{types-BLIqLF0c.d.ts → types-DGQzvl6v.d.ts} +12 -1
  29. package/dist/{types-7IoN8k-P.d.cts → types-DJ1fzNC7.d.cts} +12 -1
  30. package/dist/withdraw.cjs +4 -4
  31. package/dist/withdraw.d.cts +2 -2
  32. package/dist/withdraw.d.ts +2 -2
  33. package/dist/withdraw.mjs +3 -3
  34. package/package.json +5 -5
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DepositModalInner
3
- } from "./chunk-IYZGLNY6.mjs";
3
+ } from "./chunk-NFE5ZLD3.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-GAHX5RAT.mjs";
9
- import "./chunk-CIXHTOO3.mjs";
8
+ import "./chunk-IUW3SJQT.mjs";
9
+ import "./chunk-SDZKKUCJ.mjs";
10
10
 
11
11
  // src/DepositModalReown.tsx
12
12
  import { useCallback, useMemo } from "react";
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkOWV4KVBMcjs = require('./chunk-OWV4KVBM.cjs');
3
+ var _chunkUDKZWFCMcjs = require('./chunk-UDKZWFCM.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-4CZ7W3RS.cjs');
9
- require('./chunk-R6U6BHCV.cjs');
8
+ require('./chunk-FLVSQDP4.cjs');
9
+ require('./chunk-MUWVDVY4.cjs');
10
10
 
11
11
  // src/DepositModalReown.tsx
12
12
  var _react = require('react');
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
32
32
  reown.disconnect();
33
33
  }, [reown.disconnect]);
34
34
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
35
- _chunkOWV4KVBMcjs.DepositModalInner,
35
+ _chunkUDKZWFCMcjs.DepositModalInner,
36
36
  {
37
37
  ...props,
38
38
  reownWallet: reownWithSolana,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  WithdrawModalInner
3
- } from "./chunk-RKRF7ANK.mjs";
3
+ } from "./chunk-5FDIQNJJ.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-GAHX5RAT.mjs";
9
- import "./chunk-CIXHTOO3.mjs";
8
+ import "./chunk-IUW3SJQT.mjs";
9
+ import "./chunk-SDZKKUCJ.mjs";
10
10
 
11
11
  // src/WithdrawModalReown.tsx
12
12
  import { useCallback } from "react";
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkMGV75YLVcjs = require('./chunk-MGV75YLV.cjs');
3
+ var _chunkLTLFJPHOcjs = require('./chunk-LTLFJPHO.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-4CZ7W3RS.cjs');
9
- require('./chunk-R6U6BHCV.cjs');
8
+ require('./chunk-FLVSQDP4.cjs');
9
+ require('./chunk-MUWVDVY4.cjs');
10
10
 
11
11
  // src/WithdrawModalReown.tsx
12
12
  var _react = require('react');
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
20
20
  reown.disconnect();
21
21
  }, [reown.disconnect]);
22
22
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23
- _chunkMGV75YLVcjs.WithdrawModalInner,
23
+ _chunkLTLFJPHOcjs.WithdrawModalInner,
24
24
  {
25
25
  ...props,
26
26
  reownWallet: reown,
@@ -21,7 +21,7 @@ import {
21
21
  saveSessionOwnerToStorage,
22
22
  toEvmCaip2,
23
23
  useLatestRef
24
- } from "./chunk-GAHX5RAT.mjs";
24
+ } from "./chunk-IUW3SJQT.mjs";
25
25
  import {
26
26
  DEFAULT_BACKEND_URL,
27
27
  DEFAULT_SIGNER_ADDRESS,
@@ -34,7 +34,7 @@ import {
34
34
  getTokenDecimalsByAddress,
35
35
  getTokenIcon,
36
36
  getTokenSymbol
37
- } from "./chunk-CIXHTOO3.mjs";
37
+ } from "./chunk-SDZKKUCJ.mjs";
38
38
 
39
39
  // src/WithdrawModal.tsx
40
40
  import {
@@ -894,6 +894,11 @@ function WithdrawFlow({
894
894
  const onStepChangeRef = useLatestRef(onStepChange);
895
895
  const onTotalBalanceChangeRef = useLatestRef(onTotalBalanceChange);
896
896
  const onEventRef = useLatestRef(onEvent);
897
+ const onConnectedRef = useLatestRef(onConnected);
898
+ const onWithdrawSubmittedRef = useLatestRef(onWithdrawSubmitted);
899
+ const onWithdrawCompleteRef = useLatestRef(onWithdrawComplete);
900
+ const onWithdrawFailedRef = useLatestRef(onWithdrawFailed);
901
+ const onErrorRef = useLatestRef(onError);
897
902
  const [step, setStep] = useState2({ type: "form" });
898
903
  const [isSubmitting, setIsSubmitting] = useState2(false);
899
904
  const [totalBalanceUsd, setTotalBalanceUsd] = useState2(0);
@@ -1072,16 +1077,16 @@ function WithdrawFlow({
1072
1077
  const handleConnected = useCallback2(
1073
1078
  (addr, smartAccount) => {
1074
1079
  logFlow("setup:connected", { address: addr, smartAccount });
1075
- onConnected?.({ address: addr, smartAccount });
1080
+ onConnectedRef.current?.({ address: addr, smartAccount });
1076
1081
  },
1077
- [logFlow, onConnected]
1082
+ [logFlow, onConnectedRef]
1078
1083
  );
1079
1084
  const handleError = useCallback2(
1080
1085
  (message, code) => {
1081
1086
  logFlowError("flow:error", message, { code });
1082
- onError?.({ message, code });
1087
+ onErrorRef.current?.({ message, code });
1083
1088
  },
1084
- [logFlowError, onError]
1089
+ [logFlowError, onErrorRef]
1085
1090
  );
1086
1091
  const resolveSessionOwner = useCallback2(async (eoaAddress) => {
1087
1092
  const localOwner = loadSessionOwnerFromStorage(eoaAddress);
@@ -1102,7 +1107,7 @@ function WithdrawFlow({
1102
1107
  async (recipient, amountValue) => {
1103
1108
  const tokenSymbol = getTokenSymbol(targetToken, targetChain);
1104
1109
  const chainName = getChainName(targetChain);
1105
- onEvent?.({
1110
+ onEventRef.current?.({
1106
1111
  type: "withdraw_modal_select_amount_cta_click",
1107
1112
  pred_balance: totalBalanceUsd,
1108
1113
  selected_token: tokenSymbol,
@@ -1242,7 +1247,7 @@ function WithdrawFlow({
1242
1247
  sourceChain,
1243
1248
  sourceToken
1244
1249
  });
1245
- onWithdrawSubmitted?.({
1250
+ onWithdrawSubmittedRef.current?.({
1246
1251
  txHash: result.txHash,
1247
1252
  sourceChain,
1248
1253
  amount: amountUnits.toString(),
@@ -1284,20 +1289,20 @@ function WithdrawFlow({
1284
1289
  safeAddress,
1285
1290
  sourceToken,
1286
1291
  sourceChain,
1287
- onWithdrawSubmitted,
1288
1292
  onSignTransaction,
1289
1293
  isSourceNative,
1290
1294
  handleError,
1291
1295
  logFlow,
1292
1296
  logFlowError,
1293
- onEvent,
1294
- totalBalanceUsd
1297
+ onEventRef,
1298
+ totalBalanceUsd,
1299
+ onWithdrawSubmittedRef
1295
1300
  ]
1296
1301
  );
1297
1302
  const handleWithdrawComplete = useCallback2(
1298
1303
  (txHash, destinationTxHash, context) => {
1299
1304
  logFlow("withdraw:complete", { txHash, destinationTxHash, ...context });
1300
- onWithdrawComplete?.({
1305
+ onWithdrawCompleteRef.current?.({
1301
1306
  txHash,
1302
1307
  destinationTxHash,
1303
1308
  amount: context.amount,
@@ -1307,14 +1312,14 @@ function WithdrawFlow({
1307
1312
  targetToken: context.targetToken
1308
1313
  });
1309
1314
  },
1310
- [logFlow, onWithdrawComplete]
1315
+ [logFlow, onWithdrawCompleteRef]
1311
1316
  );
1312
1317
  const handleWithdrawFailed = useCallback2(
1313
1318
  (txHash, error) => {
1314
1319
  logFlowError("withdraw:failed", error, { txHash });
1315
- onWithdrawFailed?.({ txHash, error });
1320
+ onWithdrawFailedRef.current?.({ txHash, error });
1316
1321
  },
1317
- [logFlowError, onWithdrawFailed]
1322
+ [logFlowError, onWithdrawFailedRef]
1318
1323
  );
1319
1324
  const allowedChainSet = useMemo2(
1320
1325
  () => allowedRoutes?.sourceChains ? new Set(allowedRoutes.sourceChains) : null,
@@ -1475,7 +1480,7 @@ function WithdrawFlow({
1475
1480
  // src/WithdrawModal.tsx
1476
1481
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1477
1482
  var ReownWithdrawInner = lazy(
1478
- () => import("./WithdrawModalReown-HVBMAUPM.mjs").then((m) => ({
1483
+ () => import("./WithdrawModalReown-6VYKKKJN.mjs").then((m) => ({
1479
1484
  default: m.WithdrawModalReown
1480
1485
  }))
1481
1486
  );
@@ -1543,10 +1548,8 @@ function WithdrawModalInner({
1543
1548
  applyTheme(modalRef.current, theme);
1544
1549
  }
1545
1550
  }, [isOpen, theme]);
1546
- const hasCalledReady = useRef3(false);
1547
1551
  useEffect3(() => {
1548
- if (isOpen && !hasCalledReady.current) {
1549
- hasCalledReady.current = true;
1552
+ if (isOpen) {
1550
1553
  onReadyRef.current?.();
1551
1554
  }
1552
1555
  }, [isOpen, onReadyRef]);