@aurigami/sdk 1.1.4 → 1.1.6

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
@@ -961,6 +961,8 @@ var networkAddresses = {
961
961
  AURORA: /*#__PURE__*/"0x8bec47865ade3b172a928df8f990bc7f2a3b9f79".toLowerCase(),
962
962
  PLY: /*#__PURE__*/"0x981bD5832EAB9C8F607940E0e9faCBf8C09ee20a".toLowerCase(),
963
963
  stNEAR: /*#__PURE__*/"0x07f9f7f963c5cd2bbffd30ccfb964be114332e30".toLowerCase(),
964
+ USDC: /*#__PURE__*/'0xb12bfca5a55806aaf64e99521918a4bf0fc40802'.toLowerCase(),
965
+ WNEAR: /*#__PURE__*/'0xC42C30aC6Cc15faC9bD938618BcaA1a1FaE8501d'.toLowerCase(),
964
966
  AURPLY: /*#__PURE__*/dummyAddress.toLowerCase()
965
967
  }
966
968
  };
@@ -973,22 +975,22 @@ var INF = /*#__PURE__*/BigNumber$1.from(2).pow(256).sub(1);
973
975
 
974
976
  var decimalRecords = {
975
977
  '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee': 18,
978
+ '0xcfb6b0498cb7555e7e21502e0f449bf28760adbb': 8,
979
+ '0x8888682e24dd4df7b7ff2b91fccb575737e433bf': 8,
980
+ '0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d': 24,
976
981
  '0x07f9f7f963c5cd2bbffd30ccfb964be114332e30': 24,
982
+ '0xad5a2437ff55ed7a8cad3b797b3ec7c5a19b1c54': 8,
983
+ '0xe3520349f477a5f6eb06107066048508498a291b': 18,
984
+ '0x981bd5832eab9c8f607940e0e9facbf8c09ee20a': 18,
977
985
  '0xae4fac24dcdae0132c6d04f564dcf059616e9423': 8,
978
- '0xb12bfca5a55806aaf64e99521918a4bf0fc40802': 6,
979
- '0xca9511b610ba5fc7e311fdef9ce16050ee4449e9': 8,
980
986
  '0xce4166363e3a584dac84a47bcd3414b43efcdd1c': 8,
981
- '0x8888682e24dd4df7b7ff2b91fccb575737e433bf': 8,
987
+ '0xca9511b610ba5fc7e311fdef9ce16050ee4449e9': 8,
988
+ '0x3195949f267702723bc614cae037cdc8d1e94786': 8,
989
+ '0x4f0d864b1abf4b701799a0b30b57a22dfeb5917b': 8,
982
990
  '0x8bec47865ade3b172a928df8f990bc7f2a3b9f79': 18,
991
+ '0xb12bfca5a55806aaf64e99521918a4bf0fc40802': 6,
983
992
  '0x4988a896b1227218e4a686fde5eabdcabd91571f': 6,
984
- '0xe3520349f477a5f6eb06107066048508498a291b': 18,
985
- '0x4f0d864b1abf4b701799a0b30b57a22dfeb5917b': 8,
986
- '0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d': 24,
987
- '0xcfb6b0498cb7555e7e21502e0f449bf28760adbb': 8,
988
- '0xad5a2437ff55ed7a8cad3b797b3ec7c5a19b1c54': 8,
989
- '0xf4eb217ba2454613b15dbdea6e5f22276410e89e': 8,
990
- '0x3195949f267702723bc614cae037cdc8d1e94786': 8,
991
- '0x981bd5832eab9c8f607940e0e9facbf8c09ee20a': 18
993
+ '0xf4eb217ba2454613b15dbdea6e5f22276410e89e': 8
992
994
  };
993
995
 
994
996
  function formatObject(object) {
@@ -2668,7 +2670,7 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2668
2670
 
2669
2671
  _proto.getDetails = /*#__PURE__*/function () {
2670
2672
  var _getDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
2671
- var promises, totalDeposited, totalBorrowed, depositAPY, borrowAPY, collateralRatio, plyPrice, underlyingPrice, rewardSpeeds, borrowPlyApy, depositPlyApy;
2673
+ var promises, totalDeposited, totalBorrowed, depositAPY, borrowAPY, collateralRatio, plyPrice, underlyingPrice, rewardSpeeds, borrowPlyApy, depositPlyApy, depositNEARApy, borrowNEARApy, depositMETAApy;
2672
2674
  return runtime_1.wrap(function _callee9$(_context9) {
2673
2675
  while (1) {
2674
2676
  switch (_context9.prev = _context9.next) {
@@ -2704,6 +2706,29 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2704
2706
  case 11:
2705
2707
  borrowPlyApy = calcLMRewardApr(calcValuation(new TokenAmount(PLYToken, rewardSpeeds.plyRewardBorrowSpeed.toString()), plyPrice), underlyingPrice.multipliedBy(totalBorrowed.formattedAmount()), ONE_YEAR);
2706
2708
  depositPlyApy = calcLMRewardApr(calcValuation(new TokenAmount(PLYToken, rewardSpeeds.plyRewardSupplySpeed.toString()), plyPrice), underlyingPrice.multipliedBy(totalDeposited.formattedAmount()), ONE_YEAR);
2709
+ _context9.t0 = calcLMRewardApr;
2710
+ _context9.next = 16;
2711
+ return fetchValuation(this.getDepositNEARRewardPerWeek(), this._networkConnection.provider);
2712
+
2713
+ case 16:
2714
+ _context9.t1 = _context9.sent;
2715
+ _context9.t2 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
2716
+ depositNEARApy = (0, _context9.t0)(_context9.t1, _context9.t2, 52);
2717
+ _context9.t3 = calcLMRewardApr;
2718
+ _context9.next = 22;
2719
+ return fetchValuation(this.getBorrowNEARRewardPerWeek(), this._networkConnection.provider);
2720
+
2721
+ case 22:
2722
+ _context9.t4 = _context9.sent;
2723
+ _context9.t5 = underlyingPrice.multipliedBy(totalBorrowed.formattedAmount());
2724
+ borrowNEARApy = (0, _context9.t3)(_context9.t4, _context9.t5, 52);
2725
+
2726
+ if (isSameAddress(this.underlying.address, networkAddresses.tokens.stNEAR)) {
2727
+ depositMETAApy = calcLMRewardApr(new BigNumber(50000), underlyingPrice.multipliedBy(totalDeposited.formattedAmount()), 12);
2728
+ } else {
2729
+ depositMETAApy = new BigNumber(0);
2730
+ }
2731
+
2707
2732
  return _context9.abrupt("return", {
2708
2733
  auTokenAddress: this.auToken.address,
2709
2734
  totalTokenDeposited: totalDeposited,
@@ -2714,10 +2739,13 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2714
2739
  borrowPlyApy: borrowPlyApy.toNumber(),
2715
2740
  collateralRatio: collateralRatio,
2716
2741
  depositPlyPerWeek: new TokenAmount(PLYToken, rewardSpeeds.plyRewardSupplySpeed.mul(ONE_DAY).mul(7).toString()),
2717
- borrowPlyPerWeek: new TokenAmount(PLYToken, rewardSpeeds.plyRewardBorrowSpeed.mul(ONE_DAY).mul(7).toString())
2742
+ borrowPlyPerWeek: new TokenAmount(PLYToken, rewardSpeeds.plyRewardBorrowSpeed.mul(ONE_DAY).mul(7).toString()),
2743
+ depositNEARApy: depositNEARApy.toNumber(),
2744
+ borrowNEARApy: borrowNEARApy.toNumber(),
2745
+ depositMETAApy: depositMETAApy.toNumber()
2718
2746
  });
2719
2747
 
2720
- case 14:
2748
+ case 27:
2721
2749
  case "end":
2722
2750
  return _context9.stop();
2723
2751
  }
@@ -2790,6 +2818,26 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2790
2818
  return getUserDepositBalance;
2791
2819
  }();
2792
2820
 
2821
+ _proto.getDepositNEARRewardPerWeek = function getDepositNEARRewardPerWeek() {
2822
+ var NEARToken = new Token(networkAddresses.tokens.WNEAR, getDecimal(networkAddresses.tokens.WNEAR));
2823
+
2824
+ if (isSameAddress(this.underlying.address, networkAddresses.tokens.USDC)) {
2825
+ return new TokenAmount(NEARToken, "5000", false);
2826
+ } else {
2827
+ return new TokenAmount(NEARToken, "0");
2828
+ }
2829
+ };
2830
+
2831
+ _proto.getBorrowNEARRewardPerWeek = function getBorrowNEARRewardPerWeek() {
2832
+ var NEARToken = new Token(networkAddresses.tokens.WNEAR, getDecimal(networkAddresses.tokens.WNEAR));
2833
+
2834
+ if (isSameAddress(this.underlying.address, networkAddresses.tokens.USDC)) {
2835
+ return new TokenAmount(NEARToken, "15000", false);
2836
+ } else {
2837
+ return new TokenAmount(NEARToken, "0");
2838
+ }
2839
+ };
2840
+
2793
2841
  return MoneyMarketRead;
2794
2842
  }(BlockchainEntityRead);
2795
2843
  var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {