@rhinestone/deposit-modal 0.1.31 → 0.1.33
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-7ZO7HUN3.mjs} +9 -5
- package/dist/{DepositModalReown-N7GCYZF7.cjs → DepositModalReown-VNKZT5A7.cjs} +12 -8
- package/dist/{WithdrawModalReown-DMDRLYTE.mjs → WithdrawModalReown-PMPLUJBE.mjs} +9 -5
- package/dist/{WithdrawModalReown-DJCJ5U7E.cjs → WithdrawModalReown-YP4PEERJ.cjs} +12 -8
- package/dist/{chunk-SZ35G2DT.cjs → chunk-4WXSBBHQ.cjs} +101 -107
- package/dist/{chunk-3ICS43XC.mjs → chunk-C6I5TFSL.mjs} +4 -0
- package/dist/{chunk-EVU7M7A6.mjs → chunk-DLFUXLAM.mjs} +14 -13
- package/dist/{chunk-SLI5FHTT.mjs → chunk-ECLVABYN.mjs} +34 -40
- package/dist/{chunk-AWFJFSPH.mjs → chunk-HNDZ6G5K.mjs} +166 -249
- package/dist/{chunk-PE6OK3FH.cjs → chunk-S4UBVD3H.cjs} +5 -1
- package/dist/{chunk-MU2BOEDN.cjs → chunk-SIGTZB3C.cjs} +244 -327
- package/dist/{chunk-CS6UIMCF.mjs → chunk-SJEIKMVO.mjs} +10 -2
- package/dist/{chunk-VKQA3FO3.cjs → chunk-V7I5T4SW.cjs} +9 -1
- 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
|
@@ -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
|
] }),
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
isNativeAsset,
|
|
17
17
|
loadSessionOwnerFromStorage,
|
|
18
18
|
saveSessionOwnerToStorage
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DLFUXLAM.mjs";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_BACKEND_URL,
|
|
22
22
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
getTokenDecimalsByAddress,
|
|
30
30
|
getTokenIcon,
|
|
31
31
|
getTokenSymbol
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-C6I5TFSL.mjs";
|
|
33
33
|
|
|
34
34
|
// src/WithdrawModal.tsx
|
|
35
35
|
import {
|
|
@@ -48,7 +48,7 @@ import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMem
|
|
|
48
48
|
// src/components/steps/WithdrawFormStep.tsx
|
|
49
49
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
50
50
|
import { erc20Abi, formatUnits, parseUnits } from "viem";
|
|
51
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
51
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
52
52
|
function useClickOutside(ref, onClose) {
|
|
53
53
|
useEffect(() => {
|
|
54
54
|
function handleClick(e) {
|
|
@@ -75,6 +75,7 @@ function WithdrawFormStep({
|
|
|
75
75
|
onTargetChainChange,
|
|
76
76
|
onTargetTokenChange,
|
|
77
77
|
switchChain,
|
|
78
|
+
walletIcon,
|
|
78
79
|
submitting = false,
|
|
79
80
|
onSubmit,
|
|
80
81
|
onBalanceUsdChange
|
|
@@ -234,18 +235,6 @@ function WithdrawFormStep({
|
|
|
234
235
|
setIsSubmitting(false);
|
|
235
236
|
}
|
|
236
237
|
}, [recipient, amount, balance, asset.decimals, onSubmit]);
|
|
237
|
-
const handleSwitch = async () => {
|
|
238
|
-
if (!asset.chainId || !switchChain) return;
|
|
239
|
-
setIsSwitching(true);
|
|
240
|
-
try {
|
|
241
|
-
await switchChain(asset.chainId);
|
|
242
|
-
} catch (err) {
|
|
243
|
-
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
244
|
-
setError(formatUserError(raw));
|
|
245
|
-
} finally {
|
|
246
|
-
setIsSwitching(false);
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
238
|
return /* @__PURE__ */ jsxs("div", { className: "rs-step", children: [
|
|
250
239
|
/* @__PURE__ */ jsxs("div", { className: "rs-step-body rs-withdraw-form", children: [
|
|
251
240
|
/* @__PURE__ */ jsxs("div", { className: "rs-withdraw-section", children: [
|
|
@@ -264,14 +253,22 @@ function WithdrawFormStep({
|
|
|
264
253
|
}
|
|
265
254
|
}
|
|
266
255
|
),
|
|
267
|
-
address && /* @__PURE__ */
|
|
256
|
+
address && /* @__PURE__ */ jsx(
|
|
268
257
|
"button",
|
|
269
258
|
{
|
|
270
259
|
type: "button",
|
|
271
260
|
className: `rs-withdraw-use-connected ${isRecipientConnected ? "rs-withdraw-use-connected--active" : ""}`,
|
|
272
261
|
onClick: handleUseConnected,
|
|
273
262
|
title: isRecipientConnected ? "Using connected wallet" : "Use connected wallet",
|
|
274
|
-
children:
|
|
263
|
+
children: walletIcon ? /* @__PURE__ */ jsx(
|
|
264
|
+
"img",
|
|
265
|
+
{
|
|
266
|
+
src: walletIcon,
|
|
267
|
+
alt: "Wallet",
|
|
268
|
+
style: { width: 18, height: 18, borderRadius: 4 },
|
|
269
|
+
className: "rs-withdraw-use-connected-icon"
|
|
270
|
+
}
|
|
271
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
275
272
|
/* @__PURE__ */ jsx(
|
|
276
273
|
"svg",
|
|
277
274
|
{
|
|
@@ -291,7 +288,7 @@ function WithdrawFormStep({
|
|
|
291
288
|
}
|
|
292
289
|
),
|
|
293
290
|
isRecipientConnected ? null : "Wallet"
|
|
294
|
-
]
|
|
291
|
+
] })
|
|
295
292
|
}
|
|
296
293
|
)
|
|
297
294
|
] })
|
|
@@ -501,23 +498,7 @@ function WithdrawFormStep({
|
|
|
501
498
|
)
|
|
502
499
|
] })
|
|
503
500
|
] }),
|
|
504
|
-
chainMismatch && /* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */ jsxs("div", { className: "rs-chain-switch-text", children: [
|
|
506
|
-
"Switch to ",
|
|
507
|
-
getChainName(asset.chainId),
|
|
508
|
-
" to continue."
|
|
509
|
-
] }),
|
|
510
|
-
switchChain && /* @__PURE__ */ jsx(
|
|
511
|
-
Button,
|
|
512
|
-
{
|
|
513
|
-
variant: "outline",
|
|
514
|
-
size: "small",
|
|
515
|
-
loading: isSwitching,
|
|
516
|
-
onClick: handleSwitch,
|
|
517
|
-
children: "Switch"
|
|
518
|
-
}
|
|
519
|
-
)
|
|
520
|
-
] }),
|
|
501
|
+
chainMismatch && /* @__PURE__ */ jsx("div", { className: "rs-chain-switch", children: /* @__PURE__ */ jsx("div", { className: "rs-chain-switch-text", children: isSwitching ? `Switching to ${getChainName(asset.chainId)}...` : `Switch to ${getChainName(asset.chainId)} to continue.` }) }),
|
|
521
502
|
error && /* @__PURE__ */ jsxs("div", { className: "rs-withdraw-error", children: [
|
|
522
503
|
/* @__PURE__ */ jsx(
|
|
523
504
|
"svg",
|
|
@@ -860,6 +841,7 @@ function WithdrawFlow({
|
|
|
860
841
|
waitForFinalTx = true,
|
|
861
842
|
reownWallet,
|
|
862
843
|
onConnect,
|
|
844
|
+
onDisconnect,
|
|
863
845
|
onSignTransaction,
|
|
864
846
|
onRequestConnect,
|
|
865
847
|
connectButtonLabel,
|
|
@@ -901,11 +883,12 @@ function WithdrawFlow({
|
|
|
901
883
|
});
|
|
902
884
|
seen.add(dappWalletClient.account.address.toLowerCase());
|
|
903
885
|
}
|
|
904
|
-
if (reownWallet?.address && reownWallet.isConnected && !seen.has(reownWallet.address.toLowerCase())) {
|
|
886
|
+
if (reownWallet?.address && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(reownWallet.address.toLowerCase())) {
|
|
905
887
|
options.push({
|
|
906
888
|
address: reownWallet.address,
|
|
907
889
|
label: "External Wallet",
|
|
908
|
-
kind: "external"
|
|
890
|
+
kind: "external",
|
|
891
|
+
icon: reownWallet.icon
|
|
909
892
|
});
|
|
910
893
|
}
|
|
911
894
|
return options;
|
|
@@ -913,7 +896,9 @@ function WithdrawFlow({
|
|
|
913
896
|
dappWalletClient,
|
|
914
897
|
dappAddress,
|
|
915
898
|
reownWallet?.address,
|
|
916
|
-
reownWallet?.isConnected
|
|
899
|
+
reownWallet?.isConnected,
|
|
900
|
+
reownWallet?.walletClient,
|
|
901
|
+
reownWallet?.publicClient
|
|
917
902
|
]);
|
|
918
903
|
const canAutoLock = (dappWalletClient?.account && dappAddress || hasCustomSigner) && !reownWallet;
|
|
919
904
|
const [selectedConnectAddress, setSelectedConnectAddress] = useState2(null);
|
|
@@ -1236,6 +1221,7 @@ function WithdrawFlow({
|
|
|
1236
1221
|
onSelectAddress: setSelectedConnectAddress,
|
|
1237
1222
|
onRequestConnect,
|
|
1238
1223
|
onConnect,
|
|
1224
|
+
onDisconnect,
|
|
1239
1225
|
onContinue: () => {
|
|
1240
1226
|
if (selectedConnectAddressEffective) {
|
|
1241
1227
|
setSelectedConnectAddress(selectedConnectAddressEffective);
|
|
@@ -1250,6 +1236,12 @@ function WithdrawFlow({
|
|
|
1250
1236
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1251
1237
|
const ownerAddress = signerContext.ownerAddress;
|
|
1252
1238
|
const formPublicClient = signerContext.publicClient ?? getPublicClient(sourceChain);
|
|
1239
|
+
const selectedWalletIcon = useMemo2(() => {
|
|
1240
|
+
const selected = walletOptions.find(
|
|
1241
|
+
(o) => o.address.toLowerCase() === ownerAddress.toLowerCase()
|
|
1242
|
+
);
|
|
1243
|
+
return selected?.icon ?? reownWallet?.icon;
|
|
1244
|
+
}, [walletOptions, ownerAddress, reownWallet?.icon]);
|
|
1253
1245
|
return /* @__PURE__ */ jsxs2("div", { className: "rs-modal-body", children: [
|
|
1254
1246
|
step.type === "form" && /* @__PURE__ */ jsx2(
|
|
1255
1247
|
WithdrawFormStep,
|
|
@@ -1268,6 +1260,7 @@ function WithdrawFlow({
|
|
|
1268
1260
|
onTargetChainChange: handleTargetChainChange,
|
|
1269
1261
|
onTargetTokenChange: handleTargetTokenChange,
|
|
1270
1262
|
switchChain: signerContext.switchChain,
|
|
1263
|
+
walletIcon: selectedWalletIcon,
|
|
1271
1264
|
submitting: isSubmitting,
|
|
1272
1265
|
onSubmit: handleFormSubmit,
|
|
1273
1266
|
onBalanceUsdChange: setTotalBalanceUsd
|
|
@@ -1281,7 +1274,6 @@ function WithdrawFlow({
|
|
|
1281
1274
|
sourceChain: step.sourceChain,
|
|
1282
1275
|
sourceToken: step.sourceToken,
|
|
1283
1276
|
targetChain,
|
|
1284
|
-
targetToken,
|
|
1285
1277
|
amount: step.amount,
|
|
1286
1278
|
waitForFinalTx,
|
|
1287
1279
|
service,
|
|
@@ -1300,7 +1292,7 @@ function WithdrawFlow({
|
|
|
1300
1292
|
// src/WithdrawModal.tsx
|
|
1301
1293
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1302
1294
|
var ReownWithdrawInner = lazy(
|
|
1303
|
-
() => import("./WithdrawModalReown-
|
|
1295
|
+
() => import("./WithdrawModalReown-PMPLUJBE.mjs").then((m) => ({
|
|
1304
1296
|
default: m.WithdrawModalReown
|
|
1305
1297
|
}))
|
|
1306
1298
|
);
|
|
@@ -1333,6 +1325,7 @@ function WithdrawModalInner({
|
|
|
1333
1325
|
waitForFinalTx = true,
|
|
1334
1326
|
reownWallet,
|
|
1335
1327
|
onConnect,
|
|
1328
|
+
onDisconnect,
|
|
1336
1329
|
onSignTransaction,
|
|
1337
1330
|
onRequestConnect,
|
|
1338
1331
|
connectButtonLabel,
|
|
@@ -1501,6 +1494,7 @@ function WithdrawModalInner({
|
|
|
1501
1494
|
waitForFinalTx,
|
|
1502
1495
|
reownWallet,
|
|
1503
1496
|
onConnect,
|
|
1497
|
+
onDisconnect,
|
|
1504
1498
|
onSignTransaction,
|
|
1505
1499
|
onRequestConnect,
|
|
1506
1500
|
connectButtonLabel,
|