@multiversx/sdk-dapp-liquidity 2.0.0-alpha.3 → 2.0.0-alpha.4
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/package.json +1 -1
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -1
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +1 -1
- package/reactjs/components/BridgeHistory/BridgeHistory.js +2 -2
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +2 -2
- package/reactjs/components/TokenSelector/components/TokenList.js +12 -9
- package/reactjs/components/TokenSelector/components/TokenList.mjs +12 -9
- package/reactjs/hooks/useFetchTokens.js +2 -2
- package/reactjs/hooks/useFetchTokens.mjs +2 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -1
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +1 -1
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -1
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +1 -1
package/package.json
CHANGED
|
@@ -60,7 +60,7 @@ const getAvailableTokens = (option, targetTokens, forcedDestinationTokenSymbol)
|
|
|
60
60
|
const foundTokens = [];
|
|
61
61
|
for (const availableToken of option.availableTokens) {
|
|
62
62
|
const foundToken = targetTokens == null ? void 0 : targetTokens.find(
|
|
63
|
-
(token) => token.address === availableToken.address
|
|
63
|
+
(token) => token.address.toLowerCase() === availableToken.address.toLowerCase()
|
|
64
64
|
);
|
|
65
65
|
if (foundToken) {
|
|
66
66
|
foundTokens.push(foundToken);
|
|
@@ -57,7 +57,7 @@ const getAvailableTokens = (option, targetTokens, forcedDestinationTokenSymbol)
|
|
|
57
57
|
const foundTokens = [];
|
|
58
58
|
for (const availableToken of option.availableTokens) {
|
|
59
59
|
const foundToken = targetTokens == null ? void 0 : targetTokens.find(
|
|
60
|
-
(token) => token.address === availableToken.address
|
|
60
|
+
(token) => token.address.toLowerCase() === availableToken.address.toLowerCase()
|
|
61
61
|
);
|
|
62
62
|
if (foundToken) {
|
|
63
63
|
foundTokens.push(foundToken);
|
|
@@ -256,7 +256,7 @@ const BridgeHistory = ({
|
|
|
256
256
|
}) }),
|
|
257
257
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "liq-whitespace-nowrap", children: (_e = tokensMap[transaction.tokenSource]) == null ? void 0 : _e.symbol }),
|
|
258
258
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-relative", children: [
|
|
259
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-h-
|
|
259
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-h-6 liq-w-6 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
260
260
|
"img",
|
|
261
261
|
{
|
|
262
262
|
src: (_f = tokensMap[transaction.tokenSource]) == null ? void 0 : _f.pngUrl,
|
|
@@ -312,7 +312,7 @@ const BridgeHistory = ({
|
|
|
312
312
|
}) }),
|
|
313
313
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "liq-whitespace-nowrap", children: (_l = tokensMap[transaction.tokenDestination]) == null ? void 0 : _l.symbol }),
|
|
314
314
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-relative", children: [
|
|
315
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-h-
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-h-6 liq-w-6 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
316
316
|
"img",
|
|
317
317
|
{
|
|
318
318
|
src: (_m = tokensMap[transaction.tokenDestination]) == null ? void 0 : _m.pngUrl,
|
|
@@ -253,7 +253,7 @@ const BridgeHistory = ({
|
|
|
253
253
|
}) }),
|
|
254
254
|
/* @__PURE__ */ jsx("span", { className: "liq-whitespace-nowrap", children: (_e = tokensMap[transaction.tokenSource]) == null ? void 0 : _e.symbol }),
|
|
255
255
|
/* @__PURE__ */ jsxs("div", { className: "liq-flex liq-items-center liq-relative", children: [
|
|
256
|
-
/* @__PURE__ */ jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsx("div", { className: "liq-h-
|
|
256
|
+
/* @__PURE__ */ jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsx("div", { className: "liq-h-6 liq-w-6 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsx(
|
|
257
257
|
"img",
|
|
258
258
|
{
|
|
259
259
|
src: (_f = tokensMap[transaction.tokenSource]) == null ? void 0 : _f.pngUrl,
|
|
@@ -309,7 +309,7 @@ const BridgeHistory = ({
|
|
|
309
309
|
}) }),
|
|
310
310
|
/* @__PURE__ */ jsx("span", { className: "liq-whitespace-nowrap", children: (_l = tokensMap[transaction.tokenDestination]) == null ? void 0 : _l.symbol }),
|
|
311
311
|
/* @__PURE__ */ jsxs("div", { className: "liq-flex liq-items-center liq-relative", children: [
|
|
312
|
-
/* @__PURE__ */ jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsx("div", { className: "liq-h-
|
|
312
|
+
/* @__PURE__ */ jsx("div", { className: "liq-flex-shrink-0 liq-overflow-hidden liq-rounded-full liq-h-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsx("div", { className: "liq-h-6 liq-w-6 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsx(
|
|
313
313
|
"img",
|
|
314
314
|
{
|
|
315
315
|
src: (_m = tokensMap[transaction.tokenDestination]) == null ? void 0 : _m.pngUrl,
|
|
@@ -8,14 +8,17 @@ const TokenList = ({
|
|
|
8
8
|
onSelect,
|
|
9
9
|
selectedToken
|
|
10
10
|
}) => {
|
|
11
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "token-list liq-flex liq-flex-col liq-gap-1", children: tokens.map((token) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "token-list liq-flex liq-flex-col liq-gap-1", children: tokens.map((token) => {
|
|
12
|
+
var _a;
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14
|
+
reactjs_components_TokenSelector_components_TokenItem.TokenItem,
|
|
15
|
+
{
|
|
16
|
+
token,
|
|
17
|
+
onClick: onSelect,
|
|
18
|
+
selected: ((_a = selectedToken == null ? void 0 : selectedToken.address) == null ? void 0 : _a.toLowerCase()) === token.address.toLowerCase()
|
|
19
|
+
},
|
|
20
|
+
`${token.address}-${token.chainId}`
|
|
21
|
+
);
|
|
22
|
+
}) });
|
|
20
23
|
};
|
|
21
24
|
exports.TokenList = TokenList;
|
|
@@ -5,15 +5,18 @@ const TokenList = ({
|
|
|
5
5
|
onSelect,
|
|
6
6
|
selectedToken
|
|
7
7
|
}) => {
|
|
8
|
-
return /* @__PURE__ */ jsx("div", { className: "token-list liq-flex liq-flex-col liq-gap-1", children: tokens.map((token) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { className: "token-list liq-flex liq-flex-col liq-gap-1", children: tokens.map((token) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
TokenItem,
|
|
12
|
+
{
|
|
13
|
+
token,
|
|
14
|
+
onClick: onSelect,
|
|
15
|
+
selected: ((_a = selectedToken == null ? void 0 : selectedToken.address) == null ? void 0 : _a.toLowerCase()) === token.address.toLowerCase()
|
|
16
|
+
},
|
|
17
|
+
`${token.address}-${token.chainId}`
|
|
18
|
+
);
|
|
19
|
+
}) });
|
|
17
20
|
};
|
|
18
21
|
export {
|
|
19
22
|
TokenList
|
|
@@ -57,7 +57,7 @@ const useFetchTokens = ({
|
|
|
57
57
|
const mvxTokensWithBalances = React.useMemo(() => {
|
|
58
58
|
return mvxTokens == null ? void 0 : mvxTokens.map((token) => {
|
|
59
59
|
const foundToken = mvxTokensBalances == null ? void 0 : mvxTokensBalances.find(
|
|
60
|
-
(mvxToken) => mvxToken.address === token.address
|
|
60
|
+
(mvxToken) => mvxToken.address.toLowerCase() === token.address.toLowerCase()
|
|
61
61
|
);
|
|
62
62
|
if (!foundToken) {
|
|
63
63
|
return {
|
|
@@ -74,7 +74,7 @@ const useFetchTokens = ({
|
|
|
74
74
|
const nonMvxTokensWithBalances = React.useMemo(() => {
|
|
75
75
|
return nonMvxTokens == null ? void 0 : nonMvxTokens.map((token) => {
|
|
76
76
|
const foundToken = nonMvxTokensBalances == null ? void 0 : nonMvxTokensBalances.find(
|
|
77
|
-
(nonMvxToken) => nonMvxToken.address === token.address && nonMvxToken.chainId === token.chainId
|
|
77
|
+
(nonMvxToken) => nonMvxToken.address.toLowerCase() === token.address.toLowerCase() && nonMvxToken.chainId.toLowerCase() === token.chainId.toLowerCase()
|
|
78
78
|
);
|
|
79
79
|
if (!foundToken) {
|
|
80
80
|
return {
|
|
@@ -54,7 +54,7 @@ const useFetchTokens = ({
|
|
|
54
54
|
const mvxTokensWithBalances = useMemo(() => {
|
|
55
55
|
return mvxTokens == null ? void 0 : mvxTokens.map((token) => {
|
|
56
56
|
const foundToken = mvxTokensBalances == null ? void 0 : mvxTokensBalances.find(
|
|
57
|
-
(mvxToken) => mvxToken.address === token.address
|
|
57
|
+
(mvxToken) => mvxToken.address.toLowerCase() === token.address.toLowerCase()
|
|
58
58
|
);
|
|
59
59
|
if (!foundToken) {
|
|
60
60
|
return {
|
|
@@ -71,7 +71,7 @@ const useFetchTokens = ({
|
|
|
71
71
|
const nonMvxTokensWithBalances = useMemo(() => {
|
|
72
72
|
return nonMvxTokens == null ? void 0 : nonMvxTokens.map((token) => {
|
|
73
73
|
const foundToken = nonMvxTokensBalances == null ? void 0 : nonMvxTokensBalances.find(
|
|
74
|
-
(nonMvxToken) => nonMvxToken.address === token.address && nonMvxToken.chainId === token.chainId
|
|
74
|
+
(nonMvxToken) => nonMvxToken.address.toLowerCase() === token.address.toLowerCase() && nonMvxToken.chainId.toLowerCase() === token.chainId.toLowerCase()
|
|
75
75
|
);
|
|
76
76
|
if (!foundToken) {
|
|
77
77
|
return {
|
|
@@ -27,7 +27,7 @@ const useGetMvxTokensBalancesQuery = ({
|
|
|
27
27
|
return data.map((asset) => {
|
|
28
28
|
var _a;
|
|
29
29
|
const foundToken = tokens.find(
|
|
30
|
-
(token) => token.address === asset.identifier
|
|
30
|
+
(token) => token.address.toLowerCase() === asset.identifier.toLowerCase()
|
|
31
31
|
);
|
|
32
32
|
if (!foundToken) {
|
|
33
33
|
throw new Error("Token not found");
|
|
@@ -24,7 +24,7 @@ const useGetMvxTokensBalancesQuery = ({
|
|
|
24
24
|
return data.map((asset) => {
|
|
25
25
|
var _a;
|
|
26
26
|
const foundToken = tokens.find(
|
|
27
|
-
(token) => token.address === asset.identifier
|
|
27
|
+
(token) => token.address.toLowerCase() === asset.identifier.toLowerCase()
|
|
28
28
|
);
|
|
29
29
|
if (!foundToken) {
|
|
30
30
|
throw new Error("Token not found");
|
|
@@ -41,7 +41,7 @@ const useGetNonMvxTokensBalancesQuery = ({
|
|
|
41
41
|
});
|
|
42
42
|
return assets.map((asset) => {
|
|
43
43
|
const foundToken = tokens.find(
|
|
44
|
-
(token) => token.address === asset.tokenId
|
|
44
|
+
(token) => token.address.toLowerCase() === asset.tokenId.toLowerCase()
|
|
45
45
|
);
|
|
46
46
|
if (!foundToken) {
|
|
47
47
|
throw new Error("Token not found");
|
|
@@ -38,7 +38,7 @@ const useGetNonMvxTokensBalancesQuery = ({
|
|
|
38
38
|
});
|
|
39
39
|
return assets.map((asset) => {
|
|
40
40
|
const foundToken = tokens.find(
|
|
41
|
-
(token) => token.address === asset.tokenId
|
|
41
|
+
(token) => token.address.toLowerCase() === asset.tokenId.toLowerCase()
|
|
42
42
|
);
|
|
43
43
|
if (!foundToken) {
|
|
44
44
|
throw new Error("Token not found");
|