rainbow-swap-sdk 1.2.1 → 1.2.2
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 +13 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/types/app-status.type.d.ts +4 -0
- package/dist/types/app-status.type.js +2 -0
- package/dist/utils/api.utils.d.ts +2 -0
- package/dist/utils/api.utils.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,19 @@ const swapMessages = await getSwapMessages(
|
|
|
53
53
|
);
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
### Application status check
|
|
57
|
+
|
|
58
|
+
Additionally, you might want to check if everything is functioning correctly. For instance, you could temporarily disable swaps if block production on TON is disrupted due to the DOGS listing.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { getAppStatus } from 'rainbow-swap-sdk';
|
|
62
|
+
|
|
63
|
+
const {
|
|
64
|
+
isSwapsEnabled, // true - if everything works fine
|
|
65
|
+
message // explanations why swaps are disabled
|
|
66
|
+
} = await getAppStatus();
|
|
67
|
+
```
|
|
68
|
+
|
|
56
69
|
### Live example
|
|
57
70
|
|
|
58
71
|
For a live example of using the SDK, visit [Rainbow Swap 🌈 repository](https://github.com/0xblackbot/rainbow-swap).
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ export { RouteDirectionEnum } from './enums/route-direction.enum';
|
|
|
4
4
|
export { SwapRouteType } from './enums/swap-route-type.enum';
|
|
5
5
|
export type { RouteStep } from './interfaces/route-step.interface';
|
|
6
6
|
export type { RouteStepWithCalculation } from './interfaces/route-step-with-calculation.interface';
|
|
7
|
+
export type { AppStatus } from './types/app-status.type';
|
|
7
8
|
export type { Asset } from './types/asset.type';
|
|
8
9
|
export type { AssetsRecord } from './types/assets-record.type';
|
|
9
10
|
export type { BestRouteResponse } from './types/best-route-response.type';
|
|
10
11
|
export type { CalculatedSwapRoute } from './types/calculated-swap-route.type';
|
|
11
|
-
export { getAssetsRecord, getBestRoute } from './utils/api.utils';
|
|
12
|
+
export { getAssetsRecord, getBestRoute, getAppStatus } from './utils/api.utils';
|
|
12
13
|
export { getSwapMessages, getRainbowWalletActivationMessages } from './utils/message.utils';
|
|
13
14
|
export { getIsRainbowWalletActive, getIsActivationRequired } from './utils/rainbow-wallet.utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getIsActivationRequired = exports.getIsRainbowWalletActive = exports.getRainbowWalletActivationMessages = exports.getSwapMessages = exports.getBestRoute = exports.getAssetsRecord = exports.SwapRouteType = exports.RouteDirectionEnum = exports.DexTypeEnum = exports.mapSwapRouteToRoute = void 0;
|
|
3
|
+
exports.getIsActivationRequired = exports.getIsRainbowWalletActive = exports.getRainbowWalletActivationMessages = exports.getSwapMessages = exports.getAppStatus = exports.getBestRoute = exports.getAssetsRecord = exports.SwapRouteType = exports.RouteDirectionEnum = exports.DexTypeEnum = exports.mapSwapRouteToRoute = void 0;
|
|
4
4
|
var calculated_swap_route_utils_1 = require("./dexes/shared/calculated-swap-route.utils");
|
|
5
5
|
Object.defineProperty(exports, "mapSwapRouteToRoute", { enumerable: true, get: function () { return calculated_swap_route_utils_1.mapSwapRouteToRoute; } });
|
|
6
6
|
var dex_type_enum_1 = require("./enums/dex-type.enum");
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "SwapRouteType", { enumerable: true, get: functio
|
|
|
12
12
|
var api_utils_1 = require("./utils/api.utils");
|
|
13
13
|
Object.defineProperty(exports, "getAssetsRecord", { enumerable: true, get: function () { return api_utils_1.getAssetsRecord; } });
|
|
14
14
|
Object.defineProperty(exports, "getBestRoute", { enumerable: true, get: function () { return api_utils_1.getBestRoute; } });
|
|
15
|
+
Object.defineProperty(exports, "getAppStatus", { enumerable: true, get: function () { return api_utils_1.getAppStatus; } });
|
|
15
16
|
var message_utils_1 = require("./utils/message.utils");
|
|
16
17
|
Object.defineProperty(exports, "getSwapMessages", { enumerable: true, get: function () { return message_utils_1.getSwapMessages; } });
|
|
17
18
|
Object.defineProperty(exports, "getRainbowWalletActivationMessages", { enumerable: true, get: function () { return message_utils_1.getRainbowWalletActivationMessages; } });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AppStatus } from '../types/app-status.type';
|
|
1
2
|
import { AssetsRecord } from '../types/assets-record.type';
|
|
2
3
|
import { BestRouteResponse } from '../types/best-route-response.type';
|
|
3
4
|
export declare const getAssetsRecord: () => Promise<AssetsRecord>;
|
|
@@ -6,3 +7,4 @@ export declare const getBestRoute: (params: {
|
|
|
6
7
|
inputAssetAddress: string;
|
|
7
8
|
outputAssetAddress: string;
|
|
8
9
|
}) => Promise<BestRouteResponse>;
|
|
10
|
+
export declare const getAppStatus: () => Promise<AppStatus>;
|
package/dist/utils/api.utils.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBestRoute = exports.getAssetsRecord = void 0;
|
|
3
|
+
exports.getAppStatus = exports.getBestRoute = exports.getAssetsRecord = void 0;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
const getAssetsRecord = () => globals_1.API.get('/assets-record').then(response => response.data);
|
|
6
6
|
exports.getAssetsRecord = getAssetsRecord;
|
|
7
7
|
const getBestRoute = (params) => globals_1.API.get('/best-route', { params }).then(response => response.data);
|
|
8
8
|
exports.getBestRoute = getBestRoute;
|
|
9
|
+
const getAppStatus = () => globals_1.API.get('/app-status').then(response => response.data);
|
|
10
|
+
exports.getAppStatus = getAppStatus;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rainbow-swap-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "SDK for building applications on top of Rainbow Swap 🌈 - The Next Gen DEX Aggregator on TON 💎.",
|
|
5
5
|
"repository": "https://github.com/0xblackbot/rainbow-swap-sdk.git",
|
|
6
6
|
"license": "Apache-2.0",
|