@ref-finance/ref-sdk 1.4.8 → 1.4.9

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.
@@ -4201,22 +4201,18 @@ var getUserRegisteredTokens = /*#__PURE__*/function () {
4201
4201
  }();
4202
4202
  var getAccountNearBalance = /*#__PURE__*/function () {
4203
4203
  var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(accountId) {
4204
- var provider;
4205
4204
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
4206
4205
  while (1) {
4207
4206
  switch (_context9.prev = _context9.next) {
4208
4207
  case 0:
4209
- provider = new nearApiJs.providers.JsonRpcProvider({
4210
- url: getConfig().nodeUrl
4211
- });
4212
- return _context9.abrupt("return", provider.query({
4208
+ return _context9.abrupt("return", near.connection.provider.query({
4213
4209
  request_type: 'view_account',
4214
4210
  finality: 'final',
4215
4211
  account_id: accountId
4216
4212
  }).then(function (data) {
4217
4213
  return data.amount;
4218
4214
  }));
4219
- case 2:
4215
+ case 1:
4220
4216
  case "end":
4221
4217
  return _context9.stop();
4222
4218
  }
@@ -4292,44 +4288,41 @@ var DCLSwapGetStorageBalance = function DCLSwapGetStorageBalance(tokenId, Accoun
4292
4288
  };
4293
4289
  var getMinStorageBalance = /*#__PURE__*/function () {
4294
4290
  var _ref14 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(nep141Address) {
4295
- var provider, result, balance;
4291
+ var result, balance;
4296
4292
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
4297
4293
  while (1) {
4298
4294
  switch (_context11.prev = _context11.next) {
4299
4295
  case 0:
4300
4296
  _context11.prev = 0;
4301
- provider = new nearApiJs.providers.JsonRpcProvider({
4302
- url: getConfig().nodeUrl
4303
- });
4304
- _context11.next = 4;
4305
- return provider.query({
4297
+ _context11.next = 3;
4298
+ return near.connection.provider.query({
4306
4299
  request_type: 'call_function',
4307
4300
  account_id: nep141Address,
4308
4301
  method_name: 'storage_balance_bounds',
4309
4302
  args_base64: '',
4310
4303
  finality: 'optimistic'
4311
4304
  });
4312
- case 4:
4305
+ case 3:
4313
4306
  result = _context11.sent;
4314
4307
  balance = JSON.parse(Buffer.from(result.result).toString());
4315
4308
  if (!(!balance || !balance.min)) {
4316
- _context11.next = 8;
4309
+ _context11.next = 7;
4317
4310
  break;
4318
4311
  }
4319
4312
  return _context11.abrupt("return", FT_MINIMUM_STORAGE_BALANCE_LARGE);
4320
- case 8:
4313
+ case 7:
4321
4314
  return _context11.abrupt("return", balance.min);
4322
- case 11:
4323
- _context11.prev = 11;
4315
+ case 10:
4316
+ _context11.prev = 10;
4324
4317
  _context11.t0 = _context11["catch"](0);
4325
4318
  console.error(_context11.t0, nep141Address);
4326
4319
  return _context11.abrupt("return", FT_MINIMUM_STORAGE_BALANCE_LARGE);
4327
- case 15:
4320
+ case 14:
4328
4321
  case "end":
4329
4322
  return _context11.stop();
4330
4323
  }
4331
4324
  }
4332
- }, _callee11, null, [[0, 11]]);
4325
+ }, _callee11, null, [[0, 10]]);
4333
4326
  }));
4334
4327
  return function getMinStorageBalance(_x13) {
4335
4328
  return _ref14.apply(this, arguments);