@multiversx/sdk-dapp-liquidity 1.0.8 → 1.0.9
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/index.js +1 -0
- package/index.mjs +2 -1
- package/package.json +1 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +4 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +4 -2
- package/reactjs/components/TokenSelector/components/SelectContent.js +4 -2
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +4 -2
- package/reactjs/constants/chains.d.ts +1 -0
- package/reactjs/constants/chains.js +2 -0
- package/reactjs/constants/chains.mjs +2 -0
- package/reactjs/constants/index.js +1 -0
- package/reactjs/constants/index.mjs +2 -1
- package/reactjs/index.js +1 -0
- package/reactjs/index.mjs +2 -1
package/index.js
CHANGED
|
@@ -178,6 +178,7 @@ Object.defineProperty(exports, "useWaitForTransactionReceipt", {
|
|
|
178
178
|
enumerable: true,
|
|
179
179
|
get: () => wagmi.useWaitForTransactionReceipt
|
|
180
180
|
});
|
|
181
|
+
exports.ALL_NETWORK_ID = reactjs_constants_chains.ALL_NETWORK_ID;
|
|
181
182
|
exports.chainIdentifier = reactjs_constants_chains.chainIdentifier;
|
|
182
183
|
exports.useAppKit = index.useAppKit;
|
|
183
184
|
exports.useAppKitEvents = index.useAppKitEvents;
|
package/index.mjs
CHANGED
|
@@ -80,10 +80,11 @@ import { roundAmount } from "./reactjs/utils/roundAmount.mjs";
|
|
|
80
80
|
import { testNumber } from "./reactjs/utils/testNumber.mjs";
|
|
81
81
|
import { u as u2 } from "./react-B9sQBOh0.mjs";
|
|
82
82
|
import { useWaitForTransactionReceipt } from "wagmi";
|
|
83
|
-
import { chainIdentifier } from "./reactjs/constants/chains.mjs";
|
|
83
|
+
import { ALL_NETWORK_ID, chainIdentifier } from "./reactjs/constants/chains.mjs";
|
|
84
84
|
import { u as u3, a, e, b, c, d } from "./index-BXwpbIDQ.mjs";
|
|
85
85
|
import { u as u4, b as b2, a as a2 } from "./react-CSQpf1zk.mjs";
|
|
86
86
|
export {
|
|
87
|
+
ALL_NETWORK_ID,
|
|
87
88
|
AccountAddress,
|
|
88
89
|
AmountCard,
|
|
89
90
|
AmountInput,
|
package/package.json
CHANGED
|
@@ -7,6 +7,8 @@ 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");
|
|
9
9
|
const reactjs_components_TokenSelector_components_ChainSelect_components_SelectedChainOption = require("./components/SelectedChainOption.js");
|
|
10
|
+
require("../../../../constants/index.js");
|
|
11
|
+
const reactjs_constants_chains = require("../../../../constants/chains.js");
|
|
10
12
|
const ChainSelect = ({
|
|
11
13
|
isLoading,
|
|
12
14
|
selectedChainId,
|
|
@@ -26,9 +28,9 @@ const ChainSelect = ({
|
|
|
26
28
|
}));
|
|
27
29
|
options.unshift({
|
|
28
30
|
label: "All",
|
|
29
|
-
value:
|
|
31
|
+
value: reactjs_constants_chains.ALL_NETWORK_ID,
|
|
30
32
|
chain: {
|
|
31
|
-
id:
|
|
33
|
+
id: reactjs_constants_chains.ALL_NETWORK_ID,
|
|
32
34
|
name: "all",
|
|
33
35
|
networkName: "All",
|
|
34
36
|
svgUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg"
|
|
@@ -4,6 +4,8 @@ import Select from "react-select";
|
|
|
4
4
|
import { FormatChainOptionLabel } from "./components/FormatChainOptionLabel.mjs";
|
|
5
5
|
import { IndicatorSeparator } from "./components/IndicatorSeparator.mjs";
|
|
6
6
|
import { SelectedChainOption } from "./components/SelectedChainOption.mjs";
|
|
7
|
+
import "../../../../constants/index.mjs";
|
|
8
|
+
import { ALL_NETWORK_ID } from "../../../../constants/chains.mjs";
|
|
7
9
|
const ChainSelect = ({
|
|
8
10
|
isLoading,
|
|
9
11
|
selectedChainId,
|
|
@@ -23,9 +25,9 @@ const ChainSelect = ({
|
|
|
23
25
|
}));
|
|
24
26
|
options.unshift({
|
|
25
27
|
label: "All",
|
|
26
|
-
value:
|
|
28
|
+
value: ALL_NETWORK_ID,
|
|
27
29
|
chain: {
|
|
28
|
-
id:
|
|
30
|
+
id: ALL_NETWORK_ID,
|
|
29
31
|
name: "all",
|
|
30
32
|
networkName: "All",
|
|
31
33
|
svgUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg"
|
|
@@ -5,8 +5,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
const require$$0 = 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
|
+
require("../../../constants/index.js");
|
|
8
9
|
const reactjs_hooks_useGetChainId = require("../../../hooks/useGetChainId.js");
|
|
9
10
|
const reactjs_components_base_MxSearch_MxSearch = require("../../base/MxSearch/MxSearch.js");
|
|
11
|
+
const reactjs_constants_chains = require("../../../constants/chains.js");
|
|
10
12
|
const SelectContent = ({
|
|
11
13
|
onSelect,
|
|
12
14
|
tokens = [],
|
|
@@ -19,7 +21,7 @@ const SelectContent = ({
|
|
|
19
21
|
const searchPatternRef = require$$0.useRef("");
|
|
20
22
|
const activeChainId = reactjs_hooks_useGetChainId.useGetChainId();
|
|
21
23
|
const [selectedChainId, setSelectedChainId] = require$$0.useState(
|
|
22
|
-
(activeChainId == null ? void 0 : activeChainId.toString()) ??
|
|
24
|
+
(activeChainId == null ? void 0 : activeChainId.toString()) ?? reactjs_constants_chains.ALL_NETWORK_ID
|
|
23
25
|
);
|
|
24
26
|
const filteredTokensText = require$$0.useMemo(() => {
|
|
25
27
|
const selectedChain = chains.find(
|
|
@@ -36,7 +38,7 @@ const SelectContent = ({
|
|
|
36
38
|
};
|
|
37
39
|
const handleSearch = (pattern) => {
|
|
38
40
|
searchPatternRef.current = pattern;
|
|
39
|
-
if (selectedChainId ===
|
|
41
|
+
if (selectedChainId === reactjs_constants_chains.ALL_NETWORK_ID) {
|
|
40
42
|
const filtered2 = tokens.filter(
|
|
41
43
|
(token) => token.symbol.toLowerCase().includes(pattern.toLowerCase())
|
|
42
44
|
);
|
|
@@ -2,8 +2,10 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef, useMemo, useEffect } from "react";
|
|
3
3
|
import { ChainSelect } from "./ChainSelect/ChainSelect.mjs";
|
|
4
4
|
import { TokenList } from "./TokenList.mjs";
|
|
5
|
+
import "../../../constants/index.mjs";
|
|
5
6
|
import { useGetChainId } from "../../../hooks/useGetChainId.mjs";
|
|
6
7
|
import { MxSearch } from "../../base/MxSearch/MxSearch.mjs";
|
|
8
|
+
import { ALL_NETWORK_ID } from "../../../constants/chains.mjs";
|
|
7
9
|
const SelectContent = ({
|
|
8
10
|
onSelect,
|
|
9
11
|
tokens = [],
|
|
@@ -16,7 +18,7 @@ const SelectContent = ({
|
|
|
16
18
|
const searchPatternRef = useRef("");
|
|
17
19
|
const activeChainId = useGetChainId();
|
|
18
20
|
const [selectedChainId, setSelectedChainId] = useState(
|
|
19
|
-
(activeChainId == null ? void 0 : activeChainId.toString()) ??
|
|
21
|
+
(activeChainId == null ? void 0 : activeChainId.toString()) ?? ALL_NETWORK_ID
|
|
20
22
|
);
|
|
21
23
|
const filteredTokensText = useMemo(() => {
|
|
22
24
|
const selectedChain = chains.find(
|
|
@@ -33,7 +35,7 @@ const SelectContent = ({
|
|
|
33
35
|
};
|
|
34
36
|
const handleSearch = (pattern) => {
|
|
35
37
|
searchPatternRef.current = pattern;
|
|
36
|
-
if (selectedChainId ===
|
|
38
|
+
if (selectedChainId === ALL_NETWORK_ID) {
|
|
37
39
|
const filtered2 = tokens.filter(
|
|
38
40
|
(token) => token.symbol.toLowerCase().includes(pattern.toLowerCase())
|
|
39
41
|
);
|
|
@@ -7,6 +7,7 @@ const safeWindow = (
|
|
|
7
7
|
typeof window !== "undefined" ? window : {}
|
|
8
8
|
);
|
|
9
9
|
const safeDocument = typeof document !== "undefined" ? safeWindow.document : {};
|
|
10
|
+
exports.ALL_NETWORK_ID = reactjs_constants_chains.ALL_NETWORK_ID;
|
|
10
11
|
exports.chainIdentifier = reactjs_constants_chains.chainIdentifier;
|
|
11
12
|
exports.safeDocument = safeDocument;
|
|
12
13
|
exports.safeWindow = safeWindow;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { chainIdentifier } from "./chains.mjs";
|
|
1
|
+
import { ALL_NETWORK_ID, chainIdentifier } from "./chains.mjs";
|
|
2
2
|
const safeWindow = (
|
|
3
3
|
// eslint-disable-next-line no-undef
|
|
4
4
|
typeof window !== "undefined" ? window : {}
|
|
5
5
|
);
|
|
6
6
|
const safeDocument = typeof document !== "undefined" ? safeWindow.document : {};
|
|
7
7
|
export {
|
|
8
|
+
ALL_NETWORK_ID,
|
|
8
9
|
chainIdentifier,
|
|
9
10
|
safeDocument,
|
|
10
11
|
safeWindow
|
package/reactjs/index.js
CHANGED
|
@@ -142,6 +142,7 @@ Object.defineProperty(exports, "useWaitForTransactionReceipt", {
|
|
|
142
142
|
enumerable: true,
|
|
143
143
|
get: () => wagmi.useWaitForTransactionReceipt
|
|
144
144
|
});
|
|
145
|
+
exports.ALL_NETWORK_ID = reactjs_constants_chains.ALL_NETWORK_ID;
|
|
145
146
|
exports.chainIdentifier = reactjs_constants_chains.chainIdentifier;
|
|
146
147
|
exports.useAppKit = index.useAppKit;
|
|
147
148
|
exports.useAppKitEvents = index.useAppKitEvents;
|
package/reactjs/index.mjs
CHANGED
|
@@ -63,10 +63,11 @@ import { roundAmount } from "./utils/roundAmount.mjs";
|
|
|
63
63
|
import { testNumber } from "./utils/testNumber.mjs";
|
|
64
64
|
import { u as u2 } from "../react-B9sQBOh0.mjs";
|
|
65
65
|
import { useWaitForTransactionReceipt } from "wagmi";
|
|
66
|
-
import { chainIdentifier } from "./constants/chains.mjs";
|
|
66
|
+
import { ALL_NETWORK_ID, chainIdentifier } from "./constants/chains.mjs";
|
|
67
67
|
import { u as u3, a, e, b, c, d } from "../index-BXwpbIDQ.mjs";
|
|
68
68
|
import { u as u4, b as b2, a as a2 } from "../react-CSQpf1zk.mjs";
|
|
69
69
|
export {
|
|
70
|
+
ALL_NETWORK_ID,
|
|
70
71
|
AccountAddress,
|
|
71
72
|
AmountCard,
|
|
72
73
|
AmountInput,
|