@rhinestone/deposit-modal 0.1.33 → 0.1.35
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-7ZO7HUN3.mjs → DepositModalReown-25YB4LPZ.mjs} +1 -1
- package/dist/{DepositModalReown-VNKZT5A7.cjs → DepositModalReown-TLKQ7Y4X.cjs} +2 -2
- package/dist/{WithdrawModalReown-YP4PEERJ.cjs → WithdrawModalReown-HJYESBOR.cjs} +2 -2
- package/dist/{WithdrawModalReown-PMPLUJBE.mjs → WithdrawModalReown-SVRGP2R2.mjs} +1 -1
- package/dist/{chunk-HNDZ6G5K.mjs → chunk-DL5M5QZZ.mjs} +7 -7
- package/dist/{chunk-ECLVABYN.mjs → chunk-GJ7W4TIL.mjs} +56 -24
- package/dist/{chunk-SIGTZB3C.cjs → chunk-YCXVHPGZ.cjs} +7 -7
- package/dist/{chunk-4WXSBBHQ.cjs → chunk-YWZMQIUA.cjs} +64 -32
- package/dist/deposit.cjs +2 -2
- package/dist/deposit.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +2 -2
- package/dist/reown.cjs +3 -3
- package/dist/reown.mjs +2 -2
- package/dist/withdraw.cjs +2 -2
- package/dist/withdraw.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYCXVHPGZcjs = require('./chunk-YCXVHPGZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ function DepositModalWithReown(props) {
|
|
|
20
20
|
reown.disconnect();
|
|
21
21
|
}, [reown.disconnect]);
|
|
22
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
-
|
|
23
|
+
_chunkYCXVHPGZcjs.DepositModalInner,
|
|
24
24
|
{
|
|
25
25
|
...props,
|
|
26
26
|
reownWallet: reown,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYWZMQIUAcjs = require('./chunk-YWZMQIUA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -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
|
-
|
|
23
|
+
_chunkYWZMQIUAcjs.WithdrawModalInner,
|
|
24
24
|
{
|
|
25
25
|
...props,
|
|
26
26
|
reownWallet: reown,
|
|
@@ -1887,14 +1887,14 @@ function DepositFlow({
|
|
|
1887
1887
|
}
|
|
1888
1888
|
return null;
|
|
1889
1889
|
}, [selectedConnectAddress, walletOptions]);
|
|
1890
|
-
const walletOptionsKey = useMemo5(
|
|
1891
|
-
() => walletOptions.map((option) => option.address.toLowerCase()).join(","),
|
|
1892
|
-
[walletOptions]
|
|
1893
|
-
);
|
|
1894
1890
|
const hasNavigatedBackRef = useRef5(false);
|
|
1895
1891
|
useEffect7(() => {
|
|
1896
|
-
|
|
1897
|
-
|
|
1892
|
+
if (!showConnectStep && isConnectSelectionConfirmed && flowMode === "wallet" && !signerContext) {
|
|
1893
|
+
setSelectedConnectAddress(null);
|
|
1894
|
+
setIsConnectSelectionConfirmed(false);
|
|
1895
|
+
setFlowMode(null);
|
|
1896
|
+
}
|
|
1897
|
+
}, [showConnectStep, isConnectSelectionConfirmed, flowMode, signerContext]);
|
|
1898
1898
|
useEffect7(() => {
|
|
1899
1899
|
if (hasNavigatedBackRef.current || isConnectSelectionConfirmed || flowMode) {
|
|
1900
1900
|
return;
|
|
@@ -2099,7 +2099,7 @@ function DepositFlow({
|
|
|
2099
2099
|
// src/DepositModal.tsx
|
|
2100
2100
|
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2101
2101
|
var ReownDepositInner = lazy(
|
|
2102
|
-
() => import("./DepositModalReown-
|
|
2102
|
+
() => import("./DepositModalReown-25YB4LPZ.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
2103
2103
|
);
|
|
2104
2104
|
function DepositModal(props) {
|
|
2105
2105
|
const needsReown = !!props.reownAppId;
|
|
@@ -60,10 +60,20 @@ function useClickOutside(ref, onClose) {
|
|
|
60
60
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
61
61
|
}, [ref, onClose]);
|
|
62
62
|
}
|
|
63
|
+
function resolvePreferredConnectedRecipient(connectedAddress, fallbackAddress, safeAddress) {
|
|
64
|
+
const candidates = [connectedAddress, fallbackAddress].filter(
|
|
65
|
+
(value) => Boolean(value)
|
|
66
|
+
);
|
|
67
|
+
const nonSafe = candidates.find(
|
|
68
|
+
(value) => value.toLowerCase() !== safeAddress.toLowerCase()
|
|
69
|
+
);
|
|
70
|
+
return nonSafe ?? candidates[0] ?? "";
|
|
71
|
+
}
|
|
63
72
|
function WithdrawFormStep({
|
|
64
73
|
walletClient,
|
|
65
74
|
publicClient,
|
|
66
75
|
address,
|
|
76
|
+
connectedAddress,
|
|
67
77
|
safeAddress,
|
|
68
78
|
asset,
|
|
69
79
|
defaultRecipient,
|
|
@@ -80,9 +90,13 @@ function WithdrawFormStep({
|
|
|
80
90
|
onSubmit,
|
|
81
91
|
onBalanceUsdChange
|
|
82
92
|
}) {
|
|
83
|
-
const
|
|
84
|
-
|
|
93
|
+
const preferredConnectedRecipient = resolvePreferredConnectedRecipient(
|
|
94
|
+
connectedAddress,
|
|
95
|
+
address,
|
|
96
|
+
safeAddress
|
|
85
97
|
);
|
|
98
|
+
const seededRecipient = defaultRecipient ?? preferredConnectedRecipient;
|
|
99
|
+
const [recipient, setRecipient] = useState(seededRecipient);
|
|
86
100
|
const [amount, setAmount] = useState(defaultAmount ?? "");
|
|
87
101
|
const [balance, setBalance] = useState(null);
|
|
88
102
|
const [error, setError] = useState(null);
|
|
@@ -97,7 +111,7 @@ function WithdrawFormStep({
|
|
|
97
111
|
useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
|
|
98
112
|
useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
|
|
99
113
|
const isRecipientConnected = Boolean(
|
|
100
|
-
|
|
114
|
+
preferredConnectedRecipient && recipient && recipient.toLowerCase() === preferredConnectedRecipient.toLowerCase()
|
|
101
115
|
);
|
|
102
116
|
const chainMismatch = Boolean(
|
|
103
117
|
walletClient?.chain?.id && walletClient.chain.id !== asset.chainId
|
|
@@ -105,6 +119,17 @@ function WithdrawFormStep({
|
|
|
105
119
|
const targetSymbol = getTokenSymbol(targetToken, targetChain);
|
|
106
120
|
const targetChainName = getChainName(targetChain);
|
|
107
121
|
const isBusy = submitting || isSubmitting;
|
|
122
|
+
const seededRecipientRef = useRef(seededRecipient);
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
const nextSeed = defaultRecipient ?? preferredConnectedRecipient;
|
|
125
|
+
setRecipient((current) => {
|
|
126
|
+
if (current === seededRecipientRef.current || current === "") {
|
|
127
|
+
return nextSeed;
|
|
128
|
+
}
|
|
129
|
+
return current;
|
|
130
|
+
});
|
|
131
|
+
seededRecipientRef.current = nextSeed;
|
|
132
|
+
}, [defaultRecipient, preferredConnectedRecipient]);
|
|
108
133
|
useEffect(() => {
|
|
109
134
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
110
135
|
hasAttemptedSwitch.current = true;
|
|
@@ -198,10 +223,10 @@ function WithdrawFormStep({
|
|
|
198
223
|
setError(null);
|
|
199
224
|
}, [balance, asset.decimals]);
|
|
200
225
|
const handleUseConnected = useCallback(() => {
|
|
201
|
-
if (!
|
|
202
|
-
setRecipient(
|
|
226
|
+
if (!preferredConnectedRecipient) return;
|
|
227
|
+
setRecipient(preferredConnectedRecipient);
|
|
203
228
|
setError(null);
|
|
204
|
-
}, [
|
|
229
|
+
}, [preferredConnectedRecipient]);
|
|
205
230
|
const handleWithdraw = useCallback(async () => {
|
|
206
231
|
if (!recipient || !/^0x[a-fA-F0-9]{40}$/.test(recipient)) {
|
|
207
232
|
setError("Enter a valid recipient address");
|
|
@@ -900,7 +925,7 @@ function WithdrawFlow({
|
|
|
900
925
|
reownWallet?.walletClient,
|
|
901
926
|
reownWallet?.publicClient
|
|
902
927
|
]);
|
|
903
|
-
const canAutoLock = (dappWalletClient?.account && dappAddress
|
|
928
|
+
const canAutoLock = hasCustomSigner || Boolean(dappWalletClient?.account && dappAddress) && !reownWallet;
|
|
904
929
|
const [selectedConnectAddress, setSelectedConnectAddress] = useState2(null);
|
|
905
930
|
const signerContext = useMemo2(() => {
|
|
906
931
|
if (canAutoLock) {
|
|
@@ -1035,7 +1060,10 @@ function WithdrawFlow({
|
|
|
1035
1060
|
primaryType: typedData.primaryType,
|
|
1036
1061
|
message: typedData.message
|
|
1037
1062
|
});
|
|
1038
|
-
const sessionDetails = buildSessionDetails(
|
|
1063
|
+
const sessionDetails = buildSessionDetails(
|
|
1064
|
+
setup.sessionDetailsUnsigned,
|
|
1065
|
+
signature
|
|
1066
|
+
);
|
|
1039
1067
|
await service.registerAccount({
|
|
1040
1068
|
address: smartAccount,
|
|
1041
1069
|
accountParams: {
|
|
@@ -1204,14 +1232,21 @@ function WithdrawFlow({
|
|
|
1204
1232
|
}
|
|
1205
1233
|
return null;
|
|
1206
1234
|
}, [selectedConnectAddress, walletOptions]);
|
|
1207
|
-
const walletOptionsKey = useMemo2(
|
|
1208
|
-
() => walletOptions.map((option) => option.address.toLowerCase()).join(","),
|
|
1209
|
-
[walletOptions]
|
|
1210
|
-
);
|
|
1211
1235
|
const showConnectStep = !canAutoLock && !isConnectSelectionConfirmed;
|
|
1212
1236
|
useEffect2(() => {
|
|
1213
|
-
|
|
1214
|
-
|
|
1237
|
+
if (!showConnectStep && isConnectSelectionConfirmed && !signerContext) {
|
|
1238
|
+
setSelectedConnectAddress(null);
|
|
1239
|
+
setIsConnectSelectionConfirmed(false);
|
|
1240
|
+
}
|
|
1241
|
+
}, [showConnectStep, isConnectSelectionConfirmed, signerContext]);
|
|
1242
|
+
const ownerAddress = signerContext?.ownerAddress;
|
|
1243
|
+
const selectedWalletIcon = useMemo2(() => {
|
|
1244
|
+
if (!ownerAddress) return reownWallet?.icon;
|
|
1245
|
+
const selected = walletOptions.find(
|
|
1246
|
+
(o) => o.address.toLowerCase() === ownerAddress.toLowerCase()
|
|
1247
|
+
);
|
|
1248
|
+
return selected?.icon ?? reownWallet?.icon;
|
|
1249
|
+
}, [walletOptions, ownerAddress, reownWallet?.icon]);
|
|
1215
1250
|
if (showConnectStep) {
|
|
1216
1251
|
return /* @__PURE__ */ jsx2("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx2(
|
|
1217
1252
|
ConnectStep,
|
|
@@ -1234,24 +1269,21 @@ function WithdrawFlow({
|
|
|
1234
1269
|
}
|
|
1235
1270
|
if (!signerContext) return null;
|
|
1236
1271
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1237
|
-
const
|
|
1272
|
+
const resolvedOwnerAddress = signerContext.ownerAddress;
|
|
1273
|
+
const resolvedConnectedAddress = signerContext.walletClient?.account?.address ?? reownWallet?.address ?? dappWalletClient?.account?.address ?? resolvedOwnerAddress;
|
|
1274
|
+
const resolvedDefaultRecipient = defaultRecipient ?? resolvedOwnerAddress;
|
|
1238
1275
|
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]);
|
|
1245
1276
|
return /* @__PURE__ */ jsxs2("div", { className: "rs-modal-body", children: [
|
|
1246
1277
|
step.type === "form" && /* @__PURE__ */ jsx2(
|
|
1247
1278
|
WithdrawFormStep,
|
|
1248
1279
|
{
|
|
1249
1280
|
walletClient: signerContext.walletClient,
|
|
1250
1281
|
publicClient: formPublicClient,
|
|
1251
|
-
address:
|
|
1282
|
+
address: resolvedOwnerAddress,
|
|
1283
|
+
connectedAddress: resolvedConnectedAddress,
|
|
1252
1284
|
safeAddress,
|
|
1253
1285
|
asset,
|
|
1254
|
-
defaultRecipient:
|
|
1286
|
+
defaultRecipient: resolvedDefaultRecipient,
|
|
1255
1287
|
defaultAmount,
|
|
1256
1288
|
targetChain,
|
|
1257
1289
|
targetToken,
|
|
@@ -1292,7 +1324,7 @@ function WithdrawFlow({
|
|
|
1292
1324
|
// src/WithdrawModal.tsx
|
|
1293
1325
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1294
1326
|
var ReownWithdrawInner = lazy(
|
|
1295
|
-
() => import("./WithdrawModalReown-
|
|
1327
|
+
() => import("./WithdrawModalReown-SVRGP2R2.mjs").then((m) => ({
|
|
1296
1328
|
default: m.WithdrawModalReown
|
|
1297
1329
|
}))
|
|
1298
1330
|
);
|
|
@@ -1887,14 +1887,14 @@ function DepositFlow({
|
|
|
1887
1887
|
}
|
|
1888
1888
|
return null;
|
|
1889
1889
|
}, [selectedConnectAddress, walletOptions]);
|
|
1890
|
-
const walletOptionsKey = _react.useMemo.call(void 0,
|
|
1891
|
-
() => walletOptions.map((option) => option.address.toLowerCase()).join(","),
|
|
1892
|
-
[walletOptions]
|
|
1893
|
-
);
|
|
1894
1890
|
const hasNavigatedBackRef = _react.useRef.call(void 0, false);
|
|
1895
1891
|
_react.useEffect.call(void 0, () => {
|
|
1896
|
-
|
|
1897
|
-
|
|
1892
|
+
if (!showConnectStep && isConnectSelectionConfirmed && flowMode === "wallet" && !signerContext) {
|
|
1893
|
+
setSelectedConnectAddress(null);
|
|
1894
|
+
setIsConnectSelectionConfirmed(false);
|
|
1895
|
+
setFlowMode(null);
|
|
1896
|
+
}
|
|
1897
|
+
}, [showConnectStep, isConnectSelectionConfirmed, flowMode, signerContext]);
|
|
1898
1898
|
_react.useEffect.call(void 0, () => {
|
|
1899
1899
|
if (hasNavigatedBackRef.current || isConnectSelectionConfirmed || flowMode) {
|
|
1900
1900
|
return;
|
|
@@ -2099,7 +2099,7 @@ function DepositFlow({
|
|
|
2099
2099
|
// src/DepositModal.tsx
|
|
2100
2100
|
|
|
2101
2101
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
2102
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
2102
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-TLKQ7Y4X.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2103
2103
|
);
|
|
2104
2104
|
function DepositModal(props) {
|
|
2105
2105
|
const needsReown = !!props.reownAppId;
|
|
@@ -60,10 +60,20 @@ function useClickOutside(ref, onClose) {
|
|
|
60
60
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
61
61
|
}, [ref, onClose]);
|
|
62
62
|
}
|
|
63
|
+
function resolvePreferredConnectedRecipient(connectedAddress, fallbackAddress, safeAddress) {
|
|
64
|
+
const candidates = [connectedAddress, fallbackAddress].filter(
|
|
65
|
+
(value) => Boolean(value)
|
|
66
|
+
);
|
|
67
|
+
const nonSafe = candidates.find(
|
|
68
|
+
(value) => value.toLowerCase() !== safeAddress.toLowerCase()
|
|
69
|
+
);
|
|
70
|
+
return _nullishCoalesce(_nullishCoalesce(nonSafe, () => ( candidates[0])), () => ( ""));
|
|
71
|
+
}
|
|
63
72
|
function WithdrawFormStep({
|
|
64
73
|
walletClient,
|
|
65
74
|
publicClient,
|
|
66
75
|
address,
|
|
76
|
+
connectedAddress,
|
|
67
77
|
safeAddress,
|
|
68
78
|
asset,
|
|
69
79
|
defaultRecipient,
|
|
@@ -80,9 +90,13 @@ function WithdrawFormStep({
|
|
|
80
90
|
onSubmit,
|
|
81
91
|
onBalanceUsdChange
|
|
82
92
|
}) {
|
|
83
|
-
const
|
|
84
|
-
|
|
93
|
+
const preferredConnectedRecipient = resolvePreferredConnectedRecipient(
|
|
94
|
+
connectedAddress,
|
|
95
|
+
address,
|
|
96
|
+
safeAddress
|
|
85
97
|
);
|
|
98
|
+
const seededRecipient = _nullishCoalesce(defaultRecipient, () => ( preferredConnectedRecipient));
|
|
99
|
+
const [recipient, setRecipient] = _react.useState.call(void 0, seededRecipient);
|
|
86
100
|
const [amount, setAmount] = _react.useState.call(void 0, _nullishCoalesce(defaultAmount, () => ( "")));
|
|
87
101
|
const [balance, setBalance] = _react.useState.call(void 0, null);
|
|
88
102
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
@@ -97,7 +111,7 @@ function WithdrawFormStep({
|
|
|
97
111
|
useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
|
|
98
112
|
useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
|
|
99
113
|
const isRecipientConnected = Boolean(
|
|
100
|
-
|
|
114
|
+
preferredConnectedRecipient && recipient && recipient.toLowerCase() === preferredConnectedRecipient.toLowerCase()
|
|
101
115
|
);
|
|
102
116
|
const chainMismatch = Boolean(
|
|
103
117
|
_optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
|
|
@@ -105,6 +119,17 @@ function WithdrawFormStep({
|
|
|
105
119
|
const targetSymbol = _chunkS4UBVD3Hcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
106
120
|
const targetChainName = _chunkS4UBVD3Hcjs.getChainName.call(void 0, targetChain);
|
|
107
121
|
const isBusy = submitting || isSubmitting;
|
|
122
|
+
const seededRecipientRef = _react.useRef.call(void 0, seededRecipient);
|
|
123
|
+
_react.useEffect.call(void 0, () => {
|
|
124
|
+
const nextSeed = _nullishCoalesce(defaultRecipient, () => ( preferredConnectedRecipient));
|
|
125
|
+
setRecipient((current) => {
|
|
126
|
+
if (current === seededRecipientRef.current || current === "") {
|
|
127
|
+
return nextSeed;
|
|
128
|
+
}
|
|
129
|
+
return current;
|
|
130
|
+
});
|
|
131
|
+
seededRecipientRef.current = nextSeed;
|
|
132
|
+
}, [defaultRecipient, preferredConnectedRecipient]);
|
|
108
133
|
_react.useEffect.call(void 0, () => {
|
|
109
134
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
110
135
|
hasAttemptedSwitch.current = true;
|
|
@@ -198,10 +223,10 @@ function WithdrawFormStep({
|
|
|
198
223
|
setError(null);
|
|
199
224
|
}, [balance, asset.decimals]);
|
|
200
225
|
const handleUseConnected = _react.useCallback.call(void 0, () => {
|
|
201
|
-
if (!
|
|
202
|
-
setRecipient(
|
|
226
|
+
if (!preferredConnectedRecipient) return;
|
|
227
|
+
setRecipient(preferredConnectedRecipient);
|
|
203
228
|
setError(null);
|
|
204
|
-
}, [
|
|
229
|
+
}, [preferredConnectedRecipient]);
|
|
205
230
|
const handleWithdraw = _react.useCallback.call(void 0, async () => {
|
|
206
231
|
if (!recipient || !/^0x[a-fA-F0-9]{40}$/.test(recipient)) {
|
|
207
232
|
setError("Enter a valid recipient address");
|
|
@@ -900,7 +925,7 @@ function WithdrawFlow({
|
|
|
900
925
|
_optionalChain([reownWallet, 'optionalAccess', _13 => _13.walletClient]),
|
|
901
926
|
_optionalChain([reownWallet, 'optionalAccess', _14 => _14.publicClient])
|
|
902
927
|
]);
|
|
903
|
-
const canAutoLock = (_optionalChain([dappWalletClient, 'optionalAccess', _15 => _15.account]) && dappAddress
|
|
928
|
+
const canAutoLock = hasCustomSigner || Boolean(_optionalChain([dappWalletClient, 'optionalAccess', _15 => _15.account]) && dappAddress) && !reownWallet;
|
|
904
929
|
const [selectedConnectAddress, setSelectedConnectAddress] = _react.useState.call(void 0, null);
|
|
905
930
|
const signerContext = _react.useMemo.call(void 0, () => {
|
|
906
931
|
if (canAutoLock) {
|
|
@@ -1035,7 +1060,10 @@ function WithdrawFlow({
|
|
|
1035
1060
|
primaryType: typedData.primaryType,
|
|
1036
1061
|
message: typedData.message
|
|
1037
1062
|
});
|
|
1038
|
-
const sessionDetails = _chunkYIHOACM3cjs.buildSessionDetails.call(void 0,
|
|
1063
|
+
const sessionDetails = _chunkYIHOACM3cjs.buildSessionDetails.call(void 0,
|
|
1064
|
+
setup.sessionDetailsUnsigned,
|
|
1065
|
+
signature
|
|
1066
|
+
);
|
|
1039
1067
|
await service.registerAccount({
|
|
1040
1068
|
address: smartAccount,
|
|
1041
1069
|
accountParams: {
|
|
@@ -1204,14 +1232,21 @@ function WithdrawFlow({
|
|
|
1204
1232
|
}
|
|
1205
1233
|
return null;
|
|
1206
1234
|
}, [selectedConnectAddress, walletOptions]);
|
|
1207
|
-
const walletOptionsKey = _react.useMemo.call(void 0,
|
|
1208
|
-
() => walletOptions.map((option) => option.address.toLowerCase()).join(","),
|
|
1209
|
-
[walletOptions]
|
|
1210
|
-
);
|
|
1211
1235
|
const showConnectStep = !canAutoLock && !isConnectSelectionConfirmed;
|
|
1212
1236
|
_react.useEffect.call(void 0, () => {
|
|
1213
|
-
|
|
1214
|
-
|
|
1237
|
+
if (!showConnectStep && isConnectSelectionConfirmed && !signerContext) {
|
|
1238
|
+
setSelectedConnectAddress(null);
|
|
1239
|
+
setIsConnectSelectionConfirmed(false);
|
|
1240
|
+
}
|
|
1241
|
+
}, [showConnectStep, isConnectSelectionConfirmed, signerContext]);
|
|
1242
|
+
const ownerAddress = _optionalChain([signerContext, 'optionalAccess', _30 => _30.ownerAddress]);
|
|
1243
|
+
const selectedWalletIcon = _react.useMemo.call(void 0, () => {
|
|
1244
|
+
if (!ownerAddress) return _optionalChain([reownWallet, 'optionalAccess', _31 => _31.icon]);
|
|
1245
|
+
const selected = walletOptions.find(
|
|
1246
|
+
(o) => o.address.toLowerCase() === ownerAddress.toLowerCase()
|
|
1247
|
+
);
|
|
1248
|
+
return _nullishCoalesce(_optionalChain([selected, 'optionalAccess', _32 => _32.icon]), () => ( _optionalChain([reownWallet, 'optionalAccess', _33 => _33.icon])));
|
|
1249
|
+
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _34 => _34.icon])]);
|
|
1215
1250
|
if (showConnectStep) {
|
|
1216
1251
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1217
1252
|
_chunkYIHOACM3cjs.ConnectStep,
|
|
@@ -1234,24 +1269,21 @@ function WithdrawFlow({
|
|
|
1234
1269
|
}
|
|
1235
1270
|
if (!signerContext) return null;
|
|
1236
1271
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1237
|
-
const
|
|
1272
|
+
const resolvedOwnerAddress = signerContext.ownerAddress;
|
|
1273
|
+
const resolvedConnectedAddress = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _35 => _35.walletClient, 'optionalAccess', _36 => _36.account, 'optionalAccess', _37 => _37.address]), () => ( _optionalChain([reownWallet, 'optionalAccess', _38 => _38.address]))), () => ( _optionalChain([dappWalletClient, 'optionalAccess', _39 => _39.account, 'optionalAccess', _40 => _40.address]))), () => ( resolvedOwnerAddress));
|
|
1274
|
+
const resolvedDefaultRecipient = _nullishCoalesce(defaultRecipient, () => ( resolvedOwnerAddress));
|
|
1238
1275
|
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkYIHOACM3cjs.getPublicClient.call(void 0, sourceChain)));
|
|
1239
|
-
const selectedWalletIcon = _react.useMemo.call(void 0, () => {
|
|
1240
|
-
const selected = walletOptions.find(
|
|
1241
|
-
(o) => o.address.toLowerCase() === ownerAddress.toLowerCase()
|
|
1242
|
-
);
|
|
1243
|
-
return _nullishCoalesce(_optionalChain([selected, 'optionalAccess', _30 => _30.icon]), () => ( _optionalChain([reownWallet, 'optionalAccess', _31 => _31.icon])));
|
|
1244
|
-
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _32 => _32.icon])]);
|
|
1245
1276
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1246
1277
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1247
1278
|
WithdrawFormStep,
|
|
1248
1279
|
{
|
|
1249
1280
|
walletClient: signerContext.walletClient,
|
|
1250
1281
|
publicClient: formPublicClient,
|
|
1251
|
-
address:
|
|
1282
|
+
address: resolvedOwnerAddress,
|
|
1283
|
+
connectedAddress: resolvedConnectedAddress,
|
|
1252
1284
|
safeAddress,
|
|
1253
1285
|
asset,
|
|
1254
|
-
defaultRecipient:
|
|
1286
|
+
defaultRecipient: resolvedDefaultRecipient,
|
|
1255
1287
|
defaultAmount,
|
|
1256
1288
|
targetChain,
|
|
1257
1289
|
targetToken,
|
|
@@ -1292,7 +1324,7 @@ function WithdrawFlow({
|
|
|
1292
1324
|
// src/WithdrawModal.tsx
|
|
1293
1325
|
|
|
1294
1326
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1295
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1327
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-HJYESBOR.cjs"))).then((m) => ({
|
|
1296
1328
|
default: m.WithdrawModalReown
|
|
1297
1329
|
}))
|
|
1298
1330
|
);
|
|
@@ -1357,7 +1389,7 @@ function WithdrawModalInner({
|
|
|
1357
1389
|
_react.useEffect.call(void 0, () => {
|
|
1358
1390
|
if (isOpen && !hasCalledReady.current) {
|
|
1359
1391
|
hasCalledReady.current = true;
|
|
1360
|
-
_optionalChain([onReady, 'optionalCall',
|
|
1392
|
+
_optionalChain([onReady, 'optionalCall', _41 => _41()]);
|
|
1361
1393
|
}
|
|
1362
1394
|
}, [isOpen, onReady]);
|
|
1363
1395
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1376,14 +1408,14 @@ function WithdrawModalInner({
|
|
|
1376
1408
|
setTotalBalanceUsd(balance2);
|
|
1377
1409
|
}, []);
|
|
1378
1410
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
1379
|
-
_optionalChain([backHandlerRef, 'access',
|
|
1411
|
+
_optionalChain([backHandlerRef, 'access', _42 => _42.current, 'optionalCall', _43 => _43()]);
|
|
1380
1412
|
}, []);
|
|
1381
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1382
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1383
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1384
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
1385
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
1386
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
1413
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _44 => _44.showLogo]), () => ( false));
|
|
1414
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _45 => _45.showStepper]), () => ( false));
|
|
1415
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _46 => _46.showBackButton]), () => ( true));
|
|
1416
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _47 => _47.balance]);
|
|
1417
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _48 => _48.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
1418
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _49 => _49.title]), () => ( "Withdraw"));
|
|
1387
1419
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1388
1420
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1389
1421
|
_chunkYIHOACM3cjs.Modal,
|
package/dist/deposit.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYCXVHPGZcjs = require('./chunk-YCXVHPGZ.cjs');
|
|
4
4
|
require('./chunk-YIHOACM3.cjs');
|
|
5
5
|
require('./chunk-S4UBVD3H.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.DepositModal =
|
|
8
|
+
exports.DepositModal = _chunkYCXVHPGZcjs.DepositModal;
|
package/dist/deposit.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYCXVHPGZcjs = require('./chunk-YCXVHPGZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkYWZMQIUAcjs = require('./chunk-YWZMQIUA.cjs');
|
|
7
7
|
require('./chunk-YIHOACM3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
@@ -66,4 +66,4 @@ var _chunkS4UBVD3Hcjs = require('./chunk-S4UBVD3H.cjs');
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
exports.CHAIN_BY_ID = _chunkS4UBVD3Hcjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkS4UBVD3Hcjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkS4UBVD3Hcjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal =
|
|
69
|
+
exports.CHAIN_BY_ID = _chunkS4UBVD3Hcjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkS4UBVD3Hcjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkS4UBVD3Hcjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkYCXVHPGZcjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkS4UBVD3Hcjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkS4UBVD3Hcjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkS4UBVD3Hcjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunkYWZMQIUAcjs.WithdrawModal; exports.chainRegistry = _chunkS4UBVD3Hcjs.chainRegistry; exports.findChainIdForToken = _chunkS4UBVD3Hcjs.findChainIdForToken; exports.getChainBadge = _chunkS4UBVD3Hcjs.getChainBadge; exports.getChainIcon = _chunkS4UBVD3Hcjs.getChainIcon; exports.getChainId = _chunkS4UBVD3Hcjs.getChainId; exports.getChainName = _chunkS4UBVD3Hcjs.getChainName; exports.getChainObject = _chunkS4UBVD3Hcjs.getChainObject; exports.getExplorerName = _chunkS4UBVD3Hcjs.getExplorerName; exports.getExplorerTxUrl = _chunkS4UBVD3Hcjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkS4UBVD3Hcjs.getExplorerUrl; exports.getSupportedChainIds = _chunkS4UBVD3Hcjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkS4UBVD3Hcjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkS4UBVD3Hcjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkS4UBVD3Hcjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkS4UBVD3Hcjs.getTokenAddress; exports.getTokenDecimals = _chunkS4UBVD3Hcjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkS4UBVD3Hcjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkS4UBVD3Hcjs.getTokenIcon; exports.getTokenSymbol = _chunkS4UBVD3Hcjs.getTokenSymbol; exports.getUsdcAddress = _chunkS4UBVD3Hcjs.getUsdcAddress; exports.getUsdcDecimals = _chunkS4UBVD3Hcjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkS4UBVD3Hcjs.isSupportedTokenAddressForChain;
|
package/dist/index.mjs
CHANGED
package/dist/reown.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYCXVHPGZcjs = require('./chunk-YCXVHPGZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkYWZMQIUAcjs = require('./chunk-YWZMQIUA.cjs');
|
|
7
7
|
require('./chunk-YIHOACM3.cjs');
|
|
8
8
|
require('./chunk-S4UBVD3H.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.DepositModal =
|
|
12
|
+
exports.DepositModal = _chunkYCXVHPGZcjs.DepositModal; exports.WithdrawModal = _chunkYWZMQIUAcjs.WithdrawModal;
|
package/dist/reown.mjs
CHANGED
package/dist/withdraw.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYWZMQIUAcjs = require('./chunk-YWZMQIUA.cjs');
|
|
4
4
|
require('./chunk-YIHOACM3.cjs');
|
|
5
5
|
require('./chunk-S4UBVD3H.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.WithdrawModal =
|
|
8
|
+
exports.WithdrawModal = _chunkYWZMQIUAcjs.WithdrawModal;
|
package/dist/withdraw.mjs
CHANGED