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