@ref-finance/ref-sdk 1.2.2 → 1.3.0
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/README.md +6 -4
- package/dist/ref-sdk.cjs.development.js +88 -91
- package/dist/ref-sdk.cjs.development.js.map +1 -1
- package/dist/ref-sdk.cjs.production.min.js +1 -1
- package/dist/ref-sdk.cjs.production.min.js.map +1 -1
- package/dist/ref-sdk.esm.js +88 -91
- package/dist/ref-sdk.esm.js.map +1 -1
- package/dist/ref-sdk.umd.development.js +88 -91
- package/dist/ref-sdk.umd.development.js.map +1 -1
- package/dist/ref-sdk.umd.production.min.js +1 -1
- package/dist/ref-sdk.umd.production.min.js.map +1 -1
- package/package.json +6 -6
package/dist/ref-sdk.esm.js
CHANGED
|
@@ -68,7 +68,7 @@ function getConfig(env) {
|
|
|
68
68
|
REF_TOKEN_ID: 'token.v2.ref-finance.near',
|
|
69
69
|
indexerUrl: 'https://indexer.ref.finance',
|
|
70
70
|
explorerUrl: 'https://nearblocks.io',
|
|
71
|
-
REF_DCL_SWAP_CONTRACT_ID: '
|
|
71
|
+
REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near'
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -179,9 +179,6 @@ function _regeneratorRuntime() {
|
|
|
179
179
|
var exports = {},
|
|
180
180
|
Op = Object.prototype,
|
|
181
181
|
hasOwn = Op.hasOwnProperty,
|
|
182
|
-
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
183
|
-
obj[key] = desc.value;
|
|
184
|
-
},
|
|
185
182
|
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
186
183
|
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
187
184
|
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
@@ -205,9 +202,40 @@ function _regeneratorRuntime() {
|
|
|
205
202
|
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
206
203
|
generator = Object.create(protoGenerator.prototype),
|
|
207
204
|
context = new Context(tryLocsList || []);
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
206
|
+
var state = "suspendedStart";
|
|
207
|
+
return function (method, arg) {
|
|
208
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
209
|
+
if ("completed" === state) {
|
|
210
|
+
if ("throw" === method) throw arg;
|
|
211
|
+
return doneResult();
|
|
212
|
+
}
|
|
213
|
+
for (context.method = method, context.arg = arg;;) {
|
|
214
|
+
var delegate = context.delegate;
|
|
215
|
+
if (delegate) {
|
|
216
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
217
|
+
if (delegateResult) {
|
|
218
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
219
|
+
return delegateResult;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
223
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
224
|
+
context.dispatchException(context.arg);
|
|
225
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
226
|
+
state = "executing";
|
|
227
|
+
var record = tryCatch(innerFn, self, context);
|
|
228
|
+
if ("normal" === record.type) {
|
|
229
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
230
|
+
return {
|
|
231
|
+
value: record.arg,
|
|
232
|
+
done: context.done
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}(innerFn, self, context), generator;
|
|
211
239
|
}
|
|
212
240
|
function tryCatch(fn, obj, arg) {
|
|
213
241
|
try {
|
|
@@ -261,49 +289,13 @@ function _regeneratorRuntime() {
|
|
|
261
289
|
reject(record.arg);
|
|
262
290
|
}
|
|
263
291
|
var previousPromise;
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
function
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
276
|
-
var state = "suspendedStart";
|
|
277
|
-
return function (method, arg) {
|
|
278
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
279
|
-
if ("completed" === state) {
|
|
280
|
-
if ("throw" === method) throw arg;
|
|
281
|
-
return doneResult();
|
|
282
|
-
}
|
|
283
|
-
for (context.method = method, context.arg = arg;;) {
|
|
284
|
-
var delegate = context.delegate;
|
|
285
|
-
if (delegate) {
|
|
286
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
287
|
-
if (delegateResult) {
|
|
288
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
289
|
-
return delegateResult;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
293
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
294
|
-
context.dispatchException(context.arg);
|
|
295
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
296
|
-
state = "executing";
|
|
297
|
-
var record = tryCatch(innerFn, self, context);
|
|
298
|
-
if ("normal" === record.type) {
|
|
299
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
300
|
-
return {
|
|
301
|
-
value: record.arg,
|
|
302
|
-
done: context.done
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
292
|
+
this._invoke = function (method, arg) {
|
|
293
|
+
function callInvokeWithMethodAndArg() {
|
|
294
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
295
|
+
invoke(method, arg, resolve, reject);
|
|
296
|
+
});
|
|
306
297
|
}
|
|
298
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
307
299
|
};
|
|
308
300
|
}
|
|
309
301
|
function maybeInvokeDelegate(delegate, context) {
|
|
@@ -359,13 +351,7 @@ function _regeneratorRuntime() {
|
|
|
359
351
|
done: !0
|
|
360
352
|
};
|
|
361
353
|
}
|
|
362
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
363
|
-
value: GeneratorFunctionPrototype,
|
|
364
|
-
configurable: !0
|
|
365
|
-
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
366
|
-
value: GeneratorFunction,
|
|
367
|
-
configurable: !0
|
|
368
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
354
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
369
355
|
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
370
356
|
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
371
357
|
}, exports.mark = function (genFun) {
|
|
@@ -386,9 +372,8 @@ function _regeneratorRuntime() {
|
|
|
386
372
|
return this;
|
|
387
373
|
}), define(Gp, "toString", function () {
|
|
388
374
|
return "[object Generator]";
|
|
389
|
-
}), exports.keys = function (
|
|
390
|
-
var
|
|
391
|
-
keys = [];
|
|
375
|
+
}), exports.keys = function (object) {
|
|
376
|
+
var keys = [];
|
|
392
377
|
for (var key in object) keys.push(key);
|
|
393
378
|
return keys.reverse(), function next() {
|
|
394
379
|
for (; keys.length;) {
|
|
@@ -877,7 +862,7 @@ function checkIntegerSumOfAllocations(allocations, totalInput) {
|
|
|
877
862
|
return newAllocations;
|
|
878
863
|
}
|
|
879
864
|
|
|
880
|
-
var
|
|
865
|
+
var _marked5 = /*#__PURE__*/_regeneratorRuntime().mark(yenFromPy);
|
|
881
866
|
Big.RM = 0;
|
|
882
867
|
Big.DP = 40;
|
|
883
868
|
Big.NE = -40;
|
|
@@ -1299,8 +1284,8 @@ function getBestOptimalAllocationsAndOutputs(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
|
1299
1284
|
return _getBestOptimalAllocationsAndOutputs.apply(this, arguments);
|
|
1300
1285
|
}
|
|
1301
1286
|
function _getBestOptimalAllocationsAndOutputs() {
|
|
1302
|
-
_getBestOptimalAllocationsAndOutputs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1303
|
-
return _regeneratorRuntime().wrap(function
|
|
1287
|
+
_getBestOptimalAllocationsAndOutputs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(pools, inputToken, outputToken, totalInput, maxPathLength, threshold) {
|
|
1288
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context7) {
|
|
1304
1289
|
while (1) {
|
|
1305
1290
|
switch (_context7.prev = _context7.next) {
|
|
1306
1291
|
case 0:
|
|
@@ -1311,9 +1296,9 @@ function _getBestOptimalAllocationsAndOutputs() {
|
|
|
1311
1296
|
threshold = 0.001;
|
|
1312
1297
|
}
|
|
1313
1298
|
return _context7.abrupt("return", function () {
|
|
1314
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1299
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(totalInput) {
|
|
1315
1300
|
var paths, poolChains, routes, nodeRoutes, inputOutput, allocations, outputs;
|
|
1316
|
-
return _regeneratorRuntime().wrap(function
|
|
1301
|
+
return _regeneratorRuntime().wrap(function _callee$(_context6) {
|
|
1317
1302
|
while (1) {
|
|
1318
1303
|
switch (_context6.prev = _context6.next) {
|
|
1319
1304
|
case 0:
|
|
@@ -1362,7 +1347,7 @@ function _getBestOptimalAllocationsAndOutputs() {
|
|
|
1362
1347
|
return _context6.stop();
|
|
1363
1348
|
}
|
|
1364
1349
|
}
|
|
1365
|
-
},
|
|
1350
|
+
}, _callee);
|
|
1366
1351
|
}));
|
|
1367
1352
|
return function (_x33) {
|
|
1368
1353
|
return _ref.apply(this, arguments);
|
|
@@ -1373,7 +1358,7 @@ function _getBestOptimalAllocationsAndOutputs() {
|
|
|
1373
1358
|
return _context7.stop();
|
|
1374
1359
|
}
|
|
1375
1360
|
}
|
|
1376
|
-
},
|
|
1361
|
+
}, _callee2);
|
|
1377
1362
|
}));
|
|
1378
1363
|
return _getBestOptimalAllocationsAndOutputs.apply(this, arguments);
|
|
1379
1364
|
}
|
|
@@ -1483,8 +1468,8 @@ function getSmartRouteSwapActions(_x7, _x8, _x9, _x10, _x11, _x12, _x13, _x14, _
|
|
|
1483
1468
|
return _getSmartRouteSwapActions.apply(this, arguments);
|
|
1484
1469
|
}
|
|
1485
1470
|
function _getSmartRouteSwapActions() {
|
|
1486
|
-
_getSmartRouteSwapActions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1487
|
-
return _regeneratorRuntime().wrap(function
|
|
1471
|
+
_getSmartRouteSwapActions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(pools, inputToken, outputToken, totalInput, allTokens, maxPathLength, threshold, numberOfRoutesLimit, MAX_NUMBER_PARALLEL_POOLS, decimalsCulledPoolIds) {
|
|
1472
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context10) {
|
|
1488
1473
|
while (1) {
|
|
1489
1474
|
switch (_context10.prev = _context10.next) {
|
|
1490
1475
|
case 0:
|
|
@@ -1504,9 +1489,9 @@ function _getSmartRouteSwapActions() {
|
|
|
1504
1489
|
decimalsCulledPoolIds = [];
|
|
1505
1490
|
}
|
|
1506
1491
|
return _context10.abrupt("return", function () {
|
|
1507
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1492
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(totalInput) {
|
|
1508
1493
|
var resDict, allocations, routes, nodeRoutes, sortedIndexValues, topIndices, reducedRoutes, reducedNodeRoutes, _iterator3, _step3, ind, currentBestOutput, bestAllocations, bestNodeRoutes, bestRoutes, parallelNodeRoutes, parallelRoutes, n, currentNodeRoute, bestRoutesAreParallel, _filteredAllocationsAndOutputs, parallellAllocations, parallelOutputs, sortIndices, filteredParallelRoutes, filteredParallelNodeRoutes, i, parallelOutput, canHaveTwoRoutes, j, route1, route2, nodeRoute1, nodeRoute2, _route1PoolIds, route2PoolIds, sharePool, _iterator4, _step4, route1PoolId, currentRoutes, currentNodeRoutes, _filteredAllocationsAndOutputs2, _filteredAllocations, _filteredOutputs, totalOutput, _currentRoutes, _currentNodeRoutes, _filteredAllocationsAndOutputs3, _filteredAllocations2, _filteredOutputs2, _totalOutput, allSortedIndices, sortedIndices, filteredRoutes, filteredNodeRoutes, index, route1PoolIds, _route2PoolIds, sharedRoute, allFilteredRoutes, allFilteredNodeRoutes, firstRoute, firstRoutePoolIds, allFilteredRouteIds, secondRoute, filteredAllocationsAndOutputs, filteredAllocations, hops, actions, _supplies, hopInputTokenMeta, hopOutputTokenMeta, hopOutputTokenDecimals, expectedHopOutput, decimalEstimate, status, tokens, overallPriceImpact, action;
|
|
1509
|
-
return _regeneratorRuntime().wrap(function
|
|
1494
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context9) {
|
|
1510
1495
|
while (1) {
|
|
1511
1496
|
switch (_context9.prev = _context9.next) {
|
|
1512
1497
|
case 0:
|
|
@@ -1901,8 +1886,8 @@ function _getSmartRouteSwapActions() {
|
|
|
1901
1886
|
}
|
|
1902
1887
|
_context9.next = 143;
|
|
1903
1888
|
return Promise.all(hops[i].nodeRoute.map( /*#__PURE__*/function () {
|
|
1904
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1905
|
-
return _regeneratorRuntime().wrap(function
|
|
1889
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t) {
|
|
1890
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context8) {
|
|
1906
1891
|
while (1) {
|
|
1907
1892
|
switch (_context8.prev = _context8.next) {
|
|
1908
1893
|
case 0:
|
|
@@ -1925,7 +1910,7 @@ function _getSmartRouteSwapActions() {
|
|
|
1925
1910
|
return _context8.stop();
|
|
1926
1911
|
}
|
|
1927
1912
|
}
|
|
1928
|
-
},
|
|
1913
|
+
}, _callee3);
|
|
1929
1914
|
}));
|
|
1930
1915
|
return function (_x35) {
|
|
1931
1916
|
return _ref3.apply(this, arguments);
|
|
@@ -1986,7 +1971,7 @@ function _getSmartRouteSwapActions() {
|
|
|
1986
1971
|
return _context9.stop();
|
|
1987
1972
|
}
|
|
1988
1973
|
}
|
|
1989
|
-
},
|
|
1974
|
+
}, _callee4);
|
|
1990
1975
|
}));
|
|
1991
1976
|
return function (_x34) {
|
|
1992
1977
|
return _ref2.apply(this, arguments);
|
|
@@ -1997,7 +1982,7 @@ function _getSmartRouteSwapActions() {
|
|
|
1997
1982
|
return _context10.stop();
|
|
1998
1983
|
}
|
|
1999
1984
|
}
|
|
2000
|
-
},
|
|
1985
|
+
}, _callee5);
|
|
2001
1986
|
}));
|
|
2002
1987
|
return _getSmartRouteSwapActions.apply(this, arguments);
|
|
2003
1988
|
}
|
|
@@ -2005,9 +1990,9 @@ function calculateSmartRouteV2PriceImpact(_x17, _x18) {
|
|
|
2005
1990
|
return _calculateSmartRouteV2PriceImpact.apply(this, arguments);
|
|
2006
1991
|
}
|
|
2007
1992
|
function _calculateSmartRouteV2PriceImpact() {
|
|
2008
|
-
_calculateSmartRouteV2PriceImpact = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1993
|
+
_calculateSmartRouteV2PriceImpact = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(actions, allTokens) {
|
|
2009
1994
|
var deltaY, inputTokenMeta, deltaX, R, P, routes, nodeRoutes, allocations, totalAllocations, weights, i, route, nodeRoute, tokens, weight, num, denom, routeMarketPrice, num1, denom1, num2, denom2, priceImpact;
|
|
2010
|
-
return _regeneratorRuntime().wrap(function
|
|
1995
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context12) {
|
|
2011
1996
|
while (1) {
|
|
2012
1997
|
switch (_context12.prev = _context12.next) {
|
|
2013
1998
|
case 0:
|
|
@@ -2053,8 +2038,8 @@ function _calculateSmartRouteV2PriceImpact() {
|
|
|
2053
2038
|
nodeRoute = nodeRoutes[i];
|
|
2054
2039
|
_context12.next = 17;
|
|
2055
2040
|
return Promise.all(nodeRoute.map( /*#__PURE__*/function () {
|
|
2056
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2057
|
-
return _regeneratorRuntime().wrap(function
|
|
2041
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t) {
|
|
2042
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context11) {
|
|
2058
2043
|
while (1) {
|
|
2059
2044
|
switch (_context11.prev = _context11.next) {
|
|
2060
2045
|
case 0:
|
|
@@ -2077,7 +2062,7 @@ function _calculateSmartRouteV2PriceImpact() {
|
|
|
2077
2062
|
return _context11.stop();
|
|
2078
2063
|
}
|
|
2079
2064
|
}
|
|
2080
|
-
},
|
|
2065
|
+
}, _callee6);
|
|
2081
2066
|
}));
|
|
2082
2067
|
return function (_x36) {
|
|
2083
2068
|
return _ref4.apply(this, arguments);
|
|
@@ -2108,7 +2093,7 @@ function _calculateSmartRouteV2PriceImpact() {
|
|
|
2108
2093
|
return _context12.stop();
|
|
2109
2094
|
}
|
|
2110
2095
|
}
|
|
2111
|
-
},
|
|
2096
|
+
}, _callee7);
|
|
2112
2097
|
}));
|
|
2113
2098
|
return _calculateSmartRouteV2PriceImpact.apply(this, arguments);
|
|
2114
2099
|
}
|
|
@@ -2443,7 +2428,7 @@ function yenFromPy(g, source, target) {
|
|
|
2443
2428
|
return _context5.stop();
|
|
2444
2429
|
}
|
|
2445
2430
|
}
|
|
2446
|
-
},
|
|
2431
|
+
}, _marked5, null, [[6, 14]]);
|
|
2447
2432
|
}
|
|
2448
2433
|
function getKShortestPaths(g, source, target, k, maxPathLength) {
|
|
2449
2434
|
if (maxPathLength === void 0) {
|
|
@@ -2480,9 +2465,9 @@ function getPathsFromPools(_x19, _x20, _x21, _x22) {
|
|
|
2480
2465
|
return _getPathsFromPools.apply(this, arguments);
|
|
2481
2466
|
}
|
|
2482
2467
|
function _getPathsFromPools() {
|
|
2483
|
-
_getPathsFromPools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2468
|
+
_getPathsFromPools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(pools, inputToken, outputToken, maxPathLength) {
|
|
2484
2469
|
var graph;
|
|
2485
|
-
return _regeneratorRuntime().wrap(function
|
|
2470
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context13) {
|
|
2486
2471
|
while (1) {
|
|
2487
2472
|
switch (_context13.prev = _context13.next) {
|
|
2488
2473
|
case 0:
|
|
@@ -2496,7 +2481,7 @@ function _getPathsFromPools() {
|
|
|
2496
2481
|
return _context13.stop();
|
|
2497
2482
|
}
|
|
2498
2483
|
}
|
|
2499
|
-
},
|
|
2484
|
+
}, _callee8);
|
|
2500
2485
|
}));
|
|
2501
2486
|
return _getPathsFromPools.apply(this, arguments);
|
|
2502
2487
|
}
|
|
@@ -2531,9 +2516,9 @@ function stableSmart(_x28, _x29, _x30, _x31, _x32) {
|
|
|
2531
2516
|
return _stableSmart.apply(this, arguments);
|
|
2532
2517
|
}
|
|
2533
2518
|
function _stableSmart() {
|
|
2534
|
-
_stableSmart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2519
|
+
_stableSmart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(pools, inputToken, outputToken, totalInput, allTokens) {
|
|
2535
2520
|
var smartRouteActions;
|
|
2536
|
-
return _regeneratorRuntime().wrap(function
|
|
2521
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context15) {
|
|
2537
2522
|
while (1) {
|
|
2538
2523
|
switch (_context15.prev = _context15.next) {
|
|
2539
2524
|
case 0:
|
|
@@ -2547,7 +2532,7 @@ function _stableSmart() {
|
|
|
2547
2532
|
return _context15.stop();
|
|
2548
2533
|
}
|
|
2549
2534
|
}
|
|
2550
|
-
},
|
|
2535
|
+
}, _callee10);
|
|
2551
2536
|
}));
|
|
2552
2537
|
return _stableSmart.apply(this, arguments);
|
|
2553
2538
|
}
|
|
@@ -3893,7 +3878,11 @@ var refFiViewFunction = /*#__PURE__*/function () {
|
|
|
3893
3878
|
return near.account(REF_FI_CONTRACT_ID);
|
|
3894
3879
|
case 3:
|
|
3895
3880
|
nearConnection = _context.sent;
|
|
3896
|
-
return _context.abrupt("return", nearConnection.viewFunction(
|
|
3881
|
+
return _context.abrupt("return", nearConnection.viewFunction({
|
|
3882
|
+
contractId: REF_FI_CONTRACT_ID,
|
|
3883
|
+
methodName: methodName,
|
|
3884
|
+
args: args
|
|
3885
|
+
}));
|
|
3897
3886
|
case 5:
|
|
3898
3887
|
case "end":
|
|
3899
3888
|
return _context.stop();
|
|
@@ -3917,7 +3906,11 @@ var ftViewFunction = /*#__PURE__*/function () {
|
|
|
3917
3906
|
return near.account(REF_FI_CONTRACT_ID);
|
|
3918
3907
|
case 3:
|
|
3919
3908
|
nearConnection = _context2.sent;
|
|
3920
|
-
return _context2.abrupt("return", nearConnection.viewFunction(
|
|
3909
|
+
return _context2.abrupt("return", nearConnection.viewFunction({
|
|
3910
|
+
contractId: tokenId,
|
|
3911
|
+
methodName: methodName,
|
|
3912
|
+
args: args
|
|
3913
|
+
}));
|
|
3921
3914
|
case 5:
|
|
3922
3915
|
case "end":
|
|
3923
3916
|
return _context2.stop();
|
|
@@ -4209,7 +4202,11 @@ var refDCLSwapViewFunction = /*#__PURE__*/function () {
|
|
|
4209
4202
|
}
|
|
4210
4203
|
throw DCLInValid;
|
|
4211
4204
|
case 6:
|
|
4212
|
-
return _context10.abrupt("return", nearConnection.viewFunction(
|
|
4205
|
+
return _context10.abrupt("return", nearConnection.viewFunction({
|
|
4206
|
+
contractId: config.REF_DCL_SWAP_CONTRACT_ID,
|
|
4207
|
+
methodName: methodName,
|
|
4208
|
+
args: args
|
|
4209
|
+
}));
|
|
4213
4210
|
case 7:
|
|
4214
4211
|
case "end":
|
|
4215
4212
|
return _context10.stop();
|