@pioneer-platform/rango-client 8.3.3 → 8.3.5
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/lib/index.js +10 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -69,7 +69,7 @@ module.exports = {
|
|
|
69
69
|
networkSupport: function () {
|
|
70
70
|
return networkSupport;
|
|
71
71
|
},
|
|
72
|
-
|
|
72
|
+
getQuote: function (quote) {
|
|
73
73
|
return get_quote(quote);
|
|
74
74
|
},
|
|
75
75
|
createTransaction: function (id, step, validateBalance, validateFee) {
|
|
@@ -106,23 +106,27 @@ var create_transaction = function (id, step, validateBalance, validateFee) {
|
|
|
106
106
|
};
|
|
107
107
|
var get_quote = function (quote) {
|
|
108
108
|
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
-
var tag, output, e_2;
|
|
109
|
+
var tag, output, unsignedTx, e_2;
|
|
110
110
|
return __generator(this, function (_a) {
|
|
111
111
|
switch (_a.label) {
|
|
112
112
|
case 0:
|
|
113
113
|
tag = TAG + " | get_quote | ";
|
|
114
114
|
_a.label = 1;
|
|
115
115
|
case 1:
|
|
116
|
-
_a.trys.push([1,
|
|
116
|
+
_a.trys.push([1, 4, , 5]);
|
|
117
117
|
return [4 /*yield*/, rango.getBestRoute(quote)];
|
|
118
118
|
case 2:
|
|
119
119
|
output = _a.sent();
|
|
120
|
-
return [
|
|
120
|
+
return [4 /*yield*/, create_transaction(output.quote.requestId, 1, false, false)];
|
|
121
121
|
case 3:
|
|
122
|
+
unsignedTx = _a.sent();
|
|
123
|
+
output.unsignedTx = unsignedTx;
|
|
124
|
+
return [2 /*return*/, output];
|
|
125
|
+
case 4:
|
|
122
126
|
e_2 = _a.sent();
|
|
123
127
|
console.error(tag, "e: ", e_2);
|
|
124
|
-
return [3 /*break*/,
|
|
125
|
-
case
|
|
128
|
+
return [3 /*break*/, 5];
|
|
129
|
+
case 5: return [2 /*return*/];
|
|
126
130
|
}
|
|
127
131
|
});
|
|
128
132
|
});
|