@rhinestone/deposit-modal 0.1.27 → 0.1.29
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-4PFOMSC6.cjs} +4 -4
- package/dist/{DepositModalReown-PFKTSKDS.mjs → DepositModalReown-BVHWFWIG.mjs} +3 -3
- package/dist/{WithdrawModalReown-6AAWH35J.mjs → WithdrawModalReown-CJCNT7SA.mjs} +3 -3
- package/dist/{WithdrawModalReown-BA6ECON3.cjs → WithdrawModalReown-YREQR7DV.cjs} +4 -4
- package/dist/{chunk-7MQU2SR7.cjs → chunk-5QJNOPNF.cjs} +164 -171
- package/dist/{chunk-QWYZJL3L.cjs → chunk-7ZCUANBT.cjs} +40 -61
- package/dist/{chunk-XIS33BZ6.cjs → chunk-CPIQJR47.cjs} +82 -87
- package/dist/{chunk-A6QLADED.mjs → chunk-CSQRKM4Y.mjs} +123 -2
- package/dist/{chunk-CEIWN53N.cjs → chunk-DLYVHOME.cjs} +130 -9
- package/dist/{chunk-QCRZCGAE.mjs → chunk-K6YG3I6O.mjs} +21 -26
- package/dist/{chunk-YOFGP4FV.mjs → chunk-N6T4TKXI.mjs} +12 -33
- package/dist/{chunk-AJALMXW4.mjs → chunk-XTTTHW3W.mjs} +22 -29
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +11 -2
- package/dist/constants.d.ts +11 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.mjs +4 -4
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +56 -9
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunk7ZCUANBTcjs = require('./chunk-7ZCUANBT.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@ var _chunkQWYZJL3Lcjs = require('./chunk-QWYZJL3L.cjs');
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var _chunkDLYVHOMEcjs = require('./chunk-DLYVHOME.cjs');
|
|
40
40
|
|
|
41
41
|
// src/DepositModal.tsx
|
|
42
42
|
|
|
@@ -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 = _chunk7ZCUANBTcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
60
60
|
if (localOwner) {
|
|
61
61
|
return {
|
|
62
|
-
account:
|
|
62
|
+
account: _chunk7ZCUANBTcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
63
63
|
address: localOwner.address
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
const created =
|
|
67
|
-
|
|
66
|
+
const created = _chunk7ZCUANBTcjs.createSessionOwnerKey.call(void 0, );
|
|
67
|
+
_chunk7ZCUANBTcjs.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 = _chunk7ZCUANBTcjs.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, _chunk7ZCUANBTcjs.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, _chunk7ZCUANBTcjs.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 _chunk7ZCUANBTcjs.getAssetId.call(void 0, {
|
|
268
261
|
chainId: defaultSourceChain,
|
|
269
262
|
token: defaultSourceToken
|
|
270
263
|
});
|
|
@@ -281,10 +274,10 @@ function AssetSelectStep({
|
|
|
281
274
|
try {
|
|
282
275
|
const portfolio = await service.fetchPortfolio(address);
|
|
283
276
|
if (!active) return;
|
|
284
|
-
const portfolioAssets =
|
|
277
|
+
const portfolioAssets = _chunk7ZCUANBTcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
285
278
|
setAssets(portfolioAssets);
|
|
286
279
|
const hasNative = portfolioAssets.some(
|
|
287
|
-
(asset) => asset.token.toLowerCase() ===
|
|
280
|
+
(asset) => asset.token.toLowerCase() === _chunkDLYVHOMEcjs.NATIVE_TOKEN_ADDRESS
|
|
288
281
|
);
|
|
289
282
|
if (!hasNative) {
|
|
290
283
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -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 _chunk7ZCUANBTcjs.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, _chunk7ZCUANBTcjs.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 }) }),
|
|
@@ -396,9 +389,9 @@ function AssetSelectStep({
|
|
|
396
389
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
397
390
|
const isSelected = selectedAssetId === asset.id;
|
|
398
391
|
const tokenAmount = formatBalance(asset);
|
|
399
|
-
const badge =
|
|
400
|
-
const tokenIcon =
|
|
401
|
-
const chainIcon =
|
|
392
|
+
const badge = _chunkDLYVHOMEcjs.getChainBadge.call(void 0, asset.chainId);
|
|
393
|
+
const tokenIcon = _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
394
|
+
const chainIcon = _chunkDLYVHOMEcjs.getChainIcon.call(void 0, asset.chainId);
|
|
402
395
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
403
396
|
"button",
|
|
404
397
|
{
|
|
@@ -422,7 +415,7 @@ function AssetSelectStep({
|
|
|
422
415
|
"img",
|
|
423
416
|
{
|
|
424
417
|
src: chainIcon,
|
|
425
|
-
alt:
|
|
418
|
+
alt: _chunkDLYVHOMEcjs.getChainName.call(void 0, asset.chainId),
|
|
426
419
|
className: "rs-asset-chain-badge"
|
|
427
420
|
}
|
|
428
421
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -443,7 +436,7 @@ function AssetSelectStep({
|
|
|
443
436
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
444
437
|
" ",
|
|
445
438
|
"on ",
|
|
446
|
-
|
|
439
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, asset.chainId)
|
|
447
440
|
] })
|
|
448
441
|
] }),
|
|
449
442
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -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 ? _chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.Button,
|
|
467
460
|
{
|
|
468
461
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
469
462
|
disabled: !selectedAsset,
|
|
@@ -471,17 +464,17 @@ function AssetSelectStep({
|
|
|
471
464
|
children: "Continue"
|
|
472
465
|
}
|
|
473
466
|
) }),
|
|
474
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
467
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7ZCUANBTcjs.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
|
-
if (!
|
|
482
|
-
const id =
|
|
474
|
+
if (!_chunkDLYVHOMEcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
475
|
+
const id = _chunk7ZCUANBTcjs.getAssetId.call(void 0, {
|
|
483
476
|
chainId: connectedChainId,
|
|
484
|
-
token:
|
|
477
|
+
token: _chunkDLYVHOMEcjs.NATIVE_TOKEN_ADDRESS
|
|
485
478
|
});
|
|
486
479
|
if (existingIds.has(id)) return [];
|
|
487
480
|
try {
|
|
@@ -490,7 +483,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
490
483
|
{
|
|
491
484
|
id,
|
|
492
485
|
chainId: connectedChainId,
|
|
493
|
-
token:
|
|
486
|
+
token: _chunkDLYVHOMEcjs.NATIVE_TOKEN_ADDRESS,
|
|
494
487
|
symbol: "ETH",
|
|
495
488
|
name: "Ethereum",
|
|
496
489
|
decimals: 18,
|
|
@@ -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 = _chunk7ZCUANBTcjs.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 _chunk7ZCUANBTcjs.tokenFormatter.format(numeric);
|
|
624
617
|
} catch (e8) {
|
|
625
618
|
return "...";
|
|
626
619
|
}
|
|
@@ -634,9 +627,9 @@ 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 _chunk7ZCUANBTcjs.tokenFormatter.format(tokenAmount);
|
|
638
631
|
}, [tokenAmount]);
|
|
639
|
-
const targetSymbol =
|
|
632
|
+
const targetSymbol = _chunkDLYVHOMEcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
640
633
|
const handlePresetClick = (percentage) => {
|
|
641
634
|
if (balanceUsd === null) return;
|
|
642
635
|
const value = balanceUsd * percentage / 100;
|
|
@@ -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 ${_chunk7ZCUANBTcjs.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 ${_chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.currencyFormatter.format(balanceUsd),
|
|
731
724
|
")"
|
|
732
725
|
] })
|
|
733
726
|
] }) })
|
|
@@ -741,26 +734,26 @@ function AmountStep({
|
|
|
741
734
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You send" }),
|
|
742
735
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
743
736
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
744
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, asset.symbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
745
738
|
"img",
|
|
746
739
|
{
|
|
747
|
-
src:
|
|
740
|
+
src: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
748
741
|
alt: asset.symbol
|
|
749
742
|
}
|
|
750
743
|
) : asset.symbol.slice(0, 2) }),
|
|
751
744
|
(() => {
|
|
752
|
-
const chainIcon =
|
|
745
|
+
const chainIcon = _chunkDLYVHOMEcjs.getChainIcon.call(void 0, asset.chainId);
|
|
753
746
|
if (chainIcon) {
|
|
754
747
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
755
748
|
"img",
|
|
756
749
|
{
|
|
757
750
|
src: chainIcon,
|
|
758
|
-
alt:
|
|
751
|
+
alt: _chunkDLYVHOMEcjs.getChainName.call(void 0, asset.chainId),
|
|
759
752
|
className: "rs-flow-pill-chain-badge"
|
|
760
753
|
}
|
|
761
754
|
);
|
|
762
755
|
}
|
|
763
|
-
const badge =
|
|
756
|
+
const badge = _chunkDLYVHOMEcjs.getChainBadge.call(void 0, asset.chainId);
|
|
764
757
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
765
758
|
"div",
|
|
766
759
|
{
|
|
@@ -798,26 +791,26 @@ function AmountStep({
|
|
|
798
791
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You receive" }),
|
|
799
792
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
800
793
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
801
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
794
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, targetSymbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
802
795
|
"img",
|
|
803
796
|
{
|
|
804
|
-
src:
|
|
797
|
+
src: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
805
798
|
alt: targetSymbol
|
|
806
799
|
}
|
|
807
800
|
) : targetSymbol.slice(0, 2) }),
|
|
808
801
|
(() => {
|
|
809
|
-
const chainIcon =
|
|
802
|
+
const chainIcon = _chunkDLYVHOMEcjs.getChainIcon.call(void 0, targetChain);
|
|
810
803
|
if (chainIcon) {
|
|
811
804
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
812
805
|
"img",
|
|
813
806
|
{
|
|
814
807
|
src: chainIcon,
|
|
815
|
-
alt:
|
|
808
|
+
alt: _chunkDLYVHOMEcjs.getChainName.call(void 0, targetChain),
|
|
816
809
|
className: "rs-flow-pill-chain-badge"
|
|
817
810
|
}
|
|
818
811
|
);
|
|
819
812
|
}
|
|
820
|
-
const badge =
|
|
813
|
+
const badge = _chunkDLYVHOMEcjs.getChainBadge.call(void 0, targetChain);
|
|
821
814
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
822
815
|
"div",
|
|
823
816
|
{
|
|
@@ -866,11 +859,11 @@ function AmountStep({
|
|
|
866
859
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", style: { marginTop: 16 }, children: [
|
|
867
860
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch-text", children: [
|
|
868
861
|
"Switch your wallet to ",
|
|
869
|
-
|
|
862
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, asset.chainId),
|
|
870
863
|
" to continue."
|
|
871
864
|
] }),
|
|
872
865
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
873
|
-
|
|
866
|
+
_chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.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, _chunk7ZCUANBTcjs.PoweredBy, {})
|
|
915
908
|
] });
|
|
916
909
|
}
|
|
917
910
|
|
|
@@ -938,9 +931,9 @@ 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
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
936
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkDLYVHOMEcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
944
937
|
const formattedAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
945
938
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
946
939
|
if (asset.balanceUsd === void 0 || !asset.balance) return null;
|
|
@@ -993,7 +986,7 @@ function ConfirmStep({
|
|
|
993
986
|
return;
|
|
994
987
|
}
|
|
995
988
|
if (chainMismatch) {
|
|
996
|
-
setError(`Switch to ${
|
|
989
|
+
setError(`Switch to ${_chunkDLYVHOMEcjs.getChainName.call(void 0, asset.chainId)} to sign`);
|
|
997
990
|
return;
|
|
998
991
|
}
|
|
999
992
|
const parsedAmount = parseFloat(amount);
|
|
@@ -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 = _chunk7ZCUANBTcjs.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 = _chunk7ZCUANBTcjs.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(_chunk7ZCUANBTcjs.formatUserError.call(void 0, raw));
|
|
1056
1049
|
} finally {
|
|
1057
1050
|
setIsSwitching(false);
|
|
1058
1051
|
}
|
|
@@ -1069,15 +1062,15 @@ function ConfirmStep({
|
|
|
1069
1062
|
className: "rs-card-value",
|
|
1070
1063
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1071
1064
|
children: [
|
|
1072
|
-
|
|
1065
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, asset.chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1073
1066
|
"img",
|
|
1074
1067
|
{
|
|
1075
|
-
src:
|
|
1068
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, asset.chainId),
|
|
1076
1069
|
alt: "",
|
|
1077
1070
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1078
1071
|
}
|
|
1079
1072
|
),
|
|
1080
|
-
|
|
1073
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, asset.chainId)
|
|
1081
1074
|
]
|
|
1082
1075
|
}
|
|
1083
1076
|
)
|
|
@@ -1090,15 +1083,15 @@ function ConfirmStep({
|
|
|
1090
1083
|
className: "rs-card-value",
|
|
1091
1084
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1092
1085
|
children: [
|
|
1093
|
-
|
|
1086
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1094
1087
|
"img",
|
|
1095
1088
|
{
|
|
1096
|
-
src:
|
|
1089
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, targetChain),
|
|
1097
1090
|
alt: "",
|
|
1098
1091
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1099
1092
|
}
|
|
1100
1093
|
),
|
|
1101
|
-
|
|
1094
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, targetChain)
|
|
1102
1095
|
]
|
|
1103
1096
|
}
|
|
1104
1097
|
)
|
|
@@ -1117,10 +1110,10 @@ function ConfirmStep({
|
|
|
1117
1110
|
className: "rs-card-value",
|
|
1118
1111
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1119
1112
|
children: [
|
|
1120
|
-
|
|
1113
|
+
_chunkDLYVHOMEcjs.getTokenIcon.call(void 0, asset.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1121
1114
|
"img",
|
|
1122
1115
|
{
|
|
1123
|
-
src:
|
|
1116
|
+
src: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
1124
1117
|
alt: "",
|
|
1125
1118
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1126
1119
|
}
|
|
@@ -1140,10 +1133,10 @@ function ConfirmStep({
|
|
|
1140
1133
|
className: "rs-card-value",
|
|
1141
1134
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1142
1135
|
children: [
|
|
1143
|
-
|
|
1136
|
+
_chunkDLYVHOMEcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1144
1137
|
"img",
|
|
1145
1138
|
{
|
|
1146
|
-
src:
|
|
1139
|
+
src: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
1147
1140
|
alt: "",
|
|
1148
1141
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1149
1142
|
}
|
|
@@ -1157,17 +1150,17 @@ 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: _chunk7ZCUANBTcjs.currencyFormatter.format(receiveAmountUsd) })
|
|
1161
1154
|
] })
|
|
1162
1155
|
] }),
|
|
1163
1156
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", children: [
|
|
1164
1157
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch-text", children: [
|
|
1165
1158
|
"Switch your wallet to ",
|
|
1166
|
-
|
|
1159
|
+
_chunkDLYVHOMEcjs.getChainName.call(void 0, asset.chainId),
|
|
1167
1160
|
" to sign."
|
|
1168
1161
|
] }),
|
|
1169
1162
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1170
|
-
|
|
1163
|
+
_chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.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, _chunk7ZCUANBTcjs.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 {};
|
|
@@ -1354,12 +1347,12 @@ function DepositAddressStep({
|
|
|
1354
1347
|
onDepositDetected,
|
|
1355
1348
|
onError
|
|
1356
1349
|
}) {
|
|
1357
|
-
const supportedChainIds = _react.useMemo.call(void 0, () =>
|
|
1350
|
+
const supportedChainIds = _react.useMemo.call(void 0, () => _chunkDLYVHOMEcjs.getSupportedChainIds.call(void 0, ), []);
|
|
1358
1351
|
const BASE_CHAIN_ID = 8453;
|
|
1359
1352
|
const defaultChainId = supportedChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : supportedChainIds[0];
|
|
1360
1353
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1361
1354
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
1362
|
-
() =>
|
|
1355
|
+
() => _chunkDLYVHOMEcjs.getSupportedTokenSymbolsForChain.call(void 0, sourceChainId),
|
|
1363
1356
|
[sourceChainId]
|
|
1364
1357
|
);
|
|
1365
1358
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -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 = _chunk7ZCUANBTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_optionalChain([_chunk7ZCUANBTcjs.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) {
|
|
@@ -1422,7 +1415,7 @@ function DepositAddressStep({
|
|
|
1422
1415
|
const fallback = sourceSelectionRef.current;
|
|
1423
1416
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
1424
1417
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
1425
|
-
const token = _nullishCoalesce(details.token, () => (
|
|
1418
|
+
const token = _nullishCoalesce(details.token, () => ( _chunkDLYVHOMEcjs.getTokenAddress.call(void 0, fallback.tokenSymbol, fallback.chainId)));
|
|
1426
1419
|
if (token) {
|
|
1427
1420
|
depositHandledRef.current = true;
|
|
1428
1421
|
onDepositDetected(eventTxHash, chainId, amount, token);
|
|
@@ -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) {
|
|
@@ -1447,7 +1440,7 @@ function DepositAddressStep({
|
|
|
1447
1440
|
clearTimeout(timeoutId);
|
|
1448
1441
|
};
|
|
1449
1442
|
}, [smartAccount, service, onDepositDetected, onError]);
|
|
1450
|
-
const chainIconSrc =
|
|
1443
|
+
const chainIconSrc = _chunkDLYVHOMEcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1451
1444
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1452
1445
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address", children: [
|
|
1453
1446
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
@@ -1463,10 +1456,10 @@ function DepositAddressStep({
|
|
|
1463
1456
|
setChainDropdownOpen(false);
|
|
1464
1457
|
},
|
|
1465
1458
|
children: [
|
|
1466
|
-
|
|
1459
|
+
_chunkDLYVHOMEcjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1467
1460
|
"img",
|
|
1468
1461
|
{
|
|
1469
|
-
src:
|
|
1462
|
+
src: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1470
1463
|
alt: "",
|
|
1471
1464
|
className: "rs-deposit-address-dropdown-icon"
|
|
1472
1465
|
}
|
|
@@ -1503,10 +1496,10 @@ function DepositAddressStep({
|
|
|
1503
1496
|
setTokenDropdownOpen(false);
|
|
1504
1497
|
},
|
|
1505
1498
|
children: [
|
|
1506
|
-
|
|
1499
|
+
_chunkDLYVHOMEcjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1507
1500
|
"img",
|
|
1508
1501
|
{
|
|
1509
|
-
src:
|
|
1502
|
+
src: _chunkDLYVHOMEcjs.getTokenIcon.call(void 0, symbol),
|
|
1510
1503
|
alt: "",
|
|
1511
1504
|
className: "rs-deposit-address-dropdown-icon"
|
|
1512
1505
|
}
|
|
@@ -1529,15 +1522,15 @@ function DepositAddressStep({
|
|
|
1529
1522
|
setTokenDropdownOpen(false);
|
|
1530
1523
|
},
|
|
1531
1524
|
children: [
|
|
1532
|
-
|
|
1525
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1533
1526
|
"img",
|
|
1534
1527
|
{
|
|
1535
|
-
src:
|
|
1528
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, sourceChainId),
|
|
1536
1529
|
alt: "",
|
|
1537
1530
|
className: "rs-deposit-address-dropdown-icon"
|
|
1538
1531
|
}
|
|
1539
1532
|
),
|
|
1540
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1533
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkDLYVHOMEcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1541
1534
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1542
1535
|
"svg",
|
|
1543
1536
|
{
|
|
@@ -1569,15 +1562,15 @@ function DepositAddressStep({
|
|
|
1569
1562
|
setChainDropdownOpen(false);
|
|
1570
1563
|
},
|
|
1571
1564
|
children: [
|
|
1572
|
-
|
|
1565
|
+
_chunkDLYVHOMEcjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1573
1566
|
"img",
|
|
1574
1567
|
{
|
|
1575
|
-
src:
|
|
1568
|
+
src: _chunkDLYVHOMEcjs.getChainIcon.call(void 0, chainId),
|
|
1576
1569
|
alt: "",
|
|
1577
1570
|
className: "rs-deposit-address-dropdown-icon"
|
|
1578
1571
|
}
|
|
1579
1572
|
),
|
|
1580
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1573
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkDLYVHOMEcjs.getChainName.call(void 0, chainId) })
|
|
1581
1574
|
]
|
|
1582
1575
|
},
|
|
1583
1576
|
chainId
|
|
@@ -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, _chunk7ZCUANBTcjs.PoweredBy, {})
|
|
1631
1624
|
] });
|
|
1632
1625
|
}
|
|
1633
1626
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1648,7 +1641,7 @@ function DepositFlow({
|
|
|
1648
1641
|
sourceToken: defaultSourceToken,
|
|
1649
1642
|
amount: defaultAmount,
|
|
1650
1643
|
recipient,
|
|
1651
|
-
signerAddress =
|
|
1644
|
+
signerAddress = _chunkDLYVHOMEcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1652
1645
|
sessionChainIds,
|
|
1653
1646
|
forceRegister = false,
|
|
1654
1647
|
waitForFinalTx = true,
|
|
@@ -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, () => ( _chunk7ZCUANBTcjs.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, () => ( _chunk7ZCUANBTcjs.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, () => ( _chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.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 _chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.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-4PFOMSC6.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2116
2109
|
);
|
|
2117
2110
|
function DepositModal(props) {
|
|
2118
2111
|
const needsReown = !!props.reownAppId;
|
|
@@ -2135,8 +2128,8 @@ function DepositModalInner({
|
|
|
2135
2128
|
sourceToken,
|
|
2136
2129
|
defaultAmount,
|
|
2137
2130
|
recipient,
|
|
2138
|
-
backendUrl =
|
|
2139
|
-
signerAddress =
|
|
2131
|
+
backendUrl = _chunkDLYVHOMEcjs.DEFAULT_BACKEND_URL,
|
|
2132
|
+
signerAddress = _chunkDLYVHOMEcjs.DEFAULT_SIGNER_ADDRESS,
|
|
2140
2133
|
sessionChainIds,
|
|
2141
2134
|
forceRegister = false,
|
|
2142
2135
|
waitForFinalTx = true,
|
|
@@ -2160,19 +2153,19 @@ function DepositModalInner({
|
|
|
2160
2153
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
2161
2154
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
2162
2155
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
2163
|
-
const targetChain =
|
|
2164
|
-
const sourceChain = sourceChainProp ?
|
|
2165
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
2156
|
+
const targetChain = _chunkDLYVHOMEcjs.getChainId.call(void 0, targetChainProp);
|
|
2157
|
+
const sourceChain = sourceChainProp ? _chunkDLYVHOMEcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
2158
|
+
const service = _react.useMemo.call(void 0, () => _chunk7ZCUANBTcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
2166
2159
|
_react.useEffect.call(void 0, () => {
|
|
2167
2160
|
if (isOpen && modalRef.current) {
|
|
2168
|
-
|
|
2161
|
+
_chunk7ZCUANBTcjs.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
|
+
_chunk7ZCUANBTcjs.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: _chunk7ZCUANBTcjs.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,
|