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