@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 CHANGED
@@ -21,9 +21,11 @@ Ref SDK identifies env variable NEAR_ENV or REACT_APP_REF_SDK_ENV to get global
21
21
 
22
22
  ```plain
23
23
  export function getConfig(
24
- env: string | undefined = process.env.NEAR_ENV ||
24
+ env: string | undefined = ENV ||
25
+ process.env.NEAR_ENV ||
25
26
  process.env.REACT_APP_REF_SDK_ENV
26
27
  ) {
28
+ ENV = env;
27
29
  switch (env) {
28
30
  case 'mainnet':
29
31
  return {
@@ -35,7 +37,7 @@ export function getConfig(
35
37
  REF_TOKEN_ID: 'token.v2.ref-finance.near',
36
38
  indexerUrl: 'https://indexer.ref.finance',
37
39
  explorerUrl: 'https://testnet.nearblocks.io',
38
- REF_DCL_SWAP_CONTRACT_ID: '',
40
+ REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near',
39
41
  };
40
42
  case 'testnet':
41
43
  return {
@@ -47,7 +49,7 @@ export function getConfig(
47
49
  REF_FI_CONTRACT_ID: 'ref-finance-101.testnet',
48
50
  REF_TOKEN_ID: 'ref.fakes.testnet',
49
51
  explorerUrl: 'https://testnet.nearblocks.io',
50
- REF_DCL_SWAP_CONTRACT_ID: 'dcl.ref-dev.testnet',
52
+ REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-dev.testnet',
51
53
  };
52
54
  default:
53
55
  return {
@@ -59,7 +61,7 @@ export function getConfig(
59
61
  REF_TOKEN_ID: 'token.v2.ref-finance.near',
60
62
  indexerUrl: 'https://indexer.ref.finance',
61
63
  explorerUrl: 'https://nearblocks.io',
62
- REF_DCL_SWAP_CONTRACT_ID: '',
64
+ REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near',
63
65
  };
64
66
  }
65
67
  }
@@ -75,7 +75,7 @@ function getConfig(env) {
75
75
  REF_TOKEN_ID: 'token.v2.ref-finance.near',
76
76
  indexerUrl: 'https://indexer.ref.finance',
77
77
  explorerUrl: 'https://nearblocks.io',
78
- REF_DCL_SWAP_CONTRACT_ID: 'dcl.ref-labs.near'
78
+ REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near'
79
79
  };
80
80
  }
81
81
  }
@@ -186,9 +186,6 @@ function _regeneratorRuntime() {
186
186
  var exports = {},
187
187
  Op = Object.prototype,
188
188
  hasOwn = Op.hasOwnProperty,
189
- defineProperty = Object.defineProperty || function (obj, key, desc) {
190
- obj[key] = desc.value;
191
- },
192
189
  $Symbol = "function" == typeof Symbol ? Symbol : {},
193
190
  iteratorSymbol = $Symbol.iterator || "@@iterator",
194
191
  asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
@@ -212,9 +209,40 @@ function _regeneratorRuntime() {
212
209
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
213
210
  generator = Object.create(protoGenerator.prototype),
214
211
  context = new Context(tryLocsList || []);
215
- return defineProperty(generator, "_invoke", {
216
- value: makeInvokeMethod(innerFn, self, context)
217
- }), generator;
212
+ return generator._invoke = function (innerFn, self, context) {
213
+ var state = "suspendedStart";
214
+ return function (method, arg) {
215
+ if ("executing" === state) throw new Error("Generator is already running");
216
+ if ("completed" === state) {
217
+ if ("throw" === method) throw arg;
218
+ return doneResult();
219
+ }
220
+ for (context.method = method, context.arg = arg;;) {
221
+ var delegate = context.delegate;
222
+ if (delegate) {
223
+ var delegateResult = maybeInvokeDelegate(delegate, context);
224
+ if (delegateResult) {
225
+ if (delegateResult === ContinueSentinel) continue;
226
+ return delegateResult;
227
+ }
228
+ }
229
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
230
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
231
+ context.dispatchException(context.arg);
232
+ } else "return" === context.method && context.abrupt("return", context.arg);
233
+ state = "executing";
234
+ var record = tryCatch(innerFn, self, context);
235
+ if ("normal" === record.type) {
236
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
237
+ return {
238
+ value: record.arg,
239
+ done: context.done
240
+ };
241
+ }
242
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
243
+ }
244
+ };
245
+ }(innerFn, self, context), generator;
218
246
  }
219
247
  function tryCatch(fn, obj, arg) {
220
248
  try {
@@ -268,49 +296,13 @@ function _regeneratorRuntime() {
268
296
  reject(record.arg);
269
297
  }
270
298
  var previousPromise;
271
- defineProperty(this, "_invoke", {
272
- value: function (method, arg) {
273
- function callInvokeWithMethodAndArg() {
274
- return new PromiseImpl(function (resolve, reject) {
275
- invoke(method, arg, resolve, reject);
276
- });
277
- }
278
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
279
- }
280
- });
281
- }
282
- function makeInvokeMethod(innerFn, self, context) {
283
- var state = "suspendedStart";
284
- return function (method, arg) {
285
- if ("executing" === state) throw new Error("Generator is already running");
286
- if ("completed" === state) {
287
- if ("throw" === method) throw arg;
288
- return doneResult();
289
- }
290
- for (context.method = method, context.arg = arg;;) {
291
- var delegate = context.delegate;
292
- if (delegate) {
293
- var delegateResult = maybeInvokeDelegate(delegate, context);
294
- if (delegateResult) {
295
- if (delegateResult === ContinueSentinel) continue;
296
- return delegateResult;
297
- }
298
- }
299
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
300
- if ("suspendedStart" === state) throw state = "completed", context.arg;
301
- context.dispatchException(context.arg);
302
- } else "return" === context.method && context.abrupt("return", context.arg);
303
- state = "executing";
304
- var record = tryCatch(innerFn, self, context);
305
- if ("normal" === record.type) {
306
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
307
- return {
308
- value: record.arg,
309
- done: context.done
310
- };
311
- }
312
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
299
+ this._invoke = function (method, arg) {
300
+ function callInvokeWithMethodAndArg() {
301
+ return new PromiseImpl(function (resolve, reject) {
302
+ invoke(method, arg, resolve, reject);
303
+ });
313
304
  }
305
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
314
306
  };
315
307
  }
316
308
  function maybeInvokeDelegate(delegate, context) {
@@ -366,13 +358,7 @@ function _regeneratorRuntime() {
366
358
  done: !0
367
359
  };
368
360
  }
369
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
370
- value: GeneratorFunctionPrototype,
371
- configurable: !0
372
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
373
- value: GeneratorFunction,
374
- configurable: !0
375
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
361
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
376
362
  var ctor = "function" == typeof genFun && genFun.constructor;
377
363
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
378
364
  }, exports.mark = function (genFun) {
@@ -393,9 +379,8 @@ function _regeneratorRuntime() {
393
379
  return this;
394
380
  }), define(Gp, "toString", function () {
395
381
  return "[object Generator]";
396
- }), exports.keys = function (val) {
397
- var object = Object(val),
398
- keys = [];
382
+ }), exports.keys = function (object) {
383
+ var keys = [];
399
384
  for (var key in object) keys.push(key);
400
385
  return keys.reverse(), function next() {
401
386
  for (; keys.length;) {
@@ -884,7 +869,7 @@ function checkIntegerSumOfAllocations(allocations, totalInput) {
884
869
  return newAllocations;
885
870
  }
886
871
 
887
- var _marked3 = /*#__PURE__*/_regeneratorRuntime().mark(yenFromPy);
872
+ var _marked5 = /*#__PURE__*/_regeneratorRuntime().mark(yenFromPy);
888
873
  Big.RM = 0;
889
874
  Big.DP = 40;
890
875
  Big.NE = -40;
@@ -1306,8 +1291,8 @@ function getBestOptimalAllocationsAndOutputs(_x, _x2, _x3, _x4, _x5, _x6) {
1306
1291
  return _getBestOptimalAllocationsAndOutputs.apply(this, arguments);
1307
1292
  }
1308
1293
  function _getBestOptimalAllocationsAndOutputs() {
1309
- _getBestOptimalAllocationsAndOutputs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(pools, inputToken, outputToken, totalInput, maxPathLength, threshold) {
1310
- return _regeneratorRuntime().wrap(function _callee4$(_context7) {
1294
+ _getBestOptimalAllocationsAndOutputs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(pools, inputToken, outputToken, totalInput, maxPathLength, threshold) {
1295
+ return _regeneratorRuntime().wrap(function _callee2$(_context7) {
1311
1296
  while (1) {
1312
1297
  switch (_context7.prev = _context7.next) {
1313
1298
  case 0:
@@ -1318,9 +1303,9 @@ function _getBestOptimalAllocationsAndOutputs() {
1318
1303
  threshold = 0.001;
1319
1304
  }
1320
1305
  return _context7.abrupt("return", function () {
1321
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(totalInput) {
1306
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(totalInput) {
1322
1307
  var paths, poolChains, routes, nodeRoutes, inputOutput, allocations, outputs;
1323
- return _regeneratorRuntime().wrap(function _callee3$(_context6) {
1308
+ return _regeneratorRuntime().wrap(function _callee$(_context6) {
1324
1309
  while (1) {
1325
1310
  switch (_context6.prev = _context6.next) {
1326
1311
  case 0:
@@ -1369,7 +1354,7 @@ function _getBestOptimalAllocationsAndOutputs() {
1369
1354
  return _context6.stop();
1370
1355
  }
1371
1356
  }
1372
- }, _callee3);
1357
+ }, _callee);
1373
1358
  }));
1374
1359
  return function (_x33) {
1375
1360
  return _ref.apply(this, arguments);
@@ -1380,7 +1365,7 @@ function _getBestOptimalAllocationsAndOutputs() {
1380
1365
  return _context7.stop();
1381
1366
  }
1382
1367
  }
1383
- }, _callee4);
1368
+ }, _callee2);
1384
1369
  }));
1385
1370
  return _getBestOptimalAllocationsAndOutputs.apply(this, arguments);
1386
1371
  }
@@ -1490,8 +1475,8 @@ function getSmartRouteSwapActions(_x7, _x8, _x9, _x10, _x11, _x12, _x13, _x14, _
1490
1475
  return _getSmartRouteSwapActions.apply(this, arguments);
1491
1476
  }
1492
1477
  function _getSmartRouteSwapActions() {
1493
- _getSmartRouteSwapActions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(pools, inputToken, outputToken, totalInput, allTokens, maxPathLength, threshold, numberOfRoutesLimit, MAX_NUMBER_PARALLEL_POOLS, decimalsCulledPoolIds) {
1494
- return _regeneratorRuntime().wrap(function _callee7$(_context10) {
1478
+ _getSmartRouteSwapActions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(pools, inputToken, outputToken, totalInput, allTokens, maxPathLength, threshold, numberOfRoutesLimit, MAX_NUMBER_PARALLEL_POOLS, decimalsCulledPoolIds) {
1479
+ return _regeneratorRuntime().wrap(function _callee5$(_context10) {
1495
1480
  while (1) {
1496
1481
  switch (_context10.prev = _context10.next) {
1497
1482
  case 0:
@@ -1511,9 +1496,9 @@ function _getSmartRouteSwapActions() {
1511
1496
  decimalsCulledPoolIds = [];
1512
1497
  }
1513
1498
  return _context10.abrupt("return", function () {
1514
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(totalInput) {
1499
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(totalInput) {
1515
1500
  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;
1516
- return _regeneratorRuntime().wrap(function _callee6$(_context9) {
1501
+ return _regeneratorRuntime().wrap(function _callee4$(_context9) {
1517
1502
  while (1) {
1518
1503
  switch (_context9.prev = _context9.next) {
1519
1504
  case 0:
@@ -1908,8 +1893,8 @@ function _getSmartRouteSwapActions() {
1908
1893
  }
1909
1894
  _context9.next = 143;
1910
1895
  return Promise.all(hops[i].nodeRoute.map( /*#__PURE__*/function () {
1911
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(t) {
1912
- return _regeneratorRuntime().wrap(function _callee5$(_context8) {
1896
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(t) {
1897
+ return _regeneratorRuntime().wrap(function _callee3$(_context8) {
1913
1898
  while (1) {
1914
1899
  switch (_context8.prev = _context8.next) {
1915
1900
  case 0:
@@ -1932,7 +1917,7 @@ function _getSmartRouteSwapActions() {
1932
1917
  return _context8.stop();
1933
1918
  }
1934
1919
  }
1935
- }, _callee5);
1920
+ }, _callee3);
1936
1921
  }));
1937
1922
  return function (_x35) {
1938
1923
  return _ref3.apply(this, arguments);
@@ -1993,7 +1978,7 @@ function _getSmartRouteSwapActions() {
1993
1978
  return _context9.stop();
1994
1979
  }
1995
1980
  }
1996
- }, _callee6);
1981
+ }, _callee4);
1997
1982
  }));
1998
1983
  return function (_x34) {
1999
1984
  return _ref2.apply(this, arguments);
@@ -2004,7 +1989,7 @@ function _getSmartRouteSwapActions() {
2004
1989
  return _context10.stop();
2005
1990
  }
2006
1991
  }
2007
- }, _callee7);
1992
+ }, _callee5);
2008
1993
  }));
2009
1994
  return _getSmartRouteSwapActions.apply(this, arguments);
2010
1995
  }
@@ -2012,9 +1997,9 @@ function calculateSmartRouteV2PriceImpact(_x17, _x18) {
2012
1997
  return _calculateSmartRouteV2PriceImpact.apply(this, arguments);
2013
1998
  }
2014
1999
  function _calculateSmartRouteV2PriceImpact() {
2015
- _calculateSmartRouteV2PriceImpact = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(actions, allTokens) {
2000
+ _calculateSmartRouteV2PriceImpact = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(actions, allTokens) {
2016
2001
  var deltaY, inputTokenMeta, deltaX, R, P, routes, nodeRoutes, allocations, totalAllocations, weights, i, route, nodeRoute, tokens, weight, num, denom, routeMarketPrice, num1, denom1, num2, denom2, priceImpact;
2017
- return _regeneratorRuntime().wrap(function _callee9$(_context12) {
2002
+ return _regeneratorRuntime().wrap(function _callee7$(_context12) {
2018
2003
  while (1) {
2019
2004
  switch (_context12.prev = _context12.next) {
2020
2005
  case 0:
@@ -2060,8 +2045,8 @@ function _calculateSmartRouteV2PriceImpact() {
2060
2045
  nodeRoute = nodeRoutes[i];
2061
2046
  _context12.next = 17;
2062
2047
  return Promise.all(nodeRoute.map( /*#__PURE__*/function () {
2063
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t) {
2064
- return _regeneratorRuntime().wrap(function _callee8$(_context11) {
2048
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(t) {
2049
+ return _regeneratorRuntime().wrap(function _callee6$(_context11) {
2065
2050
  while (1) {
2066
2051
  switch (_context11.prev = _context11.next) {
2067
2052
  case 0:
@@ -2084,7 +2069,7 @@ function _calculateSmartRouteV2PriceImpact() {
2084
2069
  return _context11.stop();
2085
2070
  }
2086
2071
  }
2087
- }, _callee8);
2072
+ }, _callee6);
2088
2073
  }));
2089
2074
  return function (_x36) {
2090
2075
  return _ref4.apply(this, arguments);
@@ -2115,7 +2100,7 @@ function _calculateSmartRouteV2PriceImpact() {
2115
2100
  return _context12.stop();
2116
2101
  }
2117
2102
  }
2118
- }, _callee9);
2103
+ }, _callee7);
2119
2104
  }));
2120
2105
  return _calculateSmartRouteV2PriceImpact.apply(this, arguments);
2121
2106
  }
@@ -2450,7 +2435,7 @@ function yenFromPy(g, source, target) {
2450
2435
  return _context5.stop();
2451
2436
  }
2452
2437
  }
2453
- }, _marked3, null, [[6, 14]]);
2438
+ }, _marked5, null, [[6, 14]]);
2454
2439
  }
2455
2440
  function getKShortestPaths(g, source, target, k, maxPathLength) {
2456
2441
  if (maxPathLength === void 0) {
@@ -2487,9 +2472,9 @@ function getPathsFromPools(_x19, _x20, _x21, _x22) {
2487
2472
  return _getPathsFromPools.apply(this, arguments);
2488
2473
  }
2489
2474
  function _getPathsFromPools() {
2490
- _getPathsFromPools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(pools, inputToken, outputToken, maxPathLength) {
2475
+ _getPathsFromPools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(pools, inputToken, outputToken, maxPathLength) {
2491
2476
  var graph;
2492
- return _regeneratorRuntime().wrap(function _callee10$(_context13) {
2477
+ return _regeneratorRuntime().wrap(function _callee8$(_context13) {
2493
2478
  while (1) {
2494
2479
  switch (_context13.prev = _context13.next) {
2495
2480
  case 0:
@@ -2503,7 +2488,7 @@ function _getPathsFromPools() {
2503
2488
  return _context13.stop();
2504
2489
  }
2505
2490
  }
2506
- }, _callee10);
2491
+ }, _callee8);
2507
2492
  }));
2508
2493
  return _getPathsFromPools.apply(this, arguments);
2509
2494
  }
@@ -2538,9 +2523,9 @@ function stableSmart(_x28, _x29, _x30, _x31, _x32) {
2538
2523
  return _stableSmart.apply(this, arguments);
2539
2524
  }
2540
2525
  function _stableSmart() {
2541
- _stableSmart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(pools, inputToken, outputToken, totalInput, allTokens) {
2526
+ _stableSmart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(pools, inputToken, outputToken, totalInput, allTokens) {
2542
2527
  var smartRouteActions;
2543
- return _regeneratorRuntime().wrap(function _callee12$(_context15) {
2528
+ return _regeneratorRuntime().wrap(function _callee10$(_context15) {
2544
2529
  while (1) {
2545
2530
  switch (_context15.prev = _context15.next) {
2546
2531
  case 0:
@@ -2554,7 +2539,7 @@ function _stableSmart() {
2554
2539
  return _context15.stop();
2555
2540
  }
2556
2541
  }
2557
- }, _callee12);
2542
+ }, _callee10);
2558
2543
  }));
2559
2544
  return _stableSmart.apply(this, arguments);
2560
2545
  }
@@ -3899,7 +3884,11 @@ var refFiViewFunction = /*#__PURE__*/function () {
3899
3884
  return near.account(exports.REF_FI_CONTRACT_ID);
3900
3885
  case 3:
3901
3886
  nearConnection = _context.sent;
3902
- return _context.abrupt("return", nearConnection.viewFunction(exports.REF_FI_CONTRACT_ID, methodName, args));
3887
+ return _context.abrupt("return", nearConnection.viewFunction({
3888
+ contractId: exports.REF_FI_CONTRACT_ID,
3889
+ methodName: methodName,
3890
+ args: args
3891
+ }));
3903
3892
  case 5:
3904
3893
  case "end":
3905
3894
  return _context.stop();
@@ -3923,7 +3912,11 @@ var ftViewFunction = /*#__PURE__*/function () {
3923
3912
  return near.account(exports.REF_FI_CONTRACT_ID);
3924
3913
  case 3:
3925
3914
  nearConnection = _context2.sent;
3926
- return _context2.abrupt("return", nearConnection.viewFunction(tokenId, methodName, args));
3915
+ return _context2.abrupt("return", nearConnection.viewFunction({
3916
+ contractId: tokenId,
3917
+ methodName: methodName,
3918
+ args: args
3919
+ }));
3927
3920
  case 5:
3928
3921
  case "end":
3929
3922
  return _context2.stop();
@@ -4215,7 +4208,11 @@ var refDCLSwapViewFunction = /*#__PURE__*/function () {
4215
4208
  }
4216
4209
  throw DCLInValid;
4217
4210
  case 6:
4218
- return _context10.abrupt("return", nearConnection.viewFunction(exports.config.REF_DCL_SWAP_CONTRACT_ID, methodName, args));
4211
+ return _context10.abrupt("return", nearConnection.viewFunction({
4212
+ contractId: exports.config.REF_DCL_SWAP_CONTRACT_ID,
4213
+ methodName: methodName,
4214
+ args: args
4215
+ }));
4219
4216
  case 7:
4220
4217
  case "end":
4221
4218
  return _context10.stop();