rainbow-swap-sdk 1.5.2 → 1.5.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/dist/enums/swap-status.enum.d.ts +6 -0
- package/dist/enums/swap-status.enum.js +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/interfaces/swap-history-data.interface.d.ts +17 -0
- package/dist/interfaces/swap-history-data.interface.js +2 -0
- package/dist/types/swap-history-data.type.d.ts +3 -0
- package/dist/types/swap-history-data.type.js +2 -0
- package/dist/utils/api.utils.d.ts +4 -1
- package/dist/utils/api.utils.js +8 -3
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwapStatusEnum = void 0;
|
|
4
|
+
var SwapStatusEnum;
|
|
5
|
+
(function (SwapStatusEnum) {
|
|
6
|
+
SwapStatusEnum["Pending"] = "Pending";
|
|
7
|
+
SwapStatusEnum["Success"] = "Success";
|
|
8
|
+
SwapStatusEnum["Failed"] = "Failed";
|
|
9
|
+
SwapStatusEnum["PartiallyFilled"] = "Partially Filled";
|
|
10
|
+
})(SwapStatusEnum || (exports.SwapStatusEnum = SwapStatusEnum = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export type { AssetsRecord } from './types/assets-record.type';
|
|
|
9
9
|
export type { BestRouteDisplayData, RouteDisplayData, RouteStepDisplayData } from './types/best-route-display-data.type';
|
|
10
10
|
export type { BestRouteParams } from './types/best-route-params.type';
|
|
11
11
|
export type { BestRouteResponse } from './types/best-route-response.type';
|
|
12
|
-
export { getAssetsRecord, getAssetsList, getBestRoute, getAppStatus } from './utils/api.utils';
|
|
12
|
+
export { getAssetsRecord, getAssetsList, getBestRoute, getAppStatus, getSwapHistoryData } from './utils/api.utils';
|
|
13
13
|
export { toNano, fromNano } from './utils/big-int.utils';
|
|
14
14
|
export { getQueryId } from './utils/transfer-params.utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getQueryId = exports.fromNano = exports.toNano = exports.getAppStatus = exports.getBestRoute = exports.getAssetsList = exports.getAssetsRecord = exports.SwapRouteType = exports.RouteDirectionEnum = exports.DexTypeEnum = void 0;
|
|
3
|
+
exports.getQueryId = exports.fromNano = exports.toNano = exports.getSwapHistoryData = exports.getAppStatus = exports.getBestRoute = exports.getAssetsList = exports.getAssetsRecord = exports.SwapRouteType = exports.RouteDirectionEnum = exports.DexTypeEnum = void 0;
|
|
4
4
|
var dex_type_enum_1 = require("./enums/dex-type.enum");
|
|
5
5
|
Object.defineProperty(exports, "DexTypeEnum", { enumerable: true, get: function () { return dex_type_enum_1.DexTypeEnum; } });
|
|
6
6
|
var route_direction_enum_1 = require("./enums/route-direction.enum");
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "getAssetsRecord", { enumerable: true, get: funct
|
|
|
12
12
|
Object.defineProperty(exports, "getAssetsList", { enumerable: true, get: function () { return api_utils_1.getAssetsList; } });
|
|
13
13
|
Object.defineProperty(exports, "getBestRoute", { enumerable: true, get: function () { return api_utils_1.getBestRoute; } });
|
|
14
14
|
Object.defineProperty(exports, "getAppStatus", { enumerable: true, get: function () { return api_utils_1.getAppStatus; } });
|
|
15
|
+
Object.defineProperty(exports, "getSwapHistoryData", { enumerable: true, get: function () { return api_utils_1.getSwapHistoryData; } });
|
|
15
16
|
var big_int_utils_1 = require("./utils/big-int.utils");
|
|
16
17
|
Object.defineProperty(exports, "toNano", { enumerable: true, get: function () { return big_int_utils_1.toNano; } });
|
|
17
18
|
Object.defineProperty(exports, "fromNano", { enumerable: true, get: function () { return big_int_utils_1.fromNano; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SwapStatusEnum } from '../enums/swap-status.enum';
|
|
2
|
+
export interface SwapHistoryData {
|
|
3
|
+
timestamp: number;
|
|
4
|
+
bocHash: string;
|
|
5
|
+
status: SwapStatusEnum;
|
|
6
|
+
completedMessageCount: number;
|
|
7
|
+
sentInfo?: Info;
|
|
8
|
+
receivedInfo?: Info;
|
|
9
|
+
returnedInfo?: Info;
|
|
10
|
+
intermediateTokensInfo?: Info[];
|
|
11
|
+
}
|
|
12
|
+
interface Info {
|
|
13
|
+
amount: number;
|
|
14
|
+
usdAmount: number;
|
|
15
|
+
symbol: string;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { SwapHistoryData } from '../interfaces/swap-history-data.interface';
|
|
1
2
|
import { AppStatus } from '../types/app-status.type';
|
|
2
3
|
import { Asset } from '../types/asset.type';
|
|
3
4
|
import { AssetsListParams } from '../types/assets-list-patams.type';
|
|
4
5
|
import { AssetsRecord } from '../types/assets-record.type';
|
|
5
6
|
import { BestRouteParams } from '../types/best-route-params.type';
|
|
6
7
|
import { BestRouteResponse } from '../types/best-route-response.type';
|
|
8
|
+
import { SwapHistoryDataParams } from '../types/swap-history-data.type';
|
|
7
9
|
export declare const getAppStatus: () => Promise<AppStatus>;
|
|
8
10
|
/**
|
|
9
11
|
* @deprecated This method is deprecated and will be removed in the next major release.
|
|
@@ -11,4 +13,5 @@ export declare const getAppStatus: () => Promise<AppStatus>;
|
|
|
11
13
|
*/
|
|
12
14
|
export declare const getAssetsRecord: () => Promise<AssetsRecord>;
|
|
13
15
|
export declare const getAssetsList: (params: AssetsListParams) => Promise<Asset[]>;
|
|
14
|
-
export declare const getBestRoute: (params: BestRouteParams) => Promise<BestRouteResponse>;
|
|
16
|
+
export declare const getBestRoute: (params: BestRouteParams, authTokens?: string) => Promise<BestRouteResponse>;
|
|
17
|
+
export declare const getSwapHistoryData: (params: SwapHistoryDataParams) => Promise<SwapHistoryData>;
|
package/dist/utils/api.utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBestRoute = exports.getAssetsList = exports.getAssetsRecord = exports.getAppStatus = void 0;
|
|
3
|
+
exports.getSwapHistoryData = exports.getBestRoute = exports.getAssetsList = exports.getAssetsRecord = exports.getAppStatus = void 0;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
const getAppStatus = () => globals_1.API.get('/app-status').then(response => response.data);
|
|
6
6
|
exports.getAppStatus = getAppStatus;
|
|
@@ -25,14 +25,19 @@ const getAssetsList = (params) => {
|
|
|
25
25
|
}).then(response => response.data);
|
|
26
26
|
};
|
|
27
27
|
exports.getAssetsList = getAssetsList;
|
|
28
|
-
const getBestRoute = (params) => {
|
|
28
|
+
const getBestRoute = (params, authTokens) => {
|
|
29
29
|
if (abortControllers.bestRoute) {
|
|
30
30
|
abortControllers.bestRoute.abort();
|
|
31
31
|
}
|
|
32
32
|
abortControllers.bestRoute = new AbortController();
|
|
33
33
|
return globals_1.API.get('/best-route', {
|
|
34
34
|
params,
|
|
35
|
-
signal: abortControllers.bestRoute.signal
|
|
35
|
+
signal: abortControllers.bestRoute.signal,
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: authTokens
|
|
38
|
+
}
|
|
36
39
|
}).then(response => response.data);
|
|
37
40
|
};
|
|
38
41
|
exports.getBestRoute = getBestRoute;
|
|
42
|
+
const getSwapHistoryData = (params) => globals_1.API.get('/swap-history-data', { params }).then(response => response.data);
|
|
43
|
+
exports.getSwapHistoryData = getSwapHistoryData;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rainbow-swap-sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "SDK for building applications on top of Rainbow.ag - Swap Aggregator on TON 💎.",
|
|
5
5
|
"repository": "https://github.com/0xblackbot/rainbow-swap-sdk.git",
|
|
6
6
|
"license": "Apache-2.0",
|