@rhinestone/deposit-modal 0.0.0-dev-20260611141108 → 0.0.0-dev-20260617120607

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 (29) hide show
  1. package/dist/{DepositModalReown-QVVFHL2N.cjs → DepositModalReown-KFTMS2WX.cjs} +9 -9
  2. package/dist/{DepositModalReown-O4VWVJYG.mjs → DepositModalReown-PC7EX5VK.mjs} +6 -6
  3. package/dist/{WithdrawModalReown-GLOHYSUG.mjs → WithdrawModalReown-BE23LUMT.mjs} +5 -5
  4. package/dist/{WithdrawModalReown-3GK2F2AF.cjs → WithdrawModalReown-Z2YF2FSJ.cjs} +8 -8
  5. package/dist/{chunk-7KHWMSID.cjs → chunk-3MXWIYAT.cjs} +16 -6
  6. package/dist/{chunk-NWCRGZG3.mjs → chunk-3PVDRSJ7.mjs} +36 -52
  7. package/dist/{chunk-MMPRPDLS.cjs → chunk-7MP2UWIQ.cjs} +349 -365
  8. package/dist/{chunk-MILJQWPT.cjs → chunk-ABVRVW3P.cjs} +133 -8
  9. package/dist/{chunk-7AADPL52.cjs → chunk-AE5LHTPM.cjs} +121 -101
  10. package/dist/{chunk-TQ2AYMWS.mjs → chunk-F7P4MV72.mjs} +1 -1
  11. package/dist/{chunk-BAEB5AFZ.mjs → chunk-FJWLC4AM.mjs} +1 -1
  12. package/dist/{chunk-E25DOT37.mjs → chunk-GKC22JC4.mjs} +217 -103
  13. package/dist/{chunk-R5CPOBCF.cjs → chunk-NRNJAQUA.cjs} +4 -4
  14. package/dist/{chunk-GQCEQZGF.cjs → chunk-OQVLEVNR.cjs} +256 -142
  15. package/dist/{chunk-AJHFNHG3.cjs → chunk-UEKPBRBY.cjs} +3 -3
  16. package/dist/{chunk-KAYBLYUS.mjs → chunk-UFKFSGT3.mjs} +14 -4
  17. package/dist/{chunk-RVBLNCWE.mjs → chunk-WCIGOV34.mjs} +32 -12
  18. package/dist/{chunk-6YRDD462.mjs → chunk-WJX3TJFK.mjs} +135 -10
  19. package/dist/constants.cjs +2 -2
  20. package/dist/constants.mjs +1 -1
  21. package/dist/deposit.cjs +6 -6
  22. package/dist/deposit.mjs +5 -5
  23. package/dist/index.cjs +7 -7
  24. package/dist/index.mjs +6 -6
  25. package/dist/polymarket.cjs +6 -6
  26. package/dist/polymarket.mjs +3 -3
  27. package/dist/withdraw.cjs +5 -5
  28. package/dist/withdraw.mjs +4 -4
  29. package/package.json +1 -1
@@ -1,14 +1,14 @@
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 _chunkMMPRPDLScjs = require('./chunk-MMPRPDLS.cjs');
4
- require('./chunk-R5CPOBCF.cjs');
3
+ var _chunk7MP2UWIQcjs = require('./chunk-7MP2UWIQ.cjs');
4
+ require('./chunk-NRNJAQUA.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunk7KHWMSIDcjs = require('./chunk-7KHWMSID.cjs');
9
- require('./chunk-GQCEQZGF.cjs');
10
- require('./chunk-AJHFNHG3.cjs');
11
- require('./chunk-MILJQWPT.cjs');
8
+ var _chunk3MXWIYATcjs = require('./chunk-3MXWIYAT.cjs');
9
+ require('./chunk-OQVLEVNR.cjs');
10
+ require('./chunk-UEKPBRBY.cjs');
11
+ require('./chunk-ABVRVW3P.cjs');
12
12
 
13
13
  // src/DepositModalReown.tsx
14
14
  var _react = require('react');
@@ -16,7 +16,7 @@ var _react3 = require('@reown/appkit/react');
16
16
  var _react5 = require('@reown/appkit-adapter-solana/react');
17
17
  var _jsxruntime = require('react/jsx-runtime');
18
18
  function DepositModalWithReown(props) {
19
- const reown = _chunk7KHWMSIDcjs.useReownWallet.call(void 0, );
19
+ const reown = _chunk3MXWIYATcjs.useReownWallet.call(void 0, );
20
20
  const enableSolana = _nullishCoalesce(props.enableSolana, () => ( true));
21
21
  const { walletProvider: solanaWalletProvider } = _react3.useAppKitProvider.call(void 0,
22
22
  enableSolana ? "solana" : "eip155"
@@ -37,7 +37,7 @@ function DepositModalWithReown(props) {
37
37
  reown.disconnect();
38
38
  }, [reown.disconnect]);
39
39
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
40
- _chunkMMPRPDLScjs.DepositModalInner,
40
+ _chunk7MP2UWIQcjs.DepositModalInner,
41
41
  {
42
42
  ...props,
43
43
  reownWallet: reownWithSolana,
@@ -48,7 +48,7 @@ function DepositModalWithReown(props) {
48
48
  }
49
49
  function DepositModalReown(props) {
50
50
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
51
- _chunk7KHWMSIDcjs.ReownWalletProvider,
51
+ _chunk3MXWIYATcjs.ReownWalletProvider,
52
52
  {
53
53
  projectId: props.reownAppId,
54
54
  theme: props.theme,
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  DepositModalInner
3
- } from "./chunk-NWCRGZG3.mjs";
4
- import "./chunk-BAEB5AFZ.mjs";
3
+ } from "./chunk-3PVDRSJ7.mjs";
4
+ import "./chunk-FJWLC4AM.mjs";
5
5
  import {
6
6
  ReownWalletProvider,
7
7
  useReownWallet
8
- } from "./chunk-KAYBLYUS.mjs";
9
- import "./chunk-E25DOT37.mjs";
10
- import "./chunk-TQ2AYMWS.mjs";
11
- import "./chunk-6YRDD462.mjs";
8
+ } from "./chunk-UFKFSGT3.mjs";
9
+ import "./chunk-GKC22JC4.mjs";
10
+ import "./chunk-F7P4MV72.mjs";
11
+ import "./chunk-WJX3TJFK.mjs";
12
12
 
13
13
  // src/DepositModalReown.tsx
14
14
  import { useCallback, useMemo } from "react";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  WithdrawModalInner
3
- } from "./chunk-RVBLNCWE.mjs";
3
+ } from "./chunk-WCIGOV34.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
- } from "./chunk-KAYBLYUS.mjs";
8
- import "./chunk-E25DOT37.mjs";
9
- import "./chunk-TQ2AYMWS.mjs";
10
- import "./chunk-6YRDD462.mjs";
7
+ } from "./chunk-UFKFSGT3.mjs";
8
+ import "./chunk-GKC22JC4.mjs";
9
+ import "./chunk-F7P4MV72.mjs";
10
+ import "./chunk-WJX3TJFK.mjs";
11
11
 
12
12
  // src/WithdrawModalReown.tsx
13
13
  import { useCallback } from "react";
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk7AADPL52cjs = require('./chunk-7AADPL52.cjs');
3
+ var _chunkAE5LHTPMcjs = require('./chunk-AE5LHTPM.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunk7KHWMSIDcjs = require('./chunk-7KHWMSID.cjs');
8
- require('./chunk-GQCEQZGF.cjs');
9
- require('./chunk-AJHFNHG3.cjs');
10
- require('./chunk-MILJQWPT.cjs');
7
+ var _chunk3MXWIYATcjs = require('./chunk-3MXWIYAT.cjs');
8
+ require('./chunk-OQVLEVNR.cjs');
9
+ require('./chunk-UEKPBRBY.cjs');
10
+ require('./chunk-ABVRVW3P.cjs');
11
11
 
12
12
  // src/WithdrawModalReown.tsx
13
13
  var _react = require('react');
14
14
  var _jsxruntime = require('react/jsx-runtime');
15
15
  function WithdrawModalWithReown(props) {
16
- const reown = _chunk7KHWMSIDcjs.useReownWallet.call(void 0, );
16
+ const reown = _chunk3MXWIYATcjs.useReownWallet.call(void 0, );
17
17
  const handleConnect = _react.useCallback.call(void 0, () => {
18
18
  reown.openConnect();
19
19
  }, [reown.openConnect]);
@@ -21,7 +21,7 @@ function WithdrawModalWithReown(props) {
21
21
  reown.disconnect();
22
22
  }, [reown.disconnect]);
23
23
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
24
- _chunk7AADPL52cjs.WithdrawModalInner,
24
+ _chunkAE5LHTPMcjs.WithdrawModalInner,
25
25
  {
26
26
  ...props,
27
27
  reownWallet: reown,
@@ -31,7 +31,7 @@ function WithdrawModalWithReown(props) {
31
31
  );
32
32
  }
33
33
  function WithdrawModalReown(props) {
34
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7KHWMSIDcjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
34
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3MXWIYATcjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
35
35
  }
36
36
 
37
37
 
@@ -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
- var _chunkGQCEQZGFcjs = require('./chunk-GQCEQZGF.cjs');
3
+ var _chunkOQVLEVNRcjs = require('./chunk-OQVLEVNR.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkMILJQWPTcjs = require('./chunk-MILJQWPT.cjs');
7
+ var _chunkABVRVW3Pcjs = require('./chunk-ABVRVW3P.cjs');
8
8
 
9
9
  // src/core/reown.tsx
10
10
  var _react = require('react');
@@ -35,6 +35,11 @@ var _networks = require('@reown/appkit/networks');
35
35
 
36
36
 
37
37
 
38
+
39
+
40
+
41
+
42
+
38
43
  var APPKIT_NETWORK_BY_ID = {
39
44
  [_networks.mainnet.id]: _networks.mainnet,
40
45
  [_networks.optimism.id]: _networks.optimism,
@@ -43,9 +48,14 @@ var APPKIT_NETWORK_BY_ID = {
43
48
  [_networks.base.id]: _networks.base,
44
49
  [_networks.bsc.id]: _networks.bsc,
45
50
  [_networks.soneium.id]: _networks.soneium,
46
- [_networks.plasma.id]: _networks.plasma
51
+ [_networks.plasma.id]: _networks.plasma,
52
+ [_networks.gnosis.id]: _networks.gnosis,
53
+ [_networks.sonic.id]: _networks.sonic,
54
+ [_networks.monad.id]: _networks.monad,
55
+ [_networks.unichain.id]: _networks.unichain,
56
+ [_networks.katana.id]: _networks.katana
47
57
  };
48
- var EVM_NETWORKS = _chunkMILJQWPTcjs.SUPPORTED_CHAINS.map((chain) => {
58
+ var EVM_NETWORKS = _chunkABVRVW3Pcjs.SUPPORTED_CHAINS.map((chain) => {
49
59
  const network = APPKIT_NETWORK_BY_ID[chain.id];
50
60
  if (!network) {
51
61
  throw new Error(
@@ -145,9 +155,9 @@ function useReownWallet() {
145
155
  await switchChainAsync({ chainId });
146
156
  }
147
157
  } catch (err) {
148
- if (_chunkGQCEQZGFcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
158
+ if (_chunkOQVLEVNRcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
149
159
  throw new Error(
150
- `Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, chainId)} in your wallet to continue`
160
+ `Switch to ${_chunkABVRVW3Pcjs.getChainName.call(void 0, chainId)} in your wallet to continue`
151
161
  );
152
162
  }
153
163
  throw err;
@@ -7,7 +7,7 @@ import {
7
7
  executePolymarketSafeTransfer,
8
8
  fetchPolymarketProxyWallet,
9
9
  readPolymarketBalances
10
- } from "./chunk-BAEB5AFZ.mjs";
10
+ } from "./chunk-FJWLC4AM.mjs";
11
11
  import {
12
12
  AlertTriangleIcon,
13
13
  ArrowUpRightIcon,
@@ -45,6 +45,8 @@ import {
45
45
  debugError,
46
46
  debugLog,
47
47
  failureMessageForEvent,
48
+ formatReceiveEstimate,
49
+ formatTokenAmount,
48
50
  formatUserError,
49
51
  getAssetId,
50
52
  getEventSourceDetails,
@@ -60,10 +62,10 @@ import {
60
62
  tokenFormatter,
61
63
  txRefsMatch,
62
64
  useLatestRef
63
- } from "./chunk-E25DOT37.mjs";
65
+ } from "./chunk-GKC22JC4.mjs";
64
66
  import {
65
67
  SAFE_ABI
66
- } from "./chunk-TQ2AYMWS.mjs";
68
+ } from "./chunk-F7P4MV72.mjs";
67
69
  import {
68
70
  DEFAULT_BACKEND_URL,
69
71
  DEFAULT_SIGNER_ADDRESS,
@@ -93,7 +95,7 @@ import {
93
95
  isVirtualDestination,
94
96
  parseEvmChainId,
95
97
  targetChainToCaip2
96
- } from "./chunk-6YRDD462.mjs";
98
+ } from "./chunk-WJX3TJFK.mjs";
97
99
 
98
100
  // src/DepositModal.tsx
99
101
  import {
@@ -876,25 +878,21 @@ function ConfirmStep({
876
878
  const targetChainIcon = getChainIcon(targetChain);
877
879
  const sourceTokenIcon = getTokenIcon(asset.symbol);
878
880
  const targetTokenIcon = getTokenIcon(targetSymbol);
879
- const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", {
880
- minimumFractionDigits: 2,
881
- maximumFractionDigits: 6
882
- }) : "0";
883
- const formattedReceiveAmount = (() => {
884
- if (sameRoute) return formattedSendAmount;
885
- const dollarValue = Number(targetAmount);
886
- if (!Number.isFinite(dollarValue) || dollarValue <= 0)
887
- return formattedSendAmount;
888
- if (targetTokenPriceUsd !== null && targetTokenPriceUsd > 0) {
889
- const tokenAmount = dollarValue / targetTokenPriceUsd;
890
- return tokenAmount.toLocaleString("en-US", {
891
- minimumFractionDigits: 2,
892
- maximumFractionDigits: 6
893
- });
894
- }
895
- return formattedSendAmount;
881
+ const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? formatTokenAmount(Number(amount), asset.symbol) ?? "0" : "0";
882
+ const receiveDisplay = (() => {
883
+ if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
884
+ const usdValue = Number(targetAmount);
885
+ const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
886
+ const estimate = formatReceiveEstimate({
887
+ sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
888
+ sourceSymbol: asset.symbol,
889
+ targetSymbol,
890
+ sourceAmountUsd,
891
+ prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
892
+ });
893
+ if (estimate !== void 0) return estimate;
894
+ return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedSendAmount} ${asset.symbol}`;
896
895
  })();
897
- const receiveAmount = sameRoute ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
898
896
  const feeSponsored = uiConfig?.feeSponsored ?? false;
899
897
  const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
900
898
  const feeDisplay = quote ? `$${quote.fees.totalUsd.toFixed(2)}` : null;
@@ -1048,11 +1046,7 @@ function ConfirmStep({
1048
1046
  /* @__PURE__ */ jsxs4("div", { className: "rs-review-detail-row", children: [
1049
1047
  /* @__PURE__ */ jsx4("span", { children: "Receive" }),
1050
1048
  /* @__PURE__ */ jsxs4("span", { className: "rs-review-detail-value", children: [
1051
- /* @__PURE__ */ jsxs4("span", { children: [
1052
- receiveAmount,
1053
- " ",
1054
- targetSymbol
1055
- ] }),
1049
+ /* @__PURE__ */ jsx4("span", { children: receiveDisplay }),
1056
1050
  targetTokenIcon && /* @__PURE__ */ jsx4("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx4("img", { src: targetTokenIcon, alt: "" }) })
1057
1051
  ] })
1058
1052
  ] }),
@@ -3579,7 +3573,6 @@ function SolanaConfirmStep({
3579
3573
  const [isSubmitting, setIsSubmitting] = useState10(false);
3580
3574
  const [error, setError] = useState10(null);
3581
3575
  const targetSymbol = getTargetTokenSymbol(targetToken, targetChain);
3582
- const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
3583
3576
  const sourceChainName = getChainName("solana");
3584
3577
  const targetChainName = getChainName(targetChain);
3585
3578
  const sourceChainIcon = getChainIcon("solana");
@@ -3588,25 +3581,20 @@ function SolanaConfirmStep({
3588
3581
  const targetTokenIcon = getTokenIcon(targetSymbol);
3589
3582
  const feeSponsored = uiConfig?.feeSponsored ?? false;
3590
3583
  const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
3591
- const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
3592
- minimumFractionDigits: 2,
3593
- maximumFractionDigits: 6
3594
- }) : "0";
3595
- const formattedReceiveAmount = (() => {
3596
- if (isSameToken) return formattedAmount;
3597
- const dollarValue = Number(targetAmount);
3598
- if (!Number.isFinite(dollarValue) || dollarValue <= 0)
3599
- return formattedAmount;
3600
- if (targetTokenPriceUsd !== null && targetTokenPriceUsd > 0) {
3601
- const tokenAmount = dollarValue / targetTokenPriceUsd;
3602
- return tokenAmount.toLocaleString("en-US", {
3603
- minimumFractionDigits: 2,
3604
- maximumFractionDigits: 6
3605
- });
3606
- }
3607
- return formattedAmount;
3584
+ const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? formatTokenAmount(Number(sourceAmount), token.symbol) ?? "0" : "0";
3585
+ const receiveDisplay = (() => {
3586
+ const usdValue = Number(targetAmount);
3587
+ const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
3588
+ const estimate = formatReceiveEstimate({
3589
+ sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
3590
+ sourceSymbol: token.symbol,
3591
+ targetSymbol,
3592
+ sourceAmountUsd,
3593
+ prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
3594
+ });
3595
+ if (estimate !== void 0) return estimate;
3596
+ return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedAmount} ${token.symbol}`;
3608
3597
  })();
3609
- const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
3610
3598
  const handleConfirm = async () => {
3611
3599
  if (!solanaProvider) {
3612
3600
  debugLog(debug, "solana-confirm", "submit:blocked", {
@@ -3732,11 +3720,7 @@ function SolanaConfirmStep({
3732
3720
  /* @__PURE__ */ jsxs15("div", { className: "rs-review-detail-row", children: [
3733
3721
  /* @__PURE__ */ jsx17("span", { children: "Receive" }),
3734
3722
  /* @__PURE__ */ jsxs15("span", { className: "rs-review-detail-value", children: [
3735
- /* @__PURE__ */ jsxs15("span", { children: [
3736
- receiveAmount,
3737
- " ",
3738
- targetSymbol
3739
- ] }),
3723
+ /* @__PURE__ */ jsx17("span", { children: receiveDisplay }),
3740
3724
  targetTokenIcon && /* @__PURE__ */ jsx17("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx17("img", { src: targetTokenIcon, alt: "" }) })
3741
3725
  ] })
3742
3726
  ] }),
@@ -7519,7 +7503,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
7519
7503
  // src/DepositModal.tsx
7520
7504
  import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
7521
7505
  var ReownDepositInner = lazy2(
7522
- () => import("./DepositModalReown-O4VWVJYG.mjs").then((m) => ({ default: m.DepositModalReown }))
7506
+ () => import("./DepositModalReown-PC7EX5VK.mjs").then((m) => ({ default: m.DepositModalReown }))
7523
7507
  );
7524
7508
  function sortByCreatedAtDesc(items) {
7525
7509
  return [...items].sort((a, b) => {