@aurigami/sdk 1.20.7 → 1.20.8

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.
@@ -2922,38 +2922,15 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2922
2922
  }();
2923
2923
  _proto.getDepositMetaAPY = /*#__PURE__*/function () {
2924
2924
  var _getDepositMetaAPY = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
2925
- var _yield$Promise$all6, totalDeposited, underlyingPrice, depositMETAApy;
2926
2925
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
2927
2926
  while (1) switch (_context13.prev = _context13.next) {
2928
2927
  case 0:
2929
- _context13.next = 2;
2930
- return Promise.all([this.getTotalTokenDeposited(), fetchPrice(this.underlying.address, this._networkConnection.provider)]);
2931
- case 2:
2932
- _yield$Promise$all6 = _context13.sent;
2933
- totalDeposited = _yield$Promise$all6[0];
2934
- underlyingPrice = _yield$Promise$all6[1];
2935
- if (!isSameAddress(this.underlying.address, networkAddresses.tokens.stNEAR)) {
2936
- _context13.next = 14;
2937
- break;
2938
- }
2939
- _context13.t0 = helpers;
2940
- _context13.next = 9;
2941
- return fetchValuation(TokenAmount.fromAddressAndAmount(networkAddresses.tokens.META, '250000', false), this._networkConnection.provider);
2942
- case 9:
2943
- _context13.t1 = _context13.sent;
2944
- _context13.t2 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
2945
- depositMETAApy = _context13.t0.calcLMRewardApr.call(_context13.t0, _context13.t1, _context13.t2, 12);
2946
- _context13.next = 15;
2947
- break;
2948
- case 14:
2949
- depositMETAApy = new BigNumber(0);
2950
- case 15:
2951
- return _context13.abrupt("return", depositMETAApy);
2952
- case 16:
2928
+ return _context13.abrupt("return", new BigNumber(0));
2929
+ case 1:
2953
2930
  case "end":
2954
2931
  return _context13.stop();
2955
2932
  }
2956
- }, _callee13, this);
2933
+ }, _callee13);
2957
2934
  }));
2958
2935
  function getDepositMetaAPY() {
2959
2936
  return _getDepositMetaAPY.apply(this, arguments);
@@ -2979,30 +2956,30 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2979
2956
  }();
2980
2957
  _proto.getDetails = /*#__PURE__*/function () {
2981
2958
  var _getDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
2982
- var _yield$Promise$all7, totalDeposited, totalBorrowed, depositAPY, borrowAPY, collateralRatio, rewardSpeeds, _yield$Promise$all8, depositPlyAPY, borrowPlyAPY, depositNearAPY, borrowNearAPY, depositMetaAPY, staderDepositApy;
2959
+ var _yield$Promise$all6, totalDeposited, totalBorrowed, depositAPY, borrowAPY, collateralRatio, rewardSpeeds, _yield$Promise$all7, depositPlyAPY, borrowPlyAPY, depositNearAPY, borrowNearAPY, depositMetaAPY, staderDepositApy;
2983
2960
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
2984
2961
  while (1) switch (_context15.prev = _context15.next) {
2985
2962
  case 0:
2986
2963
  _context15.next = 2;
2987
2964
  return Promise.all([this.getTotalTokenDeposited(), this.getTotalTokenBorrowed(), this.getDepositAPY(), this.getBorrowAPY(), this.getCollateralRatio(), this.getRewardSpeeds()]);
2988
2965
  case 2:
2989
- _yield$Promise$all7 = _context15.sent;
2990
- totalDeposited = _yield$Promise$all7[0];
2991
- totalBorrowed = _yield$Promise$all7[1];
2992
- depositAPY = _yield$Promise$all7[2];
2993
- borrowAPY = _yield$Promise$all7[3];
2994
- collateralRatio = _yield$Promise$all7[4];
2995
- rewardSpeeds = _yield$Promise$all7[5];
2966
+ _yield$Promise$all6 = _context15.sent;
2967
+ totalDeposited = _yield$Promise$all6[0];
2968
+ totalBorrowed = _yield$Promise$all6[1];
2969
+ depositAPY = _yield$Promise$all6[2];
2970
+ borrowAPY = _yield$Promise$all6[3];
2971
+ collateralRatio = _yield$Promise$all6[4];
2972
+ rewardSpeeds = _yield$Promise$all6[5];
2996
2973
  _context15.next = 11;
2997
2974
  return Promise.all([this.getDepositPlyAPY(), this.getBorrowPlyAPY(), this.getDepositNearAPY(), this.getBorrowNearAPY(), this.getDepositMetaAPY(), this.getDepositStaderAPY()]);
2998
2975
  case 11:
2999
- _yield$Promise$all8 = _context15.sent;
3000
- depositPlyAPY = _yield$Promise$all8[0];
3001
- borrowPlyAPY = _yield$Promise$all8[1];
3002
- depositNearAPY = _yield$Promise$all8[2];
3003
- borrowNearAPY = _yield$Promise$all8[3];
3004
- depositMetaAPY = _yield$Promise$all8[4];
3005
- staderDepositApy = _yield$Promise$all8[5];
2976
+ _yield$Promise$all7 = _context15.sent;
2977
+ depositPlyAPY = _yield$Promise$all7[0];
2978
+ borrowPlyAPY = _yield$Promise$all7[1];
2979
+ depositNearAPY = _yield$Promise$all7[2];
2980
+ borrowNearAPY = _yield$Promise$all7[3];
2981
+ depositMetaAPY = _yield$Promise$all7[4];
2982
+ staderDepositApy = _yield$Promise$all7[5];
3006
2983
  return _context15.abrupt("return", {
3007
2984
  auTokenAddress: this.auToken.address,
3008
2985
  totalTokenDeposited: totalDeposited,
@@ -3148,17 +3125,17 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3148
3125
  }();
3149
3126
  _proto.getDepositBorrowValue = /*#__PURE__*/function () {
3150
3127
  var _getDepositBorrowValue = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(userAddress) {
3151
- var _yield$Promise$all9, price, depositBalance, borrowBalance, suppliedValue, borrowedValue;
3128
+ var _yield$Promise$all8, price, depositBalance, borrowBalance, suppliedValue, borrowedValue;
3152
3129
  return _regeneratorRuntime().wrap(function _callee20$(_context20) {
3153
3130
  while (1) switch (_context20.prev = _context20.next) {
3154
3131
  case 0:
3155
3132
  _context20.next = 2;
3156
3133
  return Promise.all([this.getUnderlyingPrice(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress)]);
3157
3134
  case 2:
3158
- _yield$Promise$all9 = _context20.sent;
3159
- price = _yield$Promise$all9[0];
3160
- depositBalance = _yield$Promise$all9[1];
3161
- borrowBalance = _yield$Promise$all9[2];
3135
+ _yield$Promise$all8 = _context20.sent;
3136
+ price = _yield$Promise$all8[0];
3137
+ depositBalance = _yield$Promise$all8[1];
3138
+ borrowBalance = _yield$Promise$all8[2];
3162
3139
  suppliedValue = price.multipliedBy(depositBalance.formattedAmount());
3163
3140
  borrowedValue = price.multipliedBy(borrowBalance.formattedAmount());
3164
3141
  return _context20.abrupt("return", {
@@ -3178,19 +3155,19 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3178
3155
  }();
3179
3156
  _proto.getApyWithoutIncentive = /*#__PURE__*/function () {
3180
3157
  var _getApyWithoutIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(userAddress) {
3181
- var _yield$Promise$all10, price, depositApy, borrowApy, depositBalance, borrowBalance, suppliedValue, borrowedValue, sum;
3158
+ var _yield$Promise$all9, price, depositApy, borrowApy, depositBalance, borrowBalance, suppliedValue, borrowedValue, sum;
3182
3159
  return _regeneratorRuntime().wrap(function _callee21$(_context21) {
3183
3160
  while (1) switch (_context21.prev = _context21.next) {
3184
3161
  case 0:
3185
3162
  _context21.next = 2;
3186
3163
  return Promise.all([this.getUnderlyingPrice(), this.getDepositAPY(), this.getBorrowAPY(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress)]);
3187
3164
  case 2:
3188
- _yield$Promise$all10 = _context21.sent;
3189
- price = _yield$Promise$all10[0];
3190
- depositApy = _yield$Promise$all10[1];
3191
- borrowApy = _yield$Promise$all10[2];
3192
- depositBalance = _yield$Promise$all10[3];
3193
- borrowBalance = _yield$Promise$all10[4];
3165
+ _yield$Promise$all9 = _context21.sent;
3166
+ price = _yield$Promise$all9[0];
3167
+ depositApy = _yield$Promise$all9[1];
3168
+ borrowApy = _yield$Promise$all9[2];
3169
+ depositBalance = _yield$Promise$all9[3];
3170
+ borrowBalance = _yield$Promise$all9[4];
3194
3171
  suppliedValue = price.multipliedBy(depositBalance.formattedAmount());
3195
3172
  borrowedValue = price.multipliedBy(borrowBalance.formattedAmount());
3196
3173
  sum = calcNetApy(suppliedValue, depositApy, borrowedValue, borrowApy);
@@ -3212,24 +3189,24 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3212
3189
  }();
3213
3190
  _proto.getApyWithIncentive = /*#__PURE__*/function () {
3214
3191
  var _getApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(userAddress) {
3215
- var _yield$Promise$all11, price, depositApy, borrowApy, depositBalance, borrowBalance, nearDepositApy, plyDepositApy, metaDepositApy, nearBorrowApy, plyBorrowApy, staderDepositApy, suppliedValue, borrowedValue, totalDepositApy, totalBorrowApy, sum;
3192
+ var _yield$Promise$all10, price, depositApy, borrowApy, depositBalance, borrowBalance, nearDepositApy, plyDepositApy, metaDepositApy, nearBorrowApy, plyBorrowApy, staderDepositApy, suppliedValue, borrowedValue, totalDepositApy, totalBorrowApy, sum;
3216
3193
  return _regeneratorRuntime().wrap(function _callee22$(_context22) {
3217
3194
  while (1) switch (_context22.prev = _context22.next) {
3218
3195
  case 0:
3219
3196
  _context22.next = 2;
3220
3197
  return Promise.all([this.getUnderlyingPrice(), this.getDepositAPY(), this.getBorrowAPY(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress), this.getDepositNearAPY(), this.getDepositPlyAPY(), this.getDepositMetaAPY(), this.getBorrowNearAPY(), this.getBorrowPlyAPY()]);
3221
3198
  case 2:
3222
- _yield$Promise$all11 = _context22.sent;
3223
- price = _yield$Promise$all11[0];
3224
- depositApy = _yield$Promise$all11[1];
3225
- borrowApy = _yield$Promise$all11[2];
3226
- depositBalance = _yield$Promise$all11[3];
3227
- borrowBalance = _yield$Promise$all11[4];
3228
- nearDepositApy = _yield$Promise$all11[5];
3229
- plyDepositApy = _yield$Promise$all11[6];
3230
- metaDepositApy = _yield$Promise$all11[7];
3231
- nearBorrowApy = _yield$Promise$all11[8];
3232
- plyBorrowApy = _yield$Promise$all11[9];
3199
+ _yield$Promise$all10 = _context22.sent;
3200
+ price = _yield$Promise$all10[0];
3201
+ depositApy = _yield$Promise$all10[1];
3202
+ borrowApy = _yield$Promise$all10[2];
3203
+ depositBalance = _yield$Promise$all10[3];
3204
+ borrowBalance = _yield$Promise$all10[4];
3205
+ nearDepositApy = _yield$Promise$all10[5];
3206
+ plyDepositApy = _yield$Promise$all10[6];
3207
+ metaDepositApy = _yield$Promise$all10[7];
3208
+ nearBorrowApy = _yield$Promise$all10[8];
3209
+ plyBorrowApy = _yield$Promise$all10[9];
3233
3210
  _context22.next = 15;
3234
3211
  return this.getDepositStaderAPY();
3235
3212
  case 15: