@aurigami/sdk 1.9.3 → 1.9.5
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.d.ts +1 -1
- package/dist/interactors/misc.d.ts +1 -1
- package/dist/sdk.cjs.development.js +26 -17
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +26 -17
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/SDK.ts +3 -2
- package/src/interactors/MoneyMarket.ts +8 -4
- package/src/interactors/misc.ts +3 -3
package/dist/sdk.esm.js
CHANGED
|
@@ -2843,7 +2843,7 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2843
2843
|
|
|
2844
2844
|
_proto.getDepositAPY = /*#__PURE__*/function () {
|
|
2845
2845
|
var _getDepositAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
|
|
2846
|
-
var supplyRatePerTimestamp;
|
|
2846
|
+
var supplyRatePerTimestamp, supplyRatePerDay;
|
|
2847
2847
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
2848
2848
|
while (1) {
|
|
2849
2849
|
switch (_context4.prev = _context4.next) {
|
|
@@ -2853,9 +2853,10 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2853
2853
|
|
|
2854
2854
|
case 2:
|
|
2855
2855
|
supplyRatePerTimestamp = _context4.sent;
|
|
2856
|
-
|
|
2856
|
+
supplyRatePerDay = new BigNumber(supplyRatePerTimestamp.toString()).multipliedBy(ONE_DAY).div(decimalFactor(18));
|
|
2857
|
+
return _context4.abrupt("return", new BigNumber(supplyRatePerDay.plus(1)).pow(365).minus(1));
|
|
2857
2858
|
|
|
2858
|
-
case
|
|
2859
|
+
case 5:
|
|
2859
2860
|
case "end":
|
|
2860
2861
|
return _context4.stop();
|
|
2861
2862
|
}
|
|
@@ -2872,7 +2873,7 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2872
2873
|
|
|
2873
2874
|
_proto.getBorrowAPY = /*#__PURE__*/function () {
|
|
2874
2875
|
var _getBorrowAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
|
|
2875
|
-
var borrowRatePerTimestamp;
|
|
2876
|
+
var borrowRatePerTimestamp, borrowRatePerDay;
|
|
2876
2877
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
2877
2878
|
while (1) {
|
|
2878
2879
|
switch (_context5.prev = _context5.next) {
|
|
@@ -2882,9 +2883,10 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2882
2883
|
|
|
2883
2884
|
case 2:
|
|
2884
2885
|
borrowRatePerTimestamp = _context5.sent;
|
|
2885
|
-
|
|
2886
|
+
borrowRatePerDay = new BigNumber(borrowRatePerTimestamp.toString()).multipliedBy(ONE_DAY).div(decimalFactor(18));
|
|
2887
|
+
return _context5.abrupt("return", new BigNumber(borrowRatePerDay.plus(1)).pow(365).minus(1));
|
|
2886
2888
|
|
|
2887
|
-
case
|
|
2889
|
+
case 5:
|
|
2888
2890
|
case "end":
|
|
2889
2891
|
return _context5.stop();
|
|
2890
2892
|
}
|
|
@@ -4465,17 +4467,20 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4465
4467
|
}();
|
|
4466
4468
|
|
|
4467
4469
|
_proto.sneakAccounts = /*#__PURE__*/function () {
|
|
4468
|
-
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(accounts, tokenAddresses) {
|
|
4470
|
+
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(accounts, tokenAddresses, dust) {
|
|
4469
4471
|
var _this3 = this;
|
|
4470
4472
|
|
|
4471
|
-
var _1E18,
|
|
4473
|
+
var _1E18, oracle, tokens, prices, exrate, res, _iterator2, _step2, addr, infos, _i, snapshot, bal, bor, balR, borR;
|
|
4472
4474
|
|
|
4473
4475
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4474
4476
|
while (1) {
|
|
4475
4477
|
switch (_context5.prev = _context5.next) {
|
|
4476
4478
|
case 0:
|
|
4479
|
+
if (dust === void 0) {
|
|
4480
|
+
dust = /*#__PURE__*/new BigNumber(0.1);
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4477
4483
|
_1E18 = BigNumber$1.from(10).pow(18);
|
|
4478
|
-
dust = new BigNumber(0.1);
|
|
4479
4484
|
oracle = this.env.getContract(networkAddresses.misc.oracle, AuriOracleABI.abi);
|
|
4480
4485
|
tokens = tokenAddresses.map(function (addr) {
|
|
4481
4486
|
return _this3.env.getContract(addr, abis.abi);
|
|
@@ -4519,7 +4524,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4519
4524
|
balR = new BigNumber(bal.toString()).dividedBy(_1E18.toString());
|
|
4520
4525
|
borR = new BigNumber(bor.toString()).dividedBy(_1E18.toString());
|
|
4521
4526
|
|
|
4522
|
-
if (!(balR.
|
|
4527
|
+
if (!(balR.lte(dust) && borR.lte(dust))) {
|
|
4523
4528
|
_context5.next = 26;
|
|
4524
4529
|
break;
|
|
4525
4530
|
}
|
|
@@ -4559,7 +4564,7 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4559
4564
|
}, _callee5, this);
|
|
4560
4565
|
}));
|
|
4561
4566
|
|
|
4562
|
-
function sneakAccounts(_x4, _x5) {
|
|
4567
|
+
function sneakAccounts(_x4, _x5, _x6) {
|
|
4563
4568
|
return _sneakAccounts.apply(this, arguments);
|
|
4564
4569
|
}
|
|
4565
4570
|
|
|
@@ -5238,14 +5243,18 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5238
5243
|
}();
|
|
5239
5244
|
|
|
5240
5245
|
_proto.sneakAccounts = /*#__PURE__*/function () {
|
|
5241
|
-
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(accounts, tokenAddresses) {
|
|
5246
|
+
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(accounts, tokenAddresses, dust) {
|
|
5242
5247
|
return runtime_1.wrap(function _callee9$(_context9) {
|
|
5243
5248
|
while (1) {
|
|
5244
5249
|
switch (_context9.prev = _context9.next) {
|
|
5245
5250
|
case 0:
|
|
5246
|
-
|
|
5251
|
+
if (dust === void 0) {
|
|
5252
|
+
dust = /*#__PURE__*/new BigNumber(0.1);
|
|
5253
|
+
}
|
|
5247
5254
|
|
|
5248
|
-
|
|
5255
|
+
return _context9.abrupt("return", this._misc.sneakAccounts(accounts, tokenAddresses, dust));
|
|
5256
|
+
|
|
5257
|
+
case 2:
|
|
5249
5258
|
case "end":
|
|
5250
5259
|
return _context9.stop();
|
|
5251
5260
|
}
|
|
@@ -5253,7 +5262,7 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5253
5262
|
}, _callee9, this);
|
|
5254
5263
|
}));
|
|
5255
5264
|
|
|
5256
|
-
function sneakAccounts(_x7, _x8) {
|
|
5265
|
+
function sneakAccounts(_x7, _x8, _x9) {
|
|
5257
5266
|
return _sneakAccounts.apply(this, arguments);
|
|
5258
5267
|
}
|
|
5259
5268
|
|
|
@@ -5315,7 +5324,7 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
5315
5324
|
}, _callee11, this);
|
|
5316
5325
|
}));
|
|
5317
5326
|
|
|
5318
|
-
function stake(
|
|
5327
|
+
function stake(_x10) {
|
|
5319
5328
|
return _stake.apply(this, arguments);
|
|
5320
5329
|
}
|
|
5321
5330
|
|
|
@@ -5338,7 +5347,7 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
5338
5347
|
}, _callee12, this);
|
|
5339
5348
|
}));
|
|
5340
5349
|
|
|
5341
|
-
function unstake(
|
|
5350
|
+
function unstake(_x11) {
|
|
5342
5351
|
return _unstake.apply(this, arguments);
|
|
5343
5352
|
}
|
|
5344
5353
|
|