@multiversx/sdk-dapp-liquidity 1.1.0-alpha.37 → 1.1.0-alpha.39
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 +1 -2
- package/api/checkAccount.d.ts +1 -1
- package/api/getChains.d.ts +1 -1
- package/api/getTokens.d.ts +1 -1
- package/api/getTokensBalances.d.ts +1 -1
- package/api/getTransactions.d.ts +1 -1
- package/api/tests/getTokens.spec.js +5 -3
- package/api/tests/getTokens.spec.mjs +5 -3
- package/api/tests/getTransactions.spec.js +14 -8
- package/api/tests/getTransactions.spec.mjs +14 -8
- package/dto/Chain.dto.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +1 -2
- package/reactjs/components/BridgeForm/BridgeForm.js +20 -24
- package/reactjs/components/BridgeForm/BridgeForm.mjs +20 -24
- package/reactjs/components/BridgeHistory/BridgeHistory.d.ts +1 -2
- package/reactjs/components/BridgeHistory/BridgeHistory.js +8 -11
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +8 -11
- package/reactjs/components/Connect/BridgeAccountDisplay.d.ts +1 -2
- package/reactjs/components/Connect/BridgeAccountDisplay.js +4 -4
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +4 -4
- package/reactjs/components/Connect/BridgeConnectButton.js +1 -1
- package/reactjs/components/Connect/BridgeConnectButton.mjs +1 -1
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +1 -2
- package/reactjs/components/TokenSelector/TokenSelector.js +3 -7
- package/reactjs/components/TokenSelector/TokenSelector.mjs +3 -7
- 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/ChainSelect/components/ChainOptionLabel.d.ts +1 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +2 -2
- package/reactjs/components/TokenSelector/components/ChainSelect/types/chainSelectOption.d.ts +1 -0
- package/reactjs/components/TokenSelector/components/ChainSelect/types/partialChainOption.d.ts +1 -0
- package/reactjs/components/TokenSelector/components/TokenIcon.js +2 -2
- package/reactjs/components/TokenSelector/components/TokenIcon.mjs +2 -2
- package/reactjs/components/TokenSelector/components/TokenItem.d.ts +1 -2
- package/reactjs/components/TokenSelector/components/TokenItem.js +2 -4
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +2 -4
- package/reactjs/components/TokenSelector/components/TokenList.js +1 -1
- package/reactjs/components/TokenSelector/components/TokenList.mjs +1 -1
- package/reactjs/context/Web3AppProvider.d.ts +2 -1
- package/reactjs/context/Web3AppProvider.js +5 -3
- package/reactjs/context/Web3AppProvider.mjs +5 -3
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +1 -1
- package/reactjs/hooks/useBalances.d.ts +1 -3
- package/reactjs/hooks/useBalances.js +1 -1
- package/reactjs/hooks/useBalances.mjs +1 -1
- package/reactjs/hooks/useBridgeFormik.d.ts +1 -2
- package/reactjs/hooks/useBridgeFormik.js +2 -1
- package/reactjs/hooks/useBridgeFormik.mjs +2 -1
- package/reactjs/hooks/useFetchBridgeData.d.ts +1 -2
- package/reactjs/hooks/useFetchBridgeData.js +3 -7
- package/reactjs/hooks/useFetchBridgeData.mjs +3 -7
- package/reactjs/hooks/useFetchTokens.d.ts +1 -2
- package/reactjs/hooks/useFetchTokens.js +3 -7
- package/reactjs/hooks/useFetchTokens.mjs +3 -7
- package/reactjs/hooks/useFiatData.d.ts +1 -2
- package/reactjs/hooks/useFiatData.js +2 -5
- package/reactjs/hooks/useFiatData.mjs +2 -5
- package/reactjs/hooks/useResolveTokenChain.d.ts +1 -2
- package/reactjs/hooks/useResolveTokenChain.js +3 -8
- package/reactjs/hooks/useResolveTokenChain.mjs +3 -8
- package/reactjs/index.js +1 -1
- package/reactjs/index.mjs +1 -1
- package/reactjs/queries/useCheckAccount.query.d.ts +1 -3
- package/reactjs/queries/useCheckAccount.query.js +3 -4
- package/reactjs/queries/useCheckAccount.query.mjs +3 -4
- package/reactjs/queries/useGetAllTokens.query.d.ts +1 -3
- package/reactjs/queries/useGetAllTokens.query.js +3 -3
- package/reactjs/queries/useGetAllTokens.query.mjs +3 -3
- package/reactjs/queries/useGetChains.query.d.ts +1 -3
- package/reactjs/queries/useGetChains.query.js +3 -3
- package/reactjs/queries/useGetChains.query.mjs +3 -3
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +1 -2
- package/reactjs/queries/useGetEvmTokensBalances.query.js +6 -6
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +6 -6
- package/reactjs/queries/useGetHistory.query.d.ts +2 -3
- package/reactjs/queries/useGetHistory.query.js +3 -2
- package/reactjs/queries/useGetHistory.query.mjs +3 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +1 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.js +3 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.mjs +3 -2
- package/{useBalances-84Wb5V4N.mjs → useBalances-CtcrEcK2.mjs} +3 -6
- package/{useBalances-BrSgRL7R.js → useBalances-ok4GNkJ5.js} +3 -6
package/README.md
CHANGED
|
@@ -161,12 +161,11 @@ const App = () => {
|
|
|
161
161
|
|
|
162
162
|
return (
|
|
163
163
|
// Wrap your app with Web3AppProvider to enable multi-chain connections
|
|
164
|
-
<Web3AppProvider appKit={provider.appKit} config={provider.config} options={provider.options}>
|
|
164
|
+
<Web3AppProvider appKit={provider.appKit} config={provider.config} options={provider.options} nativeAuthToken={nativeAuthToken}>
|
|
165
165
|
<BridgeForm
|
|
166
166
|
mvxChainId={"44"}
|
|
167
167
|
mvxAddress={mvxAccount?.address}
|
|
168
168
|
username={mvxAccount?.username}
|
|
169
|
-
nativeAuthToken={nativeAuthToken}
|
|
170
169
|
callbackRoute={"/deposit"}
|
|
171
170
|
showHistory={showHistory}
|
|
172
171
|
onSuccessfullySentTransaction={(txHashes) => {
|
package/api/checkAccount.d.ts
CHANGED
package/api/getChains.d.ts
CHANGED
package/api/getTokens.d.ts
CHANGED
package/api/getTransactions.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ describe("getTokens", () => {
|
|
|
24
24
|
}
|
|
25
25
|
];
|
|
26
26
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
27
|
-
const result = await api_getTokens.getTokens({ url });
|
|
27
|
+
const result = await api_getTokens.getTokens({ url, nativeAuthToken: "" });
|
|
28
28
|
expect(mockedAxios.get).toHaveBeenCalledWith("/tokens", { baseURL: url });
|
|
29
29
|
expect(result.data).toEqual(response);
|
|
30
30
|
});
|
|
@@ -47,7 +47,7 @@ describe("getTokens", () => {
|
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
49
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
50
|
-
const result = await api_getTokens.getTokens({ url, chainId });
|
|
50
|
+
const result = await api_getTokens.getTokens({ url, chainId, nativeAuthToken: "" });
|
|
51
51
|
expect(mockedAxios.get).toHaveBeenCalledWith(`/tokens/${chainId}`, {
|
|
52
52
|
baseURL: url
|
|
53
53
|
});
|
|
@@ -55,6 +55,8 @@ describe("getTokens", () => {
|
|
|
55
55
|
});
|
|
56
56
|
it("handles error when fetching tokens", async () => {
|
|
57
57
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
58
|
-
await expect(api_getTokens.getTokens({ url })).rejects.toThrow(
|
|
58
|
+
await expect(api_getTokens.getTokens({ url, nativeAuthToken: "" })).rejects.toThrow(
|
|
59
|
+
"Network Error"
|
|
60
|
+
);
|
|
59
61
|
});
|
|
60
62
|
});
|
|
@@ -22,7 +22,7 @@ describe("getTokens", () => {
|
|
|
22
22
|
}
|
|
23
23
|
];
|
|
24
24
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
25
|
-
const result = await getTokens({ url });
|
|
25
|
+
const result = await getTokens({ url, nativeAuthToken: "" });
|
|
26
26
|
expect(mockedAxios.get).toHaveBeenCalledWith("/tokens", { baseURL: url });
|
|
27
27
|
expect(result.data).toEqual(response);
|
|
28
28
|
});
|
|
@@ -45,7 +45,7 @@ describe("getTokens", () => {
|
|
|
45
45
|
}
|
|
46
46
|
];
|
|
47
47
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
48
|
-
const result = await getTokens({ url, chainId });
|
|
48
|
+
const result = await getTokens({ url, chainId, nativeAuthToken: "" });
|
|
49
49
|
expect(mockedAxios.get).toHaveBeenCalledWith(`/tokens/${chainId}`, {
|
|
50
50
|
baseURL: url
|
|
51
51
|
});
|
|
@@ -53,6 +53,8 @@ describe("getTokens", () => {
|
|
|
53
53
|
});
|
|
54
54
|
it("handles error when fetching tokens", async () => {
|
|
55
55
|
mockedAxios.get.mockRejectedValue(new Error("Network Error"));
|
|
56
|
-
await expect(getTokens({ url })).rejects.toThrow(
|
|
56
|
+
await expect(getTokens({ url, nativeAuthToken: "" })).rejects.toThrow(
|
|
57
|
+
"Network Error"
|
|
58
|
+
);
|
|
57
59
|
});
|
|
58
60
|
});
|
|
@@ -30,7 +30,7 @@ describe("getTransactions", () => {
|
|
|
30
30
|
});
|
|
31
31
|
it("fetches transactions with only address parameter", async () => {
|
|
32
32
|
const address = "0x123";
|
|
33
|
-
const result = await api_getTransactions.getTransactions({ url, address });
|
|
33
|
+
const result = await api_getTransactions.getTransactions({ url, address, nativeAuthToken: "" });
|
|
34
34
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
35
35
|
"/transactions?receiver=0x123",
|
|
36
36
|
{ baseURL: url }
|
|
@@ -39,7 +39,7 @@ describe("getTransactions", () => {
|
|
|
39
39
|
});
|
|
40
40
|
it("fetches transactions with empty address", async () => {
|
|
41
41
|
const address = "";
|
|
42
|
-
const result = await api_getTransactions.getTransactions({ url, address });
|
|
42
|
+
const result = await api_getTransactions.getTransactions({ url, address, nativeAuthToken: "" });
|
|
43
43
|
expect(mockedAxios.get).toHaveBeenCalledWith("/transactions?", {
|
|
44
44
|
baseURL: url
|
|
45
45
|
});
|
|
@@ -53,7 +53,8 @@ describe("getTransactions", () => {
|
|
|
53
53
|
provider: types_providerType.ProviderType.MultiversxBridge,
|
|
54
54
|
status: "success",
|
|
55
55
|
tokenIn: "0xTOKEN",
|
|
56
|
-
tokenOut: "WEGLD-123456"
|
|
56
|
+
tokenOut: "WEGLD-123456",
|
|
57
|
+
nativeAuthToken: ""
|
|
57
58
|
});
|
|
58
59
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
59
60
|
"/transactions?receiver=0x123&sender=0xABC&provider=multiversxBridge&status=success&tokenIn=0xTOKEN&tokenOut=WEGLD-123456",
|
|
@@ -69,7 +70,8 @@ describe("getTransactions", () => {
|
|
|
69
70
|
provider: types_providerType.ProviderType.MultiversxBridge,
|
|
70
71
|
status: "",
|
|
71
72
|
tokenIn: "0xTOKEN",
|
|
72
|
-
tokenOut: ""
|
|
73
|
+
tokenOut: "",
|
|
74
|
+
nativeAuthToken: ""
|
|
73
75
|
});
|
|
74
76
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
75
77
|
"/transactions?receiver=0x123&provider=multiversxBridge&tokenIn=0xTOKEN",
|
|
@@ -80,9 +82,9 @@ describe("getTransactions", () => {
|
|
|
80
82
|
it("handles axios error", async () => {
|
|
81
83
|
const error = new Error("Network error");
|
|
82
84
|
mockedAxios.get.mockRejectedValueOnce(error);
|
|
83
|
-
await expect(
|
|
84
|
-
"
|
|
85
|
-
);
|
|
85
|
+
await expect(
|
|
86
|
+
api_getTransactions.getTransactions({ url, address: "0x123", nativeAuthToken: "" })
|
|
87
|
+
).rejects.toThrow("Network error");
|
|
86
88
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
87
89
|
"/transactions?receiver=0x123",
|
|
88
90
|
{ baseURL: url }
|
|
@@ -97,7 +99,11 @@ describe("getTransactions", () => {
|
|
|
97
99
|
config: {}
|
|
98
100
|
};
|
|
99
101
|
mockedAxios.get.mockResolvedValueOnce(axiosResponse);
|
|
100
|
-
const result = await api_getTransactions.getTransactions({
|
|
102
|
+
const result = await api_getTransactions.getTransactions({
|
|
103
|
+
url,
|
|
104
|
+
address: "0x123",
|
|
105
|
+
nativeAuthToken: ""
|
|
106
|
+
});
|
|
101
107
|
expect(result).toEqual(axiosResponse);
|
|
102
108
|
});
|
|
103
109
|
});
|
|
@@ -28,7 +28,7 @@ describe("getTransactions", () => {
|
|
|
28
28
|
});
|
|
29
29
|
it("fetches transactions with only address parameter", async () => {
|
|
30
30
|
const address = "0x123";
|
|
31
|
-
const result = await getTransactions({ url, address });
|
|
31
|
+
const result = await getTransactions({ url, address, nativeAuthToken: "" });
|
|
32
32
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
33
33
|
"/transactions?receiver=0x123",
|
|
34
34
|
{ baseURL: url }
|
|
@@ -37,7 +37,7 @@ describe("getTransactions", () => {
|
|
|
37
37
|
});
|
|
38
38
|
it("fetches transactions with empty address", async () => {
|
|
39
39
|
const address = "";
|
|
40
|
-
const result = await getTransactions({ url, address });
|
|
40
|
+
const result = await getTransactions({ url, address, nativeAuthToken: "" });
|
|
41
41
|
expect(mockedAxios.get).toHaveBeenCalledWith("/transactions?", {
|
|
42
42
|
baseURL: url
|
|
43
43
|
});
|
|
@@ -51,7 +51,8 @@ describe("getTransactions", () => {
|
|
|
51
51
|
provider: ProviderType.MultiversxBridge,
|
|
52
52
|
status: "success",
|
|
53
53
|
tokenIn: "0xTOKEN",
|
|
54
|
-
tokenOut: "WEGLD-123456"
|
|
54
|
+
tokenOut: "WEGLD-123456",
|
|
55
|
+
nativeAuthToken: ""
|
|
55
56
|
});
|
|
56
57
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
57
58
|
"/transactions?receiver=0x123&sender=0xABC&provider=multiversxBridge&status=success&tokenIn=0xTOKEN&tokenOut=WEGLD-123456",
|
|
@@ -67,7 +68,8 @@ describe("getTransactions", () => {
|
|
|
67
68
|
provider: ProviderType.MultiversxBridge,
|
|
68
69
|
status: "",
|
|
69
70
|
tokenIn: "0xTOKEN",
|
|
70
|
-
tokenOut: ""
|
|
71
|
+
tokenOut: "",
|
|
72
|
+
nativeAuthToken: ""
|
|
71
73
|
});
|
|
72
74
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
73
75
|
"/transactions?receiver=0x123&provider=multiversxBridge&tokenIn=0xTOKEN",
|
|
@@ -78,9 +80,9 @@ describe("getTransactions", () => {
|
|
|
78
80
|
it("handles axios error", async () => {
|
|
79
81
|
const error = new Error("Network error");
|
|
80
82
|
mockedAxios.get.mockRejectedValueOnce(error);
|
|
81
|
-
await expect(
|
|
82
|
-
"
|
|
83
|
-
);
|
|
83
|
+
await expect(
|
|
84
|
+
getTransactions({ url, address: "0x123", nativeAuthToken: "" })
|
|
85
|
+
).rejects.toThrow("Network error");
|
|
84
86
|
expect(mockedAxios.get).toHaveBeenCalledWith(
|
|
85
87
|
"/transactions?receiver=0x123",
|
|
86
88
|
{ baseURL: url }
|
|
@@ -95,7 +97,11 @@ describe("getTransactions", () => {
|
|
|
95
97
|
config: {}
|
|
96
98
|
};
|
|
97
99
|
mockedAxios.get.mockResolvedValueOnce(axiosResponse);
|
|
98
|
-
const result = await getTransactions({
|
|
100
|
+
const result = await getTransactions({
|
|
101
|
+
url,
|
|
102
|
+
address: "0x123",
|
|
103
|
+
nativeAuthToken: ""
|
|
104
|
+
});
|
|
99
105
|
expect(result).toEqual(axiosResponse);
|
|
100
106
|
});
|
|
101
107
|
});
|
package/dto/Chain.dto.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -55,7 +55,7 @@ const reactjs_hooks_validation_useSecondAmountSchema = require("./reactjs/hooks/
|
|
|
55
55
|
const reactjs_hooks_validation_useTestHasEnoughFunds = require("./reactjs/hooks/validation/useTestHasEnoughFunds.js");
|
|
56
56
|
const reactjs_hooks_validation_useTestIsConnected = require("./reactjs/hooks/validation/useTestIsConnected.js");
|
|
57
57
|
const reactjs_hooks_useAccount = require("./reactjs/hooks/useAccount.js");
|
|
58
|
-
const reactjs_hooks_useBalances = require("./useBalances-
|
|
58
|
+
const reactjs_hooks_useBalances = require("./useBalances-ok4GNkJ5.js");
|
|
59
59
|
const reactjs_hooks_useBridgeFormik = require("./reactjs/hooks/useBridgeFormik.js");
|
|
60
60
|
const reactjs_hooks_useDebounce = require("./reactjs/hooks/useDebounce.js");
|
|
61
61
|
const reactjs_hooks_useFetchBridgeData = require("./reactjs/hooks/useFetchBridgeData.js");
|
package/index.mjs
CHANGED
|
@@ -52,7 +52,7 @@ import { useSecondAmountSchema } from "./reactjs/hooks/validation/useSecondAmoun
|
|
|
52
52
|
import { useTestHasEnoughFunds } from "./reactjs/hooks/validation/useTestHasEnoughFunds.mjs";
|
|
53
53
|
import { useTestIsConnected } from "./reactjs/hooks/validation/useTestIsConnected.mjs";
|
|
54
54
|
import { useAccount } from "./reactjs/hooks/useAccount.mjs";
|
|
55
|
-
import { u } from "./useBalances-
|
|
55
|
+
import { u } from "./useBalances-CtcrEcK2.mjs";
|
|
56
56
|
import { BridgeFormikValuesEnum, useBridgeFormik } from "./reactjs/hooks/useBridgeFormik.mjs";
|
|
57
57
|
import { useDebounce } from "./reactjs/hooks/useDebounce.mjs";
|
|
58
58
|
import { useFetchBridgeData } from "./reactjs/hooks/useFetchBridgeData.mjs";
|
package/package.json
CHANGED
|
@@ -2,7 +2,6 @@ interface BridgeFormProps {
|
|
|
2
2
|
mvxChainId: string;
|
|
3
3
|
mvxAddress?: string;
|
|
4
4
|
username?: string;
|
|
5
|
-
nativeAuthToken?: string;
|
|
6
5
|
callbackRoute?: string;
|
|
7
6
|
firstTokenIdentifier?: string;
|
|
8
7
|
secondTokenIdentifier?: string;
|
|
@@ -18,5 +17,5 @@ interface BridgeFormProps {
|
|
|
18
17
|
onMvxDisconnect?: () => void;
|
|
19
18
|
onNavigate?: (url: string, options?: object) => void;
|
|
20
19
|
}
|
|
21
|
-
export declare const BridgeForm: ({ mvxChainId, mvxAddress, username,
|
|
20
|
+
export declare const BridgeForm: ({ mvxChainId, mvxAddress, username, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, firstTokenAmount, secondTokenAmount, refetchTrigger, showHistory, forcedDestinationTokenSymbol, onSuccessfullySentTransaction, onFailedSentTransaction, onHistoryClose, onMvxConnect, onMvxDisconnect, onNavigate }: BridgeFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
21
|
export {};
|
|
@@ -44,7 +44,7 @@ const reactjs_components_Connect_MvxAccountDisplay = require("../Connect/MvxAcco
|
|
|
44
44
|
const reactjs_components_TokenSelector_TokenSelector = require("../TokenSelector/TokenSelector.js");
|
|
45
45
|
const viem = require("viem");
|
|
46
46
|
const actions = require("viem/actions");
|
|
47
|
-
const reactjs_hooks_useBalances = require("../../../useBalances-
|
|
47
|
+
const reactjs_hooks_useBalances = require("../../../useBalances-ok4GNkJ5.js");
|
|
48
48
|
function deepEqual(a, b) {
|
|
49
49
|
if (a === b)
|
|
50
50
|
return true;
|
|
@@ -121,7 +121,6 @@ const BridgeForm = ({
|
|
|
121
121
|
mvxChainId,
|
|
122
122
|
mvxAddress,
|
|
123
123
|
username,
|
|
124
|
-
nativeAuthToken,
|
|
125
124
|
callbackRoute = "/",
|
|
126
125
|
firstTokenIdentifier,
|
|
127
126
|
secondTokenIdentifier,
|
|
@@ -145,7 +144,12 @@ const BridgeForm = ({
|
|
|
145
144
|
const [siginingTransactionsCount, setSigningTransactionsCount] = React.useState(0);
|
|
146
145
|
const account = reactjs_hooks_useAccount.useAccount();
|
|
147
146
|
const { switchNetwork } = react.useAppKitNetwork();
|
|
148
|
-
const {
|
|
147
|
+
const {
|
|
148
|
+
config,
|
|
149
|
+
options,
|
|
150
|
+
supportedChains: sdkChains,
|
|
151
|
+
nativeAuthToken
|
|
152
|
+
} = reactjs_context_useWeb3App.useWeb3App();
|
|
149
153
|
const chainId = reactjs_hooks_useGetChainId.useGetChainId();
|
|
150
154
|
const {
|
|
151
155
|
evmTokensWithBalances,
|
|
@@ -158,8 +162,7 @@ const BridgeForm = ({
|
|
|
158
162
|
} = reactjs_hooks_useFetchBridgeData.useFetchBridgeData({
|
|
159
163
|
refetchTrigger,
|
|
160
164
|
mvxAddress,
|
|
161
|
-
mvxApiURL: options.mvxApiURL
|
|
162
|
-
nativeAuthToken
|
|
165
|
+
mvxApiURL: options.mvxApiURL
|
|
163
166
|
});
|
|
164
167
|
const isTokensLoading = tokensLoading || isLoadingEvmTokensBalances || isLoadingMvxTokensBalances || isChainsLoading;
|
|
165
168
|
const activeChain = React.useMemo(() => {
|
|
@@ -559,7 +562,6 @@ const BridgeForm = ({
|
|
|
559
562
|
resetSwapForm
|
|
560
563
|
} = reactjs_hooks_useBridgeFormik.useBridgeFormik({
|
|
561
564
|
rate,
|
|
562
|
-
nativeAuthToken,
|
|
563
565
|
mvxAccountAddress: mvxAddress,
|
|
564
566
|
firstToken,
|
|
565
567
|
firstAmount,
|
|
@@ -651,6 +653,10 @@ const BridgeForm = ({
|
|
|
651
653
|
handleOnChangeSecondAmount(secondTokenAmount);
|
|
652
654
|
}
|
|
653
655
|
}, [secondTokenAmount]);
|
|
656
|
+
console.log("BridgeForm=", {
|
|
657
|
+
nativeAuthToken,
|
|
658
|
+
chains
|
|
659
|
+
});
|
|
654
660
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
655
661
|
"form",
|
|
656
662
|
{
|
|
@@ -660,14 +666,7 @@ const BridgeForm = ({
|
|
|
660
666
|
autoComplete: "off",
|
|
661
667
|
onSubmit: handleSubmit,
|
|
662
668
|
children: [
|
|
663
|
-
showHistory && /* @__PURE__ */ jsxRuntime.jsx(
|
|
664
|
-
reactjs_components_BridgeHistory_BridgeHistory.BridgeHistory,
|
|
665
|
-
{
|
|
666
|
-
mvxAddress,
|
|
667
|
-
onClose: handleHistoryClose,
|
|
668
|
-
nativeAuthToken
|
|
669
|
-
}
|
|
670
|
-
),
|
|
669
|
+
showHistory && /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_BridgeHistory_BridgeHistory.BridgeHistory, { mvxAddress, onClose: handleHistoryClose }),
|
|
671
670
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
672
671
|
reactjs_components_AmountCard_AmountCard.AmountCard,
|
|
673
672
|
{
|
|
@@ -685,8 +684,7 @@ const BridgeForm = ({
|
|
|
685
684
|
reactjs_components_Connect_BridgeAccountDisplay.BridgeAccountDisplay,
|
|
686
685
|
{
|
|
687
686
|
disabled: isPendingRate,
|
|
688
|
-
activeChain: selectedChainOption
|
|
689
|
-
nativeAuthToken
|
|
687
|
+
activeChain: selectedChainOption
|
|
690
688
|
}
|
|
691
689
|
)
|
|
692
690
|
] }),
|
|
@@ -716,8 +714,7 @@ const BridgeForm = ({
|
|
|
716
714
|
onBlur: handleBlur,
|
|
717
715
|
onMaxBtnClick: handleOnFirstMaxBtnChange,
|
|
718
716
|
selectedOption: firstToken,
|
|
719
|
-
onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
|
|
720
|
-
nativeAuthToken
|
|
717
|
+
onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
|
|
721
718
|
}
|
|
722
719
|
)
|
|
723
720
|
] })
|
|
@@ -740,7 +737,7 @@ const BridgeForm = ({
|
|
|
740
737
|
reactjs_components_Connect_MvxAccountDisplay.MvxAccountDisplay,
|
|
741
738
|
{
|
|
742
739
|
accountAddress: mvxAddress,
|
|
743
|
-
chainIcon: (mvxChain == null ? void 0 : mvxChain.
|
|
740
|
+
chainIcon: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
744
741
|
username,
|
|
745
742
|
accountExplorerUrl: `${options.mvxExplorerAddress}/accounts/${mvxAddress}`,
|
|
746
743
|
showTag: true,
|
|
@@ -774,8 +771,7 @@ const BridgeForm = ({
|
|
|
774
771
|
color: "neutral-850",
|
|
775
772
|
onChange: onChangeSecondSelect,
|
|
776
773
|
onBlur: handleBlur,
|
|
777
|
-
selectedOption: secondToken
|
|
778
|
-
nativeAuthToken
|
|
774
|
+
selectedOption: secondToken
|
|
779
775
|
}
|
|
780
776
|
)
|
|
781
777
|
] })
|
|
@@ -787,7 +783,7 @@ const BridgeForm = ({
|
|
|
787
783
|
reactjs_components_Connect_MvxConnectButton.MvxConnectButton,
|
|
788
784
|
{
|
|
789
785
|
mvxAccountAddress: mvxAddress,
|
|
790
|
-
icon: mvxChain == null ? void 0 : mvxChain.
|
|
786
|
+
icon: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
791
787
|
onClick: onMvxConnect
|
|
792
788
|
}
|
|
793
789
|
),
|
|
@@ -812,7 +808,7 @@ const BridgeForm = ({
|
|
|
812
808
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
813
809
|
"img",
|
|
814
810
|
{
|
|
815
|
-
src: (mvxChain == null ? void 0 : mvxChain.
|
|
811
|
+
src: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
816
812
|
alt: "",
|
|
817
813
|
className: "liq-h-[1.5rem] liq-w-[1.5rem]"
|
|
818
814
|
}
|
|
@@ -833,7 +829,7 @@ const BridgeForm = ({
|
|
|
833
829
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
834
830
|
"img",
|
|
835
831
|
{
|
|
836
|
-
src: (mvxChain == null ? void 0 : mvxChain.
|
|
832
|
+
src: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
837
833
|
alt: "",
|
|
838
834
|
className: "liq-h-[1.5rem] liq-w-[1.5rem]"
|
|
839
835
|
}
|
|
@@ -41,7 +41,7 @@ import { MvxAccountDisplay } from "../Connect/MvxAccountDisplay.mjs";
|
|
|
41
41
|
import { TokenSelector } from "../TokenSelector/TokenSelector.mjs";
|
|
42
42
|
import { hexToString } from "viem";
|
|
43
43
|
import { waitForTransactionReceipt as waitForTransactionReceipt$1, getTransaction, call } from "viem/actions";
|
|
44
|
-
import { g as getAction } from "../../../useBalances-
|
|
44
|
+
import { g as getAction } from "../../../useBalances-CtcrEcK2.mjs";
|
|
45
45
|
function deepEqual(a, b) {
|
|
46
46
|
if (a === b)
|
|
47
47
|
return true;
|
|
@@ -118,7 +118,6 @@ const BridgeForm = ({
|
|
|
118
118
|
mvxChainId,
|
|
119
119
|
mvxAddress,
|
|
120
120
|
username,
|
|
121
|
-
nativeAuthToken,
|
|
122
121
|
callbackRoute = "/",
|
|
123
122
|
firstTokenIdentifier,
|
|
124
123
|
secondTokenIdentifier,
|
|
@@ -142,7 +141,12 @@ const BridgeForm = ({
|
|
|
142
141
|
const [siginingTransactionsCount, setSigningTransactionsCount] = useState(0);
|
|
143
142
|
const account = useAccount();
|
|
144
143
|
const { switchNetwork } = useAppKitNetwork();
|
|
145
|
-
const {
|
|
144
|
+
const {
|
|
145
|
+
config,
|
|
146
|
+
options,
|
|
147
|
+
supportedChains: sdkChains,
|
|
148
|
+
nativeAuthToken
|
|
149
|
+
} = useWeb3App();
|
|
146
150
|
const chainId = useGetChainId();
|
|
147
151
|
const {
|
|
148
152
|
evmTokensWithBalances,
|
|
@@ -155,8 +159,7 @@ const BridgeForm = ({
|
|
|
155
159
|
} = useFetchBridgeData({
|
|
156
160
|
refetchTrigger,
|
|
157
161
|
mvxAddress,
|
|
158
|
-
mvxApiURL: options.mvxApiURL
|
|
159
|
-
nativeAuthToken
|
|
162
|
+
mvxApiURL: options.mvxApiURL
|
|
160
163
|
});
|
|
161
164
|
const isTokensLoading = tokensLoading || isLoadingEvmTokensBalances || isLoadingMvxTokensBalances || isChainsLoading;
|
|
162
165
|
const activeChain = useMemo(() => {
|
|
@@ -556,7 +559,6 @@ const BridgeForm = ({
|
|
|
556
559
|
resetSwapForm
|
|
557
560
|
} = useBridgeFormik({
|
|
558
561
|
rate,
|
|
559
|
-
nativeAuthToken,
|
|
560
562
|
mvxAccountAddress: mvxAddress,
|
|
561
563
|
firstToken,
|
|
562
564
|
firstAmount,
|
|
@@ -648,6 +650,10 @@ const BridgeForm = ({
|
|
|
648
650
|
handleOnChangeSecondAmount(secondTokenAmount);
|
|
649
651
|
}
|
|
650
652
|
}, [secondTokenAmount]);
|
|
653
|
+
console.log("BridgeForm=", {
|
|
654
|
+
nativeAuthToken,
|
|
655
|
+
chains
|
|
656
|
+
});
|
|
651
657
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
652
658
|
"form",
|
|
653
659
|
{
|
|
@@ -657,14 +663,7 @@ const BridgeForm = ({
|
|
|
657
663
|
autoComplete: "off",
|
|
658
664
|
onSubmit: handleSubmit,
|
|
659
665
|
children: [
|
|
660
|
-
showHistory && /* @__PURE__ */ jsx(
|
|
661
|
-
BridgeHistory,
|
|
662
|
-
{
|
|
663
|
-
mvxAddress,
|
|
664
|
-
onClose: handleHistoryClose,
|
|
665
|
-
nativeAuthToken
|
|
666
|
-
}
|
|
667
|
-
),
|
|
666
|
+
showHistory && /* @__PURE__ */ jsx(BridgeHistory, { mvxAddress, onClose: handleHistoryClose }),
|
|
668
667
|
/* @__PURE__ */ jsxs(
|
|
669
668
|
AmountCard,
|
|
670
669
|
{
|
|
@@ -682,8 +681,7 @@ const BridgeForm = ({
|
|
|
682
681
|
BridgeAccountDisplay,
|
|
683
682
|
{
|
|
684
683
|
disabled: isPendingRate,
|
|
685
|
-
activeChain: selectedChainOption
|
|
686
|
-
nativeAuthToken
|
|
684
|
+
activeChain: selectedChainOption
|
|
687
685
|
}
|
|
688
686
|
)
|
|
689
687
|
] }),
|
|
@@ -713,8 +711,7 @@ const BridgeForm = ({
|
|
|
713
711
|
onBlur: handleBlur,
|
|
714
712
|
onMaxBtnClick: handleOnFirstMaxBtnChange,
|
|
715
713
|
selectedOption: firstToken,
|
|
716
|
-
onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
|
|
717
|
-
nativeAuthToken
|
|
714
|
+
onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
|
|
718
715
|
}
|
|
719
716
|
)
|
|
720
717
|
] })
|
|
@@ -737,7 +734,7 @@ const BridgeForm = ({
|
|
|
737
734
|
MvxAccountDisplay,
|
|
738
735
|
{
|
|
739
736
|
accountAddress: mvxAddress,
|
|
740
|
-
chainIcon: (mvxChain == null ? void 0 : mvxChain.
|
|
737
|
+
chainIcon: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
741
738
|
username,
|
|
742
739
|
accountExplorerUrl: `${options.mvxExplorerAddress}/accounts/${mvxAddress}`,
|
|
743
740
|
showTag: true,
|
|
@@ -771,8 +768,7 @@ const BridgeForm = ({
|
|
|
771
768
|
color: "neutral-850",
|
|
772
769
|
onChange: onChangeSecondSelect,
|
|
773
770
|
onBlur: handleBlur,
|
|
774
|
-
selectedOption: secondToken
|
|
775
|
-
nativeAuthToken
|
|
771
|
+
selectedOption: secondToken
|
|
776
772
|
}
|
|
777
773
|
)
|
|
778
774
|
] })
|
|
@@ -784,7 +780,7 @@ const BridgeForm = ({
|
|
|
784
780
|
MvxConnectButton,
|
|
785
781
|
{
|
|
786
782
|
mvxAccountAddress: mvxAddress,
|
|
787
|
-
icon: mvxChain == null ? void 0 : mvxChain.
|
|
783
|
+
icon: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
788
784
|
onClick: onMvxConnect
|
|
789
785
|
}
|
|
790
786
|
),
|
|
@@ -809,7 +805,7 @@ const BridgeForm = ({
|
|
|
809
805
|
/* @__PURE__ */ jsx(
|
|
810
806
|
"img",
|
|
811
807
|
{
|
|
812
|
-
src: (mvxChain == null ? void 0 : mvxChain.
|
|
808
|
+
src: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
813
809
|
alt: "",
|
|
814
810
|
className: "liq-h-[1.5rem] liq-w-[1.5rem]"
|
|
815
811
|
}
|
|
@@ -830,7 +826,7 @@ const BridgeForm = ({
|
|
|
830
826
|
/* @__PURE__ */ jsx(
|
|
831
827
|
"img",
|
|
832
828
|
{
|
|
833
|
-
src: (mvxChain == null ? void 0 : mvxChain.
|
|
829
|
+
src: (mvxChain == null ? void 0 : mvxChain.pngUrl) ?? "",
|
|
834
830
|
alt: "",
|
|
835
831
|
className: "liq-h-[1.5rem] liq-w-[1.5rem]"
|
|
836
832
|
}
|
|
@@ -26,13 +26,11 @@ const reactjs_components_base_MxTooltip_MxTooltip = require("../base/MxTooltip/M
|
|
|
26
26
|
const ArrowUpRight = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%206V13C15%2013.5625%2014.5312%2014%2014%2014C13.4375%2014%2013%2013.5625%2013%2013V8.4375L6.6875%2014.7188C6.3125%2015.125%205.65625%2015.125%205.28125%2014.7188C4.875%2014.3438%204.875%2013.6875%205.28125%2013.3125L11.5625%207H7C6.4375%207%206%206.5625%206%206C6%205.46875%206.4375%205%207%205H14C14.5312%205%2015%205.46875%2015%206Z'%20fill='%23CDD0DB'/%3e%3c/svg%3e";
|
|
27
27
|
const BridgeHistory = ({
|
|
28
28
|
mvxAddress,
|
|
29
|
-
nativeAuthToken,
|
|
30
29
|
onClose
|
|
31
30
|
}) => {
|
|
32
31
|
const { options } = reactjs_context_useWeb3App.useWeb3App();
|
|
33
32
|
const { data, isLoading, isError } = reactjs_queries_useGetHistory_query.useGetHistoryQuery({
|
|
34
|
-
address: mvxAddress
|
|
35
|
-
nativeAuthToken
|
|
33
|
+
address: mvxAddress
|
|
36
34
|
});
|
|
37
35
|
const resolveTransactionIcon = React.useCallback((transaction) => {
|
|
38
36
|
switch (transaction.status) {
|
|
@@ -85,8 +83,7 @@ const BridgeHistory = ({
|
|
|
85
83
|
isChainsLoading
|
|
86
84
|
} = reactjs_hooks_useFetchBridgeData.useFetchBridgeData({
|
|
87
85
|
mvxAddress,
|
|
88
|
-
mvxApiURL: options.mvxApiURL
|
|
89
|
-
nativeAuthToken
|
|
86
|
+
mvxApiURL: options.mvxApiURL
|
|
90
87
|
});
|
|
91
88
|
const tokensMap = React.useMemo(() => {
|
|
92
89
|
return [
|
|
@@ -217,7 +214,7 @@ const BridgeHistory = ({
|
|
|
217
214
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
218
215
|
"img",
|
|
219
216
|
{
|
|
220
|
-
src: (_c = tokensMap[transaction.tokenDestination]) == null ? void 0 : _c.
|
|
217
|
+
src: (_c = tokensMap[transaction.tokenDestination]) == null ? void 0 : _c.pngUrl,
|
|
221
218
|
alt: "",
|
|
222
219
|
className: "liq-h-[1.5rem] liq-w-[1.5rem]"
|
|
223
220
|
}
|
|
@@ -234,7 +231,7 @@ const BridgeHistory = ({
|
|
|
234
231
|
/* @__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-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
235
232
|
"img",
|
|
236
233
|
{
|
|
237
|
-
src: (_f = tokensMap[transaction.tokenSource]) == null ? void 0 : _f.
|
|
234
|
+
src: (_f = tokensMap[transaction.tokenSource]) == null ? void 0 : _f.pngUrl,
|
|
238
235
|
alt: "",
|
|
239
236
|
className: "liq-asset-icon liq-sm liq-p-0"
|
|
240
237
|
}
|
|
@@ -242,7 +239,7 @@ const BridgeHistory = ({
|
|
|
242
239
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
243
240
|
"img",
|
|
244
241
|
{
|
|
245
|
-
src: (_g = chainsMap[transaction.fromChainId]) == null ? void 0 : _g.
|
|
242
|
+
src: (_g = chainsMap[transaction.fromChainId]) == null ? void 0 : _g.pngUrl,
|
|
246
243
|
alt: "",
|
|
247
244
|
className: "liq-absolute liq-left-3 liq-bottom-[-2px] liq-chain-icon liq-sm liq-w-5 liq-h-5 liq-border-[3px] liq-border-neutral-850 liq-rounded-lg"
|
|
248
245
|
}
|
|
@@ -274,7 +271,7 @@ const BridgeHistory = ({
|
|
|
274
271
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
275
272
|
"img",
|
|
276
273
|
{
|
|
277
|
-
src: (_j = tokensMap[transaction.tokenSource]) == null ? void 0 : _j.
|
|
274
|
+
src: (_j = tokensMap[transaction.tokenSource]) == null ? void 0 : _j.pngUrl,
|
|
278
275
|
alt: "",
|
|
279
276
|
className: "liq-h-[1.5rem] liq-w-[1.5rem]"
|
|
280
277
|
}
|
|
@@ -291,7 +288,7 @@ const BridgeHistory = ({
|
|
|
291
288
|
/* @__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-8 liq-w-8 liq-flex liq-items-center liq-justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
292
289
|
"img",
|
|
293
290
|
{
|
|
294
|
-
src: (_m = tokensMap[transaction.tokenDestination]) == null ? void 0 : _m.
|
|
291
|
+
src: (_m = tokensMap[transaction.tokenDestination]) == null ? void 0 : _m.pngUrl,
|
|
295
292
|
alt: "",
|
|
296
293
|
className: "liq-asset-icon liq-sm liq-p-0"
|
|
297
294
|
}
|
|
@@ -299,7 +296,7 @@ const BridgeHistory = ({
|
|
|
299
296
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
300
297
|
"img",
|
|
301
298
|
{
|
|
302
|
-
src: (_n = chainsMap[transaction.toChainId]) == null ? void 0 : _n.
|
|
299
|
+
src: (_n = chainsMap[transaction.toChainId]) == null ? void 0 : _n.pngUrl,
|
|
303
300
|
alt: "",
|
|
304
301
|
className: "liq-absolute liq-left-3 liq-bottom-[-2px] liq-chain-icon liq-sm liq-w-5 liq-h-5 liq-border-[3px] liq-border-neutral-850 liq-rounded-lg"
|
|
305
302
|
}
|