@multiversx/sdk-dapp-liquidity 1.1.0-alpha.0 → 1.1.0-alpha.1
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 +2 -2
- package/api/confirmFiatRate.d.ts +19 -0
- package/api/confirmFiatRate.js +34 -0
- package/api/confirmFiatRate.mjs +33 -0
- package/api/tests/getChains.spec.js +1 -1
- package/api/tests/getChains.spec.mjs +1 -1
- package/api/tests/getTransactions.spec.js +7 -3
- package/api/tests/getTransactions.spec.mjs +7 -3
- package/api/tests/sendTransactions.spec.js +14 -8
- package/api/tests/sendTransactions.spec.mjs +14 -8
- package/{index-ColTMqTq.mjs → bitcoin-CC1UPyzF.mjs} +28691 -52450
- package/{index-SjL1bsvE.js → bitcoin-DgJtQpEP.js} +28565 -52324
- package/dto/Chain.dto.d.ts +1 -1
- package/dto/Token.dto.d.ts +1 -0
- package/dto/Transaction.dto.d.ts +3 -0
- package/index-0HkMxaG8.js +468 -0
- package/{index-D3h_0DdC.js → index-CRpflwIF.js} +3 -2
- package/{index-fUglKiv3.mjs → index-CpW-TGUF.mjs} +2 -1
- package/index-D6X1U8OY.mjs +231 -0
- package/index.js +3 -3
- package/index.mjs +3 -3
- package/modules/fiat/components/FiatForm/FiatForm.d.ts +9 -0
- package/modules/fiat/components/FiatForm/FiatForm.js +315 -0
- package/modules/fiat/components/FiatForm/FiatForm.mjs +314 -0
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.d.ts +13 -0
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.js +118 -0
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.mjs +117 -0
- package/modules/fiat/components/FiatForm/components/AmountInput/index.d.ts +1 -0
- package/modules/fiat/components/FiatForm/components/AmountInput/index.js +5 -0
- package/modules/fiat/components/FiatForm/components/AmountInput/index.mjs +4 -0
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.d.ts +7 -0
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.js +74 -0
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.mjs +73 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.d.ts +14 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.js +94 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.mjs +93 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.d.ts +7 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.js +83 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.mjs +82 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.d.ts +7 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.js +92 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.mjs +91 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.d.ts +5 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.js +30 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.mjs +29 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.d.ts +8 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.js +104 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.mjs +103 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.d.ts +7 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.js +33 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.mjs +32 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.d.ts +7 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.js +21 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.mjs +20 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.d.ts +9 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.js +26 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.mjs +25 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.d.ts +1 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.js +5 -0
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.mjs +4 -0
- package/modules/fiat/components/FiatForm/index.d.ts +1 -0
- package/modules/fiat/components/FiatForm/index.js +5 -0
- package/modules/fiat/components/FiatForm/index.mjs +4 -0
- package/modules/fiat/components/index.d.ts +1 -0
- package/modules/fiat/components/index.js +5 -0
- package/modules/fiat/components/index.mjs +4 -0
- package/modules/fiat/context/FiatProvider.d.ts +8 -0
- package/modules/fiat/context/FiatProvider.js +24 -0
- package/modules/fiat/context/FiatProvider.mjs +23 -0
- package/modules/fiat/context/queryClient.d.ts +3 -0
- package/modules/fiat/context/queryClient.js +12 -0
- package/modules/fiat/context/queryClient.mjs +11 -0
- package/modules/fiat/context/useFiat.d.ts +1 -0
- package/modules/fiat/context/useFiat.js +13 -0
- package/modules/fiat/context/useFiat.mjs +12 -0
- package/modules/fiat/hooks/index.d.ts +2 -0
- package/modules/fiat/hooks/index.js +7 -0
- package/modules/fiat/hooks/index.mjs +6 -0
- package/modules/fiat/hooks/useFiatData.d.ts +7 -0
- package/modules/fiat/hooks/useFiatData.js +76 -0
- package/modules/fiat/hooks/useFiatData.mjs +75 -0
- package/modules/fiat/hooks/validation/index.d.ts +1 -0
- package/modules/fiat/hooks/validation/index.js +5 -0
- package/modules/fiat/hooks/validation/index.mjs +4 -0
- package/modules/fiat/hooks/validation/useAmountSchema.d.ts +2 -0
- package/modules/fiat/hooks/validation/useAmountSchema.js +27 -0
- package/modules/fiat/hooks/validation/useAmountSchema.mjs +9 -0
- package/modules/fiat/index.d.ts +8 -0
- package/modules/fiat/index.js +22 -0
- package/modules/fiat/index.mjs +21 -0
- package/modules/fiat/init/index.d.ts +2 -0
- package/modules/fiat/init/index.js +5 -0
- package/modules/fiat/init/index.mjs +4 -0
- package/modules/fiat/init/init.d.ts +22 -0
- package/modules/fiat/init/init.js +15 -0
- package/modules/fiat/init/init.mjs +14 -0
- package/modules/fiat/queries/index.d.ts +2 -0
- package/modules/fiat/queries/index.js +7 -0
- package/modules/fiat/queries/index.mjs +6 -0
- package/modules/fiat/queries/useGetRate.mutation.d.ts +6 -0
- package/modules/fiat/queries/useGetRate.mutation.js +20 -0
- package/modules/fiat/queries/useGetRate.mutation.mjs +19 -0
- package/modules/fiat/queries/useGetTokens.query.d.ts +5 -0
- package/modules/fiat/queries/useGetTokens.query.js +33 -0
- package/modules/fiat/queries/useGetTokens.query.mjs +32 -0
- package/package.json +3 -2
- package/react-B64ZbiKy.mjs +254 -0
- package/{react-D2FjNBgs.js → react-BozMPLkn.js} +623 -419
- package/{react-DykKTu1E.mjs → react-CN9w_Rtw.mjs} +263 -59
- package/{react-BDmrtlgL.mjs → react-CZt9p-RK.mjs} +2 -1
- package/{react-CtPdHYsQ.js → react-DSg_4gdG.js} +7 -6
- package/react-Wmrk3u2q.js +254 -0
- package/reactjs/components/BridgeForm/BridgeForm.js +11 -2
- package/reactjs/components/BridgeForm/BridgeForm.mjs +12 -3
- package/reactjs/components/BridgeHistory/BridgeHistory.js +90 -29
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +91 -30
- package/reactjs/components/Connect/BridgeAccountDisplay.js +3 -2
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +3 -2
- package/reactjs/components/Connect/CustomConnectButton.js +3 -2
- package/reactjs/components/Connect/CustomConnectButton.mjs +3 -2
- package/reactjs/components/Connect/SwitchChainButton.js +4 -3
- package/reactjs/components/Connect/SwitchChainButton.mjs +4 -3
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +1 -1
- package/reactjs/components/TokenSelector/components/TokenItem.js +2 -2
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +2 -2
- package/reactjs/hooks/useAccount.js +3 -2
- package/reactjs/hooks/useAccount.mjs +3 -2
- package/reactjs/hooks/useFetchBridgeData.d.ts +4 -0
- package/reactjs/hooks/useFetchBridgeData.js +6 -2
- package/reactjs/hooks/useFetchBridgeData.mjs +6 -2
- package/reactjs/hooks/useFetchTokens.d.ts +4 -0
- package/reactjs/hooks/useFetchTokens.js +6 -1
- package/reactjs/hooks/useFetchTokens.mjs +6 -1
- package/reactjs/hooks/useFiatData.d.ts +28 -0
- package/reactjs/hooks/useFiatData.js +68 -0
- package/reactjs/hooks/useFiatData.mjs +67 -0
- package/reactjs/hooks/useGetChainId.js +1 -1
- package/reactjs/hooks/useGetChainId.mjs +1 -1
- package/reactjs/index.js +3 -3
- package/reactjs/index.mjs +3 -3
- package/reactjs/init/init.d.ts +1 -2
- package/reactjs/init/init.js +1 -1
- package/reactjs/init/init.mjs +1 -1
- package/reactjs/init/tests/init.spec.js +4 -4
- package/reactjs/init/tests/init.spec.mjs +4 -4
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +1 -0
- package/reactjs/queries/useGetEvmTokensBalances.query.js +3 -2
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +3 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +1 -0
- package/reactjs/queries/useGetRate.mutation.js +1 -12
- package/reactjs/queries/useGetRate.mutation.mjs +1 -12
- package/reactjs/reexports.js +3 -3
- package/reactjs/reexports.mjs +3 -3
- package/style.css +1724 -0
- package/{w3m-modal-C56iK3fa.js → w3m-modal-D1GK9s5A.js} +47 -47
- package/{w3m-modal-rwydRJct.mjs → w3m-modal-DFePcJNd.mjs} +1 -1
- package/index-CYK46UPq.js +0 -329
- package/index-Ct1WIDmD.mjs +0 -91
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @multiversx/
|
|
1
|
+
# @multiversx/sdk-dapp-liquidity
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
@@ -63,7 +63,7 @@ yarn publish-package-next
|
|
|
63
63
|
## Usage
|
|
64
64
|
|
|
65
65
|
```css
|
|
66
|
-
@import 'node_modules/@multiversx/
|
|
66
|
+
@import 'node_modules/@multiversx/sdk-dapp-liquidity/style.css';
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
```tsx
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ConfirmRateDto } from '../dto/ConfirmRate.dto';
|
|
2
|
+
import { AxiosResponse } from 'axios';
|
|
3
|
+
|
|
4
|
+
type ConfirmFiatRateProps = {
|
|
5
|
+
url: string;
|
|
6
|
+
nativeAuthToken: string;
|
|
7
|
+
body: ConfirmRateDto;
|
|
8
|
+
};
|
|
9
|
+
type ConfirmFiatRateResponse = ConfirmRateDto & {
|
|
10
|
+
type: string;
|
|
11
|
+
content: string;
|
|
12
|
+
additionalInfo: {
|
|
13
|
+
url: string;
|
|
14
|
+
checksum: string;
|
|
15
|
+
jsonRequest: string;
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
export declare function confirmFiatRate({ url, nativeAuthToken, body }: ConfirmFiatRateProps): Promise<AxiosResponse<ConfirmFiatRateResponse>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const axios = require("axios");
|
|
5
|
+
const helpers_decodeToken = require("../helpers/decodeToken.js");
|
|
6
|
+
async function confirmFiatRate({
|
|
7
|
+
url,
|
|
8
|
+
nativeAuthToken,
|
|
9
|
+
body
|
|
10
|
+
}) {
|
|
11
|
+
var _a;
|
|
12
|
+
const config = {
|
|
13
|
+
baseURL: url,
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (!nativeAuthToken) {
|
|
19
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
20
|
+
}
|
|
21
|
+
const decodedToken = await helpers_decodeToken.decodeToken(nativeAuthToken);
|
|
22
|
+
if (config.headers.set) {
|
|
23
|
+
config.headers.set({
|
|
24
|
+
...config.headers,
|
|
25
|
+
origin: (decodedToken == null ? void 0 : decodedToken.origin) ?? ""
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return await axios.post(
|
|
29
|
+
`/rate/confirm`,
|
|
30
|
+
body,
|
|
31
|
+
config
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
exports.confirmFiatRate = confirmFiatRate;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { decodeToken } from "../helpers/decodeToken.mjs";
|
|
3
|
+
async function confirmFiatRate({
|
|
4
|
+
url,
|
|
5
|
+
nativeAuthToken,
|
|
6
|
+
body
|
|
7
|
+
}) {
|
|
8
|
+
var _a;
|
|
9
|
+
const config = {
|
|
10
|
+
baseURL: url,
|
|
11
|
+
headers: {
|
|
12
|
+
Authorization: `Bearer ${nativeAuthToken}`
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
if (!nativeAuthToken) {
|
|
16
|
+
(_a = config.headers) == null ? true : delete _a.Authorization;
|
|
17
|
+
}
|
|
18
|
+
const decodedToken = await decodeToken(nativeAuthToken);
|
|
19
|
+
if (config.headers.set) {
|
|
20
|
+
config.headers.set({
|
|
21
|
+
...config.headers,
|
|
22
|
+
origin: (decodedToken == null ? void 0 : decodedToken.origin) ?? ""
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return await axios.post(
|
|
26
|
+
`/rate/confirm`,
|
|
27
|
+
body,
|
|
28
|
+
config
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
confirmFiatRate
|
|
33
|
+
};
|
|
@@ -9,7 +9,7 @@ describe("getChains", () => {
|
|
|
9
9
|
it("fetches chains successfully", async () => {
|
|
10
10
|
const response = [
|
|
11
11
|
{
|
|
12
|
-
chainId: 1,
|
|
12
|
+
chainId: "1",
|
|
13
13
|
chainName: "msx",
|
|
14
14
|
pngUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.png",
|
|
15
15
|
svgUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.svg",
|
|
@@ -7,7 +7,7 @@ describe("getChains", () => {
|
|
|
7
7
|
it("fetches chains successfully", async () => {
|
|
8
8
|
const response = [
|
|
9
9
|
{
|
|
10
|
-
chainId: 1,
|
|
10
|
+
chainId: "1",
|
|
11
11
|
chainName: "msx",
|
|
12
12
|
pngUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.png",
|
|
13
13
|
svgUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.svg",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
const axios = require("axios");
|
|
4
|
+
const types_providerType = require("../../types/providerType.js");
|
|
4
5
|
const api_getTransactions = require("../getTransactions.js");
|
|
5
6
|
jest.mock("axios");
|
|
6
7
|
const mockedAxios = axios;
|
|
@@ -21,7 +22,8 @@ describe("getTransactions", () => {
|
|
|
21
22
|
status: "success",
|
|
22
23
|
receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
|
|
23
24
|
txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
|
|
24
|
-
fee: "0"
|
|
25
|
+
fee: "0",
|
|
26
|
+
provider: types_providerType.ProviderType.MultiversxBridge
|
|
25
27
|
}
|
|
26
28
|
];
|
|
27
29
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
@@ -46,7 +48,8 @@ describe("getTransactions", () => {
|
|
|
46
48
|
status: "success",
|
|
47
49
|
receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
|
|
48
50
|
txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
|
|
49
|
-
fee: "0"
|
|
51
|
+
fee: "0",
|
|
52
|
+
provider: types_providerType.ProviderType.MultiversxBridge
|
|
50
53
|
}
|
|
51
54
|
];
|
|
52
55
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
@@ -72,7 +75,8 @@ describe("getTransactions", () => {
|
|
|
72
75
|
status: "success",
|
|
73
76
|
receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
|
|
74
77
|
txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
|
|
75
|
-
fee: "0"
|
|
78
|
+
fee: "0",
|
|
79
|
+
provider: types_providerType.ProviderType.MultiversxBridge
|
|
76
80
|
}
|
|
77
81
|
];
|
|
78
82
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import { ProviderType } from "../../types/providerType.mjs";
|
|
2
3
|
import { getTransactions } from "../getTransactions.mjs";
|
|
3
4
|
jest.mock("axios");
|
|
4
5
|
const mockedAxios = axios;
|
|
@@ -19,7 +20,8 @@ describe("getTransactions", () => {
|
|
|
19
20
|
status: "success",
|
|
20
21
|
receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
|
|
21
22
|
txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
|
|
22
|
-
fee: "0"
|
|
23
|
+
fee: "0",
|
|
24
|
+
provider: ProviderType.MultiversxBridge
|
|
23
25
|
}
|
|
24
26
|
];
|
|
25
27
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
@@ -44,7 +46,8 @@ describe("getTransactions", () => {
|
|
|
44
46
|
status: "success",
|
|
45
47
|
receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
|
|
46
48
|
txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
|
|
47
|
-
fee: "0"
|
|
49
|
+
fee: "0",
|
|
50
|
+
provider: ProviderType.MultiversxBridge
|
|
48
51
|
}
|
|
49
52
|
];
|
|
50
53
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
@@ -70,7 +73,8 @@ describe("getTransactions", () => {
|
|
|
70
73
|
status: "success",
|
|
71
74
|
receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
|
|
72
75
|
txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
|
|
73
|
-
fee: "0"
|
|
76
|
+
fee: "0",
|
|
77
|
+
provider: ProviderType.MultiversxBridge
|
|
74
78
|
}
|
|
75
79
|
];
|
|
76
80
|
mockedAxios.get.mockResolvedValue({ data: response });
|
|
@@ -23,7 +23,7 @@ describe("sendTransactions", () => {
|
|
|
23
23
|
}
|
|
24
24
|
];
|
|
25
25
|
it("POST sendTransactions successfully", async () => {
|
|
26
|
-
const response = { data: { transactions } };
|
|
26
|
+
const response = { data: { transactions, provider: types_providerType.ProviderType.None } };
|
|
27
27
|
mockedAxios.post.mockResolvedValue(response);
|
|
28
28
|
const result = await api_sendTransactions.sendTransactions({
|
|
29
29
|
transactions,
|
|
@@ -33,9 +33,12 @@ describe("sendTransactions", () => {
|
|
|
33
33
|
});
|
|
34
34
|
expect(mockedAxios.post).toHaveBeenCalledWith(
|
|
35
35
|
"/transactions",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
{
|
|
37
|
+
transactions: transactions.map(
|
|
38
|
+
(transaction) => JSON.parse(helpers_serializeTransaction.serializeTransaction(transaction))
|
|
39
|
+
),
|
|
40
|
+
provider: types_providerType.ProviderType.None
|
|
41
|
+
},
|
|
39
42
|
{
|
|
40
43
|
baseURL: url,
|
|
41
44
|
headers: {
|
|
@@ -49,7 +52,7 @@ describe("sendTransactions", () => {
|
|
|
49
52
|
});
|
|
50
53
|
it("POST sendTransactions with additional axiosConfig", async () => {
|
|
51
54
|
const axiosConfig = { timeout: 1e3 };
|
|
52
|
-
const response = { data: { transactions } };
|
|
55
|
+
const response = { data: { transactions, provider: types_providerType.ProviderType.None } };
|
|
53
56
|
mockedAxios.post.mockResolvedValue(response);
|
|
54
57
|
const result = await api_sendTransactions.sendTransactions({
|
|
55
58
|
transactions,
|
|
@@ -60,9 +63,12 @@ describe("sendTransactions", () => {
|
|
|
60
63
|
});
|
|
61
64
|
expect(mockedAxios.post).toHaveBeenCalledWith(
|
|
62
65
|
"/transactions",
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
{
|
|
67
|
+
transactions: transactions.map(
|
|
68
|
+
(transaction) => JSON.parse(helpers_serializeTransaction.serializeTransaction(transaction))
|
|
69
|
+
),
|
|
70
|
+
provider: types_providerType.ProviderType.None
|
|
71
|
+
},
|
|
66
72
|
{
|
|
67
73
|
baseURL: url,
|
|
68
74
|
headers: {
|
|
@@ -21,7 +21,7 @@ describe("sendTransactions", () => {
|
|
|
21
21
|
}
|
|
22
22
|
];
|
|
23
23
|
it("POST sendTransactions successfully", async () => {
|
|
24
|
-
const response = { data: { transactions } };
|
|
24
|
+
const response = { data: { transactions, provider: ProviderType.None } };
|
|
25
25
|
mockedAxios.post.mockResolvedValue(response);
|
|
26
26
|
const result = await sendTransactions({
|
|
27
27
|
transactions,
|
|
@@ -31,9 +31,12 @@ describe("sendTransactions", () => {
|
|
|
31
31
|
});
|
|
32
32
|
expect(mockedAxios.post).toHaveBeenCalledWith(
|
|
33
33
|
"/transactions",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
{
|
|
35
|
+
transactions: transactions.map(
|
|
36
|
+
(transaction) => JSON.parse(serializeTransaction(transaction))
|
|
37
|
+
),
|
|
38
|
+
provider: ProviderType.None
|
|
39
|
+
},
|
|
37
40
|
{
|
|
38
41
|
baseURL: url,
|
|
39
42
|
headers: {
|
|
@@ -47,7 +50,7 @@ describe("sendTransactions", () => {
|
|
|
47
50
|
});
|
|
48
51
|
it("POST sendTransactions with additional axiosConfig", async () => {
|
|
49
52
|
const axiosConfig = { timeout: 1e3 };
|
|
50
|
-
const response = { data: { transactions } };
|
|
53
|
+
const response = { data: { transactions, provider: ProviderType.None } };
|
|
51
54
|
mockedAxios.post.mockResolvedValue(response);
|
|
52
55
|
const result = await sendTransactions({
|
|
53
56
|
transactions,
|
|
@@ -58,9 +61,12 @@ describe("sendTransactions", () => {
|
|
|
58
61
|
});
|
|
59
62
|
expect(mockedAxios.post).toHaveBeenCalledWith(
|
|
60
63
|
"/transactions",
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
{
|
|
65
|
+
transactions: transactions.map(
|
|
66
|
+
(transaction) => JSON.parse(serializeTransaction(transaction))
|
|
67
|
+
),
|
|
68
|
+
provider: ProviderType.None
|
|
69
|
+
},
|
|
64
70
|
{
|
|
65
71
|
baseURL: url,
|
|
66
72
|
headers: {
|