@rhinestone/deposit-modal 0.1.23 → 0.1.24
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/README.md +5 -1
- package/dist/{chunk-J7UK4L5T.mjs → chunk-35DWLO33.mjs} +36 -41
- package/dist/{chunk-W7ZYJB2X.cjs → chunk-A2PDOYYE.cjs} +81 -89
- package/dist/{chunk-BO745KAB.cjs → chunk-ANQQMGNN.cjs} +116 -197
- package/dist/{chunk-V6HZJZOL.cjs → chunk-O3I5KVXA.cjs} +72 -77
- package/dist/{chunk-JBT2ZV3Q.mjs → chunk-P7SQQAAF.mjs} +89 -170
- package/dist/{chunk-N2LJOFT2.mjs → chunk-ZMVCDFXM.mjs} +40 -48
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +197 -0
- package/dist/reown.d.cts +14 -0
- package/dist/reown.d.ts +14 -0
- package/dist/reown.mjs +197 -0
- package/dist/{types-D_xeOU8G.d.cts → types-CUww05xT.d.cts} +14 -1
- package/dist/{types-DnGF9RJJ.d.ts → types-Z6GjVWFR.d.ts} +14 -1
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +33 -11
- package/dist/DepositModalReown-324WTBDE.cjs +0 -33
- package/dist/DepositModalReown-YTWIR7A4.mjs +0 -33
- package/dist/WithdrawModalReown-ICP3DH6Q.mjs +0 -33
- package/dist/WithdrawModalReown-ZNTE2G6W.cjs +0 -33
- package/dist/chunk-6VJ2ZTNQ.cjs +0 -90
- package/dist/chunk-LBEP3A2Z.mjs +0 -90
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function
|
|
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
3
|
|
|
4
4
|
|
|
@@ -16,11 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var _chunkBO745KABcjs = require('./chunk-BO745KAB.cjs');
|
|
19
|
+
var _chunkANQQMGNNcjs = require('./chunk-ANQQMGNN.cjs');
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
|
|
@@ -43,8 +39,6 @@ var _chunkCEIWN53Ncjs = require('./chunk-CEIWN53N.cjs');
|
|
|
43
39
|
|
|
44
40
|
|
|
45
41
|
|
|
46
|
-
|
|
47
|
-
|
|
48
42
|
var _react = require('react');
|
|
49
43
|
|
|
50
44
|
// src/WithdrawFlow.tsx
|
|
@@ -115,7 +109,7 @@ function WithdrawFormStep({
|
|
|
115
109
|
setIsSwitching(true);
|
|
116
110
|
switchChain(asset.chainId).catch((err) => {
|
|
117
111
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
118
|
-
setError(
|
|
112
|
+
setError(_chunkANQQMGNNcjs.formatUserError.call(void 0, raw));
|
|
119
113
|
}).finally(() => {
|
|
120
114
|
setIsSwitching(false);
|
|
121
115
|
});
|
|
@@ -132,7 +126,7 @@ function WithdrawFormStep({
|
|
|
132
126
|
return;
|
|
133
127
|
}
|
|
134
128
|
try {
|
|
135
|
-
const bal =
|
|
129
|
+
const bal = _chunkANQQMGNNcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
136
130
|
address: asset.token,
|
|
137
131
|
abi: _viem.erc20Abi,
|
|
138
132
|
functionName: "balanceOf",
|
|
@@ -234,7 +228,7 @@ function WithdrawFormStep({
|
|
|
234
228
|
await onSubmit(recipient, amount);
|
|
235
229
|
} catch (err) {
|
|
236
230
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
237
|
-
setError(
|
|
231
|
+
setError(_chunkANQQMGNNcjs.formatUserError.call(void 0, raw));
|
|
238
232
|
} finally {
|
|
239
233
|
setIsSubmitting(false);
|
|
240
234
|
}
|
|
@@ -246,7 +240,7 @@ function WithdrawFormStep({
|
|
|
246
240
|
await switchChain(asset.chainId);
|
|
247
241
|
} catch (err) {
|
|
248
242
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
249
|
-
setError(
|
|
243
|
+
setError(_chunkANQQMGNNcjs.formatUserError.call(void 0, raw));
|
|
250
244
|
} finally {
|
|
251
245
|
setIsSwitching(false);
|
|
252
246
|
}
|
|
@@ -336,7 +330,7 @@ function WithdrawFormStep({
|
|
|
336
330
|
] })
|
|
337
331
|
] }),
|
|
338
332
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkANQQMGNNcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
340
334
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
341
335
|
formattedBalance,
|
|
342
336
|
" ",
|
|
@@ -513,7 +507,7 @@ function WithdrawFormStep({
|
|
|
513
507
|
" to continue."
|
|
514
508
|
] }),
|
|
515
509
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
-
|
|
510
|
+
_chunkANQQMGNNcjs.Button,
|
|
517
511
|
{
|
|
518
512
|
variant: "outline",
|
|
519
513
|
size: "small",
|
|
@@ -545,7 +539,7 @@ function WithdrawFormStep({
|
|
|
545
539
|
] })
|
|
546
540
|
] }),
|
|
547
541
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
548
|
-
|
|
542
|
+
_chunkANQQMGNNcjs.Button,
|
|
549
543
|
{
|
|
550
544
|
onClick: handleWithdraw,
|
|
551
545
|
fullWidth: true,
|
|
@@ -554,14 +548,11 @@ function WithdrawFormStep({
|
|
|
554
548
|
children: isBusy ? "Preparing..." : "Withdraw"
|
|
555
549
|
}
|
|
556
550
|
) }),
|
|
557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
551
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANQQMGNNcjs.PoweredBy, {})
|
|
558
552
|
] });
|
|
559
553
|
}
|
|
560
554
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
561
555
|
|
|
562
|
-
// src/WithdrawFlow.tsx
|
|
563
|
-
var _sdk = require('@rhinestone/sdk');
|
|
564
|
-
|
|
565
556
|
// src/core/safe.ts
|
|
566
557
|
|
|
567
558
|
|
|
@@ -862,7 +853,6 @@ function WithdrawFlow({
|
|
|
862
853
|
recipient: defaultRecipient,
|
|
863
854
|
amount: defaultAmount,
|
|
864
855
|
service,
|
|
865
|
-
rhinestoneApiKey,
|
|
866
856
|
signerAddress = _chunkCEIWN53Ncjs.DEFAULT_SIGNER_ADDRESS,
|
|
867
857
|
sessionChainIds,
|
|
868
858
|
forceRegister = false,
|
|
@@ -933,14 +923,14 @@ function WithdrawFlow({
|
|
|
933
923
|
return {
|
|
934
924
|
ownerAddress: dappAddress,
|
|
935
925
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
936
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
926
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkANQQMGNNcjs.getPublicClient.call(void 0, sourceChain))),
|
|
937
927
|
switchChain: dappSwitchChain
|
|
938
928
|
};
|
|
939
929
|
}
|
|
940
930
|
return {
|
|
941
931
|
ownerAddress: dappWalletClient.account.address,
|
|
942
932
|
walletClient: dappWalletClient,
|
|
943
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
933
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkANQQMGNNcjs.getPublicClient.call(void 0, sourceChain))),
|
|
944
934
|
switchChain: dappSwitchChain
|
|
945
935
|
};
|
|
946
936
|
}
|
|
@@ -949,7 +939,7 @@ function WithdrawFlow({
|
|
|
949
939
|
return {
|
|
950
940
|
ownerAddress: dappWalletClient.account.address,
|
|
951
941
|
walletClient: dappWalletClient,
|
|
952
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
942
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkANQQMGNNcjs.getPublicClient.call(void 0, sourceChain))),
|
|
953
943
|
switchChain: dappSwitchChain
|
|
954
944
|
};
|
|
955
945
|
}
|
|
@@ -978,7 +968,7 @@ function WithdrawFlow({
|
|
|
978
968
|
const symbol = _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
979
969
|
const decimals = _chunkCEIWN53Ncjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
980
970
|
return {
|
|
981
|
-
id:
|
|
971
|
+
id: _chunkANQQMGNNcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
982
972
|
chainId: sourceChain,
|
|
983
973
|
token: sourceToken,
|
|
984
974
|
symbol,
|
|
@@ -1008,20 +998,30 @@ function WithdrawFlow({
|
|
|
1008
998
|
[onError]
|
|
1009
999
|
);
|
|
1010
1000
|
const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
|
|
1011
|
-
const localOwner =
|
|
1001
|
+
const localOwner = _chunkANQQMGNNcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1012
1002
|
if (localOwner) {
|
|
1013
1003
|
return {
|
|
1014
|
-
account:
|
|
1004
|
+
account: _chunkANQQMGNNcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1015
1005
|
address: localOwner.address
|
|
1016
1006
|
};
|
|
1017
1007
|
}
|
|
1018
|
-
const created =
|
|
1019
|
-
|
|
1008
|
+
const created = _chunkANQQMGNNcjs.createSessionOwnerKey.call(void 0, );
|
|
1009
|
+
_chunkANQQMGNNcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1020
1010
|
return {
|
|
1021
1011
|
account: created.account,
|
|
1022
1012
|
address: created.address
|
|
1023
1013
|
};
|
|
1024
1014
|
}, []);
|
|
1015
|
+
const signSessionDetails = _react.useCallback.call(void 0,
|
|
1016
|
+
async (sessionOwnerAccount, typedData) => {
|
|
1017
|
+
const signer = sessionOwnerAccount;
|
|
1018
|
+
if (!signer.signTypedData) {
|
|
1019
|
+
throw new Error("Session owner cannot sign typed data");
|
|
1020
|
+
}
|
|
1021
|
+
return await signer.signTypedData(typedData);
|
|
1022
|
+
},
|
|
1023
|
+
[]
|
|
1024
|
+
);
|
|
1025
1025
|
const handleFormSubmit = _react.useCallback.call(void 0,
|
|
1026
1026
|
async (recipient, amountValue) => {
|
|
1027
1027
|
const ownerAddress2 = _optionalChain([signerContext, 'optionalAccess', _22 => _22.ownerAddress]);
|
|
@@ -1036,31 +1036,32 @@ function WithdrawFlow({
|
|
|
1036
1036
|
}
|
|
1037
1037
|
setIsSubmitting(true);
|
|
1038
1038
|
try {
|
|
1039
|
-
const signerAccount = _optionalChain([signerContext, 'optionalAccess', _24 => _24.walletClient]) ? _sdk.walletClientToAccount.call(void 0, signerContext.walletClient) : _chunkBO745KABcjs.createViewOnlyAccount.call(void 0, ownerAddress2);
|
|
1040
1039
|
const sessionOwner = await resolveSessionOwner(ownerAddress2);
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1043
|
-
sessionOwner.
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1040
|
+
const prepared = await service.prepareAccount({
|
|
1041
|
+
ownerAddress: ownerAddress2,
|
|
1042
|
+
sessionOwnerAddress: sessionOwner.address,
|
|
1043
|
+
targetChain,
|
|
1044
|
+
targetToken,
|
|
1045
|
+
signerAddress,
|
|
1046
|
+
sessionChainIds
|
|
1047
|
+
});
|
|
1048
|
+
const smartAccount = prepared.smartAccount;
|
|
1047
1049
|
const checkResult = await service.checkAccount(smartAccount);
|
|
1048
|
-
const targetMatches = checkResult.targetChain === targetChain && _optionalChain([checkResult, 'access',
|
|
1050
|
+
const targetMatches = checkResult.targetChain === targetChain && _optionalChain([checkResult, 'access', _24 => _24.targetToken, 'optionalAccess', _25 => _25.toLowerCase, 'call', _26 => _26()]) === targetToken.toLowerCase();
|
|
1049
1051
|
if (!checkResult.isRegistered || forceRegister || !targetMatches) {
|
|
1050
|
-
const
|
|
1051
|
-
const sessionDetails = await _chunkBO745KABcjs.getSessionDetails.call(void 0,
|
|
1052
|
-
account,
|
|
1053
|
-
targetChainObj,
|
|
1054
|
-
signerAddress,
|
|
1052
|
+
const signature = await signSessionDetails(
|
|
1055
1053
|
sessionOwner.account,
|
|
1056
|
-
|
|
1057
|
-
|
|
1054
|
+
prepared.sessionDetailsUnsigned.data
|
|
1055
|
+
);
|
|
1056
|
+
const sessionDetails = _chunkANQQMGNNcjs.buildSessionDetails.call(void 0,
|
|
1057
|
+
prepared.sessionDetailsUnsigned,
|
|
1058
|
+
signature
|
|
1058
1059
|
);
|
|
1059
1060
|
await service.registerAccount({
|
|
1060
1061
|
address: smartAccount,
|
|
1061
1062
|
accountParams: {
|
|
1062
|
-
factory:
|
|
1063
|
-
factoryData:
|
|
1063
|
+
factory: prepared.accountParams.factory,
|
|
1064
|
+
factoryData: prepared.accountParams.factoryData,
|
|
1064
1065
|
sessionDetails
|
|
1065
1066
|
},
|
|
1066
1067
|
eoaAddress: ownerAddress2,
|
|
@@ -1074,7 +1075,7 @@ function WithdrawFlow({
|
|
|
1074
1075
|
}
|
|
1075
1076
|
handleConnected(ownerAddress2, smartAccount);
|
|
1076
1077
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1077
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
1078
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _27 => _27.publicClient]), () => ( _chunkANQQMGNNcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1078
1079
|
let result;
|
|
1079
1080
|
if (onRelayTransaction) {
|
|
1080
1081
|
const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
|
|
@@ -1115,7 +1116,7 @@ function WithdrawFlow({
|
|
|
1115
1116
|
chainId: sourceChain
|
|
1116
1117
|
});
|
|
1117
1118
|
}
|
|
1118
|
-
_optionalChain([onWithdrawSubmitted, 'optionalCall',
|
|
1119
|
+
_optionalChain([onWithdrawSubmitted, 'optionalCall', _28 => _28({
|
|
1119
1120
|
txHash: result.txHash,
|
|
1120
1121
|
sourceChain,
|
|
1121
1122
|
amount: amountUnits.toString(),
|
|
@@ -1131,7 +1132,7 @@ function WithdrawFlow({
|
|
|
1131
1132
|
});
|
|
1132
1133
|
} catch (err) {
|
|
1133
1134
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
1134
|
-
handleError(
|
|
1135
|
+
handleError(_chunkANQQMGNNcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1135
1136
|
throw err;
|
|
1136
1137
|
} finally {
|
|
1137
1138
|
setIsSubmitting(false);
|
|
@@ -1147,7 +1148,6 @@ function WithdrawFlow({
|
|
|
1147
1148
|
targetChain,
|
|
1148
1149
|
targetToken,
|
|
1149
1150
|
service,
|
|
1150
|
-
rhinestoneApiKey,
|
|
1151
1151
|
handleConnected,
|
|
1152
1152
|
asset.decimals,
|
|
1153
1153
|
safeAddress,
|
|
@@ -1156,18 +1156,19 @@ function WithdrawFlow({
|
|
|
1156
1156
|
onWithdrawSubmitted,
|
|
1157
1157
|
onRelayTransaction,
|
|
1158
1158
|
isSourceNative,
|
|
1159
|
-
handleError
|
|
1159
|
+
handleError,
|
|
1160
|
+
signSessionDetails
|
|
1160
1161
|
]
|
|
1161
1162
|
);
|
|
1162
1163
|
const handleWithdrawComplete = _react.useCallback.call(void 0,
|
|
1163
1164
|
(txHash, destinationTxHash) => {
|
|
1164
|
-
_optionalChain([onWithdrawComplete, 'optionalCall',
|
|
1165
|
+
_optionalChain([onWithdrawComplete, 'optionalCall', _29 => _29({ txHash, destinationTxHash })]);
|
|
1165
1166
|
},
|
|
1166
1167
|
[onWithdrawComplete]
|
|
1167
1168
|
);
|
|
1168
1169
|
const handleWithdrawFailed = _react.useCallback.call(void 0,
|
|
1169
1170
|
(txHash, error) => {
|
|
1170
|
-
_optionalChain([onWithdrawFailed, 'optionalCall',
|
|
1171
|
+
_optionalChain([onWithdrawFailed, 'optionalCall', _30 => _30({ txHash, error })]);
|
|
1171
1172
|
},
|
|
1172
1173
|
[onWithdrawFailed]
|
|
1173
1174
|
);
|
|
@@ -1225,7 +1226,7 @@ function WithdrawFlow({
|
|
|
1225
1226
|
}, [walletOptionsKey, selectedConnectAddressEffective]);
|
|
1226
1227
|
if (showConnectStep) {
|
|
1227
1228
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1228
|
-
|
|
1229
|
+
_chunkANQQMGNNcjs.ConnectStep,
|
|
1229
1230
|
{
|
|
1230
1231
|
walletOptions,
|
|
1231
1232
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1245,7 +1246,7 @@ function WithdrawFlow({
|
|
|
1245
1246
|
if (!signerContext) return null;
|
|
1246
1247
|
if (!onRelayTransaction && !signerContext.walletClient) return null;
|
|
1247
1248
|
const ownerAddress = signerContext.ownerAddress;
|
|
1248
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1249
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkANQQMGNNcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1249
1250
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1250
1251
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1251
1252
|
WithdrawFormStep,
|
|
@@ -1270,7 +1271,7 @@ function WithdrawFlow({
|
|
|
1270
1271
|
}
|
|
1271
1272
|
),
|
|
1272
1273
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1273
|
-
|
|
1274
|
+
_chunkANQQMGNNcjs.ProcessingStep,
|
|
1274
1275
|
{
|
|
1275
1276
|
smartAccount: step.smartAccount,
|
|
1276
1277
|
txHash: step.txHash,
|
|
@@ -1295,15 +1296,11 @@ function WithdrawFlow({
|
|
|
1295
1296
|
|
|
1296
1297
|
// src/WithdrawModal.tsx
|
|
1297
1298
|
|
|
1298
|
-
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1299
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-ZNTE2G6W.cjs"))).then((m) => ({
|
|
1300
|
-
default: m.WithdrawModalReown
|
|
1301
|
-
}))
|
|
1302
|
-
);
|
|
1303
1299
|
function WithdrawModal(props) {
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1300
|
+
if (props.reownAppId) {
|
|
1301
|
+
throw new Error(
|
|
1302
|
+
'Reown support moved to "@rhinestone/deposit-modal/reown". Use that entrypoint when passing reownAppId.'
|
|
1303
|
+
);
|
|
1307
1304
|
}
|
|
1308
1305
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalInner, { ...props });
|
|
1309
1306
|
}
|
|
@@ -1323,7 +1320,6 @@ function WithdrawModalInner({
|
|
|
1323
1320
|
onClose,
|
|
1324
1321
|
inline,
|
|
1325
1322
|
backendUrl = _chunkCEIWN53Ncjs.DEFAULT_BACKEND_URL,
|
|
1326
|
-
rhinestoneApiKey,
|
|
1327
1323
|
signerAddress = _chunkCEIWN53Ncjs.DEFAULT_SIGNER_ADDRESS,
|
|
1328
1324
|
sessionChainIds,
|
|
1329
1325
|
forceRegister = false,
|
|
@@ -1351,17 +1347,17 @@ function WithdrawModalInner({
|
|
|
1351
1347
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
1352
1348
|
const targetChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, targetChainProp);
|
|
1353
1349
|
const sourceChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, sourceChainProp);
|
|
1354
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
1350
|
+
const service = _react.useMemo.call(void 0, () => _chunkANQQMGNNcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
1355
1351
|
_react.useEffect.call(void 0, () => {
|
|
1356
1352
|
if (isOpen && modalRef.current) {
|
|
1357
|
-
|
|
1353
|
+
_chunkANQQMGNNcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1358
1354
|
}
|
|
1359
1355
|
}, [isOpen, theme]);
|
|
1360
1356
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
1361
1357
|
_react.useEffect.call(void 0, () => {
|
|
1362
1358
|
if (isOpen && !hasCalledReady.current) {
|
|
1363
1359
|
hasCalledReady.current = true;
|
|
1364
|
-
_optionalChain([onReady, 'optionalCall',
|
|
1360
|
+
_optionalChain([onReady, 'optionalCall', _31 => _31()]);
|
|
1365
1361
|
}
|
|
1366
1362
|
}, [isOpen, onReady]);
|
|
1367
1363
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1380,17 +1376,17 @@ function WithdrawModalInner({
|
|
|
1380
1376
|
setTotalBalanceUsd(balance);
|
|
1381
1377
|
}, []);
|
|
1382
1378
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
1383
|
-
_optionalChain([backHandlerRef, 'access',
|
|
1379
|
+
_optionalChain([backHandlerRef, 'access', _32 => _32.current, 'optionalCall', _33 => _33()]);
|
|
1384
1380
|
}, []);
|
|
1385
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1386
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1387
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1388
|
-
const balanceTitle = _optionalChain([uiConfig, 'optionalAccess',
|
|
1389
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
1390
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
1381
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _34 => _34.showLogo]), () => ( false));
|
|
1382
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _35 => _35.showStepper]), () => ( false));
|
|
1383
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _36 => _36.showBackButton]), () => ( true));
|
|
1384
|
+
const balanceTitle = _optionalChain([uiConfig, 'optionalAccess', _37 => _37.balanceTitle]);
|
|
1385
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _38 => _38.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
1386
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _39 => _39.title]), () => ( "Withdraw"));
|
|
1391
1387
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1392
1388
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
-
|
|
1389
|
+
_chunkANQQMGNNcjs.Modal,
|
|
1394
1390
|
{
|
|
1395
1391
|
isOpen,
|
|
1396
1392
|
onClose,
|
|
@@ -1448,7 +1444,7 @@ function WithdrawModalInner({
|
|
|
1448
1444
|
] }),
|
|
1449
1445
|
balanceTitle && totalBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
1450
1446
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balanceTitle }),
|
|
1451
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children:
|
|
1447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _chunkANQQMGNNcjs.currencyFormatter.format(totalBalanceUsd) })
|
|
1452
1448
|
] })
|
|
1453
1449
|
] }),
|
|
1454
1450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1492,7 +1488,6 @@ function WithdrawModalInner({
|
|
|
1492
1488
|
recipient,
|
|
1493
1489
|
amount: defaultAmount,
|
|
1494
1490
|
service,
|
|
1495
|
-
rhinestoneApiKey,
|
|
1496
1491
|
signerAddress,
|
|
1497
1492
|
sessionChainIds,
|
|
1498
1493
|
forceRegister,
|