rainbow-swap-sdk 1.1.9 → 1.1.10

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.
@@ -0,0 +1,2 @@
1
+ import { DeDustCalculatedSwapRoute } from './calculated-swap-route.interface';
2
+ export declare const dedust_mapSwapRouteToRoute: (swapRoute: DeDustCalculatedSwapRoute) => import("../..").RouteStepWithCalculation[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dedust_mapSwapRouteToRoute = void 0;
4
+ const dedust_mapSwapRouteToRoute = (swapRoute) => swapRoute.route;
5
+ exports.dedust_mapSwapRouteToRoute = dedust_mapSwapRouteToRoute;
@@ -0,0 +1,2 @@
1
+ import { RainbowCalculatedSwapRoute } from './calculated-swap-route.interface';
2
+ export declare const rainbow_mapSwapRouteToRoute: (swapRoute: RainbowCalculatedSwapRoute) => import("../..").RouteStepWithCalculation[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rainbow_mapSwapRouteToRoute = void 0;
4
+ const rainbow_mapSwapRouteToRoute = (swapRoute) => [...swapRoute.firstChunk, ...swapRoute.secondChunk];
5
+ exports.rainbow_mapSwapRouteToRoute = rainbow_mapSwapRouteToRoute;
@@ -0,0 +1,3 @@
1
+ import { RouteStepWithCalculation } from '../../interfaces/route-step-with-calculation.interface';
2
+ import { CalculatedSwapRoute } from '../../types/calculated-swap-route.type';
3
+ export declare const mapSwapRouteToRoute: (swapRoute: CalculatedSwapRoute) => RouteStepWithCalculation[];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapSwapRouteToRoute = void 0;
4
+ const swap_route_type_enum_1 = require("../../enums/swap-route-type.enum");
5
+ const calculated_swap_route_utils_1 = require("../dedust/calculated-swap-route.utils");
6
+ const calculated_swap_route_utils_2 = require("../rainbow/calculated-swap-route.utils");
7
+ const calculated_swap_route_utils_3 = require("../ston/calculated-swap-route.utils");
8
+ const mapSwapRouteToRoute = (swapRoute) => {
9
+ if (swapRoute.type === swap_route_type_enum_1.SwapRouteType.DeDust) {
10
+ return (0, calculated_swap_route_utils_1.dedust_mapSwapRouteToRoute)(swapRoute);
11
+ }
12
+ if (swapRoute.type === swap_route_type_enum_1.SwapRouteType.Ston) {
13
+ return (0, calculated_swap_route_utils_3.ston_mapSwapRouteToRoute)(swapRoute);
14
+ }
15
+ return (0, calculated_swap_route_utils_2.rainbow_mapSwapRouteToRoute)(swapRoute);
16
+ };
17
+ exports.mapSwapRouteToRoute = mapSwapRouteToRoute;
@@ -0,0 +1,2 @@
1
+ import { StonCalculatedSwapRoute } from './calculated-swap-route.interface';
2
+ export declare const ston_mapSwapRouteToRoute: (swapRoute: StonCalculatedSwapRoute) => import("../..").RouteStepWithCalculation[];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ston_mapSwapRouteToRoute = void 0;
4
+ const ston_mapSwapRouteToRoute = (swapRoute) => [swapRoute.routeStep];
5
+ exports.ston_mapSwapRouteToRoute = ston_mapSwapRouteToRoute;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { mapSwapRouteToRoute } from './dexes/shared/calculated-swap-route.utils';
1
2
  export { DexTypeEnum } from './enums/dex-type.enum';
2
3
  export { RouteDirectionEnum } from './enums/route-direction.enum';
3
4
  export { SwapRouteType } from './enums/swap-route-type.enum';
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
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 = void 0;
3
+ exports.getIsActivationRequired = exports.getIsRainbowWalletActive = exports.getRainbowWalletActivationMessages = exports.getSwapMessages = exports.getBestRoute = exports.getAssetsRecord = exports.SwapRouteType = exports.RouteDirectionEnum = exports.DexTypeEnum = exports.mapSwapRouteToRoute = void 0;
4
+ var calculated_swap_route_utils_1 = require("./dexes/shared/calculated-swap-route.utils");
5
+ Object.defineProperty(exports, "mapSwapRouteToRoute", { enumerable: true, get: function () { return calculated_swap_route_utils_1.mapSwapRouteToRoute; } });
4
6
  var dex_type_enum_1 = require("./enums/dex-type.enum");
5
7
  Object.defineProperty(exports, "DexTypeEnum", { enumerable: true, get: function () { return dex_type_enum_1.DexTypeEnum; } });
6
8
  var route_direction_enum_1 = require("./enums/route-direction.enum");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rainbow-swap-sdk",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "An SDK for building applications on top of Rainbow Swap",
5
5
  "repository": "https://github.com/0xblackbot/rainbow-swap-sdk.git",
6
6
  "license": "Apache-2.0",