@rhinestone/deposit-modal 0.1.27 → 0.1.28
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-NGYZ4G7Q.cjs → DepositModalReown-6IXFIXR6.cjs} +3 -3
- package/dist/{DepositModalReown-PFKTSKDS.mjs → DepositModalReown-FF4YU5VV.mjs} +2 -2
- package/dist/{WithdrawModalReown-BA6ECON3.cjs → WithdrawModalReown-GMIE6AWA.cjs} +3 -3
- package/dist/{WithdrawModalReown-6AAWH35J.mjs → WithdrawModalReown-LIYQG2BW.mjs} +2 -2
- package/dist/{chunk-XIS33BZ6.cjs → chunk-LP6DQCKV.cjs} +56 -61
- package/dist/{chunk-YOFGP4FV.mjs → chunk-RQSAANC3.mjs} +11 -32
- package/dist/{chunk-QWYZJL3L.cjs → chunk-VW3QQWEL.cjs} +11 -32
- package/dist/{chunk-QCRZCGAE.mjs → chunk-XF7M4TTT.mjs} +20 -25
- package/dist/{chunk-7MQU2SR7.cjs → chunk-XJ4G6RO6.cjs} +110 -117
- package/dist/{chunk-AJALMXW4.mjs → chunk-YXTWMYHK.mjs} +21 -28
- 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 _chunkVW3QQWELcjs = require('./chunk-VW3QQWEL.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -56,15 +56,15 @@ var _react = require('react');
|
|
|
56
56
|
|
|
57
57
|
var _jsxruntime = require('react/jsx-runtime');
|
|
58
58
|
async function resolveSessionOwner(eoaAddress) {
|
|
59
|
-
const localOwner =
|
|
59
|
+
const localOwner = _chunkVW3QQWELcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
60
60
|
if (localOwner) {
|
|
61
61
|
return {
|
|
62
|
-
account:
|
|
62
|
+
account: _chunkVW3QQWELcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
63
63
|
address: localOwner.address
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
const created =
|
|
67
|
-
|
|
66
|
+
const created = _chunkVW3QQWELcjs.createSessionOwnerKey.call(void 0, );
|
|
67
|
+
_chunkVW3QQWELcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
68
68
|
return {
|
|
69
69
|
account: created.account,
|
|
70
70
|
address: created.address
|
|
@@ -96,48 +96,43 @@ function SetupStep({
|
|
|
96
96
|
try {
|
|
97
97
|
setState({ type: "creating-account" });
|
|
98
98
|
const sessionOwner = await resolveSessionOwner(address);
|
|
99
|
-
const
|
|
100
|
-
const smartAccount = computed.smartAccount;
|
|
101
|
-
setState({ type: "checking" });
|
|
102
|
-
const checkResult = await service.checkAccount(smartAccount);
|
|
103
|
-
if (checkResult.isRegistered && !forceRegister) {
|
|
104
|
-
const targetMatches = checkResult.targetChain === targetChain && _optionalChain([checkResult, 'access', _ => _.targetToken, 'optionalAccess', _2 => _2.toLowerCase, 'call', _3 => _3()]) === targetToken.toLowerCase();
|
|
105
|
-
if (targetMatches) {
|
|
106
|
-
setState({ type: "ready", smartAccount });
|
|
107
|
-
_optionalChain([onConnected, 'optionalCall', _4 => _4(address, smartAccount)]);
|
|
108
|
-
onSetupComplete(smartAccount);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
setState({ type: "signing-session" });
|
|
113
|
-
const prepared = await service.prepareAccount({
|
|
99
|
+
const setup = await service.setupAccount({
|
|
114
100
|
ownerAddress: address,
|
|
115
101
|
sessionOwnerAddress: sessionOwner.address,
|
|
116
102
|
targetChain,
|
|
117
103
|
targetToken,
|
|
118
104
|
signerAddress,
|
|
119
|
-
sessionChainIds
|
|
105
|
+
sessionChainIds,
|
|
106
|
+
forceRegister
|
|
120
107
|
});
|
|
108
|
+
const smartAccount = setup.smartAccount;
|
|
109
|
+
if (!setup.needsRegistration) {
|
|
110
|
+
setState({ type: "ready", smartAccount });
|
|
111
|
+
_optionalChain([onConnected, 'optionalCall', _ => _(address, smartAccount)]);
|
|
112
|
+
onSetupComplete(smartAccount);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
setState({ type: "signing-session" });
|
|
116
|
+
if (!setup.accountParams || !setup.sessionDetailsUnsigned) {
|
|
117
|
+
throw new Error("Missing registration payload from setup-account");
|
|
118
|
+
}
|
|
121
119
|
if (!sessionOwner.account.signTypedData) {
|
|
122
120
|
throw new Error("Session owner account does not support signTypedData");
|
|
123
121
|
}
|
|
124
|
-
const typedData =
|
|
122
|
+
const typedData = setup.sessionDetailsUnsigned.data;
|
|
125
123
|
const signature = await sessionOwner.account.signTypedData({
|
|
126
124
|
domain: typedData.domain,
|
|
127
125
|
types: typedData.types,
|
|
128
126
|
primaryType: typedData.primaryType,
|
|
129
127
|
message: typedData.message
|
|
130
128
|
});
|
|
131
|
-
const sessionDetails =
|
|
132
|
-
prepared.sessionDetailsUnsigned,
|
|
133
|
-
signature
|
|
134
|
-
);
|
|
129
|
+
const sessionDetails = _chunkVW3QQWELcjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
135
130
|
setState({ type: "registering" });
|
|
136
131
|
await service.registerAccount({
|
|
137
132
|
address: smartAccount,
|
|
138
133
|
accountParams: {
|
|
139
|
-
factory:
|
|
140
|
-
factoryData:
|
|
134
|
+
factory: setup.accountParams.factory,
|
|
135
|
+
factoryData: setup.accountParams.factoryData,
|
|
141
136
|
sessionDetails
|
|
142
137
|
},
|
|
143
138
|
eoaAddress: address,
|
|
@@ -149,12 +144,12 @@ function SetupStep({
|
|
|
149
144
|
}
|
|
150
145
|
});
|
|
151
146
|
setState({ type: "ready", smartAccount });
|
|
152
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
147
|
+
_optionalChain([onConnected, 'optionalCall', _2 => _2(address, smartAccount)]);
|
|
153
148
|
onSetupComplete(smartAccount);
|
|
154
149
|
} catch (error) {
|
|
155
150
|
const message = error instanceof Error ? error.message : "Setup failed";
|
|
156
151
|
setState({ type: "error", message });
|
|
157
|
-
_optionalChain([onError, 'optionalCall',
|
|
152
|
+
_optionalChain([onError, 'optionalCall', _3 => _3(message, "SETUP_ERROR")]);
|
|
158
153
|
}
|
|
159
154
|
}, [
|
|
160
155
|
address,
|
|
@@ -185,8 +180,6 @@ function SetupStep({
|
|
|
185
180
|
switch (state.type) {
|
|
186
181
|
case "idle":
|
|
187
182
|
return "Preparing...";
|
|
188
|
-
case "checking":
|
|
189
|
-
return "Verifying your account...";
|
|
190
183
|
case "creating-account":
|
|
191
184
|
return "Preparing your deposit account...";
|
|
192
185
|
case "signing-session":
|
|
@@ -199,12 +192,12 @@ function SetupStep({
|
|
|
199
192
|
return state.message;
|
|
200
193
|
}
|
|
201
194
|
};
|
|
202
|
-
const isLoading = state.type === "idle" || state.type === "
|
|
195
|
+
const isLoading = state.type === "idle" || state.type === "creating-account" || state.type === "signing-session" || state.type === "registering";
|
|
203
196
|
const isError = state.type === "error";
|
|
204
197
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
205
198
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
206
199
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
207
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
200
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVW3QQWELcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
208
201
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
209
202
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
210
203
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -241,7 +234,7 @@ function SetupStep({
|
|
|
241
234
|
] })
|
|
242
235
|
] })
|
|
243
236
|
] }),
|
|
244
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
237
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVW3QQWELcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
245
238
|
] });
|
|
246
239
|
}
|
|
247
240
|
|
|
@@ -264,7 +257,7 @@ function AssetSelectStep({
|
|
|
264
257
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
265
258
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
266
259
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
267
|
-
return
|
|
260
|
+
return _chunkVW3QQWELcjs.getAssetId.call(void 0, {
|
|
268
261
|
chainId: defaultSourceChain,
|
|
269
262
|
token: defaultSourceToken
|
|
270
263
|
});
|
|
@@ -281,7 +274,7 @@ function AssetSelectStep({
|
|
|
281
274
|
try {
|
|
282
275
|
const portfolio = await service.fetchPortfolio(address);
|
|
283
276
|
if (!active) return;
|
|
284
|
-
const portfolioAssets =
|
|
277
|
+
const portfolioAssets = _chunkVW3QQWELcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
285
278
|
setAssets(portfolioAssets);
|
|
286
279
|
const hasNative = portfolioAssets.some(
|
|
287
280
|
(asset) => asset.token.toLowerCase() === _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -322,7 +315,7 @@ function AssetSelectStep({
|
|
|
322
315
|
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
323
316
|
0
|
|
324
317
|
);
|
|
325
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
318
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _4 => _4(total)]);
|
|
326
319
|
}, [assets, onTotalBalanceComputed]);
|
|
327
320
|
const rows = _react.useMemo.call(void 0, () => {
|
|
328
321
|
return assets.filter((a) => {
|
|
@@ -349,7 +342,7 @@ function AssetSelectStep({
|
|
|
349
342
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
350
343
|
const numeric = Number(raw);
|
|
351
344
|
if (!Number.isFinite(numeric)) return raw;
|
|
352
|
-
return
|
|
345
|
+
return _chunkVW3QQWELcjs.tokenFormatter.format(numeric);
|
|
353
346
|
} catch (e3) {
|
|
354
347
|
return asset.balance;
|
|
355
348
|
}
|
|
@@ -363,7 +356,7 @@ function AssetSelectStep({
|
|
|
363
356
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
364
357
|
children: [
|
|
365
358
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
366
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
359
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVW3QQWELcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
367
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
368
361
|
] }),
|
|
369
362
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error }) }),
|
|
@@ -453,7 +446,7 @@ function AssetSelectStep({
|
|
|
453
446
|
] })
|
|
454
447
|
] })
|
|
455
448
|
] }),
|
|
456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ?
|
|
449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ? _chunkVW3QQWELcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
457
450
|
]
|
|
458
451
|
},
|
|
459
452
|
asset.id
|
|
@@ -463,7 +456,7 @@ function AssetSelectStep({
|
|
|
463
456
|
}
|
|
464
457
|
),
|
|
465
458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
466
|
-
|
|
459
|
+
_chunkVW3QQWELcjs.Button,
|
|
467
460
|
{
|
|
468
461
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
469
462
|
disabled: !selectedAsset,
|
|
@@ -471,15 +464,15 @@ function AssetSelectStep({
|
|
|
471
464
|
children: "Continue"
|
|
472
465
|
}
|
|
473
466
|
) }),
|
|
474
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
467
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVW3QQWELcjs.PoweredBy, {})
|
|
475
468
|
] });
|
|
476
469
|
}
|
|
477
470
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
478
471
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
479
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
472
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _5 => _5.chain, 'optionalAccess', _6 => _6.id]);
|
|
480
473
|
if (!connectedChainId) return [];
|
|
481
474
|
if (!_chunkCEIWN53Ncjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
482
|
-
const id =
|
|
475
|
+
const id = _chunkVW3QQWELcjs.getAssetId.call(void 0, {
|
|
483
476
|
chainId: connectedChainId,
|
|
484
477
|
token: _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
485
478
|
});
|
|
@@ -538,7 +531,7 @@ function AmountStep({
|
|
|
538
531
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
539
532
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
540
533
|
const chainMismatch = Boolean(
|
|
541
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
534
|
+
_optionalChain([walletClient, 'optionalAccess', _7 => _7.chain, 'optionalAccess', _8 => _8.id]) && walletClient.chain.id !== asset.chainId
|
|
542
535
|
);
|
|
543
536
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
544
537
|
if (tokenPriceUsdOverride !== void 0) return tokenPriceUsdOverride;
|
|
@@ -559,7 +552,7 @@ function AmountStep({
|
|
|
559
552
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
560
553
|
if (!balanceTarget || !publicClient) return;
|
|
561
554
|
try {
|
|
562
|
-
const bal =
|
|
555
|
+
const bal = _chunkVW3QQWELcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
563
556
|
address: asset.token,
|
|
564
557
|
abi: _viem.erc20Abi,
|
|
565
558
|
functionName: "balanceOf",
|
|
@@ -612,7 +605,7 @@ function AmountStep({
|
|
|
612
605
|
}, [balance, tokenPriceUsd, asset.decimals]);
|
|
613
606
|
_react.useEffect.call(void 0, () => {
|
|
614
607
|
if (balanceUsd === null) return;
|
|
615
|
-
_optionalChain([onBalanceUsdChange, 'optionalCall',
|
|
608
|
+
_optionalChain([onBalanceUsdChange, 'optionalCall', _9 => _9(balanceUsd)]);
|
|
616
609
|
}, [balanceUsd, onBalanceUsdChange]);
|
|
617
610
|
const formattedBalance = _react.useMemo.call(void 0, () => {
|
|
618
611
|
if (balance === null) return "...";
|
|
@@ -620,7 +613,7 @@ function AmountStep({
|
|
|
620
613
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
621
614
|
const numeric = Number(raw);
|
|
622
615
|
if (!Number.isFinite(numeric)) return raw;
|
|
623
|
-
return
|
|
616
|
+
return _chunkVW3QQWELcjs.tokenFormatter.format(numeric);
|
|
624
617
|
} catch (e8) {
|
|
625
618
|
return "...";
|
|
626
619
|
}
|
|
@@ -634,7 +627,7 @@ function AmountStep({
|
|
|
634
627
|
}, [amountUsd, tokenPriceUsd]);
|
|
635
628
|
const formattedTokenAmount = _react.useMemo.call(void 0, () => {
|
|
636
629
|
if (tokenAmount === null) return "0.00";
|
|
637
|
-
return
|
|
630
|
+
return _chunkVW3QQWELcjs.tokenFormatter.format(tokenAmount);
|
|
638
631
|
}, [tokenAmount]);
|
|
639
632
|
const targetSymbol = _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
640
633
|
const handlePresetClick = (percentage) => {
|
|
@@ -649,15 +642,15 @@ function AmountStep({
|
|
|
649
642
|
setError("Please enter a valid amount");
|
|
650
643
|
return;
|
|
651
644
|
}
|
|
652
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
645
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _10 => _10.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
653
646
|
setError(
|
|
654
|
-
`Maximum deposit is ${
|
|
647
|
+
`Maximum deposit is ${_chunkVW3QQWELcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
655
648
|
);
|
|
656
649
|
return;
|
|
657
650
|
}
|
|
658
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
651
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _11 => _11.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
659
652
|
setError(
|
|
660
|
-
`Minimum deposit is ${
|
|
653
|
+
`Minimum deposit is ${_chunkVW3QQWELcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
661
654
|
);
|
|
662
655
|
return;
|
|
663
656
|
}
|
|
@@ -727,7 +720,7 @@ function AmountStep({
|
|
|
727
720
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
728
721
|
" ",
|
|
729
722
|
"(",
|
|
730
|
-
|
|
723
|
+
_chunkVW3QQWELcjs.currencyFormatter.format(balanceUsd),
|
|
731
724
|
")"
|
|
732
725
|
] })
|
|
733
726
|
] }) })
|
|
@@ -870,7 +863,7 @@ function AmountStep({
|
|
|
870
863
|
" to continue."
|
|
871
864
|
] }),
|
|
872
865
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
873
|
-
|
|
866
|
+
_chunkVW3QQWELcjs.Button,
|
|
874
867
|
{
|
|
875
868
|
variant: "outline",
|
|
876
869
|
size: "small",
|
|
@@ -903,7 +896,7 @@ function AmountStep({
|
|
|
903
896
|
] })
|
|
904
897
|
] }),
|
|
905
898
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
906
|
-
|
|
899
|
+
_chunkVW3QQWELcjs.Button,
|
|
907
900
|
{
|
|
908
901
|
onClick: handleContinue,
|
|
909
902
|
fullWidth: true,
|
|
@@ -911,7 +904,7 @@ function AmountStep({
|
|
|
911
904
|
children: "Continue"
|
|
912
905
|
}
|
|
913
906
|
) }),
|
|
914
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
907
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVW3QQWELcjs.PoweredBy, {})
|
|
915
908
|
] });
|
|
916
909
|
}
|
|
917
910
|
|
|
@@ -938,7 +931,7 @@ function ConfirmStep({
|
|
|
938
931
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
939
932
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
940
933
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
941
|
-
const chainMismatch = _optionalChain([walletClient, 'optionalAccess',
|
|
934
|
+
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _12 => _12.chain, 'optionalAccess', _13 => _13.id]) && walletClient.chain.id !== asset.chainId;
|
|
942
935
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
943
936
|
const targetSymbol = sameRoute ? asset.symbol : _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
944
937
|
const formattedAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
@@ -1021,7 +1014,7 @@ function ConfirmStep({
|
|
|
1021
1014
|
throw new Error("Wallet not properly connected");
|
|
1022
1015
|
}
|
|
1023
1016
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1024
|
-
const hash =
|
|
1017
|
+
const hash = _chunkVW3QQWELcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1025
1018
|
account,
|
|
1026
1019
|
chain,
|
|
1027
1020
|
to: transferTo,
|
|
@@ -1034,13 +1027,13 @@ function ConfirmStep({
|
|
|
1034
1027
|
functionName: "transfer",
|
|
1035
1028
|
args: [transferTo, amountUnits]
|
|
1036
1029
|
});
|
|
1037
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1030
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _14 => _14(hash, asset.chainId, amountUnits.toString())]);
|
|
1038
1031
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1039
1032
|
} catch (err) {
|
|
1040
1033
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1041
|
-
const message =
|
|
1034
|
+
const message = _chunkVW3QQWELcjs.formatUserError.call(void 0, raw);
|
|
1042
1035
|
setError(message);
|
|
1043
|
-
_optionalChain([onError, 'optionalCall',
|
|
1036
|
+
_optionalChain([onError, 'optionalCall', _15 => _15(message, "TRANSFER_ERROR")]);
|
|
1044
1037
|
} finally {
|
|
1045
1038
|
setIsSubmitting(false);
|
|
1046
1039
|
}
|
|
@@ -1052,7 +1045,7 @@ function ConfirmStep({
|
|
|
1052
1045
|
await switchChain(asset.chainId);
|
|
1053
1046
|
} catch (err) {
|
|
1054
1047
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1055
|
-
setError(
|
|
1048
|
+
setError(_chunkVW3QQWELcjs.formatUserError.call(void 0, raw));
|
|
1056
1049
|
} finally {
|
|
1057
1050
|
setIsSwitching(false);
|
|
1058
1051
|
}
|
|
@@ -1157,7 +1150,7 @@ function ConfirmStep({
|
|
|
1157
1150
|
] }),
|
|
1158
1151
|
receiveAmountUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
1159
1152
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Value" }),
|
|
1160
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children:
|
|
1153
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: _chunkVW3QQWELcjs.currencyFormatter.format(receiveAmountUsd) })
|
|
1161
1154
|
] })
|
|
1162
1155
|
] }),
|
|
1163
1156
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", children: [
|
|
@@ -1167,7 +1160,7 @@ function ConfirmStep({
|
|
|
1167
1160
|
" to sign."
|
|
1168
1161
|
] }),
|
|
1169
1162
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1170
|
-
|
|
1163
|
+
_chunkVW3QQWELcjs.Button,
|
|
1171
1164
|
{
|
|
1172
1165
|
variant: "outline",
|
|
1173
1166
|
size: "small",
|
|
@@ -1200,7 +1193,7 @@ function ConfirmStep({
|
|
|
1200
1193
|
] })
|
|
1201
1194
|
] }),
|
|
1202
1195
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1203
|
-
|
|
1196
|
+
_chunkVW3QQWELcjs.Button,
|
|
1204
1197
|
{
|
|
1205
1198
|
onClick: handleConfirm,
|
|
1206
1199
|
loading: isSubmitting,
|
|
@@ -1209,7 +1202,7 @@ function ConfirmStep({
|
|
|
1209
1202
|
children: "Confirm Order"
|
|
1210
1203
|
}
|
|
1211
1204
|
) }),
|
|
1212
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1205
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVW3QQWELcjs.PoweredBy, {})
|
|
1213
1206
|
] });
|
|
1214
1207
|
}
|
|
1215
1208
|
|
|
@@ -1331,7 +1324,7 @@ function asAddress(value) {
|
|
|
1331
1324
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
1332
1325
|
}
|
|
1333
1326
|
function getDepositEventDetails(event) {
|
|
1334
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1327
|
+
if (!_optionalChain([event, 'optionalAccess', _16 => _16.type]) || !isRecord(event.data)) return {};
|
|
1335
1328
|
if (event.type === "deposit-received") {
|
|
1336
1329
|
return {
|
|
1337
1330
|
chainId: asNumber(event.data.chain),
|
|
@@ -1342,8 +1335,8 @@ function getDepositEventDetails(event) {
|
|
|
1342
1335
|
if (event.type === "bridge-started") {
|
|
1343
1336
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1344
1337
|
return {
|
|
1345
|
-
chainId: asNumber(_optionalChain([source, 'optionalAccess',
|
|
1346
|
-
token: asAddress(_optionalChain([source, 'optionalAccess',
|
|
1338
|
+
chainId: asNumber(_optionalChain([source, 'optionalAccess', _17 => _17.chain])),
|
|
1339
|
+
token: asAddress(_optionalChain([source, 'optionalAccess', _18 => _18.asset]))
|
|
1347
1340
|
};
|
|
1348
1341
|
}
|
|
1349
1342
|
return {};
|
|
@@ -1414,7 +1407,7 @@ function DepositAddressStep({
|
|
|
1414
1407
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1415
1408
|
if (cancelled || depositHandledRef.current) return;
|
|
1416
1409
|
const event = status.lastEvent;
|
|
1417
|
-
const eventTxHash =
|
|
1410
|
+
const eventTxHash = _chunkVW3QQWELcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_optionalChain([_chunkVW3QQWELcjs.getEventTxHash.call(void 0, event), 'optionalAccess', _19 => _19.toLowerCase, 'call', _20 => _20()]), () => ( null)) : null;
|
|
1418
1411
|
if (baselineTxHash === void 0) {
|
|
1419
1412
|
baselineTxHash = eventTxHash;
|
|
1420
1413
|
} else if (eventTxHash && eventTxHash !== baselineTxHash) {
|
|
@@ -1434,7 +1427,7 @@ function DepositAddressStep({
|
|
|
1434
1427
|
if (!cancelled) {
|
|
1435
1428
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1436
1429
|
setPollingError(msg);
|
|
1437
|
-
_optionalChain([onError, 'optionalCall',
|
|
1430
|
+
_optionalChain([onError, 'optionalCall', _21 => _21(msg, "STATUS_POLL_ERROR")]);
|
|
1438
1431
|
}
|
|
1439
1432
|
}
|
|
1440
1433
|
if (!cancelled && !depositHandledRef.current) {
|
|
@@ -1627,7 +1620,7 @@ function DepositAddressStep({
|
|
|
1627
1620
|
] }),
|
|
1628
1621
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1629
1622
|
] }) }),
|
|
1630
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1623
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVW3QQWELcjs.PoweredBy, {})
|
|
1631
1624
|
] });
|
|
1632
1625
|
}
|
|
1633
1626
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1673,15 +1666,15 @@ function DepositFlow({
|
|
|
1673
1666
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
|
|
1674
1667
|
const [selectedConnectAddress, setSelectedConnectAddress] = _react.useState.call(void 0, null);
|
|
1675
1668
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
1676
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1669
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _22 => _22.switchChain])) return void 0;
|
|
1677
1670
|
return async (chainId) => {
|
|
1678
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
1671
|
+
await _optionalChain([dappWalletClient, 'access', _23 => _23.switchChain, 'optionalCall', _24 => _24({ id: chainId })]);
|
|
1679
1672
|
};
|
|
1680
1673
|
}, [dappWalletClient]);
|
|
1681
1674
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
1682
1675
|
const options = [];
|
|
1683
1676
|
const seen = /* @__PURE__ */ new Set();
|
|
1684
|
-
if (_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1677
|
+
if (_optionalChain([dappWalletClient, 'optionalAccess', _25 => _25.account]) && dappAddress) {
|
|
1685
1678
|
options.push({
|
|
1686
1679
|
address: dappWalletClient.account.address,
|
|
1687
1680
|
label: "Connected Wallet",
|
|
@@ -1689,7 +1682,7 @@ function DepositFlow({
|
|
|
1689
1682
|
});
|
|
1690
1683
|
seen.add(dappWalletClient.account.address.toLowerCase());
|
|
1691
1684
|
}
|
|
1692
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
1685
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _26 => _26.address]) && reownWallet.isConnected && !seen.has(reownWallet.address.toLowerCase())) {
|
|
1693
1686
|
options.push({
|
|
1694
1687
|
address: reownWallet.address,
|
|
1695
1688
|
label: "External Wallet",
|
|
@@ -1700,10 +1693,10 @@ function DepositFlow({
|
|
|
1700
1693
|
}, [
|
|
1701
1694
|
dappWalletClient,
|
|
1702
1695
|
dappAddress,
|
|
1703
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
1704
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
1696
|
+
_optionalChain([reownWallet, 'optionalAccess', _27 => _27.address]),
|
|
1697
|
+
_optionalChain([reownWallet, 'optionalAccess', _28 => _28.isConnected])
|
|
1705
1698
|
]);
|
|
1706
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
1699
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _29 => _29.account]) && dappAddress && !reownWallet;
|
|
1707
1700
|
const hasWalletOptions = walletOptions.length > 0;
|
|
1708
1701
|
const showConnectStep = !canAutoLock && !isConnectSelectionConfirmed;
|
|
1709
1702
|
const signerContext = _react.useMemo.call(void 0, () => {
|
|
@@ -1712,30 +1705,30 @@ function DepositFlow({
|
|
|
1712
1705
|
return {
|
|
1713
1706
|
ownerAddress: dappAddress,
|
|
1714
1707
|
walletClient: void 0,
|
|
1715
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1708
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVW3QQWELcjs.getPublicClient.call(void 0, targetChain))),
|
|
1716
1709
|
switchChain: void 0
|
|
1717
1710
|
};
|
|
1718
1711
|
}
|
|
1719
1712
|
if (canAutoLock) {
|
|
1720
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1713
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _30 => _30.chain, 'optionalAccess', _31 => _31.id]), () => ( targetChain));
|
|
1721
1714
|
return {
|
|
1722
1715
|
ownerAddress: dappWalletClient.account.address,
|
|
1723
1716
|
walletClient: dappWalletClient,
|
|
1724
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1717
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVW3QQWELcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1725
1718
|
switchChain: dappSwitchChain
|
|
1726
1719
|
};
|
|
1727
1720
|
}
|
|
1728
1721
|
if (!isConnectSelectionConfirmed || !selectedConnectAddress) return null;
|
|
1729
|
-
if (_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1730
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1722
|
+
if (_optionalChain([dappWalletClient, 'optionalAccess', _32 => _32.account]) && dappWalletClient.account.address.toLowerCase() === selectedConnectAddress.toLowerCase()) {
|
|
1723
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _33 => _33.chain, 'optionalAccess', _34 => _34.id]), () => ( targetChain));
|
|
1731
1724
|
return {
|
|
1732
1725
|
ownerAddress: dappWalletClient.account.address,
|
|
1733
1726
|
walletClient: dappWalletClient,
|
|
1734
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1727
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVW3QQWELcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1735
1728
|
switchChain: dappSwitchChain
|
|
1736
1729
|
};
|
|
1737
1730
|
}
|
|
1738
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
1731
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _35 => _35.address, 'optionalAccess', _36 => _36.toLowerCase, 'call', _37 => _37()]) === selectedConnectAddress.toLowerCase() && reownWallet.walletClient && reownWallet.publicClient) {
|
|
1739
1732
|
return {
|
|
1740
1733
|
ownerAddress: reownWallet.address,
|
|
1741
1734
|
walletClient: reownWallet.walletClient,
|
|
@@ -1756,7 +1749,7 @@ function DepositFlow({
|
|
|
1756
1749
|
reownWallet,
|
|
1757
1750
|
targetChain
|
|
1758
1751
|
]);
|
|
1759
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
1752
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _38 => _38.ownerAddress]))), () => ( null));
|
|
1760
1753
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
1761
1754
|
_react.useEffect.call(void 0, () => {
|
|
1762
1755
|
const prev = lastTargetRef.current;
|
|
@@ -1799,10 +1792,10 @@ function DepositFlow({
|
|
|
1799
1792
|
const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : 4;
|
|
1800
1793
|
const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && signerContext && !canAutoLock ? handleBackFromSelectAsset : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
|
|
1801
1794
|
_react.useEffect.call(void 0, () => {
|
|
1802
|
-
_optionalChain([onStepChange, 'optionalCall',
|
|
1795
|
+
_optionalChain([onStepChange, 'optionalCall', _39 => _39(stepIndex, currentBackHandler)]);
|
|
1803
1796
|
}, [stepIndex, currentBackHandler, onStepChange]);
|
|
1804
1797
|
_react.useEffect.call(void 0, () => {
|
|
1805
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
1798
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _40 => _40(totalBalanceUsd)]);
|
|
1806
1799
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
1807
1800
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
1808
1801
|
const handleSelectProvider = _react.useCallback.call(void 0, () => {
|
|
@@ -1840,13 +1833,13 @@ function DepositFlow({
|
|
|
1840
1833
|
directTransfer: isSameRoute(chainId, token, targetChain, targetToken)
|
|
1841
1834
|
};
|
|
1842
1835
|
});
|
|
1843
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1836
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _41 => _41({ txHash, sourceChain: chainId, amount })]);
|
|
1844
1837
|
},
|
|
1845
1838
|
[onDepositSubmitted, targetChain, targetToken]
|
|
1846
1839
|
);
|
|
1847
1840
|
const handleConnected = _react.useCallback.call(void 0,
|
|
1848
1841
|
(addr, smartAccount) => {
|
|
1849
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
1842
|
+
_optionalChain([onConnected, 'optionalCall', _42 => _42({ address: addr, smartAccount })]);
|
|
1850
1843
|
},
|
|
1851
1844
|
[onConnected]
|
|
1852
1845
|
);
|
|
@@ -1898,25 +1891,25 @@ function DepositFlow({
|
|
|
1898
1891
|
);
|
|
1899
1892
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
1900
1893
|
(txHash, sourceChain, amount) => {
|
|
1901
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1894
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _43 => _43({ txHash, sourceChain, amount })]);
|
|
1902
1895
|
},
|
|
1903
1896
|
[onDepositSubmitted]
|
|
1904
1897
|
);
|
|
1905
1898
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
1906
1899
|
(txHash, destinationTxHash) => {
|
|
1907
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1900
|
+
_optionalChain([onDepositComplete, 'optionalCall', _44 => _44({ txHash, destinationTxHash })]);
|
|
1908
1901
|
},
|
|
1909
1902
|
[onDepositComplete]
|
|
1910
1903
|
);
|
|
1911
1904
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
1912
1905
|
(txHash, error) => {
|
|
1913
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1906
|
+
_optionalChain([onDepositFailed, 'optionalCall', _45 => _45({ txHash, error })]);
|
|
1914
1907
|
},
|
|
1915
1908
|
[onDepositFailed]
|
|
1916
1909
|
);
|
|
1917
1910
|
const handleError = _react.useCallback.call(void 0,
|
|
1918
1911
|
(message, code) => {
|
|
1919
|
-
_optionalChain([onError, 'optionalCall',
|
|
1912
|
+
_optionalChain([onError, 'optionalCall', _46 => _46({ message, code })]);
|
|
1920
1913
|
},
|
|
1921
1914
|
[onError]
|
|
1922
1915
|
);
|
|
@@ -1939,7 +1932,7 @@ function DepositFlow({
|
|
|
1939
1932
|
}, [walletOptionsKey, selectedConnectAddressEffective]);
|
|
1940
1933
|
if (showConnectStep) {
|
|
1941
1934
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1942
|
-
|
|
1935
|
+
_chunkVW3QQWELcjs.ConnectStep,
|
|
1943
1936
|
{
|
|
1944
1937
|
walletOptions,
|
|
1945
1938
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1990,7 +1983,7 @@ function DepositFlow({
|
|
|
1990
1983
|
}
|
|
1991
1984
|
),
|
|
1992
1985
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1993
|
-
|
|
1986
|
+
_chunkVW3QQWELcjs.ProcessingStep,
|
|
1994
1987
|
{
|
|
1995
1988
|
smartAccount: step.smartAccount,
|
|
1996
1989
|
txHash: step.txHash,
|
|
@@ -2012,16 +2005,16 @@ function DepositFlow({
|
|
|
2012
2005
|
)
|
|
2013
2006
|
] });
|
|
2014
2007
|
}
|
|
2015
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
2008
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _47 => _47.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _48 => _48.publicClient])) {
|
|
2016
2009
|
return null;
|
|
2017
2010
|
}
|
|
2018
2011
|
const ownerAddress = signerContext.ownerAddress;
|
|
2019
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
2012
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _49 => _49.walletClient, 'optionalAccess', _50 => _50.chain, 'optionalAccess', _51 => _51.id]), () => ( _optionalChain([signerContext, 'access', _52 => _52.publicClient, 'access', _53 => _53.chain, 'optionalAccess', _54 => _54.id]))), () => ( targetChain));
|
|
2020
2013
|
const getReadClientForChain = (chainId) => {
|
|
2021
|
-
if (_optionalChain([signerContext, 'access',
|
|
2014
|
+
if (_optionalChain([signerContext, 'access', _55 => _55.publicClient, 'access', _56 => _56.chain, 'optionalAccess', _57 => _57.id]) === chainId) {
|
|
2022
2015
|
return signerContext.publicClient;
|
|
2023
2016
|
}
|
|
2024
|
-
return
|
|
2017
|
+
return _chunkVW3QQWELcjs.getPublicClient.call(void 0, chainId);
|
|
2025
2018
|
};
|
|
2026
2019
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
2027
2020
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2087,7 +2080,7 @@ function DepositFlow({
|
|
|
2087
2080
|
}
|
|
2088
2081
|
),
|
|
2089
2082
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2090
|
-
|
|
2083
|
+
_chunkVW3QQWELcjs.ProcessingStep,
|
|
2091
2084
|
{
|
|
2092
2085
|
smartAccount: step.smartAccount,
|
|
2093
2086
|
txHash: step.txHash,
|
|
@@ -2112,7 +2105,7 @@ function DepositFlow({
|
|
|
2112
2105
|
// src/DepositModal.tsx
|
|
2113
2106
|
|
|
2114
2107
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
2115
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
2108
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-6IXFIXR6.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2116
2109
|
);
|
|
2117
2110
|
function DepositModal(props) {
|
|
2118
2111
|
const needsReown = !!props.reownAppId;
|
|
@@ -2162,17 +2155,17 @@ function DepositModalInner({
|
|
|
2162
2155
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
2163
2156
|
const targetChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, targetChainProp);
|
|
2164
2157
|
const sourceChain = sourceChainProp ? _chunkCEIWN53Ncjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
2165
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
2158
|
+
const service = _react.useMemo.call(void 0, () => _chunkVW3QQWELcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
2166
2159
|
_react.useEffect.call(void 0, () => {
|
|
2167
2160
|
if (isOpen && modalRef.current) {
|
|
2168
|
-
|
|
2161
|
+
_chunkVW3QQWELcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
2169
2162
|
}
|
|
2170
2163
|
}, [isOpen, theme]);
|
|
2171
2164
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
2172
2165
|
_react.useEffect.call(void 0, () => {
|
|
2173
2166
|
if (isOpen && !hasCalledReady.current) {
|
|
2174
2167
|
hasCalledReady.current = true;
|
|
2175
|
-
_optionalChain([onReady, 'optionalCall',
|
|
2168
|
+
_optionalChain([onReady, 'optionalCall', _58 => _58()]);
|
|
2176
2169
|
}
|
|
2177
2170
|
}, [isOpen, onReady]);
|
|
2178
2171
|
_react.useEffect.call(void 0, () => {
|
|
@@ -2191,17 +2184,17 @@ function DepositModalInner({
|
|
|
2191
2184
|
setTotalBalanceUsd(balance);
|
|
2192
2185
|
}, []);
|
|
2193
2186
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
2194
|
-
_optionalChain([backHandlerRef, 'access',
|
|
2187
|
+
_optionalChain([backHandlerRef, 'access', _59 => _59.current, 'optionalCall', _60 => _60()]);
|
|
2195
2188
|
}, []);
|
|
2196
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2197
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2198
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2199
|
-
const balanceTitle = _optionalChain([uiConfig, 'optionalAccess',
|
|
2200
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
2201
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
2189
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _61 => _61.showLogo]), () => ( false));
|
|
2190
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _62 => _62.showStepper]), () => ( false));
|
|
2191
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _63 => _63.showBackButton]), () => ( true));
|
|
2192
|
+
const balanceTitle = _optionalChain([uiConfig, 'optionalAccess', _64 => _64.balanceTitle]);
|
|
2193
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _65 => _65.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
2194
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _66 => _66.title]), () => ( "Deposit"));
|
|
2202
2195
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
2203
2196
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2204
|
-
|
|
2197
|
+
_chunkVW3QQWELcjs.Modal,
|
|
2205
2198
|
{
|
|
2206
2199
|
isOpen,
|
|
2207
2200
|
onClose,
|
|
@@ -2262,7 +2255,7 @@ function DepositModalInner({
|
|
|
2262
2255
|
balanceTitle,
|
|
2263
2256
|
":"
|
|
2264
2257
|
] }),
|
|
2265
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children:
|
|
2258
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _chunkVW3QQWELcjs.currencyFormatter.format(totalBalanceUsd) })
|
|
2266
2259
|
] })
|
|
2267
2260
|
] }),
|
|
2268
2261
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|