@aurigami/sdk 1.5.1 → 1.5.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 +7 -4
- package/dist/Staking.d.ts +24 -0
- package/dist/constants.d.ts +2 -2
- package/dist/priceFetcher.d.ts +1 -0
- package/dist/sdk.cjs.development.js +387 -158
- 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 +391 -163
- package/dist/sdk.esm.js.map +1 -1
- package/dist/tokenAmount.d.ts +2 -0
- package/package.json +4 -1
- package/src/SDK.ts +39 -129
- package/src/Staking.ts +193 -0
- package/src/constants.ts +2 -2
- package/src/helpers.ts +3 -5
- package/src/priceFetcher.ts +13 -15
- package/src/tokenAmount.ts +14 -1
package/dist/sdk.esm.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { BigNumber as BigNumber$1, utils, Contract, ethers } from 'ethers';
|
|
3
3
|
import { Logger } from 'ethers/lib/utils';
|
|
4
|
+
import AuriFairLaunchABI from '@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json';
|
|
5
|
+
import AuriLensABI from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json';
|
|
6
|
+
import ComptrollerABI from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
|
|
7
|
+
import FaucetABI from '@aurigami/contracts/artifacts/contracts/mock/Faucet.sol/Faucet.json';
|
|
4
8
|
import { Signer } from '@ethersproject/abstract-signer';
|
|
5
|
-
import axios from 'axios';
|
|
6
9
|
import assert from 'assert';
|
|
10
|
+
import axios from 'axios';
|
|
7
11
|
import AuErc20ABI from '@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json';
|
|
8
12
|
import AuETHABI from '@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json';
|
|
9
|
-
import ComptrollerABI from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
|
|
10
|
-
import AuriLensABI from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json';
|
|
11
13
|
import EthRepayHelperABI from '@aurigami/contracts/artifacts/contracts/EthRepayHelper.sol/EthRepayHelper.json';
|
|
12
|
-
import AuriFairLaunchABI from '@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json';
|
|
13
|
-
import FaucetABI from '@aurigami/contracts/artifacts/contracts/mock/Faucet.sol/Faucet.json';
|
|
14
|
-
import EIP20InterfaceABI from '@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json';
|
|
15
14
|
import PulpABI from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
|
|
15
|
+
import EIP20InterfaceABI from '@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json';
|
|
16
16
|
import AuTokenABI from '@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json';
|
|
17
17
|
import AuriAirdropABI from '@aurigami/contracts/artifacts/contracts/AuriAirdrop.sol/AuriAirdrop.json';
|
|
18
18
|
|
|
@@ -916,24 +916,6 @@ var BlockchainEntity = /*#__PURE__*/function () {
|
|
|
916
916
|
return BlockchainEntity;
|
|
917
917
|
}();
|
|
918
918
|
|
|
919
|
-
var ComptrollerRewardType;
|
|
920
|
-
|
|
921
|
-
(function (ComptrollerRewardType) {
|
|
922
|
-
ComptrollerRewardType[ComptrollerRewardType["PLY"] = 0] = "PLY";
|
|
923
|
-
ComptrollerRewardType[ComptrollerRewardType["AURORA"] = 1] = "AURORA";
|
|
924
|
-
})(ComptrollerRewardType || (ComptrollerRewardType = {}));
|
|
925
|
-
|
|
926
|
-
var MarketAction;
|
|
927
|
-
|
|
928
|
-
(function (MarketAction) {
|
|
929
|
-
MarketAction[MarketAction["Deposit"] = 0] = "Deposit";
|
|
930
|
-
MarketAction[MarketAction["Borrow"] = 1] = "Borrow";
|
|
931
|
-
MarketAction[MarketAction["Withdraw"] = 2] = "Withdraw";
|
|
932
|
-
MarketAction[MarketAction["Repay"] = 3] = "Repay";
|
|
933
|
-
MarketAction[MarketAction["EnableCollateral"] = 4] = "EnableCollateral";
|
|
934
|
-
MarketAction[MarketAction["DisableCollateral"] = 5] = "DisableCollateral";
|
|
935
|
-
})(MarketAction || (MarketAction = {}));
|
|
936
|
-
|
|
937
919
|
var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
|
|
938
920
|
var ETHAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
|
|
939
921
|
var AURORA_CHAINID = 1313161554;
|
|
@@ -1000,7 +982,7 @@ var networkAddresses = {
|
|
|
1000
982
|
var PRICE_WHITELISTED = /*#__PURE__*/new Set( /*#__PURE__*/[].concat( /*#__PURE__*/networkAddresses.auTokens.map(function (t) {
|
|
1001
983
|
return t.underlying;
|
|
1002
984
|
}), [networkAddresses.tokens.AURORA, networkAddresses.tokens.TRI, networkAddresses.tokens.META, networkAddresses.tokens.stNEAR]));
|
|
1003
|
-
var REWARD_CLAIM_START =
|
|
985
|
+
var REWARD_CLAIM_START = 1651748400;
|
|
1004
986
|
var BORROW_LIMIT_BUFFER = /*#__PURE__*/new BigNumber(1);
|
|
1005
987
|
var ONE_DAY = 86400;
|
|
1006
988
|
var ONE_WEEK = ONE_DAY * 7;
|
|
@@ -1195,6 +1177,24 @@ function _getBlockBeforeTimestamp() {
|
|
|
1195
1177
|
return _getBlockBeforeTimestamp.apply(this, arguments);
|
|
1196
1178
|
}
|
|
1197
1179
|
|
|
1180
|
+
var ComptrollerRewardType;
|
|
1181
|
+
|
|
1182
|
+
(function (ComptrollerRewardType) {
|
|
1183
|
+
ComptrollerRewardType[ComptrollerRewardType["PLY"] = 0] = "PLY";
|
|
1184
|
+
ComptrollerRewardType[ComptrollerRewardType["AURORA"] = 1] = "AURORA";
|
|
1185
|
+
})(ComptrollerRewardType || (ComptrollerRewardType = {}));
|
|
1186
|
+
|
|
1187
|
+
var MarketAction;
|
|
1188
|
+
|
|
1189
|
+
(function (MarketAction) {
|
|
1190
|
+
MarketAction[MarketAction["Deposit"] = 0] = "Deposit";
|
|
1191
|
+
MarketAction[MarketAction["Borrow"] = 1] = "Borrow";
|
|
1192
|
+
MarketAction[MarketAction["Withdraw"] = 2] = "Withdraw";
|
|
1193
|
+
MarketAction[MarketAction["Repay"] = 3] = "Repay";
|
|
1194
|
+
MarketAction[MarketAction["EnableCollateral"] = 4] = "EnableCollateral";
|
|
1195
|
+
MarketAction[MarketAction["DisableCollateral"] = 5] = "DisableCollateral";
|
|
1196
|
+
})(MarketAction || (MarketAction = {}));
|
|
1197
|
+
|
|
1198
1198
|
var Token = function Token(address, decimals) {
|
|
1199
1199
|
this.address = address.toLowerCase();
|
|
1200
1200
|
this.decimals = decimals;
|
|
@@ -1227,6 +1227,14 @@ var TokenAmount = /*#__PURE__*/function () {
|
|
|
1227
1227
|
return this.rawAmnt;
|
|
1228
1228
|
};
|
|
1229
1229
|
|
|
1230
|
+
TokenAmount.fromAddressAndAmount = function fromAddressAndAmount(tokenAddress, amount, isRaw) {
|
|
1231
|
+
if (isRaw === void 0) {
|
|
1232
|
+
isRaw = true;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
return new TokenAmount(new Token(tokenAddress, getDecimal(tokenAddress)), amount, isRaw);
|
|
1236
|
+
};
|
|
1237
|
+
|
|
1230
1238
|
return TokenAmount;
|
|
1231
1239
|
}();
|
|
1232
1240
|
|
|
@@ -2331,7 +2339,7 @@ function _fetchLPPrice() {
|
|
|
2331
2339
|
return _fetchLPPriceBy.apply(this, arguments);
|
|
2332
2340
|
};
|
|
2333
2341
|
|
|
2334
|
-
fetchLPPriceBy = function _fetchLPPriceBy2(
|
|
2342
|
+
fetchLPPriceBy = function _fetchLPPriceBy2(_x22) {
|
|
2335
2343
|
return _fetchLPPriceBy.apply(this, arguments);
|
|
2336
2344
|
};
|
|
2337
2345
|
|
|
@@ -2590,78 +2598,97 @@ function fetchPLYPrice(_x15) {
|
|
|
2590
2598
|
|
|
2591
2599
|
function _fetchPLYPrice() {
|
|
2592
2600
|
_fetchPLYPrice = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(provider) {
|
|
2593
|
-
var LPInfo, plyAddress, plyDecimal, wnearAddress, wnearDecimal;
|
|
2594
2601
|
return runtime_1.wrap(function _callee11$(_context11) {
|
|
2595
2602
|
while (1) {
|
|
2596
2603
|
switch (_context11.prev = _context11.next) {
|
|
2597
2604
|
case 0:
|
|
2598
|
-
return _context11.abrupt("return",
|
|
2605
|
+
return _context11.abrupt("return", fetchToken0PriceByLP(networkAddresses.tokens.PLYWNEAR, provider));
|
|
2599
2606
|
|
|
2600
|
-
case
|
|
2601
|
-
|
|
2607
|
+
case 1:
|
|
2608
|
+
case "end":
|
|
2609
|
+
return _context11.stop();
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
}, _callee11);
|
|
2613
|
+
}));
|
|
2614
|
+
return _fetchPLYPrice.apply(this, arguments);
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2617
|
+
function fetchToken0PriceByLP(_x16, _x17) {
|
|
2618
|
+
return _fetchToken0PriceByLP.apply(this, arguments);
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
function _fetchToken0PriceByLP() {
|
|
2622
|
+
_fetchToken0PriceByLP = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(LP, provider) {
|
|
2623
|
+
var LPInfo, token0Decimal, token1Decimal;
|
|
2624
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
2625
|
+
while (1) {
|
|
2626
|
+
switch (_context12.prev = _context12.next) {
|
|
2627
|
+
case 0:
|
|
2628
|
+
_context12.next = 2;
|
|
2629
|
+
return fetchLPPositions(LP, provider);
|
|
2630
|
+
|
|
2631
|
+
case 2:
|
|
2632
|
+
LPInfo = _context12.sent;
|
|
2602
2633
|
|
|
2603
2634
|
if (!LPInfo.reserve1.isZero()) {
|
|
2604
|
-
|
|
2635
|
+
_context12.next = 5;
|
|
2605
2636
|
break;
|
|
2606
2637
|
}
|
|
2607
2638
|
|
|
2608
|
-
return
|
|
2639
|
+
return _context12.abrupt("return", new BigNumber(0));
|
|
2609
2640
|
|
|
2610
|
-
case
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
case 14:
|
|
2621
|
-
return _context11.abrupt("return", _context11.sent.multipliedBy(LPInfo.reserve1.toString()).multipliedBy(decimalFactor(plyDecimal)).dividedBy(decimalFactor(wnearDecimal)).dividedBy(LPInfo.reserve0.toString()));
|
|
2622
|
-
|
|
2623
|
-
case 15:
|
|
2641
|
+
case 5:
|
|
2642
|
+
token0Decimal = getDecimal(LPInfo.token0);
|
|
2643
|
+
token1Decimal = getDecimal(LPInfo.token1);
|
|
2644
|
+
_context12.next = 9;
|
|
2645
|
+
return fetchPrice(LPInfo.token1, provider);
|
|
2646
|
+
|
|
2647
|
+
case 9:
|
|
2648
|
+
return _context12.abrupt("return", _context12.sent.multipliedBy(LPInfo.reserve1.toString()).multipliedBy(decimalFactor(token0Decimal)).dividedBy(decimalFactor(token1Decimal)).dividedBy(LPInfo.reserve0.toString()));
|
|
2649
|
+
|
|
2650
|
+
case 10:
|
|
2624
2651
|
case "end":
|
|
2625
|
-
return
|
|
2652
|
+
return _context12.stop();
|
|
2626
2653
|
}
|
|
2627
2654
|
}
|
|
2628
|
-
},
|
|
2655
|
+
}, _callee12);
|
|
2629
2656
|
}));
|
|
2630
|
-
return
|
|
2657
|
+
return _fetchToken0PriceByLP.apply(this, arguments);
|
|
2631
2658
|
}
|
|
2632
2659
|
|
|
2633
|
-
function fetchValuation(
|
|
2660
|
+
function fetchValuation(_x18, _x19) {
|
|
2634
2661
|
return _fetchValuation.apply(this, arguments);
|
|
2635
2662
|
}
|
|
2636
2663
|
|
|
2637
2664
|
function _fetchValuation() {
|
|
2638
|
-
_fetchValuation = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2665
|
+
_fetchValuation = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(tokenAmount, provider) {
|
|
2639
2666
|
var price;
|
|
2640
|
-
return runtime_1.wrap(function
|
|
2667
|
+
return runtime_1.wrap(function _callee13$(_context13) {
|
|
2641
2668
|
while (1) {
|
|
2642
|
-
switch (
|
|
2669
|
+
switch (_context13.prev = _context13.next) {
|
|
2643
2670
|
case 0:
|
|
2644
2671
|
if (!(tokenAmount.rawAmount() == '0')) {
|
|
2645
|
-
|
|
2672
|
+
_context13.next = 2;
|
|
2646
2673
|
break;
|
|
2647
2674
|
}
|
|
2648
2675
|
|
|
2649
|
-
return
|
|
2676
|
+
return _context13.abrupt("return", new BigNumber(0));
|
|
2650
2677
|
|
|
2651
2678
|
case 2:
|
|
2652
|
-
|
|
2679
|
+
_context13.next = 4;
|
|
2653
2680
|
return fetchPrice(tokenAmount.token.address, provider);
|
|
2654
2681
|
|
|
2655
2682
|
case 4:
|
|
2656
|
-
price =
|
|
2657
|
-
return
|
|
2683
|
+
price = _context13.sent;
|
|
2684
|
+
return _context13.abrupt("return", calcValuation(tokenAmount, price));
|
|
2658
2685
|
|
|
2659
2686
|
case 6:
|
|
2660
2687
|
case "end":
|
|
2661
|
-
return
|
|
2688
|
+
return _context13.stop();
|
|
2662
2689
|
}
|
|
2663
2690
|
}
|
|
2664
|
-
},
|
|
2691
|
+
}, _callee13);
|
|
2665
2692
|
}));
|
|
2666
2693
|
return _fetchValuation.apply(this, arguments);
|
|
2667
2694
|
}
|
|
@@ -2669,23 +2696,23 @@ function _fetchValuation() {
|
|
|
2669
2696
|
function calcValuation(tokenAmount, price) {
|
|
2670
2697
|
return new BigNumber(tokenAmount.formattedAmount()).multipliedBy(price);
|
|
2671
2698
|
}
|
|
2672
|
-
function valuateToken(
|
|
2699
|
+
function valuateToken(_x20, _x21) {
|
|
2673
2700
|
return _valuateToken.apply(this, arguments);
|
|
2674
2701
|
}
|
|
2675
2702
|
|
|
2676
2703
|
function _valuateToken() {
|
|
2677
|
-
_valuateToken = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2704
|
+
_valuateToken = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(tokenAmount, provider) {
|
|
2678
2705
|
var tokenValuation;
|
|
2679
|
-
return runtime_1.wrap(function
|
|
2706
|
+
return runtime_1.wrap(function _callee14$(_context14) {
|
|
2680
2707
|
while (1) {
|
|
2681
|
-
switch (
|
|
2708
|
+
switch (_context14.prev = _context14.next) {
|
|
2682
2709
|
case 0:
|
|
2683
|
-
|
|
2710
|
+
_context14.next = 2;
|
|
2684
2711
|
return fetchValuation(tokenAmount, provider);
|
|
2685
2712
|
|
|
2686
2713
|
case 2:
|
|
2687
|
-
tokenValuation =
|
|
2688
|
-
return
|
|
2714
|
+
tokenValuation = _context14.sent;
|
|
2715
|
+
return _context14.abrupt("return", {
|
|
2689
2716
|
tokenAmount: tokenAmount,
|
|
2690
2717
|
currencyAmount: {
|
|
2691
2718
|
currency: 'USD',
|
|
@@ -2695,10 +2722,10 @@ function _valuateToken() {
|
|
|
2695
2722
|
|
|
2696
2723
|
case 4:
|
|
2697
2724
|
case "end":
|
|
2698
|
-
return
|
|
2725
|
+
return _context14.stop();
|
|
2699
2726
|
}
|
|
2700
2727
|
}
|
|
2701
|
-
},
|
|
2728
|
+
}, _callee14);
|
|
2702
2729
|
}));
|
|
2703
2730
|
return _valuateToken.apply(this, arguments);
|
|
2704
2731
|
}
|
|
@@ -3701,6 +3728,244 @@ var Papermill = /*#__PURE__*/function (_BlockchainEntity) {
|
|
|
3701
3728
|
return Papermill;
|
|
3702
3729
|
}(BlockchainEntity);
|
|
3703
3730
|
|
|
3731
|
+
var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
3732
|
+
_inheritsLoose(StakingRead, _BlockchainEntityRead);
|
|
3733
|
+
|
|
3734
|
+
function StakingRead(networkConnection) {
|
|
3735
|
+
var _this;
|
|
3736
|
+
|
|
3737
|
+
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
3738
|
+
_this._comptroller = new Contract(networkAddresses.misc.COMPTROLLER, ComptrollerABI.abi, networkConnection.provider);
|
|
3739
|
+
_this._auriFairLaunch = new Contract(networkAddresses.misc.AURIFAIRLAUNCH, AuriFairLaunchABI.abi, networkConnection.provider);
|
|
3740
|
+
_this._auriLens = new Contract(networkAddresses.misc.AURILENS, AuriLensABI.abi, networkConnection.provider);
|
|
3741
|
+
return _this;
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
var _proto = StakingRead.prototype;
|
|
3745
|
+
|
|
3746
|
+
_proto.getPLYWNEARPoolDetails = /*#__PURE__*/function () {
|
|
3747
|
+
var _getPLYWNEARPoolDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
3748
|
+
var stakedLiquidity, rewardPerSeconds, stakedLiquidityAmount, totalStakeValuation, promises, i, rewardTokenAddress, rewardToken, rewardPerSecond, APYs;
|
|
3749
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
3750
|
+
while (1) {
|
|
3751
|
+
switch (_context.prev = _context.next) {
|
|
3752
|
+
case 0:
|
|
3753
|
+
_context.next = 2;
|
|
3754
|
+
return this._auriFairLaunch.getPoolInfo(PLYWNEAR_POOL_ID).then(function (res) {
|
|
3755
|
+
stakedLiquidity = res.totalStake;
|
|
3756
|
+
rewardPerSeconds = res.rewardPerSeconds;
|
|
3757
|
+
});
|
|
3758
|
+
|
|
3759
|
+
case 2:
|
|
3760
|
+
stakedLiquidityAmount = new TokenAmount(PLYWNEARToken, stakedLiquidity.toString());
|
|
3761
|
+
_context.next = 5;
|
|
3762
|
+
return fetchValuation(stakedLiquidityAmount, this._networkConnection.provider);
|
|
3763
|
+
|
|
3764
|
+
case 5:
|
|
3765
|
+
totalStakeValuation = _context.sent;
|
|
3766
|
+
promises = [];
|
|
3767
|
+
|
|
3768
|
+
for (i = 0; i < rewardPerSeconds.length; i++) {
|
|
3769
|
+
rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[i];
|
|
3770
|
+
rewardToken = new Token(rewardTokenAddress, getDecimal(rewardTokenAddress));
|
|
3771
|
+
rewardPerSecond = rewardPerSeconds[i];
|
|
3772
|
+
promises.push(fetchValuation(new TokenAmount(rewardToken, rewardPerSecond.toString()), this._networkConnection.provider));
|
|
3773
|
+
}
|
|
3774
|
+
|
|
3775
|
+
APYs = [];
|
|
3776
|
+
_context.next = 11;
|
|
3777
|
+
return Promise.all(promises);
|
|
3778
|
+
|
|
3779
|
+
case 11:
|
|
3780
|
+
_context.sent.forEach(function (rewardPerSecondValuation, i) {
|
|
3781
|
+
var rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[i];
|
|
3782
|
+
var apy = calcLMRewardApr(rewardPerSecondValuation, totalStakeValuation, ONE_DAY * 365).toFixed(DECIMAL_PRECISION);
|
|
3783
|
+
APYs.push({
|
|
3784
|
+
address: rewardTokenAddress,
|
|
3785
|
+
apy: apy
|
|
3786
|
+
});
|
|
3787
|
+
});
|
|
3788
|
+
|
|
3789
|
+
return _context.abrupt("return", {
|
|
3790
|
+
totalStakedLiquidity: {
|
|
3791
|
+
tokenAmount: stakedLiquidityAmount,
|
|
3792
|
+
currencyAmount: {
|
|
3793
|
+
currency: 'USD',
|
|
3794
|
+
amount: totalStakeValuation.toFixed(DECIMAL_PRECISION)
|
|
3795
|
+
}
|
|
3796
|
+
},
|
|
3797
|
+
APYs: APYs
|
|
3798
|
+
});
|
|
3799
|
+
|
|
3800
|
+
case 13:
|
|
3801
|
+
case "end":
|
|
3802
|
+
return _context.stop();
|
|
3803
|
+
}
|
|
3804
|
+
}
|
|
3805
|
+
}, _callee, this);
|
|
3806
|
+
}));
|
|
3807
|
+
|
|
3808
|
+
function getPLYWNEARPoolDetails() {
|
|
3809
|
+
return _getPLYWNEARPoolDetails.apply(this, arguments);
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
return getPLYWNEARPoolDetails;
|
|
3813
|
+
}();
|
|
3814
|
+
|
|
3815
|
+
_proto.stakeBalanceOf = /*#__PURE__*/function () {
|
|
3816
|
+
var _stakeBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(user) {
|
|
3817
|
+
var userInfo, stakeAmount;
|
|
3818
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
3819
|
+
while (1) {
|
|
3820
|
+
switch (_context2.prev = _context2.next) {
|
|
3821
|
+
case 0:
|
|
3822
|
+
_context2.next = 2;
|
|
3823
|
+
return this._auriFairLaunch.getUserInfo(PLYWNEAR_POOL_ID, user);
|
|
3824
|
+
|
|
3825
|
+
case 2:
|
|
3826
|
+
userInfo = _context2.sent;
|
|
3827
|
+
stakeAmount = new TokenAmount(PLYWNEARToken, userInfo.amount.toString());
|
|
3828
|
+
return _context2.abrupt("return", valuateToken(stakeAmount, this._networkConnection.provider));
|
|
3829
|
+
|
|
3830
|
+
case 5:
|
|
3831
|
+
case "end":
|
|
3832
|
+
return _context2.stop();
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
}, _callee2, this);
|
|
3836
|
+
}));
|
|
3837
|
+
|
|
3838
|
+
function stakeBalanceOf(_x) {
|
|
3839
|
+
return _stakeBalanceOf.apply(this, arguments);
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3842
|
+
return stakeBalanceOf;
|
|
3843
|
+
}();
|
|
3844
|
+
|
|
3845
|
+
_proto.LpBalanceOf = /*#__PURE__*/function () {
|
|
3846
|
+
var _LpBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(user) {
|
|
3847
|
+
var lpContract, balance;
|
|
3848
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
3849
|
+
while (1) {
|
|
3850
|
+
switch (_context3.prev = _context3.next) {
|
|
3851
|
+
case 0:
|
|
3852
|
+
lpContract = new Contract(networkAddresses.tokens.PLYWNEAR, EIP20InterfaceABI.abi, this._networkConnection.provider);
|
|
3853
|
+
_context3.next = 3;
|
|
3854
|
+
return lpContract.balanceOf(user);
|
|
3855
|
+
|
|
3856
|
+
case 3:
|
|
3857
|
+
balance = _context3.sent;
|
|
3858
|
+
return _context3.abrupt("return", valuateToken(new TokenAmount(PLYWNEARToken, balance.toString()), this._networkConnection.provider));
|
|
3859
|
+
|
|
3860
|
+
case 5:
|
|
3861
|
+
case "end":
|
|
3862
|
+
return _context3.stop();
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
}, _callee3, this);
|
|
3866
|
+
}));
|
|
3867
|
+
|
|
3868
|
+
function LpBalanceOf(_x2) {
|
|
3869
|
+
return _LpBalanceOf.apply(this, arguments);
|
|
3870
|
+
}
|
|
3871
|
+
|
|
3872
|
+
return LpBalanceOf;
|
|
3873
|
+
}();
|
|
3874
|
+
|
|
3875
|
+
_proto.unclaimedRewardsOf = /*#__PURE__*/function () {
|
|
3876
|
+
var _unclaimedRewardsOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(user) {
|
|
3877
|
+
var userInfo, rewards;
|
|
3878
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
3879
|
+
while (1) {
|
|
3880
|
+
switch (_context4.prev = _context4.next) {
|
|
3881
|
+
case 0:
|
|
3882
|
+
_context4.next = 2;
|
|
3883
|
+
return this._auriFairLaunch.callStatic.updateAndGetUserInfo(PLYWNEAR_POOL_ID, user, {
|
|
3884
|
+
from: user
|
|
3885
|
+
});
|
|
3886
|
+
|
|
3887
|
+
case 2:
|
|
3888
|
+
userInfo = _context4.sent;
|
|
3889
|
+
rewards = userInfo.unclaimedRewards;
|
|
3890
|
+
return _context4.abrupt("return", rewards.map(function (reward, i) {
|
|
3891
|
+
return TokenAmount.fromAddressAndAmount(PLYWNEAR_REWARD_TOKENS[i], reward.toString());
|
|
3892
|
+
}));
|
|
3893
|
+
|
|
3894
|
+
case 5:
|
|
3895
|
+
case "end":
|
|
3896
|
+
return _context4.stop();
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
}, _callee4, this);
|
|
3900
|
+
}));
|
|
3901
|
+
|
|
3902
|
+
function unclaimedRewardsOf(_x3) {
|
|
3903
|
+
return _unclaimedRewardsOf.apply(this, arguments);
|
|
3904
|
+
}
|
|
3905
|
+
|
|
3906
|
+
return unclaimedRewardsOf;
|
|
3907
|
+
}();
|
|
3908
|
+
|
|
3909
|
+
return StakingRead;
|
|
3910
|
+
}(BlockchainEntityRead);
|
|
3911
|
+
var StakingReadWrite = /*#__PURE__*/function (_StakingRead) {
|
|
3912
|
+
_inheritsLoose(StakingReadWrite, _StakingRead);
|
|
3913
|
+
|
|
3914
|
+
function StakingReadWrite() {
|
|
3915
|
+
return _StakingRead.apply(this, arguments) || this;
|
|
3916
|
+
}
|
|
3917
|
+
|
|
3918
|
+
var _proto2 = StakingReadWrite.prototype;
|
|
3919
|
+
|
|
3920
|
+
_proto2.stake = /*#__PURE__*/function () {
|
|
3921
|
+
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(amount) {
|
|
3922
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
3923
|
+
while (1) {
|
|
3924
|
+
switch (_context5.prev = _context5.next) {
|
|
3925
|
+
case 0:
|
|
3926
|
+
return _context5.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).deposit(PLYWNEAR_POOL_ID, amount.rawAmount()));
|
|
3927
|
+
|
|
3928
|
+
case 1:
|
|
3929
|
+
case "end":
|
|
3930
|
+
return _context5.stop();
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
}, _callee5, this);
|
|
3934
|
+
}));
|
|
3935
|
+
|
|
3936
|
+
function stake(_x4) {
|
|
3937
|
+
return _stake.apply(this, arguments);
|
|
3938
|
+
}
|
|
3939
|
+
|
|
3940
|
+
return stake;
|
|
3941
|
+
}();
|
|
3942
|
+
|
|
3943
|
+
_proto2.unstake = /*#__PURE__*/function () {
|
|
3944
|
+
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(amount) {
|
|
3945
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
3946
|
+
while (1) {
|
|
3947
|
+
switch (_context6.prev = _context6.next) {
|
|
3948
|
+
case 0:
|
|
3949
|
+
return _context6.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).withdraw(PLYWNEAR_POOL_ID, amount.rawAmount()));
|
|
3950
|
+
|
|
3951
|
+
case 1:
|
|
3952
|
+
case "end":
|
|
3953
|
+
return _context6.stop();
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
}, _callee6, this);
|
|
3957
|
+
}));
|
|
3958
|
+
|
|
3959
|
+
function unstake(_x5) {
|
|
3960
|
+
return _unstake.apply(this, arguments);
|
|
3961
|
+
}
|
|
3962
|
+
|
|
3963
|
+
return unstake;
|
|
3964
|
+
}();
|
|
3965
|
+
|
|
3966
|
+
return StakingReadWrite;
|
|
3967
|
+
}(StakingRead);
|
|
3968
|
+
|
|
3704
3969
|
var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
3705
3970
|
_inheritsLoose(SdkRead, _BlockchainEntityRead);
|
|
3706
3971
|
|
|
@@ -3708,6 +3973,7 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3708
3973
|
var _this;
|
|
3709
3974
|
|
|
3710
3975
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
3976
|
+
_this._stakingRead = new StakingRead(networkConnection);
|
|
3711
3977
|
_this._comptroller = new Contract(networkAddresses.misc.COMPTROLLER, ComptrollerABI.abi, networkConnection.provider);
|
|
3712
3978
|
_this._auriFairLaunch = new Contract(networkAddresses.misc.AURIFAIRLAUNCH, AuriFairLaunchABI.abi, networkConnection.provider);
|
|
3713
3979
|
_this._auriLens = new Contract(networkAddresses.misc.AURILENS, AuriLensABI.abi, networkConnection.provider);
|
|
@@ -3859,60 +4125,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3859
4125
|
|
|
3860
4126
|
_proto.getPLYWNEARPoolDetails = /*#__PURE__*/function () {
|
|
3861
4127
|
var _getPLYWNEARPoolDetails = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
3862
|
-
var stakedLiquidity, rewardPerSeconds, stakedLiquidityAmount, totalStakeValuation, promises, _i, rewardTokenAddress, rewardToken, rewardPerSecond, APYs;
|
|
3863
|
-
|
|
3864
4128
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
3865
4129
|
while (1) {
|
|
3866
4130
|
switch (_context2.prev = _context2.next) {
|
|
3867
4131
|
case 0:
|
|
3868
|
-
_context2.
|
|
3869
|
-
return this._auriFairLaunch.getPoolInfo(PLYWNEAR_POOL_ID).then(function (res) {
|
|
3870
|
-
stakedLiquidity = res.totalStake;
|
|
3871
|
-
rewardPerSeconds = res.rewardPerSeconds;
|
|
3872
|
-
});
|
|
3873
|
-
|
|
3874
|
-
case 2:
|
|
3875
|
-
stakedLiquidityAmount = new TokenAmount(PLYWNEARToken, stakedLiquidity.toString());
|
|
3876
|
-
_context2.next = 5;
|
|
3877
|
-
return fetchValuation(stakedLiquidityAmount, this._networkConnection.provider);
|
|
3878
|
-
|
|
3879
|
-
case 5:
|
|
3880
|
-
totalStakeValuation = _context2.sent;
|
|
3881
|
-
promises = [];
|
|
3882
|
-
|
|
3883
|
-
for (_i = 0; _i < rewardPerSeconds.length; _i++) {
|
|
3884
|
-
rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[_i];
|
|
3885
|
-
rewardToken = new Token(rewardTokenAddress, getDecimal(rewardTokenAddress));
|
|
3886
|
-
rewardPerSecond = rewardPerSeconds[_i];
|
|
3887
|
-
promises.push(fetchValuation(new TokenAmount(rewardToken, rewardPerSecond.toString()), this._networkConnection.provider));
|
|
3888
|
-
}
|
|
3889
|
-
|
|
3890
|
-
APYs = [];
|
|
3891
|
-
_context2.next = 11;
|
|
3892
|
-
return Promise.all(promises);
|
|
3893
|
-
|
|
3894
|
-
case 11:
|
|
3895
|
-
_context2.sent.forEach(function (rewardPerSecondValuation, i) {
|
|
3896
|
-
var rewardTokenAddress = PLYWNEAR_REWARD_TOKENS[i];
|
|
3897
|
-
var apy = calcLMRewardApr(rewardPerSecondValuation, totalStakeValuation, ONE_DAY * 365).toFixed(DECIMAL_PRECISION);
|
|
3898
|
-
APYs.push({
|
|
3899
|
-
address: rewardTokenAddress,
|
|
3900
|
-
apy: apy
|
|
3901
|
-
});
|
|
3902
|
-
});
|
|
3903
|
-
|
|
3904
|
-
return _context2.abrupt("return", {
|
|
3905
|
-
totalStakedLiquidity: {
|
|
3906
|
-
tokenAmount: stakedLiquidityAmount,
|
|
3907
|
-
currencyAmount: {
|
|
3908
|
-
currency: 'USD',
|
|
3909
|
-
amount: totalStakeValuation.toFixed(DECIMAL_PRECISION)
|
|
3910
|
-
}
|
|
3911
|
-
},
|
|
3912
|
-
APYs: APYs
|
|
3913
|
-
});
|
|
4132
|
+
return _context2.abrupt("return", this._stakingRead.getPLYWNEARPoolDetails());
|
|
3914
4133
|
|
|
3915
|
-
case
|
|
4134
|
+
case 1:
|
|
3916
4135
|
case "end":
|
|
3917
4136
|
return _context2.stop();
|
|
3918
4137
|
}
|
|
@@ -3961,20 +4180,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3961
4180
|
|
|
3962
4181
|
_proto.stakeBalanceOf = /*#__PURE__*/function () {
|
|
3963
4182
|
var _stakeBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(user) {
|
|
3964
|
-
var userInfo, stakeAmount;
|
|
3965
4183
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
3966
4184
|
while (1) {
|
|
3967
4185
|
switch (_context4.prev = _context4.next) {
|
|
3968
4186
|
case 0:
|
|
3969
|
-
_context4.
|
|
3970
|
-
return this._auriFairLaunch.getUserInfo(PLYWNEAR_POOL_ID, user);
|
|
4187
|
+
return _context4.abrupt("return", this._stakingRead.stakeBalanceOf(user));
|
|
3971
4188
|
|
|
3972
|
-
case
|
|
3973
|
-
userInfo = _context4.sent;
|
|
3974
|
-
stakeAmount = new TokenAmount(PLYWNEARToken, userInfo.amount.toString());
|
|
3975
|
-
return _context4.abrupt("return", valuateToken(stakeAmount, this._networkConnection.provider));
|
|
3976
|
-
|
|
3977
|
-
case 5:
|
|
4189
|
+
case 1:
|
|
3978
4190
|
case "end":
|
|
3979
4191
|
return _context4.stop();
|
|
3980
4192
|
}
|
|
@@ -3991,20 +4203,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3991
4203
|
|
|
3992
4204
|
_proto.LpBalanceOf = /*#__PURE__*/function () {
|
|
3993
4205
|
var _LpBalanceOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(user) {
|
|
3994
|
-
var lpContract, balance;
|
|
3995
4206
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
3996
4207
|
while (1) {
|
|
3997
4208
|
switch (_context5.prev = _context5.next) {
|
|
3998
4209
|
case 0:
|
|
3999
|
-
|
|
4000
|
-
_context5.next = 3;
|
|
4001
|
-
return lpContract.balanceOf(user);
|
|
4002
|
-
|
|
4003
|
-
case 3:
|
|
4004
|
-
balance = _context5.sent;
|
|
4005
|
-
return _context5.abrupt("return", valuateToken(new TokenAmount(PLYWNEARToken, balance.toString()), this._networkConnection.provider));
|
|
4210
|
+
return _context5.abrupt("return", this._stakingRead.LpBalanceOf(user));
|
|
4006
4211
|
|
|
4007
|
-
case
|
|
4212
|
+
case 1:
|
|
4008
4213
|
case "end":
|
|
4009
4214
|
return _context5.stop();
|
|
4010
4215
|
}
|
|
@@ -4019,6 +4224,29 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4019
4224
|
return LpBalanceOf;
|
|
4020
4225
|
}();
|
|
4021
4226
|
|
|
4227
|
+
_proto.unclaimedRewardsOf = /*#__PURE__*/function () {
|
|
4228
|
+
var _unclaimedRewardsOf = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(user) {
|
|
4229
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
4230
|
+
while (1) {
|
|
4231
|
+
switch (_context6.prev = _context6.next) {
|
|
4232
|
+
case 0:
|
|
4233
|
+
return _context6.abrupt("return", this._stakingRead.unclaimedRewardsOf(user));
|
|
4234
|
+
|
|
4235
|
+
case 1:
|
|
4236
|
+
case "end":
|
|
4237
|
+
return _context6.stop();
|
|
4238
|
+
}
|
|
4239
|
+
}
|
|
4240
|
+
}, _callee6, this);
|
|
4241
|
+
}));
|
|
4242
|
+
|
|
4243
|
+
function unclaimedRewardsOf(_x5) {
|
|
4244
|
+
return _unclaimedRewardsOf.apply(this, arguments);
|
|
4245
|
+
}
|
|
4246
|
+
|
|
4247
|
+
return unclaimedRewardsOf;
|
|
4248
|
+
}();
|
|
4249
|
+
|
|
4022
4250
|
_proto.calcHypotheticalStats = function calcHypotheticalStats(_ref) {
|
|
4023
4251
|
var userMarketDetail = _ref.userMarketDetail,
|
|
4024
4252
|
currentBorrowLimit = _ref.currentBorrowLimit,
|
|
@@ -4069,19 +4297,19 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4069
4297
|
var _proto2 = SdkReadWrite.prototype;
|
|
4070
4298
|
|
|
4071
4299
|
_proto2.claim = /*#__PURE__*/function () {
|
|
4072
|
-
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4073
|
-
return runtime_1.wrap(function
|
|
4300
|
+
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
|
|
4301
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
4074
4302
|
while (1) {
|
|
4075
|
-
switch (
|
|
4303
|
+
switch (_context7.prev = _context7.next) {
|
|
4076
4304
|
case 0:
|
|
4077
|
-
return
|
|
4305
|
+
return _context7.abrupt("return", this._auriLens.connect(this._networkConnection.signer).claimRewards(this._comptroller.address, this._auriFairLaunch.address, ALL_STAKING_POOLS));
|
|
4078
4306
|
|
|
4079
4307
|
case 1:
|
|
4080
4308
|
case "end":
|
|
4081
|
-
return
|
|
4309
|
+
return _context7.stop();
|
|
4082
4310
|
}
|
|
4083
4311
|
}
|
|
4084
|
-
},
|
|
4312
|
+
}, _callee7, this);
|
|
4085
4313
|
}));
|
|
4086
4314
|
|
|
4087
4315
|
function claim() {
|
|
@@ -4092,22 +4320,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4092
4320
|
}();
|
|
4093
4321
|
|
|
4094
4322
|
_proto2.stake = /*#__PURE__*/function () {
|
|
4095
|
-
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4096
|
-
return runtime_1.wrap(function
|
|
4323
|
+
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
|
|
4324
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4097
4325
|
while (1) {
|
|
4098
|
-
switch (
|
|
4326
|
+
switch (_context8.prev = _context8.next) {
|
|
4099
4327
|
case 0:
|
|
4100
|
-
return
|
|
4328
|
+
return _context8.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
|
|
4101
4329
|
|
|
4102
4330
|
case 1:
|
|
4103
4331
|
case "end":
|
|
4104
|
-
return
|
|
4332
|
+
return _context8.stop();
|
|
4105
4333
|
}
|
|
4106
4334
|
}
|
|
4107
|
-
},
|
|
4335
|
+
}, _callee8, this);
|
|
4108
4336
|
}));
|
|
4109
4337
|
|
|
4110
|
-
function stake(
|
|
4338
|
+
function stake(_x6) {
|
|
4111
4339
|
return _stake.apply(this, arguments);
|
|
4112
4340
|
}
|
|
4113
4341
|
|
|
@@ -4115,22 +4343,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4115
4343
|
}();
|
|
4116
4344
|
|
|
4117
4345
|
_proto2.unstake = /*#__PURE__*/function () {
|
|
4118
|
-
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4119
|
-
return runtime_1.wrap(function
|
|
4346
|
+
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(amount) {
|
|
4347
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
4120
4348
|
while (1) {
|
|
4121
|
-
switch (
|
|
4349
|
+
switch (_context9.prev = _context9.next) {
|
|
4122
4350
|
case 0:
|
|
4123
|
-
return
|
|
4351
|
+
return _context9.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
|
|
4124
4352
|
|
|
4125
4353
|
case 1:
|
|
4126
4354
|
case "end":
|
|
4127
|
-
return
|
|
4355
|
+
return _context9.stop();
|
|
4128
4356
|
}
|
|
4129
4357
|
}
|
|
4130
|
-
},
|
|
4358
|
+
}, _callee9, this);
|
|
4131
4359
|
}));
|
|
4132
4360
|
|
|
4133
|
-
function unstake(
|
|
4361
|
+
function unstake(_x7) {
|
|
4134
4362
|
return _unstake.apply(this, arguments);
|
|
4135
4363
|
}
|
|
4136
4364
|
|
|
@@ -4138,21 +4366,21 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4138
4366
|
}();
|
|
4139
4367
|
|
|
4140
4368
|
_proto2.faucetDrip = /*#__PURE__*/function () {
|
|
4141
|
-
var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4369
|
+
var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
|
|
4142
4370
|
var faucet;
|
|
4143
|
-
return runtime_1.wrap(function
|
|
4371
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
4144
4372
|
while (1) {
|
|
4145
|
-
switch (
|
|
4373
|
+
switch (_context10.prev = _context10.next) {
|
|
4146
4374
|
case 0:
|
|
4147
4375
|
faucet = new Contract(networkAddresses.misc.FAUCET, FaucetABI.abi, this._networkConnection.provider);
|
|
4148
|
-
return
|
|
4376
|
+
return _context10.abrupt("return", faucet.connect(this._networkConnection.signer).drip());
|
|
4149
4377
|
|
|
4150
4378
|
case 2:
|
|
4151
4379
|
case "end":
|
|
4152
|
-
return
|
|
4380
|
+
return _context10.stop();
|
|
4153
4381
|
}
|
|
4154
4382
|
}
|
|
4155
|
-
},
|
|
4383
|
+
}, _callee10, this);
|
|
4156
4384
|
}));
|
|
4157
4385
|
|
|
4158
4386
|
function faucetDrip() {
|
|
@@ -107388,5 +107616,5 @@ BigNumber.config({
|
|
|
107388
107616
|
DECIMAL_PLACES: 50
|
|
107389
107617
|
});
|
|
107390
107618
|
|
|
107391
|
-
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, ETHAddress, INF, MarketAction, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, REWARD_CLAIM_START, SDK, SdkRead, SdkReadWrite, Token, TokenAmount, TransferEventQuery, calcLMRewardApr, calcValuation, decimalFactor, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getBlockBeforeTimestamp, getBlockTimestamp, getCurrentTimestamp, getDecimal, isSameAddress, networkAddresses, validateAndParseAddress, valuateToken };
|
|
107619
|
+
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, ETHAddress, INF, MarketAction, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, REWARD_CLAIM_START, SDK, SdkRead, SdkReadWrite, Token, TokenAmount, TransferEventQuery, calcLMRewardApr, calcValuation, decimalFactor, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getBlockBeforeTimestamp, getBlockTimestamp, getCurrentTimestamp, getDecimal, isSameAddress, networkAddresses, validateAndParseAddress, valuateToken };
|
|
107392
107620
|
//# sourceMappingURL=sdk.esm.js.map
|