@pioneer-platform/rango-client 8.3.13 → 8.3.15

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.
Files changed (2) hide show
  1. package/lib/index.js +29 -5
  2. package/package.json +2 -1
package/lib/index.js CHANGED
@@ -119,7 +119,7 @@ var create_transaction = function (id, step, validateBalance, validateFee) {
119
119
  };
120
120
  var get_quote = function (quote) {
121
121
  return __awaiter(this, void 0, void 0, function () {
122
- var tag, output, unsignedTx, e_2;
122
+ var tag, output, quoteRango, unsignedTx, e_2;
123
123
  return __generator(this, function (_a) {
124
124
  switch (_a.label) {
125
125
  case 0:
@@ -127,15 +127,39 @@ var get_quote = function (quote) {
127
127
  _a.label = 1;
128
128
  case 1:
129
129
  _a.trys.push([1, 4, , 5]);
130
+ output = {};
130
131
  return [4 /*yield*/, rango.getBestRoute(quote)];
131
132
  case 2:
132
- output = _a.sent();
133
- log.info(tag, "output: ", output);
134
- return [4 /*yield*/, create_transaction(output.requestId, 1, false, false)];
133
+ quoteRango = _a.sent();
134
+ log.info(tag, "quoteRango: ", quoteRango);
135
+ return [4 /*yield*/, create_transaction(quoteRango.requestId, 1, false, false)];
135
136
  case 3:
136
137
  unsignedTx = _a.sent();
137
138
  log.info(tag, "unsignedTx: ", unsignedTx);
138
- output.unsignedTx = unsignedTx;
139
+ output.meta = {
140
+ quoteMode: "RANGO"
141
+ };
142
+ output.id = quoteRango.requestId;
143
+ output.complete = true;
144
+ output.amountOut = quoteRango.result.outputAmount;
145
+ output.inboundAddress = unsignedTx.transaction.to;
146
+ output.tx = {
147
+ type: "evm",
148
+ chain: caipToNetworkId(shortListSymbolToCaip[quote.from.blockchain]),
149
+ txParams: {
150
+ to: unsignedTx.transaction.to,
151
+ from: unsignedTx.transaction.from,
152
+ data: unsignedTx.transaction.data,
153
+ value: unsignedTx.transaction.value,
154
+ gasLimit: unsignedTx.transaction.gasLimit,
155
+ gasPrice: unsignedTx.transaction.gasPrice,
156
+ maxPriorityFeePerGas: unsignedTx.transaction.maxPriorityFeePerGas,
157
+ maxFeePerGas: unsignedTx.transaction.maxFeePerGas,
158
+ nonce: unsignedTx.transaction.nonce
159
+ }
160
+ };
161
+ output.rawUnsigned = unsignedTx;
162
+ output.raw = quoteRango;
139
163
  return [2 /*return*/, output];
140
164
  case 4:
141
165
  e_2 = _a.sent();
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@pioneer-platform/rango-client",
3
- "version": "8.3.13",
3
+ "version": "8.3.15",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {
7
7
  "@pioneer-platform/loggerdog": "^8.3.1",
8
+ "@pioneer-platform/pioneer-caip": "9.2.20",
8
9
  "@pioneer-platform/pioneer-coins": "^9.2.8",
9
10
  "axios": "^1.3.4",
10
11
  "dotenv": "^8.2.0",