@rhinestone/deposit-modal 0.1.53 → 0.1.54
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-LNZ46L4O.mjs → DepositModalReown-5QKEE7R3.mjs} +3 -3
- package/dist/{DepositModalReown-OXAW4Y7O.cjs → DepositModalReown-XKP2Z55X.cjs} +4 -4
- package/dist/{WithdrawModalReown-EE74V66X.mjs → WithdrawModalReown-DN6OKFGR.mjs} +3 -3
- package/dist/{WithdrawModalReown-V3ZJESQ5.cjs → WithdrawModalReown-ZQCNJLSP.cjs} +4 -4
- package/dist/{chunk-ZB5Y2ACC.mjs → chunk-AJUR6FAP.mjs} +23 -8
- package/dist/{chunk-ZJQZEIHA.mjs → chunk-CIXHTOO3.mjs} +1 -1
- package/dist/{chunk-DBBSH7HP.cjs → chunk-EAEDK474.cjs} +58 -32
- package/dist/{chunk-K57KO3SW.cjs → chunk-GOMHX544.cjs} +80 -74
- package/dist/{chunk-REDAO3MS.mjs → chunk-JQTV5JTB.mjs} +37 -11
- package/dist/{chunk-47WDWD6Z.cjs → chunk-QJVXCBUI.cjs} +231 -216
- package/dist/{chunk-NELAYNA3.cjs → chunk-R6U6BHCV.cjs} +1 -1
- package/dist/{chunk-4BL7RCZB.mjs → chunk-XXB2LVUB.mjs} +23 -17
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +4 -4
- package/dist/styles.css +45 -55
- package/dist/{types-D1nvo2dK.d.ts → types-BPE95RUG.d.ts} +2 -0
- package/dist/{types-DgiqazTb.d.cts → types-Cm5vGVK2.d.cts} +2 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkEAEDK474cjs = require('./chunk-EAEDK474.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -33,7 +33,7 @@ var _chunkDBBSH7HPcjs = require('./chunk-DBBSH7HP.cjs');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunkR6U6BHCVcjs = require('./chunk-R6U6BHCV.cjs');
|
|
37
37
|
|
|
38
38
|
// src/WithdrawModal.tsx
|
|
39
39
|
|
|
@@ -121,8 +121,8 @@ function WithdrawFormStep({
|
|
|
121
121
|
const chainMismatch = Boolean(
|
|
122
122
|
_optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
|
|
123
123
|
);
|
|
124
|
-
const targetSymbol =
|
|
125
|
-
const targetChainName =
|
|
124
|
+
const targetSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
125
|
+
const targetChainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
126
126
|
const isBusy = submitting || isSubmitting;
|
|
127
127
|
const seededRecipientRef = _react.useRef.call(void 0, seededRecipient);
|
|
128
128
|
_react.useEffect.call(void 0, () => {
|
|
@@ -141,7 +141,7 @@ function WithdrawFormStep({
|
|
|
141
141
|
setIsSwitching(true);
|
|
142
142
|
switchChain(asset.chainId).catch((err) => {
|
|
143
143
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
144
|
-
setError(
|
|
144
|
+
setError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw));
|
|
145
145
|
}).finally(() => {
|
|
146
146
|
setIsSwitching(false);
|
|
147
147
|
});
|
|
@@ -161,7 +161,7 @@ function WithdrawFormStep({
|
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
164
|
-
const bal =
|
|
164
|
+
const bal = _chunkEAEDK474cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
165
165
|
address: asset.token,
|
|
166
166
|
abi: _viem.erc20Abi,
|
|
167
167
|
functionName: "balanceOf",
|
|
@@ -264,7 +264,7 @@ function WithdrawFormStep({
|
|
|
264
264
|
await onSubmit(recipient, amount);
|
|
265
265
|
} catch (err) {
|
|
266
266
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
267
|
-
setError(
|
|
267
|
+
setError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw));
|
|
268
268
|
} finally {
|
|
269
269
|
setIsSubmitting(false);
|
|
270
270
|
}
|
|
@@ -272,17 +272,17 @@ function WithdrawFormStep({
|
|
|
272
272
|
if (isBalanceLoading) {
|
|
273
273
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
274
274
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
|
|
275
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
275
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.Spinner, { className: "rs-spinner--lg" }),
|
|
276
276
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
277
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${
|
|
277
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
278
278
|
] }),
|
|
279
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
279
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
280
280
|
] });
|
|
281
281
|
}
|
|
282
282
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
283
283
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-form", children: [
|
|
284
284
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
285
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Recipient" }),
|
|
285
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Recipient address" }),
|
|
286
286
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
|
|
287
287
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
288
288
|
"input",
|
|
@@ -304,15 +304,18 @@ function WithdrawFormStep({
|
|
|
304
304
|
className: `rs-withdraw-use-connected ${isRecipientConnected ? "rs-withdraw-use-connected--active" : ""}`,
|
|
305
305
|
onClick: handleUseConnected,
|
|
306
306
|
title: isRecipientConnected ? "Using connected wallet" : "Use connected wallet",
|
|
307
|
-
children: walletIcon ? /* @__PURE__ */ _jsxruntime.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
307
|
+
children: walletIcon ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
308
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
309
|
+
"img",
|
|
310
|
+
{
|
|
311
|
+
src: walletIcon,
|
|
312
|
+
alt: "Wallet",
|
|
313
|
+
style: { width: 18, height: 18, borderRadius: 4 },
|
|
314
|
+
className: "rs-withdraw-use-connected-icon"
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
isRecipientConnected ? null : "Use connected"
|
|
318
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
316
319
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
317
320
|
"svg",
|
|
318
321
|
{
|
|
@@ -331,7 +334,7 @@ function WithdrawFormStep({
|
|
|
331
334
|
)
|
|
332
335
|
}
|
|
333
336
|
),
|
|
334
|
-
isRecipientConnected ? null : "
|
|
337
|
+
isRecipientConnected ? null : "Use connected"
|
|
335
338
|
] })
|
|
336
339
|
}
|
|
337
340
|
)
|
|
@@ -372,8 +375,9 @@ function WithdrawFormStep({
|
|
|
372
375
|
] })
|
|
373
376
|
] }),
|
|
374
377
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
375
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
378
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkEAEDK474cjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
376
379
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
380
|
+
"Balance: ",
|
|
377
381
|
formattedBalance,
|
|
378
382
|
" ",
|
|
379
383
|
asset.symbol
|
|
@@ -382,7 +386,7 @@ function WithdrawFormStep({
|
|
|
382
386
|
] }),
|
|
383
387
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-row", children: [
|
|
384
388
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-col", children: [
|
|
385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Receive" }),
|
|
389
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Receive token" }),
|
|
386
390
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
387
391
|
"div",
|
|
388
392
|
{
|
|
@@ -400,10 +404,10 @@ function WithdrawFormStep({
|
|
|
400
404
|
},
|
|
401
405
|
children: [
|
|
402
406
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
403
|
-
|
|
407
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
408
|
"img",
|
|
405
409
|
{
|
|
406
|
-
src:
|
|
410
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
407
411
|
alt: targetSymbol,
|
|
408
412
|
className: "rs-withdraw-dropdown-icon"
|
|
409
413
|
}
|
|
@@ -444,10 +448,10 @@ function WithdrawFormStep({
|
|
|
444
448
|
setShowTokenDropdown(false);
|
|
445
449
|
},
|
|
446
450
|
children: [
|
|
447
|
-
|
|
451
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
448
452
|
"img",
|
|
449
453
|
{
|
|
450
|
-
src:
|
|
454
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, option.symbol),
|
|
451
455
|
alt: option.symbol,
|
|
452
456
|
className: "rs-withdraw-dropdown-icon"
|
|
453
457
|
}
|
|
@@ -462,7 +466,7 @@ function WithdrawFormStep({
|
|
|
462
466
|
)
|
|
463
467
|
] }),
|
|
464
468
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-col", children: [
|
|
465
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "
|
|
469
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Receive chain" }),
|
|
466
470
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
467
471
|
"div",
|
|
468
472
|
{
|
|
@@ -480,10 +484,10 @@ function WithdrawFormStep({
|
|
|
480
484
|
},
|
|
481
485
|
children: [
|
|
482
486
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
483
|
-
|
|
487
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
484
488
|
"img",
|
|
485
489
|
{
|
|
486
|
-
src:
|
|
490
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain),
|
|
487
491
|
alt: targetChainName,
|
|
488
492
|
className: "rs-withdraw-dropdown-icon"
|
|
489
493
|
}
|
|
@@ -524,10 +528,10 @@ function WithdrawFormStep({
|
|
|
524
528
|
setShowChainDropdown(false);
|
|
525
529
|
},
|
|
526
530
|
children: [
|
|
527
|
-
|
|
531
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
528
532
|
"img",
|
|
529
533
|
{
|
|
530
|
-
src:
|
|
534
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, chain.id),
|
|
531
535
|
alt: chain.name,
|
|
532
536
|
className: "rs-withdraw-dropdown-icon"
|
|
533
537
|
}
|
|
@@ -542,7 +546,7 @@ function WithdrawFormStep({
|
|
|
542
546
|
)
|
|
543
547
|
] })
|
|
544
548
|
] }),
|
|
545
|
-
chainMismatch && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch-text", children: isSwitching ? `Switching to ${
|
|
549
|
+
chainMismatch && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch-text", children: isSwitching ? `Switching to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
546
550
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
|
|
547
551
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
548
552
|
"svg",
|
|
@@ -565,16 +569,16 @@ function WithdrawFormStep({
|
|
|
565
569
|
] })
|
|
566
570
|
] }),
|
|
567
571
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
568
|
-
|
|
572
|
+
_chunkEAEDK474cjs.Button,
|
|
569
573
|
{
|
|
570
574
|
onClick: handleWithdraw,
|
|
571
575
|
fullWidth: true,
|
|
572
576
|
loading: isBusy,
|
|
573
577
|
disabled: !recipient || !amount || chainMismatch || isBusy,
|
|
574
|
-
children: isBusy ? "Preparing..." : "Withdraw"
|
|
578
|
+
children: isBusy ? "Preparing..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
|
|
575
579
|
}
|
|
576
580
|
) }),
|
|
577
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
578
582
|
] });
|
|
579
583
|
}
|
|
580
584
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -657,7 +661,7 @@ async function executeSafeEthTransfer(params) {
|
|
|
657
661
|
throw new Error("Wallet not connected");
|
|
658
662
|
}
|
|
659
663
|
if (chain.id !== chainId) {
|
|
660
|
-
throw new Error(`Switch to ${
|
|
664
|
+
throw new Error(`Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, chainId)} to sign`);
|
|
661
665
|
}
|
|
662
666
|
const isOwner = await publicClient.readContract({
|
|
663
667
|
address: safeAddress,
|
|
@@ -740,7 +744,7 @@ async function executeSafeErc20Transfer(params) {
|
|
|
740
744
|
throw new Error("Wallet not connected");
|
|
741
745
|
}
|
|
742
746
|
if (chain.id !== chainId) {
|
|
743
|
-
throw new Error(`Switch to ${
|
|
747
|
+
throw new Error(`Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, chainId)} to sign`);
|
|
744
748
|
}
|
|
745
749
|
const isOwner = await publicClient.readContract({
|
|
746
750
|
address: safeAddress,
|
|
@@ -879,7 +883,7 @@ function WithdrawFlow({
|
|
|
879
883
|
recipient: defaultRecipient,
|
|
880
884
|
amount: defaultAmount,
|
|
881
885
|
service,
|
|
882
|
-
signerAddress =
|
|
886
|
+
signerAddress = _chunkR6U6BHCVcjs.DEFAULT_SIGNER_ADDRESS,
|
|
883
887
|
sessionChainIds,
|
|
884
888
|
forceRegister = false,
|
|
885
889
|
waitForFinalTx = true,
|
|
@@ -905,13 +909,13 @@ function WithdrawFlow({
|
|
|
905
909
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
|
|
906
910
|
const logFlow = _react.useCallback.call(void 0,
|
|
907
911
|
(message, data) => {
|
|
908
|
-
|
|
912
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
909
913
|
},
|
|
910
914
|
[debug]
|
|
911
915
|
);
|
|
912
916
|
const logFlowError = _react.useCallback.call(void 0,
|
|
913
917
|
(message, error, data) => {
|
|
914
|
-
|
|
918
|
+
_chunkEAEDK474cjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
915
919
|
},
|
|
916
920
|
[debug]
|
|
917
921
|
);
|
|
@@ -970,14 +974,14 @@ function WithdrawFlow({
|
|
|
970
974
|
return {
|
|
971
975
|
ownerAddress: dappAddress,
|
|
972
976
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
973
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
977
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain))),
|
|
974
978
|
switchChain: dappSwitchChain
|
|
975
979
|
};
|
|
976
980
|
}
|
|
977
981
|
return {
|
|
978
982
|
ownerAddress: dappWalletClient.account.address,
|
|
979
983
|
walletClient: dappWalletClient,
|
|
980
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
984
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain))),
|
|
981
985
|
switchChain: dappSwitchChain
|
|
982
986
|
};
|
|
983
987
|
}
|
|
@@ -988,7 +992,7 @@ function WithdrawFlow({
|
|
|
988
992
|
return {
|
|
989
993
|
ownerAddress: dappWalletClient.account.address,
|
|
990
994
|
walletClient: dappWalletClient,
|
|
991
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
995
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain))),
|
|
992
996
|
switchChain: dappSwitchChain
|
|
993
997
|
};
|
|
994
998
|
}
|
|
@@ -1015,10 +1019,10 @@ function WithdrawFlow({
|
|
|
1015
1019
|
sourceChain
|
|
1016
1020
|
]);
|
|
1017
1021
|
const asset = _react.useMemo.call(void 0, () => {
|
|
1018
|
-
const symbol =
|
|
1019
|
-
const decimals =
|
|
1022
|
+
const symbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1023
|
+
const decimals = _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1020
1024
|
return {
|
|
1021
|
-
id:
|
|
1025
|
+
id: _chunkEAEDK474cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1022
1026
|
chainId: sourceChain,
|
|
1023
1027
|
token: sourceToken,
|
|
1024
1028
|
symbol,
|
|
@@ -1026,7 +1030,7 @@ function WithdrawFlow({
|
|
|
1026
1030
|
decimals
|
|
1027
1031
|
};
|
|
1028
1032
|
}, [sourceChain, sourceToken]);
|
|
1029
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
1033
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
1030
1034
|
const stepIndex = step.type === "form" ? 0 : 1;
|
|
1031
1035
|
const currentBackHandler = void 0;
|
|
1032
1036
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1068,15 +1072,15 @@ function WithdrawFlow({
|
|
|
1068
1072
|
[logFlowError, onError]
|
|
1069
1073
|
);
|
|
1070
1074
|
const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
|
|
1071
|
-
const localOwner =
|
|
1075
|
+
const localOwner = _chunkEAEDK474cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1072
1076
|
if (localOwner) {
|
|
1073
1077
|
return {
|
|
1074
|
-
account:
|
|
1078
|
+
account: _chunkEAEDK474cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1075
1079
|
address: localOwner.address
|
|
1076
1080
|
};
|
|
1077
1081
|
}
|
|
1078
|
-
const created =
|
|
1079
|
-
|
|
1082
|
+
const created = _chunkEAEDK474cjs.createSessionOwnerKey.call(void 0, );
|
|
1083
|
+
_chunkEAEDK474cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1080
1084
|
return {
|
|
1081
1085
|
account: created.account,
|
|
1082
1086
|
address: created.address
|
|
@@ -1106,7 +1110,7 @@ function WithdrawFlow({
|
|
|
1106
1110
|
const setup = await service.setupAccount({
|
|
1107
1111
|
ownerAddress: ownerAddress2,
|
|
1108
1112
|
sessionOwnerAddress: sessionOwner.address,
|
|
1109
|
-
targetChain:
|
|
1113
|
+
targetChain: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, targetChain),
|
|
1110
1114
|
targetToken,
|
|
1111
1115
|
signerAddress,
|
|
1112
1116
|
sessionChainIds,
|
|
@@ -1133,7 +1137,7 @@ function WithdrawFlow({
|
|
|
1133
1137
|
primaryType: typedData.primaryType,
|
|
1134
1138
|
message: typedData.message
|
|
1135
1139
|
});
|
|
1136
|
-
const sessionDetails =
|
|
1140
|
+
const sessionDetails = _chunkEAEDK474cjs.buildSessionDetails.call(void 0,
|
|
1137
1141
|
setup.sessionDetailsUnsigned,
|
|
1138
1142
|
signature
|
|
1139
1143
|
);
|
|
@@ -1147,7 +1151,7 @@ function WithdrawFlow({
|
|
|
1147
1151
|
eoaAddress: ownerAddress2,
|
|
1148
1152
|
sessionOwner: sessionOwner.address,
|
|
1149
1153
|
target: {
|
|
1150
|
-
chain:
|
|
1154
|
+
chain: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, targetChain),
|
|
1151
1155
|
token: targetToken,
|
|
1152
1156
|
recipient
|
|
1153
1157
|
}
|
|
@@ -1156,7 +1160,7 @@ function WithdrawFlow({
|
|
|
1156
1160
|
}
|
|
1157
1161
|
handleConnected(ownerAddress2, smartAccount);
|
|
1158
1162
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1159
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _26 => _26.publicClient]), () => (
|
|
1163
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _26 => _26.publicClient]), () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain)));
|
|
1160
1164
|
let result;
|
|
1161
1165
|
if (onSignTransaction) {
|
|
1162
1166
|
const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
|
|
@@ -1179,7 +1183,7 @@ function WithdrawFlow({
|
|
|
1179
1183
|
const { signature } = await onSignTransaction(request);
|
|
1180
1184
|
const relayResult = await service.relayWithdraw({
|
|
1181
1185
|
smartAccount,
|
|
1182
|
-
chainId:
|
|
1186
|
+
chainId: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1183
1187
|
safeAddress,
|
|
1184
1188
|
safeTransaction: request.typedData.message,
|
|
1185
1189
|
signature
|
|
@@ -1237,7 +1241,7 @@ function WithdrawFlow({
|
|
|
1237
1241
|
targetChain,
|
|
1238
1242
|
targetToken
|
|
1239
1243
|
});
|
|
1240
|
-
handleError(
|
|
1244
|
+
handleError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1241
1245
|
throw err;
|
|
1242
1246
|
} finally {
|
|
1243
1247
|
setIsSubmitting(false);
|
|
@@ -1288,12 +1292,12 @@ function WithdrawFlow({
|
|
|
1288
1292
|
[logFlowError, onWithdrawFailed]
|
|
1289
1293
|
);
|
|
1290
1294
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1291
|
-
return
|
|
1292
|
-
(chain) =>
|
|
1295
|
+
return _chunkR6U6BHCVcjs.SOURCE_CHAINS.filter(
|
|
1296
|
+
(chain) => _chunkR6U6BHCVcjs.getSupportedTargetTokens.call(void 0, chain.id).length > 0
|
|
1293
1297
|
);
|
|
1294
1298
|
}, []);
|
|
1295
1299
|
const targetTokenOptions = _react.useMemo.call(void 0,
|
|
1296
|
-
() =>
|
|
1300
|
+
() => _chunkR6U6BHCVcjs.getSupportedTargetTokens.call(void 0, targetChain),
|
|
1297
1301
|
[targetChain]
|
|
1298
1302
|
);
|
|
1299
1303
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1308,7 +1312,7 @@ function WithdrawFlow({
|
|
|
1308
1312
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1309
1313
|
(chainId) => {
|
|
1310
1314
|
setTargetChain(chainId);
|
|
1311
|
-
const options =
|
|
1315
|
+
const options = _chunkR6U6BHCVcjs.getSupportedTargetTokens.call(void 0, chainId);
|
|
1312
1316
|
if (options.length === 0) {
|
|
1313
1317
|
return;
|
|
1314
1318
|
}
|
|
@@ -1355,7 +1359,7 @@ function WithdrawFlow({
|
|
|
1355
1359
|
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _37 => _37.icon])]);
|
|
1356
1360
|
if (showConnectStep) {
|
|
1357
1361
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1358
|
-
|
|
1362
|
+
_chunkEAEDK474cjs.ConnectStep,
|
|
1359
1363
|
{
|
|
1360
1364
|
walletOptions,
|
|
1361
1365
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -1378,7 +1382,7 @@ function WithdrawFlow({
|
|
|
1378
1382
|
const resolvedOwnerAddress = signerContext.ownerAddress;
|
|
1379
1383
|
const resolvedConnectedAddress = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _38 => _38.walletClient, 'optionalAccess', _39 => _39.account, 'optionalAccess', _40 => _40.address]), () => ( _optionalChain([reownWallet, 'optionalAccess', _41 => _41.address]))), () => ( _optionalChain([dappWalletClient, 'optionalAccess', _42 => _42.account, 'optionalAccess', _43 => _43.address]))), () => ( resolvedOwnerAddress));
|
|
1380
1384
|
const resolvedDefaultRecipient = _nullishCoalesce(defaultRecipient, () => ( resolvedConnectedAddress));
|
|
1381
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1385
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, sourceChain)));
|
|
1382
1386
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1383
1387
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1384
1388
|
WithdrawFormStep,
|
|
@@ -1405,7 +1409,7 @@ function WithdrawFlow({
|
|
|
1405
1409
|
}
|
|
1406
1410
|
),
|
|
1407
1411
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1408
|
-
|
|
1412
|
+
_chunkEAEDK474cjs.ProcessingStep,
|
|
1409
1413
|
{
|
|
1410
1414
|
smartAccount: step.smartAccount,
|
|
1411
1415
|
txHash: step.txHash,
|
|
@@ -1431,7 +1435,7 @@ function WithdrawFlow({
|
|
|
1431
1435
|
// src/WithdrawModal.tsx
|
|
1432
1436
|
|
|
1433
1437
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1434
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1438
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-ZQCNJLSP.cjs"))).then((m) => ({
|
|
1435
1439
|
default: m.WithdrawModalReown
|
|
1436
1440
|
}))
|
|
1437
1441
|
);
|
|
@@ -1457,8 +1461,9 @@ function WithdrawModalInner({
|
|
|
1457
1461
|
isOpen,
|
|
1458
1462
|
onClose,
|
|
1459
1463
|
inline,
|
|
1460
|
-
|
|
1461
|
-
|
|
1464
|
+
closeOnOverlayClick,
|
|
1465
|
+
backendUrl = _chunkR6U6BHCVcjs.DEFAULT_BACKEND_URL,
|
|
1466
|
+
signerAddress = _chunkR6U6BHCVcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1462
1467
|
sessionChainIds,
|
|
1463
1468
|
forceRegister = false,
|
|
1464
1469
|
waitForFinalTx = true,
|
|
@@ -1484,15 +1489,15 @@ function WithdrawModalInner({
|
|
|
1484
1489
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
1485
1490
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
1486
1491
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
1487
|
-
const targetChain =
|
|
1488
|
-
const sourceChain =
|
|
1492
|
+
const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
|
|
1493
|
+
const sourceChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp);
|
|
1489
1494
|
const service = _react.useMemo.call(void 0,
|
|
1490
|
-
() =>
|
|
1495
|
+
() => _chunkEAEDK474cjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1491
1496
|
[backendUrl, debug]
|
|
1492
1497
|
);
|
|
1493
1498
|
_react.useEffect.call(void 0, () => {
|
|
1494
1499
|
if (isOpen && modalRef.current) {
|
|
1495
|
-
|
|
1500
|
+
_chunkEAEDK474cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1496
1501
|
}
|
|
1497
1502
|
}, [isOpen, theme]);
|
|
1498
1503
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -1528,12 +1533,13 @@ function WithdrawModalInner({
|
|
|
1528
1533
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _52 => _52.title]), () => ( "Withdraw"));
|
|
1529
1534
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1530
1535
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1531
|
-
|
|
1536
|
+
_chunkEAEDK474cjs.Modal,
|
|
1532
1537
|
{
|
|
1533
1538
|
isOpen,
|
|
1534
1539
|
onClose,
|
|
1535
1540
|
className,
|
|
1536
1541
|
inline,
|
|
1542
|
+
closeOnOverlayClick,
|
|
1537
1543
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: modalRef, className: "rs-modal", children: [
|
|
1538
1544
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header--redesigned", children: [
|
|
1539
1545
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1586,7 +1592,7 @@ function WithdrawModalInner({
|
|
|
1586
1592
|
] }),
|
|
1587
1593
|
balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
1588
1594
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balance.title }),
|
|
1589
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
1595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkEAEDK474cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
1590
1596
|
] })
|
|
1591
1597
|
] }),
|
|
1592
1598
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getTokenDecimalsByAddress,
|
|
9
9
|
getTokenIcon,
|
|
10
10
|
getTokenSymbol
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CIXHTOO3.mjs";
|
|
12
12
|
|
|
13
13
|
// src/components/ui/Modal.tsx
|
|
14
14
|
import {
|
|
@@ -31,7 +31,8 @@ function Modal({
|
|
|
31
31
|
onClose,
|
|
32
32
|
children,
|
|
33
33
|
className = "",
|
|
34
|
-
inline = false
|
|
34
|
+
inline = false,
|
|
35
|
+
closeOnOverlayClick = false
|
|
35
36
|
}) {
|
|
36
37
|
const overlayRef = useRef(null);
|
|
37
38
|
const contentRef = useRef(null);
|
|
@@ -95,11 +96,11 @@ function Modal({
|
|
|
95
96
|
);
|
|
96
97
|
const handleOverlayClick = useCallback(
|
|
97
98
|
(event) => {
|
|
98
|
-
if (event.target === overlayRef.current) {
|
|
99
|
+
if (closeOnOverlayClick && event.target === overlayRef.current) {
|
|
99
100
|
onClose();
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
|
-
[onClose]
|
|
103
|
+
[closeOnOverlayClick, onClose]
|
|
103
104
|
);
|
|
104
105
|
if (!isOpen) return null;
|
|
105
106
|
if (inline) {
|
|
@@ -766,21 +767,46 @@ function formatUserError(raw) {
|
|
|
766
767
|
if (lower.includes("execution reverted")) {
|
|
767
768
|
return "Transaction would fail on-chain";
|
|
768
769
|
}
|
|
770
|
+
if (lower.includes("timed out") || lower.includes("took too long")) {
|
|
771
|
+
return "Request timed out \u2014 please try again";
|
|
772
|
+
}
|
|
773
|
+
if (lower.includes("econnrefused") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("fetch failed")) {
|
|
774
|
+
return "Service unavailable \u2014 please try again";
|
|
775
|
+
}
|
|
769
776
|
if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
|
|
770
777
|
return "Solana RPC unavailable \u2014 please retry";
|
|
771
778
|
}
|
|
772
779
|
if (lower.includes("network") || lower.includes("disconnected")) {
|
|
773
780
|
return "Network error \u2014 check your connection";
|
|
774
781
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
782
|
+
if (lower.includes("rate limit") || lower.includes("429")) {
|
|
783
|
+
return "Rate limited \u2014 please try again shortly";
|
|
784
|
+
}
|
|
785
|
+
let cleaned = raw;
|
|
786
|
+
const stripMarkers = [
|
|
787
|
+
"\n\nRequest Arguments:",
|
|
788
|
+
"\nRaw Call Arguments:",
|
|
789
|
+
"\nRequest body:",
|
|
790
|
+
"\nContract Call:",
|
|
791
|
+
"\nDocs:",
|
|
792
|
+
"\nDetails:",
|
|
793
|
+
"\nVersion:",
|
|
794
|
+
"\nURL:"
|
|
795
|
+
];
|
|
796
|
+
for (const marker of stripMarkers) {
|
|
797
|
+
const idx = cleaned.indexOf(marker);
|
|
798
|
+
if (idx !== -1) {
|
|
799
|
+
cleaned = cleaned.slice(0, idx).trim();
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
cleaned = cleaned.replace(/https?:\/\/\S+/g, "").trim();
|
|
803
|
+
if (cleaned.length === 0) {
|
|
804
|
+
return "An unexpected error occurred";
|
|
779
805
|
}
|
|
780
|
-
if (
|
|
781
|
-
return
|
|
806
|
+
if (cleaned.length > 120) {
|
|
807
|
+
return cleaned.slice(0, 120) + "...";
|
|
782
808
|
}
|
|
783
|
-
return
|
|
809
|
+
return cleaned;
|
|
784
810
|
}
|
|
785
811
|
|
|
786
812
|
// src/core/theme.ts
|