@rhinestone/deposit-modal 0.1.49 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/{DepositModalReown-PWD3WK7I.mjs → DepositModalReown-BMHCHJ2P.mjs} +18 -7
- package/dist/{DepositModalReown-AVQEEWEQ.cjs → DepositModalReown-KT5MMNTJ.cjs} +21 -10
- package/dist/{WithdrawModalReown-ZSR3RP44.cjs → WithdrawModalReown-DULPL255.cjs} +6 -6
- package/dist/{WithdrawModalReown-FODH7PY5.mjs → WithdrawModalReown-V5HYDMO2.mjs} +3 -3
- package/dist/{chunk-KOYHFHYW.cjs → chunk-2AS2NAJ2.cjs} +149 -119
- package/dist/{chunk-FKNYONM2.mjs → chunk-BNSX25TA.mjs} +5 -4
- package/dist/{chunk-PW55TOFK.cjs → chunk-DKYHVAHN.cjs} +45 -36
- package/dist/{chunk-HCZNF6CR.mjs → chunk-G2GXEC7C.mjs} +14 -5
- package/dist/{chunk-7HJ7IBRH.cjs → chunk-NU3ES4JY.cjs} +5 -4
- package/dist/{chunk-QLLL6ARN.mjs → chunk-SKL3JJP6.mjs} +42 -12
- package/dist/{chunk-JGB6XSYS.mjs → chunk-UPA7N6GY.mjs} +11 -12
- package/dist/{chunk-XLRQCIYD.cjs → chunk-XAGXQV4K.cjs} +11 -12
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +4 -4
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +3 -3
- package/dist/{types-B0FLVdXb.d.ts → types-D1nvo2dK.d.ts} +11 -0
- package/dist/{types-dY70pF2y.d.cts → types-DgiqazTb.d.cts} +11 -0
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkNU3ES4JYcjs = require('./chunk-NU3ES4JY.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -61,15 +61,15 @@ var _react = require('react');
|
|
|
61
61
|
|
|
62
62
|
var _jsxruntime = require('react/jsx-runtime');
|
|
63
63
|
async function resolveSessionOwner(eoaAddress) {
|
|
64
|
-
const localOwner =
|
|
64
|
+
const localOwner = _chunkNU3ES4JYcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
65
65
|
if (localOwner) {
|
|
66
66
|
return {
|
|
67
|
-
account:
|
|
67
|
+
account: _chunkNU3ES4JYcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
68
68
|
address: localOwner.address
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
const created =
|
|
72
|
-
|
|
71
|
+
const created = _chunkNU3ES4JYcjs.createSessionOwnerKey.call(void 0, );
|
|
72
|
+
_chunkNU3ES4JYcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
73
73
|
return {
|
|
74
74
|
account: created.account,
|
|
75
75
|
address: created.address
|
|
@@ -84,6 +84,7 @@ function SetupStep({
|
|
|
84
84
|
sessionChainIds,
|
|
85
85
|
recipient,
|
|
86
86
|
forceRegister,
|
|
87
|
+
enableSolana = true,
|
|
87
88
|
service,
|
|
88
89
|
onSetupComplete,
|
|
89
90
|
onError,
|
|
@@ -104,7 +105,7 @@ function SetupStep({
|
|
|
104
105
|
const setup = await service.setupAccount({
|
|
105
106
|
ownerAddress: address,
|
|
106
107
|
sessionOwnerAddress: sessionOwner.address,
|
|
107
|
-
targetChain:
|
|
108
|
+
targetChain: _chunkNU3ES4JYcjs.toEvmCaip2.call(void 0, targetChain),
|
|
108
109
|
targetToken,
|
|
109
110
|
signerAddress,
|
|
110
111
|
sessionChainIds,
|
|
@@ -114,7 +115,10 @@ function SetupStep({
|
|
|
114
115
|
if (!setup.needsRegistration) {
|
|
115
116
|
setState({ type: "ready", smartAccount });
|
|
116
117
|
_optionalChain([onConnected, 'optionalCall', _ => _(address, smartAccount)]);
|
|
117
|
-
onSetupComplete(
|
|
118
|
+
onSetupComplete(
|
|
119
|
+
smartAccount,
|
|
120
|
+
enableSolana ? setup.solanaDepositAddress : void 0
|
|
121
|
+
);
|
|
118
122
|
return;
|
|
119
123
|
}
|
|
120
124
|
setState({ type: "signing-session" });
|
|
@@ -131,7 +135,7 @@ function SetupStep({
|
|
|
131
135
|
primaryType: typedData.primaryType,
|
|
132
136
|
message: typedData.message
|
|
133
137
|
});
|
|
134
|
-
const sessionDetails =
|
|
138
|
+
const sessionDetails = _chunkNU3ES4JYcjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
135
139
|
setState({ type: "registering" });
|
|
136
140
|
const registerResult = await service.registerAccount({
|
|
137
141
|
address: smartAccount,
|
|
@@ -143,14 +147,17 @@ function SetupStep({
|
|
|
143
147
|
eoaAddress: address,
|
|
144
148
|
sessionOwner: sessionOwner.address,
|
|
145
149
|
target: {
|
|
146
|
-
chain:
|
|
150
|
+
chain: _chunkNU3ES4JYcjs.toEvmCaip2.call(void 0, targetChain),
|
|
147
151
|
token: targetToken,
|
|
148
152
|
...recipient && { recipient }
|
|
149
153
|
}
|
|
150
154
|
});
|
|
151
155
|
setState({ type: "ready", smartAccount });
|
|
152
156
|
_optionalChain([onConnected, 'optionalCall', _2 => _2(address, smartAccount)]);
|
|
153
|
-
onSetupComplete(
|
|
157
|
+
onSetupComplete(
|
|
158
|
+
smartAccount,
|
|
159
|
+
enableSolana ? registerResult.solanaDepositAddress : void 0
|
|
160
|
+
);
|
|
154
161
|
} catch (error) {
|
|
155
162
|
const message = error instanceof Error ? error.message : "Setup failed";
|
|
156
163
|
setState({ type: "error", message });
|
|
@@ -165,6 +172,7 @@ function SetupStep({
|
|
|
165
172
|
sessionChainIds,
|
|
166
173
|
recipient,
|
|
167
174
|
forceRegister,
|
|
175
|
+
enableSolana,
|
|
168
176
|
service,
|
|
169
177
|
onSetupComplete,
|
|
170
178
|
onError,
|
|
@@ -202,7 +210,7 @@ function SetupStep({
|
|
|
202
210
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
203
211
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
204
212
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
205
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
213
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
206
214
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
207
215
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
208
216
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -239,7 +247,7 @@ function SetupStep({
|
|
|
239
247
|
] })
|
|
240
248
|
] })
|
|
241
249
|
] }),
|
|
242
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
243
251
|
] });
|
|
244
252
|
}
|
|
245
253
|
|
|
@@ -264,7 +272,7 @@ function AssetSelectStep({
|
|
|
264
272
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
265
273
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
266
274
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
267
|
-
return
|
|
275
|
+
return _chunkNU3ES4JYcjs.getAssetId.call(void 0, {
|
|
268
276
|
chainId: defaultSourceChain,
|
|
269
277
|
token: defaultSourceToken
|
|
270
278
|
});
|
|
@@ -281,7 +289,7 @@ function AssetSelectStep({
|
|
|
281
289
|
try {
|
|
282
290
|
const portfolio = await service.fetchPortfolio(address);
|
|
283
291
|
if (!active) return;
|
|
284
|
-
const portfolioAssets =
|
|
292
|
+
const portfolioAssets = _chunkNU3ES4JYcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
285
293
|
setAssets(portfolioAssets);
|
|
286
294
|
const hasNative = portfolioAssets.some(
|
|
287
295
|
(asset) => asset.token.toLowerCase() === _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -362,7 +370,7 @@ function AssetSelectStep({
|
|
|
362
370
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
363
371
|
const numeric = Number(raw);
|
|
364
372
|
if (!Number.isFinite(numeric)) return raw;
|
|
365
|
-
return
|
|
373
|
+
return _chunkNU3ES4JYcjs.tokenFormatter.format(numeric);
|
|
366
374
|
} catch (e3) {
|
|
367
375
|
return asset.balance;
|
|
368
376
|
}
|
|
@@ -376,7 +384,7 @@ function AssetSelectStep({
|
|
|
376
384
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
377
385
|
children: [
|
|
378
386
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
379
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
387
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
380
388
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
381
389
|
] }),
|
|
382
390
|
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 }) }),
|
|
@@ -466,7 +474,7 @@ function AssetSelectStep({
|
|
|
466
474
|
] })
|
|
467
475
|
] })
|
|
468
476
|
] }),
|
|
469
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
477
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkNU3ES4JYcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
470
478
|
]
|
|
471
479
|
},
|
|
472
480
|
asset.id
|
|
@@ -476,7 +484,7 @@ function AssetSelectStep({
|
|
|
476
484
|
}
|
|
477
485
|
),
|
|
478
486
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
479
|
-
|
|
487
|
+
_chunkNU3ES4JYcjs.Button,
|
|
480
488
|
{
|
|
481
489
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
482
490
|
disabled: !selectedAsset,
|
|
@@ -484,7 +492,7 @@ function AssetSelectStep({
|
|
|
484
492
|
children: "Continue"
|
|
485
493
|
}
|
|
486
494
|
) }),
|
|
487
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
495
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.PoweredBy, {})
|
|
488
496
|
] });
|
|
489
497
|
}
|
|
490
498
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -492,7 +500,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
492
500
|
const connectedChainId = _optionalChain([publicClient, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.id]);
|
|
493
501
|
if (!connectedChainId) return [];
|
|
494
502
|
if (!_chunkNELAYNA3cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
495
|
-
const id =
|
|
503
|
+
const id = _chunkNU3ES4JYcjs.getAssetId.call(void 0, {
|
|
496
504
|
chainId: connectedChainId,
|
|
497
505
|
token: _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS
|
|
498
506
|
});
|
|
@@ -578,7 +586,7 @@ function AmountStep({
|
|
|
578
586
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
579
587
|
if (!balanceTarget || !publicClient) return;
|
|
580
588
|
try {
|
|
581
|
-
const bal =
|
|
589
|
+
const bal = _chunkNU3ES4JYcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
582
590
|
address: asset.token,
|
|
583
591
|
abi: _viem.erc20Abi,
|
|
584
592
|
functionName: "balanceOf",
|
|
@@ -604,7 +612,7 @@ function AmountStep({
|
|
|
604
612
|
setIsSwitching(true);
|
|
605
613
|
switchChain(asset.chainId).catch((err) => {
|
|
606
614
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
607
|
-
setError(
|
|
615
|
+
setError(_chunkNU3ES4JYcjs.formatUserError.call(void 0, raw));
|
|
608
616
|
}).finally(() => {
|
|
609
617
|
setIsSwitching(false);
|
|
610
618
|
});
|
|
@@ -640,7 +648,7 @@ function AmountStep({
|
|
|
640
648
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
641
649
|
const numeric = Number(raw);
|
|
642
650
|
if (!Number.isFinite(numeric)) return raw;
|
|
643
|
-
return
|
|
651
|
+
return _chunkNU3ES4JYcjs.tokenFormatter.format(numeric);
|
|
644
652
|
} catch (e8) {
|
|
645
653
|
return "...";
|
|
646
654
|
}
|
|
@@ -682,13 +690,13 @@ function AmountStep({
|
|
|
682
690
|
const usdValue = numericAmount;
|
|
683
691
|
if (_optionalChain([uiConfig, 'optionalAccess', _15 => _15.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
684
692
|
setError(
|
|
685
|
-
`Maximum deposit is ${
|
|
693
|
+
`Maximum deposit is ${_chunkNU3ES4JYcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
686
694
|
);
|
|
687
695
|
return;
|
|
688
696
|
}
|
|
689
697
|
if (_optionalChain([uiConfig, 'optionalAccess', _16 => _16.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
690
698
|
setError(
|
|
691
|
-
`Minimum deposit is ${
|
|
699
|
+
`Minimum deposit is ${_chunkNU3ES4JYcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
692
700
|
);
|
|
693
701
|
return;
|
|
694
702
|
}
|
|
@@ -737,7 +745,7 @@ function AmountStep({
|
|
|
737
745
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
738
746
|
" ",
|
|
739
747
|
"(",
|
|
740
|
-
|
|
748
|
+
_chunkNU3ES4JYcjs.currencyFormatter.format(balanceUsd),
|
|
741
749
|
")"
|
|
742
750
|
] })
|
|
743
751
|
] }) })
|
|
@@ -896,7 +904,7 @@ function AmountStep({
|
|
|
896
904
|
] })
|
|
897
905
|
] }),
|
|
898
906
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
899
|
-
|
|
907
|
+
_chunkNU3ES4JYcjs.Button,
|
|
900
908
|
{
|
|
901
909
|
onClick: handleContinue,
|
|
902
910
|
fullWidth: true,
|
|
@@ -904,7 +912,7 @@ function AmountStep({
|
|
|
904
912
|
children: "Continue"
|
|
905
913
|
}
|
|
906
914
|
) }),
|
|
907
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
915
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.PoweredBy, {})
|
|
908
916
|
] });
|
|
909
917
|
}
|
|
910
918
|
|
|
@@ -954,7 +962,7 @@ function ConfirmStep({
|
|
|
954
962
|
setIsSwitching(true);
|
|
955
963
|
switchChain(asset.chainId).catch((err) => {
|
|
956
964
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
957
|
-
setError(
|
|
965
|
+
setError(_chunkNU3ES4JYcjs.formatUserError.call(void 0, raw));
|
|
958
966
|
}).finally(() => {
|
|
959
967
|
setIsSwitching(false);
|
|
960
968
|
});
|
|
@@ -997,7 +1005,7 @@ function ConfirmStep({
|
|
|
997
1005
|
throw new Error("Wallet not properly connected");
|
|
998
1006
|
}
|
|
999
1007
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1000
|
-
const hash =
|
|
1008
|
+
const hash = _chunkNU3ES4JYcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1001
1009
|
account,
|
|
1002
1010
|
chain,
|
|
1003
1011
|
to: transferTo,
|
|
@@ -1014,7 +1022,7 @@ function ConfirmStep({
|
|
|
1014
1022
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1015
1023
|
} catch (err) {
|
|
1016
1024
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1017
|
-
const message =
|
|
1025
|
+
const message = _chunkNU3ES4JYcjs.formatUserError.call(void 0, raw);
|
|
1018
1026
|
setError(message);
|
|
1019
1027
|
_optionalChain([onError, 'optionalCall', _20 => _20(message, "TRANSFER_ERROR")]);
|
|
1020
1028
|
} finally {
|
|
@@ -1143,7 +1151,7 @@ function ConfirmStep({
|
|
|
1143
1151
|
] })
|
|
1144
1152
|
] }),
|
|
1145
1153
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1146
|
-
|
|
1154
|
+
_chunkNU3ES4JYcjs.Button,
|
|
1147
1155
|
{
|
|
1148
1156
|
onClick: handleConfirm,
|
|
1149
1157
|
loading: isSubmitting,
|
|
@@ -1152,7 +1160,7 @@ function ConfirmStep({
|
|
|
1152
1160
|
children: "Confirm Order"
|
|
1153
1161
|
}
|
|
1154
1162
|
) }),
|
|
1155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1163
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.PoweredBy, {})
|
|
1156
1164
|
] });
|
|
1157
1165
|
}
|
|
1158
1166
|
|
|
@@ -1550,10 +1558,10 @@ function DepositAddressStep({
|
|
|
1550
1558
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1551
1559
|
if (cancelled || depositHandledRef.current) return;
|
|
1552
1560
|
const event = status.lastEvent;
|
|
1553
|
-
const eventTxHash =
|
|
1561
|
+
const eventTxHash = _chunkNU3ES4JYcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkNU3ES4JYcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1554
1562
|
if (baselineTxHash === void 0) {
|
|
1555
1563
|
baselineTxHash = eventTxHash;
|
|
1556
|
-
} else if (eventTxHash && (!baselineTxHash || !
|
|
1564
|
+
} else if (eventTxHash && (!baselineTxHash || !_chunkNU3ES4JYcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHash))) {
|
|
1557
1565
|
const details = getDepositEventDetails(event);
|
|
1558
1566
|
const fallback = sourceSelectionRef.current;
|
|
1559
1567
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1776,7 +1784,7 @@ function DepositAddressStep({
|
|
|
1776
1784
|
] }),
|
|
1777
1785
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1778
1786
|
] }) }),
|
|
1779
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1787
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.PoweredBy, {})
|
|
1780
1788
|
] });
|
|
1781
1789
|
}
|
|
1782
1790
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1807,7 +1815,7 @@ function SolanaTokenSelectStep({
|
|
|
1807
1815
|
setError(null);
|
|
1808
1816
|
const portfolioBySymbol = {};
|
|
1809
1817
|
try {
|
|
1810
|
-
|
|
1818
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1811
1819
|
solanaAddress
|
|
1812
1820
|
});
|
|
1813
1821
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -1830,12 +1838,12 @@ function SolanaTokenSelectStep({
|
|
|
1830
1838
|
};
|
|
1831
1839
|
}
|
|
1832
1840
|
}
|
|
1833
|
-
|
|
1841
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
1834
1842
|
symbols: Object.keys(portfolioBySymbol)
|
|
1835
1843
|
});
|
|
1836
1844
|
} catch (err) {
|
|
1837
1845
|
if (!active) return;
|
|
1838
|
-
|
|
1846
|
+
_chunkNU3ES4JYcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
1839
1847
|
solanaAddress
|
|
1840
1848
|
});
|
|
1841
1849
|
setError(
|
|
@@ -1889,7 +1897,7 @@ function SolanaTokenSelectStep({
|
|
|
1889
1897
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1890
1898
|
children: [
|
|
1891
1899
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1892
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1900
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
1893
1901
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1894
1902
|
] }),
|
|
1895
1903
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -1926,7 +1934,7 @@ function SolanaTokenSelectStep({
|
|
|
1926
1934
|
try {
|
|
1927
1935
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
1928
1936
|
const numeric = Number(raw);
|
|
1929
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
1937
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkNU3ES4JYcjs.tokenFormatter.format(numeric) : raw;
|
|
1930
1938
|
} catch (e14) {
|
|
1931
1939
|
formattedBalance = "...";
|
|
1932
1940
|
}
|
|
@@ -1970,7 +1978,7 @@ function SolanaTokenSelectStep({
|
|
|
1970
1978
|
] })
|
|
1971
1979
|
] })
|
|
1972
1980
|
] }),
|
|
1973
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
1981
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkNU3ES4JYcjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
1974
1982
|
]
|
|
1975
1983
|
},
|
|
1976
1984
|
entry.token.symbol
|
|
@@ -1980,7 +1988,7 @@ function SolanaTokenSelectStep({
|
|
|
1980
1988
|
}
|
|
1981
1989
|
),
|
|
1982
1990
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1983
|
-
|
|
1991
|
+
_chunkNU3ES4JYcjs.Button,
|
|
1984
1992
|
{
|
|
1985
1993
|
onClick: () => selectedEntry && onContinue(
|
|
1986
1994
|
selectedEntry.token,
|
|
@@ -1992,7 +2000,7 @@ function SolanaTokenSelectStep({
|
|
|
1992
2000
|
children: "Continue"
|
|
1993
2001
|
}
|
|
1994
2002
|
) }),
|
|
1995
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2003
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.PoweredBy, {})
|
|
1996
2004
|
] });
|
|
1997
2005
|
}
|
|
1998
2006
|
|
|
@@ -2040,7 +2048,7 @@ function SolanaAmountStep({
|
|
|
2040
2048
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2041
2049
|
const numeric = Number(raw);
|
|
2042
2050
|
if (!Number.isFinite(numeric)) return raw;
|
|
2043
|
-
return
|
|
2051
|
+
return _chunkNU3ES4JYcjs.tokenFormatter.format(numeric);
|
|
2044
2052
|
} catch (e16) {
|
|
2045
2053
|
return "...";
|
|
2046
2054
|
}
|
|
@@ -2058,7 +2066,7 @@ function SolanaAmountStep({
|
|
|
2058
2066
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2059
2067
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2060
2068
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2061
|
-
return
|
|
2069
|
+
return _chunkNU3ES4JYcjs.currencyFormatter.format(computedBalanceUsd);
|
|
2062
2070
|
}, [computedBalanceUsd]);
|
|
2063
2071
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2064
2072
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2083,7 +2091,7 @@ function SolanaAmountStep({
|
|
|
2083
2091
|
const factor = 10 ** maxDecimals;
|
|
2084
2092
|
const truncated = Math.floor(value * factor) / factor;
|
|
2085
2093
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2086
|
-
|
|
2094
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2087
2095
|
percentage,
|
|
2088
2096
|
symbol: token.symbol,
|
|
2089
2097
|
formatted
|
|
@@ -2097,7 +2105,7 @@ function SolanaAmountStep({
|
|
|
2097
2105
|
const handleContinue = () => {
|
|
2098
2106
|
const numericAmount = parseFloat(amount);
|
|
2099
2107
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2100
|
-
|
|
2108
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2101
2109
|
amount,
|
|
2102
2110
|
reason: "nan-or-non-positive"
|
|
2103
2111
|
});
|
|
@@ -2109,13 +2117,13 @@ function SolanaAmountStep({
|
|
|
2109
2117
|
const usdValue = numericAmount;
|
|
2110
2118
|
if (_optionalChain([uiConfig, 'optionalAccess', _38 => _38.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2111
2119
|
setError(
|
|
2112
|
-
`Maximum deposit is ${
|
|
2120
|
+
`Maximum deposit is ${_chunkNU3ES4JYcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2113
2121
|
);
|
|
2114
2122
|
return;
|
|
2115
2123
|
}
|
|
2116
2124
|
if (_optionalChain([uiConfig, 'optionalAccess', _39 => _39.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
2117
2125
|
setError(
|
|
2118
|
-
`Minimum deposit is ${
|
|
2126
|
+
`Minimum deposit is ${_chunkNU3ES4JYcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
2119
2127
|
);
|
|
2120
2128
|
return;
|
|
2121
2129
|
}
|
|
@@ -2125,7 +2133,7 @@ function SolanaAmountStep({
|
|
|
2125
2133
|
try {
|
|
2126
2134
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2127
2135
|
} catch (e20) {
|
|
2128
|
-
|
|
2136
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2129
2137
|
amount,
|
|
2130
2138
|
sourceAmount: sourceAmountStr,
|
|
2131
2139
|
reason: "parse-units-failed"
|
|
@@ -2135,7 +2143,7 @@ function SolanaAmountStep({
|
|
|
2135
2143
|
}
|
|
2136
2144
|
if (amountInUnits > spendableBalance) {
|
|
2137
2145
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2138
|
-
|
|
2146
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2139
2147
|
amount,
|
|
2140
2148
|
balance: balance.toString(),
|
|
2141
2149
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2147,7 +2155,7 @@ function SolanaAmountStep({
|
|
|
2147
2155
|
);
|
|
2148
2156
|
return;
|
|
2149
2157
|
}
|
|
2150
|
-
|
|
2158
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2151
2159
|
symbol: token.symbol,
|
|
2152
2160
|
inputAmountUsd: amount,
|
|
2153
2161
|
sourceAmount: sourceAmountStr,
|
|
@@ -2238,7 +2246,7 @@ function SolanaAmountStep({
|
|
|
2238
2246
|
] })
|
|
2239
2247
|
] }),
|
|
2240
2248
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2241
|
-
|
|
2249
|
+
_chunkNU3ES4JYcjs.Button,
|
|
2242
2250
|
{
|
|
2243
2251
|
onClick: handleContinue,
|
|
2244
2252
|
fullWidth: true,
|
|
@@ -2246,7 +2254,7 @@ function SolanaAmountStep({
|
|
|
2246
2254
|
children: "Continue"
|
|
2247
2255
|
}
|
|
2248
2256
|
) }),
|
|
2249
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2257
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.PoweredBy, {})
|
|
2250
2258
|
] });
|
|
2251
2259
|
}
|
|
2252
2260
|
|
|
@@ -2290,7 +2298,7 @@ function SolanaConfirmStep({
|
|
|
2290
2298
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2291
2299
|
const handleConfirm = async () => {
|
|
2292
2300
|
if (!solanaProvider) {
|
|
2293
|
-
|
|
2301
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2294
2302
|
reason: "missing-provider"
|
|
2295
2303
|
});
|
|
2296
2304
|
setError("Solana wallet not connected");
|
|
@@ -2298,7 +2306,7 @@ function SolanaConfirmStep({
|
|
|
2298
2306
|
}
|
|
2299
2307
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2300
2308
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2301
|
-
|
|
2309
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2302
2310
|
reason: "invalid-amount",
|
|
2303
2311
|
sourceAmount
|
|
2304
2312
|
});
|
|
@@ -2307,7 +2315,7 @@ function SolanaConfirmStep({
|
|
|
2307
2315
|
}
|
|
2308
2316
|
setError(null);
|
|
2309
2317
|
setIsSubmitting(true);
|
|
2310
|
-
|
|
2318
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2311
2319
|
smartAccount,
|
|
2312
2320
|
solanaAddress,
|
|
2313
2321
|
solanaDepositAddress,
|
|
@@ -2317,7 +2325,7 @@ function SolanaConfirmStep({
|
|
|
2317
2325
|
});
|
|
2318
2326
|
try {
|
|
2319
2327
|
const check = await service.checkAccount(smartAccount);
|
|
2320
|
-
|
|
2328
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2321
2329
|
smartAccount,
|
|
2322
2330
|
isRegistered: check.isRegistered,
|
|
2323
2331
|
targetChain: check.targetChain,
|
|
@@ -2330,7 +2338,7 @@ function SolanaConfirmStep({
|
|
|
2330
2338
|
}
|
|
2331
2339
|
const connection = getSolanaConnection();
|
|
2332
2340
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2333
|
-
|
|
2341
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2334
2342
|
token: token.symbol,
|
|
2335
2343
|
sourceAmount,
|
|
2336
2344
|
amountUnits: amountUnits.toString()
|
|
@@ -2347,7 +2355,7 @@ function SolanaConfirmStep({
|
|
|
2347
2355
|
token.mint,
|
|
2348
2356
|
amountUnits
|
|
2349
2357
|
);
|
|
2350
|
-
|
|
2358
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2351
2359
|
token: token.symbol,
|
|
2352
2360
|
instructionCount: transaction.instructions.length,
|
|
2353
2361
|
feePayer: _optionalChain([transaction, 'access', _40 => _40.feePayer, 'optionalAccess', _41 => _41.toBase58, 'call', _42 => _42()]),
|
|
@@ -2358,15 +2366,15 @@ function SolanaConfirmStep({
|
|
|
2358
2366
|
connection,
|
|
2359
2367
|
transaction
|
|
2360
2368
|
);
|
|
2361
|
-
|
|
2369
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2362
2370
|
txHash,
|
|
2363
2371
|
amountUnits: amountUnits.toString()
|
|
2364
2372
|
});
|
|
2365
2373
|
onConfirm(txHash, amountUnits.toString());
|
|
2366
2374
|
} catch (err) {
|
|
2367
2375
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2368
|
-
const message =
|
|
2369
|
-
|
|
2376
|
+
const message = _chunkNU3ES4JYcjs.formatUserError.call(void 0, raw);
|
|
2377
|
+
_chunkNU3ES4JYcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2370
2378
|
smartAccount,
|
|
2371
2379
|
token: token.symbol,
|
|
2372
2380
|
sourceAmount
|
|
@@ -2499,7 +2507,7 @@ function SolanaConfirmStep({
|
|
|
2499
2507
|
] })
|
|
2500
2508
|
] }),
|
|
2501
2509
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2502
|
-
|
|
2510
|
+
_chunkNU3ES4JYcjs.Button,
|
|
2503
2511
|
{
|
|
2504
2512
|
onClick: handleConfirm,
|
|
2505
2513
|
loading: isSubmitting,
|
|
@@ -2508,7 +2516,7 @@ function SolanaConfirmStep({
|
|
|
2508
2516
|
children: "Confirm Order"
|
|
2509
2517
|
}
|
|
2510
2518
|
) }),
|
|
2511
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2519
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNU3ES4JYcjs.PoweredBy, {})
|
|
2512
2520
|
] });
|
|
2513
2521
|
}
|
|
2514
2522
|
|
|
@@ -2535,6 +2543,7 @@ function DepositFlow({
|
|
|
2535
2543
|
sessionChainIds,
|
|
2536
2544
|
forceRegister = false,
|
|
2537
2545
|
waitForFinalTx = true,
|
|
2546
|
+
enableSolana = true,
|
|
2538
2547
|
reownWallet,
|
|
2539
2548
|
onConnect,
|
|
2540
2549
|
onDisconnect,
|
|
@@ -2564,13 +2573,13 @@ function DepositFlow({
|
|
|
2564
2573
|
flowModeRef.current = flowMode;
|
|
2565
2574
|
const logFlow = _react.useCallback.call(void 0,
|
|
2566
2575
|
(message, data) => {
|
|
2567
|
-
|
|
2576
|
+
_chunkNU3ES4JYcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
2568
2577
|
},
|
|
2569
2578
|
[debug]
|
|
2570
2579
|
);
|
|
2571
2580
|
const logFlowError = _react.useCallback.call(void 0,
|
|
2572
2581
|
(message, error, data) => {
|
|
2573
|
-
|
|
2582
|
+
_chunkNU3ES4JYcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
2574
2583
|
},
|
|
2575
2584
|
[debug]
|
|
2576
2585
|
);
|
|
@@ -2610,7 +2619,7 @@ function DepositFlow({
|
|
|
2610
2619
|
});
|
|
2611
2620
|
seen.add(id);
|
|
2612
2621
|
}
|
|
2613
|
-
if (_optionalChain([reownWallet, 'optionalAccess', _49 => _49.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
2622
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _49 => _49.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
2614
2623
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
2615
2624
|
if (!seen.has(id)) {
|
|
2616
2625
|
options.push({
|
|
@@ -2644,6 +2653,7 @@ function DepositFlow({
|
|
|
2644
2653
|
_optionalChain([reownWallet, 'optionalAccess', _53 => _53.walletClient]),
|
|
2645
2654
|
_optionalChain([reownWallet, 'optionalAccess', _54 => _54.publicClient]),
|
|
2646
2655
|
_optionalChain([reownWallet, 'optionalAccess', _55 => _55.icon]),
|
|
2656
|
+
enableSolana,
|
|
2647
2657
|
_optionalChain([reownWallet, 'optionalAccess', _56 => _56.isSolana]),
|
|
2648
2658
|
_optionalChain([reownWallet, 'optionalAccess', _57 => _57.solanaAddress]),
|
|
2649
2659
|
_optionalChain([reownWallet, 'optionalAccess', _58 => _58.caipAddress])
|
|
@@ -2651,7 +2661,7 @@ function DepositFlow({
|
|
|
2651
2661
|
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _59 => _59.account]) && dappAddress && !reownWallet;
|
|
2652
2662
|
const hasWalletOptions = walletOptions.length > 0;
|
|
2653
2663
|
const hasReownSession = Boolean(
|
|
2654
|
-
_optionalChain([reownWallet, 'optionalAccess', _60 => _60.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _61 => _61.address])
|
|
2664
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _60 => _60.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _61 => _61.address]) : _optionalChain([reownWallet, 'optionalAccess', _62 => _62.address])
|
|
2655
2665
|
);
|
|
2656
2666
|
const showConnectStep = flowMode === null && !canAutoLock && !isConnectSelectionConfirmed;
|
|
2657
2667
|
const walletSelectionKey = _react.useMemo.call(void 0, () => {
|
|
@@ -2677,16 +2687,16 @@ function DepositFlow({
|
|
|
2677
2687
|
return {
|
|
2678
2688
|
ownerAddress: dappAddress,
|
|
2679
2689
|
walletClient: void 0,
|
|
2680
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2690
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNU3ES4JYcjs.getPublicClient.call(void 0, targetChain))),
|
|
2681
2691
|
switchChain: void 0
|
|
2682
2692
|
};
|
|
2683
2693
|
}
|
|
2684
2694
|
if (canAutoLock) {
|
|
2685
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2695
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _63 => _63.chain, 'optionalAccess', _64 => _64.id]), () => ( targetChain));
|
|
2686
2696
|
return {
|
|
2687
2697
|
ownerAddress: dappWalletClient.account.address,
|
|
2688
2698
|
walletClient: dappWalletClient,
|
|
2689
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2699
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNU3ES4JYcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2690
2700
|
switchChain: dappSwitchChain
|
|
2691
2701
|
};
|
|
2692
2702
|
}
|
|
@@ -2700,24 +2710,24 @@ function DepositFlow({
|
|
|
2700
2710
|
return {
|
|
2701
2711
|
ownerAddress: dappAddress,
|
|
2702
2712
|
walletClient: void 0,
|
|
2703
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2713
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNU3ES4JYcjs.getPublicClient.call(void 0, targetChain))),
|
|
2704
2714
|
switchChain: void 0
|
|
2705
2715
|
};
|
|
2706
2716
|
}
|
|
2707
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2708
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2717
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _65 => _65.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2718
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _66 => _66.chain, 'optionalAccess', _67 => _67.id]), () => ( targetChain));
|
|
2709
2719
|
return {
|
|
2710
2720
|
ownerAddress: dappWalletClient.account.address,
|
|
2711
2721
|
walletClient: dappWalletClient,
|
|
2712
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2722
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNU3ES4JYcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2713
2723
|
switchChain: dappSwitchChain
|
|
2714
2724
|
};
|
|
2715
2725
|
}
|
|
2716
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
2726
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _68 => _68.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2717
2727
|
return {
|
|
2718
2728
|
ownerAddress: reownWallet.address,
|
|
2719
2729
|
walletClient: reownWallet.walletClient,
|
|
2720
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
2730
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkNU3ES4JYcjs.getPublicClient.call(void 0, targetChain))),
|
|
2721
2731
|
switchChain: reownWallet.switchChain
|
|
2722
2732
|
};
|
|
2723
2733
|
}
|
|
@@ -2755,7 +2765,7 @@ function DepositFlow({
|
|
|
2755
2765
|
return {
|
|
2756
2766
|
ownerAddress: dappAddress,
|
|
2757
2767
|
walletClient: void 0,
|
|
2758
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2768
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNU3ES4JYcjs.getPublicClient.call(void 0, targetChain))),
|
|
2759
2769
|
switchChain: void 0
|
|
2760
2770
|
};
|
|
2761
2771
|
}
|
|
@@ -2777,7 +2787,7 @@ function DepositFlow({
|
|
|
2777
2787
|
walletSignerContext,
|
|
2778
2788
|
walletSelectionKey
|
|
2779
2789
|
]);
|
|
2780
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
2790
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _69 => _69.ownerAddress]))), () => ( null));
|
|
2781
2791
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
2782
2792
|
_react.useEffect.call(void 0, () => {
|
|
2783
2793
|
const prev = lastTargetRef.current;
|
|
@@ -2854,7 +2864,7 @@ function DepositFlow({
|
|
|
2854
2864
|
const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "solana-token-select" ? 1 : step.type === "solana-amount" ? 2 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : step.type === "solana-confirm" ? 3 : 4;
|
|
2855
2865
|
const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && signerContext && !canAutoLock ? handleBackFromSelectAsset : step.type === "solana-token-select" ? handleBackFromSolanaTokenSelect : step.type === "solana-amount" ? handleBackFromSolanaAmount : step.type === "solana-confirm" ? handleBackFromSolanaConfirm : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
|
|
2856
2866
|
_react.useEffect.call(void 0, () => {
|
|
2857
|
-
_optionalChain([onStepChange, 'optionalCall',
|
|
2867
|
+
_optionalChain([onStepChange, 'optionalCall', _70 => _70(stepIndex, currentBackHandler)]);
|
|
2858
2868
|
}, [stepIndex, currentBackHandler, onStepChange]);
|
|
2859
2869
|
_react.useEffect.call(void 0, () => {
|
|
2860
2870
|
logFlow("state:changed", {
|
|
@@ -2873,7 +2883,7 @@ function DepositFlow({
|
|
|
2873
2883
|
targetToken
|
|
2874
2884
|
]);
|
|
2875
2885
|
_react.useEffect.call(void 0, () => {
|
|
2876
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
2886
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _71 => _71(totalBalanceUsd)]);
|
|
2877
2887
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
2878
2888
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2879
2889
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -2915,7 +2925,7 @@ function DepositFlow({
|
|
|
2915
2925
|
solanaDepositAddress
|
|
2916
2926
|
});
|
|
2917
2927
|
} else {
|
|
2918
|
-
_optionalChain([onError, 'optionalCall',
|
|
2928
|
+
_optionalChain([onError, 'optionalCall', _72 => _72({
|
|
2919
2929
|
message: "Solana deposit address not available. Please try again.",
|
|
2920
2930
|
code: "SOLANA_SETUP_FAILED"
|
|
2921
2931
|
})]);
|
|
@@ -2950,7 +2960,7 @@ function DepositFlow({
|
|
|
2950
2960
|
directTransfer
|
|
2951
2961
|
};
|
|
2952
2962
|
});
|
|
2953
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
2963
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _73 => _73({ txHash, sourceChain: chainId, amount })]);
|
|
2954
2964
|
},
|
|
2955
2965
|
[onDepositSubmitted, targetChain, targetToken]
|
|
2956
2966
|
);
|
|
@@ -3022,7 +3032,7 @@ function DepositFlow({
|
|
|
3022
3032
|
sourceDecimals: prev.token.decimals
|
|
3023
3033
|
};
|
|
3024
3034
|
});
|
|
3025
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3035
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _74 => _74({
|
|
3026
3036
|
txHash,
|
|
3027
3037
|
sourceChain: "solana",
|
|
3028
3038
|
amount: amountUnits
|
|
@@ -3032,7 +3042,7 @@ function DepositFlow({
|
|
|
3032
3042
|
);
|
|
3033
3043
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3034
3044
|
(addr, smartAccount) => {
|
|
3035
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3045
|
+
_optionalChain([onConnected, 'optionalCall', _75 => _75({ address: addr, smartAccount })]);
|
|
3036
3046
|
},
|
|
3037
3047
|
[onConnected]
|
|
3038
3048
|
);
|
|
@@ -3095,28 +3105,28 @@ function DepositFlow({
|
|
|
3095
3105
|
);
|
|
3096
3106
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3097
3107
|
(txHash, sourceChain, amount) => {
|
|
3098
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3108
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _76 => _76({ txHash, sourceChain, amount })]);
|
|
3099
3109
|
},
|
|
3100
3110
|
[onDepositSubmitted]
|
|
3101
3111
|
);
|
|
3102
3112
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3103
|
-
(txHash, destinationTxHash) => {
|
|
3104
|
-
logFlow("deposit:complete", { txHash, destinationTxHash });
|
|
3105
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3113
|
+
(txHash, destinationTxHash, context) => {
|
|
3114
|
+
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3115
|
+
_optionalChain([onDepositComplete, 'optionalCall', _77 => _77({ txHash, destinationTxHash, ...context })]);
|
|
3106
3116
|
},
|
|
3107
3117
|
[logFlow, onDepositComplete]
|
|
3108
3118
|
);
|
|
3109
3119
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3110
3120
|
(txHash, error) => {
|
|
3111
3121
|
logFlowError("deposit:failed", error, { txHash });
|
|
3112
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3122
|
+
_optionalChain([onDepositFailed, 'optionalCall', _78 => _78({ txHash, error })]);
|
|
3113
3123
|
},
|
|
3114
3124
|
[logFlowError, onDepositFailed]
|
|
3115
3125
|
);
|
|
3116
3126
|
const handleError = _react.useCallback.call(void 0,
|
|
3117
3127
|
(message, code) => {
|
|
3118
3128
|
logFlowError("flow:error", message, { code });
|
|
3119
|
-
_optionalChain([onError, 'optionalCall',
|
|
3129
|
+
_optionalChain([onError, 'optionalCall', _79 => _79({ message, code })]);
|
|
3120
3130
|
},
|
|
3121
3131
|
[logFlowError, onError]
|
|
3122
3132
|
);
|
|
@@ -3153,6 +3163,17 @@ function DepositFlow({
|
|
|
3153
3163
|
setFlowMode(null);
|
|
3154
3164
|
}
|
|
3155
3165
|
}, [showConnectStep, isConnectSelectionConfirmed, flowMode, signerContext]);
|
|
3166
|
+
_react.useEffect.call(void 0, () => {
|
|
3167
|
+
if (enableSolana || flowMode !== "solana-wallet") {
|
|
3168
|
+
return;
|
|
3169
|
+
}
|
|
3170
|
+
setFlowMode(null);
|
|
3171
|
+
setIsConnectSelectionConfirmed(false);
|
|
3172
|
+
setSelectedWalletId(null);
|
|
3173
|
+
if (step.type !== "processing") {
|
|
3174
|
+
setStep({ type: "setup" });
|
|
3175
|
+
}
|
|
3176
|
+
}, [enableSolana, flowMode, step.type]);
|
|
3156
3177
|
_react.useEffect.call(void 0, () => {
|
|
3157
3178
|
if (hasNavigatedBackRef.current || isConnectSelectionConfirmed || flowMode) {
|
|
3158
3179
|
return;
|
|
@@ -3162,7 +3183,7 @@ function DepositFlow({
|
|
|
3162
3183
|
if (walletId) {
|
|
3163
3184
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3164
3185
|
setSelectedWalletId(walletId);
|
|
3165
|
-
if (_optionalChain([selectedOption, 'optionalAccess',
|
|
3186
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _80 => _80.kind]) === "solana") {
|
|
3166
3187
|
handleSelectSolanaWallet();
|
|
3167
3188
|
} else {
|
|
3168
3189
|
handleSelectProvider();
|
|
@@ -3178,6 +3199,7 @@ function DepositFlow({
|
|
|
3178
3199
|
}, [
|
|
3179
3200
|
hasWalletOptions,
|
|
3180
3201
|
hasReownSession,
|
|
3202
|
+
enableSolana,
|
|
3181
3203
|
isConnectSelectionConfirmed,
|
|
3182
3204
|
flowMode,
|
|
3183
3205
|
selectedWalletIdEffective,
|
|
@@ -3190,7 +3212,7 @@ function DepositFlow({
|
|
|
3190
3212
|
]);
|
|
3191
3213
|
if (showConnectStep) {
|
|
3192
3214
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3193
|
-
|
|
3215
|
+
_chunkNU3ES4JYcjs.ConnectStep,
|
|
3194
3216
|
{
|
|
3195
3217
|
walletOptions,
|
|
3196
3218
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3209,7 +3231,7 @@ function DepositFlow({
|
|
|
3209
3231
|
const selectedOption = walletOptions.find(
|
|
3210
3232
|
(o) => o.id === selectedWalletIdEffective
|
|
3211
3233
|
);
|
|
3212
|
-
if (_optionalChain([selectedOption, 'optionalAccess',
|
|
3234
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _81 => _81.kind]) === "solana") {
|
|
3213
3235
|
handleSelectSolanaWallet();
|
|
3214
3236
|
} else {
|
|
3215
3237
|
handleSelectProvider();
|
|
@@ -3233,6 +3255,7 @@ function DepositFlow({
|
|
|
3233
3255
|
sessionChainIds,
|
|
3234
3256
|
recipient,
|
|
3235
3257
|
forceRegister,
|
|
3258
|
+
enableSolana,
|
|
3236
3259
|
service,
|
|
3237
3260
|
onSetupComplete: handleSetupComplete,
|
|
3238
3261
|
onConnected: handleConnected,
|
|
@@ -3243,20 +3266,21 @@ function DepositFlow({
|
|
|
3243
3266
|
DepositAddressStep,
|
|
3244
3267
|
{
|
|
3245
3268
|
smartAccount: step.smartAccount,
|
|
3246
|
-
solanaDepositAddress: step.solanaDepositAddress,
|
|
3269
|
+
solanaDepositAddress: enableSolana ? step.solanaDepositAddress : void 0,
|
|
3247
3270
|
service,
|
|
3248
3271
|
onDepositDetected: handleDepositAddressDetected,
|
|
3249
3272
|
onError: handleError
|
|
3250
3273
|
}
|
|
3251
3274
|
),
|
|
3252
3275
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3253
|
-
|
|
3276
|
+
_chunkNU3ES4JYcjs.ProcessingStep,
|
|
3254
3277
|
{
|
|
3255
3278
|
smartAccount: step.smartAccount,
|
|
3256
3279
|
txHash: step.txHash,
|
|
3257
3280
|
sourceChain: step.sourceChain,
|
|
3258
3281
|
sourceToken: step.sourceToken,
|
|
3259
3282
|
targetChain,
|
|
3283
|
+
targetToken,
|
|
3260
3284
|
amount: step.amount,
|
|
3261
3285
|
sourceSymbol: step.sourceSymbol,
|
|
3262
3286
|
sourceDecimals: step.sourceDecimals,
|
|
@@ -3275,8 +3299,8 @@ function DepositFlow({
|
|
|
3275
3299
|
}
|
|
3276
3300
|
if (isSolanaWalletMode) {
|
|
3277
3301
|
if (!sessionKeyAddress) return null;
|
|
3278
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3279
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3302
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _82 => _82.solanaAddress]);
|
|
3303
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _83 => _83.solanaProvider]);
|
|
3280
3304
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3281
3305
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3282
3306
|
SetupStep,
|
|
@@ -3288,6 +3312,7 @@ function DepositFlow({
|
|
|
3288
3312
|
sessionChainIds,
|
|
3289
3313
|
recipient,
|
|
3290
3314
|
forceRegister,
|
|
3315
|
+
enableSolana,
|
|
3291
3316
|
service,
|
|
3292
3317
|
onSetupComplete: handleSetupComplete,
|
|
3293
3318
|
onConnected: handleConnected,
|
|
@@ -3370,13 +3395,14 @@ function DepositFlow({
|
|
|
3370
3395
|
) })
|
|
3371
3396
|
] }) : null,
|
|
3372
3397
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3373
|
-
|
|
3398
|
+
_chunkNU3ES4JYcjs.ProcessingStep,
|
|
3374
3399
|
{
|
|
3375
3400
|
smartAccount: step.smartAccount,
|
|
3376
3401
|
txHash: step.txHash,
|
|
3377
3402
|
sourceChain: step.sourceChain,
|
|
3378
3403
|
sourceToken: step.sourceToken,
|
|
3379
3404
|
targetChain,
|
|
3405
|
+
targetToken,
|
|
3380
3406
|
amount: step.amount,
|
|
3381
3407
|
sourceSymbol: step.sourceSymbol,
|
|
3382
3408
|
sourceDecimals: step.sourceDecimals,
|
|
@@ -3393,16 +3419,16 @@ function DepositFlow({
|
|
|
3393
3419
|
)
|
|
3394
3420
|
] });
|
|
3395
3421
|
}
|
|
3396
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3422
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _84 => _84.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _85 => _85.publicClient])) {
|
|
3397
3423
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet..." }) }) }) }) });
|
|
3398
3424
|
}
|
|
3399
3425
|
const ownerAddress = signerContext.ownerAddress;
|
|
3400
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
3426
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _86 => _86.walletClient, 'optionalAccess', _87 => _87.chain, 'optionalAccess', _88 => _88.id]), () => ( _optionalChain([signerContext, 'access', _89 => _89.publicClient, 'access', _90 => _90.chain, 'optionalAccess', _91 => _91.id]))), () => ( targetChain));
|
|
3401
3427
|
const getReadClientForChain = (chainId) => {
|
|
3402
|
-
if (_optionalChain([signerContext, 'access',
|
|
3428
|
+
if (_optionalChain([signerContext, 'access', _92 => _92.publicClient, 'access', _93 => _93.chain, 'optionalAccess', _94 => _94.id]) === chainId) {
|
|
3403
3429
|
return signerContext.publicClient;
|
|
3404
3430
|
}
|
|
3405
|
-
return
|
|
3431
|
+
return _chunkNU3ES4JYcjs.getPublicClient.call(void 0, chainId);
|
|
3406
3432
|
};
|
|
3407
3433
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3408
3434
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3416,6 +3442,7 @@ function DepositFlow({
|
|
|
3416
3442
|
sessionChainIds,
|
|
3417
3443
|
recipient,
|
|
3418
3444
|
forceRegister,
|
|
3445
|
+
enableSolana,
|
|
3419
3446
|
service,
|
|
3420
3447
|
onSetupComplete: handleSetupComplete,
|
|
3421
3448
|
onConnected: handleConnected,
|
|
@@ -3472,13 +3499,14 @@ function DepositFlow({
|
|
|
3472
3499
|
}
|
|
3473
3500
|
),
|
|
3474
3501
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3475
|
-
|
|
3502
|
+
_chunkNU3ES4JYcjs.ProcessingStep,
|
|
3476
3503
|
{
|
|
3477
3504
|
smartAccount: step.smartAccount,
|
|
3478
3505
|
txHash: step.txHash,
|
|
3479
3506
|
sourceChain: step.sourceChain,
|
|
3480
3507
|
sourceToken: step.sourceToken,
|
|
3481
3508
|
targetChain,
|
|
3509
|
+
targetToken,
|
|
3482
3510
|
amount: step.amount,
|
|
3483
3511
|
sourceSymbol: step.sourceSymbol,
|
|
3484
3512
|
sourceDecimals: step.sourceDecimals,
|
|
@@ -3499,7 +3527,7 @@ function DepositFlow({
|
|
|
3499
3527
|
// src/DepositModal.tsx
|
|
3500
3528
|
|
|
3501
3529
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3502
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3530
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-KT5MMNTJ.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3503
3531
|
);
|
|
3504
3532
|
function DepositModal(props) {
|
|
3505
3533
|
const needsReown = !!props.reownAppId;
|
|
@@ -3528,6 +3556,7 @@ function DepositModalInner({
|
|
|
3528
3556
|
sessionChainIds,
|
|
3529
3557
|
forceRegister = false,
|
|
3530
3558
|
waitForFinalTx = true,
|
|
3559
|
+
enableSolana = true,
|
|
3531
3560
|
reownWallet,
|
|
3532
3561
|
onConnect,
|
|
3533
3562
|
onDisconnect,
|
|
@@ -3553,7 +3582,7 @@ function DepositModalInner({
|
|
|
3553
3582
|
const targetChain = _chunkNELAYNA3cjs.getChainId.call(void 0, targetChainProp);
|
|
3554
3583
|
const sourceChain = sourceChainProp ? _chunkNELAYNA3cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
3555
3584
|
const service = _react.useMemo.call(void 0,
|
|
3556
|
-
() =>
|
|
3585
|
+
() => _chunkNU3ES4JYcjs.createDepositService.call(void 0, backendUrl, {
|
|
3557
3586
|
debug,
|
|
3558
3587
|
debugScope: "service:deposit"
|
|
3559
3588
|
}),
|
|
@@ -3561,7 +3590,7 @@ function DepositModalInner({
|
|
|
3561
3590
|
);
|
|
3562
3591
|
_react.useEffect.call(void 0, () => {
|
|
3563
3592
|
if (isOpen && modalRef.current) {
|
|
3564
|
-
|
|
3593
|
+
_chunkNU3ES4JYcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
3565
3594
|
}
|
|
3566
3595
|
}, [isOpen, theme]);
|
|
3567
3596
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3571,7 +3600,7 @@ function DepositModalInner({
|
|
|
3571
3600
|
_react.useEffect.call(void 0, () => {
|
|
3572
3601
|
if (isOpen && !hasCalledReady.current) {
|
|
3573
3602
|
hasCalledReady.current = true;
|
|
3574
|
-
_optionalChain([onReady, 'optionalCall',
|
|
3603
|
+
_optionalChain([onReady, 'optionalCall', _95 => _95()]);
|
|
3575
3604
|
}
|
|
3576
3605
|
}, [isOpen, onReady]);
|
|
3577
3606
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3590,17 +3619,17 @@ function DepositModalInner({
|
|
|
3590
3619
|
setTotalBalanceUsd(balance2);
|
|
3591
3620
|
}, []);
|
|
3592
3621
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3593
|
-
_optionalChain([backHandlerRef, 'access',
|
|
3622
|
+
_optionalChain([backHandlerRef, 'access', _96 => _96.current, 'optionalCall', _97 => _97()]);
|
|
3594
3623
|
}, []);
|
|
3595
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3596
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3597
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3598
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
3599
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3600
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3624
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _98 => _98.showLogo]), () => ( false));
|
|
3625
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _99 => _99.showStepper]), () => ( false));
|
|
3626
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.showBackButton]), () => ( true));
|
|
3627
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _101 => _101.balance]);
|
|
3628
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _102 => _102.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
3629
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _103 => _103.title]), () => ( "Deposit"));
|
|
3601
3630
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3602
3631
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3603
|
-
|
|
3632
|
+
_chunkNU3ES4JYcjs.Modal,
|
|
3604
3633
|
{
|
|
3605
3634
|
isOpen,
|
|
3606
3635
|
onClose,
|
|
@@ -3661,7 +3690,7 @@ function DepositModalInner({
|
|
|
3661
3690
|
balance.title,
|
|
3662
3691
|
":"
|
|
3663
3692
|
] }),
|
|
3664
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
3693
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkNU3ES4JYcjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
3665
3694
|
] })
|
|
3666
3695
|
] }),
|
|
3667
3696
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3708,6 +3737,7 @@ function DepositModalInner({
|
|
|
3708
3737
|
sessionChainIds,
|
|
3709
3738
|
forceRegister,
|
|
3710
3739
|
waitForFinalTx,
|
|
3740
|
+
enableSolana,
|
|
3711
3741
|
reownWallet,
|
|
3712
3742
|
onConnect,
|
|
3713
3743
|
onDisconnect,
|