@aurigami/sdk 1.19.1 → 1.19.3
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 +4 -0
- package/dist/interactors/MoneyMarket.d.ts +4 -0
- package/dist/interactors/misc.d.ts +4 -0
- package/dist/sdk.cjs.development.js +335 -179
- 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 +335 -179
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/SDK.ts +6 -4
- package/src/interactors/MoneyMarket.ts +14 -0
- package/src/interactors/Staking.ts +13 -5
- package/src/interactors/misc.ts +41 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -3168,48 +3168,44 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3168
3168
|
}
|
|
3169
3169
|
return borrowCap;
|
|
3170
3170
|
}();
|
|
3171
|
-
_proto.
|
|
3172
|
-
var
|
|
3173
|
-
var _yield$Promise$all10, price,
|
|
3171
|
+
_proto.getDepositBorrowValue = /*#__PURE__*/function () {
|
|
3172
|
+
var _getDepositBorrowValue = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(userAddress) {
|
|
3173
|
+
var _yield$Promise$all10, price, depositBalance, borrowBalance, suppliedValue, borrowedValue;
|
|
3174
3174
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
3175
3175
|
while (1) switch (_context20.prev = _context20.next) {
|
|
3176
3176
|
case 0:
|
|
3177
3177
|
_context20.next = 2;
|
|
3178
|
-
return Promise.all([this.getUnderlyingPrice(), this.
|
|
3178
|
+
return Promise.all([this.getUnderlyingPrice(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress)]);
|
|
3179
3179
|
case 2:
|
|
3180
3180
|
_yield$Promise$all10 = _context20.sent;
|
|
3181
3181
|
price = _yield$Promise$all10[0];
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
depositBalance = _yield$Promise$all10[3];
|
|
3185
|
-
borrowBalance = _yield$Promise$all10[4];
|
|
3182
|
+
depositBalance = _yield$Promise$all10[1];
|
|
3183
|
+
borrowBalance = _yield$Promise$all10[2];
|
|
3186
3184
|
suppliedValue = price.multipliedBy(depositBalance.formattedAmount());
|
|
3187
3185
|
borrowedValue = price.multipliedBy(borrowBalance.formattedAmount());
|
|
3188
|
-
sum = calcNetApy(suppliedValue, depositApy, borrowedValue, borrowApy);
|
|
3189
3186
|
return _context20.abrupt("return", {
|
|
3190
|
-
sum: sum,
|
|
3191
3187
|
suppliedValue: suppliedValue,
|
|
3192
3188
|
borrowedValue: borrowedValue
|
|
3193
3189
|
});
|
|
3194
|
-
case
|
|
3190
|
+
case 9:
|
|
3195
3191
|
case "end":
|
|
3196
3192
|
return _context20.stop();
|
|
3197
3193
|
}
|
|
3198
3194
|
}, _callee20, this);
|
|
3199
3195
|
}));
|
|
3200
|
-
function
|
|
3201
|
-
return
|
|
3196
|
+
function getDepositBorrowValue(_x3) {
|
|
3197
|
+
return _getDepositBorrowValue.apply(this, arguments);
|
|
3202
3198
|
}
|
|
3203
|
-
return
|
|
3199
|
+
return getDepositBorrowValue;
|
|
3204
3200
|
}();
|
|
3205
|
-
_proto.
|
|
3206
|
-
var
|
|
3207
|
-
var _yield$Promise$all11, price, depositApy, borrowApy, depositBalance, borrowBalance,
|
|
3201
|
+
_proto.getApyWithoutIncentive = /*#__PURE__*/function () {
|
|
3202
|
+
var _getApyWithoutIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(userAddress) {
|
|
3203
|
+
var _yield$Promise$all11, price, depositApy, borrowApy, depositBalance, borrowBalance, suppliedValue, borrowedValue, sum;
|
|
3208
3204
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
3209
3205
|
while (1) switch (_context21.prev = _context21.next) {
|
|
3210
3206
|
case 0:
|
|
3211
3207
|
_context21.next = 2;
|
|
3212
|
-
return Promise.all([this.getUnderlyingPrice(), this.getDepositAPY(), this.getBorrowAPY(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress)
|
|
3208
|
+
return Promise.all([this.getUnderlyingPrice(), this.getDepositAPY(), this.getBorrowAPY(), this.getUserDepositBalance(userAddress), this.getUserBorrowBalance(userAddress)]);
|
|
3213
3209
|
case 2:
|
|
3214
3210
|
_yield$Promise$all11 = _context21.sent;
|
|
3215
3211
|
price = _yield$Promise$all11[0];
|
|
@@ -3217,32 +3213,66 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3217
3213
|
borrowApy = _yield$Promise$all11[2];
|
|
3218
3214
|
depositBalance = _yield$Promise$all11[3];
|
|
3219
3215
|
borrowBalance = _yield$Promise$all11[4];
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3216
|
+
suppliedValue = price.multipliedBy(depositBalance.formattedAmount());
|
|
3217
|
+
borrowedValue = price.multipliedBy(borrowBalance.formattedAmount());
|
|
3218
|
+
sum = calcNetApy(suppliedValue, depositApy, borrowedValue, borrowApy);
|
|
3219
|
+
return _context21.abrupt("return", {
|
|
3220
|
+
sum: sum,
|
|
3221
|
+
suppliedValue: suppliedValue,
|
|
3222
|
+
borrowedValue: borrowedValue
|
|
3223
|
+
});
|
|
3224
|
+
case 12:
|
|
3225
|
+
case "end":
|
|
3226
|
+
return _context21.stop();
|
|
3227
|
+
}
|
|
3228
|
+
}, _callee21, this);
|
|
3229
|
+
}));
|
|
3230
|
+
function getApyWithoutIncentive(_x4) {
|
|
3231
|
+
return _getApyWithoutIncentive.apply(this, arguments);
|
|
3232
|
+
}
|
|
3233
|
+
return getApyWithoutIncentive;
|
|
3234
|
+
}();
|
|
3235
|
+
_proto.getApyWithIncentive = /*#__PURE__*/function () {
|
|
3236
|
+
var _getApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(userAddress) {
|
|
3237
|
+
var _yield$Promise$all12, price, depositApy, borrowApy, depositBalance, borrowBalance, nearDepositApy, plyDepositApy, metaDepositApy, nearBorrowApy, plyBorrowApy, staderDepositApy, suppliedValue, borrowedValue, totalDepositApy, totalBorrowApy, sum;
|
|
3238
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
3239
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
3240
|
+
case 0:
|
|
3241
|
+
_context22.next = 2;
|
|
3242
|
+
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()]);
|
|
3243
|
+
case 2:
|
|
3244
|
+
_yield$Promise$all12 = _context22.sent;
|
|
3245
|
+
price = _yield$Promise$all12[0];
|
|
3246
|
+
depositApy = _yield$Promise$all12[1];
|
|
3247
|
+
borrowApy = _yield$Promise$all12[2];
|
|
3248
|
+
depositBalance = _yield$Promise$all12[3];
|
|
3249
|
+
borrowBalance = _yield$Promise$all12[4];
|
|
3250
|
+
nearDepositApy = _yield$Promise$all12[5];
|
|
3251
|
+
plyDepositApy = _yield$Promise$all12[6];
|
|
3252
|
+
metaDepositApy = _yield$Promise$all12[7];
|
|
3253
|
+
nearBorrowApy = _yield$Promise$all12[8];
|
|
3254
|
+
plyBorrowApy = _yield$Promise$all12[9];
|
|
3255
|
+
_context22.next = 15;
|
|
3226
3256
|
return this.getDepositStaderAPY();
|
|
3227
3257
|
case 15:
|
|
3228
|
-
staderDepositApy =
|
|
3258
|
+
staderDepositApy = _context22.sent;
|
|
3229
3259
|
suppliedValue = price.multipliedBy(depositBalance.formattedAmount());
|
|
3230
3260
|
borrowedValue = price.multipliedBy(borrowBalance.formattedAmount());
|
|
3231
3261
|
totalDepositApy = depositApy.plus(nearDepositApy).plus(plyDepositApy).plus(metaDepositApy).plus(staderDepositApy);
|
|
3232
3262
|
totalBorrowApy = borrowApy.plus(nearBorrowApy).plus(plyBorrowApy);
|
|
3233
3263
|
sum = calcNetApy(suppliedValue, totalDepositApy, borrowedValue, totalBorrowApy);
|
|
3234
|
-
return
|
|
3264
|
+
return _context22.abrupt("return", {
|
|
3235
3265
|
sum: sum,
|
|
3236
3266
|
suppliedValue: suppliedValue,
|
|
3237
3267
|
borrowedValue: borrowedValue
|
|
3238
3268
|
});
|
|
3239
3269
|
case 22:
|
|
3240
3270
|
case "end":
|
|
3241
|
-
return
|
|
3271
|
+
return _context22.stop();
|
|
3242
3272
|
}
|
|
3243
|
-
},
|
|
3273
|
+
}, _callee22, this);
|
|
3244
3274
|
}));
|
|
3245
|
-
function getApyWithIncentive(
|
|
3275
|
+
function getApyWithIncentive(_x5) {
|
|
3246
3276
|
return _getApyWithIncentive.apply(this, arguments);
|
|
3247
3277
|
}
|
|
3248
3278
|
return getApyWithIncentive;
|
|
@@ -3315,112 +3345,112 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
|
|
|
3315
3345
|
}
|
|
3316
3346
|
var _proto2 = MoneyMarketReadWrite.prototype;
|
|
3317
3347
|
_proto2.deposit = /*#__PURE__*/function () {
|
|
3318
|
-
var _deposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3319
|
-
return _regeneratorRuntime().wrap(function
|
|
3320
|
-
while (1) switch (
|
|
3348
|
+
var _deposit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(amount) {
|
|
3349
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
3350
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
3321
3351
|
case 0:
|
|
3322
3352
|
if (!isSameAddress(amount.token.address, ETHAddress)) {
|
|
3323
|
-
|
|
3353
|
+
_context23.next = 4;
|
|
3324
3354
|
break;
|
|
3325
3355
|
}
|
|
3326
|
-
return
|
|
3356
|
+
return _context23.abrupt("return", this.auToken.connect(this._networkConnection.signer).mint({
|
|
3327
3357
|
value: amount.rawAmount()
|
|
3328
3358
|
}));
|
|
3329
3359
|
case 4:
|
|
3330
|
-
return
|
|
3360
|
+
return _context23.abrupt("return", this.auToken.connect(this._networkConnection.signer).mint(amount.rawAmount()));
|
|
3331
3361
|
case 5:
|
|
3332
3362
|
case "end":
|
|
3333
|
-
return
|
|
3363
|
+
return _context23.stop();
|
|
3334
3364
|
}
|
|
3335
|
-
},
|
|
3365
|
+
}, _callee23, this);
|
|
3336
3366
|
}));
|
|
3337
|
-
function deposit(
|
|
3367
|
+
function deposit(_x6) {
|
|
3338
3368
|
return _deposit.apply(this, arguments);
|
|
3339
3369
|
}
|
|
3340
3370
|
return deposit;
|
|
3341
3371
|
}();
|
|
3342
3372
|
_proto2.borrow = /*#__PURE__*/function () {
|
|
3343
|
-
var _borrow = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3344
|
-
return _regeneratorRuntime().wrap(function
|
|
3345
|
-
while (1) switch (
|
|
3373
|
+
var _borrow = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(amount) {
|
|
3374
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
3375
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
3346
3376
|
case 0:
|
|
3347
|
-
return
|
|
3377
|
+
return _context24.abrupt("return", this.auToken.connect(this._networkConnection.signer).borrow(amount.rawAmount()));
|
|
3348
3378
|
case 1:
|
|
3349
3379
|
case "end":
|
|
3350
|
-
return
|
|
3380
|
+
return _context24.stop();
|
|
3351
3381
|
}
|
|
3352
|
-
},
|
|
3382
|
+
}, _callee24, this);
|
|
3353
3383
|
}));
|
|
3354
|
-
function borrow(
|
|
3384
|
+
function borrow(_x7) {
|
|
3355
3385
|
return _borrow.apply(this, arguments);
|
|
3356
3386
|
}
|
|
3357
3387
|
return borrow;
|
|
3358
3388
|
}();
|
|
3359
3389
|
_proto2.withdraw = /*#__PURE__*/function () {
|
|
3360
|
-
var _withdraw = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3361
|
-
return _regeneratorRuntime().wrap(function
|
|
3362
|
-
while (1) switch (
|
|
3390
|
+
var _withdraw = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(amount) {
|
|
3391
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
3392
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
3363
3393
|
case 0:
|
|
3364
3394
|
if (!new BigNumber(amount.rawAmount()).lt(0)) {
|
|
3365
|
-
|
|
3395
|
+
_context25.next = 2;
|
|
3366
3396
|
break;
|
|
3367
3397
|
}
|
|
3368
|
-
return
|
|
3398
|
+
return _context25.abrupt("return", this.auToken.connect(this._networkConnection.signer).redeemUnderlying(INF));
|
|
3369
3399
|
case 2:
|
|
3370
|
-
return
|
|
3400
|
+
return _context25.abrupt("return", this.auToken.connect(this._networkConnection.signer).redeemUnderlying(amount.rawAmount()));
|
|
3371
3401
|
case 3:
|
|
3372
3402
|
case "end":
|
|
3373
|
-
return
|
|
3403
|
+
return _context25.stop();
|
|
3374
3404
|
}
|
|
3375
|
-
},
|
|
3405
|
+
}, _callee25, this);
|
|
3376
3406
|
}));
|
|
3377
|
-
function withdraw(
|
|
3407
|
+
function withdraw(_x8) {
|
|
3378
3408
|
return _withdraw.apply(this, arguments);
|
|
3379
3409
|
}
|
|
3380
3410
|
return withdraw;
|
|
3381
3411
|
}();
|
|
3382
3412
|
_proto2.repay = /*#__PURE__*/function () {
|
|
3383
|
-
var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3384
|
-
return _regeneratorRuntime().wrap(function
|
|
3385
|
-
while (1) switch (
|
|
3413
|
+
var _repay = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(amount) {
|
|
3414
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
3415
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
3386
3416
|
case 0:
|
|
3387
3417
|
if (!isSameAddress(amount.token.address, ETHAddress)) {
|
|
3388
|
-
|
|
3418
|
+
_context26.next = 4;
|
|
3389
3419
|
break;
|
|
3390
3420
|
}
|
|
3391
|
-
return
|
|
3421
|
+
return _context26.abrupt("return", this._EthRepayHelper.connect(this._networkConnection.signer).repayBorrow({
|
|
3392
3422
|
value: amount.rawAmount()
|
|
3393
3423
|
}));
|
|
3394
3424
|
case 4:
|
|
3395
3425
|
if (!new BigNumber(amount.rawAmount()).lt(0)) {
|
|
3396
|
-
|
|
3426
|
+
_context26.next = 8;
|
|
3397
3427
|
break;
|
|
3398
3428
|
}
|
|
3399
|
-
return
|
|
3429
|
+
return _context26.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(INF));
|
|
3400
3430
|
case 8:
|
|
3401
|
-
return
|
|
3431
|
+
return _context26.abrupt("return", this.auToken.connect(this._networkConnection.signer).repayBorrow(amount.rawAmount()));
|
|
3402
3432
|
case 9:
|
|
3403
3433
|
case "end":
|
|
3404
|
-
return
|
|
3434
|
+
return _context26.stop();
|
|
3405
3435
|
}
|
|
3406
|
-
},
|
|
3436
|
+
}, _callee26, this);
|
|
3407
3437
|
}));
|
|
3408
|
-
function repay(
|
|
3438
|
+
function repay(_x9) {
|
|
3409
3439
|
return _repay.apply(this, arguments);
|
|
3410
3440
|
}
|
|
3411
3441
|
return repay;
|
|
3412
3442
|
}();
|
|
3413
3443
|
_proto2.enableCollateral = /*#__PURE__*/function () {
|
|
3414
|
-
var _enableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3415
|
-
return _regeneratorRuntime().wrap(function
|
|
3416
|
-
while (1) switch (
|
|
3444
|
+
var _enableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
|
|
3445
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
3446
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
3417
3447
|
case 0:
|
|
3418
|
-
return
|
|
3448
|
+
return _context27.abrupt("return", this.env.comptroller.connect(this._networkConnection.signer).enterMarkets([this.auToken.address]));
|
|
3419
3449
|
case 1:
|
|
3420
3450
|
case "end":
|
|
3421
|
-
return
|
|
3451
|
+
return _context27.stop();
|
|
3422
3452
|
}
|
|
3423
|
-
},
|
|
3453
|
+
}, _callee27, this);
|
|
3424
3454
|
}));
|
|
3425
3455
|
function enableCollateral() {
|
|
3426
3456
|
return _enableCollateral.apply(this, arguments);
|
|
@@ -3428,16 +3458,16 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
|
|
|
3428
3458
|
return enableCollateral;
|
|
3429
3459
|
}();
|
|
3430
3460
|
_proto2.disableCollateral = /*#__PURE__*/function () {
|
|
3431
|
-
var _disableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3432
|
-
return _regeneratorRuntime().wrap(function
|
|
3433
|
-
while (1) switch (
|
|
3461
|
+
var _disableCollateral = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
3462
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
3463
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
3434
3464
|
case 0:
|
|
3435
|
-
return
|
|
3465
|
+
return _context28.abrupt("return", this.env.comptroller.connect(this._networkConnection.signer).exitMarket(this.auToken.address));
|
|
3436
3466
|
case 1:
|
|
3437
3467
|
case "end":
|
|
3438
|
-
return
|
|
3468
|
+
return _context28.stop();
|
|
3439
3469
|
}
|
|
3440
|
-
},
|
|
3470
|
+
}, _callee28, this);
|
|
3441
3471
|
}));
|
|
3442
3472
|
function disableCollateral() {
|
|
3443
3473
|
return _disableCollateral.apply(this, arguments);
|
|
@@ -4747,20 +4777,35 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4747
4777
|
var _proto = StakingRead.prototype;
|
|
4748
4778
|
_proto.getPLYWNEARPoolDetails = /*#__PURE__*/function () {
|
|
4749
4779
|
var _getPLYWNEARPoolDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4750
|
-
var stakedLiquidity, rewardPerSeconds, stakedLiquidityAmount, totalStakeValuation, promises, i, rewardTokenAddress, rewardToken, rewardPerSecond, APYs;
|
|
4780
|
+
var _yield$this$env$auriF, stakedLiquidity, rewardPerSeconds, stakedLiquidityAmount, totalStakeValuation, promises, i, rewardTokenAddress, rewardToken, rewardPerSecond, APYs;
|
|
4751
4781
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4752
4782
|
while (1) switch (_context.prev = _context.next) {
|
|
4753
4783
|
case 0:
|
|
4754
4784
|
_context.next = 2;
|
|
4755
4785
|
return this.env.auriFairLaunch.getPoolInfo(PLYWNEAR_POOL_ID).then(function (res) {
|
|
4756
|
-
|
|
4757
|
-
|
|
4786
|
+
var endedTime = res.endTime;
|
|
4787
|
+
// If the pool has ended, return 0 reward per second
|
|
4788
|
+
if (endedTime < Date.now() / 1000) {
|
|
4789
|
+
return {
|
|
4790
|
+
stakedLiquidity: res.totalStake,
|
|
4791
|
+
rewardPerSeconds: res.rewardPerSeconds.map(function (_) {
|
|
4792
|
+
return BigNumber$1.from(0);
|
|
4793
|
+
})
|
|
4794
|
+
};
|
|
4795
|
+
}
|
|
4796
|
+
return {
|
|
4797
|
+
stakedLiquidity: res.totalStake,
|
|
4798
|
+
rewardPerSeconds: res.rewardPerSeconds
|
|
4799
|
+
};
|
|
4758
4800
|
});
|
|
4759
4801
|
case 2:
|
|
4802
|
+
_yield$this$env$auriF = _context.sent;
|
|
4803
|
+
stakedLiquidity = _yield$this$env$auriF.stakedLiquidity;
|
|
4804
|
+
rewardPerSeconds = _yield$this$env$auriF.rewardPerSeconds;
|
|
4760
4805
|
stakedLiquidityAmount = new TokenAmount(PLYWNEARToken, stakedLiquidity.toString());
|
|
4761
|
-
_context.next =
|
|
4806
|
+
_context.next = 8;
|
|
4762
4807
|
return fetchValuation(stakedLiquidityAmount, this._networkConnection.provider);
|
|
4763
|
-
case
|
|
4808
|
+
case 8:
|
|
4764
4809
|
totalStakeValuation = _context.sent;
|
|
4765
4810
|
promises = []; // Calculate the reward per second in USD
|
|
4766
4811
|
for (i = 0; i < rewardPerSeconds.length; i++) {
|
|
@@ -4770,9 +4815,9 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4770
4815
|
promises.push(fetchValuation(new TokenAmount(rewardToken, rewardPerSecond.toString()), this._networkConnection.provider));
|
|
4771
4816
|
}
|
|
4772
4817
|
APYs = [];
|
|
4773
|
-
_context.next =
|
|
4818
|
+
_context.next = 14;
|
|
4774
4819
|
return Promise.all(promises);
|
|
4775
|
-
case
|
|
4820
|
+
case 14:
|
|
4776
4821
|
_context.sent.forEach(function (rewardPerSecondValuation, i) {
|
|
4777
4822
|
var rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[i];
|
|
4778
4823
|
var apy = calcLMRewardApr(rewardPerSecondValuation, totalStakeValuation, ONE_DAY * 365).toFixed(DECIMAL_PRECISION);
|
|
@@ -4785,7 +4830,7 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4785
4830
|
totalStakedLiquidity: stakedLiquidityAmount,
|
|
4786
4831
|
APYs: APYs
|
|
4787
4832
|
});
|
|
4788
|
-
case
|
|
4833
|
+
case 16:
|
|
4789
4834
|
case "end":
|
|
4790
4835
|
return _context.stop();
|
|
4791
4836
|
}
|
|
@@ -5419,25 +5464,123 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5419
5464
|
}
|
|
5420
5465
|
return sneakAccounts;
|
|
5421
5466
|
}();
|
|
5422
|
-
_proto.
|
|
5423
|
-
var
|
|
5467
|
+
_proto.getLTVAndLiquidationThreshold = /*#__PURE__*/function () {
|
|
5468
|
+
var _getLTVAndLiquidationThreshold = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(userAddr) {
|
|
5424
5469
|
var _this3 = this;
|
|
5470
|
+
var totalSuppliedValue, totalBorrowedValue, collateralValue, assetsIn, marketValues, _loop2, i, ltv, liquidationThreshold;
|
|
5471
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context11) {
|
|
5472
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
5473
|
+
case 0:
|
|
5474
|
+
totalSuppliedValue = new BigNumber(0);
|
|
5475
|
+
totalBorrowedValue = new BigNumber(0);
|
|
5476
|
+
collateralValue = new BigNumber(0);
|
|
5477
|
+
_context11.next = 5;
|
|
5478
|
+
return this.env.comptroller.getAssetsIn(userAddr);
|
|
5479
|
+
case 5:
|
|
5480
|
+
assetsIn = _context11.sent;
|
|
5481
|
+
_context11.next = 8;
|
|
5482
|
+
return Promise.all(networkAddresses.auTokens.map( /*#__PURE__*/function () {
|
|
5483
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(auToken) {
|
|
5484
|
+
var moneyMarket;
|
|
5485
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context8) {
|
|
5486
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
5487
|
+
case 0:
|
|
5488
|
+
moneyMarket = new MoneyMarketRead(_this3._networkConnection, auToken.address, auToken.underlying);
|
|
5489
|
+
return _context8.abrupt("return", Promise.all([moneyMarket.getCollateralRatio(), moneyMarket.getDepositBorrowValue(userAddr)]));
|
|
5490
|
+
case 2:
|
|
5491
|
+
case "end":
|
|
5492
|
+
return _context8.stop();
|
|
5493
|
+
}
|
|
5494
|
+
}, _callee7);
|
|
5495
|
+
}));
|
|
5496
|
+
return function (_x9) {
|
|
5497
|
+
return _ref2.apply(this, arguments);
|
|
5498
|
+
};
|
|
5499
|
+
}()));
|
|
5500
|
+
case 8:
|
|
5501
|
+
marketValues = _context11.sent;
|
|
5502
|
+
networkAddresses.auTokens.forEach( /*#__PURE__*/function () {
|
|
5503
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(auToken, i) {
|
|
5504
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context9) {
|
|
5505
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
5506
|
+
case 0:
|
|
5507
|
+
case "end":
|
|
5508
|
+
return _context9.stop();
|
|
5509
|
+
}
|
|
5510
|
+
}, _callee8);
|
|
5511
|
+
}));
|
|
5512
|
+
return function (_x10, _x11) {
|
|
5513
|
+
return _ref3.apply(this, arguments);
|
|
5514
|
+
};
|
|
5515
|
+
}());
|
|
5516
|
+
_loop2 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop2() {
|
|
5517
|
+
var auToken, _marketValues$i, collateralRatio, depositBorrowValue;
|
|
5518
|
+
return _regeneratorRuntime().wrap(function _loop2$(_context10) {
|
|
5519
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
5520
|
+
case 0:
|
|
5521
|
+
auToken = networkAddresses.auTokens[i];
|
|
5522
|
+
_marketValues$i = marketValues[i], collateralRatio = _marketValues$i[0], depositBorrowValue = _marketValues$i[1];
|
|
5523
|
+
if (assetsIn.find(function (auAddress) {
|
|
5524
|
+
return isSameAddress(auToken.address, auAddress);
|
|
5525
|
+
}) !== undefined) {
|
|
5526
|
+
totalSuppliedValue = totalSuppliedValue.plus(depositBorrowValue.suppliedValue);
|
|
5527
|
+
collateralValue = collateralValue.plus(depositBorrowValue.suppliedValue.times(collateralRatio));
|
|
5528
|
+
}
|
|
5529
|
+
totalBorrowedValue = totalBorrowedValue.plus(depositBorrowValue.borrowedValue);
|
|
5530
|
+
case 4:
|
|
5531
|
+
case "end":
|
|
5532
|
+
return _context10.stop();
|
|
5533
|
+
}
|
|
5534
|
+
}, _loop2);
|
|
5535
|
+
});
|
|
5536
|
+
i = 0;
|
|
5537
|
+
case 12:
|
|
5538
|
+
if (!(i < marketValues.length)) {
|
|
5539
|
+
_context11.next = 17;
|
|
5540
|
+
break;
|
|
5541
|
+
}
|
|
5542
|
+
return _context11.delegateYield(_loop2(), "t0", 14);
|
|
5543
|
+
case 14:
|
|
5544
|
+
i++;
|
|
5545
|
+
_context11.next = 12;
|
|
5546
|
+
break;
|
|
5547
|
+
case 17:
|
|
5548
|
+
ltv = totalBorrowedValue.div(totalSuppliedValue);
|
|
5549
|
+
liquidationThreshold = collateralValue.div(totalSuppliedValue);
|
|
5550
|
+
return _context11.abrupt("return", {
|
|
5551
|
+
ltv: ltv,
|
|
5552
|
+
liquidationThreshold: liquidationThreshold
|
|
5553
|
+
});
|
|
5554
|
+
case 20:
|
|
5555
|
+
case "end":
|
|
5556
|
+
return _context11.stop();
|
|
5557
|
+
}
|
|
5558
|
+
}, _callee9, this);
|
|
5559
|
+
}));
|
|
5560
|
+
function getLTVAndLiquidationThreshold(_x8) {
|
|
5561
|
+
return _getLTVAndLiquidationThreshold.apply(this, arguments);
|
|
5562
|
+
}
|
|
5563
|
+
return getLTVAndLiquidationThreshold;
|
|
5564
|
+
}();
|
|
5565
|
+
_proto.getNetApyWithoutIncentive = /*#__PURE__*/function () {
|
|
5566
|
+
var _getNetApyWithoutIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(userAddress) {
|
|
5567
|
+
var _this4 = this;
|
|
5425
5568
|
var sum, totalSuppliedValue, totalBorrowedValue, netApy, apys, _iterator3, _step3, apy;
|
|
5426
|
-
return _regeneratorRuntime().wrap(function
|
|
5427
|
-
while (1) switch (
|
|
5569
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context12) {
|
|
5570
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
5428
5571
|
case 0:
|
|
5429
5572
|
sum = new BigNumber(0);
|
|
5430
5573
|
totalSuppliedValue = new BigNumber(0);
|
|
5431
5574
|
totalBorrowedValue = new BigNumber(0);
|
|
5432
5575
|
netApy = new BigNumber(0);
|
|
5433
|
-
|
|
5576
|
+
_context12.next = 6;
|
|
5434
5577
|
return Promise.all(networkAddresses.auTokens.map(function (auToken) {
|
|
5435
|
-
var moneyMarket = new MoneyMarketRead(
|
|
5578
|
+
var moneyMarket = new MoneyMarketRead(_this4._networkConnection, auToken.address, auToken.underlying);
|
|
5436
5579
|
var apyWithoutIncentive = moneyMarket.getApyWithoutIncentive(userAddress);
|
|
5437
5580
|
return apyWithoutIncentive;
|
|
5438
5581
|
}));
|
|
5439
5582
|
case 6:
|
|
5440
|
-
apys =
|
|
5583
|
+
apys = _context12.sent;
|
|
5441
5584
|
for (_iterator3 = _createForOfIteratorHelperLoose(apys); !(_step3 = _iterator3()).done;) {
|
|
5442
5585
|
apy = _step3.value;
|
|
5443
5586
|
sum = sum.plus(apy.sum);
|
|
@@ -5449,37 +5592,37 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5449
5592
|
} else if (sum.lt(0)) {
|
|
5450
5593
|
netApy = sum.div(totalBorrowedValue);
|
|
5451
5594
|
}
|
|
5452
|
-
return
|
|
5595
|
+
return _context12.abrupt("return", netApy);
|
|
5453
5596
|
case 10:
|
|
5454
5597
|
case "end":
|
|
5455
|
-
return
|
|
5598
|
+
return _context12.stop();
|
|
5456
5599
|
}
|
|
5457
|
-
},
|
|
5600
|
+
}, _callee10);
|
|
5458
5601
|
}));
|
|
5459
|
-
function getNetApyWithoutIncentive(
|
|
5602
|
+
function getNetApyWithoutIncentive(_x12) {
|
|
5460
5603
|
return _getNetApyWithoutIncentive.apply(this, arguments);
|
|
5461
5604
|
}
|
|
5462
5605
|
return getNetApyWithoutIncentive;
|
|
5463
5606
|
}();
|
|
5464
5607
|
_proto.getNetApyWithIncentive = /*#__PURE__*/function () {
|
|
5465
|
-
var _getNetApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
5466
|
-
var
|
|
5608
|
+
var _getNetApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(userAddress) {
|
|
5609
|
+
var _this5 = this;
|
|
5467
5610
|
var sum, totalSuppliedValue, totalBorrowedValue, netApy, apys, _iterator4, _step4, apy;
|
|
5468
|
-
return _regeneratorRuntime().wrap(function
|
|
5469
|
-
while (1) switch (
|
|
5611
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context13) {
|
|
5612
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
5470
5613
|
case 0:
|
|
5471
5614
|
sum = new BigNumber(0);
|
|
5472
5615
|
totalSuppliedValue = new BigNumber(0);
|
|
5473
5616
|
totalBorrowedValue = new BigNumber(0);
|
|
5474
5617
|
netApy = new BigNumber(0);
|
|
5475
|
-
|
|
5618
|
+
_context13.next = 6;
|
|
5476
5619
|
return Promise.all(networkAddresses.auTokens.map(function (auToken) {
|
|
5477
|
-
var moneyMarket = new MoneyMarketRead(
|
|
5620
|
+
var moneyMarket = new MoneyMarketRead(_this5._networkConnection, auToken.address, auToken.underlying);
|
|
5478
5621
|
var apyWithIncentive = moneyMarket.getApyWithIncentive(userAddress);
|
|
5479
5622
|
return apyWithIncentive;
|
|
5480
5623
|
}));
|
|
5481
5624
|
case 6:
|
|
5482
|
-
apys =
|
|
5625
|
+
apys = _context13.sent;
|
|
5483
5626
|
for (_iterator4 = _createForOfIteratorHelperLoose(apys); !(_step4 = _iterator4()).done;) {
|
|
5484
5627
|
apy = _step4.value;
|
|
5485
5628
|
sum = sum.plus(apy.sum);
|
|
@@ -5491,14 +5634,14 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5491
5634
|
} else if (sum.lt(0)) {
|
|
5492
5635
|
netApy = sum.div(totalBorrowedValue);
|
|
5493
5636
|
}
|
|
5494
|
-
return
|
|
5637
|
+
return _context13.abrupt("return", netApy);
|
|
5495
5638
|
case 10:
|
|
5496
5639
|
case "end":
|
|
5497
|
-
return
|
|
5640
|
+
return _context13.stop();
|
|
5498
5641
|
}
|
|
5499
|
-
},
|
|
5642
|
+
}, _callee11);
|
|
5500
5643
|
}));
|
|
5501
|
-
function getNetApyWithIncentive(
|
|
5644
|
+
function getNetApyWithIncentive(_x13) {
|
|
5502
5645
|
return _getNetApyWithIncentive.apply(this, arguments);
|
|
5503
5646
|
}
|
|
5504
5647
|
return getNetApyWithIncentive;
|
|
@@ -5819,49 +5962,62 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5819
5962
|
}
|
|
5820
5963
|
return sneakAccounts;
|
|
5821
5964
|
}();
|
|
5822
|
-
_proto.
|
|
5823
|
-
var
|
|
5824
|
-
var miscRead;
|
|
5965
|
+
_proto.getLTVAndLiquidationThreshold = /*#__PURE__*/function () {
|
|
5966
|
+
var _getLTVAndLiquidationThreshold = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(userAddr) {
|
|
5825
5967
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
5826
5968
|
while (1) switch (_context10.prev = _context10.next) {
|
|
5827
5969
|
case 0:
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
case 2:
|
|
5970
|
+
return _context10.abrupt("return", this._misc.getLTVAndLiquidationThreshold(userAddr));
|
|
5971
|
+
case 1:
|
|
5831
5972
|
case "end":
|
|
5832
5973
|
return _context10.stop();
|
|
5833
5974
|
}
|
|
5834
5975
|
}, _callee10, this);
|
|
5835
5976
|
}));
|
|
5836
|
-
function
|
|
5837
|
-
return
|
|
5977
|
+
function getLTVAndLiquidationThreshold(_x10) {
|
|
5978
|
+
return _getLTVAndLiquidationThreshold.apply(this, arguments);
|
|
5838
5979
|
}
|
|
5839
|
-
return
|
|
5980
|
+
return getLTVAndLiquidationThreshold;
|
|
5840
5981
|
}();
|
|
5841
|
-
_proto.
|
|
5842
|
-
var
|
|
5843
|
-
var miscRead;
|
|
5982
|
+
_proto.getNetApyWithoutIncentive = /*#__PURE__*/function () {
|
|
5983
|
+
var _getNetApyWithoutIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(userAddress) {
|
|
5844
5984
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
5845
5985
|
while (1) switch (_context11.prev = _context11.next) {
|
|
5846
5986
|
case 0:
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
case 2:
|
|
5987
|
+
return _context11.abrupt("return", this._misc.getNetApyWithoutIncentive(userAddress));
|
|
5988
|
+
case 1:
|
|
5850
5989
|
case "end":
|
|
5851
5990
|
return _context11.stop();
|
|
5852
5991
|
}
|
|
5853
5992
|
}, _callee11, this);
|
|
5854
5993
|
}));
|
|
5855
|
-
function
|
|
5994
|
+
function getNetApyWithoutIncentive(_x11) {
|
|
5995
|
+
return _getNetApyWithoutIncentive.apply(this, arguments);
|
|
5996
|
+
}
|
|
5997
|
+
return getNetApyWithoutIncentive;
|
|
5998
|
+
}();
|
|
5999
|
+
_proto.getNetApyWithIncentive = /*#__PURE__*/function () {
|
|
6000
|
+
var _getNetApyWithIncentive = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(userAddress) {
|
|
6001
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
6002
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
6003
|
+
case 0:
|
|
6004
|
+
return _context12.abrupt("return", this._misc.getNetApyWithIncentive(userAddress));
|
|
6005
|
+
case 1:
|
|
6006
|
+
case "end":
|
|
6007
|
+
return _context12.stop();
|
|
6008
|
+
}
|
|
6009
|
+
}, _callee12, this);
|
|
6010
|
+
}));
|
|
6011
|
+
function getNetApyWithIncentive(_x12) {
|
|
5856
6012
|
return _getNetApyWithIncentive.apply(this, arguments);
|
|
5857
6013
|
}
|
|
5858
6014
|
return getNetApyWithIncentive;
|
|
5859
6015
|
}();
|
|
5860
6016
|
_proto.setUserNotificationSettings = /*#__PURE__*/function () {
|
|
5861
|
-
var _setUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6017
|
+
var _setUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(address, mail, utilisation, liquidation, captchaResponse) {
|
|
5862
6018
|
var body, response;
|
|
5863
|
-
return _regeneratorRuntime().wrap(function
|
|
5864
|
-
while (1) switch (
|
|
6019
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
6020
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
5865
6021
|
case 0:
|
|
5866
6022
|
body = {
|
|
5867
6023
|
address: address,
|
|
@@ -5872,27 +6028,27 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5872
6028
|
},
|
|
5873
6029
|
captchaResponse: captchaResponse
|
|
5874
6030
|
};
|
|
5875
|
-
|
|
6031
|
+
_context13.next = 3;
|
|
5876
6032
|
return postApi('alert-setting/set', body);
|
|
5877
6033
|
case 3:
|
|
5878
|
-
response =
|
|
5879
|
-
return
|
|
6034
|
+
response = _context13.sent;
|
|
6035
|
+
return _context13.abrupt("return", response);
|
|
5880
6036
|
case 5:
|
|
5881
6037
|
case "end":
|
|
5882
|
-
return
|
|
6038
|
+
return _context13.stop();
|
|
5883
6039
|
}
|
|
5884
|
-
},
|
|
6040
|
+
}, _callee13);
|
|
5885
6041
|
}));
|
|
5886
|
-
function setUserNotificationSettings(
|
|
6042
|
+
function setUserNotificationSettings(_x13, _x14, _x15, _x16, _x17) {
|
|
5887
6043
|
return _setUserNotificationSettings.apply(this, arguments);
|
|
5888
6044
|
}
|
|
5889
6045
|
return setUserNotificationSettings;
|
|
5890
6046
|
}();
|
|
5891
6047
|
_proto.unsetUserNotificationSettings = /*#__PURE__*/function () {
|
|
5892
|
-
var _unsetUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6048
|
+
var _unsetUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(address, captchaResponse) {
|
|
5893
6049
|
var body, response;
|
|
5894
|
-
return _regeneratorRuntime().wrap(function
|
|
5895
|
-
while (1) switch (
|
|
6050
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
6051
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
5896
6052
|
case 0:
|
|
5897
6053
|
body = {
|
|
5898
6054
|
address: address,
|
|
@@ -5903,57 +6059,57 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5903
6059
|
},
|
|
5904
6060
|
captchaResponse: captchaResponse
|
|
5905
6061
|
};
|
|
5906
|
-
|
|
6062
|
+
_context14.next = 3;
|
|
5907
6063
|
return postApi('alert-setting/set', body);
|
|
5908
6064
|
case 3:
|
|
5909
|
-
response =
|
|
5910
|
-
return
|
|
6065
|
+
response = _context14.sent;
|
|
6066
|
+
return _context14.abrupt("return", response);
|
|
5911
6067
|
case 5:
|
|
5912
6068
|
case "end":
|
|
5913
|
-
return
|
|
6069
|
+
return _context14.stop();
|
|
5914
6070
|
}
|
|
5915
|
-
},
|
|
6071
|
+
}, _callee14);
|
|
5916
6072
|
}));
|
|
5917
|
-
function unsetUserNotificationSettings(
|
|
6073
|
+
function unsetUserNotificationSettings(_x18, _x19) {
|
|
5918
6074
|
return _unsetUserNotificationSettings.apply(this, arguments);
|
|
5919
6075
|
}
|
|
5920
6076
|
return unsetUserNotificationSettings;
|
|
5921
6077
|
}();
|
|
5922
6078
|
_proto.getUserNotificationSettings = /*#__PURE__*/function () {
|
|
5923
|
-
var _getUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6079
|
+
var _getUserNotificationSettings = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(addresses) {
|
|
5924
6080
|
var body, response;
|
|
5925
|
-
return _regeneratorRuntime().wrap(function
|
|
5926
|
-
while (1) switch (
|
|
6081
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
6082
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
5927
6083
|
case 0:
|
|
5928
6084
|
body = {
|
|
5929
6085
|
addresses: addresses
|
|
5930
6086
|
};
|
|
5931
|
-
|
|
6087
|
+
_context15.next = 3;
|
|
5932
6088
|
return postApi('alert-setting/get-user-setting', body);
|
|
5933
6089
|
case 3:
|
|
5934
|
-
response =
|
|
5935
|
-
return
|
|
6090
|
+
response = _context15.sent;
|
|
6091
|
+
return _context15.abrupt("return", response);
|
|
5936
6092
|
case 5:
|
|
5937
6093
|
case "end":
|
|
5938
|
-
return
|
|
6094
|
+
return _context15.stop();
|
|
5939
6095
|
}
|
|
5940
|
-
},
|
|
6096
|
+
}, _callee15);
|
|
5941
6097
|
}));
|
|
5942
|
-
function getUserNotificationSettings(
|
|
6098
|
+
function getUserNotificationSettings(_x20) {
|
|
5943
6099
|
return _getUserNotificationSettings.apply(this, arguments);
|
|
5944
6100
|
}
|
|
5945
6101
|
return getUserNotificationSettings;
|
|
5946
6102
|
}();
|
|
5947
6103
|
_proto.getLiquidationHistory = /*#__PURE__*/function () {
|
|
5948
|
-
var _getLiquidationHistory = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6104
|
+
var _getLiquidationHistory = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(address) {
|
|
5949
6105
|
var liquidationHistorySubgraph, liquidationEvents;
|
|
5950
|
-
return _regeneratorRuntime().wrap(function
|
|
5951
|
-
while (1) switch (
|
|
6106
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
6107
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
5952
6108
|
case 0:
|
|
5953
|
-
|
|
6109
|
+
_context16.next = 2;
|
|
5954
6110
|
return queryGraphQL(getLiquidationEventsQuery(address, 100), AURIGAMI_SUBGRAPH_URL);
|
|
5955
6111
|
case 2:
|
|
5956
|
-
liquidationHistorySubgraph =
|
|
6112
|
+
liquidationHistorySubgraph = _context16.sent;
|
|
5957
6113
|
liquidationEvents = liquidationHistorySubgraph.liquidationEvents.map(function (event) {
|
|
5958
6114
|
var value = {
|
|
5959
6115
|
amount: event.underlyingRepayAmountUSD.toString(),
|
|
@@ -5972,14 +6128,14 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5972
6128
|
transactionId: event.id.split('-')[0]
|
|
5973
6129
|
};
|
|
5974
6130
|
});
|
|
5975
|
-
return
|
|
6131
|
+
return _context16.abrupt("return", liquidationEvents);
|
|
5976
6132
|
case 5:
|
|
5977
6133
|
case "end":
|
|
5978
|
-
return
|
|
6134
|
+
return _context16.stop();
|
|
5979
6135
|
}
|
|
5980
|
-
},
|
|
6136
|
+
}, _callee16);
|
|
5981
6137
|
}));
|
|
5982
|
-
function getLiquidationHistory(
|
|
6138
|
+
function getLiquidationHistory(_x21) {
|
|
5983
6139
|
return _getLiquidationHistory.apply(this, arguments);
|
|
5984
6140
|
}
|
|
5985
6141
|
return getLiquidationHistory;
|
|
@@ -6001,16 +6157,16 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
6001
6157
|
_proto2.claim =
|
|
6002
6158
|
/*#__PURE__*/
|
|
6003
6159
|
function () {
|
|
6004
|
-
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6005
|
-
return _regeneratorRuntime().wrap(function
|
|
6006
|
-
while (1) switch (
|
|
6160
|
+
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
6161
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
6162
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
6007
6163
|
case 0:
|
|
6008
|
-
return
|
|
6164
|
+
return _context17.abrupt("return", this.env.auriLens.connect(this._networkConnection.signer).claimRewards(this.env.comptroller.address, this.env.auriFairLaunch.address, ALL_STAKING_POOLS));
|
|
6009
6165
|
case 1:
|
|
6010
6166
|
case "end":
|
|
6011
|
-
return
|
|
6167
|
+
return _context17.stop();
|
|
6012
6168
|
}
|
|
6013
|
-
},
|
|
6169
|
+
}, _callee17, this);
|
|
6014
6170
|
}));
|
|
6015
6171
|
function claim() {
|
|
6016
6172
|
return _claim.apply(this, arguments);
|
|
@@ -6018,35 +6174,35 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
6018
6174
|
return claim;
|
|
6019
6175
|
}();
|
|
6020
6176
|
_proto2.stake = /*#__PURE__*/function () {
|
|
6021
|
-
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6022
|
-
return _regeneratorRuntime().wrap(function
|
|
6023
|
-
while (1) switch (
|
|
6177
|
+
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(amount) {
|
|
6178
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
6179
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
6024
6180
|
case 0:
|
|
6025
|
-
return
|
|
6181
|
+
return _context18.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
|
|
6026
6182
|
case 1:
|
|
6027
6183
|
case "end":
|
|
6028
|
-
return
|
|
6184
|
+
return _context18.stop();
|
|
6029
6185
|
}
|
|
6030
|
-
},
|
|
6186
|
+
}, _callee18, this);
|
|
6031
6187
|
}));
|
|
6032
|
-
function stake(
|
|
6188
|
+
function stake(_x22) {
|
|
6033
6189
|
return _stake.apply(this, arguments);
|
|
6034
6190
|
}
|
|
6035
6191
|
return stake;
|
|
6036
6192
|
}();
|
|
6037
6193
|
_proto2.unstake = /*#__PURE__*/function () {
|
|
6038
|
-
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6039
|
-
return _regeneratorRuntime().wrap(function
|
|
6040
|
-
while (1) switch (
|
|
6194
|
+
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(amount) {
|
|
6195
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
6196
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
6041
6197
|
case 0:
|
|
6042
|
-
return
|
|
6198
|
+
return _context19.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
|
|
6043
6199
|
case 1:
|
|
6044
6200
|
case "end":
|
|
6045
|
-
return
|
|
6201
|
+
return _context19.stop();
|
|
6046
6202
|
}
|
|
6047
|
-
},
|
|
6203
|
+
}, _callee19, this);
|
|
6048
6204
|
}));
|
|
6049
|
-
function unstake(
|
|
6205
|
+
function unstake(_x23) {
|
|
6050
6206
|
return _unstake.apply(this, arguments);
|
|
6051
6207
|
}
|
|
6052
6208
|
return unstake;
|