@rhinestone/deposit-modal 0.1.24 → 0.1.26
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 +1 -5
- package/dist/DepositModalReown-4WZF2HMJ.mjs +33 -0
- package/dist/DepositModalReown-NKDYLTKD.cjs +33 -0
- package/dist/WithdrawModalReown-244RQ5FZ.mjs +33 -0
- package/dist/WithdrawModalReown-GL4TM22D.cjs +33 -0
- package/dist/{chunk-P7SQQAAF.mjs → chunk-3FK5FAUL.mjs} +244 -76
- package/dist/{chunk-ANQQMGNN.cjs → chunk-4Q6QCALP.cjs} +271 -103
- package/dist/{chunk-O3I5KVXA.cjs → chunk-4WULBRUA.cjs} +97 -81
- package/dist/chunk-6VJ2ZTNQ.cjs +90 -0
- package/dist/{chunk-A2PDOYYE.cjs → chunk-7QCFFKB5.cjs} +78 -68
- package/dist/{chunk-35DWLO33.mjs → chunk-DJAUNNEW.mjs} +61 -45
- package/dist/chunk-LBEP3A2Z.mjs +90 -0
- package/dist/{chunk-ZMVCDFXM.mjs → chunk-W42B54IA.mjs} +37 -27
- 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 +6 -191
- package/dist/reown.d.cts +4 -12
- package/dist/reown.d.ts +4 -12
- package/dist/reown.mjs +8 -193
- package/dist/{types-CUww05xT.d.cts → types-BwaQ7jK5.d.cts} +3 -16
- package/dist/{types-Z6GjVWFR.d.ts → types-CgXyx46m.d.ts} +3 -16
- 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 +16 -33
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var _chunk4Q6QCALPcjs = require('./chunk-4Q6QCALP.cjs');
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
|
|
@@ -46,6 +48,8 @@ var _chunkCEIWN53Ncjs = require('./chunk-CEIWN53N.cjs');
|
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
|
|
51
|
+
|
|
52
|
+
|
|
49
53
|
var _react = require('react');
|
|
50
54
|
|
|
51
55
|
// src/DepositFlow.tsx
|
|
@@ -53,17 +57,18 @@ var _react = require('react');
|
|
|
53
57
|
|
|
54
58
|
// src/components/steps/SetupStep.tsx
|
|
55
59
|
|
|
60
|
+
var _sdk = require('@rhinestone/sdk');
|
|
56
61
|
var _jsxruntime = require('react/jsx-runtime');
|
|
57
62
|
async function resolveSessionOwner(eoaAddress) {
|
|
58
|
-
const localOwner =
|
|
63
|
+
const localOwner = _chunk4Q6QCALPcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
59
64
|
if (localOwner) {
|
|
60
65
|
return {
|
|
61
|
-
account:
|
|
66
|
+
account: _chunk4Q6QCALPcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
62
67
|
address: localOwner.address
|
|
63
68
|
};
|
|
64
69
|
}
|
|
65
|
-
const created =
|
|
66
|
-
|
|
70
|
+
const created = _chunk4Q6QCALPcjs.createSessionOwnerKey.call(void 0, );
|
|
71
|
+
_chunk4Q6QCALPcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
67
72
|
return {
|
|
68
73
|
account: created.account,
|
|
69
74
|
address: created.address
|
|
@@ -73,7 +78,9 @@ function SetupStep({
|
|
|
73
78
|
walletClient,
|
|
74
79
|
address,
|
|
75
80
|
targetChain,
|
|
81
|
+
targetChainObj,
|
|
76
82
|
targetToken,
|
|
83
|
+
rhinestoneApiKey,
|
|
77
84
|
signerAddress,
|
|
78
85
|
sessionChainIds,
|
|
79
86
|
recipient,
|
|
@@ -85,18 +92,8 @@ function SetupStep({
|
|
|
85
92
|
}) {
|
|
86
93
|
const [state, setState] = _react.useState.call(void 0, { type: "idle" });
|
|
87
94
|
const setupInitiatedRef = _react.useRef.call(void 0, false);
|
|
88
|
-
const signSessionDetails = _react.useCallback.call(void 0,
|
|
89
|
-
async (sessionOwner, typedData) => {
|
|
90
|
-
const signer = sessionOwner.account;
|
|
91
|
-
if (!signer.signTypedData) {
|
|
92
|
-
throw new Error("Session owner cannot sign typed data");
|
|
93
|
-
}
|
|
94
|
-
return await signer.signTypedData(typedData);
|
|
95
|
-
},
|
|
96
|
-
[]
|
|
97
|
-
);
|
|
98
95
|
const runSetup = _react.useCallback.call(void 0, async () => {
|
|
99
|
-
if (!address) {
|
|
96
|
+
if (!address || !targetChainObj) {
|
|
100
97
|
return;
|
|
101
98
|
}
|
|
102
99
|
if (walletClient && !walletClient.account) {
|
|
@@ -126,13 +123,16 @@ function SetupStep({
|
|
|
126
123
|
}
|
|
127
124
|
}
|
|
128
125
|
setState({ type: "signing-session" });
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
const signerAccount = walletClient ? _sdk.walletClientToAccount.call(void 0, walletClient) : _chunk4Q6QCALPcjs.createViewOnlyAccount.call(void 0, address);
|
|
127
|
+
const account = await _chunk4Q6QCALPcjs.createSmartAccount.call(void 0,
|
|
128
|
+
signerAccount,
|
|
129
|
+
sessionOwner.account,
|
|
130
|
+
rhinestoneApiKey
|
|
132
131
|
);
|
|
133
|
-
const sessionDetails =
|
|
132
|
+
const sessionDetails = await _chunk4Q6QCALPcjs.signSessionDetails.call(void 0,
|
|
133
|
+
account,
|
|
134
134
|
prepared.sessionDetailsUnsigned,
|
|
135
|
-
|
|
135
|
+
sessionOwner.account
|
|
136
136
|
);
|
|
137
137
|
setState({ type: "registering" });
|
|
138
138
|
await service.registerAccount({
|
|
@@ -161,8 +161,10 @@ function SetupStep({
|
|
|
161
161
|
}, [
|
|
162
162
|
address,
|
|
163
163
|
walletClient,
|
|
164
|
+
targetChainObj,
|
|
164
165
|
targetChain,
|
|
165
166
|
targetToken,
|
|
167
|
+
rhinestoneApiKey,
|
|
166
168
|
signerAddress,
|
|
167
169
|
sessionChainIds,
|
|
168
170
|
recipient,
|
|
@@ -170,16 +172,15 @@ function SetupStep({
|
|
|
170
172
|
service,
|
|
171
173
|
onSetupComplete,
|
|
172
174
|
onError,
|
|
173
|
-
onConnected
|
|
174
|
-
signSessionDetails
|
|
175
|
+
onConnected
|
|
175
176
|
]);
|
|
176
177
|
_react.useEffect.call(void 0, () => {
|
|
177
178
|
const hasWallet = walletClient ? Boolean(walletClient.account) : true;
|
|
178
|
-
if (address && hasWallet && !setupInitiatedRef.current && state.type === "idle") {
|
|
179
|
+
if (address && hasWallet && targetChainObj && !setupInitiatedRef.current && state.type === "idle") {
|
|
179
180
|
setupInitiatedRef.current = true;
|
|
180
181
|
runSetup();
|
|
181
182
|
}
|
|
182
|
-
}, [address, walletClient, state.type, runSetup]);
|
|
183
|
+
}, [address, walletClient, targetChainObj, state.type, runSetup]);
|
|
183
184
|
const handleRetry = () => {
|
|
184
185
|
setupInitiatedRef.current = false;
|
|
185
186
|
setState({ type: "idle" });
|
|
@@ -207,7 +208,7 @@ function SetupStep({
|
|
|
207
208
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
208
209
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
209
210
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
210
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
211
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
211
212
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
212
213
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
213
214
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -244,7 +245,7 @@ function SetupStep({
|
|
|
244
245
|
] })
|
|
245
246
|
] })
|
|
246
247
|
] }),
|
|
247
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
248
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
248
249
|
] });
|
|
249
250
|
}
|
|
250
251
|
|
|
@@ -267,7 +268,7 @@ function AssetSelectStep({
|
|
|
267
268
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
268
269
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
269
270
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
270
|
-
return
|
|
271
|
+
return _chunk4Q6QCALPcjs.getAssetId.call(void 0, {
|
|
271
272
|
chainId: defaultSourceChain,
|
|
272
273
|
token: defaultSourceToken
|
|
273
274
|
});
|
|
@@ -284,7 +285,7 @@ function AssetSelectStep({
|
|
|
284
285
|
try {
|
|
285
286
|
const portfolio = await service.fetchPortfolio(address);
|
|
286
287
|
if (!active) return;
|
|
287
|
-
const portfolioAssets =
|
|
288
|
+
const portfolioAssets = _chunk4Q6QCALPcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
288
289
|
setAssets(portfolioAssets);
|
|
289
290
|
const hasNative = portfolioAssets.some(
|
|
290
291
|
(asset) => asset.token.toLowerCase() === _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -352,7 +353,7 @@ function AssetSelectStep({
|
|
|
352
353
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
353
354
|
const numeric = Number(raw);
|
|
354
355
|
if (!Number.isFinite(numeric)) return raw;
|
|
355
|
-
return
|
|
356
|
+
return _chunk4Q6QCALPcjs.tokenFormatter.format(numeric);
|
|
356
357
|
} catch (e3) {
|
|
357
358
|
return asset.balance;
|
|
358
359
|
}
|
|
@@ -366,7 +367,7 @@ function AssetSelectStep({
|
|
|
366
367
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
367
368
|
children: [
|
|
368
369
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
370
371
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
371
372
|
] }),
|
|
372
373
|
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 }) }),
|
|
@@ -456,7 +457,7 @@ function AssetSelectStep({
|
|
|
456
457
|
] })
|
|
457
458
|
] })
|
|
458
459
|
] }),
|
|
459
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ?
|
|
460
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 ? _chunk4Q6QCALPcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
460
461
|
]
|
|
461
462
|
},
|
|
462
463
|
asset.id
|
|
@@ -466,7 +467,7 @@ function AssetSelectStep({
|
|
|
466
467
|
}
|
|
467
468
|
),
|
|
468
469
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
469
|
-
|
|
470
|
+
_chunk4Q6QCALPcjs.Button,
|
|
470
471
|
{
|
|
471
472
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
472
473
|
disabled: !selectedAsset,
|
|
@@ -474,7 +475,7 @@ function AssetSelectStep({
|
|
|
474
475
|
children: "Continue"
|
|
475
476
|
}
|
|
476
477
|
) }),
|
|
477
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
478
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
478
479
|
] });
|
|
479
480
|
}
|
|
480
481
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -482,7 +483,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
482
483
|
const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
|
|
483
484
|
if (!connectedChainId) return [];
|
|
484
485
|
if (!_chunkCEIWN53Ncjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
485
|
-
const id =
|
|
486
|
+
const id = _chunk4Q6QCALPcjs.getAssetId.call(void 0, {
|
|
486
487
|
chainId: connectedChainId,
|
|
487
488
|
token: _chunkCEIWN53Ncjs.NATIVE_TOKEN_ADDRESS
|
|
488
489
|
});
|
|
@@ -562,7 +563,7 @@ function AmountStep({
|
|
|
562
563
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
563
564
|
if (!balanceTarget || !publicClient) return;
|
|
564
565
|
try {
|
|
565
|
-
const bal =
|
|
566
|
+
const bal = _chunk4Q6QCALPcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
566
567
|
address: asset.token,
|
|
567
568
|
abi: _viem.erc20Abi,
|
|
568
569
|
functionName: "balanceOf",
|
|
@@ -623,7 +624,7 @@ function AmountStep({
|
|
|
623
624
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
624
625
|
const numeric = Number(raw);
|
|
625
626
|
if (!Number.isFinite(numeric)) return raw;
|
|
626
|
-
return
|
|
627
|
+
return _chunk4Q6QCALPcjs.tokenFormatter.format(numeric);
|
|
627
628
|
} catch (e8) {
|
|
628
629
|
return "...";
|
|
629
630
|
}
|
|
@@ -637,7 +638,7 @@ function AmountStep({
|
|
|
637
638
|
}, [amountUsd, tokenPriceUsd]);
|
|
638
639
|
const formattedTokenAmount = _react.useMemo.call(void 0, () => {
|
|
639
640
|
if (tokenAmount === null) return "0.00";
|
|
640
|
-
return
|
|
641
|
+
return _chunk4Q6QCALPcjs.tokenFormatter.format(tokenAmount);
|
|
641
642
|
}, [tokenAmount]);
|
|
642
643
|
const targetSymbol = _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
643
644
|
const handlePresetClick = (percentage) => {
|
|
@@ -654,13 +655,13 @@ function AmountStep({
|
|
|
654
655
|
}
|
|
655
656
|
if (_optionalChain([uiConfig, 'optionalAccess', _13 => _13.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
656
657
|
setError(
|
|
657
|
-
`Maximum deposit is ${
|
|
658
|
+
`Maximum deposit is ${_chunk4Q6QCALPcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
658
659
|
);
|
|
659
660
|
return;
|
|
660
661
|
}
|
|
661
662
|
if (_optionalChain([uiConfig, 'optionalAccess', _14 => _14.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
662
663
|
setError(
|
|
663
|
-
`Minimum deposit is ${
|
|
664
|
+
`Minimum deposit is ${_chunk4Q6QCALPcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
664
665
|
);
|
|
665
666
|
return;
|
|
666
667
|
}
|
|
@@ -730,7 +731,7 @@ function AmountStep({
|
|
|
730
731
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
731
732
|
" ",
|
|
732
733
|
"(",
|
|
733
|
-
|
|
734
|
+
_chunk4Q6QCALPcjs.currencyFormatter.format(balanceUsd),
|
|
734
735
|
")"
|
|
735
736
|
] })
|
|
736
737
|
] }) })
|
|
@@ -873,7 +874,7 @@ function AmountStep({
|
|
|
873
874
|
" to continue."
|
|
874
875
|
] }),
|
|
875
876
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
876
|
-
|
|
877
|
+
_chunk4Q6QCALPcjs.Button,
|
|
877
878
|
{
|
|
878
879
|
variant: "outline",
|
|
879
880
|
size: "small",
|
|
@@ -906,7 +907,7 @@ function AmountStep({
|
|
|
906
907
|
] })
|
|
907
908
|
] }),
|
|
908
909
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
909
|
-
|
|
910
|
+
_chunk4Q6QCALPcjs.Button,
|
|
910
911
|
{
|
|
911
912
|
onClick: handleContinue,
|
|
912
913
|
fullWidth: true,
|
|
@@ -914,7 +915,7 @@ function AmountStep({
|
|
|
914
915
|
children: "Continue"
|
|
915
916
|
}
|
|
916
917
|
) }),
|
|
917
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
918
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
918
919
|
] });
|
|
919
920
|
}
|
|
920
921
|
|
|
@@ -1024,7 +1025,7 @@ function ConfirmStep({
|
|
|
1024
1025
|
throw new Error("Wallet not properly connected");
|
|
1025
1026
|
}
|
|
1026
1027
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1027
|
-
const hash =
|
|
1028
|
+
const hash = _chunk4Q6QCALPcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1028
1029
|
account,
|
|
1029
1030
|
chain,
|
|
1030
1031
|
to: transferTo,
|
|
@@ -1041,7 +1042,7 @@ function ConfirmStep({
|
|
|
1041
1042
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1042
1043
|
} catch (err) {
|
|
1043
1044
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1044
|
-
const message =
|
|
1045
|
+
const message = _chunk4Q6QCALPcjs.formatUserError.call(void 0, raw);
|
|
1045
1046
|
setError(message);
|
|
1046
1047
|
_optionalChain([onError, 'optionalCall', _18 => _18(message, "TRANSFER_ERROR")]);
|
|
1047
1048
|
} finally {
|
|
@@ -1055,7 +1056,7 @@ function ConfirmStep({
|
|
|
1055
1056
|
await switchChain(asset.chainId);
|
|
1056
1057
|
} catch (err) {
|
|
1057
1058
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1058
|
-
setError(
|
|
1059
|
+
setError(_chunk4Q6QCALPcjs.formatUserError.call(void 0, raw));
|
|
1059
1060
|
} finally {
|
|
1060
1061
|
setIsSwitching(false);
|
|
1061
1062
|
}
|
|
@@ -1160,7 +1161,7 @@ function ConfirmStep({
|
|
|
1160
1161
|
] }),
|
|
1161
1162
|
receiveAmountUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
1162
1163
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Value" }),
|
|
1163
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children:
|
|
1164
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: _chunk4Q6QCALPcjs.currencyFormatter.format(receiveAmountUsd) })
|
|
1164
1165
|
] })
|
|
1165
1166
|
] }),
|
|
1166
1167
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", children: [
|
|
@@ -1170,7 +1171,7 @@ function ConfirmStep({
|
|
|
1170
1171
|
" to sign."
|
|
1171
1172
|
] }),
|
|
1172
1173
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1173
|
-
|
|
1174
|
+
_chunk4Q6QCALPcjs.Button,
|
|
1174
1175
|
{
|
|
1175
1176
|
variant: "outline",
|
|
1176
1177
|
size: "small",
|
|
@@ -1203,7 +1204,7 @@ function ConfirmStep({
|
|
|
1203
1204
|
] })
|
|
1204
1205
|
] }),
|
|
1205
1206
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1206
|
-
|
|
1207
|
+
_chunk4Q6QCALPcjs.Button,
|
|
1207
1208
|
{
|
|
1208
1209
|
onClick: handleConfirm,
|
|
1209
1210
|
loading: isSubmitting,
|
|
@@ -1212,7 +1213,7 @@ function ConfirmStep({
|
|
|
1212
1213
|
children: "Confirm Order"
|
|
1213
1214
|
}
|
|
1214
1215
|
) }),
|
|
1215
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1216
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
1216
1217
|
] });
|
|
1217
1218
|
}
|
|
1218
1219
|
|
|
@@ -1417,7 +1418,7 @@ function DepositAddressStep({
|
|
|
1417
1418
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1418
1419
|
if (cancelled || depositHandledRef.current) return;
|
|
1419
1420
|
const event = status.lastEvent;
|
|
1420
|
-
const eventTxHash =
|
|
1421
|
+
const eventTxHash = _chunk4Q6QCALPcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_optionalChain([_chunk4Q6QCALPcjs.getEventTxHash.call(void 0, event), 'optionalAccess', _22 => _22.toLowerCase, 'call', _23 => _23()]), () => ( null)) : null;
|
|
1421
1422
|
if (baselineTxHash === void 0) {
|
|
1422
1423
|
baselineTxHash = eventTxHash;
|
|
1423
1424
|
} else if (eventTxHash && eventTxHash !== baselineTxHash) {
|
|
@@ -1630,7 +1631,7 @@ function DepositAddressStep({
|
|
|
1630
1631
|
] }),
|
|
1631
1632
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1632
1633
|
] }) }),
|
|
1633
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1634
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4Q6QCALPcjs.PoweredBy, {})
|
|
1634
1635
|
] });
|
|
1635
1636
|
}
|
|
1636
1637
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1651,6 +1652,7 @@ function DepositFlow({
|
|
|
1651
1652
|
sourceToken: defaultSourceToken,
|
|
1652
1653
|
amount: defaultAmount,
|
|
1653
1654
|
recipient,
|
|
1655
|
+
rhinestoneApiKey,
|
|
1654
1656
|
signerAddress = _chunkCEIWN53Ncjs.DEFAULT_SIGNER_ADDRESS,
|
|
1655
1657
|
sessionChainIds,
|
|
1656
1658
|
forceRegister = false,
|
|
@@ -1716,7 +1718,7 @@ function DepositFlow({
|
|
|
1716
1718
|
return {
|
|
1717
1719
|
ownerAddress: dappAddress,
|
|
1718
1720
|
walletClient: void 0,
|
|
1719
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1721
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, targetChain))),
|
|
1720
1722
|
switchChain: void 0
|
|
1721
1723
|
};
|
|
1722
1724
|
}
|
|
@@ -1725,7 +1727,7 @@ function DepositFlow({
|
|
|
1725
1727
|
return {
|
|
1726
1728
|
ownerAddress: dappWalletClient.account.address,
|
|
1727
1729
|
walletClient: dappWalletClient,
|
|
1728
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1730
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1729
1731
|
switchChain: dappSwitchChain
|
|
1730
1732
|
};
|
|
1731
1733
|
}
|
|
@@ -1735,7 +1737,7 @@ function DepositFlow({
|
|
|
1735
1737
|
return {
|
|
1736
1738
|
ownerAddress: dappWalletClient.account.address,
|
|
1737
1739
|
walletClient: dappWalletClient,
|
|
1738
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1740
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk4Q6QCALPcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1739
1741
|
switchChain: dappSwitchChain
|
|
1740
1742
|
};
|
|
1741
1743
|
}
|
|
@@ -1943,7 +1945,7 @@ function DepositFlow({
|
|
|
1943
1945
|
}, [walletOptionsKey, selectedConnectAddressEffective]);
|
|
1944
1946
|
if (showConnectStep) {
|
|
1945
1947
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1946
|
-
|
|
1948
|
+
_chunk4Q6QCALPcjs.ConnectStep,
|
|
1947
1949
|
{
|
|
1948
1950
|
walletOptions,
|
|
1949
1951
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1973,7 +1975,9 @@ function DepositFlow({
|
|
|
1973
1975
|
{
|
|
1974
1976
|
address: sessionKeyAddress,
|
|
1975
1977
|
targetChain,
|
|
1978
|
+
targetChainObj,
|
|
1976
1979
|
targetToken,
|
|
1980
|
+
rhinestoneApiKey,
|
|
1977
1981
|
signerAddress,
|
|
1978
1982
|
sessionChainIds,
|
|
1979
1983
|
recipient,
|
|
@@ -1994,7 +1998,7 @@ function DepositFlow({
|
|
|
1994
1998
|
}
|
|
1995
1999
|
),
|
|
1996
2000
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1997
|
-
|
|
2001
|
+
_chunk4Q6QCALPcjs.ProcessingStep,
|
|
1998
2002
|
{
|
|
1999
2003
|
smartAccount: step.smartAccount,
|
|
2000
2004
|
txHash: step.txHash,
|
|
@@ -2025,7 +2029,7 @@ function DepositFlow({
|
|
|
2025
2029
|
if (_optionalChain([signerContext, 'access', _58 => _58.publicClient, 'access', _59 => _59.chain, 'optionalAccess', _60 => _60.id]) === chainId) {
|
|
2026
2030
|
return signerContext.publicClient;
|
|
2027
2031
|
}
|
|
2028
|
-
return
|
|
2032
|
+
return _chunk4Q6QCALPcjs.getPublicClient.call(void 0, chainId);
|
|
2029
2033
|
};
|
|
2030
2034
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
2031
2035
|
step.type === "setup" && targetChainObj && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2034,7 +2038,9 @@ function DepositFlow({
|
|
|
2034
2038
|
walletClient: signerContext.walletClient,
|
|
2035
2039
|
address: ownerAddress,
|
|
2036
2040
|
targetChain,
|
|
2041
|
+
targetChainObj,
|
|
2037
2042
|
targetToken,
|
|
2043
|
+
rhinestoneApiKey,
|
|
2038
2044
|
signerAddress,
|
|
2039
2045
|
sessionChainIds,
|
|
2040
2046
|
recipient,
|
|
@@ -2091,7 +2097,7 @@ function DepositFlow({
|
|
|
2091
2097
|
}
|
|
2092
2098
|
),
|
|
2093
2099
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2094
|
-
|
|
2100
|
+
_chunk4Q6QCALPcjs.ProcessingStep,
|
|
2095
2101
|
{
|
|
2096
2102
|
smartAccount: step.smartAccount,
|
|
2097
2103
|
txHash: step.txHash,
|
|
@@ -2115,11 +2121,13 @@ function DepositFlow({
|
|
|
2115
2121
|
|
|
2116
2122
|
// src/DepositModal.tsx
|
|
2117
2123
|
|
|
2124
|
+
var ReownDepositInner = _react.lazy.call(void 0,
|
|
2125
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-NKDYLTKD.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2126
|
+
);
|
|
2118
2127
|
function DepositModal(props) {
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
);
|
|
2128
|
+
const needsReown = !!props.reownAppId;
|
|
2129
|
+
if (needsReown) {
|
|
2130
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Suspense, { fallback: null, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ReownDepositInner, { ...props }) });
|
|
2123
2131
|
}
|
|
2124
2132
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositModalInner, { ...props });
|
|
2125
2133
|
}
|
|
@@ -2138,6 +2146,7 @@ function DepositModalInner({
|
|
|
2138
2146
|
defaultAmount,
|
|
2139
2147
|
recipient,
|
|
2140
2148
|
backendUrl = _chunkCEIWN53Ncjs.DEFAULT_BACKEND_URL,
|
|
2149
|
+
rhinestoneApiKey,
|
|
2141
2150
|
signerAddress = _chunkCEIWN53Ncjs.DEFAULT_SIGNER_ADDRESS,
|
|
2142
2151
|
sessionChainIds,
|
|
2143
2152
|
forceRegister = false,
|
|
@@ -2164,10 +2173,10 @@ function DepositModalInner({
|
|
|
2164
2173
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
2165
2174
|
const targetChain = _chunkCEIWN53Ncjs.getChainId.call(void 0, targetChainProp);
|
|
2166
2175
|
const sourceChain = sourceChainProp ? _chunkCEIWN53Ncjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
2167
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
2176
|
+
const service = _react.useMemo.call(void 0, () => _chunk4Q6QCALPcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
2168
2177
|
_react.useEffect.call(void 0, () => {
|
|
2169
2178
|
if (isOpen && modalRef.current) {
|
|
2170
|
-
|
|
2179
|
+
_chunk4Q6QCALPcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
2171
2180
|
}
|
|
2172
2181
|
}, [isOpen, theme]);
|
|
2173
2182
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -2203,7 +2212,7 @@ function DepositModalInner({
|
|
|
2203
2212
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _69 => _69.title]), () => ( "Deposit"));
|
|
2204
2213
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
2205
2214
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2206
|
-
|
|
2215
|
+
_chunk4Q6QCALPcjs.Modal,
|
|
2207
2216
|
{
|
|
2208
2217
|
isOpen,
|
|
2209
2218
|
onClose,
|
|
@@ -2264,7 +2273,7 @@ function DepositModalInner({
|
|
|
2264
2273
|
balanceTitle,
|
|
2265
2274
|
":"
|
|
2266
2275
|
] }),
|
|
2267
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children:
|
|
2276
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _chunk4Q6QCALPcjs.currencyFormatter.format(totalBalanceUsd) })
|
|
2268
2277
|
] })
|
|
2269
2278
|
] }),
|
|
2270
2279
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2307,6 +2316,7 @@ function DepositModalInner({
|
|
|
2307
2316
|
sourceToken,
|
|
2308
2317
|
amount: defaultAmount,
|
|
2309
2318
|
recipient,
|
|
2319
|
+
rhinestoneApiKey,
|
|
2310
2320
|
signerAddress,
|
|
2311
2321
|
sessionChainIds,
|
|
2312
2322
|
forceRegister,
|