@rhinestone/deposit-modal 0.1.65 → 0.1.67
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-Y4M3RA73.mjs → DepositModalReown-EYIV6APK.mjs} +3 -3
- package/dist/{DepositModalReown-6ZMLUWWD.cjs → DepositModalReown-UPYZN2XA.cjs} +4 -4
- package/dist/{WithdrawModalReown-HVBMAUPM.mjs → WithdrawModalReown-6VYKKKJN.mjs} +3 -3
- package/dist/{WithdrawModalReown-WJ5SHBV4.cjs → WithdrawModalReown-WHPQDJJJ.cjs} +4 -4
- package/dist/{chunk-RKRF7ANK.mjs → chunk-5FDIQNJJ.mjs} +22 -19
- package/dist/{chunk-4CZ7W3RS.cjs → chunk-FLVSQDP4.cjs} +181 -132
- package/dist/{chunk-GAHX5RAT.mjs → chunk-IUW3SJQT.mjs} +103 -54
- package/dist/{chunk-MGV75YLV.cjs → chunk-LTLFJPHO.cjs} +106 -103
- package/dist/{chunk-R6U6BHCV.cjs → chunk-MUWVDVY4.cjs} +13 -1
- package/dist/{chunk-IYZGLNY6.mjs → chunk-NFE5ZLD3.mjs} +1171 -374
- package/dist/{chunk-CIXHTOO3.mjs → chunk-SDZKKUCJ.mjs} +13 -1
- package/dist/{chunk-OWV4KVBM.cjs → chunk-UDKZWFCM.cjs} +1251 -454
- 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 +696 -34
- package/dist/{types-BLIqLF0c.d.ts → types-DGQzvl6v.d.ts} +12 -1
- package/dist/{types-7IoN8k-P.d.cts → types-DJ1fzNC7.d.cts} +12 -1
- 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 +5 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NFE5ZLD3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-MBURQ26S.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-IUW3SJQT.mjs";
|
|
9
|
+
import "./chunk-SDZKKUCJ.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
import { useCallback, useMemo } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUDKZWFCMcjs = require('./chunk-UDKZWFCM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-FLVSQDP4.cjs');
|
|
9
|
+
require('./chunk-MUWVDVY4.cjs');
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
|
|
|
32
32
|
reown.disconnect();
|
|
33
33
|
}, [reown.disconnect]);
|
|
34
34
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
35
|
-
|
|
35
|
+
_chunkUDKZWFCMcjs.DepositModalInner,
|
|
36
36
|
{
|
|
37
37
|
...props,
|
|
38
38
|
reownWallet: reownWithSolana,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5FDIQNJJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-MBURQ26S.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-IUW3SJQT.mjs";
|
|
9
|
+
import "./chunk-SDZKKUCJ.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
import { useCallback } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLTLFJPHOcjs = require('./chunk-LTLFJPHO.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-FLVSQDP4.cjs');
|
|
9
|
+
require('./chunk-MUWVDVY4.cjs');
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
|
|
|
20
20
|
reown.disconnect();
|
|
21
21
|
}, [reown.disconnect]);
|
|
22
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
-
|
|
23
|
+
_chunkLTLFJPHOcjs.WithdrawModalInner,
|
|
24
24
|
{
|
|
25
25
|
...props,
|
|
26
26
|
reownWallet: reown,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
saveSessionOwnerToStorage,
|
|
22
22
|
toEvmCaip2,
|
|
23
23
|
useLatestRef
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IUW3SJQT.mjs";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_BACKEND_URL,
|
|
27
27
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
getTokenDecimalsByAddress,
|
|
35
35
|
getTokenIcon,
|
|
36
36
|
getTokenSymbol
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SDZKKUCJ.mjs";
|
|
38
38
|
|
|
39
39
|
// src/WithdrawModal.tsx
|
|
40
40
|
import {
|
|
@@ -894,6 +894,11 @@ function WithdrawFlow({
|
|
|
894
894
|
const onStepChangeRef = useLatestRef(onStepChange);
|
|
895
895
|
const onTotalBalanceChangeRef = useLatestRef(onTotalBalanceChange);
|
|
896
896
|
const onEventRef = useLatestRef(onEvent);
|
|
897
|
+
const onConnectedRef = useLatestRef(onConnected);
|
|
898
|
+
const onWithdrawSubmittedRef = useLatestRef(onWithdrawSubmitted);
|
|
899
|
+
const onWithdrawCompleteRef = useLatestRef(onWithdrawComplete);
|
|
900
|
+
const onWithdrawFailedRef = useLatestRef(onWithdrawFailed);
|
|
901
|
+
const onErrorRef = useLatestRef(onError);
|
|
897
902
|
const [step, setStep] = useState2({ type: "form" });
|
|
898
903
|
const [isSubmitting, setIsSubmitting] = useState2(false);
|
|
899
904
|
const [totalBalanceUsd, setTotalBalanceUsd] = useState2(0);
|
|
@@ -1072,16 +1077,16 @@ function WithdrawFlow({
|
|
|
1072
1077
|
const handleConnected = useCallback2(
|
|
1073
1078
|
(addr, smartAccount) => {
|
|
1074
1079
|
logFlow("setup:connected", { address: addr, smartAccount });
|
|
1075
|
-
|
|
1080
|
+
onConnectedRef.current?.({ address: addr, smartAccount });
|
|
1076
1081
|
},
|
|
1077
|
-
[logFlow,
|
|
1082
|
+
[logFlow, onConnectedRef]
|
|
1078
1083
|
);
|
|
1079
1084
|
const handleError = useCallback2(
|
|
1080
1085
|
(message, code) => {
|
|
1081
1086
|
logFlowError("flow:error", message, { code });
|
|
1082
|
-
|
|
1087
|
+
onErrorRef.current?.({ message, code });
|
|
1083
1088
|
},
|
|
1084
|
-
[logFlowError,
|
|
1089
|
+
[logFlowError, onErrorRef]
|
|
1085
1090
|
);
|
|
1086
1091
|
const resolveSessionOwner = useCallback2(async (eoaAddress) => {
|
|
1087
1092
|
const localOwner = loadSessionOwnerFromStorage(eoaAddress);
|
|
@@ -1102,7 +1107,7 @@ function WithdrawFlow({
|
|
|
1102
1107
|
async (recipient, amountValue) => {
|
|
1103
1108
|
const tokenSymbol = getTokenSymbol(targetToken, targetChain);
|
|
1104
1109
|
const chainName = getChainName(targetChain);
|
|
1105
|
-
|
|
1110
|
+
onEventRef.current?.({
|
|
1106
1111
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1107
1112
|
pred_balance: totalBalanceUsd,
|
|
1108
1113
|
selected_token: tokenSymbol,
|
|
@@ -1242,7 +1247,7 @@ function WithdrawFlow({
|
|
|
1242
1247
|
sourceChain,
|
|
1243
1248
|
sourceToken
|
|
1244
1249
|
});
|
|
1245
|
-
|
|
1250
|
+
onWithdrawSubmittedRef.current?.({
|
|
1246
1251
|
txHash: result.txHash,
|
|
1247
1252
|
sourceChain,
|
|
1248
1253
|
amount: amountUnits.toString(),
|
|
@@ -1284,20 +1289,20 @@ function WithdrawFlow({
|
|
|
1284
1289
|
safeAddress,
|
|
1285
1290
|
sourceToken,
|
|
1286
1291
|
sourceChain,
|
|
1287
|
-
onWithdrawSubmitted,
|
|
1288
1292
|
onSignTransaction,
|
|
1289
1293
|
isSourceNative,
|
|
1290
1294
|
handleError,
|
|
1291
1295
|
logFlow,
|
|
1292
1296
|
logFlowError,
|
|
1293
|
-
|
|
1294
|
-
totalBalanceUsd
|
|
1297
|
+
onEventRef,
|
|
1298
|
+
totalBalanceUsd,
|
|
1299
|
+
onWithdrawSubmittedRef
|
|
1295
1300
|
]
|
|
1296
1301
|
);
|
|
1297
1302
|
const handleWithdrawComplete = useCallback2(
|
|
1298
1303
|
(txHash, destinationTxHash, context) => {
|
|
1299
1304
|
logFlow("withdraw:complete", { txHash, destinationTxHash, ...context });
|
|
1300
|
-
|
|
1305
|
+
onWithdrawCompleteRef.current?.({
|
|
1301
1306
|
txHash,
|
|
1302
1307
|
destinationTxHash,
|
|
1303
1308
|
amount: context.amount,
|
|
@@ -1307,14 +1312,14 @@ function WithdrawFlow({
|
|
|
1307
1312
|
targetToken: context.targetToken
|
|
1308
1313
|
});
|
|
1309
1314
|
},
|
|
1310
|
-
[logFlow,
|
|
1315
|
+
[logFlow, onWithdrawCompleteRef]
|
|
1311
1316
|
);
|
|
1312
1317
|
const handleWithdrawFailed = useCallback2(
|
|
1313
1318
|
(txHash, error) => {
|
|
1314
1319
|
logFlowError("withdraw:failed", error, { txHash });
|
|
1315
|
-
|
|
1320
|
+
onWithdrawFailedRef.current?.({ txHash, error });
|
|
1316
1321
|
},
|
|
1317
|
-
[logFlowError,
|
|
1322
|
+
[logFlowError, onWithdrawFailedRef]
|
|
1318
1323
|
);
|
|
1319
1324
|
const allowedChainSet = useMemo2(
|
|
1320
1325
|
() => allowedRoutes?.sourceChains ? new Set(allowedRoutes.sourceChains) : null,
|
|
@@ -1475,7 +1480,7 @@ function WithdrawFlow({
|
|
|
1475
1480
|
// src/WithdrawModal.tsx
|
|
1476
1481
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1477
1482
|
var ReownWithdrawInner = lazy(
|
|
1478
|
-
() => import("./WithdrawModalReown-
|
|
1483
|
+
() => import("./WithdrawModalReown-6VYKKKJN.mjs").then((m) => ({
|
|
1479
1484
|
default: m.WithdrawModalReown
|
|
1480
1485
|
}))
|
|
1481
1486
|
);
|
|
@@ -1543,10 +1548,8 @@ function WithdrawModalInner({
|
|
|
1543
1548
|
applyTheme(modalRef.current, theme);
|
|
1544
1549
|
}
|
|
1545
1550
|
}, [isOpen, theme]);
|
|
1546
|
-
const hasCalledReady = useRef3(false);
|
|
1547
1551
|
useEffect3(() => {
|
|
1548
|
-
if (isOpen
|
|
1549
|
-
hasCalledReady.current = true;
|
|
1552
|
+
if (isOpen) {
|
|
1550
1553
|
onReadyRef.current?.();
|
|
1551
1554
|
}
|
|
1552
1555
|
}, [isOpen, onReadyRef]);
|