@rhinestone/deposit-modal 0.1.63 → 0.1.65
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-3KQE4YU6.cjs → DepositModalReown-6ZMLUWWD.cjs} +3 -3
- package/dist/{DepositModalReown-XOLZ62BQ.mjs → DepositModalReown-Y4M3RA73.mjs} +2 -2
- package/dist/{WithdrawModalReown-2BW5CM3A.mjs → WithdrawModalReown-HVBMAUPM.mjs} +2 -2
- package/dist/{WithdrawModalReown-RCQFBPOF.cjs → WithdrawModalReown-WJ5SHBV4.cjs} +3 -3
- package/dist/{chunk-5SR5N75I.cjs → chunk-4CZ7W3RS.cjs} +75 -73
- package/dist/{chunk-TDTBAZNO.mjs → chunk-GAHX5RAT.mjs} +2 -0
- package/dist/{chunk-XVCPUB6K.mjs → chunk-IYZGLNY6.mjs} +4 -2
- package/dist/{chunk-OFGBTU45.cjs → chunk-MGV75YLV.cjs} +61 -77
- package/dist/{chunk-N3BZTUSJ.cjs → chunk-OWV4KVBM.cjs} +88 -86
- package/dist/{chunk-2IFX6ZEE.mjs → chunk-RKRF7ANK.mjs} +16 -32
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +4 -4
- package/dist/reown.mjs +3 -3
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunk4CZ7W3RScjs = require('./chunk-4CZ7W3RS.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -65,20 +65,10 @@ function useClickOutside(ref, onClose) {
|
|
|
65
65
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
66
66
|
}, [ref, onClose]);
|
|
67
67
|
}
|
|
68
|
-
function resolvePreferredConnectedRecipient(connectedAddress, fallbackAddress, safeAddress) {
|
|
69
|
-
const candidates = [connectedAddress, fallbackAddress].filter(
|
|
70
|
-
(value) => Boolean(value)
|
|
71
|
-
);
|
|
72
|
-
const nonSafe = candidates.find(
|
|
73
|
-
(value) => value.toLowerCase() !== safeAddress.toLowerCase()
|
|
74
|
-
);
|
|
75
|
-
return _nullishCoalesce(_nullishCoalesce(nonSafe, () => ( candidates[0])), () => ( ""));
|
|
76
|
-
}
|
|
77
68
|
function WithdrawFormStep({
|
|
78
69
|
walletClient,
|
|
79
70
|
publicClient,
|
|
80
|
-
|
|
81
|
-
connectedAddress,
|
|
71
|
+
connectedRecipient,
|
|
82
72
|
safeAddress,
|
|
83
73
|
asset,
|
|
84
74
|
defaultRecipient,
|
|
@@ -95,13 +85,7 @@ function WithdrawFormStep({
|
|
|
95
85
|
onSubmit,
|
|
96
86
|
onBalanceUsdChange
|
|
97
87
|
}) {
|
|
98
|
-
const
|
|
99
|
-
connectedAddress,
|
|
100
|
-
address,
|
|
101
|
-
safeAddress
|
|
102
|
-
);
|
|
103
|
-
const seededRecipient = _nullishCoalesce(defaultRecipient, () => ( preferredConnectedRecipient));
|
|
104
|
-
const [recipient, setRecipient] = _react.useState.call(void 0, seededRecipient);
|
|
88
|
+
const [recipient, setRecipient] = _react.useState.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
105
89
|
const [amount, setAmount] = _react.useState.call(void 0, _nullishCoalesce(defaultAmount, () => ( "")));
|
|
106
90
|
const [balance, setBalance] = _react.useState.call(void 0, null);
|
|
107
91
|
const [isBalanceLoading, setIsBalanceLoading] = _react.useState.call(void 0, true);
|
|
@@ -116,6 +100,7 @@ function WithdrawFormStep({
|
|
|
116
100
|
const publicClientChainId = _optionalChain([publicClient, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]);
|
|
117
101
|
useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
|
|
118
102
|
useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
|
|
103
|
+
const preferredConnectedRecipient = _nullishCoalesce(connectedRecipient, () => ( ""));
|
|
119
104
|
const isRecipientConnected = Boolean(
|
|
120
105
|
preferredConnectedRecipient && recipient && recipient.toLowerCase() === preferredConnectedRecipient.toLowerCase()
|
|
121
106
|
);
|
|
@@ -125,9 +110,9 @@ function WithdrawFormStep({
|
|
|
125
110
|
const targetSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
126
111
|
const targetChainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
127
112
|
const isBusy = submitting || isSubmitting;
|
|
128
|
-
const seededRecipientRef = _react.useRef.call(void 0,
|
|
113
|
+
const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
129
114
|
_react.useEffect.call(void 0, () => {
|
|
130
|
-
const nextSeed = _nullishCoalesce(defaultRecipient, () => (
|
|
115
|
+
const nextSeed = _nullishCoalesce(defaultRecipient, () => ( ""));
|
|
131
116
|
setRecipient((current) => {
|
|
132
117
|
if (current === seededRecipientRef.current || current === "") {
|
|
133
118
|
return nextSeed;
|
|
@@ -135,14 +120,14 @@ function WithdrawFormStep({
|
|
|
135
120
|
return current;
|
|
136
121
|
});
|
|
137
122
|
seededRecipientRef.current = nextSeed;
|
|
138
|
-
}, [defaultRecipient
|
|
123
|
+
}, [defaultRecipient]);
|
|
139
124
|
_react.useEffect.call(void 0, () => {
|
|
140
125
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
141
126
|
hasAttemptedSwitch.current = true;
|
|
142
127
|
setIsSwitching(true);
|
|
143
128
|
switchChain(asset.chainId).catch((err) => {
|
|
144
129
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
145
|
-
setError(
|
|
130
|
+
setError(_chunk4CZ7W3RScjs.formatUserError.call(void 0, raw));
|
|
146
131
|
}).finally(() => {
|
|
147
132
|
setIsSwitching(false);
|
|
148
133
|
});
|
|
@@ -162,7 +147,7 @@ function WithdrawFormStep({
|
|
|
162
147
|
return;
|
|
163
148
|
}
|
|
164
149
|
try {
|
|
165
|
-
const bal =
|
|
150
|
+
const bal = _chunk4CZ7W3RScjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
166
151
|
address: asset.token,
|
|
167
152
|
abi: _viem.erc20Abi,
|
|
168
153
|
functionName: "balanceOf",
|
|
@@ -265,7 +250,7 @@ function WithdrawFormStep({
|
|
|
265
250
|
await onSubmit(recipient, amount);
|
|
266
251
|
} catch (err) {
|
|
267
252
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
268
|
-
setError(
|
|
253
|
+
setError(_chunk4CZ7W3RScjs.formatUserError.call(void 0, raw));
|
|
269
254
|
} finally {
|
|
270
255
|
setIsSubmitting(false);
|
|
271
256
|
}
|
|
@@ -273,11 +258,11 @@ function WithdrawFormStep({
|
|
|
273
258
|
if (isBalanceLoading) {
|
|
274
259
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
275
260
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
|
|
276
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
261
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4CZ7W3RScjs.Spinner, { className: "rs-spinner--lg" }),
|
|
277
262
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
278
263
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
279
264
|
] }),
|
|
280
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
265
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4CZ7W3RScjs.PoweredBy, {})
|
|
281
266
|
] });
|
|
282
267
|
}
|
|
283
268
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
@@ -298,7 +283,7 @@ function WithdrawFormStep({
|
|
|
298
283
|
}
|
|
299
284
|
}
|
|
300
285
|
),
|
|
301
|
-
|
|
286
|
+
preferredConnectedRecipient && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
302
287
|
"button",
|
|
303
288
|
{
|
|
304
289
|
type: "button",
|
|
@@ -376,7 +361,7 @@ function WithdrawFormStep({
|
|
|
376
361
|
] })
|
|
377
362
|
] }),
|
|
378
363
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
379
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
364
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunk4CZ7W3RScjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
380
365
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
381
366
|
"Balance: ",
|
|
382
367
|
formattedBalance,
|
|
@@ -570,7 +555,7 @@ function WithdrawFormStep({
|
|
|
570
555
|
] })
|
|
571
556
|
] }),
|
|
572
557
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
573
|
-
|
|
558
|
+
_chunk4CZ7W3RScjs.Button,
|
|
574
559
|
{
|
|
575
560
|
onClick: handleWithdraw,
|
|
576
561
|
fullWidth: true,
|
|
@@ -579,7 +564,7 @@ function WithdrawFormStep({
|
|
|
579
564
|
children: isBusy ? "Preparing..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
|
|
580
565
|
}
|
|
581
566
|
) }),
|
|
582
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
567
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4CZ7W3RScjs.PoweredBy, {})
|
|
583
568
|
] });
|
|
584
569
|
}
|
|
585
570
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -906,22 +891,22 @@ function WithdrawFlow({
|
|
|
906
891
|
onError,
|
|
907
892
|
debug
|
|
908
893
|
}) {
|
|
909
|
-
const onStepChangeRef =
|
|
910
|
-
const onTotalBalanceChangeRef =
|
|
911
|
-
const onEventRef =
|
|
894
|
+
const onStepChangeRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onStepChange);
|
|
895
|
+
const onTotalBalanceChangeRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
896
|
+
const onEventRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onEvent);
|
|
912
897
|
const [step, setStep] = _react.useState.call(void 0, { type: "form" });
|
|
913
898
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
914
899
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, 0);
|
|
915
900
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
|
|
916
901
|
const logFlow = _react.useCallback.call(void 0,
|
|
917
902
|
(message, data) => {
|
|
918
|
-
|
|
903
|
+
_chunk4CZ7W3RScjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
919
904
|
},
|
|
920
905
|
[debug]
|
|
921
906
|
);
|
|
922
907
|
const logFlowError = _react.useCallback.call(void 0,
|
|
923
908
|
(message, error, data) => {
|
|
924
|
-
|
|
909
|
+
_chunk4CZ7W3RScjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
925
910
|
},
|
|
926
911
|
[debug]
|
|
927
912
|
);
|
|
@@ -980,14 +965,14 @@ function WithdrawFlow({
|
|
|
980
965
|
return {
|
|
981
966
|
ownerAddress: dappAddress,
|
|
982
967
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
983
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
968
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain))),
|
|
984
969
|
switchChain: dappSwitchChain
|
|
985
970
|
};
|
|
986
971
|
}
|
|
987
972
|
return {
|
|
988
973
|
ownerAddress: dappWalletClient.account.address,
|
|
989
974
|
walletClient: dappWalletClient,
|
|
990
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
975
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain))),
|
|
991
976
|
switchChain: dappSwitchChain
|
|
992
977
|
};
|
|
993
978
|
}
|
|
@@ -998,7 +983,7 @@ function WithdrawFlow({
|
|
|
998
983
|
return {
|
|
999
984
|
ownerAddress: dappWalletClient.account.address,
|
|
1000
985
|
walletClient: dappWalletClient,
|
|
1001
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
986
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain))),
|
|
1002
987
|
switchChain: dappSwitchChain
|
|
1003
988
|
};
|
|
1004
989
|
}
|
|
@@ -1028,7 +1013,7 @@ function WithdrawFlow({
|
|
|
1028
1013
|
const symbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1029
1014
|
const decimals = _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1030
1015
|
return {
|
|
1031
|
-
id:
|
|
1016
|
+
id: _chunk4CZ7W3RScjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1032
1017
|
chainId: sourceChain,
|
|
1033
1018
|
token: sourceToken,
|
|
1034
1019
|
symbol,
|
|
@@ -1099,15 +1084,15 @@ function WithdrawFlow({
|
|
|
1099
1084
|
[logFlowError, onError]
|
|
1100
1085
|
);
|
|
1101
1086
|
const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
|
|
1102
|
-
const localOwner =
|
|
1087
|
+
const localOwner = _chunk4CZ7W3RScjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1103
1088
|
if (localOwner) {
|
|
1104
1089
|
return {
|
|
1105
|
-
account:
|
|
1090
|
+
account: _chunk4CZ7W3RScjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1106
1091
|
address: localOwner.address
|
|
1107
1092
|
};
|
|
1108
1093
|
}
|
|
1109
|
-
const created =
|
|
1110
|
-
|
|
1094
|
+
const created = _chunk4CZ7W3RScjs.createSessionOwnerKey.call(void 0, );
|
|
1095
|
+
_chunk4CZ7W3RScjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1111
1096
|
return {
|
|
1112
1097
|
account: created.account,
|
|
1113
1098
|
address: created.address
|
|
@@ -1147,8 +1132,9 @@ function WithdrawFlow({
|
|
|
1147
1132
|
const setup = await service.setupAccount({
|
|
1148
1133
|
ownerAddress: ownerAddress2,
|
|
1149
1134
|
sessionOwnerAddress: sessionOwner.address,
|
|
1150
|
-
targetChain:
|
|
1135
|
+
targetChain: _chunk4CZ7W3RScjs.toEvmCaip2.call(void 0, targetChain),
|
|
1151
1136
|
targetToken,
|
|
1137
|
+
recipient,
|
|
1152
1138
|
signerAddress,
|
|
1153
1139
|
sessionChainIds,
|
|
1154
1140
|
forceRegister
|
|
@@ -1174,7 +1160,7 @@ function WithdrawFlow({
|
|
|
1174
1160
|
primaryType: typedData.primaryType,
|
|
1175
1161
|
message: typedData.message
|
|
1176
1162
|
});
|
|
1177
|
-
const sessionDetails =
|
|
1163
|
+
const sessionDetails = _chunk4CZ7W3RScjs.buildSessionDetails.call(void 0,
|
|
1178
1164
|
setup.sessionDetailsUnsigned,
|
|
1179
1165
|
signature
|
|
1180
1166
|
);
|
|
@@ -1188,7 +1174,7 @@ function WithdrawFlow({
|
|
|
1188
1174
|
eoaAddress: ownerAddress2,
|
|
1189
1175
|
sessionOwner: sessionOwner.address,
|
|
1190
1176
|
target: {
|
|
1191
|
-
chain:
|
|
1177
|
+
chain: _chunk4CZ7W3RScjs.toEvmCaip2.call(void 0, targetChain),
|
|
1192
1178
|
token: targetToken,
|
|
1193
1179
|
recipient
|
|
1194
1180
|
}
|
|
@@ -1197,7 +1183,7 @@ function WithdrawFlow({
|
|
|
1197
1183
|
}
|
|
1198
1184
|
handleConnected(ownerAddress2, smartAccount);
|
|
1199
1185
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1200
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _31 => _31.publicClient]), () => (
|
|
1186
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _31 => _31.publicClient]), () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain)));
|
|
1201
1187
|
let result;
|
|
1202
1188
|
if (onSignTransaction) {
|
|
1203
1189
|
const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
|
|
@@ -1220,7 +1206,7 @@ function WithdrawFlow({
|
|
|
1220
1206
|
const { signature } = await onSignTransaction(request);
|
|
1221
1207
|
const relayResult = await service.relayWithdraw({
|
|
1222
1208
|
smartAccount,
|
|
1223
|
-
chainId:
|
|
1209
|
+
chainId: _chunk4CZ7W3RScjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1224
1210
|
safeAddress,
|
|
1225
1211
|
safeTransaction: request.typedData.message,
|
|
1226
1212
|
signature
|
|
@@ -1278,7 +1264,7 @@ function WithdrawFlow({
|
|
|
1278
1264
|
targetChain,
|
|
1279
1265
|
targetToken
|
|
1280
1266
|
});
|
|
1281
|
-
handleError(
|
|
1267
|
+
handleError(_chunk4CZ7W3RScjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1282
1268
|
throw err;
|
|
1283
1269
|
} finally {
|
|
1284
1270
|
setIsSubmitting(false);
|
|
@@ -1406,16 +1392,17 @@ function WithdrawFlow({
|
|
|
1406
1392
|
}
|
|
1407
1393
|
}, [showConnectStep, isConnectSelectionConfirmed, signerContext]);
|
|
1408
1394
|
const ownerAddress = _optionalChain([signerContext, 'optionalAccess', _39 => _39.ownerAddress]);
|
|
1395
|
+
const selectedWalletOption = selectedWalletIdEffective ? _nullishCoalesce(walletOptions.find((option) => option.id === selectedWalletIdEffective), () => ( null)) : null;
|
|
1409
1396
|
const selectedWalletIcon = _react.useMemo.call(void 0, () => {
|
|
1410
|
-
if (!ownerAddress) return
|
|
1397
|
+
if (!ownerAddress) return void 0;
|
|
1411
1398
|
const selected = walletOptions.find(
|
|
1412
|
-
(o) => _optionalChain([o, 'access',
|
|
1399
|
+
(o) => _optionalChain([o, 'access', _40 => _40.address, 'optionalAccess', _41 => _41.toLowerCase, 'call', _42 => _42()]) === ownerAddress.toLowerCase()
|
|
1413
1400
|
);
|
|
1414
|
-
return
|
|
1415
|
-
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess',
|
|
1401
|
+
return _optionalChain([selected, 'optionalAccess', _43 => _43.kind]) === "external" ? _nullishCoalesce(selected.icon, () => ( _optionalChain([reownWallet, 'optionalAccess', _44 => _44.icon]))) : void 0;
|
|
1402
|
+
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _45 => _45.icon])]);
|
|
1416
1403
|
if (showConnectStep) {
|
|
1417
1404
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1418
|
-
|
|
1405
|
+
_chunk4CZ7W3RScjs.ConnectStep,
|
|
1419
1406
|
{
|
|
1420
1407
|
walletOptions,
|
|
1421
1408
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -1435,21 +1422,18 @@ function WithdrawFlow({
|
|
|
1435
1422
|
}
|
|
1436
1423
|
if (!signerContext) return null;
|
|
1437
1424
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1438
|
-
const
|
|
1439
|
-
const
|
|
1440
|
-
const resolvedDefaultRecipient = _nullishCoalesce(defaultRecipient, () => ( resolvedConnectedAddress));
|
|
1441
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunk5SR5N75Icjs.getPublicClient.call(void 0, sourceChain)));
|
|
1425
|
+
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _46 => _46.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1426
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunk4CZ7W3RScjs.getPublicClient.call(void 0, sourceChain)));
|
|
1442
1427
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1443
1428
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1444
1429
|
WithdrawFormStep,
|
|
1445
1430
|
{
|
|
1446
1431
|
walletClient: signerContext.walletClient,
|
|
1447
1432
|
publicClient: formPublicClient,
|
|
1448
|
-
|
|
1449
|
-
connectedAddress: resolvedConnectedAddress,
|
|
1433
|
+
connectedRecipient: resolvedConnectedRecipient,
|
|
1450
1434
|
safeAddress,
|
|
1451
1435
|
asset,
|
|
1452
|
-
defaultRecipient
|
|
1436
|
+
defaultRecipient,
|
|
1453
1437
|
defaultAmount,
|
|
1454
1438
|
targetChain,
|
|
1455
1439
|
targetToken,
|
|
@@ -1465,7 +1449,7 @@ function WithdrawFlow({
|
|
|
1465
1449
|
}
|
|
1466
1450
|
),
|
|
1467
1451
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1468
|
-
|
|
1452
|
+
_chunk4CZ7W3RScjs.ProcessingStep,
|
|
1469
1453
|
{
|
|
1470
1454
|
smartAccount: step.smartAccount,
|
|
1471
1455
|
txHash: step.txHash,
|
|
@@ -1491,7 +1475,7 @@ function WithdrawFlow({
|
|
|
1491
1475
|
// src/WithdrawModal.tsx
|
|
1492
1476
|
|
|
1493
1477
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1494
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1478
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-WJ5SHBV4.cjs"))).then((m) => ({
|
|
1495
1479
|
default: m.WithdrawModalReown
|
|
1496
1480
|
}))
|
|
1497
1481
|
);
|
|
@@ -1544,26 +1528,26 @@ function WithdrawModalInner({
|
|
|
1544
1528
|
debug
|
|
1545
1529
|
}) {
|
|
1546
1530
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1547
|
-
const onReadyRef =
|
|
1531
|
+
const onReadyRef = _chunk4CZ7W3RScjs.useLatestRef.call(void 0, onReady);
|
|
1548
1532
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
1549
1533
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
1550
1534
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
1551
1535
|
const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
|
|
1552
1536
|
const sourceChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp);
|
|
1553
1537
|
const service = _react.useMemo.call(void 0,
|
|
1554
|
-
() =>
|
|
1538
|
+
() => _chunk4CZ7W3RScjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1555
1539
|
[backendUrl, debug]
|
|
1556
1540
|
);
|
|
1557
1541
|
_react.useEffect.call(void 0, () => {
|
|
1558
1542
|
if (isOpen && modalRef.current) {
|
|
1559
|
-
|
|
1543
|
+
_chunk4CZ7W3RScjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1560
1544
|
}
|
|
1561
1545
|
}, [isOpen, theme]);
|
|
1562
1546
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
1563
1547
|
_react.useEffect.call(void 0, () => {
|
|
1564
1548
|
if (isOpen && !hasCalledReady.current) {
|
|
1565
1549
|
hasCalledReady.current = true;
|
|
1566
|
-
_optionalChain([onReadyRef, 'access',
|
|
1550
|
+
_optionalChain([onReadyRef, 'access', _47 => _47.current, 'optionalCall', _48 => _48()]);
|
|
1567
1551
|
}
|
|
1568
1552
|
}, [isOpen, onReadyRef]);
|
|
1569
1553
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1582,17 +1566,17 @@ function WithdrawModalInner({
|
|
|
1582
1566
|
setTotalBalanceUsd(balance2);
|
|
1583
1567
|
}, []);
|
|
1584
1568
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
1585
|
-
_optionalChain([backHandlerRef, 'access',
|
|
1569
|
+
_optionalChain([backHandlerRef, 'access', _49 => _49.current, 'optionalCall', _50 => _50()]);
|
|
1586
1570
|
}, []);
|
|
1587
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1588
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1589
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1590
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
1591
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
1592
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
1571
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _51 => _51.showLogo]), () => ( false));
|
|
1572
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _52 => _52.showStepper]), () => ( false));
|
|
1573
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _53 => _53.showBackButton]), () => ( true));
|
|
1574
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _54 => _54.balance]);
|
|
1575
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _55 => _55.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
1576
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _56 => _56.title]), () => ( "Withdraw"));
|
|
1593
1577
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1594
1578
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1595
|
-
|
|
1579
|
+
_chunk4CZ7W3RScjs.Modal,
|
|
1596
1580
|
{
|
|
1597
1581
|
isOpen,
|
|
1598
1582
|
onClose,
|
|
@@ -1651,7 +1635,7 @@ function WithdrawModalInner({
|
|
|
1651
1635
|
] }),
|
|
1652
1636
|
balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
1653
1637
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balance.title }),
|
|
1654
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
1638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunk4CZ7W3RScjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
1655
1639
|
] })
|
|
1656
1640
|
] }),
|
|
1657
1641
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|