@rhinestone/deposit-modal 0.3.0-alpha.1 → 0.3.0-alpha.2
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-VV3H2WWC.cjs → DepositModalReown-B2XLFH4Z.cjs} +3 -3
- package/dist/{DepositModalReown-EESTTLN4.mjs → DepositModalReown-VFTXYG2B.mjs} +2 -2
- package/dist/{WithdrawModalReown-SQQQV6KQ.mjs → WithdrawModalReown-BDJFCWWM.mjs} +2 -2
- package/dist/{WithdrawModalReown-IP4MOGER.cjs → WithdrawModalReown-K52AK53K.cjs} +3 -3
- package/dist/{chunk-SLLI7SB6.mjs → chunk-AHSVY7AE.mjs} +23 -62
- package/dist/{chunk-C6JK3IO6.cjs → chunk-BLAGBBMP.cjs} +162 -201
- package/dist/{chunk-DCAANLEP.cjs → chunk-FTMCKJM4.cjs} +4 -4
- package/dist/{chunk-D5YCALVX.mjs → chunk-TWA3SXVV.mjs} +2 -2
- package/dist/{chunk-FY76DWPD.mjs → chunk-XKDZEIB7.mjs} +4 -4
- package/dist/{chunk-K7MNFNR7.cjs → chunk-ZMNFBFIR.cjs} +54 -54
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -771,7 +771,7 @@ function createDepositService(baseUrl, options) {
|
|
|
771
771
|
return result;
|
|
772
772
|
},
|
|
773
773
|
async fetchDepositHistory(params) {
|
|
774
|
-
const searchParams = new URLSearchParams({
|
|
774
|
+
const searchParams = new URLSearchParams({ recipient: params.recipient });
|
|
775
775
|
searchParams.set("limit", String(_nullishCoalesce(params.limit, () => ( 20))));
|
|
776
776
|
if (params.cursor) {
|
|
777
777
|
searchParams.set("cursor", params.cursor);
|
|
@@ -779,7 +779,7 @@ function createDepositService(baseUrl, options) {
|
|
|
779
779
|
const url = apiUrl(`/deposits?${searchParams.toString()}`);
|
|
780
780
|
debugLog(debug, scope, "fetchDepositHistory:request", {
|
|
781
781
|
url,
|
|
782
|
-
|
|
782
|
+
recipient: shortRef(params.recipient),
|
|
783
783
|
cursor: params.cursor
|
|
784
784
|
});
|
|
785
785
|
const response = await fetch(url, {
|
|
@@ -794,7 +794,7 @@ function createDepositService(baseUrl, options) {
|
|
|
794
794
|
scope,
|
|
795
795
|
"fetchDepositHistory:failed",
|
|
796
796
|
error,
|
|
797
|
-
{ status: response.status,
|
|
797
|
+
{ status: response.status, recipient: shortRef(params.recipient) }
|
|
798
798
|
);
|
|
799
799
|
throw new Error(
|
|
800
800
|
error.error || `Deposit history fetch failed: ${response.status}`
|
|
@@ -804,7 +804,7 @@ function createDepositService(baseUrl, options) {
|
|
|
804
804
|
const deposits = Array.isArray(_optionalChain([data, 'optionalAccess', _18 => _18.deposits])) ? data.deposits : [];
|
|
805
805
|
const nextCursor = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess', _19 => _19.nextCursor]), () => ( _optionalChain([data, 'optionalAccess', _20 => _20.next_cursor]))), () => ( null));
|
|
806
806
|
debugLog(debug, scope, "fetchDepositHistory:success", {
|
|
807
|
-
|
|
807
|
+
recipient: shortRef(params.recipient),
|
|
808
808
|
count: deposits.length,
|
|
809
809
|
hasMore: Boolean(nextCursor)
|
|
810
810
|
});
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
saveSessionOwnerToStorage,
|
|
29
29
|
toEvmCaip2,
|
|
30
30
|
useLatestRef
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XKDZEIB7.mjs";
|
|
32
32
|
import {
|
|
33
33
|
DEFAULT_BACKEND_URL,
|
|
34
34
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -1767,7 +1767,7 @@ function deriveStepView(step, _registration) {
|
|
|
1767
1767
|
// src/WithdrawModal.tsx
|
|
1768
1768
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1769
1769
|
var ReownWithdrawInner = lazy(
|
|
1770
|
-
() => import("./WithdrawModalReown-
|
|
1770
|
+
() => import("./WithdrawModalReown-BDJFCWWM.mjs").then((m) => ({
|
|
1771
1771
|
default: m.WithdrawModalReown
|
|
1772
1772
|
}))
|
|
1773
1773
|
);
|
|
@@ -771,7 +771,7 @@ function createDepositService(baseUrl, options) {
|
|
|
771
771
|
return result;
|
|
772
772
|
},
|
|
773
773
|
async fetchDepositHistory(params) {
|
|
774
|
-
const searchParams = new URLSearchParams({
|
|
774
|
+
const searchParams = new URLSearchParams({ recipient: params.recipient });
|
|
775
775
|
searchParams.set("limit", String(params.limit ?? 20));
|
|
776
776
|
if (params.cursor) {
|
|
777
777
|
searchParams.set("cursor", params.cursor);
|
|
@@ -779,7 +779,7 @@ function createDepositService(baseUrl, options) {
|
|
|
779
779
|
const url = apiUrl(`/deposits?${searchParams.toString()}`);
|
|
780
780
|
debugLog(debug, scope, "fetchDepositHistory:request", {
|
|
781
781
|
url,
|
|
782
|
-
|
|
782
|
+
recipient: shortRef(params.recipient),
|
|
783
783
|
cursor: params.cursor
|
|
784
784
|
});
|
|
785
785
|
const response = await fetch(url, {
|
|
@@ -794,7 +794,7 @@ function createDepositService(baseUrl, options) {
|
|
|
794
794
|
scope,
|
|
795
795
|
"fetchDepositHistory:failed",
|
|
796
796
|
error,
|
|
797
|
-
{ status: response.status,
|
|
797
|
+
{ status: response.status, recipient: shortRef(params.recipient) }
|
|
798
798
|
);
|
|
799
799
|
throw new Error(
|
|
800
800
|
error.error || `Deposit history fetch failed: ${response.status}`
|
|
@@ -804,7 +804,7 @@ function createDepositService(baseUrl, options) {
|
|
|
804
804
|
const deposits = Array.isArray(data?.deposits) ? data.deposits : [];
|
|
805
805
|
const nextCursor = data?.nextCursor ?? data?.next_cursor ?? null;
|
|
806
806
|
debugLog(debug, scope, "fetchDepositHistory:success", {
|
|
807
|
-
|
|
807
|
+
recipient: shortRef(params.recipient),
|
|
808
808
|
count: deposits.length,
|
|
809
809
|
hasMore: Boolean(nextCursor)
|
|
810
810
|
});
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkFTMCKJM4cjs = require('./chunk-FTMCKJM4.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -252,7 +252,7 @@ function WithdrawFormStep({
|
|
|
252
252
|
setIsSwitching(true);
|
|
253
253
|
switchChain(asset.chainId).catch((err) => {
|
|
254
254
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
255
|
-
setError(
|
|
255
|
+
setError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw));
|
|
256
256
|
}).finally(() => {
|
|
257
257
|
setIsSwitching(false);
|
|
258
258
|
});
|
|
@@ -272,7 +272,7 @@ function WithdrawFormStep({
|
|
|
272
272
|
return;
|
|
273
273
|
}
|
|
274
274
|
try {
|
|
275
|
-
const bal =
|
|
275
|
+
const bal = _chunkFTMCKJM4cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
276
276
|
address: asset.token,
|
|
277
277
|
abi: _viem.erc20Abi,
|
|
278
278
|
functionName: "balanceOf",
|
|
@@ -376,7 +376,7 @@ function WithdrawFormStep({
|
|
|
376
376
|
await onSubmit(recipient, amount);
|
|
377
377
|
} catch (err) {
|
|
378
378
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
379
|
-
setError(
|
|
379
|
+
setError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw));
|
|
380
380
|
} finally {
|
|
381
381
|
setIsSubmitting(false);
|
|
382
382
|
}
|
|
@@ -384,16 +384,16 @@ function WithdrawFormStep({
|
|
|
384
384
|
if (isBalanceLoading) {
|
|
385
385
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
386
386
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
|
|
387
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
387
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, { className: "rs-spinner--lg" }),
|
|
388
388
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
389
389
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
390
390
|
] }),
|
|
391
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
391
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
392
392
|
] });
|
|
393
393
|
}
|
|
394
394
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
395
395
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-form", children: [
|
|
396
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
396
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
397
397
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
398
398
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Recipient address" }),
|
|
399
399
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
|
|
@@ -431,7 +431,7 @@ function WithdrawFormStep({
|
|
|
431
431
|
),
|
|
432
432
|
isRecipientConnected ? null : "Use connected"
|
|
433
433
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
434
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
435
435
|
isRecipientConnected ? null : "Use connected"
|
|
436
436
|
] })
|
|
437
437
|
}
|
|
@@ -470,7 +470,7 @@ function WithdrawFormStep({
|
|
|
470
470
|
) })
|
|
471
471
|
] }),
|
|
472
472
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
473
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
473
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkFTMCKJM4cjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
474
474
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
475
475
|
"Balance: ",
|
|
476
476
|
formattedBalance,
|
|
@@ -510,7 +510,7 @@ function WithdrawFormStep({
|
|
|
510
510
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
511
511
|
] }),
|
|
512
512
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
-
|
|
513
|
+
_chunkFTMCKJM4cjs.ChevronDownIcon,
|
|
514
514
|
{
|
|
515
515
|
className: "rs-withdraw-dropdown-arrow",
|
|
516
516
|
style: {
|
|
@@ -578,7 +578,7 @@ function WithdrawFormStep({
|
|
|
578
578
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
579
579
|
] }),
|
|
580
580
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
-
|
|
581
|
+
_chunkFTMCKJM4cjs.ChevronDownIcon,
|
|
582
582
|
{
|
|
583
583
|
className: "rs-withdraw-dropdown-arrow",
|
|
584
584
|
style: {
|
|
@@ -619,16 +619,16 @@ function WithdrawFormStep({
|
|
|
619
619
|
] }),
|
|
620
620
|
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 ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
621
621
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
|
|
622
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
622
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, {}),
|
|
623
623
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
624
624
|
] }),
|
|
625
625
|
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
|
|
626
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
626
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, {}),
|
|
627
627
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: registrationError })
|
|
628
628
|
] })
|
|
629
629
|
] }),
|
|
630
630
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
631
|
-
|
|
631
|
+
_chunkFTMCKJM4cjs.Button,
|
|
632
632
|
{
|
|
633
633
|
onClick: handleWithdraw,
|
|
634
634
|
fullWidth: true,
|
|
@@ -637,7 +637,7 @@ function WithdrawFormStep({
|
|
|
637
637
|
children: isBusy ? "Preparing..." : registrationPending ? "Preparing session..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
|
|
638
638
|
}
|
|
639
639
|
) }),
|
|
640
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
641
641
|
] });
|
|
642
642
|
}
|
|
643
643
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -677,7 +677,7 @@ function WithdrawReviewStep({
|
|
|
677
677
|
await onConfirm();
|
|
678
678
|
} catch (err) {
|
|
679
679
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
680
|
-
const message =
|
|
680
|
+
const message = _chunkFTMCKJM4cjs.formatUserError.call(void 0, raw);
|
|
681
681
|
setError(message);
|
|
682
682
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
683
683
|
} finally {
|
|
@@ -688,9 +688,9 @@ function WithdrawReviewStep({
|
|
|
688
688
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
689
689
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
690
690
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
691
|
-
|
|
691
|
+
_chunkFTMCKJM4cjs.BodyHeader,
|
|
692
692
|
{
|
|
693
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
693
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CircleArrowOutUpLeftIcon, {}),
|
|
694
694
|
title: "Review withdrawal"
|
|
695
695
|
}
|
|
696
696
|
),
|
|
@@ -741,15 +741,15 @@ function WithdrawReviewStep({
|
|
|
741
741
|
] })
|
|
742
742
|
] }),
|
|
743
743
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
744
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
744
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
745
745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
746
746
|
] }),
|
|
747
747
|
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
748
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
748
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
749
749
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: registrationError })
|
|
750
750
|
] }),
|
|
751
751
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
752
|
-
|
|
752
|
+
_chunkFTMCKJM4cjs.Button,
|
|
753
753
|
{
|
|
754
754
|
onClick: handleConfirm,
|
|
755
755
|
loading: isSubmitting,
|
|
@@ -760,7 +760,7 @@ function WithdrawReviewStep({
|
|
|
760
760
|
}
|
|
761
761
|
)
|
|
762
762
|
] }),
|
|
763
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
763
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
764
764
|
] });
|
|
765
765
|
}
|
|
766
766
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -1056,15 +1056,15 @@ async function buildSafeTransaction(params) {
|
|
|
1056
1056
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
1057
1057
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
1058
1058
|
function resolveSessionOwner(eoaAddress) {
|
|
1059
|
-
const localOwner =
|
|
1059
|
+
const localOwner = _chunkFTMCKJM4cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
1060
1060
|
if (localOwner) {
|
|
1061
1061
|
return {
|
|
1062
|
-
account:
|
|
1062
|
+
account: _chunkFTMCKJM4cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
1063
1063
|
address: localOwner.address
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
1066
|
-
const created =
|
|
1067
|
-
|
|
1066
|
+
const created = _chunkFTMCKJM4cjs.createSessionOwnerKey.call(void 0, );
|
|
1067
|
+
_chunkFTMCKJM4cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
1068
1068
|
return { account: created.account, address: created.address };
|
|
1069
1069
|
}
|
|
1070
1070
|
function targetsEqual(a, b) {
|
|
@@ -1100,19 +1100,19 @@ function WithdrawFlow({
|
|
|
1100
1100
|
onError,
|
|
1101
1101
|
debug
|
|
1102
1102
|
}) {
|
|
1103
|
-
const onStepChangeRef =
|
|
1104
|
-
const onEventRef =
|
|
1105
|
-
const onLifecycleRef =
|
|
1106
|
-
const onErrorRef =
|
|
1103
|
+
const onStepChangeRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onStepChange);
|
|
1104
|
+
const onEventRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onEvent);
|
|
1105
|
+
const onLifecycleRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onLifecycle);
|
|
1106
|
+
const onErrorRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onError);
|
|
1107
1107
|
const logFlow = _react.useCallback.call(void 0,
|
|
1108
1108
|
(message, data) => {
|
|
1109
|
-
|
|
1109
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
1110
1110
|
},
|
|
1111
1111
|
[debug]
|
|
1112
1112
|
);
|
|
1113
1113
|
const logFlowError = _react.useCallback.call(void 0,
|
|
1114
1114
|
(message, error, data) => {
|
|
1115
|
-
|
|
1115
|
+
_chunkFTMCKJM4cjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
1116
1116
|
},
|
|
1117
1117
|
[debug]
|
|
1118
1118
|
);
|
|
@@ -1187,14 +1187,14 @@ function WithdrawFlow({
|
|
|
1187
1187
|
return {
|
|
1188
1188
|
ownerAddress: dappAddress,
|
|
1189
1189
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
1190
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1190
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain))),
|
|
1191
1191
|
switchChain: dappSwitchChain
|
|
1192
1192
|
};
|
|
1193
1193
|
}
|
|
1194
1194
|
return {
|
|
1195
1195
|
ownerAddress: dappWalletClient.account.address,
|
|
1196
1196
|
walletClient: dappWalletClient,
|
|
1197
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1197
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain))),
|
|
1198
1198
|
switchChain: dappSwitchChain
|
|
1199
1199
|
};
|
|
1200
1200
|
}
|
|
@@ -1205,7 +1205,7 @@ function WithdrawFlow({
|
|
|
1205
1205
|
return {
|
|
1206
1206
|
ownerAddress: dappWalletClient.account.address,
|
|
1207
1207
|
walletClient: dappWalletClient,
|
|
1208
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1208
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain))),
|
|
1209
1209
|
switchChain: dappSwitchChain
|
|
1210
1210
|
};
|
|
1211
1211
|
}
|
|
@@ -1262,7 +1262,7 @@ function WithdrawFlow({
|
|
|
1262
1262
|
const setup = await service.setupAccount({
|
|
1263
1263
|
ownerAddress,
|
|
1264
1264
|
sessionOwnerAddress: sessionOwner.address,
|
|
1265
|
-
targetChain:
|
|
1265
|
+
targetChain: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, targetChain),
|
|
1266
1266
|
targetToken,
|
|
1267
1267
|
recipient: recipientForRegistration,
|
|
1268
1268
|
signerAddress,
|
|
@@ -1287,7 +1287,7 @@ function WithdrawFlow({
|
|
|
1287
1287
|
message: typedData.message
|
|
1288
1288
|
});
|
|
1289
1289
|
if (cancelled) return;
|
|
1290
|
-
const sessionDetails =
|
|
1290
|
+
const sessionDetails = _chunkFTMCKJM4cjs.buildSessionDetails.call(void 0,
|
|
1291
1291
|
setup.sessionDetailsUnsigned,
|
|
1292
1292
|
signature
|
|
1293
1293
|
);
|
|
@@ -1301,7 +1301,7 @@ function WithdrawFlow({
|
|
|
1301
1301
|
eoaAddress: ownerAddress,
|
|
1302
1302
|
sessionOwner: sessionOwner.address,
|
|
1303
1303
|
target: {
|
|
1304
|
-
chain:
|
|
1304
|
+
chain: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, targetChain),
|
|
1305
1305
|
token: targetToken,
|
|
1306
1306
|
recipient: recipientForRegistration
|
|
1307
1307
|
}
|
|
@@ -1324,7 +1324,7 @@ function WithdrawFlow({
|
|
|
1324
1324
|
} catch (err) {
|
|
1325
1325
|
if (cancelled) return;
|
|
1326
1326
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1327
|
-
const message =
|
|
1327
|
+
const message = _chunkFTMCKJM4cjs.formatUserError.call(void 0, raw);
|
|
1328
1328
|
logFlowError("auto-register:failed", err, {
|
|
1329
1329
|
ownerAddress,
|
|
1330
1330
|
targetChain,
|
|
@@ -1360,7 +1360,7 @@ function WithdrawFlow({
|
|
|
1360
1360
|
const symbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1361
1361
|
const decimals = _chunkIVTXEYB2cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1362
1362
|
return {
|
|
1363
|
-
id:
|
|
1363
|
+
id: _chunkFTMCKJM4cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1364
1364
|
chainId: sourceChain,
|
|
1365
1365
|
token: sourceToken,
|
|
1366
1366
|
symbol,
|
|
@@ -1468,7 +1468,7 @@ function WithdrawFlow({
|
|
|
1468
1468
|
targetToken
|
|
1469
1469
|
});
|
|
1470
1470
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1471
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1471
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain)));
|
|
1472
1472
|
let result;
|
|
1473
1473
|
if (onSignTransaction) {
|
|
1474
1474
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1492,7 +1492,7 @@ function WithdrawFlow({
|
|
|
1492
1492
|
const { signature } = await onSignTransaction(request);
|
|
1493
1493
|
const relayResult = await service.relayWithdraw({
|
|
1494
1494
|
smartAccount,
|
|
1495
|
-
chainId:
|
|
1495
|
+
chainId: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1496
1496
|
safeAddress,
|
|
1497
1497
|
safeTransaction: request.typedData.message,
|
|
1498
1498
|
signature
|
|
@@ -1544,7 +1544,7 @@ function WithdrawFlow({
|
|
|
1544
1544
|
targetChain,
|
|
1545
1545
|
targetToken
|
|
1546
1546
|
});
|
|
1547
|
-
handleError(
|
|
1547
|
+
handleError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1548
1548
|
throw err;
|
|
1549
1549
|
}
|
|
1550
1550
|
},
|
|
@@ -1671,7 +1671,7 @@ function WithdrawFlow({
|
|
|
1671
1671
|
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _60 => _60.icon])]);
|
|
1672
1672
|
if (showConnectStep) {
|
|
1673
1673
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1674
|
-
|
|
1674
|
+
_chunkFTMCKJM4cjs.ConnectStep,
|
|
1675
1675
|
{
|
|
1676
1676
|
walletOptions,
|
|
1677
1677
|
onConfirmWallet: (walletId) => {
|
|
@@ -1689,7 +1689,7 @@ function WithdrawFlow({
|
|
|
1689
1689
|
if (!signerContext) return null;
|
|
1690
1690
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1691
1691
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1692
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1692
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain)));
|
|
1693
1693
|
const stepView = deriveStepView(flowStep, registration);
|
|
1694
1694
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1695
1695
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1733,7 +1733,7 @@ function WithdrawFlow({
|
|
|
1733
1733
|
}
|
|
1734
1734
|
),
|
|
1735
1735
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1736
|
-
|
|
1736
|
+
_chunkFTMCKJM4cjs.ProcessingStep,
|
|
1737
1737
|
{
|
|
1738
1738
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1739
1739
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1767,7 +1767,7 @@ function deriveStepView(step, _registration) {
|
|
|
1767
1767
|
// src/WithdrawModal.tsx
|
|
1768
1768
|
|
|
1769
1769
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1770
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1770
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-K52AK53K.cjs"))).then((m) => ({
|
|
1771
1771
|
default: m.WithdrawModalReown
|
|
1772
1772
|
}))
|
|
1773
1773
|
);
|
|
@@ -1815,18 +1815,18 @@ function WithdrawModalInner({
|
|
|
1815
1815
|
debug
|
|
1816
1816
|
}) {
|
|
1817
1817
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1818
|
-
const onReadyRef =
|
|
1818
|
+
const onReadyRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onReady);
|
|
1819
1819
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1820
1820
|
void 0
|
|
1821
1821
|
);
|
|
1822
1822
|
const targetChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, targetChainProp);
|
|
1823
1823
|
const sourceChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, sourceChainProp);
|
|
1824
1824
|
const service = _react.useMemo.call(void 0,
|
|
1825
|
-
() =>
|
|
1825
|
+
() => _chunkFTMCKJM4cjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1826
1826
|
[backendUrl, debug]
|
|
1827
1827
|
);
|
|
1828
1828
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1829
|
-
const onErrorRef =
|
|
1829
|
+
const onErrorRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onError);
|
|
1830
1830
|
_react.useEffect.call(void 0, () => {
|
|
1831
1831
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1832
1832
|
_optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
@@ -1837,7 +1837,7 @@ function WithdrawModalInner({
|
|
|
1837
1837
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1838
1838
|
_react.useEffect.call(void 0, () => {
|
|
1839
1839
|
if (isOpen && modalRef.current) {
|
|
1840
|
-
|
|
1840
|
+
_chunkFTMCKJM4cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1841
1841
|
}
|
|
1842
1842
|
}, [isOpen, theme]);
|
|
1843
1843
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1856,7 +1856,7 @@ function WithdrawModalInner({
|
|
|
1856
1856
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
|
|
1857
1857
|
const canGoBack = backHandler !== void 0;
|
|
1858
1858
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1859
|
-
|
|
1859
|
+
_chunkFTMCKJM4cjs.Modal,
|
|
1860
1860
|
{
|
|
1861
1861
|
isOpen,
|
|
1862
1862
|
onClose,
|
|
@@ -1872,7 +1872,7 @@ function WithdrawModalInner({
|
|
|
1872
1872
|
className: "rs-modal-header-back",
|
|
1873
1873
|
"aria-label": "Go back",
|
|
1874
1874
|
onClick: backHandler,
|
|
1875
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1875
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ChevronLeftIcon, {})
|
|
1876
1876
|
}
|
|
1877
1877
|
) }),
|
|
1878
1878
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1882,7 +1882,7 @@ function WithdrawModalInner({
|
|
|
1882
1882
|
onClick: onClose,
|
|
1883
1883
|
className: "rs-modal-close",
|
|
1884
1884
|
"aria-label": "Close",
|
|
1885
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1885
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CloseIcon, {})
|
|
1886
1886
|
}
|
|
1887
1887
|
) })
|
|
1888
1888
|
] }),
|
package/dist/deposit.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkBLAGBBMPcjs = require('./chunk-BLAGBBMP.cjs');
|
|
4
|
+
require('./chunk-FTMCKJM4.cjs');
|
|
5
5
|
require('./chunk-IVTXEYB2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.DepositModal =
|
|
8
|
+
exports.DepositModal = _chunkBLAGBBMPcjs.DepositModal;
|
package/dist/deposit.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBLAGBBMPcjs = require('./chunk-BLAGBBMP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkZMNFBFIRcjs = require('./chunk-ZMNFBFIR.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkYQFH2WSWcjs = require('./chunk-YQFH2WSW.cjs');
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-FTMCKJM4.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -70,4 +70,4 @@ var _chunkIVTXEYB2cjs = require('./chunk-IVTXEYB2.cjs');
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
exports.CHAIN_BY_ID = _chunkIVTXEYB2cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkIVTXEYB2cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal =
|
|
73
|
+
exports.CHAIN_BY_ID = _chunkIVTXEYB2cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunkIVTXEYB2cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkBLAGBBMPcjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunkIVTXEYB2cjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunkIVTXEYB2cjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunkZMNFBFIRcjs.WithdrawModal; exports.chainRegistry = _chunkIVTXEYB2cjs.chainRegistry; exports.disconnectWallet = _chunkYQFH2WSWcjs.disconnectWallet; exports.findChainIdForToken = _chunkIVTXEYB2cjs.findChainIdForToken; exports.getChainBadge = _chunkIVTXEYB2cjs.getChainBadge; exports.getChainIcon = _chunkIVTXEYB2cjs.getChainIcon; exports.getChainId = _chunkIVTXEYB2cjs.getChainId; exports.getChainName = _chunkIVTXEYB2cjs.getChainName; exports.getChainObject = _chunkIVTXEYB2cjs.getChainObject; exports.getExplorerName = _chunkIVTXEYB2cjs.getExplorerName; exports.getExplorerTxUrl = _chunkIVTXEYB2cjs.getExplorerTxUrl; exports.getExplorerUrl = _chunkIVTXEYB2cjs.getExplorerUrl; exports.getSupportedChainIds = _chunkIVTXEYB2cjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunkIVTXEYB2cjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunkIVTXEYB2cjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunkIVTXEYB2cjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunkIVTXEYB2cjs.getTokenAddress; exports.getTokenDecimals = _chunkIVTXEYB2cjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunkIVTXEYB2cjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon; exports.getTokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol; exports.getUsdcAddress = _chunkIVTXEYB2cjs.getUsdcAddress; exports.getUsdcDecimals = _chunkIVTXEYB2cjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunkIVTXEYB2cjs.isSupportedTokenAddressForChain;
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AHSVY7AE.mjs";
|
|
4
4
|
import {
|
|
5
5
|
WithdrawModal
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TWA3SXVV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
disconnectWallet
|
|
9
9
|
} from "./chunk-5YXAQB6A.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-XKDZEIB7.mjs";
|
|
11
11
|
import {
|
|
12
12
|
CHAIN_BY_ID,
|
|
13
13
|
DEFAULT_BACKEND_URL,
|
package/dist/withdraw.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkZMNFBFIRcjs = require('./chunk-ZMNFBFIR.cjs');
|
|
4
|
+
require('./chunk-FTMCKJM4.cjs');
|
|
5
5
|
require('./chunk-IVTXEYB2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.WithdrawModal =
|
|
8
|
+
exports.WithdrawModal = _chunkZMNFBFIRcjs.WithdrawModal;
|
package/dist/withdraw.mjs
CHANGED