@aurigami/sdk 1.6.9 → 1.6.11

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/dist/sdk.esm.js CHANGED
@@ -3940,8 +3940,8 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3940
3940
  return getPlyCirculatingSupply;
3941
3941
  }();
3942
3942
 
3943
- _proto.getUltilizations = /*#__PURE__*/function () {
3944
- var _getUltilizations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(userAddr) {
3943
+ _proto.getUtilisation = /*#__PURE__*/function () {
3944
+ var _getUtilisation = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(userAddr) {
3945
3945
  var accountDetail, sumBorrow, sumCol;
3946
3946
  return runtime_1.wrap(function _callee4$(_context4) {
3947
3947
  while (1) {
@@ -3964,25 +3964,25 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3964
3964
  }, _callee4, this);
3965
3965
  }));
3966
3966
 
3967
- function getUltilizations(_x3) {
3968
- return _getUltilizations.apply(this, arguments);
3967
+ function getUtilisation(_x3) {
3968
+ return _getUtilisation.apply(this, arguments);
3969
3969
  }
3970
3970
 
3971
- return getUltilizations;
3971
+ return getUtilisation;
3972
3972
  }();
3973
3973
 
3974
3974
  _proto.sneakAccounts = /*#__PURE__*/function () {
3975
3975
  var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(accounts, tokenAddresses) {
3976
3976
  var _this3 = this;
3977
3977
 
3978
- var _1E18, _1E9, oracle, tokens, prices, exrate, res, _iterator2, _step2, addr, infos, _i, snapshot, bal, bor, balR, borR;
3978
+ var _1E18, dust, oracle, tokens, prices, exrate, res, _iterator2, _step2, addr, infos, _i, snapshot, bal, bor, balR, borR;
3979
3979
 
3980
3980
  return runtime_1.wrap(function _callee5$(_context5) {
3981
3981
  while (1) {
3982
3982
  switch (_context5.prev = _context5.next) {
3983
3983
  case 0:
3984
3984
  _1E18 = BigNumber$1.from(10).pow(18);
3985
- _1E9 = BigNumber$1.from(10).pow(9);
3985
+ dust = new BigNumber(0.1);
3986
3986
  oracle = this.env.getContract(networkAddresses.misc.oracle, AuriOracleABI.abi);
3987
3987
  tokens = tokenAddresses.map(function (addr) {
3988
3988
  return _this3.env.getContract(addr, AuTokenABI.abi);
@@ -4023,10 +4023,10 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4023
4023
  snapshot = _context5.sent;
4024
4024
  bal = snapshot[0].mul(exrate[_i]).div(_1E18).mul(prices[_i]).div(_1E18);
4025
4025
  bor = snapshot[1].mul(prices[_i]).div(_1E18);
4026
- balR = bal.div(_1E9).toNumber() / Math.pow(10, 9);
4027
- borR = bor.div(_1E9).toNumber() / Math.pow(10, 9);
4026
+ balR = new BigNumber(bal.toString()).dividedBy(_1E18.toString());
4027
+ borR = new BigNumber(bor.toString()).dividedBy(_1E18.toString());
4028
4028
 
4029
- if (!(balR < 0.1 || borR < 0.1)) {
4029
+ if (!(balR.lt(dust) || borR.lt(dust))) {
4030
4030
  _context5.next = 26;
4031
4031
  break;
4032
4032
  }
@@ -4046,7 +4046,10 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4046
4046
  break;
4047
4047
 
4048
4048
  case 30:
4049
- res.push(infos);
4049
+ res.push({
4050
+ address: addr,
4051
+ tokens: infos
4052
+ });
4050
4053
 
4051
4054
  case 31:
4052
4055
  _context5.next = 12;
@@ -4517,13 +4520,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4517
4520
  return getPlyCirculatingSupply;
4518
4521
  }();
4519
4522
 
4520
- _proto.getUltilizations = /*#__PURE__*/function () {
4521
- var _getUltilizations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(userAddr) {
4523
+ _proto.getUtilisation = /*#__PURE__*/function () {
4524
+ var _getUtilisation = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(userAddr) {
4522
4525
  return runtime_1.wrap(function _callee8$(_context8) {
4523
4526
  while (1) {
4524
4527
  switch (_context8.prev = _context8.next) {
4525
4528
  case 0:
4526
- return _context8.abrupt("return", this._misc.getUltilizations(userAddr));
4529
+ return _context8.abrupt("return", this._misc.getUtilisation(userAddr));
4527
4530
 
4528
4531
  case 1:
4529
4532
  case "end":
@@ -4533,11 +4536,11 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4533
4536
  }, _callee8, this);
4534
4537
  }));
4535
4538
 
4536
- function getUltilizations(_x6) {
4537
- return _getUltilizations.apply(this, arguments);
4539
+ function getUtilisation(_x6) {
4540
+ return _getUtilisation.apply(this, arguments);
4538
4541
  }
4539
4542
 
4540
- return getUltilizations;
4543
+ return getUtilisation;
4541
4544
  }();
4542
4545
 
4543
4546
  _proto.sneakAccounts = /*#__PURE__*/function () {