@pioneer-platform/pioneer-router 8.12.4 → 8.12.6
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/.turbo/turbo-build.log +2 -1
- package/CHANGELOG.md +18 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +57 -98
- package/package.json +7 -8
package/.turbo/turbo-build.log
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
[0m[2m[35m$[0m [2m[1mtsc -p .[0m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @pioneer-platform/pioneer-router
|
|
2
2
|
|
|
3
|
+
## 8.12.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- cache work
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @pioneer-platform/chainflip-client@0.8.5
|
|
10
|
+
- @pioneer-platform/mayachain-client@0.8.5
|
|
11
|
+
- @pioneer-platform/pro-token@0.8.1
|
|
12
|
+
- @pioneer-platform/rango-client@8.11.5
|
|
13
|
+
- @pioneer-platform/uniswap-client@8.11.23
|
|
14
|
+
|
|
15
|
+
## 8.12.5
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- @pioneer-platform/uniswap-client@8.11.4
|
|
20
|
+
|
|
3
21
|
## 8.12.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ declare const redis: any;
|
|
|
4
4
|
declare let proToken: any;
|
|
5
5
|
declare const caipToRango: any, caipToNetworkId: any, caipToThorchain: any;
|
|
6
6
|
declare let rango: any;
|
|
7
|
-
declare let changelly: any;
|
|
8
7
|
declare let osmosis: any;
|
|
9
8
|
declare let thorchain: any;
|
|
10
9
|
declare let mayachain: any;
|
package/lib/index.js
CHANGED
|
@@ -81,8 +81,8 @@ var proToken = require("@pioneer-platform/pro-token");
|
|
|
81
81
|
var _a = require("@pioneer-platform/pioneer-caip"), caipToRango = _a.caipToRango, caipToNetworkId = _a.caipToNetworkId, caipToThorchain = _a.caipToThorchain;
|
|
82
82
|
//rango
|
|
83
83
|
var rango = require("@pioneer-platform/rango-client");
|
|
84
|
-
//
|
|
85
|
-
|
|
84
|
+
// DISABLED - Symbol-based lookup causes collision issues
|
|
85
|
+
// let changelly = require("@pioneer-platform/changelly-client")
|
|
86
86
|
//osmosis
|
|
87
87
|
var osmosis = require("@pioneer-platform/osmosis-client");
|
|
88
88
|
//
|
|
@@ -99,8 +99,8 @@ var mayachain = require("@pioneer-platform/mayachain-client");
|
|
|
99
99
|
// //bridge
|
|
100
100
|
// let across = require("@pioneer-platform/across-client")
|
|
101
101
|
var MEMOLESS_SUPPORT = {
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
// "changelly": true, // DISABLED - Symbol collision issues
|
|
103
|
+
// "chainflip": true, // DISABLED - web3 compatibility
|
|
104
104
|
};
|
|
105
105
|
var NetworksByIntegration = {};
|
|
106
106
|
var AssetsByIntegration = {};
|
|
@@ -110,27 +110,28 @@ module.exports = {
|
|
|
110
110
|
var _a, _b, _c, _d;
|
|
111
111
|
return __generator(this, function (_e) {
|
|
112
112
|
switch (_e.label) {
|
|
113
|
-
case 0: return [4 /*yield*/, rango.init()
|
|
113
|
+
case 0: return [4 /*yield*/, rango.init()
|
|
114
|
+
// DISABLED: await changelly.init()
|
|
115
|
+
];
|
|
114
116
|
case 1:
|
|
115
117
|
_e.sent();
|
|
116
|
-
|
|
117
|
-
case 2:
|
|
118
|
-
_e.sent();
|
|
118
|
+
// DISABLED: await changelly.init()
|
|
119
119
|
return [4 /*yield*/, osmosis.init()];
|
|
120
|
-
case
|
|
120
|
+
case 2:
|
|
121
|
+
// DISABLED: await changelly.init()
|
|
121
122
|
_e.sent();
|
|
122
123
|
return [4 /*yield*/, mayachain.init()
|
|
123
124
|
// TEMP DISABLED: await uniswap.init()
|
|
124
125
|
];
|
|
125
|
-
case
|
|
126
|
+
case 3:
|
|
126
127
|
_e.sent();
|
|
127
128
|
// TEMP DISABLED: await uniswap.init()
|
|
128
129
|
return [4 /*yield*/, thorchain.init({})];
|
|
129
|
-
case
|
|
130
|
+
case 4:
|
|
130
131
|
// TEMP DISABLED: await uniswap.init()
|
|
131
132
|
_e.sent();
|
|
132
133
|
NetworksByIntegration['mayachain'] = mayachain.networkSupport();
|
|
133
|
-
NetworksByIntegration['changelly'] = changelly.networkSupport()
|
|
134
|
+
// DISABLED: NetworksByIntegration['changelly'] = changelly.networkSupport()
|
|
134
135
|
NetworksByIntegration['rango'] = rango.networkSupport();
|
|
135
136
|
NetworksByIntegration['osmosis'] = osmosis.networkSupport();
|
|
136
137
|
// TEMP DISABLED: NetworksByIntegration['uniswap'] = uniswap.networkSupport()
|
|
@@ -139,7 +140,7 @@ module.exports = {
|
|
|
139
140
|
NetworksByIntegration['thorchain'] = thorchain.networkSupport();
|
|
140
141
|
//get assets
|
|
141
142
|
AssetsByIntegration['mayachain'] = mayachain.assetSupport();
|
|
142
|
-
AssetsByIntegration['changelly'] = changelly.assetSupport()
|
|
143
|
+
// DISABLED: AssetsByIntegration['changelly'] = changelly.assetSupport()
|
|
143
144
|
AssetsByIntegration['rango'] = rango.assetSupport();
|
|
144
145
|
AssetsByIntegration['osmosis'] = osmosis.assetSupport();
|
|
145
146
|
// TEMP DISABLED: AssetsByIntegration['uniswap'] = uniswap.assetSupport()
|
|
@@ -176,7 +177,7 @@ module.exports = {
|
|
|
176
177
|
};
|
|
177
178
|
function get_quote_from_integration(integration, quote) {
|
|
178
179
|
return __awaiter(this, void 0, void 0, function () {
|
|
179
|
-
var tag, sellAssetCaip, buyAssetCaip,
|
|
180
|
+
var tag, sellAssetCaip, buyAssetCaip, _a, thorchainNameSellAsset, thorchainBuyAsset, payloadThorchain, quoteThorchain, rangoNameSellAsset, rangoNameBuyAsset, payloadRango, quoteRango, payloadOsmosis, quoteOsmosis, mayachainNameSellAsset, mayachainBuyAsset, payloadMayachain, quoteMayachain, e_1;
|
|
180
181
|
var _b;
|
|
181
182
|
return __generator(this, function (_c) {
|
|
182
183
|
switch (_c.label) {
|
|
@@ -184,28 +185,17 @@ function get_quote_from_integration(integration, quote) {
|
|
|
184
185
|
tag = TAG + " | get_quote_from_integration | ";
|
|
185
186
|
_c.label = 1;
|
|
186
187
|
case 1:
|
|
187
|
-
_c.trys.push([1,
|
|
188
|
+
_c.trys.push([1, 12, , 13]);
|
|
188
189
|
sellAssetCaip = typeof quote.sellAsset === 'string' ? quote.sellAsset : quote.sellAsset.caip;
|
|
189
190
|
buyAssetCaip = typeof quote.buyAsset === 'string' ? quote.buyAsset : quote.buyAsset.caip;
|
|
190
|
-
extractSymbolFromCaip = function (caip) {
|
|
191
|
-
// This is a simple extraction - you may want to use a proper CAIP parser
|
|
192
|
-
var parts = caip.split('/');
|
|
193
|
-
if (parts.length > 1) {
|
|
194
|
-
// For now, return the chain identifier
|
|
195
|
-
// You might need a proper CAIP-to-symbol mapping
|
|
196
|
-
return parts[0].split(':')[0].toUpperCase();
|
|
197
|
-
}
|
|
198
|
-
return '';
|
|
199
|
-
};
|
|
200
191
|
_a = integration;
|
|
201
192
|
switch (_a) {
|
|
202
193
|
case "thorchain": return [3 /*break*/, 2];
|
|
203
194
|
case "rango": return [3 /*break*/, 4];
|
|
204
195
|
case "osmosis": return [3 /*break*/, 6];
|
|
205
|
-
case "
|
|
206
|
-
case "mayachain": return [3 /*break*/, 10];
|
|
196
|
+
case "mayachain": return [3 /*break*/, 8];
|
|
207
197
|
}
|
|
208
|
-
return [3 /*break*/,
|
|
198
|
+
return [3 /*break*/, 10];
|
|
209
199
|
case 2:
|
|
210
200
|
log.info(tag, "thorchain quote: ", quote);
|
|
211
201
|
if (!quote.senderAddress)
|
|
@@ -278,88 +268,57 @@ function get_quote_from_integration(integration, quote) {
|
|
|
278
268
|
return [4 /*yield*/, osmosis.getQuote(payloadOsmosis)];
|
|
279
269
|
case 7:
|
|
280
270
|
quoteOsmosis = _c.sent();
|
|
281
|
-
return [2 /*return*/, [quoteOsmosis]
|
|
271
|
+
return [2 /*return*/, [quoteOsmosis]
|
|
272
|
+
// DISABLED - Symbol-based lookup causes collision issues
|
|
273
|
+
// case "changelly":
|
|
274
|
+
// // Changelly needs ticker symbols - extract from CAIP
|
|
275
|
+
// let from = extractSymbolFromCaip(sellAssetCaip)
|
|
276
|
+
// let to = extractSymbolFromCaip(buyAssetCaip)
|
|
277
|
+
// let address = quote.recipientAddress
|
|
278
|
+
// let amount = quote.sellAmount
|
|
279
|
+
// log.info({
|
|
280
|
+
// from,
|
|
281
|
+
// to,
|
|
282
|
+
// address,
|
|
283
|
+
// amount
|
|
284
|
+
// })
|
|
285
|
+
// let quoteChangelly = await changelly.getQuote(from, to, address, amount)
|
|
286
|
+
// return [quoteChangelly]
|
|
287
|
+
];
|
|
282
288
|
case 8:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return [2 /*return*/, [quoteChangelly]];
|
|
297
|
-
case 10:
|
|
298
|
-
mayaSellAsset = caipToThorchain(sellAssetCaip, null, null);
|
|
299
|
-
mayaBuyAsset = caipToThorchain(buyAssetCaip, null, null);
|
|
300
|
-
if (!mayaSellAsset)
|
|
301
|
-
throw Error('invalid mayaSellAsset');
|
|
302
|
-
if (!mayaBuyAsset)
|
|
303
|
-
throw Error('invalid mayaBuyAsset');
|
|
289
|
+
log.info(tag, "mayachain quote: ", quote);
|
|
290
|
+
if (!quote.senderAddress)
|
|
291
|
+
throw Error('invalid quote! missing senderAddress');
|
|
292
|
+
if (!quote.recipientAddress)
|
|
293
|
+
throw Error('invalid quote! missing recipientAddress');
|
|
294
|
+
mayachainNameSellAsset = mayachain.caipToAssetName(sellAssetCaip);
|
|
295
|
+
mayachainBuyAsset = mayachain.caipToAssetName(buyAssetCaip);
|
|
296
|
+
log.info(tag, "mayachainBuyAsset: ", mayachainBuyAsset);
|
|
297
|
+
log.info(tag, "mayachainNameSellAsset: ", mayachainNameSellAsset);
|
|
298
|
+
if (!mayachainNameSellAsset)
|
|
299
|
+
throw Error('invalid mayachainNameSellAsset');
|
|
300
|
+
if (!mayachainBuyAsset)
|
|
301
|
+
throw Error('invalid mayachainBuyAsset');
|
|
304
302
|
payloadMayachain = {
|
|
305
|
-
sellAsset:
|
|
306
|
-
buyAsset: mayaBuyAsset,
|
|
303
|
+
sellAsset: mayachainNameSellAsset,
|
|
307
304
|
sellAmount: quote.sellAmount,
|
|
305
|
+
buyAsset: mayachainBuyAsset,
|
|
308
306
|
senderAddress: quote.senderAddress,
|
|
309
307
|
recipientAddress: quote.recipientAddress,
|
|
310
|
-
slippage:
|
|
308
|
+
slippage: 3,
|
|
311
309
|
};
|
|
312
310
|
log.info(tag, "payloadMayachain: ", payloadMayachain);
|
|
313
311
|
return [4 /*yield*/, mayachain.getQuote(payloadMayachain)];
|
|
314
|
-
case
|
|
312
|
+
case 9:
|
|
315
313
|
quoteMayachain = _c.sent();
|
|
316
|
-
return [2 /*return*/, [quoteMayachain]
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
// sellAsset: quote.sellAsset,
|
|
321
|
-
// buyAsset: quote.buyAsset,
|
|
322
|
-
// sellAmount: quote.sellAmount,
|
|
323
|
-
// senderAddress: quote.senderAddress,
|
|
324
|
-
// recipientAddress: quote.recipientAddress,
|
|
325
|
-
// slippage: quote.slippage
|
|
326
|
-
// }
|
|
327
|
-
// log.info(tag,"payloadUniswap: ",payloadUniswap)
|
|
328
|
-
// let quoteUniswap = await uniswap.getQuote(payloadUniswap)
|
|
329
|
-
// log.info(tag,"quoteUniswap: ",quoteUniswap)
|
|
330
|
-
// return [quoteUniswap]
|
|
331
|
-
// TEMP DISABLED - web3 compatibility issue
|
|
332
|
-
// case "chainflip":
|
|
333
|
-
// let payloadChainflip = {
|
|
334
|
-
// sellAsset: quote.sellAsset.caip,
|
|
335
|
-
// buyAsset: quote.buyAsset.caip,
|
|
336
|
-
// sellAmount: quote.sellAmount,
|
|
337
|
-
// recipientAddress: quote.recipientAddress,
|
|
338
|
-
// slippage: quote.slippage
|
|
339
|
-
// }
|
|
340
|
-
// log.info(tag,"payloadChainflip: ",payloadChainflip)
|
|
341
|
-
// let quoteChainflip = await chainflip.getQuote(payloadChainflip)
|
|
342
|
-
// return [quoteChainflip]
|
|
343
|
-
// case "across":
|
|
344
|
-
// let payloadAcross = {
|
|
345
|
-
// sellAsset: quote.sellAsset.caip,
|
|
346
|
-
// buyAsset: quote.buyAsset.caip,
|
|
347
|
-
// sellAmount: quote.sellAmount,
|
|
348
|
-
// senderAddress: quote.senderAddress,
|
|
349
|
-
// recipientAddress: quote.recipientAddress,
|
|
350
|
-
// slippage: quote.slippage
|
|
351
|
-
// }
|
|
352
|
-
// log.info(tag,"payloadAcross: ",payloadAcross)
|
|
353
|
-
// let quotedAcross = await accross.getQuote(payloadAcross)
|
|
354
|
-
// return [quotedAcross]
|
|
355
|
-
];
|
|
356
|
-
case 12: throw new Error("Intergration not found");
|
|
357
|
-
case 13: return [3 /*break*/, 15];
|
|
358
|
-
case 14:
|
|
314
|
+
return [2 /*return*/, [quoteMayachain]];
|
|
315
|
+
case 10: throw new Error("Intergration not found");
|
|
316
|
+
case 11: return [3 /*break*/, 13];
|
|
317
|
+
case 12:
|
|
359
318
|
e_1 = _c.sent();
|
|
360
319
|
log.error(tag, "Error: ", e_1);
|
|
361
320
|
return [2 /*return*/, null];
|
|
362
|
-
case
|
|
321
|
+
case 13: return [2 /*return*/];
|
|
363
322
|
}
|
|
364
323
|
});
|
|
365
324
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/pioneer-router",
|
|
3
|
-
"version": "8.12.
|
|
3
|
+
"version": "8.12.6",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -20,17 +20,16 @@
|
|
|
20
20
|
"clean": "rm -rf coverage src/**/*.js src/**/*.map lib node_modules"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@
|
|
24
|
-
"@pioneer-platform/chainflip-client": "^0.8.4",
|
|
23
|
+
"@pioneer-platform/chainflip-client": "^0.8.5",
|
|
25
24
|
"@pioneer-platform/changelly-client": "^8.11.4",
|
|
26
25
|
"@pioneer-platform/loggerdog": "^8.11.0",
|
|
27
|
-
"@pioneer-platform/mayachain-client": "^0.8.
|
|
26
|
+
"@pioneer-platform/mayachain-client": "^0.8.5",
|
|
28
27
|
"@pioneer-platform/osmosis-client": "^0.8.4",
|
|
29
28
|
"@pioneer-platform/pioneer-caip": "^9.10.0",
|
|
30
|
-
"@pioneer-platform/pro-token": "^0.8.
|
|
31
|
-
"@pioneer-platform/rango-client": "^8.11.
|
|
29
|
+
"@pioneer-platform/pro-token": "^0.8.1",
|
|
30
|
+
"@pioneer-platform/rango-client": "^8.11.5",
|
|
32
31
|
"@pioneer-platform/thorchain-client": "^0.8.4",
|
|
33
|
-
"@pioneer-platform/uniswap-client": "^
|
|
32
|
+
"@pioneer-platform/uniswap-client": "^8.11.23",
|
|
34
33
|
"@uniswap/sdk-core": "^4.2.0",
|
|
35
34
|
"@uniswap/universal-router-sdk": "^1.9.0",
|
|
36
35
|
"dotenv": "^17.2.3",
|
|
@@ -48,4 +47,4 @@
|
|
|
48
47
|
"typescript": "^5.0.4"
|
|
49
48
|
},
|
|
50
49
|
"gitHead": "a76012f6693a12181c4744e53e977a9eaeef0ed3"
|
|
51
|
-
}
|
|
50
|
+
}
|