@rhinestone/deposit-modal 0.2.3 → 0.2.5-alpha.0
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-SJHEU6RQ.mjs → DepositModalReown-GIODYNOK.mjs} +5 -3
- package/dist/{DepositModalReown-QPJ5TT57.cjs → DepositModalReown-SVVA3OZ6.cjs} +6 -4
- package/dist/{WithdrawModalReown-RUJZCQ4C.mjs → WithdrawModalReown-HTEB4XGU.mjs} +4 -3
- package/dist/{WithdrawModalReown-KGKKBTC7.cjs → WithdrawModalReown-VNTKGALT.cjs} +5 -4
- package/dist/{chunk-5EU7N73M.cjs → chunk-4S262VLP.cjs} +83 -367
- package/dist/{chunk-TYJEZX6S.cjs → chunk-AHQY2O3U.cjs} +595 -323
- package/dist/{chunk-JRNGXHWQ.mjs → chunk-DUGDAMAF.mjs} +135 -133
- package/dist/chunk-J2SWZSXL.mjs +295 -0
- package/dist/{chunk-T2KOQH57.cjs → chunk-KE6CJVOV.cjs} +109 -107
- package/dist/chunk-LHOHM67Z.mjs +234 -0
- package/dist/{chunk-MUWVDVY4.cjs → chunk-R2HP743T.cjs} +14 -1
- package/dist/{chunk-DGT2DZXN.mjs → chunk-RQ2VCKLS.mjs} +452 -180
- package/dist/{chunk-MKO5TNVQ.mjs → chunk-WA4RA4HB.mjs} +15 -299
- package/dist/{chunk-SDZKKUCJ.mjs → chunk-WHW3ZMOT.mjs} +14 -1
- package/dist/chunk-YKGL66EF.cjs +295 -0
- package/dist/chunk-ZHLQMSQM.cjs +234 -0
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -4
- package/dist/deposit.d.cts +3 -3
- package/dist/deposit.d.ts +3 -3
- package/dist/deposit.mjs +5 -3
- package/dist/index.cjs +7 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +6 -4
- package/dist/reown.cjs +7 -5
- package/dist/reown.d.cts +2 -2
- package/dist/reown.d.ts +2 -2
- package/dist/reown.mjs +6 -4
- package/dist/safe-CB7TvRCc.d.cts +62 -0
- package/dist/safe-CB7TvRCc.d.ts +62 -0
- package/dist/safe.cjs +22 -1
- package/dist/safe.d.cts +11 -59
- package/dist/safe.d.ts +11 -59
- package/dist/safe.mjs +22 -0
- package/dist/{types-DGQzvl6v.d.ts → types-CeFbJ-MW.d.ts} +8 -1
- package/dist/{types-DJ1fzNC7.d.cts → types-D0NawmZ8.d.cts} +8 -1
- package/dist/withdraw.cjs +5 -4
- package/dist/withdraw.d.cts +3 -3
- package/dist/withdraw.d.ts +3 -3
- package/dist/withdraw.mjs +4 -3
- package/package.json +1 -1
|
@@ -21,11 +21,12 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkKE6CJVOVcjs = require('./chunk-KE6CJVOV.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
var _chunkYKGL66EFcjs = require('./chunk-YKGL66EF.cjs');
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
@@ -34,7 +35,11 @@ var _chunkT2KOQH57cjs = require('./chunk-T2KOQH57.cjs');
|
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var _chunkR2HP743Tcjs = require('./chunk-R2HP743T.cjs');
|
|
38
43
|
|
|
39
44
|
// src/WithdrawModal.tsx
|
|
40
45
|
|
|
@@ -107,8 +112,8 @@ function WithdrawFormStep({
|
|
|
107
112
|
const chainMismatch = Boolean(
|
|
108
113
|
_optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
|
|
109
114
|
);
|
|
110
|
-
const targetSymbol =
|
|
111
|
-
const targetChainName =
|
|
115
|
+
const targetSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
116
|
+
const targetChainName = _chunkR2HP743Tcjs.getChainName.call(void 0, targetChain);
|
|
112
117
|
const isBusy = submitting || isSubmitting;
|
|
113
118
|
const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
114
119
|
_react.useEffect.call(void 0, () => {
|
|
@@ -127,7 +132,7 @@ function WithdrawFormStep({
|
|
|
127
132
|
setIsSwitching(true);
|
|
128
133
|
switchChain(asset.chainId).catch((err) => {
|
|
129
134
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
130
|
-
setError(
|
|
135
|
+
setError(_chunkKE6CJVOVcjs.formatUserError.call(void 0, raw));
|
|
131
136
|
}).finally(() => {
|
|
132
137
|
setIsSwitching(false);
|
|
133
138
|
});
|
|
@@ -147,7 +152,7 @@ function WithdrawFormStep({
|
|
|
147
152
|
return;
|
|
148
153
|
}
|
|
149
154
|
try {
|
|
150
|
-
const bal =
|
|
155
|
+
const bal = _chunkKE6CJVOVcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
151
156
|
address: asset.token,
|
|
152
157
|
abi: _viem.erc20Abi,
|
|
153
158
|
functionName: "balanceOf",
|
|
@@ -250,7 +255,7 @@ function WithdrawFormStep({
|
|
|
250
255
|
await onSubmit(recipient, amount);
|
|
251
256
|
} catch (err) {
|
|
252
257
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
253
|
-
setError(
|
|
258
|
+
setError(_chunkKE6CJVOVcjs.formatUserError.call(void 0, raw));
|
|
254
259
|
} finally {
|
|
255
260
|
setIsSubmitting(false);
|
|
256
261
|
}
|
|
@@ -258,11 +263,11 @@ function WithdrawFormStep({
|
|
|
258
263
|
if (isBalanceLoading) {
|
|
259
264
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
260
265
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
|
|
261
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKE6CJVOVcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
262
267
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
263
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${
|
|
268
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
264
269
|
] }),
|
|
265
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
270
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKE6CJVOVcjs.PoweredBy, {})
|
|
266
271
|
] });
|
|
267
272
|
}
|
|
268
273
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
@@ -361,7 +366,7 @@ function WithdrawFormStep({
|
|
|
361
366
|
] })
|
|
362
367
|
] }),
|
|
363
368
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
364
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
369
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkKE6CJVOVcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
365
370
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
366
371
|
"Balance: ",
|
|
367
372
|
formattedBalance,
|
|
@@ -390,10 +395,10 @@ function WithdrawFormStep({
|
|
|
390
395
|
},
|
|
391
396
|
children: [
|
|
392
397
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
393
|
-
|
|
398
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
394
399
|
"img",
|
|
395
400
|
{
|
|
396
|
-
src:
|
|
401
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
397
402
|
alt: targetSymbol,
|
|
398
403
|
className: "rs-withdraw-dropdown-icon"
|
|
399
404
|
}
|
|
@@ -434,10 +439,10 @@ function WithdrawFormStep({
|
|
|
434
439
|
setShowTokenDropdown(false);
|
|
435
440
|
},
|
|
436
441
|
children: [
|
|
437
|
-
|
|
442
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
438
443
|
"img",
|
|
439
444
|
{
|
|
440
|
-
src:
|
|
445
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, option.symbol),
|
|
441
446
|
alt: option.symbol,
|
|
442
447
|
className: "rs-withdraw-dropdown-icon"
|
|
443
448
|
}
|
|
@@ -470,10 +475,10 @@ function WithdrawFormStep({
|
|
|
470
475
|
},
|
|
471
476
|
children: [
|
|
472
477
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
473
|
-
|
|
478
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
474
479
|
"img",
|
|
475
480
|
{
|
|
476
|
-
src:
|
|
481
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain),
|
|
477
482
|
alt: targetChainName,
|
|
478
483
|
className: "rs-withdraw-dropdown-icon"
|
|
479
484
|
}
|
|
@@ -514,10 +519,10 @@ function WithdrawFormStep({
|
|
|
514
519
|
setShowChainDropdown(false);
|
|
515
520
|
},
|
|
516
521
|
children: [
|
|
517
|
-
|
|
522
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
518
523
|
"img",
|
|
519
524
|
{
|
|
520
|
-
src:
|
|
525
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, chain.id),
|
|
521
526
|
alt: chain.name,
|
|
522
527
|
className: "rs-withdraw-dropdown-icon"
|
|
523
528
|
}
|
|
@@ -532,7 +537,7 @@ function WithdrawFormStep({
|
|
|
532
537
|
)
|
|
533
538
|
] })
|
|
534
539
|
] }),
|
|
535
|
-
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 ${
|
|
540
|
+
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 ${_chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
536
541
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
|
|
537
542
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
538
543
|
"svg",
|
|
@@ -555,7 +560,7 @@ function WithdrawFormStep({
|
|
|
555
560
|
] })
|
|
556
561
|
] }),
|
|
557
562
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
558
|
-
|
|
563
|
+
_chunkKE6CJVOVcjs.Button,
|
|
559
564
|
{
|
|
560
565
|
onClick: handleWithdraw,
|
|
561
566
|
fullWidth: true,
|
|
@@ -564,296 +569,11 @@ function WithdrawFormStep({
|
|
|
564
569
|
children: isBusy ? "Preparing..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
|
|
565
570
|
}
|
|
566
571
|
) }),
|
|
567
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
572
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKE6CJVOVcjs.PoweredBy, {})
|
|
568
573
|
] });
|
|
569
574
|
}
|
|
570
575
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
571
576
|
|
|
572
|
-
// src/core/safe.ts
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
var SAFE_ABI = [
|
|
584
|
-
{
|
|
585
|
-
type: "function",
|
|
586
|
-
name: "isOwner",
|
|
587
|
-
stateMutability: "view",
|
|
588
|
-
inputs: [{ name: "owner", type: "address" }],
|
|
589
|
-
outputs: [{ name: "", type: "bool" }]
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
type: "function",
|
|
593
|
-
name: "nonce",
|
|
594
|
-
stateMutability: "view",
|
|
595
|
-
inputs: [],
|
|
596
|
-
outputs: [{ type: "uint256" }]
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
type: "function",
|
|
600
|
-
name: "execTransaction",
|
|
601
|
-
stateMutability: "payable",
|
|
602
|
-
inputs: [
|
|
603
|
-
{ name: "to", type: "address" },
|
|
604
|
-
{ name: "value", type: "uint256" },
|
|
605
|
-
{ name: "data", type: "bytes" },
|
|
606
|
-
{ name: "operation", type: "uint8" },
|
|
607
|
-
{ name: "safeTxGas", type: "uint256" },
|
|
608
|
-
{ name: "baseGas", type: "uint256" },
|
|
609
|
-
{ name: "gasPrice", type: "uint256" },
|
|
610
|
-
{ name: "gasToken", type: "address" },
|
|
611
|
-
{ name: "refundReceiver", type: "address" },
|
|
612
|
-
{ name: "signatures", type: "bytes" }
|
|
613
|
-
],
|
|
614
|
-
outputs: [{ name: "success", type: "bool" }]
|
|
615
|
-
},
|
|
616
|
-
{
|
|
617
|
-
type: "event",
|
|
618
|
-
name: "ExecutionSuccess",
|
|
619
|
-
inputs: [
|
|
620
|
-
{ name: "txHash", type: "bytes32", indexed: true },
|
|
621
|
-
{ name: "payment", type: "uint256", indexed: false }
|
|
622
|
-
],
|
|
623
|
-
anonymous: false
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
type: "event",
|
|
627
|
-
name: "ExecutionFailure",
|
|
628
|
-
inputs: [
|
|
629
|
-
{ name: "txHash", type: "bytes32", indexed: true },
|
|
630
|
-
{ name: "payment", type: "uint256", indexed: false }
|
|
631
|
-
],
|
|
632
|
-
anonymous: false
|
|
633
|
-
}
|
|
634
|
-
];
|
|
635
|
-
async function executeSafeEthTransfer(params) {
|
|
636
|
-
const {
|
|
637
|
-
walletClient,
|
|
638
|
-
publicClient,
|
|
639
|
-
safeAddress,
|
|
640
|
-
recipient,
|
|
641
|
-
amount,
|
|
642
|
-
chainId
|
|
643
|
-
} = params;
|
|
644
|
-
const account = walletClient.account;
|
|
645
|
-
const chain = walletClient.chain;
|
|
646
|
-
if (!account || !chain) {
|
|
647
|
-
throw new Error("Wallet not connected");
|
|
648
|
-
}
|
|
649
|
-
if (chain.id !== chainId) {
|
|
650
|
-
throw new Error(`Switch to ${_chunkMUWVDVY4cjs.getChainName.call(void 0, chainId)} to sign`);
|
|
651
|
-
}
|
|
652
|
-
const isOwner = await publicClient.readContract({
|
|
653
|
-
address: safeAddress,
|
|
654
|
-
abi: SAFE_ABI,
|
|
655
|
-
functionName: "isOwner",
|
|
656
|
-
args: [account.address]
|
|
657
|
-
});
|
|
658
|
-
if (!isOwner) {
|
|
659
|
-
throw new Error("Connected wallet is not a Safe owner");
|
|
660
|
-
}
|
|
661
|
-
const safeTx = {
|
|
662
|
-
to: recipient,
|
|
663
|
-
value: amount,
|
|
664
|
-
data: "0x",
|
|
665
|
-
operation: 0,
|
|
666
|
-
safeTxGas: 0n,
|
|
667
|
-
baseGas: 0n,
|
|
668
|
-
gasPrice: 0n,
|
|
669
|
-
gasToken: _viem.zeroAddress,
|
|
670
|
-
refundReceiver: _viem.zeroAddress
|
|
671
|
-
};
|
|
672
|
-
const signature = _viem.concat.call(void 0, [
|
|
673
|
-
_viem.pad.call(void 0, account.address, { size: 32 }),
|
|
674
|
-
_viem.pad.call(void 0, _viem.toHex.call(void 0, 0), { size: 32 }),
|
|
675
|
-
_viem.toHex.call(void 0, 1, { size: 1 })
|
|
676
|
-
]);
|
|
677
|
-
const txHash = await walletClient.writeContract({
|
|
678
|
-
account,
|
|
679
|
-
chain,
|
|
680
|
-
address: safeAddress,
|
|
681
|
-
abi: SAFE_ABI,
|
|
682
|
-
functionName: "execTransaction",
|
|
683
|
-
args: [
|
|
684
|
-
safeTx.to,
|
|
685
|
-
safeTx.value,
|
|
686
|
-
safeTx.data,
|
|
687
|
-
safeTx.operation,
|
|
688
|
-
safeTx.safeTxGas,
|
|
689
|
-
safeTx.baseGas,
|
|
690
|
-
safeTx.gasPrice,
|
|
691
|
-
safeTx.gasToken,
|
|
692
|
-
safeTx.refundReceiver,
|
|
693
|
-
signature
|
|
694
|
-
]
|
|
695
|
-
});
|
|
696
|
-
const receipt = await publicClient.waitForTransactionReceipt({
|
|
697
|
-
hash: txHash
|
|
698
|
-
});
|
|
699
|
-
const safeLogs = receipt.logs.filter(
|
|
700
|
-
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
701
|
-
);
|
|
702
|
-
const parsed = _viem.parseEventLogs.call(void 0, {
|
|
703
|
-
abi: SAFE_ABI,
|
|
704
|
-
logs: safeLogs,
|
|
705
|
-
strict: false
|
|
706
|
-
});
|
|
707
|
-
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
708
|
-
if (failed) {
|
|
709
|
-
throw new Error("Safe transaction failed");
|
|
710
|
-
}
|
|
711
|
-
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
712
|
-
if (!succeeded) {
|
|
713
|
-
throw new Error("Safe transaction status unavailable");
|
|
714
|
-
}
|
|
715
|
-
return { txHash };
|
|
716
|
-
}
|
|
717
|
-
async function executeSafeErc20Transfer(params) {
|
|
718
|
-
const {
|
|
719
|
-
walletClient,
|
|
720
|
-
publicClient,
|
|
721
|
-
safeAddress,
|
|
722
|
-
tokenAddress,
|
|
723
|
-
recipient,
|
|
724
|
-
amount,
|
|
725
|
-
chainId
|
|
726
|
-
} = params;
|
|
727
|
-
const account = walletClient.account;
|
|
728
|
-
const chain = walletClient.chain;
|
|
729
|
-
if (!account || !chain) {
|
|
730
|
-
throw new Error("Wallet not connected");
|
|
731
|
-
}
|
|
732
|
-
if (chain.id !== chainId) {
|
|
733
|
-
throw new Error(`Switch to ${_chunkMUWVDVY4cjs.getChainName.call(void 0, chainId)} to sign`);
|
|
734
|
-
}
|
|
735
|
-
const isOwner = await publicClient.readContract({
|
|
736
|
-
address: safeAddress,
|
|
737
|
-
abi: SAFE_ABI,
|
|
738
|
-
functionName: "isOwner",
|
|
739
|
-
args: [account.address]
|
|
740
|
-
});
|
|
741
|
-
if (!isOwner) {
|
|
742
|
-
throw new Error("Connected wallet is not a Safe owner");
|
|
743
|
-
}
|
|
744
|
-
const data = _viem.encodeFunctionData.call(void 0, {
|
|
745
|
-
abi: _viem.erc20Abi,
|
|
746
|
-
functionName: "transfer",
|
|
747
|
-
args: [recipient, amount]
|
|
748
|
-
});
|
|
749
|
-
const safeTx = {
|
|
750
|
-
to: tokenAddress,
|
|
751
|
-
value: 0n,
|
|
752
|
-
data,
|
|
753
|
-
operation: 0,
|
|
754
|
-
safeTxGas: 0n,
|
|
755
|
-
baseGas: 0n,
|
|
756
|
-
gasPrice: 0n,
|
|
757
|
-
gasToken: _viem.zeroAddress,
|
|
758
|
-
refundReceiver: _viem.zeroAddress
|
|
759
|
-
};
|
|
760
|
-
const signature = _viem.concat.call(void 0, [
|
|
761
|
-
_viem.pad.call(void 0, account.address, { size: 32 }),
|
|
762
|
-
_viem.pad.call(void 0, _viem.toHex.call(void 0, 0), { size: 32 }),
|
|
763
|
-
_viem.toHex.call(void 0, 1, { size: 1 })
|
|
764
|
-
]);
|
|
765
|
-
const txHash = await walletClient.writeContract({
|
|
766
|
-
account,
|
|
767
|
-
chain,
|
|
768
|
-
address: safeAddress,
|
|
769
|
-
abi: SAFE_ABI,
|
|
770
|
-
functionName: "execTransaction",
|
|
771
|
-
args: [
|
|
772
|
-
safeTx.to,
|
|
773
|
-
safeTx.value,
|
|
774
|
-
safeTx.data,
|
|
775
|
-
safeTx.operation,
|
|
776
|
-
safeTx.safeTxGas,
|
|
777
|
-
safeTx.baseGas,
|
|
778
|
-
safeTx.gasPrice,
|
|
779
|
-
safeTx.gasToken,
|
|
780
|
-
safeTx.refundReceiver,
|
|
781
|
-
signature
|
|
782
|
-
]
|
|
783
|
-
});
|
|
784
|
-
const receipt = await publicClient.waitForTransactionReceipt({
|
|
785
|
-
hash: txHash
|
|
786
|
-
});
|
|
787
|
-
const safeLogs = receipt.logs.filter(
|
|
788
|
-
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
789
|
-
);
|
|
790
|
-
const parsed = _viem.parseEventLogs.call(void 0, {
|
|
791
|
-
abi: SAFE_ABI,
|
|
792
|
-
logs: safeLogs,
|
|
793
|
-
strict: false
|
|
794
|
-
});
|
|
795
|
-
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
796
|
-
if (failed) {
|
|
797
|
-
throw new Error("Safe transaction failed");
|
|
798
|
-
}
|
|
799
|
-
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
800
|
-
if (!succeeded) {
|
|
801
|
-
throw new Error("Safe transaction status unavailable");
|
|
802
|
-
}
|
|
803
|
-
return { txHash };
|
|
804
|
-
}
|
|
805
|
-
var SAFE_TX_TYPES = {
|
|
806
|
-
SafeTx: [
|
|
807
|
-
{ name: "to", type: "address" },
|
|
808
|
-
{ name: "value", type: "uint256" },
|
|
809
|
-
{ name: "data", type: "bytes" },
|
|
810
|
-
{ name: "operation", type: "uint8" },
|
|
811
|
-
{ name: "safeTxGas", type: "uint256" },
|
|
812
|
-
{ name: "baseGas", type: "uint256" },
|
|
813
|
-
{ name: "gasPrice", type: "uint256" },
|
|
814
|
-
{ name: "gasToken", type: "address" },
|
|
815
|
-
{ name: "refundReceiver", type: "address" },
|
|
816
|
-
{ name: "nonce", type: "uint256" }
|
|
817
|
-
]
|
|
818
|
-
};
|
|
819
|
-
async function buildSafeTransaction(params) {
|
|
820
|
-
const { publicClient, safeAddress, to, value, data, chainId } = params;
|
|
821
|
-
const nonce = await publicClient.readContract({
|
|
822
|
-
address: safeAddress,
|
|
823
|
-
abi: SAFE_ABI,
|
|
824
|
-
functionName: "nonce"
|
|
825
|
-
});
|
|
826
|
-
const message = {
|
|
827
|
-
to,
|
|
828
|
-
value,
|
|
829
|
-
data,
|
|
830
|
-
operation: 0,
|
|
831
|
-
safeTxGas: 0n,
|
|
832
|
-
baseGas: 0n,
|
|
833
|
-
gasPrice: 0n,
|
|
834
|
-
gasToken: _viem.zeroAddress,
|
|
835
|
-
refundReceiver: _viem.zeroAddress,
|
|
836
|
-
nonce
|
|
837
|
-
};
|
|
838
|
-
const safeTxHash = _viem.hashTypedData.call(void 0, {
|
|
839
|
-
domain: { chainId, verifyingContract: safeAddress },
|
|
840
|
-
types: SAFE_TX_TYPES,
|
|
841
|
-
primaryType: "SafeTx",
|
|
842
|
-
message
|
|
843
|
-
});
|
|
844
|
-
return {
|
|
845
|
-
chainId,
|
|
846
|
-
safeAddress,
|
|
847
|
-
safeTxHash,
|
|
848
|
-
typedData: {
|
|
849
|
-
domain: { chainId, verifyingContract: safeAddress },
|
|
850
|
-
types: SAFE_TX_TYPES,
|
|
851
|
-
primaryType: "SafeTx",
|
|
852
|
-
message
|
|
853
|
-
}
|
|
854
|
-
};
|
|
855
|
-
}
|
|
856
|
-
|
|
857
577
|
// src/WithdrawFlow.tsx
|
|
858
578
|
|
|
859
579
|
|
|
@@ -870,7 +590,7 @@ function WithdrawFlow({
|
|
|
870
590
|
amount: defaultAmount,
|
|
871
591
|
service,
|
|
872
592
|
allowedRoutes,
|
|
873
|
-
signerAddress =
|
|
593
|
+
signerAddress = _chunkR2HP743Tcjs.DEFAULT_SIGNER_ADDRESS,
|
|
874
594
|
sessionChainIds,
|
|
875
595
|
forceRegister = false,
|
|
876
596
|
waitForFinalTx = true,
|
|
@@ -891,27 +611,27 @@ function WithdrawFlow({
|
|
|
891
611
|
onError,
|
|
892
612
|
debug
|
|
893
613
|
}) {
|
|
894
|
-
const onStepChangeRef =
|
|
895
|
-
const onTotalBalanceChangeRef =
|
|
896
|
-
const onEventRef =
|
|
897
|
-
const onConnectedRef =
|
|
898
|
-
const onWithdrawSubmittedRef =
|
|
899
|
-
const onWithdrawCompleteRef =
|
|
900
|
-
const onWithdrawFailedRef =
|
|
901
|
-
const onErrorRef =
|
|
614
|
+
const onStepChangeRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onStepChange);
|
|
615
|
+
const onTotalBalanceChangeRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
616
|
+
const onEventRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onEvent);
|
|
617
|
+
const onConnectedRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onConnected);
|
|
618
|
+
const onWithdrawSubmittedRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onWithdrawSubmitted);
|
|
619
|
+
const onWithdrawCompleteRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onWithdrawComplete);
|
|
620
|
+
const onWithdrawFailedRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onWithdrawFailed);
|
|
621
|
+
const onErrorRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onError);
|
|
902
622
|
const [step, setStep] = _react.useState.call(void 0, { type: "form" });
|
|
903
623
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
904
624
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, 0);
|
|
905
625
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
|
|
906
626
|
const logFlow = _react.useCallback.call(void 0,
|
|
907
627
|
(message, data) => {
|
|
908
|
-
|
|
628
|
+
_chunkKE6CJVOVcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
909
629
|
},
|
|
910
630
|
[debug]
|
|
911
631
|
);
|
|
912
632
|
const logFlowError = _react.useCallback.call(void 0,
|
|
913
633
|
(message, error, data) => {
|
|
914
|
-
|
|
634
|
+
_chunkKE6CJVOVcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
915
635
|
},
|
|
916
636
|
[debug]
|
|
917
637
|
);
|
|
@@ -970,14 +690,14 @@ function WithdrawFlow({
|
|
|
970
690
|
return {
|
|
971
691
|
ownerAddress: dappAddress,
|
|
972
692
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
973
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
693
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkKE6CJVOVcjs.getPublicClient.call(void 0, sourceChain))),
|
|
974
694
|
switchChain: dappSwitchChain
|
|
975
695
|
};
|
|
976
696
|
}
|
|
977
697
|
return {
|
|
978
698
|
ownerAddress: dappWalletClient.account.address,
|
|
979
699
|
walletClient: dappWalletClient,
|
|
980
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
700
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkKE6CJVOVcjs.getPublicClient.call(void 0, sourceChain))),
|
|
981
701
|
switchChain: dappSwitchChain
|
|
982
702
|
};
|
|
983
703
|
}
|
|
@@ -988,7 +708,7 @@ function WithdrawFlow({
|
|
|
988
708
|
return {
|
|
989
709
|
ownerAddress: dappWalletClient.account.address,
|
|
990
710
|
walletClient: dappWalletClient,
|
|
991
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
711
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkKE6CJVOVcjs.getPublicClient.call(void 0, sourceChain))),
|
|
992
712
|
switchChain: dappSwitchChain
|
|
993
713
|
};
|
|
994
714
|
}
|
|
@@ -1015,10 +735,10 @@ function WithdrawFlow({
|
|
|
1015
735
|
sourceChain
|
|
1016
736
|
]);
|
|
1017
737
|
const asset = _react.useMemo.call(void 0, () => {
|
|
1018
|
-
const symbol =
|
|
1019
|
-
const decimals =
|
|
738
|
+
const symbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
739
|
+
const decimals = _chunkR2HP743Tcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1020
740
|
return {
|
|
1021
|
-
id:
|
|
741
|
+
id: _chunkKE6CJVOVcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1022
742
|
chainId: sourceChain,
|
|
1023
743
|
token: sourceToken,
|
|
1024
744
|
symbol,
|
|
@@ -1026,7 +746,7 @@ function WithdrawFlow({
|
|
|
1026
746
|
decimals
|
|
1027
747
|
};
|
|
1028
748
|
}, [sourceChain, sourceToken]);
|
|
1029
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
749
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkR2HP743Tcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
1030
750
|
const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
|
|
1031
751
|
const stepIndex = step.type === "form" ? 0 : 1;
|
|
1032
752
|
const currentBackHandler = void 0;
|
|
@@ -1044,8 +764,8 @@ function WithdrawFlow({
|
|
|
1044
764
|
}
|
|
1045
765
|
lastStepOpenEventKeyRef.current = "form";
|
|
1046
766
|
if (step.type === "form") {
|
|
1047
|
-
const tokenSymbol =
|
|
1048
|
-
const chainName =
|
|
767
|
+
const tokenSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
768
|
+
const chainName = _chunkR2HP743Tcjs.getChainName.call(void 0, targetChain);
|
|
1049
769
|
_optionalChain([onEventRef, 'access', _22 => _22.current, 'optionalCall', _23 => _23({
|
|
1050
770
|
type: "withdraw_modal_select_amount_open",
|
|
1051
771
|
pred_balance: totalBalanceUsd,
|
|
@@ -1090,15 +810,15 @@ function WithdrawFlow({
|
|
|
1090
810
|
[logFlowError, onErrorRef]
|
|
1091
811
|
);
|
|
1092
812
|
const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
|
|
1093
|
-
const localOwner =
|
|
813
|
+
const localOwner = _chunkKE6CJVOVcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1094
814
|
if (localOwner) {
|
|
1095
815
|
return {
|
|
1096
|
-
account:
|
|
816
|
+
account: _chunkKE6CJVOVcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1097
817
|
address: localOwner.address
|
|
1098
818
|
};
|
|
1099
819
|
}
|
|
1100
|
-
const created =
|
|
1101
|
-
|
|
820
|
+
const created = _chunkKE6CJVOVcjs.createSessionOwnerKey.call(void 0, );
|
|
821
|
+
_chunkKE6CJVOVcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1102
822
|
return {
|
|
1103
823
|
account: created.account,
|
|
1104
824
|
address: created.address
|
|
@@ -1106,8 +826,8 @@ function WithdrawFlow({
|
|
|
1106
826
|
}, []);
|
|
1107
827
|
const handleFormSubmit = _react.useCallback.call(void 0,
|
|
1108
828
|
async (recipient, amountValue) => {
|
|
1109
|
-
const tokenSymbol =
|
|
1110
|
-
const chainName =
|
|
829
|
+
const tokenSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
830
|
+
const chainName = _chunkR2HP743Tcjs.getChainName.call(void 0, targetChain);
|
|
1111
831
|
_optionalChain([onEventRef, 'access', _30 => _30.current, 'optionalCall', _31 => _31({
|
|
1112
832
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1113
833
|
pred_balance: totalBalanceUsd,
|
|
@@ -1138,7 +858,7 @@ function WithdrawFlow({
|
|
|
1138
858
|
const setup = await service.setupAccount({
|
|
1139
859
|
ownerAddress: ownerAddress2,
|
|
1140
860
|
sessionOwnerAddress: sessionOwner.address,
|
|
1141
|
-
targetChain:
|
|
861
|
+
targetChain: _chunkKE6CJVOVcjs.toEvmCaip2.call(void 0, targetChain),
|
|
1142
862
|
targetToken,
|
|
1143
863
|
recipient,
|
|
1144
864
|
signerAddress,
|
|
@@ -1166,7 +886,7 @@ function WithdrawFlow({
|
|
|
1166
886
|
primaryType: typedData.primaryType,
|
|
1167
887
|
message: typedData.message
|
|
1168
888
|
});
|
|
1169
|
-
const sessionDetails =
|
|
889
|
+
const sessionDetails = _chunkKE6CJVOVcjs.buildSessionDetails.call(void 0,
|
|
1170
890
|
setup.sessionDetailsUnsigned,
|
|
1171
891
|
signature
|
|
1172
892
|
);
|
|
@@ -1180,7 +900,7 @@ function WithdrawFlow({
|
|
|
1180
900
|
eoaAddress: ownerAddress2,
|
|
1181
901
|
sessionOwner: sessionOwner.address,
|
|
1182
902
|
target: {
|
|
1183
|
-
chain:
|
|
903
|
+
chain: _chunkKE6CJVOVcjs.toEvmCaip2.call(void 0, targetChain),
|
|
1184
904
|
token: targetToken,
|
|
1185
905
|
recipient
|
|
1186
906
|
}
|
|
@@ -1189,7 +909,7 @@ function WithdrawFlow({
|
|
|
1189
909
|
}
|
|
1190
910
|
handleConnected(ownerAddress2, smartAccount);
|
|
1191
911
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1192
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _34 => _34.publicClient]), () => (
|
|
912
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _34 => _34.publicClient]), () => ( _chunkKE6CJVOVcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1193
913
|
let result;
|
|
1194
914
|
if (onSignTransaction) {
|
|
1195
915
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1202,7 +922,7 @@ function WithdrawFlow({
|
|
|
1202
922
|
args: [transferTarget, amountUnits]
|
|
1203
923
|
})
|
|
1204
924
|
};
|
|
1205
|
-
const request = await buildSafeTransaction({
|
|
925
|
+
const request = await _chunkYKGL66EFcjs.buildSafeTransaction.call(void 0, {
|
|
1206
926
|
publicClient: pc,
|
|
1207
927
|
safeAddress,
|
|
1208
928
|
to: transferData.to,
|
|
@@ -1213,7 +933,7 @@ function WithdrawFlow({
|
|
|
1213
933
|
const { signature } = await onSignTransaction(request);
|
|
1214
934
|
const relayResult = await service.relayWithdraw({
|
|
1215
935
|
smartAccount,
|
|
1216
|
-
chainId:
|
|
936
|
+
chainId: _chunkKE6CJVOVcjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1217
937
|
safeAddress,
|
|
1218
938
|
safeTransaction: request.typedData.message,
|
|
1219
939
|
signature
|
|
@@ -1223,7 +943,7 @@ function WithdrawFlow({
|
|
|
1223
943
|
}
|
|
1224
944
|
result = { txHash: relayResult.txHash };
|
|
1225
945
|
} else if (isSourceNative) {
|
|
1226
|
-
result = await executeSafeEthTransfer({
|
|
946
|
+
result = await _chunkYKGL66EFcjs.executeSafeEthTransfer.call(void 0, {
|
|
1227
947
|
walletClient: signerContext.walletClient,
|
|
1228
948
|
publicClient: pc,
|
|
1229
949
|
safeAddress,
|
|
@@ -1232,7 +952,7 @@ function WithdrawFlow({
|
|
|
1232
952
|
chainId: sourceChain
|
|
1233
953
|
});
|
|
1234
954
|
} else {
|
|
1235
|
-
result = await executeSafeErc20Transfer({
|
|
955
|
+
result = await _chunkYKGL66EFcjs.executeSafeErc20Transfer.call(void 0, {
|
|
1236
956
|
walletClient: signerContext.walletClient,
|
|
1237
957
|
publicClient: pc,
|
|
1238
958
|
safeAddress,
|
|
@@ -1272,7 +992,7 @@ function WithdrawFlow({
|
|
|
1272
992
|
targetChain,
|
|
1273
993
|
targetToken
|
|
1274
994
|
});
|
|
1275
|
-
handleError(
|
|
995
|
+
handleError(_chunkKE6CJVOVcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1276
996
|
throw err;
|
|
1277
997
|
} finally {
|
|
1278
998
|
setIsSubmitting(false);
|
|
@@ -1334,9 +1054,9 @@ function WithdrawFlow({
|
|
|
1334
1054
|
[_optionalChain([allowedRoutes, 'optionalAccess', _44 => _44.sourceTokens])]
|
|
1335
1055
|
);
|
|
1336
1056
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1337
|
-
return
|
|
1057
|
+
return _chunkR2HP743Tcjs.SOURCE_CHAINS.filter((chain) => {
|
|
1338
1058
|
if (allowedChainSet && !allowedChainSet.has(chain.id)) return false;
|
|
1339
|
-
const tokens =
|
|
1059
|
+
const tokens = _chunkR2HP743Tcjs.getSupportedTargetTokens.call(void 0, chain.id);
|
|
1340
1060
|
if (allowedTokenSet) {
|
|
1341
1061
|
return tokens.some((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1342
1062
|
}
|
|
@@ -1344,7 +1064,7 @@ function WithdrawFlow({
|
|
|
1344
1064
|
});
|
|
1345
1065
|
}, [allowedChainSet, allowedTokenSet]);
|
|
1346
1066
|
const targetTokenOptions = _react.useMemo.call(void 0, () => {
|
|
1347
|
-
const tokens =
|
|
1067
|
+
const tokens = _chunkR2HP743Tcjs.getSupportedTargetTokens.call(void 0, targetChain);
|
|
1348
1068
|
if (!allowedTokenSet) return tokens;
|
|
1349
1069
|
return tokens.filter((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1350
1070
|
}, [targetChain, allowedTokenSet]);
|
|
@@ -1360,7 +1080,7 @@ function WithdrawFlow({
|
|
|
1360
1080
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1361
1081
|
(chainId) => {
|
|
1362
1082
|
setTargetChain(chainId);
|
|
1363
|
-
let options =
|
|
1083
|
+
let options = _chunkR2HP743Tcjs.getSupportedTargetTokens.call(void 0, chainId);
|
|
1364
1084
|
if (allowedTokenSet) {
|
|
1365
1085
|
options = options.filter((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1366
1086
|
}
|
|
@@ -1411,20 +1131,16 @@ function WithdrawFlow({
|
|
|
1411
1131
|
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _51 => _51.icon])]);
|
|
1412
1132
|
if (showConnectStep) {
|
|
1413
1133
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1414
|
-
|
|
1134
|
+
_chunkKE6CJVOVcjs.ConnectStep,
|
|
1415
1135
|
{
|
|
1416
1136
|
walletOptions,
|
|
1417
|
-
|
|
1418
|
-
|
|
1137
|
+
onSelectWallet: (walletId) => {
|
|
1138
|
+
setSelectedWalletId(walletId);
|
|
1139
|
+
setIsConnectSelectionConfirmed(true);
|
|
1140
|
+
},
|
|
1419
1141
|
onRequestConnect,
|
|
1420
1142
|
onConnect,
|
|
1421
1143
|
onDisconnect,
|
|
1422
|
-
onContinue: () => {
|
|
1423
|
-
if (selectedWalletIdEffective) {
|
|
1424
|
-
setSelectedWalletId(selectedWalletIdEffective);
|
|
1425
|
-
}
|
|
1426
|
-
setIsConnectSelectionConfirmed(true);
|
|
1427
|
-
},
|
|
1428
1144
|
connectButtonLabel
|
|
1429
1145
|
}
|
|
1430
1146
|
) });
|
|
@@ -1432,7 +1148,7 @@ function WithdrawFlow({
|
|
|
1432
1148
|
if (!signerContext) return null;
|
|
1433
1149
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1434
1150
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _52 => _52.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1435
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1151
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkKE6CJVOVcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1436
1152
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1437
1153
|
step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1438
1154
|
WithdrawFormStep,
|
|
@@ -1458,7 +1174,7 @@ function WithdrawFlow({
|
|
|
1458
1174
|
}
|
|
1459
1175
|
),
|
|
1460
1176
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1461
|
-
|
|
1177
|
+
_chunkKE6CJVOVcjs.ProcessingStep,
|
|
1462
1178
|
{
|
|
1463
1179
|
smartAccount: step.smartAccount,
|
|
1464
1180
|
txHash: step.txHash,
|
|
@@ -1485,7 +1201,7 @@ function WithdrawFlow({
|
|
|
1485
1201
|
// src/WithdrawModal.tsx
|
|
1486
1202
|
|
|
1487
1203
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1488
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1204
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-VNTKGALT.cjs"))).then((m) => ({
|
|
1489
1205
|
default: m.WithdrawModalReown
|
|
1490
1206
|
}))
|
|
1491
1207
|
);
|
|
@@ -1513,8 +1229,8 @@ function WithdrawModalInner({
|
|
|
1513
1229
|
inline,
|
|
1514
1230
|
closeOnOverlayClick,
|
|
1515
1231
|
allowedRoutes,
|
|
1516
|
-
backendUrl =
|
|
1517
|
-
signerAddress =
|
|
1232
|
+
backendUrl = _chunkR2HP743Tcjs.DEFAULT_BACKEND_URL,
|
|
1233
|
+
signerAddress = _chunkR2HP743Tcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1518
1234
|
sessionChainIds,
|
|
1519
1235
|
forceRegister = false,
|
|
1520
1236
|
waitForFinalTx = true,
|
|
@@ -1538,19 +1254,19 @@ function WithdrawModalInner({
|
|
|
1538
1254
|
debug
|
|
1539
1255
|
}) {
|
|
1540
1256
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1541
|
-
const onReadyRef =
|
|
1257
|
+
const onReadyRef = _chunkKE6CJVOVcjs.useLatestRef.call(void 0, onReady);
|
|
1542
1258
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
1543
1259
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
1544
1260
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
1545
|
-
const targetChain =
|
|
1546
|
-
const sourceChain =
|
|
1261
|
+
const targetChain = _chunkR2HP743Tcjs.getChainId.call(void 0, targetChainProp);
|
|
1262
|
+
const sourceChain = _chunkR2HP743Tcjs.getChainId.call(void 0, sourceChainProp);
|
|
1547
1263
|
const service = _react.useMemo.call(void 0,
|
|
1548
|
-
() =>
|
|
1264
|
+
() => _chunkKE6CJVOVcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1549
1265
|
[backendUrl, debug]
|
|
1550
1266
|
);
|
|
1551
1267
|
_react.useEffect.call(void 0, () => {
|
|
1552
1268
|
if (isOpen && modalRef.current) {
|
|
1553
|
-
|
|
1269
|
+
_chunkKE6CJVOVcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1554
1270
|
}
|
|
1555
1271
|
}, [isOpen, theme]);
|
|
1556
1272
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1584,7 +1300,7 @@ function WithdrawModalInner({
|
|
|
1584
1300
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _62 => _62.title]), () => ( "Withdraw"));
|
|
1585
1301
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
|
|
1586
1302
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1587
|
-
|
|
1303
|
+
_chunkKE6CJVOVcjs.Modal,
|
|
1588
1304
|
{
|
|
1589
1305
|
isOpen,
|
|
1590
1306
|
onClose,
|
|
@@ -1643,7 +1359,7 @@ function WithdrawModalInner({
|
|
|
1643
1359
|
] }),
|
|
1644
1360
|
balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
1645
1361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balance.title }),
|
|
1646
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
1362
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkKE6CJVOVcjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
1647
1363
|
] })
|
|
1648
1364
|
] }),
|
|
1649
1365
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|