@aurigami/sdk 1.5.0 → 1.5.2

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.
@@ -7,18 +7,18 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
7
7
  var BigNumber = _interopDefault(require('bignumber.js'));
8
8
  var ethers = require('ethers');
9
9
  var utils = require('ethers/lib/utils');
10
+ var AuriFairLaunchABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json'));
11
+ var AuriLensABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json'));
12
+ var ComptrollerABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json'));
13
+ var FaucetABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/mock/Faucet.sol/Faucet.json'));
10
14
  var abstractSigner = require('@ethersproject/abstract-signer');
11
- var axios = _interopDefault(require('axios'));
12
15
  var assert = _interopDefault(require('assert'));
16
+ var axios = _interopDefault(require('axios'));
13
17
  var AuErc20ABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json'));
14
18
  var AuETHABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json'));
15
- var ComptrollerABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json'));
16
- var AuriLensABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json'));
17
19
  var EthRepayHelperABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/EthRepayHelper.sol/EthRepayHelper.json'));
18
- var AuriFairLaunchABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json'));
19
- var FaucetABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/mock/Faucet.sol/Faucet.json'));
20
- var EIP20InterfaceABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json'));
21
20
  var PulpABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json'));
21
+ var EIP20InterfaceABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json'));
22
22
  var AuTokenABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json'));
23
23
  var AuriAirdropABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriAirdrop.sol/AuriAirdrop.json'));
24
24
 
@@ -922,20 +922,6 @@ var BlockchainEntity = /*#__PURE__*/function () {
922
922
  return BlockchainEntity;
923
923
  }();
924
924
 
925
- (function (ComptrollerRewardType) {
926
- ComptrollerRewardType[ComptrollerRewardType["PLY"] = 0] = "PLY";
927
- ComptrollerRewardType[ComptrollerRewardType["AURORA"] = 1] = "AURORA";
928
- })(exports.ComptrollerRewardType || (exports.ComptrollerRewardType = {}));
929
-
930
- (function (MarketAction) {
931
- MarketAction[MarketAction["Deposit"] = 0] = "Deposit";
932
- MarketAction[MarketAction["Borrow"] = 1] = "Borrow";
933
- MarketAction[MarketAction["Withdraw"] = 2] = "Withdraw";
934
- MarketAction[MarketAction["Repay"] = 3] = "Repay";
935
- MarketAction[MarketAction["EnableCollateral"] = 4] = "EnableCollateral";
936
- MarketAction[MarketAction["DisableCollateral"] = 5] = "DisableCollateral";
937
- })(exports.MarketAction || (exports.MarketAction = {}));
938
-
939
925
  var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
940
926
  var ETHAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
941
927
  var AURORA_CHAINID = 1313161554;
@@ -1002,7 +988,7 @@ var networkAddresses = {
1002
988
  var PRICE_WHITELISTED = /*#__PURE__*/new Set( /*#__PURE__*/[].concat( /*#__PURE__*/networkAddresses.auTokens.map(function (t) {
1003
989
  return t.underlying;
1004
990
  }), [networkAddresses.tokens.AURORA, networkAddresses.tokens.TRI, networkAddresses.tokens.META, networkAddresses.tokens.stNEAR]));
1005
- var REWARD_CLAIM_START = 1651762800;
991
+ var REWARD_CLAIM_START = 1651748400;
1006
992
  var BORROW_LIMIT_BUFFER = /*#__PURE__*/new BigNumber(1);
1007
993
  var ONE_DAY = 86400;
1008
994
  var ONE_WEEK = ONE_DAY * 7;
@@ -1197,6 +1183,20 @@ function _getBlockBeforeTimestamp() {
1197
1183
  return _getBlockBeforeTimestamp.apply(this, arguments);
1198
1184
  }
1199
1185
 
1186
+ (function (ComptrollerRewardType) {
1187
+ ComptrollerRewardType[ComptrollerRewardType["PLY"] = 0] = "PLY";
1188
+ ComptrollerRewardType[ComptrollerRewardType["AURORA"] = 1] = "AURORA";
1189
+ })(exports.ComptrollerRewardType || (exports.ComptrollerRewardType = {}));
1190
+
1191
+ (function (MarketAction) {
1192
+ MarketAction[MarketAction["Deposit"] = 0] = "Deposit";
1193
+ MarketAction[MarketAction["Borrow"] = 1] = "Borrow";
1194
+ MarketAction[MarketAction["Withdraw"] = 2] = "Withdraw";
1195
+ MarketAction[MarketAction["Repay"] = 3] = "Repay";
1196
+ MarketAction[MarketAction["EnableCollateral"] = 4] = "EnableCollateral";
1197
+ MarketAction[MarketAction["DisableCollateral"] = 5] = "DisableCollateral";
1198
+ })(exports.MarketAction || (exports.MarketAction = {}));
1199
+
1200
1200
  var Token = function Token(address, decimals) {
1201
1201
  this.address = address.toLowerCase();
1202
1202
  this.decimals = decimals;
@@ -1229,6 +1229,14 @@ var TokenAmount = /*#__PURE__*/function () {
1229
1229
  return this.rawAmnt;
1230
1230
  };
1231
1231
 
1232
+ TokenAmount.fromAddressAndAmount = function fromAddressAndAmount(tokenAddress, amount, isRaw) {
1233
+ if (isRaw === void 0) {
1234
+ isRaw = true;
1235
+ }
1236
+
1237
+ return new TokenAmount(new Token(tokenAddress, getDecimal(tokenAddress)), amount, isRaw);
1238
+ };
1239
+
1232
1240
  return TokenAmount;
1233
1241
  }();
1234
1242
 
@@ -2333,7 +2341,7 @@ function _fetchLPPrice() {
2333
2341
  return _fetchLPPriceBy.apply(this, arguments);
2334
2342
  };
2335
2343
 
2336
- fetchLPPriceBy = function _fetchLPPriceBy2(_x20) {
2344
+ fetchLPPriceBy = function _fetchLPPriceBy2(_x22) {
2337
2345
  return _fetchLPPriceBy.apply(this, arguments);
2338
2346
  };
2339
2347
 
@@ -2592,78 +2600,97 @@ function fetchPLYPrice(_x15) {
2592
2600
 
2593
2601
  function _fetchPLYPrice() {
2594
2602
  _fetchPLYPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(provider) {
2595
- var LPInfo, plyAddress, plyDecimal, wnearAddress, wnearDecimal;
2596
2603
  return runtime_1.wrap(function _callee11$(_context11) {
2597
2604
  while (1) {
2598
2605
  switch (_context11.prev = _context11.next) {
2599
2606
  case 0:
2600
- return _context11.abrupt("return", new BigNumber(0));
2607
+ return _context11.abrupt("return", fetchToken0PriceByLP(networkAddresses.tokens.PLYWNEAR, provider));
2601
2608
 
2602
- case 3:
2603
- LPInfo = _context11.sent;
2609
+ case 1:
2610
+ case "end":
2611
+ return _context11.stop();
2612
+ }
2613
+ }
2614
+ }, _callee11);
2615
+ }));
2616
+ return _fetchPLYPrice.apply(this, arguments);
2617
+ }
2618
+
2619
+ function fetchToken0PriceByLP(_x16, _x17) {
2620
+ return _fetchToken0PriceByLP.apply(this, arguments);
2621
+ }
2622
+
2623
+ function _fetchToken0PriceByLP() {
2624
+ _fetchToken0PriceByLP = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(LP, provider) {
2625
+ var LPInfo, token0Decimal, token1Decimal;
2626
+ return runtime_1.wrap(function _callee12$(_context12) {
2627
+ while (1) {
2628
+ switch (_context12.prev = _context12.next) {
2629
+ case 0:
2630
+ _context12.next = 2;
2631
+ return fetchLPPositions(LP, provider);
2632
+
2633
+ case 2:
2634
+ LPInfo = _context12.sent;
2604
2635
 
2605
2636
  if (!LPInfo.reserve1.isZero()) {
2606
- _context11.next = 6;
2637
+ _context12.next = 5;
2607
2638
  break;
2608
2639
  }
2609
2640
 
2610
- return _context11.abrupt("return", new BigNumber(0));
2641
+ return _context12.abrupt("return", new BigNumber(0));
2642
+
2643
+ case 5:
2644
+ token0Decimal = getDecimal(LPInfo.token0);
2645
+ token1Decimal = getDecimal(LPInfo.token1);
2646
+ _context12.next = 9;
2647
+ return fetchPrice(LPInfo.token1, provider);
2611
2648
 
2612
- case 6:
2613
- plyAddress = LPInfo.token0;
2614
- assert(isSameAddress(plyAddress, networkAddresses.tokens.PLY));
2615
- plyDecimal = getDecimal(plyAddress);
2616
- wnearAddress = LPInfo.token1;
2617
- assert(isSameAddress(wnearAddress, networkAddresses.tokens.WNEAR));
2618
- wnearDecimal = getDecimal(wnearAddress);
2619
- _context11.next = 14;
2620
- return fetchPrice(wnearAddress, provider);
2621
-
2622
- case 14:
2623
- return _context11.abrupt("return", _context11.sent.multipliedBy(LPInfo.reserve1.toString()).multipliedBy(decimalFactor(plyDecimal)).dividedBy(decimalFactor(wnearDecimal)).dividedBy(LPInfo.reserve0.toString()));
2624
-
2625
- case 15:
2649
+ case 9:
2650
+ return _context12.abrupt("return", _context12.sent.multipliedBy(LPInfo.reserve1.toString()).multipliedBy(decimalFactor(token0Decimal)).dividedBy(decimalFactor(token1Decimal)).dividedBy(LPInfo.reserve0.toString()));
2651
+
2652
+ case 10:
2626
2653
  case "end":
2627
- return _context11.stop();
2654
+ return _context12.stop();
2628
2655
  }
2629
2656
  }
2630
- }, _callee11);
2657
+ }, _callee12);
2631
2658
  }));
2632
- return _fetchPLYPrice.apply(this, arguments);
2659
+ return _fetchToken0PriceByLP.apply(this, arguments);
2633
2660
  }
2634
2661
 
2635
- function fetchValuation(_x16, _x17) {
2662
+ function fetchValuation(_x18, _x19) {
2636
2663
  return _fetchValuation.apply(this, arguments);
2637
2664
  }
2638
2665
 
2639
2666
  function _fetchValuation() {
2640
- _fetchValuation = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(tokenAmount, provider) {
2667
+ _fetchValuation = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(tokenAmount, provider) {
2641
2668
  var price;
2642
- return runtime_1.wrap(function _callee12$(_context12) {
2669
+ return runtime_1.wrap(function _callee13$(_context13) {
2643
2670
  while (1) {
2644
- switch (_context12.prev = _context12.next) {
2671
+ switch (_context13.prev = _context13.next) {
2645
2672
  case 0:
2646
2673
  if (!(tokenAmount.rawAmount() == '0')) {
2647
- _context12.next = 2;
2674
+ _context13.next = 2;
2648
2675
  break;
2649
2676
  }
2650
2677
 
2651
- return _context12.abrupt("return", new BigNumber(0));
2678
+ return _context13.abrupt("return", new BigNumber(0));
2652
2679
 
2653
2680
  case 2:
2654
- _context12.next = 4;
2681
+ _context13.next = 4;
2655
2682
  return fetchPrice(tokenAmount.token.address, provider);
2656
2683
 
2657
2684
  case 4:
2658
- price = _context12.sent;
2659
- return _context12.abrupt("return", calcValuation(tokenAmount, price));
2685
+ price = _context13.sent;
2686
+ return _context13.abrupt("return", calcValuation(tokenAmount, price));
2660
2687
 
2661
2688
  case 6:
2662
2689
  case "end":
2663
- return _context12.stop();
2690
+ return _context13.stop();
2664
2691
  }
2665
2692
  }
2666
- }, _callee12);
2693
+ }, _callee13);
2667
2694
  }));
2668
2695
  return _fetchValuation.apply(this, arguments);
2669
2696
  }
@@ -2671,23 +2698,23 @@ function _fetchValuation() {
2671
2698
  function calcValuation(tokenAmount, price) {
2672
2699
  return new BigNumber(tokenAmount.formattedAmount()).multipliedBy(price);
2673
2700
  }
2674
- function valuateToken(_x18, _x19) {
2701
+ function valuateToken(_x20, _x21) {
2675
2702
  return _valuateToken.apply(this, arguments);
2676
2703
  }
2677
2704
 
2678
2705
  function _valuateToken() {
2679
- _valuateToken = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(tokenAmount, provider) {
2706
+ _valuateToken = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(tokenAmount, provider) {
2680
2707
  var tokenValuation;
2681
- return runtime_1.wrap(function _callee13$(_context13) {
2708
+ return runtime_1.wrap(function _callee14$(_context14) {
2682
2709
  while (1) {
2683
- switch (_context13.prev = _context13.next) {
2710
+ switch (_context14.prev = _context14.next) {
2684
2711
  case 0:
2685
- _context13.next = 2;
2712
+ _context14.next = 2;
2686
2713
  return fetchValuation(tokenAmount, provider);
2687
2714
 
2688
2715
  case 2:
2689
- tokenValuation = _context13.sent;
2690
- return _context13.abrupt("return", {
2716
+ tokenValuation = _context14.sent;
2717
+ return _context14.abrupt("return", {
2691
2718
  tokenAmount: tokenAmount,
2692
2719
  currencyAmount: {
2693
2720
  currency: 'USD',
@@ -2697,10 +2724,10 @@ function _valuateToken() {
2697
2724
 
2698
2725
  case 4:
2699
2726
  case "end":
2700
- return _context13.stop();
2727
+ return _context14.stop();
2701
2728
  }
2702
2729
  }
2703
- }, _callee13);
2730
+ }, _callee14);
2704
2731
  }));
2705
2732
  return _valuateToken.apply(this, arguments);
2706
2733
  }
@@ -3386,6 +3413,7 @@ var MoneyMarket = /*#__PURE__*/function (_BlockchainEntity) {
3386
3413
  return MoneyMarket;
3387
3414
  }(BlockchainEntity);
3388
3415
 
3416
+ var LOCKING_DENOMINATOR = /*#__PURE__*/ethers.BigNumber.from(10000);
3389
3417
  var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3390
3418
  _inheritsLoose(PapermillRead, _BlockchainEntityRead);
3391
3419
 
@@ -3496,40 +3524,42 @@ var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3496
3524
  return getUnclaimedPlyReward;
3497
3525
  }();
3498
3526
 
3527
+ _proto.getWeek = function getWeek(timestamp) {
3528
+ return ethers.BigNumber.from(timestamp - REWARD_CLAIM_START).div(ONE_WEEK).toNumber();
3529
+ };
3530
+
3499
3531
  _proto.getLockingDetails = /*#__PURE__*/function () {
3500
3532
  var _getLockingDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(userAddress) {
3501
- var currentTime, currentWeek, denominator, promises, values, percentLockCurrentWeek, percentLockNextWeek, totalRewards, _yield$this$_pulp$cal, pulpAmountCurrentWeek, plyAmountCurrentWeek, plyAmountNextWeek, pulpAmountNextWeek, currentUnlockPortion, nextUnlockPortion;
3533
+ var currentWeek, promises, values, percentLockCurrentWeek, percentLockNextWeek, totalRewards, _yield$this$_pulp$cal, pulpAmountCurrentWeek, plyAmountCurrentWeek, plyAmountNextWeek, pulpAmountNextWeek, currentUnlockPortion, nextUnlockPortion;
3502
3534
 
3503
3535
  return runtime_1.wrap(function _callee4$(_context4) {
3504
3536
  while (1) {
3505
3537
  switch (_context4.prev = _context4.next) {
3506
3538
  case 0:
3507
- currentTime = getCurrentTimestamp();
3508
- currentWeek = ethers.BigNumber.from(currentTime - REWARD_CLAIM_START).div(ONE_WEEK).toNumber();
3509
- denominator = ethers.BigNumber.from(10000);
3539
+ currentWeek = this.getWeek(getCurrentTimestamp());
3510
3540
  promises = [];
3511
3541
  promises.push(this._auriLens.getPercentLock(this._pulp.address, userAddress, currentWeek));
3512
3542
  promises.push(this._auriLens.getPercentLock(this._pulp.address, userAddress, currentWeek + 1));
3513
3543
  promises.push(this.getUnclaimedPlyReward(userAddress));
3514
- _context4.next = 9;
3544
+ _context4.next = 7;
3515
3545
  return Promise.all(promises);
3516
3546
 
3517
- case 9:
3547
+ case 7:
3518
3548
  values = _context4.sent;
3519
3549
  percentLockCurrentWeek = ethers.BigNumber.from(values[0]);
3520
3550
  percentLockNextWeek = ethers.BigNumber.from(values[1]);
3521
3551
  totalRewards = values[2];
3522
- _context4.next = 15;
3552
+ _context4.next = 13;
3523
3553
  return this._pulp.calcLockAmount(userAddress, totalRewards.rawAmount());
3524
3554
 
3525
- case 15:
3555
+ case 13:
3526
3556
  _yield$this$_pulp$cal = _context4.sent;
3527
3557
  pulpAmountCurrentWeek = _yield$this$_pulp$cal[0];
3528
3558
  plyAmountCurrentWeek = _yield$this$_pulp$cal[1];
3529
- plyAmountNextWeek = percentLockNextWeek.mul(totalRewards.rawAmount()).div(denominator);
3559
+ plyAmountNextWeek = percentLockNextWeek.mul(totalRewards.rawAmount()).div(LOCKING_DENOMINATOR);
3530
3560
  pulpAmountNextWeek = ethers.BigNumber.from(totalRewards.rawAmount()).sub(plyAmountNextWeek);
3531
- currentUnlockPortion = denominator.sub(percentLockCurrentWeek).toString();
3532
- nextUnlockPortion = denominator.sub(percentLockNextWeek).toString();
3561
+ currentUnlockPortion = LOCKING_DENOMINATOR.sub(percentLockCurrentWeek).toString();
3562
+ nextUnlockPortion = LOCKING_DENOMINATOR.sub(percentLockNextWeek).toString();
3533
3563
  return _context4.abrupt("return", {
3534
3564
  vestingStart: REWARD_CLAIM_START,
3535
3565
  currentUnlockPortion: new BigNumber(currentUnlockPortion).dividedBy(100).toNumber(),
@@ -3541,7 +3571,7 @@ var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3541
3571
  nextPulp: new TokenAmount(this.pulpToken, pulpAmountNextWeek.toString())
3542
3572
  });
3543
3573
 
3544
- case 23:
3574
+ case 21:
3545
3575
  case "end":
3546
3576
  return _context4.stop();
3547
3577
  }
@@ -3585,6 +3615,36 @@ var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3585
3615
  return getTimestampToUnlock;
3586
3616
  }();
3587
3617
 
3618
+ _proto.getUnlockPortionAt = /*#__PURE__*/function () {
3619
+ var _getUnlockPortionAt = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(userAddress, timestamp) {
3620
+ var lockPortion, unlockPortion;
3621
+ return runtime_1.wrap(function _callee6$(_context6) {
3622
+ while (1) {
3623
+ switch (_context6.prev = _context6.next) {
3624
+ case 0:
3625
+ _context6.next = 2;
3626
+ return this._auriLens.getPercentLock(this._pulp.address, userAddress, this.getWeek(timestamp));
3627
+
3628
+ case 2:
3629
+ lockPortion = _context6.sent;
3630
+ unlockPortion = LOCKING_DENOMINATOR.sub(lockPortion);
3631
+ return _context6.abrupt("return", unlockPortion.toNumber() / 100);
3632
+
3633
+ case 5:
3634
+ case "end":
3635
+ return _context6.stop();
3636
+ }
3637
+ }
3638
+ }, _callee6, this);
3639
+ }));
3640
+
3641
+ function getUnlockPortionAt(_x7, _x8) {
3642
+ return _getUnlockPortionAt.apply(this, arguments);
3643
+ }
3644
+
3645
+ return getUnlockPortionAt;
3646
+ }();
3647
+
3588
3648
  return PapermillRead;
3589
3649
  }(BlockchainEntityRead);
3590
3650
  var PapermillReadWrite = /*#__PURE__*/function (_PapermillRead) {
@@ -3597,22 +3657,22 @@ var PapermillReadWrite = /*#__PURE__*/function (_PapermillRead) {
3597
3657
  var _proto2 = PapermillReadWrite.prototype;
3598
3658
 
3599
3659
  _proto2.redeem = /*#__PURE__*/function () {
3600
- var _redeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(recipient, amount) {
3601
- return runtime_1.wrap(function _callee6$(_context6) {
3660
+ var _redeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(recipient, amount) {
3661
+ return runtime_1.wrap(function _callee7$(_context7) {
3602
3662
  while (1) {
3603
- switch (_context6.prev = _context6.next) {
3663
+ switch (_context7.prev = _context7.next) {
3604
3664
  case 0:
3605
- return _context6.abrupt("return", this._pulp.connect(this._networkConnection.signer).redeem(recipient, amount.rawAmount()));
3665
+ return _context7.abrupt("return", this._pulp.connect(this._networkConnection.signer).redeem(recipient, amount.rawAmount()));
3606
3666
 
3607
3667
  case 1:
3608
3668
  case "end":
3609
- return _context6.stop();
3669
+ return _context7.stop();
3610
3670
  }
3611
3671
  }
3612
- }, _callee6, this);
3672
+ }, _callee7, this);
3613
3673
  }));
3614
3674
 
3615
- function redeem(_x7, _x8) {
3675
+ function redeem(_x9, _x10) {
3616
3676
  return _redeem.apply(this, arguments);
3617
3677
  }
3618
3678
 
@@ -3620,28 +3680,28 @@ var PapermillReadWrite = /*#__PURE__*/function (_PapermillRead) {
3620
3680
  }();
3621
3681
 
3622
3682
  _proto2.selfRedeem = /*#__PURE__*/function () {
3623
- var _selfRedeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(amount) {
3683
+ var _selfRedeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
3624
3684
  var msgSender;
3625
- return runtime_1.wrap(function _callee7$(_context7) {
3685
+ return runtime_1.wrap(function _callee8$(_context8) {
3626
3686
  while (1) {
3627
- switch (_context7.prev = _context7.next) {
3687
+ switch (_context8.prev = _context8.next) {
3628
3688
  case 0:
3629
- _context7.next = 2;
3689
+ _context8.next = 2;
3630
3690
  return this._networkConnection.signer.getAddress();
3631
3691
 
3632
3692
  case 2:
3633
- msgSender = _context7.sent;
3634
- return _context7.abrupt("return", this.redeem(msgSender, amount));
3693
+ msgSender = _context8.sent;
3694
+ return _context8.abrupt("return", this.redeem(msgSender, amount));
3635
3695
 
3636
3696
  case 4:
3637
3697
  case "end":
3638
- return _context7.stop();
3698
+ return _context8.stop();
3639
3699
  }
3640
3700
  }
3641
- }, _callee7, this);
3701
+ }, _callee8, this);
3642
3702
  }));
3643
3703
 
3644
- function selfRedeem(_x9) {
3704
+ function selfRedeem(_x11) {
3645
3705
  return _selfRedeem.apply(this, arguments);
3646
3706
  }
3647
3707
 
@@ -3670,6 +3730,244 @@ var Papermill = /*#__PURE__*/function (_BlockchainEntity) {
3670
3730
  return Papermill;
3671
3731
  }(BlockchainEntity);
3672
3732
 
3733
+ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3734
+ _inheritsLoose(StakingRead, _BlockchainEntityRead);
3735
+
3736
+ function StakingRead(networkConnection) {
3737
+ var _this;
3738
+
3739
+ _this = _BlockchainEntityRead.call(this, networkConnection) || this;
3740
+ _this._comptroller = new ethers.Contract(networkAddresses.misc.COMPTROLLER, ComptrollerABI.abi, networkConnection.provider);
3741
+ _this._auriFairLaunch = new ethers.Contract(networkAddresses.misc.AURIFAIRLAUNCH, AuriFairLaunchABI.abi, networkConnection.provider);
3742
+ _this._auriLens = new ethers.Contract(networkAddresses.misc.AURILENS, AuriLensABI.abi, networkConnection.provider);
3743
+ return _this;
3744
+ }
3745
+
3746
+ var _proto = StakingRead.prototype;
3747
+
3748
+ _proto.getPLYWNEARPoolDetails = /*#__PURE__*/function () {
3749
+ var _getPLYWNEARPoolDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
3750
+ var stakedLiquidity, rewardPerSeconds, stakedLiquidityAmount, totalStakeValuation, promises, i, rewardTokenAddress, rewardToken, rewardPerSecond, APYs;
3751
+ return runtime_1.wrap(function _callee$(_context) {
3752
+ while (1) {
3753
+ switch (_context.prev = _context.next) {
3754
+ case 0:
3755
+ _context.next = 2;
3756
+ return this._auriFairLaunch.getPoolInfo(PLYWNEAR_POOL_ID).then(function (res) {
3757
+ stakedLiquidity = res.totalStake;
3758
+ rewardPerSeconds = res.rewardPerSeconds;
3759
+ });
3760
+
3761
+ case 2:
3762
+ stakedLiquidityAmount = new TokenAmount(PLYWNEARToken, stakedLiquidity.toString());
3763
+ _context.next = 5;
3764
+ return fetchValuation(stakedLiquidityAmount, this._networkConnection.provider);
3765
+
3766
+ case 5:
3767
+ totalStakeValuation = _context.sent;
3768
+ promises = [];
3769
+
3770
+ for (i = 0; i < rewardPerSeconds.length; i++) {
3771
+ rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[i];
3772
+ rewardToken = new Token(rewardTokenAddress, getDecimal(rewardTokenAddress));
3773
+ rewardPerSecond = rewardPerSeconds[i];
3774
+ promises.push(fetchValuation(new TokenAmount(rewardToken, rewardPerSecond.toString()), this._networkConnection.provider));
3775
+ }
3776
+
3777
+ APYs = [];
3778
+ _context.next = 11;
3779
+ return Promise.all(promises);
3780
+
3781
+ case 11:
3782
+ _context.sent.forEach(function (rewardPerSecondValuation, i) {
3783
+ var rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[i];
3784
+ var apy = calcLMRewardApr(rewardPerSecondValuation, totalStakeValuation, ONE_DAY * 365).toFixed(DECIMAL_PRECISION);
3785
+ APYs.push({
3786
+ address: rewardTokenAddress,
3787
+ apy: apy
3788
+ });
3789
+ });
3790
+
3791
+ return _context.abrupt("return", {
3792
+ totalStakedLiquidity: {
3793
+ tokenAmount: stakedLiquidityAmount,
3794
+ currencyAmount: {
3795
+ currency: 'USD',
3796
+ amount: totalStakeValuation.toFixed(DECIMAL_PRECISION)
3797
+ }
3798
+ },
3799
+ APYs: APYs
3800
+ });
3801
+
3802
+ case 13:
3803
+ case "end":
3804
+ return _context.stop();
3805
+ }
3806
+ }
3807
+ }, _callee, this);
3808
+ }));
3809
+
3810
+ function getPLYWNEARPoolDetails() {
3811
+ return _getPLYWNEARPoolDetails.apply(this, arguments);
3812
+ }
3813
+
3814
+ return getPLYWNEARPoolDetails;
3815
+ }();
3816
+
3817
+ _proto.stakeBalanceOf = /*#__PURE__*/function () {
3818
+ var _stakeBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(user) {
3819
+ var userInfo, stakeAmount;
3820
+ return runtime_1.wrap(function _callee2$(_context2) {
3821
+ while (1) {
3822
+ switch (_context2.prev = _context2.next) {
3823
+ case 0:
3824
+ _context2.next = 2;
3825
+ return this._auriFairLaunch.getUserInfo(PLYWNEAR_POOL_ID, user);
3826
+
3827
+ case 2:
3828
+ userInfo = _context2.sent;
3829
+ stakeAmount = new TokenAmount(PLYWNEARToken, userInfo.amount.toString());
3830
+ return _context2.abrupt("return", valuateToken(stakeAmount, this._networkConnection.provider));
3831
+
3832
+ case 5:
3833
+ case "end":
3834
+ return _context2.stop();
3835
+ }
3836
+ }
3837
+ }, _callee2, this);
3838
+ }));
3839
+
3840
+ function stakeBalanceOf(_x) {
3841
+ return _stakeBalanceOf.apply(this, arguments);
3842
+ }
3843
+
3844
+ return stakeBalanceOf;
3845
+ }();
3846
+
3847
+ _proto.LpBalanceOf = /*#__PURE__*/function () {
3848
+ var _LpBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(user) {
3849
+ var lpContract, balance;
3850
+ return runtime_1.wrap(function _callee3$(_context3) {
3851
+ while (1) {
3852
+ switch (_context3.prev = _context3.next) {
3853
+ case 0:
3854
+ lpContract = new ethers.Contract(networkAddresses.tokens.PLYWNEAR, EIP20InterfaceABI.abi, this._networkConnection.provider);
3855
+ _context3.next = 3;
3856
+ return lpContract.balanceOf(user);
3857
+
3858
+ case 3:
3859
+ balance = _context3.sent;
3860
+ return _context3.abrupt("return", valuateToken(new TokenAmount(PLYWNEARToken, balance.toString()), this._networkConnection.provider));
3861
+
3862
+ case 5:
3863
+ case "end":
3864
+ return _context3.stop();
3865
+ }
3866
+ }
3867
+ }, _callee3, this);
3868
+ }));
3869
+
3870
+ function LpBalanceOf(_x2) {
3871
+ return _LpBalanceOf.apply(this, arguments);
3872
+ }
3873
+
3874
+ return LpBalanceOf;
3875
+ }();
3876
+
3877
+ _proto.unclaimedRewardsOf = /*#__PURE__*/function () {
3878
+ var _unclaimedRewardsOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(user) {
3879
+ var userInfo, rewards;
3880
+ return runtime_1.wrap(function _callee4$(_context4) {
3881
+ while (1) {
3882
+ switch (_context4.prev = _context4.next) {
3883
+ case 0:
3884
+ _context4.next = 2;
3885
+ return this._auriFairLaunch.callStatic.updateAndGetUserInfo(PLYWNEAR_POOL_ID, user, {
3886
+ from: user
3887
+ });
3888
+
3889
+ case 2:
3890
+ userInfo = _context4.sent;
3891
+ rewards = userInfo.unclaimedRewards;
3892
+ return _context4.abrupt("return", rewards.map(function (reward, i) {
3893
+ return TokenAmount.fromAddressAndAmount(PLYWNEAR_REWARD_TOKENS[i], reward.toString());
3894
+ }));
3895
+
3896
+ case 5:
3897
+ case "end":
3898
+ return _context4.stop();
3899
+ }
3900
+ }
3901
+ }, _callee4, this);
3902
+ }));
3903
+
3904
+ function unclaimedRewardsOf(_x3) {
3905
+ return _unclaimedRewardsOf.apply(this, arguments);
3906
+ }
3907
+
3908
+ return unclaimedRewardsOf;
3909
+ }();
3910
+
3911
+ return StakingRead;
3912
+ }(BlockchainEntityRead);
3913
+ var StakingReadWrite = /*#__PURE__*/function (_StakingRead) {
3914
+ _inheritsLoose(StakingReadWrite, _StakingRead);
3915
+
3916
+ function StakingReadWrite() {
3917
+ return _StakingRead.apply(this, arguments) || this;
3918
+ }
3919
+
3920
+ var _proto2 = StakingReadWrite.prototype;
3921
+
3922
+ _proto2.stake = /*#__PURE__*/function () {
3923
+ var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(amount) {
3924
+ return runtime_1.wrap(function _callee5$(_context5) {
3925
+ while (1) {
3926
+ switch (_context5.prev = _context5.next) {
3927
+ case 0:
3928
+ return _context5.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).deposit(PLYWNEAR_POOL_ID, amount.rawAmount()));
3929
+
3930
+ case 1:
3931
+ case "end":
3932
+ return _context5.stop();
3933
+ }
3934
+ }
3935
+ }, _callee5, this);
3936
+ }));
3937
+
3938
+ function stake(_x4) {
3939
+ return _stake.apply(this, arguments);
3940
+ }
3941
+
3942
+ return stake;
3943
+ }();
3944
+
3945
+ _proto2.unstake = /*#__PURE__*/function () {
3946
+ var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(amount) {
3947
+ return runtime_1.wrap(function _callee6$(_context6) {
3948
+ while (1) {
3949
+ switch (_context6.prev = _context6.next) {
3950
+ case 0:
3951
+ return _context6.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).withdraw(PLYWNEAR_POOL_ID, amount.rawAmount()));
3952
+
3953
+ case 1:
3954
+ case "end":
3955
+ return _context6.stop();
3956
+ }
3957
+ }
3958
+ }, _callee6, this);
3959
+ }));
3960
+
3961
+ function unstake(_x5) {
3962
+ return _unstake.apply(this, arguments);
3963
+ }
3964
+
3965
+ return unstake;
3966
+ }();
3967
+
3968
+ return StakingReadWrite;
3969
+ }(StakingRead);
3970
+
3673
3971
  var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3674
3972
  _inheritsLoose(SdkRead, _BlockchainEntityRead);
3675
3973
 
@@ -3828,53 +4126,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3828
4126
 
3829
4127
  _proto.getPLYWNEARPoolDetails = /*#__PURE__*/function () {
3830
4128
  var _getPLYWNEARPoolDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
3831
- var stakedLiquidity, rewardPerSeconds, stakedLiquidityAmount, promises, _i, rewardTokenAddress, rewardToken, rewardPerSecond, rewardPerSecondValuation, totalStakeValuation;
3832
-
3833
4129
  return runtime_1.wrap(function _callee2$(_context2) {
3834
4130
  while (1) {
3835
4131
  switch (_context2.prev = _context2.next) {
3836
4132
  case 0:
3837
- _context2.next = 2;
3838
- return this._auriFairLaunch.getPoolInfo(PLYWNEAR_POOL_ID).then(function (res) {
3839
- stakedLiquidity = res.totalStake;
3840
- rewardPerSeconds = res.rewardPerSeconds;
3841
- });
3842
-
3843
- case 2:
3844
- stakedLiquidityAmount = new TokenAmount(PLYWNEARToken, stakedLiquidity.toString());
3845
- promises = [];
3846
-
3847
- for (_i = 0; _i < rewardPerSeconds.length; _i++) {
3848
- rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[_i];
3849
- rewardToken = new Token(rewardTokenAddress, getDecimal(rewardTokenAddress));
3850
- rewardPerSecond = rewardPerSeconds[_i];
3851
- promises.push(fetchValuation(new TokenAmount(rewardToken, rewardPerSecond.toString()), this._networkConnection.provider));
3852
- }
3853
-
3854
- _context2.next = 7;
3855
- return Promise.all(promises);
3856
-
3857
- case 7:
3858
- rewardPerSecondValuation = _context2.sent.reduce(function (p, v) {
3859
- return p.plus(v);
3860
- }, new BigNumber(0));
3861
- _context2.next = 10;
3862
- return fetchValuation(stakedLiquidityAmount, this._networkConnection.provider);
3863
-
3864
- case 10:
3865
- totalStakeValuation = _context2.sent;
3866
- return _context2.abrupt("return", {
3867
- totalStakedLiquidity: {
3868
- tokenAmount: stakedLiquidityAmount,
3869
- currencyAmount: {
3870
- currency: 'USD',
3871
- amount: totalStakeValuation.toFixed(DECIMAL_PRECISION)
3872
- }
3873
- },
3874
- apy: calcLMRewardApr(rewardPerSecondValuation, totalStakeValuation, ONE_DAY * 365).toFixed(DECIMAL_PRECISION)
3875
- });
4133
+ return _context2.abrupt("return", new StakingRead(this._networkConnection).getPLYWNEARPoolDetails());
3876
4134
 
3877
- case 12:
4135
+ case 1:
3878
4136
  case "end":
3879
4137
  return _context2.stop();
3880
4138
  }
@@ -3923,20 +4181,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3923
4181
 
3924
4182
  _proto.stakeBalanceOf = /*#__PURE__*/function () {
3925
4183
  var _stakeBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(user) {
3926
- var userInfo, stakeAmount;
3927
4184
  return runtime_1.wrap(function _callee4$(_context4) {
3928
4185
  while (1) {
3929
4186
  switch (_context4.prev = _context4.next) {
3930
4187
  case 0:
3931
- _context4.next = 2;
3932
- return this._auriFairLaunch.getUserInfo(PLYWNEAR_POOL_ID, user);
4188
+ return _context4.abrupt("return", new StakingRead(this._networkConnection).stakeBalanceOf(user));
3933
4189
 
3934
- case 2:
3935
- userInfo = _context4.sent;
3936
- stakeAmount = new TokenAmount(PLYWNEARToken, userInfo.amount.toString());
3937
- return _context4.abrupt("return", valuateToken(stakeAmount, this._networkConnection.provider));
3938
-
3939
- case 5:
4190
+ case 1:
3940
4191
  case "end":
3941
4192
  return _context4.stop();
3942
4193
  }
@@ -3953,20 +4204,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3953
4204
 
3954
4205
  _proto.LpBalanceOf = /*#__PURE__*/function () {
3955
4206
  var _LpBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(user) {
3956
- var lpContract, balance;
3957
4207
  return runtime_1.wrap(function _callee5$(_context5) {
3958
4208
  while (1) {
3959
4209
  switch (_context5.prev = _context5.next) {
3960
4210
  case 0:
3961
- lpContract = new ethers.Contract(networkAddresses.tokens.PLYWNEAR, EIP20InterfaceABI.abi, this._networkConnection.provider);
3962
- _context5.next = 3;
3963
- return lpContract.balanceOf(user);
3964
-
3965
- case 3:
3966
- balance = _context5.sent;
3967
- return _context5.abrupt("return", valuateToken(new TokenAmount(PLYWNEARToken, balance.toString()), this._networkConnection.provider));
4211
+ return _context5.abrupt("return", new StakingRead(this._networkConnection).LpBalanceOf(user));
3968
4212
 
3969
- case 5:
4213
+ case 1:
3970
4214
  case "end":
3971
4215
  return _context5.stop();
3972
4216
  }
@@ -3981,6 +4225,29 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3981
4225
  return LpBalanceOf;
3982
4226
  }();
3983
4227
 
4228
+ _proto.unclaimedRewardsOf = /*#__PURE__*/function () {
4229
+ var _unclaimedRewardsOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(user) {
4230
+ return runtime_1.wrap(function _callee6$(_context6) {
4231
+ while (1) {
4232
+ switch (_context6.prev = _context6.next) {
4233
+ case 0:
4234
+ return _context6.abrupt("return", new StakingRead(this._networkConnection).unclaimedRewardsOf(user));
4235
+
4236
+ case 1:
4237
+ case "end":
4238
+ return _context6.stop();
4239
+ }
4240
+ }
4241
+ }, _callee6, this);
4242
+ }));
4243
+
4244
+ function unclaimedRewardsOf(_x5) {
4245
+ return _unclaimedRewardsOf.apply(this, arguments);
4246
+ }
4247
+
4248
+ return unclaimedRewardsOf;
4249
+ }();
4250
+
3984
4251
  _proto.calcHypotheticalStats = function calcHypotheticalStats(_ref) {
3985
4252
  var userMarketDetail = _ref.userMarketDetail,
3986
4253
  currentBorrowLimit = _ref.currentBorrowLimit,
@@ -4031,19 +4298,19 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4031
4298
  var _proto2 = SdkReadWrite.prototype;
4032
4299
 
4033
4300
  _proto2.claim = /*#__PURE__*/function () {
4034
- var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
4035
- return runtime_1.wrap(function _callee6$(_context6) {
4301
+ var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
4302
+ return runtime_1.wrap(function _callee7$(_context7) {
4036
4303
  while (1) {
4037
- switch (_context6.prev = _context6.next) {
4304
+ switch (_context7.prev = _context7.next) {
4038
4305
  case 0:
4039
- return _context6.abrupt("return", this._auriLens.connect(this._networkConnection.signer).claimRewards(this._comptroller.address, this._auriFairLaunch.address, ALL_STAKING_POOLS));
4306
+ return _context7.abrupt("return", this._auriLens.connect(this._networkConnection.signer).claimRewards(this._comptroller.address, this._auriFairLaunch.address, ALL_STAKING_POOLS));
4040
4307
 
4041
4308
  case 1:
4042
4309
  case "end":
4043
- return _context6.stop();
4310
+ return _context7.stop();
4044
4311
  }
4045
4312
  }
4046
- }, _callee6, this);
4313
+ }, _callee7, this);
4047
4314
  }));
4048
4315
 
4049
4316
  function claim() {
@@ -4054,22 +4321,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4054
4321
  }();
4055
4322
 
4056
4323
  _proto2.stake = /*#__PURE__*/function () {
4057
- var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(amount) {
4058
- return runtime_1.wrap(function _callee7$(_context7) {
4324
+ var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
4325
+ return runtime_1.wrap(function _callee8$(_context8) {
4059
4326
  while (1) {
4060
- switch (_context7.prev = _context7.next) {
4327
+ switch (_context8.prev = _context8.next) {
4061
4328
  case 0:
4062
- return _context7.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).deposit(PLYWNEAR_POOL_ID, amount.rawAmount()));
4329
+ return _context8.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
4063
4330
 
4064
4331
  case 1:
4065
4332
  case "end":
4066
- return _context7.stop();
4333
+ return _context8.stop();
4067
4334
  }
4068
4335
  }
4069
- }, _callee7, this);
4336
+ }, _callee8, this);
4070
4337
  }));
4071
4338
 
4072
- function stake(_x5) {
4339
+ function stake(_x6) {
4073
4340
  return _stake.apply(this, arguments);
4074
4341
  }
4075
4342
 
@@ -4077,22 +4344,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4077
4344
  }();
4078
4345
 
4079
4346
  _proto2.unstake = /*#__PURE__*/function () {
4080
- var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
4081
- return runtime_1.wrap(function _callee8$(_context8) {
4347
+ var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(amount) {
4348
+ return runtime_1.wrap(function _callee9$(_context9) {
4082
4349
  while (1) {
4083
- switch (_context8.prev = _context8.next) {
4350
+ switch (_context9.prev = _context9.next) {
4084
4351
  case 0:
4085
- return _context8.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).withdraw(PLYWNEAR_POOL_ID, amount.rawAmount()));
4352
+ return _context9.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
4086
4353
 
4087
4354
  case 1:
4088
4355
  case "end":
4089
- return _context8.stop();
4356
+ return _context9.stop();
4090
4357
  }
4091
4358
  }
4092
- }, _callee8, this);
4359
+ }, _callee9, this);
4093
4360
  }));
4094
4361
 
4095
- function unstake(_x6) {
4362
+ function unstake(_x7) {
4096
4363
  return _unstake.apply(this, arguments);
4097
4364
  }
4098
4365
 
@@ -4100,21 +4367,21 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4100
4367
  }();
4101
4368
 
4102
4369
  _proto2.faucetDrip = /*#__PURE__*/function () {
4103
- var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
4370
+ var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
4104
4371
  var faucet;
4105
- return runtime_1.wrap(function _callee9$(_context9) {
4372
+ return runtime_1.wrap(function _callee10$(_context10) {
4106
4373
  while (1) {
4107
- switch (_context9.prev = _context9.next) {
4374
+ switch (_context10.prev = _context10.next) {
4108
4375
  case 0:
4109
4376
  faucet = new ethers.Contract(networkAddresses.misc.FAUCET, FaucetABI.abi, this._networkConnection.provider);
4110
- return _context9.abrupt("return", faucet.connect(this._networkConnection.signer).drip());
4377
+ return _context10.abrupt("return", faucet.connect(this._networkConnection.signer).drip());
4111
4378
 
4112
4379
  case 2:
4113
4380
  case "end":
4114
- return _context9.stop();
4381
+ return _context10.stop();
4115
4382
  }
4116
4383
  }
4117
- }, _callee9, this);
4384
+ }, _callee10, this);
4118
4385
  }));
4119
4386
 
4120
4387
  function faucetDrip() {
@@ -107409,6 +107676,7 @@ exports.fetchPriceFromCoingecko = fetchPriceFromCoingecko;
107409
107676
  exports.fetchPriceFromCoingeckoAPI = fetchPriceFromCoingeckoAPI;
107410
107677
  exports.fetchPriceFromOracle = fetchPriceFromOracle;
107411
107678
  exports.fetchStNEARPrice = fetchStNEARPrice;
107679
+ exports.fetchToken0PriceByLP = fetchToken0PriceByLP;
107412
107680
  exports.fetchUnderlyingTokensPrices = fetchUnderlyingTokensPrices;
107413
107681
  exports.fetchValuation = fetchValuation;
107414
107682
  exports.formatObject = formatObject;