@pioneer-platform/pioneer-router 8.13.5 → 8.13.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @pioneer-platform/pioneer-router
2
2
 
3
+ ## 8.13.7
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: chore: chore: chore: chore: fix: move @types/pdfkit to dependencies for Docker --production build
8
+ - Updated dependencies
9
+ - @pioneer-platform/mayachain-client@0.9.7
10
+ - @pioneer-platform/osmosis-client@0.9.7
11
+ - @pioneer-platform/pro-token@0.9.7
12
+ - @pioneer-platform/rango-client@8.12.7
13
+ - @pioneer-platform/swapkit-client@0.0.3
14
+ - @pioneer-platform/thorchain-client@0.8.19
15
+ - @pioneer-platform/pioneer-caip@9.10.10
16
+
17
+ ## 8.13.6
18
+
19
+ ### Patch Changes
20
+
21
+ - chore: chore: chore: chore: fix: move @types/pdfkit to dependencies for Docker --production build
22
+ - Updated dependencies
23
+ - @pioneer-platform/mayachain-client@0.9.6
24
+ - @pioneer-platform/osmosis-client@0.9.6
25
+ - @pioneer-platform/pro-token@0.9.6
26
+ - @pioneer-platform/rango-client@8.12.6
27
+ - @pioneer-platform/swapkit-client@0.0.2
28
+ - @pioneer-platform/thorchain-client@0.8.18
29
+ - @pioneer-platform/pioneer-caip@9.10.9
30
+
3
31
  ## 8.13.5
4
32
 
5
33
  ### Patch Changes
package/lib/index.d.ts CHANGED
@@ -7,6 +7,7 @@ declare let rango: any;
7
7
  declare let osmosis: any;
8
8
  declare let thorchain: any;
9
9
  declare let mayachain: any;
10
+ declare let swapkit: any;
10
11
  declare let MEMOLESS_SUPPORT: any;
11
12
  interface Swap {
12
13
  memoless?: boolean;
@@ -25,7 +26,7 @@ interface Swap {
25
26
  }
26
27
  declare let NetworksByIntegration: any;
27
28
  declare let AssetsByIntegration: any;
28
- declare function get_quote_from_integration(integration: string, quote: Swap): Promise<any[] | null>;
29
+ declare function get_quote_from_integration(integration: string, quote: Swap): Promise<any>;
29
30
  declare let get_pro_rate_usd: () => Promise<any>;
30
31
  declare function get_quote(quote: Swap): Promise<{
31
32
  integration: string;
package/lib/index.js CHANGED
@@ -84,6 +84,7 @@ var rango = require("@pioneer-platform/rango-client");
84
84
  var osmosis = require("@pioneer-platform/osmosis-client");
85
85
  var thorchain = require("@pioneer-platform/thorchain-client");
86
86
  var mayachain = require("@pioneer-platform/mayachain-client");
87
+ var swapkit = require("@pioneer-platform/swapkit-client");
87
88
  var MEMOLESS_SUPPORT = {
88
89
  // No memoless integrations currently supported
89
90
  };
@@ -107,21 +108,26 @@ module.exports = {
107
108
  return [4 /*yield*/, mayachain.init()];
108
109
  case 3:
109
110
  _e.sent();
110
- return [4 /*yield*/, thorchain.init({})
111
+ return [4 /*yield*/, thorchain.init({})];
112
+ case 4:
113
+ _e.sent();
114
+ return [4 /*yield*/, swapkit.init()
111
115
  // Register network support
112
116
  ];
113
- case 4:
117
+ case 5:
114
118
  _e.sent();
115
119
  // Register network support
116
120
  NetworksByIntegration['mayachain'] = mayachain.networkSupport();
117
121
  NetworksByIntegration['rango'] = rango.networkSupport();
118
122
  NetworksByIntegration['osmosis'] = osmosis.networkSupport();
119
123
  NetworksByIntegration['thorchain'] = thorchain.networkSupport();
124
+ NetworksByIntegration['swapkit'] = swapkit.networkSupport();
120
125
  // Register asset support
121
126
  AssetsByIntegration['mayachain'] = mayachain.assetSupport();
122
127
  AssetsByIntegration['rango'] = rango.assetSupport();
123
128
  AssetsByIntegration['osmosis'] = osmosis.assetSupport();
124
129
  AssetsByIntegration['thorchain'] = thorchain.assetSupport();
130
+ AssetsByIntegration['swapkit'] = swapkit.assetSupport();
125
131
  // DEBUG: Log Thorchain assets to console
126
132
  console.log("\nšŸ” THORCHAIN ASSETS DEBUG:");
127
133
  console.log("Total assets:", ((_a = AssetsByIntegration['thorchain']) === null || _a === void 0 ? void 0 : _a.length) || 0);
@@ -152,7 +158,7 @@ module.exports = {
152
158
  };
153
159
  function get_quote_from_integration(integration, quote) {
154
160
  return __awaiter(this, void 0, void 0, function () {
155
- var tag, sellAssetCaip, buyAssetCaip, _a, thorchainNameSellAsset, thorchainBuyAsset, payloadThorchain, quoteThorchain, rangoNameSellAsset, rangoNameBuyAsset, payloadRango, quoteRango, payloadOsmosis, quoteOsmosis, mayachainNameSellAsset, mayachainBuyAsset, payloadMayachain, quoteMayachain, e_1;
161
+ var tag, sellAssetCaip, buyAssetCaip, _a, thorchainNameSellAsset, thorchainBuyAsset, payloadThorchain, quoteThorchain, rangoNameSellAsset, rangoNameBuyAsset, payloadRango, quoteRango, payloadOsmosis, quoteOsmosis, mayachainNameSellAsset, mayachainBuyAsset, payloadMayachain, quoteMayachain, payloadSwapkit, quoteSwapkit, e_1;
156
162
  var _b;
157
163
  return __generator(this, function (_c) {
158
164
  switch (_c.label) {
@@ -160,7 +166,7 @@ function get_quote_from_integration(integration, quote) {
160
166
  tag = TAG + " | get_quote_from_integration | ";
161
167
  _c.label = 1;
162
168
  case 1:
163
- _c.trys.push([1, 12, , 13]);
169
+ _c.trys.push([1, 14, , 15]);
164
170
  sellAssetCaip = typeof quote.sellAsset === 'string' ? quote.sellAsset : quote.sellAsset.caip;
165
171
  buyAssetCaip = typeof quote.buyAsset === 'string' ? quote.buyAsset : quote.buyAsset.caip;
166
172
  _a = integration;
@@ -169,8 +175,9 @@ function get_quote_from_integration(integration, quote) {
169
175
  case "rango": return [3 /*break*/, 4];
170
176
  case "osmosis": return [3 /*break*/, 6];
171
177
  case "mayachain": return [3 /*break*/, 8];
178
+ case "swapkit": return [3 /*break*/, 10];
172
179
  }
173
- return [3 /*break*/, 10];
180
+ return [3 /*break*/, 12];
174
181
  case 2:
175
182
  log.info(tag, "thorchain quote: ", quote);
176
183
  if (!quote.senderAddress)
@@ -287,13 +294,28 @@ function get_quote_from_integration(integration, quote) {
287
294
  case 9:
288
295
  quoteMayachain = _c.sent();
289
296
  return [2 /*return*/, [quoteMayachain]];
290
- case 10: throw new Error("Intergration not found");
291
- case 11: return [3 /*break*/, 13];
292
- case 12:
297
+ case 10:
298
+ log.info(tag, "swapkit quote: ", quote);
299
+ payloadSwapkit = {
300
+ sellAsset: sellAssetCaip,
301
+ buyAsset: buyAssetCaip,
302
+ sellAmount: quote.sellAmount,
303
+ senderAddress: quote.senderAddress,
304
+ recipientAddress: quote.recipientAddress,
305
+ slippage: quote.slippage || 3
306
+ };
307
+ log.info(tag, "payloadSwapkit: ", payloadSwapkit);
308
+ return [4 /*yield*/, swapkit.getQuote(payloadSwapkit)];
309
+ case 11:
310
+ quoteSwapkit = _c.sent();
311
+ return [2 /*return*/, quoteSwapkit ? quoteSwapkit : []];
312
+ case 12: throw new Error("Intergration not found");
313
+ case 13: return [3 /*break*/, 15];
314
+ case 14:
293
315
  e_1 = _c.sent();
294
316
  log.error(tag, "Error: ", e_1);
295
317
  return [2 /*return*/, null];
296
- case 13: return [2 /*return*/];
318
+ case 15: return [2 /*return*/];
297
319
  }
298
320
  });
299
321
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-router",
3
- "version": "8.13.5",
3
+ "version": "8.13.7",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {
@@ -21,12 +21,13 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@pioneer-platform/loggerdog": "^8.11.0",
24
- "@pioneer-platform/mayachain-client": "^0.9.5",
25
- "@pioneer-platform/osmosis-client": "^0.9.5",
26
- "@pioneer-platform/pioneer-caip": "^9.10.8",
27
- "@pioneer-platform/pro-token": "^0.9.5",
28
- "@pioneer-platform/rango-client": "^8.12.5",
29
- "@pioneer-platform/thorchain-client": "^0.8.17",
24
+ "@pioneer-platform/mayachain-client": "^0.9.7",
25
+ "@pioneer-platform/osmosis-client": "^0.9.7",
26
+ "@pioneer-platform/pioneer-caip": "^9.10.10",
27
+ "@pioneer-platform/pro-token": "^0.9.7",
28
+ "@pioneer-platform/rango-client": "^8.12.7",
29
+ "@pioneer-platform/swapkit-client": "^0.0.3",
30
+ "@pioneer-platform/thorchain-client": "^0.8.19",
30
31
  "dotenv": "^17.2.3",
31
32
  "short-uuid": "^4.2.2"
32
33
  },