@rhinestone/deposit-modal 0.1.31 → 0.1.32
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.
- package/dist/{DepositModalReown-S7HER5HU.mjs → DepositModalReown-SZPCCNPH.mjs} +9 -5
- package/dist/{DepositModalReown-N7GCYZF7.cjs → DepositModalReown-XUAEWIW7.cjs} +12 -8
- package/dist/{WithdrawModalReown-DJCJ5U7E.cjs → WithdrawModalReown-53FDOZG2.cjs} +12 -8
- package/dist/{WithdrawModalReown-DMDRLYTE.mjs → WithdrawModalReown-YGGV7BL2.mjs} +9 -5
- package/dist/{chunk-VKQA3FO3.cjs → chunk-52FVEYTL.cjs} +4 -0
- package/dist/{chunk-3ICS43XC.mjs → chunk-C6I5TFSL.mjs} +4 -0
- package/dist/{chunk-EVU7M7A6.mjs → chunk-DLFUXLAM.mjs} +14 -13
- package/dist/{chunk-CS6UIMCF.mjs → chunk-K2JJKFTV.mjs} +5 -1
- package/dist/{chunk-AWFJFSPH.mjs → chunk-MKKJ7ZE2.mjs} +117 -176
- package/dist/{chunk-MU2BOEDN.cjs → chunk-NYEWO4NW.cjs} +195 -254
- package/dist/{chunk-SLI5FHTT.mjs → chunk-RR25E5DZ.mjs} +29 -9
- package/dist/{chunk-PE6OK3FH.cjs → chunk-S4UBVD3H.cjs} +5 -1
- package/dist/{chunk-SZ35G2DT.cjs → chunk-SQDXU7ML.cjs} +87 -67
- package/dist/{chunk-G2RDCQHL.cjs → chunk-YIHOACM3.cjs} +38 -37
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +4 -4
- package/dist/{types-DTBfMH0p.d.ts → types-Bp2n2RQ3.d.ts} +0 -1
- package/dist/{types-DELv717e.d.cts → types-CIaQPR6F.d.cts} +0 -1
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MKKJ7ZE2.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-K2JJKFTV.mjs";
|
|
8
|
+
import "./chunk-DLFUXLAM.mjs";
|
|
9
|
+
import "./chunk-C6I5TFSL.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
import { useCallback } from "react";
|
|
@@ -16,12 +16,16 @@ function DepositModalWithReown(props) {
|
|
|
16
16
|
const handleConnect = useCallback(() => {
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
19
|
+
const handleDisconnect = useCallback(() => {
|
|
20
|
+
reown.disconnect();
|
|
21
|
+
}, [reown.disconnect]);
|
|
19
22
|
return /* @__PURE__ */ jsx(
|
|
20
23
|
DepositModalInner,
|
|
21
24
|
{
|
|
22
25
|
...props,
|
|
23
26
|
reownWallet: reown,
|
|
24
|
-
onConnect: handleConnect
|
|
27
|
+
onConnect: handleConnect,
|
|
28
|
+
onDisconnect: handleDisconnect
|
|
25
29
|
}
|
|
26
30
|
);
|
|
27
31
|
}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNYEWO4NWcjs = require('./chunk-NYEWO4NW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunk52FVEYTLcjs = require('./chunk-52FVEYTL.cjs');
|
|
8
|
+
require('./chunk-YIHOACM3.cjs');
|
|
9
|
+
require('./chunk-S4UBVD3H.cjs');
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
13
13
|
var _jsxruntime = require('react/jsx-runtime');
|
|
14
14
|
function DepositModalWithReown(props) {
|
|
15
|
-
const reown =
|
|
15
|
+
const reown = _chunk52FVEYTLcjs.useReownWallet.call(void 0, );
|
|
16
16
|
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
19
|
+
const handleDisconnect = _react.useCallback.call(void 0, () => {
|
|
20
|
+
reown.disconnect();
|
|
21
|
+
}, [reown.disconnect]);
|
|
19
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
20
|
-
|
|
23
|
+
_chunkNYEWO4NWcjs.DepositModalInner,
|
|
21
24
|
{
|
|
22
25
|
...props,
|
|
23
26
|
reownWallet: reown,
|
|
24
|
-
onConnect: handleConnect
|
|
27
|
+
onConnect: handleConnect,
|
|
28
|
+
onDisconnect: handleDisconnect
|
|
25
29
|
}
|
|
26
30
|
);
|
|
27
31
|
}
|
|
28
32
|
function DepositModalReown(props) {
|
|
29
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
33
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk52FVEYTLcjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositModalWithReown, { ...props }) });
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSQDXU7MLcjs = require('./chunk-SQDXU7ML.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunk52FVEYTLcjs = require('./chunk-52FVEYTL.cjs');
|
|
8
|
+
require('./chunk-YIHOACM3.cjs');
|
|
9
|
+
require('./chunk-S4UBVD3H.cjs');
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
13
13
|
var _jsxruntime = require('react/jsx-runtime');
|
|
14
14
|
function WithdrawModalWithReown(props) {
|
|
15
|
-
const reown =
|
|
15
|
+
const reown = _chunk52FVEYTLcjs.useReownWallet.call(void 0, );
|
|
16
16
|
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
19
|
+
const handleDisconnect = _react.useCallback.call(void 0, () => {
|
|
20
|
+
reown.disconnect();
|
|
21
|
+
}, [reown.disconnect]);
|
|
19
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
20
|
-
|
|
23
|
+
_chunkSQDXU7MLcjs.WithdrawModalInner,
|
|
21
24
|
{
|
|
22
25
|
...props,
|
|
23
26
|
reownWallet: reown,
|
|
24
|
-
onConnect: handleConnect
|
|
27
|
+
onConnect: handleConnect,
|
|
28
|
+
onDisconnect: handleDisconnect
|
|
25
29
|
}
|
|
26
30
|
);
|
|
27
31
|
}
|
|
28
32
|
function WithdrawModalReown(props) {
|
|
29
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
33
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk52FVEYTLcjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RR25E5DZ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-K2JJKFTV.mjs";
|
|
8
|
+
import "./chunk-DLFUXLAM.mjs";
|
|
9
|
+
import "./chunk-C6I5TFSL.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
import { useCallback } from "react";
|
|
@@ -16,12 +16,16 @@ function WithdrawModalWithReown(props) {
|
|
|
16
16
|
const handleConnect = useCallback(() => {
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
19
|
+
const handleDisconnect = useCallback(() => {
|
|
20
|
+
reown.disconnect();
|
|
21
|
+
}, [reown.disconnect]);
|
|
19
22
|
return /* @__PURE__ */ jsx(
|
|
20
23
|
WithdrawModalInner,
|
|
21
24
|
{
|
|
22
25
|
...props,
|
|
23
26
|
reownWallet: reown,
|
|
24
|
-
onConnect: handleConnect
|
|
27
|
+
onConnect: handleConnect,
|
|
28
|
+
onDisconnect: handleDisconnect
|
|
25
29
|
}
|
|
26
30
|
);
|
|
27
31
|
}
|
|
@@ -71,6 +71,7 @@ function useReownWallet() {
|
|
|
71
71
|
const { data: walletClient } = _wagmi.useWalletClient.call(void 0, );
|
|
72
72
|
const publicClient = _wagmi.usePublicClient.call(void 0, );
|
|
73
73
|
const { switchChainAsync } = _wagmi.useSwitchChain.call(void 0, );
|
|
74
|
+
const { disconnect: wagmiDisconnect } = _wagmi.useDisconnect.call(void 0, );
|
|
74
75
|
return {
|
|
75
76
|
walletClient: _nullishCoalesce(walletClient, () => ( void 0)),
|
|
76
77
|
publicClient: _nullishCoalesce(publicClient, () => ( void 0)),
|
|
@@ -80,6 +81,9 @@ function useReownWallet() {
|
|
|
80
81
|
openConnect: () => {
|
|
81
82
|
void open({ view: isConnected ? "Account" : "Connect" });
|
|
82
83
|
},
|
|
84
|
+
disconnect: () => {
|
|
85
|
+
wagmiDisconnect();
|
|
86
|
+
},
|
|
83
87
|
switchChain: async (chainId) => {
|
|
84
88
|
await switchChainAsync({ chainId });
|
|
85
89
|
}
|
|
@@ -341,6 +341,9 @@ function getTokenSymbol(token, chainId) {
|
|
|
341
341
|
}
|
|
342
342
|
return "Token";
|
|
343
343
|
}
|
|
344
|
+
function isStablecoinSymbol(symbol) {
|
|
345
|
+
return /^(usdc|usdt|dai|usd)$/i.test(symbol);
|
|
346
|
+
}
|
|
344
347
|
var CHAIN_BADGES = {
|
|
345
348
|
[mainnet.id]: { shortLabel: "ETH", color: "#627EEA", bg: "#EEF2FF" },
|
|
346
349
|
[base.id]: { shortLabel: "Base", color: "#0052FF", bg: "#E7F0FF" },
|
|
@@ -420,6 +423,7 @@ export {
|
|
|
420
423
|
getTokenDecimalsByAddress,
|
|
421
424
|
findChainIdForToken,
|
|
422
425
|
getTokenSymbol,
|
|
426
|
+
isStablecoinSymbol,
|
|
423
427
|
getChainName,
|
|
424
428
|
getChainBadge,
|
|
425
429
|
getExplorerUrl,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getTokenAddress,
|
|
8
8
|
getTokenDecimalsByAddress,
|
|
9
9
|
getTokenSymbol
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-C6I5TFSL.mjs";
|
|
11
11
|
|
|
12
12
|
// src/components/ui/Modal.tsx
|
|
13
13
|
import {
|
|
@@ -663,12 +663,13 @@ function ExternalLinkIcon() {
|
|
|
663
663
|
] });
|
|
664
664
|
}
|
|
665
665
|
function TransferIcon() {
|
|
666
|
-
return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0
|
|
666
|
+
return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx4(
|
|
667
667
|
"path",
|
|
668
668
|
{
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
fillRule: "evenodd",
|
|
670
|
+
clipRule: "evenodd",
|
|
671
|
+
d: "M9.99256 0.0706115C10.2112 0.195503 10.3185 0.457071 10.2527 0.704513L8.80705 6.13519H14.0826C14.2993 6.13519 14.4954 6.26695 14.5818 6.47064C14.6682 6.67433 14.6284 6.91113 14.4805 7.07349L6.85913 15.4396C6.68832 15.6271 6.41472 15.6711 6.19607 15.5462C5.97742 15.4213 5.87009 15.1598 5.93595 14.9123L7.38158 9.48164H2.10607C1.8893 9.48164 1.69319 9.34988 1.60679 9.14619C1.5204 8.9425 1.56019 8.7057 1.7081 8.54334L9.32949 0.177204C9.5003 -0.0102968 9.77391 -0.0542802 9.99256 0.0706115Z",
|
|
672
|
+
fill: "currentColor"
|
|
672
673
|
}
|
|
673
674
|
) });
|
|
674
675
|
}
|
|
@@ -706,6 +707,7 @@ function ConnectStep({
|
|
|
706
707
|
onSelectTransferCrypto,
|
|
707
708
|
onRequestConnect,
|
|
708
709
|
onConnect,
|
|
710
|
+
onDisconnect,
|
|
709
711
|
onContinue,
|
|
710
712
|
continueButtonLabel = "Continue",
|
|
711
713
|
connectButtonLabel = "Connect external wallet"
|
|
@@ -777,19 +779,19 @@ function ConnectStep({
|
|
|
777
779
|
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ jsx5(TransferIcon, {}) }),
|
|
778
780
|
/* @__PURE__ */ jsxs4("div", { className: "rs-connect-wallet-meta", children: [
|
|
779
781
|
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
|
|
780
|
-
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-address", children: "
|
|
782
|
+
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-address", children: "No limit instant transfer" })
|
|
781
783
|
] }),
|
|
782
784
|
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ jsx5(ChevronRightIcon, {}) })
|
|
783
785
|
]
|
|
784
786
|
}
|
|
785
787
|
)
|
|
786
788
|
] }),
|
|
787
|
-
onConnect && walletOptions?.some((option) => option.kind === "external") && /* @__PURE__ */ jsx5(
|
|
789
|
+
(onDisconnect || onConnect) && walletOptions?.some((option) => option.kind === "external") && /* @__PURE__ */ jsx5(
|
|
788
790
|
"button",
|
|
789
791
|
{
|
|
790
792
|
type: "button",
|
|
791
793
|
className: "rs-connect-wallet-manage",
|
|
792
|
-
onClick: onConnect,
|
|
794
|
+
onClick: onDisconnect ?? onConnect,
|
|
793
795
|
children: "Disconnect Wallet"
|
|
794
796
|
}
|
|
795
797
|
)
|
|
@@ -819,7 +821,7 @@ function ConnectStep({
|
|
|
819
821
|
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-icon rs-connect-wallet-icon--action", children: /* @__PURE__ */ jsx5(TransferIcon, {}) }),
|
|
820
822
|
/* @__PURE__ */ jsxs4("div", { className: "rs-connect-wallet-meta", children: [
|
|
821
823
|
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-label", children: "Transfer Crypto" }),
|
|
822
|
-
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-address", children: "
|
|
824
|
+
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-address", children: "No limit instant transfer" })
|
|
823
825
|
] }),
|
|
824
826
|
/* @__PURE__ */ jsx5("div", { className: "rs-connect-wallet-indicator", children: /* @__PURE__ */ jsx5(ChevronRightIcon, {}) })
|
|
825
827
|
]
|
|
@@ -1046,7 +1048,6 @@ function ProcessingStep({
|
|
|
1046
1048
|
sourceChain,
|
|
1047
1049
|
sourceToken,
|
|
1048
1050
|
targetChain,
|
|
1049
|
-
targetToken,
|
|
1050
1051
|
amount,
|
|
1051
1052
|
waitForFinalTx,
|
|
1052
1053
|
service,
|
|
@@ -1217,7 +1218,7 @@ function ProcessingStep({
|
|
|
1217
1218
|
const secs = seconds % 60;
|
|
1218
1219
|
return `${mins}m ${secs}s`;
|
|
1219
1220
|
};
|
|
1220
|
-
const
|
|
1221
|
+
const sourceSymbol = getTokenSymbol(sourceToken, sourceChain);
|
|
1221
1222
|
const sourceDecimals = getTokenDecimalsByAddress(sourceToken, sourceChain);
|
|
1222
1223
|
const formattedReceivedAmount = (() => {
|
|
1223
1224
|
try {
|
|
@@ -1272,11 +1273,11 @@ function ProcessingStep({
|
|
|
1272
1273
|
/* @__PURE__ */ jsx7("span", { className: "rs-card-value", children: formatElapsedTime(elapsedSeconds) })
|
|
1273
1274
|
] }),
|
|
1274
1275
|
/* @__PURE__ */ jsxs6("div", { className: "rs-card-row", children: [
|
|
1275
|
-
/* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "You
|
|
1276
|
+
/* @__PURE__ */ jsx7("span", { className: "rs-card-label", children: "You sent" }),
|
|
1276
1277
|
/* @__PURE__ */ jsxs6("span", { className: "rs-card-value", children: [
|
|
1277
1278
|
formattedReceivedAmount,
|
|
1278
1279
|
" ",
|
|
1279
|
-
|
|
1280
|
+
sourceSymbol
|
|
1280
1281
|
] })
|
|
1281
1282
|
] })
|
|
1282
1283
|
] }),
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
polygon,
|
|
13
13
|
bsc
|
|
14
14
|
} from "@reown/appkit/networks";
|
|
15
|
-
import { useWalletClient, usePublicClient, useSwitchChain } from "wagmi";
|
|
15
|
+
import { useWalletClient, usePublicClient, useSwitchChain, useDisconnect } from "wagmi";
|
|
16
16
|
import { jsx } from "react/jsx-runtime";
|
|
17
17
|
var NETWORKS = [
|
|
18
18
|
mainnet,
|
|
@@ -71,6 +71,7 @@ function useReownWallet() {
|
|
|
71
71
|
const { data: walletClient } = useWalletClient();
|
|
72
72
|
const publicClient = usePublicClient();
|
|
73
73
|
const { switchChainAsync } = useSwitchChain();
|
|
74
|
+
const { disconnect: wagmiDisconnect } = useDisconnect();
|
|
74
75
|
return {
|
|
75
76
|
walletClient: walletClient ?? void 0,
|
|
76
77
|
publicClient: publicClient ?? void 0,
|
|
@@ -80,6 +81,9 @@ function useReownWallet() {
|
|
|
80
81
|
openConnect: () => {
|
|
81
82
|
void open({ view: isConnected ? "Account" : "Connect" });
|
|
82
83
|
},
|
|
84
|
+
disconnect: () => {
|
|
85
|
+
wagmiDisconnect();
|
|
86
|
+
},
|
|
83
87
|
switchChain: async (chainId) => {
|
|
84
88
|
await switchChainAsync({ chainId });
|
|
85
89
|
}
|