@multiversx/sdk-dapp-liquidity 1.1.0-alpha.2 → 1.1.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/api/getTransactions.d.ts +8 -2
- package/api/getTransactions.js +23 -3
- package/api/getTransactions.mjs +23 -3
- package/api/tests/getChains.spec.js +2 -1
- package/api/tests/getChains.spec.mjs +2 -1
- package/api/tests/getTokens.spec.js +2 -2
- package/api/tests/getTokens.spec.mjs +2 -2
- package/api/tests/getTransactions.spec.js +79 -69
- package/api/tests/getTransactions.spec.mjs +79 -69
- package/constants/index.d.ts +1 -1
- package/constants/index.js +1 -1
- package/constants/index.mjs +1 -1
- package/dto/Chain.dto.d.ts +3 -1
- package/dto/ConfirmRate.dto.d.ts +1 -0
- package/dto/Token.dto.d.ts +7 -2
- package/index.js +44 -16
- package/index.mjs +14 -16
- package/package.json +10 -6
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +3 -1
- package/reactjs/components/BridgeForm/BridgeForm.js +182 -87
- package/reactjs/components/BridgeForm/BridgeForm.mjs +153 -58
- package/reactjs/components/BridgeHistory/BridgeHistory.js +73 -26
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +68 -21
- package/reactjs/components/Connect/BridgeAccountDisplay.js +2 -5
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +2 -5
- package/reactjs/components/Connect/CustomConnectButton.js +2 -5
- package/reactjs/components/Connect/CustomConnectButton.mjs +1 -4
- package/reactjs/components/Connect/MvxConnectButton.d.ts +2 -4
- package/reactjs/components/Connect/MvxConnectButton.js +2 -2
- package/reactjs/components/Connect/MvxConnectButton.mjs +2 -2
- package/reactjs/components/Connect/SwitchChainButton.js +2 -6
- package/reactjs/components/Connect/SwitchChainButton.mjs +1 -5
- package/reactjs/components/CopyButton/CopyButton.js +2 -2
- package/reactjs/components/CopyButton/CopyButton.mjs +2 -2
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +5 -5
- package/reactjs/components/Error/Error.d.ts +6 -0
- package/reactjs/components/Error/Error.js +67 -0
- package/reactjs/components/Error/Error.mjs +66 -0
- package/reactjs/components/Error/index.d.ts +1 -0
- package/reactjs/components/Error/index.js +5 -0
- package/reactjs/components/Error/index.mjs +4 -0
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +2 -1
- package/reactjs/components/TokenSelector/TokenSelector.js +17 -9
- package/reactjs/components/TokenSelector/TokenSelector.mjs +13 -5
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +7 -3
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +4 -0
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/SelectContent.js +12 -9
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +4 -1
- package/reactjs/components/TokenSelector/components/TokenIcon.js +3 -3
- package/reactjs/components/TokenSelector/components/TokenItem.js +9 -9
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +6 -6
- package/reactjs/components/base/MxCard/MxCard.js +2 -2
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.d.ts +4 -0
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +29 -0
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +28 -0
- package/reactjs/components/base/MxCircleLoader/index.d.ts +1 -0
- package/reactjs/components/base/MxCircleLoader/index.js +5 -0
- package/reactjs/components/base/MxCircleLoader/index.mjs +4 -0
- package/reactjs/components/base/MxLink/MxLink.js +2 -2
- package/reactjs/components/base/MxSearch/MxSearch.js +4 -4
- package/reactjs/components/base/MxSlideover/MxSlideover.js +4 -4
- package/reactjs/components/base/MxTooltip/MxTooltip.js +9 -9
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +2 -2
- package/reactjs/components/index.d.ts +1 -0
- package/reactjs/components/index.js +2 -0
- package/reactjs/components/index.mjs +2 -0
- package/reactjs/context/Web3AppProvider.d.ts +3 -1
- package/reactjs/context/Web3AppProvider.js +7 -5
- package/reactjs/context/Web3AppProvider.mjs +4 -2
- package/reactjs/context/useWeb3App.js +2 -2
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +1 -1
- package/reactjs/hooks/useAccount.js +1 -5
- package/reactjs/hooks/useAccount.mjs +1 -5
- package/reactjs/hooks/useBalances.d.ts +4 -4
- package/reactjs/hooks/useBalances.js +16 -1
- package/reactjs/hooks/useBalances.mjs +16 -1
- package/reactjs/hooks/useBridgeFormik.js +9 -16
- package/reactjs/hooks/useBridgeFormik.mjs +0 -7
- package/reactjs/hooks/useDebounce.js +3 -3
- package/reactjs/hooks/useFetchBridgeData.d.ts +14 -4
- package/reactjs/hooks/useFetchTokens.d.ts +14 -4
- package/reactjs/hooks/useFetchTokens.js +9 -9
- package/reactjs/hooks/useFetchTokens.mjs +2 -2
- package/reactjs/hooks/useFiatData.d.ts +7 -2
- package/reactjs/hooks/useFiatData.js +6 -6
- package/reactjs/hooks/useFiatData.mjs +1 -1
- package/reactjs/hooks/useGetChainId.js +3 -3
- package/reactjs/hooks/useGetChainId.mjs +1 -1
- package/reactjs/hooks/useResolveTokenChain.js +2 -2
- package/reactjs/hooks/useSendTransactions.js +2 -2
- package/reactjs/hooks/useSignTransaction.d.ts +93 -67
- package/reactjs/hooks/useSignTransaction.js +53 -4
- package/reactjs/hooks/useSignTransaction.mjs +53 -4
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
- package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
- package/reactjs/index.js +44 -16
- package/reactjs/index.mjs +14 -16
- package/reactjs/init/init.d.ts +220 -1
- package/reactjs/init/init.js +34 -10
- package/reactjs/init/init.mjs +31 -7
- package/reactjs/init/tests/init.spec.js +5 -6
- package/reactjs/init/tests/init.spec.mjs +5 -6
- package/reactjs/queries/index.d.ts +0 -1
- package/reactjs/queries/index.js +0 -2
- package/reactjs/queries/index.mjs +1 -3
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +8 -3
- package/reactjs/queries/useGetEvmTokensBalances.query.js +15 -18
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +15 -18
- package/reactjs/queries/useGetHistory.query.d.ts +9 -1
- package/reactjs/queries/useGetHistory.query.js +23 -5
- package/reactjs/queries/useGetHistory.query.mjs +23 -5
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +7 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.js +2 -2
- package/reactjs/reexports.d.ts +2 -1
- package/reactjs/reexports.js +41 -13
- package/reactjs/reexports.mjs +11 -13
- package/reactjs/utils/getInitialTokens.d.ts +4 -1
- package/reactjs/utils/getInitialTokens.js +3 -3
- package/reactjs/utils/getInitialTokens.mjs +3 -3
- package/style.css +33 -1730
- package/types/chainType.d.ts +6 -0
- package/types/chainType.js +11 -0
- package/types/chainType.mjs +10 -0
- package/types/transaction.d.ts +28 -0
- package/types/utxo.d.ts +11 -0
- package/types/utxo.js +2 -0
- package/types/utxo.mjs +1 -0
- package/{useBalances-C_69CFoa.mjs → useBalances-Bom1mw1J.mjs} +101 -23
- package/{useBalances-C4YhEYxy.js → useBalances-gZTsFZHe.js} +102 -24
- package/index-BIVnypNe.mjs +0 -108
- package/index-Ben8n3bd.js +0 -58656
- package/index-CnKr4rL1.mjs +0 -91
- package/index-CnuruJNu.js +0 -329
- package/index-DsBh-EBw.js +0 -108
- package/index-iN9APQ6x.mjs +0 -58735
- package/modules/fiat/components/FiatForm/FiatForm.d.ts +0 -9
- package/modules/fiat/components/FiatForm/FiatForm.js +0 -314
- package/modules/fiat/components/FiatForm/FiatForm.mjs +0 -313
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.d.ts +0 -13
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.js +0 -117
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.mjs +0 -116
- package/modules/fiat/components/FiatForm/components/AmountInput/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/AmountInput/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/AmountInput/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.js +0 -74
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.mjs +0 -73
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.d.ts +0 -14
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.js +0 -94
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.mjs +0 -93
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.js +0 -82
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.mjs +0 -81
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.js +0 -91
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.mjs +0 -90
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.d.ts +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.js +0 -30
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.mjs +0 -29
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.d.ts +0 -8
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.js +0 -103
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.mjs +0 -102
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.js +0 -33
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.mjs +0 -32
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.js +0 -21
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.mjs +0 -20
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.d.ts +0 -9
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.js +0 -26
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.mjs +0 -25
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/index.js +0 -5
- package/modules/fiat/components/FiatForm/index.mjs +0 -4
- package/modules/fiat/components/index.d.ts +0 -1
- package/modules/fiat/components/index.js +0 -5
- package/modules/fiat/components/index.mjs +0 -4
- package/modules/fiat/context/FiatProvider.d.ts +0 -8
- package/modules/fiat/context/FiatProvider.js +0 -24
- package/modules/fiat/context/FiatProvider.mjs +0 -23
- package/modules/fiat/context/queryClient.d.ts +0 -3
- package/modules/fiat/context/queryClient.js +0 -12
- package/modules/fiat/context/queryClient.mjs +0 -11
- package/modules/fiat/context/useFiat.d.ts +0 -1
- package/modules/fiat/context/useFiat.js +0 -13
- package/modules/fiat/context/useFiat.mjs +0 -12
- package/modules/fiat/hooks/index.d.ts +0 -2
- package/modules/fiat/hooks/index.js +0 -7
- package/modules/fiat/hooks/index.mjs +0 -6
- package/modules/fiat/hooks/useFiatData.d.ts +0 -7
- package/modules/fiat/hooks/useFiatData.js +0 -75
- package/modules/fiat/hooks/useFiatData.mjs +0 -74
- package/modules/fiat/hooks/validation/index.d.ts +0 -1
- package/modules/fiat/hooks/validation/index.js +0 -5
- package/modules/fiat/hooks/validation/index.mjs +0 -4
- package/modules/fiat/hooks/validation/useAmountSchema.d.ts +0 -2
- package/modules/fiat/hooks/validation/useAmountSchema.js +0 -27
- package/modules/fiat/hooks/validation/useAmountSchema.mjs +0 -9
- package/modules/fiat/index.d.ts +0 -8
- package/modules/fiat/index.js +0 -22
- package/modules/fiat/index.mjs +0 -21
- package/modules/fiat/init/index.d.ts +0 -2
- package/modules/fiat/init/index.js +0 -5
- package/modules/fiat/init/index.mjs +0 -4
- package/modules/fiat/init/init.d.ts +0 -22
- package/modules/fiat/init/init.js +0 -15
- package/modules/fiat/init/init.mjs +0 -14
- package/modules/fiat/queries/index.d.ts +0 -2
- package/modules/fiat/queries/index.js +0 -7
- package/modules/fiat/queries/index.mjs +0 -6
- package/modules/fiat/queries/useGetRate.mutation.d.ts +0 -6
- package/modules/fiat/queries/useGetRate.mutation.js +0 -20
- package/modules/fiat/queries/useGetRate.mutation.mjs +0 -19
- package/modules/fiat/queries/useGetTokens.query.d.ts +0 -5
- package/modules/fiat/queries/useGetTokens.query.js +0 -33
- package/modules/fiat/queries/useGetTokens.query.mjs +0 -32
- package/react-47kZTyAT.mjs +0 -51
- package/react-B_iI3-1z.mjs +0 -3133
- package/react-BomcNL1v.js +0 -254
- package/react-CqKlu0W0.js +0 -51
- package/react-R_xxu7fN.js +0 -3133
- package/react-cXurUY4Z.mjs +0 -254
- package/reactjs/queries/useGetTokens.query.d.ts +0 -3
- package/reactjs/queries/useGetTokens.query.js +0 -34
- package/reactjs/queries/useGetTokens.query.mjs +0 -33
- package/w3m-modal-Bhg44d6I.js +0 -356
- package/w3m-modal-Br2Ec3MM.mjs +0 -356
|
@@ -19,6 +19,7 @@ const TokenSelector = ({
|
|
|
19
19
|
areOptionsLoading = false,
|
|
20
20
|
className = "",
|
|
21
21
|
disabled = false,
|
|
22
|
+
isMvxSelector = false,
|
|
22
23
|
omitDisableClass = false,
|
|
23
24
|
color = "neutral-750",
|
|
24
25
|
onBlur,
|
|
@@ -32,10 +33,16 @@ const TokenSelector = ({
|
|
|
32
33
|
token: selectedOption
|
|
33
34
|
});
|
|
34
35
|
const chains = useMemo(() => {
|
|
36
|
+
if (isMvxSelector) {
|
|
37
|
+
return (data == null ? void 0 : data.filter(
|
|
38
|
+
(chain) => MVX_CHAIN_IDS.includes(chain.chainId.toString())
|
|
39
|
+
)) ?? [];
|
|
40
|
+
}
|
|
35
41
|
return (data == null ? void 0 : data.filter(
|
|
36
|
-
(chain) => !MVX_CHAIN_IDS.includes(
|
|
42
|
+
(chain) => !MVX_CHAIN_IDS.includes(chain.chainId.toString())
|
|
37
43
|
)) ?? [];
|
|
38
44
|
}, [data]);
|
|
45
|
+
const isVisuallyDisabled = disabled || chains.length < 2;
|
|
39
46
|
const handleOnClick = () => setShow(true);
|
|
40
47
|
useEffect(() => {
|
|
41
48
|
onTokenSelectorDisplay == null ? void 0 : onTokenSelectorDisplay(show);
|
|
@@ -69,6 +76,7 @@ const TokenSelector = ({
|
|
|
69
76
|
},
|
|
70
77
|
tokens: options,
|
|
71
78
|
chains,
|
|
79
|
+
isMvxSelector,
|
|
72
80
|
areChainsLoading,
|
|
73
81
|
selectedToken: selectedOption
|
|
74
82
|
}
|
|
@@ -90,19 +98,19 @@ const TokenSelector = ({
|
|
|
90
98
|
"liq-bg-neutral-900/50 liq-outline liq-outline-1 liq-outline-neutral-700/20 hover:enabled:liq-bg-neutral-600/50 hover:enabled:liq-outline-neutral-600": color === "neutral-850"
|
|
91
99
|
},
|
|
92
100
|
{
|
|
93
|
-
"disabled:!liq-opacity-70":
|
|
101
|
+
"disabled:!liq-opacity-70": isVisuallyDisabled && !omitDisableClass
|
|
94
102
|
},
|
|
95
103
|
{
|
|
96
|
-
"!liq-cursor-not-allowed !liq-bg-transparent !liq-outline-transparent":
|
|
104
|
+
"!liq-cursor-not-allowed !liq-bg-transparent !liq-outline-transparent": isVisuallyDisabled
|
|
97
105
|
},
|
|
98
106
|
className
|
|
99
107
|
),
|
|
100
108
|
onBlur,
|
|
101
109
|
onClick: handleOnClick,
|
|
102
|
-
disabled,
|
|
110
|
+
disabled: isVisuallyDisabled,
|
|
103
111
|
children: [
|
|
104
112
|
/* @__PURE__ */ jsx(SelectedOption, { value: selectedOption }),
|
|
105
|
-
!
|
|
113
|
+
!isVisuallyDisabled && /* @__PURE__ */ jsx(
|
|
106
114
|
FontAwesomeIcon,
|
|
107
115
|
{
|
|
108
116
|
icon: faChevronDown,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ChainDTO } from '../../../../../dto/Chain.dto';
|
|
2
2
|
|
|
3
|
-
export declare const ChainSelect: ({ isLoading, selectedChainId, onChange, chains }: {
|
|
3
|
+
export declare const ChainSelect: ({ isLoading, selectedChainId, ignoreAllChains, onChange, chains }: {
|
|
4
4
|
isLoading?: boolean;
|
|
5
5
|
selectedChainId?: string;
|
|
6
|
+
ignoreAllChains?: boolean;
|
|
6
7
|
onChange?: (chainId: string) => void;
|
|
7
8
|
chains: ChainDTO[];
|
|
8
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const React = require("react");
|
|
6
6
|
const Select = require("react-select");
|
|
7
7
|
const reactjs_components_TokenSelector_components_ChainSelect_components_FormatChainOptionLabel = require("./components/FormatChainOptionLabel.js");
|
|
8
8
|
const reactjs_components_TokenSelector_components_ChainSelect_components_IndicatorSeparator = require("./components/IndicatorSeparator.js");
|
|
@@ -12,10 +12,11 @@ const reactjs_constants_chains = require("../../../../constants/chains.js");
|
|
|
12
12
|
const ChainSelect = ({
|
|
13
13
|
isLoading,
|
|
14
14
|
selectedChainId,
|
|
15
|
+
ignoreAllChains = false,
|
|
15
16
|
onChange,
|
|
16
17
|
chains
|
|
17
18
|
}) => {
|
|
18
|
-
const chainOptions =
|
|
19
|
+
const chainOptions = React.useMemo(() => {
|
|
19
20
|
const options = chains.map((chain) => ({
|
|
20
21
|
label: chain.networkName,
|
|
21
22
|
value: chain.chainId.toString(),
|
|
@@ -26,6 +27,9 @@ const ChainSelect = ({
|
|
|
26
27
|
svgUrl: chain.svgUrl
|
|
27
28
|
}
|
|
28
29
|
}));
|
|
30
|
+
if (ignoreAllChains) {
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
29
33
|
options.unshift({
|
|
30
34
|
label: "All",
|
|
31
35
|
value: reactjs_constants_chains.ALL_NETWORK_ID,
|
|
@@ -38,7 +42,7 @@ const ChainSelect = ({
|
|
|
38
42
|
});
|
|
39
43
|
return options;
|
|
40
44
|
}, [chains]);
|
|
41
|
-
const selectedChain =
|
|
45
|
+
const selectedChain = React.useMemo(() => {
|
|
42
46
|
return chainOptions.find(
|
|
43
47
|
(chainOption) => chainOption.value.toString() === (selectedChainId == null ? void 0 : selectedChainId.toString())
|
|
44
48
|
) ?? (chainOptions == null ? void 0 : chainOptions[0]);
|
|
@@ -9,6 +9,7 @@ import { ALL_NETWORK_ID } from "../../../../constants/chains.mjs";
|
|
|
9
9
|
const ChainSelect = ({
|
|
10
10
|
isLoading,
|
|
11
11
|
selectedChainId,
|
|
12
|
+
ignoreAllChains = false,
|
|
12
13
|
onChange,
|
|
13
14
|
chains
|
|
14
15
|
}) => {
|
|
@@ -23,6 +24,9 @@ const ChainSelect = ({
|
|
|
23
24
|
svgUrl: chain.svgUrl
|
|
24
25
|
}
|
|
25
26
|
}));
|
|
27
|
+
if (ignoreAllChains) {
|
|
28
|
+
return options;
|
|
29
|
+
}
|
|
26
30
|
options.unshift({
|
|
27
31
|
label: "All",
|
|
28
32
|
value: ALL_NETWORK_ID,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { TokenType } from '../../../../types/token';
|
|
2
2
|
import { ChainDTO } from '../../../../dto/Chain.dto';
|
|
3
3
|
|
|
4
|
-
export declare const SelectContent: ({ onSelect, tokens, chains, areChainsLoading, selectedToken }: {
|
|
4
|
+
export declare const SelectContent: ({ onSelect, tokens, chains, isMvxSelector, areChainsLoading, selectedToken }: {
|
|
5
5
|
onSelect: (token: TokenType) => void;
|
|
6
6
|
tokens: TokenType[];
|
|
7
7
|
chains: ChainDTO[];
|
|
8
|
+
isMvxSelector?: boolean;
|
|
8
9
|
areChainsLoading?: boolean;
|
|
9
10
|
selectedToken?: TokenType;
|
|
10
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const React = require("react");
|
|
6
6
|
const reactjs_components_TokenSelector_components_ChainSelect_ChainSelect = require("./ChainSelect/ChainSelect.js");
|
|
7
7
|
const reactjs_components_TokenSelector_components_TokenList = require("./TokenList.js");
|
|
8
8
|
require("../../../constants/index.js");
|
|
@@ -13,17 +13,19 @@ const SelectContent = ({
|
|
|
13
13
|
onSelect,
|
|
14
14
|
tokens = [],
|
|
15
15
|
chains = [],
|
|
16
|
+
isMvxSelector = false,
|
|
16
17
|
areChainsLoading,
|
|
17
18
|
selectedToken
|
|
18
19
|
}) => {
|
|
19
|
-
|
|
20
|
-
const [
|
|
21
|
-
const
|
|
20
|
+
var _a;
|
|
21
|
+
const [filteredTokens, setFilteredTokens] = React.useState(tokens);
|
|
22
|
+
const [selected, setSelected] = React.useState(selectedToken);
|
|
23
|
+
const searchPatternRef = React.useRef("");
|
|
22
24
|
const activeChainId = reactjs_hooks_useGetChainId.useGetChainId();
|
|
23
|
-
const [selectedChainId, setSelectedChainId] =
|
|
24
|
-
(activeChainId == null ? void 0 : activeChainId.toString()) ?? reactjs_constants_chains.ALL_NETWORK_ID
|
|
25
|
+
const [selectedChainId, setSelectedChainId] = React.useState(
|
|
26
|
+
isMvxSelector ? ((_a = chains[0]) == null ? void 0 : _a.chainId.toString()) ?? reactjs_constants_chains.ALL_NETWORK_ID : (activeChainId == null ? void 0 : activeChainId.toString()) ?? reactjs_constants_chains.ALL_NETWORK_ID
|
|
25
27
|
);
|
|
26
|
-
const filteredTokensText =
|
|
28
|
+
const filteredTokensText = React.useMemo(() => {
|
|
27
29
|
const selectedChain = chains.find(
|
|
28
30
|
(chain) => chain.chainId.toString() === selectedChainId
|
|
29
31
|
);
|
|
@@ -50,11 +52,11 @@ const SelectContent = ({
|
|
|
50
52
|
);
|
|
51
53
|
setFilteredTokens(filtered);
|
|
52
54
|
};
|
|
53
|
-
|
|
55
|
+
React.useEffect(() => {
|
|
54
56
|
setFilteredTokens(tokens);
|
|
55
57
|
setSelected(selectedToken);
|
|
56
58
|
}, [selectedToken, tokens]);
|
|
57
|
-
|
|
59
|
+
React.useEffect(() => {
|
|
58
60
|
handleSearch(searchPatternRef.current);
|
|
59
61
|
}, [selectedChainId]);
|
|
60
62
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-relative liq-flex liq-max-w-full liq-flex-col liq-rounded-none liq-p-0 !liq-max-h-[22rem]", children: [
|
|
@@ -71,6 +73,7 @@ const SelectContent = ({
|
|
|
71
73
|
reactjs_components_TokenSelector_components_ChainSelect_ChainSelect.ChainSelect,
|
|
72
74
|
{
|
|
73
75
|
chains,
|
|
76
|
+
ignoreAllChains: isMvxSelector,
|
|
74
77
|
selectedChainId,
|
|
75
78
|
onChange: (chainId) => {
|
|
76
79
|
setSelectedChainId(chainId);
|
|
@@ -10,15 +10,17 @@ const SelectContent = ({
|
|
|
10
10
|
onSelect,
|
|
11
11
|
tokens = [],
|
|
12
12
|
chains = [],
|
|
13
|
+
isMvxSelector = false,
|
|
13
14
|
areChainsLoading,
|
|
14
15
|
selectedToken
|
|
15
16
|
}) => {
|
|
17
|
+
var _a;
|
|
16
18
|
const [filteredTokens, setFilteredTokens] = useState(tokens);
|
|
17
19
|
const [selected, setSelected] = useState(selectedToken);
|
|
18
20
|
const searchPatternRef = useRef("");
|
|
19
21
|
const activeChainId = useGetChainId();
|
|
20
22
|
const [selectedChainId, setSelectedChainId] = useState(
|
|
21
|
-
(activeChainId == null ? void 0 : activeChainId.toString()) ?? ALL_NETWORK_ID
|
|
23
|
+
isMvxSelector ? ((_a = chains[0]) == null ? void 0 : _a.chainId.toString()) ?? ALL_NETWORK_ID : (activeChainId == null ? void 0 : activeChainId.toString()) ?? ALL_NETWORK_ID
|
|
22
24
|
);
|
|
23
25
|
const filteredTokensText = useMemo(() => {
|
|
24
26
|
const selectedChain = chains.find(
|
|
@@ -68,6 +70,7 @@ const SelectContent = ({
|
|
|
68
70
|
ChainSelect,
|
|
69
71
|
{
|
|
70
72
|
chains,
|
|
73
|
+
ignoreAllChains: isMvxSelector,
|
|
71
74
|
selectedChainId,
|
|
72
75
|
onChange: (chainId) => {
|
|
73
76
|
setSelectedChainId(chainId);
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const faDiamond = require("@fortawesome/free-solid-svg-icons/faDiamond");
|
|
6
6
|
const reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
7
|
-
const
|
|
7
|
+
const React = require("react");
|
|
8
8
|
const _default = require("../../../../default-H3AbmzFV.js");
|
|
9
9
|
const reactjs_utils_mxClsx = require("../../../utils/mxClsx.js");
|
|
10
10
|
const TokenIcon = ({
|
|
@@ -12,7 +12,7 @@ const TokenIcon = ({
|
|
|
12
12
|
size = "lg",
|
|
13
13
|
className = ""
|
|
14
14
|
}) => {
|
|
15
|
-
const getIconComponent =
|
|
15
|
+
const getIconComponent = React.useCallback(
|
|
16
16
|
(assetTicker) => {
|
|
17
17
|
if (!assetTicker || !token) {
|
|
18
18
|
return /* @__PURE__ */ jsxRuntime.jsx("img", { src: _default.DefaultIcon, alt: "" });
|
|
@@ -28,7 +28,7 @@ const TokenIcon = ({
|
|
|
28
28
|
},
|
|
29
29
|
[token]
|
|
30
30
|
);
|
|
31
|
-
const IconComponent =
|
|
31
|
+
const IconComponent = React.useMemo(
|
|
32
32
|
() => getIconComponent(token == null ? void 0 : token.symbol),
|
|
33
33
|
[getIconComponent, token == null ? void 0 : token.symbol]
|
|
34
34
|
);
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const react = require("
|
|
6
|
-
const
|
|
7
|
-
const wagmi = require("wagmi");
|
|
5
|
+
const react = require("@reown/appkit/react");
|
|
6
|
+
const React = require("react");
|
|
8
7
|
const reactjs_components_TokenSelector_components_TokenIcon = require("./TokenIcon.js");
|
|
8
|
+
const reactjs_context_useWeb3App = require("../../../context/useWeb3App.js");
|
|
9
9
|
const reactjs_hooks_useGetChainId = require("../../../hooks/useGetChainId.js");
|
|
10
10
|
const reactjs_hooks_useResolveTokenChain = require("../../../hooks/useResolveTokenChain.js");
|
|
11
11
|
const TokenItem = ({
|
|
@@ -16,20 +16,20 @@ const TokenItem = ({
|
|
|
16
16
|
const { tokenChain, chainIcon } = reactjs_hooks_useResolveTokenChain.useResolveTokenChain({
|
|
17
17
|
token
|
|
18
18
|
});
|
|
19
|
-
const {
|
|
19
|
+
const { supportedChains: sdkChains } = reactjs_context_useWeb3App.useWeb3App();
|
|
20
20
|
const { switchNetwork } = react.useAppKitNetwork();
|
|
21
21
|
const chainId = reactjs_hooks_useGetChainId.useGetChainId();
|
|
22
|
-
const activeChain =
|
|
23
|
-
return sdkChains.find(
|
|
22
|
+
const activeChain = React.useMemo(() => {
|
|
23
|
+
return sdkChains == null ? void 0 : sdkChains.find(
|
|
24
24
|
(chain) => chain.id.toString() === (chainId == null ? void 0 : chainId.toString())
|
|
25
25
|
);
|
|
26
26
|
}, [chainId, sdkChains]);
|
|
27
|
-
const handleSwitchChain =
|
|
27
|
+
const handleSwitchChain = React.useCallback(() => {
|
|
28
28
|
if (activeChain && (tokenChain == null ? void 0 : tokenChain.chainId) && (activeChain == null ? void 0 : activeChain.id.toString()) !== (tokenChain == null ? void 0 : tokenChain.chainId.toString())) {
|
|
29
29
|
switchNetwork(
|
|
30
|
-
sdkChains.find(
|
|
30
|
+
(sdkChains == null ? void 0 : sdkChains.find(
|
|
31
31
|
(chain) => chain.id.toString() === (tokenChain == null ? void 0 : tokenChain.chainId.toString())
|
|
32
|
-
) ?? activeChain
|
|
32
|
+
)) ?? activeChain
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
}, [activeChain, sdkChains, tokenChain == null ? void 0 : tokenChain.chainId, activeChain == null ? void 0 : activeChain.id]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useAppKitNetwork } from "@reown/appkit/react";
|
|
3
3
|
import { useMemo, useCallback } from "react";
|
|
4
|
-
import { useSwitchChain } from "wagmi";
|
|
5
4
|
import { TokenIcon } from "./TokenIcon.mjs";
|
|
5
|
+
import { useWeb3App } from "../../../context/useWeb3App.mjs";
|
|
6
6
|
import { useGetChainId } from "../../../hooks/useGetChainId.mjs";
|
|
7
7
|
import { useResolveTokenChain } from "../../../hooks/useResolveTokenChain.mjs";
|
|
8
8
|
const TokenItem = ({
|
|
@@ -13,20 +13,20 @@ const TokenItem = ({
|
|
|
13
13
|
const { tokenChain, chainIcon } = useResolveTokenChain({
|
|
14
14
|
token
|
|
15
15
|
});
|
|
16
|
-
const {
|
|
16
|
+
const { supportedChains: sdkChains } = useWeb3App();
|
|
17
17
|
const { switchNetwork } = useAppKitNetwork();
|
|
18
18
|
const chainId = useGetChainId();
|
|
19
19
|
const activeChain = useMemo(() => {
|
|
20
|
-
return sdkChains.find(
|
|
20
|
+
return sdkChains == null ? void 0 : sdkChains.find(
|
|
21
21
|
(chain) => chain.id.toString() === (chainId == null ? void 0 : chainId.toString())
|
|
22
22
|
);
|
|
23
23
|
}, [chainId, sdkChains]);
|
|
24
24
|
const handleSwitchChain = useCallback(() => {
|
|
25
25
|
if (activeChain && (tokenChain == null ? void 0 : tokenChain.chainId) && (activeChain == null ? void 0 : activeChain.id.toString()) !== (tokenChain == null ? void 0 : tokenChain.chainId.toString())) {
|
|
26
26
|
switchNetwork(
|
|
27
|
-
sdkChains.find(
|
|
27
|
+
(sdkChains == null ? void 0 : sdkChains.find(
|
|
28
28
|
(chain) => chain.id.toString() === (tokenChain == null ? void 0 : tokenChain.chainId.toString())
|
|
29
|
-
) ?? activeChain
|
|
29
|
+
)) ?? activeChain
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
}, [activeChain, sdkChains, tokenChain == null ? void 0 : tokenChain.chainId, activeChain == null ? void 0 : activeChain.id]);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const React = require("react");
|
|
6
6
|
const reactjs_utils_mxClsx = require("../../../utils/mxClsx.js");
|
|
7
|
-
const MxCard =
|
|
7
|
+
const MxCard = React.forwardRef(
|
|
8
8
|
(props, ref) => {
|
|
9
9
|
const {
|
|
10
10
|
children,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const reactjs_utils_mxClsx = require("../../../utils/mxClsx.js");
|
|
6
|
+
const MxCircleLoader = ({
|
|
7
|
+
containerClassName = "",
|
|
8
|
+
spinnerClassName = ""
|
|
9
|
+
}) => {
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: reactjs_utils_mxClsx.mxClsx(
|
|
14
|
+
"liq-flex liq-h-full liq-w-full liq-items-center liq-justify-center",
|
|
15
|
+
containerClassName
|
|
16
|
+
),
|
|
17
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: reactjs_utils_mxClsx.mxClsx(
|
|
21
|
+
"liq-loader liq-inline-block liq-h-10 liq-w-10 liq-animate-spin liq-rounded-full liq-border-4 liq-border-primary-400 liq-border-t-neutral-850",
|
|
22
|
+
spinnerClassName
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
exports.MxCircleLoader = MxCircleLoader;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { mxClsx } from "../../../utils/mxClsx.mjs";
|
|
3
|
+
const MxCircleLoader = ({
|
|
4
|
+
containerClassName = "",
|
|
5
|
+
spinnerClassName = ""
|
|
6
|
+
}) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
className: mxClsx(
|
|
11
|
+
"liq-flex liq-h-full liq-w-full liq-items-center liq-justify-center",
|
|
12
|
+
containerClassName
|
|
13
|
+
),
|
|
14
|
+
children: /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: mxClsx(
|
|
18
|
+
"liq-loader liq-inline-block liq-h-10 liq-w-10 liq-animate-spin liq-rounded-full liq-border-4 liq-border-primary-400 liq-border-t-neutral-850",
|
|
19
|
+
spinnerClassName
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
MxCircleLoader
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MxCircleLoader';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const reactjs_components_base_MxCircleLoader_MxCircleLoader = require("./MxCircleLoader.js");
|
|
5
|
+
exports.MxCircleLoader = reactjs_components_base_MxCircleLoader_MxCircleLoader.MxCircleLoader;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const faArrowUpRightFromSquare = require("@fortawesome/free-solid-svg-icons/faArrowUpRightFromSquare");
|
|
6
6
|
const reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
7
|
-
const
|
|
7
|
+
const React = require("react");
|
|
8
8
|
const reactjs_utils_mxClsx = require("../../../utils/mxClsx.js");
|
|
9
|
-
const MxLink =
|
|
9
|
+
const MxLink = React.forwardRef(
|
|
10
10
|
(props, ref) => {
|
|
11
11
|
const {
|
|
12
12
|
disabled,
|
|
@@ -5,10 +5,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const faClose = require("@fortawesome/free-solid-svg-icons/faClose");
|
|
6
6
|
const faSearch = require("@fortawesome/free-solid-svg-icons/faSearch");
|
|
7
7
|
const reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
8
|
-
const
|
|
8
|
+
const React = require("react");
|
|
9
9
|
const reactjs_hooks_useDebounce = require("../../../hooks/useDebounce.js");
|
|
10
10
|
const reactjs_utils_mxClsx = require("../../../utils/mxClsx.js");
|
|
11
|
-
const MxSearch =
|
|
11
|
+
const MxSearch = React.forwardRef(
|
|
12
12
|
(props, ref) => {
|
|
13
13
|
const {
|
|
14
14
|
iconsClassName = "",
|
|
@@ -18,10 +18,10 @@ const MxSearch = require$$0.forwardRef(
|
|
|
18
18
|
inputDefaultValue = "",
|
|
19
19
|
onChange
|
|
20
20
|
} = props;
|
|
21
|
-
const [inputValue, setInputValue] =
|
|
21
|
+
const [inputValue, setInputValue] = React.useState(inputDefaultValue);
|
|
22
22
|
const onDebounceInputChange = reactjs_hooks_useDebounce.useDebounce(inputValue, 200);
|
|
23
23
|
const onClear = () => setInputValue("");
|
|
24
|
-
|
|
24
|
+
React.useEffect(() => onChange(onDebounceInputChange), [onDebounceInputChange]);
|
|
25
25
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
@@ -5,7 +5,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const faClose = require("@fortawesome/free-solid-svg-icons/faClose");
|
|
6
6
|
const reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
7
7
|
const react = require("@headlessui/react");
|
|
8
|
-
const
|
|
8
|
+
const React = require("react");
|
|
9
9
|
const reactjs_utils_mxClsx = require("../../../utils/mxClsx.js");
|
|
10
10
|
const reactjs_components_base_MxButton_MxButton = require("../MxButton/MxButton.js");
|
|
11
11
|
const MxSlideover = ({
|
|
@@ -15,11 +15,11 @@ const MxSlideover = ({
|
|
|
15
15
|
className = "",
|
|
16
16
|
onClose
|
|
17
17
|
}) => {
|
|
18
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.Transition.Root, { show, as:
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Transition.Root, { show, as: React.Fragment, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Dialog, { as: "div", className: "liq-relative liq-z-30", onClose, children: [
|
|
19
19
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20
20
|
react.Transition.Child,
|
|
21
21
|
{
|
|
22
|
-
as:
|
|
22
|
+
as: React.Fragment,
|
|
23
23
|
enter: "liq-ease-in-out liq-duration-150",
|
|
24
24
|
enterFrom: "liq-opacity-0",
|
|
25
25
|
enterTo: "liq-opacity-100",
|
|
@@ -32,7 +32,7 @@ const MxSlideover = ({
|
|
|
32
32
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-fixed liq-inset-0 liq-overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-absolute liq-inset-0 liq-overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-pointer-events-none liq-fixed liq-inset-y-0 liq-right-0 liq-flex liq-max-w-full liq-p-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
33
|
react.Transition.Child,
|
|
34
34
|
{
|
|
35
|
-
as:
|
|
35
|
+
as: React.Fragment,
|
|
36
36
|
enter: "liq-transform liq-transition liq-ease-in-out liq-duration-150",
|
|
37
37
|
leave: "liq-transform liq-transition liq-ease-in-out liq-duration-150",
|
|
38
38
|
enterFrom: "liq-translate-y-full lg:liq-translate-y-0 lg:liq-translate-x-full",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const React = require("react");
|
|
6
6
|
const ReactDOM = require("react-dom");
|
|
7
7
|
const reactPopper = require("react-popper");
|
|
8
8
|
const reactjs_components_base_MxTooltip_components_TooltipContent_TooltipContent = require("./components/TooltipContent/TooltipContent.js");
|
|
@@ -26,10 +26,10 @@ const MxTooltip = ({
|
|
|
26
26
|
portalId,
|
|
27
27
|
isSlideoverOnMobile = false
|
|
28
28
|
}) => {
|
|
29
|
-
const [isHover, setIsHover] =
|
|
30
|
-
const [popperEl, setPopperEl] =
|
|
31
|
-
const [referenceEl, setReferenceEl] =
|
|
32
|
-
const [showSlideOver, setShowSlideOver] =
|
|
29
|
+
const [isHover, setIsHover] = React.useState(false);
|
|
30
|
+
const [popperEl, setPopperEl] = React.useState(null);
|
|
31
|
+
const [referenceEl, setReferenceEl] = React.useState(null);
|
|
32
|
+
const [showSlideOver, setShowSlideOver] = React.useState(false);
|
|
33
33
|
const isMobile = reactjs_constants_index.safeWindow.innerWidth < 768;
|
|
34
34
|
const { styles, attributes } = reactPopper.usePopper(referenceEl, popperEl, {
|
|
35
35
|
placement,
|
|
@@ -48,7 +48,7 @@ const MxTooltip = ({
|
|
|
48
48
|
});
|
|
49
49
|
const showEvents = ["mouseenter", "focus"];
|
|
50
50
|
const hideEvents = ["mouseleave", "blur"];
|
|
51
|
-
const hideTimeoutRef =
|
|
51
|
+
const hideTimeoutRef = React.useRef();
|
|
52
52
|
const show = () => {
|
|
53
53
|
if (hideTimeoutRef.current) {
|
|
54
54
|
clearTimeout(hideTimeoutRef.current);
|
|
@@ -60,14 +60,14 @@ const MxTooltip = ({
|
|
|
60
60
|
setIsHover(false);
|
|
61
61
|
}, hideDelayMs);
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
React.useEffect(() => {
|
|
64
64
|
return () => {
|
|
65
65
|
if (hideTimeoutRef.current) {
|
|
66
66
|
clearTimeout(hideTimeoutRef.current);
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
69
|
}, []);
|
|
70
|
-
|
|
70
|
+
React.useEffect(() => {
|
|
71
71
|
showEvents.forEach((event) => popperEl == null ? void 0 : popperEl.addEventListener(event, show));
|
|
72
72
|
hideEvents.forEach((event) => popperEl == null ? void 0 : popperEl.addEventListener(event, hide));
|
|
73
73
|
return () => {
|
|
@@ -75,7 +75,7 @@ const MxTooltip = ({
|
|
|
75
75
|
hideEvents.forEach((event) => popperEl == null ? void 0 : popperEl.removeEventListener(event, hide));
|
|
76
76
|
};
|
|
77
77
|
}, [popperEl]);
|
|
78
|
-
|
|
78
|
+
React.useEffect(() => {
|
|
79
79
|
showEvents.forEach((event) => referenceEl == null ? void 0 : referenceEl.addEventListener(event, show));
|
|
80
80
|
hideEvents.forEach((event) => referenceEl == null ? void 0 : referenceEl.addEventListener(event, hide));
|
|
81
81
|
return () => {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const React = require("react");
|
|
6
6
|
const reactjs_utils_mxClsx = require("../../../../../utils/mxClsx.js");
|
|
7
|
-
const TooltipContainer =
|
|
7
|
+
const TooltipContainer = React.forwardRef(({ children, variant, variantColor, containerClassName, onClick }, ref) => {
|
|
8
8
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
@@ -25,6 +25,7 @@ const reactjs_components_TokenSelector_TokenSelector = require("./TokenSelector/
|
|
|
25
25
|
const reactjs_components_TransactionToast_TransactionToastContainer = require("./TransactionToast/TransactionToastContainer.js");
|
|
26
26
|
const reactjs_components_TransactionToast_TransactionToast = require("./TransactionToast/TransactionToast.js");
|
|
27
27
|
const reactjs_components_TrimAddress_TrimAddress = require("./TrimAddress/TrimAddress.js");
|
|
28
|
+
const reactjs_components_Error_Error = require("./Error/Error.js");
|
|
28
29
|
exports.AccountAddress = reactjs_components_AccountAddress_AccountAddress.AccountAddress;
|
|
29
30
|
exports.AmountCard = reactjs_components_AmountCard_AmountCard.AmountCard;
|
|
30
31
|
exports.AmountInput = reactjs_components_AmountInput_AmountInput.AmountInput;
|
|
@@ -49,3 +50,4 @@ exports.TokenSelector = reactjs_components_TokenSelector_TokenSelector.TokenSele
|
|
|
49
50
|
exports.TransactionToastContainer = reactjs_components_TransactionToast_TransactionToastContainer.TransactionToastContainer;
|
|
50
51
|
exports.TransactionToast = reactjs_components_TransactionToast_TransactionToast.TransactionToast;
|
|
51
52
|
exports.TrimAddress = reactjs_components_TrimAddress_TrimAddress.TrimAddress;
|
|
53
|
+
exports.Error = reactjs_components_Error_Error.Error;
|
|
@@ -22,6 +22,7 @@ import { TokenSelector } from "./TokenSelector/TokenSelector.mjs";
|
|
|
22
22
|
import { TransactionToastContainer } from "./TransactionToast/TransactionToastContainer.mjs";
|
|
23
23
|
import { TransactionToast } from "./TransactionToast/TransactionToast.mjs";
|
|
24
24
|
import { TrimAddress } from "./TrimAddress/TrimAddress.mjs";
|
|
25
|
+
import { Error } from "./Error/Error.mjs";
|
|
25
26
|
export {
|
|
26
27
|
AccountAddress,
|
|
27
28
|
AmountCard,
|
|
@@ -33,6 +34,7 @@ export {
|
|
|
33
34
|
CopyButton,
|
|
34
35
|
CustomConnectButton,
|
|
35
36
|
DisplayAmount,
|
|
37
|
+
Error,
|
|
36
38
|
MvxAccountDisplay,
|
|
37
39
|
MvxConnectButton,
|
|
38
40
|
MxButton,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { InitOptions } from '../init/init';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { ResolvedRegister } from '@wagmi/core';
|
|
4
|
+
import { AppKitNetwork } from '@reown/appkit-common';
|
|
4
5
|
import { AppKit } from '@reown/appkit/react';
|
|
5
6
|
|
|
6
7
|
export type Web3AppContextProps = {
|
|
7
8
|
config: ResolvedRegister['config'];
|
|
8
9
|
appKit: AppKit;
|
|
9
10
|
options: InitOptions;
|
|
11
|
+
supportedChains: AppKitNetwork[];
|
|
10
12
|
};
|
|
11
13
|
export declare const Web3AppContext: import('react').Context<Web3AppContextProps | undefined>;
|
|
12
|
-
export declare function Web3AppProvider({ children, config, appKit, options }: PropsWithChildren<Web3AppContextProps>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function Web3AppProvider({ children, config, appKit, options, supportedChains }: PropsWithChildren<Web3AppContextProps>): import("react/jsx-runtime").JSX.Element;
|