@aurigami/sdk 1.6.8 → 1.6.10
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 +2 -1
- package/dist/abis/index.d.ts +3 -2
- package/dist/consts/index.d.ts +2 -1
- package/dist/consts/symbols.d.ts +1 -0
- package/dist/contracts/misc.d.ts +3 -0
- package/dist/entities/auriEnv.d.ts +2 -1
- package/dist/helpers/helpers.d.ts +1 -0
- package/dist/sdk.cjs.development.js +214 -54
- 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 +221 -63
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +9 -0
- package/package.json +3 -3
- package/src/SDK.ts +9 -13
- package/src/abis/index.ts +4 -2
- package/src/consts/constants.ts +1 -1
- package/src/consts/index.ts +2 -1
- package/src/consts/symbols.ts +5 -0
- package/src/contracts/misc.ts +54 -1
- package/src/entities/auriEnv.ts +14 -1
- package/src/helpers/helpers.ts +7 -0
- package/src/types/index.ts +11 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -4,23 +4,23 @@ import { Logger } from 'ethers/lib/utils';
|
|
|
4
4
|
import MAINNET_ADDRESSES from '@aurigami/contracts/deployments/aurora_mainnet.json';
|
|
5
5
|
export { default as MAINNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_mainnet.json';
|
|
6
6
|
export { default as TESTNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_testnet.json';
|
|
7
|
-
import abis$
|
|
8
|
-
import abis$
|
|
7
|
+
import abis$7 from '@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json';
|
|
8
|
+
import abis$6 from '@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json';
|
|
9
9
|
import AuriAirdropABI from '@aurigami/contracts/artifacts/contracts/AuriAirdrop.sol/AuriAirdrop.json';
|
|
10
10
|
import abis$1 from '@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json';
|
|
11
11
|
import abis$2 from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json';
|
|
12
12
|
import AuriOracleABI from '@aurigami/contracts/artifacts/contracts/AuriOracle.sol/AuriOracle.json';
|
|
13
|
+
import AuTokenABI from '@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json';
|
|
13
14
|
import abis from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
|
|
14
|
-
import abis$
|
|
15
|
+
import abis$8 from '@aurigami/contracts/artifacts/contracts/EthRepayHelper.sol/EthRepayHelper.json';
|
|
15
16
|
import abis$3 from '@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json';
|
|
17
|
+
import abis$5 from '@aurigami/contracts/artifacts/contracts/mock/AuriInternalLens.sol/AuriInternalLens.json';
|
|
16
18
|
import IUniswapV2PairABI from '@aurigami/contracts/artifacts/contracts/mock/IUniswapV2Pair.sol/IUniswapV2Pair.json';
|
|
17
|
-
import abis$
|
|
18
|
-
import abis$a from '@aurigami/contracts/artifacts/contracts/mock/UltilizationHelper.sol/UltilizationHelper.json';
|
|
19
|
+
import abis$9 from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json';
|
|
19
20
|
import abis$4 from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
|
|
20
|
-
import abis$
|
|
21
|
+
import abis$a from '@aurigami/contracts/artifacts/contracts/ReferralDirectory.sol/ReferralDirectory.json';
|
|
21
22
|
import { Signer } from '@ethersproject/abstract-signer';
|
|
22
23
|
import axios from 'axios';
|
|
23
|
-
import AuTokenABI from '@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json';
|
|
24
24
|
|
|
25
25
|
var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
|
|
26
26
|
var ETHAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
|
|
@@ -83,7 +83,7 @@ var networkAddresses = {
|
|
|
83
83
|
TEAM_MULTISIG: /*#__PURE__*/'0x2D05FfFE70CE64c5954710D4C308dB31C8dBd8dE'.toLowerCase(),
|
|
84
84
|
PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
85
85
|
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
|
|
86
|
-
|
|
86
|
+
AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase()
|
|
87
87
|
},
|
|
88
88
|
tokens: {
|
|
89
89
|
AURORA: /*#__PURE__*/'0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -313,6 +313,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
313
313
|
_this.ply = _this.getContract(networkAddresses.tokens.PLY, abis$3.abi);
|
|
314
314
|
_this.pulp = _this.getContract(networkAddresses.tokens.PULP, abis$4.abi); // this.faucet = this.getContract<Faucet>(networkAddresses.misc.FAUCET, abis.FaucetABI.abi);
|
|
315
315
|
|
|
316
|
+
_this.auriInternalLens = _this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$5.abi);
|
|
316
317
|
return _this;
|
|
317
318
|
} // public faucet: Faucet;
|
|
318
319
|
|
|
@@ -1086,6 +1087,10 @@ try {
|
|
|
1086
1087
|
}
|
|
1087
1088
|
});
|
|
1088
1089
|
|
|
1090
|
+
var symbolRecords = /*#__PURE__*/Object.fromEntries( /*#__PURE__*/networkAddresses.auTokens.map(function (e) {
|
|
1091
|
+
return [e.address.toLowerCase(), e.name];
|
|
1092
|
+
}));
|
|
1093
|
+
|
|
1089
1094
|
var AURORA_API_BASE_URL = 'https://api.aurorascan.dev/api';
|
|
1090
1095
|
function getQuery(_x, _x2, _x3) {
|
|
1091
1096
|
return _getQuery.apply(this, arguments);
|
|
@@ -1161,6 +1166,11 @@ function getDecimal(address) {
|
|
|
1161
1166
|
assert(decimalRecords[addressLowercase] != undefined, 'Decimal not found for ' + address);
|
|
1162
1167
|
return decimalRecords[addressLowercase];
|
|
1163
1168
|
}
|
|
1169
|
+
function getSymbol(address) {
|
|
1170
|
+
var addressLowercase = address.toLowerCase();
|
|
1171
|
+
assert(symbolRecords[addressLowercase] != undefined, 'Symbol not found for ' + address);
|
|
1172
|
+
return symbolRecords[addressLowercase];
|
|
1173
|
+
}
|
|
1164
1174
|
function calcLMRewardApr(rewardsValue, totalStakeValue, frequencyPerYear) {
|
|
1165
1175
|
if (rewardsValue.isZero()) {
|
|
1166
1176
|
return new BigNumber(0);
|
|
@@ -2031,6 +2041,7 @@ var helpers = {
|
|
|
2031
2041
|
getCurrentTimestamp: getCurrentTimestamp,
|
|
2032
2042
|
validateAndParseAddress: validateAndParseAddress,
|
|
2033
2043
|
getDecimal: getDecimal,
|
|
2044
|
+
getSymbol: getSymbol,
|
|
2034
2045
|
calcLMRewardApr: calcLMRewardApr,
|
|
2035
2046
|
getBlockTimestamp: getBlockTimestamp,
|
|
2036
2047
|
getBlockBeforeTimestamp: getBlockBeforeTimestamp,
|
|
@@ -2230,9 +2241,9 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2230
2241
|
_this.env = new AuriEnv(networkConnection);
|
|
2231
2242
|
|
|
2232
2243
|
if (isSameAddress(underlyingAsset, ETHAddress)) {
|
|
2233
|
-
_this.auToken = new Contract(auToken, abis$5.abi, networkConnection.provider);
|
|
2234
|
-
} else {
|
|
2235
2244
|
_this.auToken = new Contract(auToken, abis$6.abi, networkConnection.provider);
|
|
2245
|
+
} else {
|
|
2246
|
+
_this.auToken = new Contract(auToken, abis$7.abi, networkConnection.provider);
|
|
2236
2247
|
}
|
|
2237
2248
|
|
|
2238
2249
|
_this.underlying = new Token(underlyingAsset, getDecimal(underlyingAsset));
|
|
@@ -2695,7 +2706,7 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
|
|
|
2695
2706
|
var _this3;
|
|
2696
2707
|
|
|
2697
2708
|
_this3 = _MoneyMarketRead.call(this, networkConnection, auToken, underlyingAsset) || this;
|
|
2698
|
-
_this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$
|
|
2709
|
+
_this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$8.abi, networkConnection.provider);
|
|
2699
2710
|
return _this3;
|
|
2700
2711
|
}
|
|
2701
2712
|
|
|
@@ -2909,7 +2920,7 @@ var MulticallRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2909
2920
|
var _this;
|
|
2910
2921
|
|
|
2911
2922
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
2912
|
-
_this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$
|
|
2923
|
+
_this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$9.abi, networkConnection.provider);
|
|
2913
2924
|
return _this;
|
|
2914
2925
|
}
|
|
2915
2926
|
/**
|
|
@@ -3929,6 +3940,139 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3929
3940
|
return getPlyCirculatingSupply;
|
|
3930
3941
|
}();
|
|
3931
3942
|
|
|
3943
|
+
_proto.getUtilisation = /*#__PURE__*/function () {
|
|
3944
|
+
var _getUtilisation = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(userAddr) {
|
|
3945
|
+
var accountDetail, sumBorrow, sumCol;
|
|
3946
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
3947
|
+
while (1) {
|
|
3948
|
+
switch (_context4.prev = _context4.next) {
|
|
3949
|
+
case 0:
|
|
3950
|
+
_context4.next = 2;
|
|
3951
|
+
return this.env.auriInternalLens.getAccountLiquidity(userAddr);
|
|
3952
|
+
|
|
3953
|
+
case 2:
|
|
3954
|
+
accountDetail = _context4.sent;
|
|
3955
|
+
sumBorrow = new BigNumber(accountDetail.sumBorrowPlusEffects.toString());
|
|
3956
|
+
sumCol = new BigNumber(accountDetail.sumCollateral.toString());
|
|
3957
|
+
return _context4.abrupt("return", sumBorrow.dividedBy(sumCol));
|
|
3958
|
+
|
|
3959
|
+
case 6:
|
|
3960
|
+
case "end":
|
|
3961
|
+
return _context4.stop();
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
}, _callee4, this);
|
|
3965
|
+
}));
|
|
3966
|
+
|
|
3967
|
+
function getUtilisation(_x3) {
|
|
3968
|
+
return _getUtilisation.apply(this, arguments);
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3971
|
+
return getUtilisation;
|
|
3972
|
+
}();
|
|
3973
|
+
|
|
3974
|
+
_proto.sneakAccounts = /*#__PURE__*/function () {
|
|
3975
|
+
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(accounts, tokenAddresses) {
|
|
3976
|
+
var _this3 = this;
|
|
3977
|
+
|
|
3978
|
+
var _1E18, _1E9, oracle, tokens, prices, exrate, res, _iterator2, _step2, addr, infos, _i, snapshot, bal, bor, balR, borR;
|
|
3979
|
+
|
|
3980
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
3981
|
+
while (1) {
|
|
3982
|
+
switch (_context5.prev = _context5.next) {
|
|
3983
|
+
case 0:
|
|
3984
|
+
_1E18 = BigNumber$1.from(10).pow(18);
|
|
3985
|
+
_1E9 = BigNumber$1.from(10).pow(9);
|
|
3986
|
+
oracle = this.env.getContract(networkAddresses.misc.oracle, AuriOracleABI.abi);
|
|
3987
|
+
tokens = tokenAddresses.map(function (addr) {
|
|
3988
|
+
return _this3.env.getContract(addr, AuTokenABI.abi);
|
|
3989
|
+
});
|
|
3990
|
+
_context5.next = 6;
|
|
3991
|
+
return oracle.getUnderlyingPrices(tokenAddresses);
|
|
3992
|
+
|
|
3993
|
+
case 6:
|
|
3994
|
+
prices = _context5.sent;
|
|
3995
|
+
_context5.next = 9;
|
|
3996
|
+
return this.env.auriInternalLens.callStatic.getExchangeRates(tokenAddresses);
|
|
3997
|
+
|
|
3998
|
+
case 9:
|
|
3999
|
+
exrate = _context5.sent;
|
|
4000
|
+
res = [];
|
|
4001
|
+
_iterator2 = _createForOfIteratorHelperLoose(accounts);
|
|
4002
|
+
|
|
4003
|
+
case 12:
|
|
4004
|
+
if ((_step2 = _iterator2()).done) {
|
|
4005
|
+
_context5.next = 33;
|
|
4006
|
+
break;
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
addr = _step2.value;
|
|
4010
|
+
infos = [];
|
|
4011
|
+
_i = 0;
|
|
4012
|
+
|
|
4013
|
+
case 16:
|
|
4014
|
+
if (!(_i < tokens.length)) {
|
|
4015
|
+
_context5.next = 30;
|
|
4016
|
+
break;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
_context5.next = 19;
|
|
4020
|
+
return tokens[_i].getAccountSnapshot(addr);
|
|
4021
|
+
|
|
4022
|
+
case 19:
|
|
4023
|
+
snapshot = _context5.sent;
|
|
4024
|
+
bal = snapshot[0].mul(exrate[_i]).div(_1E18).mul(prices[_i]).div(_1E18);
|
|
4025
|
+
bor = snapshot[1].mul(prices[_i]).div(_1E18);
|
|
4026
|
+
balR = bal.div(_1E9).toNumber() / Math.pow(10, 9);
|
|
4027
|
+
borR = bor.div(_1E9).toNumber() / Math.pow(10, 9);
|
|
4028
|
+
|
|
4029
|
+
if (!(balR < 0.1 || borR < 0.1)) {
|
|
4030
|
+
_context5.next = 26;
|
|
4031
|
+
break;
|
|
4032
|
+
}
|
|
4033
|
+
|
|
4034
|
+
return _context5.abrupt("continue", 27);
|
|
4035
|
+
|
|
4036
|
+
case 26:
|
|
4037
|
+
infos.push({
|
|
4038
|
+
token: getSymbol(tokenAddresses[_i]),
|
|
4039
|
+
deposit: balR,
|
|
4040
|
+
borrow: borR
|
|
4041
|
+
});
|
|
4042
|
+
|
|
4043
|
+
case 27:
|
|
4044
|
+
++_i;
|
|
4045
|
+
_context5.next = 16;
|
|
4046
|
+
break;
|
|
4047
|
+
|
|
4048
|
+
case 30:
|
|
4049
|
+
res.push({
|
|
4050
|
+
address: addr,
|
|
4051
|
+
tokens: infos
|
|
4052
|
+
});
|
|
4053
|
+
|
|
4054
|
+
case 31:
|
|
4055
|
+
_context5.next = 12;
|
|
4056
|
+
break;
|
|
4057
|
+
|
|
4058
|
+
case 33:
|
|
4059
|
+
return _context5.abrupt("return", res);
|
|
4060
|
+
|
|
4061
|
+
case 34:
|
|
4062
|
+
case "end":
|
|
4063
|
+
return _context5.stop();
|
|
4064
|
+
}
|
|
4065
|
+
}
|
|
4066
|
+
}, _callee5, this);
|
|
4067
|
+
}));
|
|
4068
|
+
|
|
4069
|
+
function sneakAccounts(_x4, _x5) {
|
|
4070
|
+
return _sneakAccounts.apply(this, arguments);
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
return sneakAccounts;
|
|
4074
|
+
}();
|
|
4075
|
+
|
|
3932
4076
|
return MiscRead;
|
|
3933
4077
|
}(BlockchainEntityRead);
|
|
3934
4078
|
|
|
@@ -3939,7 +4083,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3939
4083
|
var _this;
|
|
3940
4084
|
|
|
3941
4085
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
3942
|
-
_this.referral = new Contract(networkAddresses.misc.REFERRAL, abis$
|
|
4086
|
+
_this.referral = new Contract(networkAddresses.misc.REFERRAL, abis$a.abi, networkConnection.provider);
|
|
3943
4087
|
return _this;
|
|
3944
4088
|
}
|
|
3945
4089
|
/**
|
|
@@ -4376,24 +4520,15 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4376
4520
|
return getPlyCirculatingSupply;
|
|
4377
4521
|
}();
|
|
4378
4522
|
|
|
4379
|
-
_proto.
|
|
4380
|
-
var
|
|
4381
|
-
var helper, accountDetail, sumBorrow, sumCol;
|
|
4523
|
+
_proto.getUtilisation = /*#__PURE__*/function () {
|
|
4524
|
+
var _getUtilisation = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(userAddr) {
|
|
4382
4525
|
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4383
4526
|
while (1) {
|
|
4384
4527
|
switch (_context8.prev = _context8.next) {
|
|
4385
4528
|
case 0:
|
|
4386
|
-
|
|
4387
|
-
_context8.next = 3;
|
|
4388
|
-
return helper.getAccountLiquidity(userAddr);
|
|
4529
|
+
return _context8.abrupt("return", this._misc.getUtilisation(userAddr));
|
|
4389
4530
|
|
|
4390
|
-
case
|
|
4391
|
-
accountDetail = _context8.sent;
|
|
4392
|
-
sumBorrow = new BigNumber(accountDetail.sumBorrowPlusEffects.toString());
|
|
4393
|
-
sumCol = new BigNumber(accountDetail.sumCollateral.toString());
|
|
4394
|
-
return _context8.abrupt("return", sumBorrow.dividedBy(sumCol));
|
|
4395
|
-
|
|
4396
|
-
case 7:
|
|
4531
|
+
case 1:
|
|
4397
4532
|
case "end":
|
|
4398
4533
|
return _context8.stop();
|
|
4399
4534
|
}
|
|
@@ -4401,11 +4536,34 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4401
4536
|
}, _callee8, this);
|
|
4402
4537
|
}));
|
|
4403
4538
|
|
|
4404
|
-
function
|
|
4405
|
-
return
|
|
4539
|
+
function getUtilisation(_x6) {
|
|
4540
|
+
return _getUtilisation.apply(this, arguments);
|
|
4406
4541
|
}
|
|
4407
4542
|
|
|
4408
|
-
return
|
|
4543
|
+
return getUtilisation;
|
|
4544
|
+
}();
|
|
4545
|
+
|
|
4546
|
+
_proto.sneakAccounts = /*#__PURE__*/function () {
|
|
4547
|
+
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(accounts, tokenAddresses) {
|
|
4548
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
4549
|
+
while (1) {
|
|
4550
|
+
switch (_context9.prev = _context9.next) {
|
|
4551
|
+
case 0:
|
|
4552
|
+
return _context9.abrupt("return", this._misc.sneakAccounts(accounts, tokenAddresses));
|
|
4553
|
+
|
|
4554
|
+
case 1:
|
|
4555
|
+
case "end":
|
|
4556
|
+
return _context9.stop();
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
}, _callee9, this);
|
|
4560
|
+
}));
|
|
4561
|
+
|
|
4562
|
+
function sneakAccounts(_x7, _x8) {
|
|
4563
|
+
return _sneakAccounts.apply(this, arguments);
|
|
4564
|
+
}
|
|
4565
|
+
|
|
4566
|
+
return sneakAccounts;
|
|
4409
4567
|
}();
|
|
4410
4568
|
|
|
4411
4569
|
return SdkRead;
|
|
@@ -4425,25 +4583,25 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4425
4583
|
_proto2.claim =
|
|
4426
4584
|
/*#__PURE__*/
|
|
4427
4585
|
function () {
|
|
4428
|
-
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4429
|
-
return runtime_1.wrap(function
|
|
4586
|
+
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
|
|
4587
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
4430
4588
|
while (1) {
|
|
4431
|
-
switch (
|
|
4589
|
+
switch (_context10.prev = _context10.next) {
|
|
4432
4590
|
case 0:
|
|
4433
|
-
|
|
4434
|
-
|
|
4591
|
+
_context10.t0 = this.env.comptroller.connect(this._networkConnection.signer);
|
|
4592
|
+
_context10.next = 3;
|
|
4435
4593
|
return this._networkConnection.signer.getAddress();
|
|
4436
4594
|
|
|
4437
4595
|
case 3:
|
|
4438
|
-
|
|
4439
|
-
return
|
|
4596
|
+
_context10.t1 = _context10.sent;
|
|
4597
|
+
return _context10.abrupt("return", _context10.t0['claimReward(uint8,address)'].call(_context10.t0, 0, _context10.t1));
|
|
4440
4598
|
|
|
4441
4599
|
case 5:
|
|
4442
4600
|
case "end":
|
|
4443
|
-
return
|
|
4601
|
+
return _context10.stop();
|
|
4444
4602
|
}
|
|
4445
4603
|
}
|
|
4446
|
-
},
|
|
4604
|
+
}, _callee10, this);
|
|
4447
4605
|
}));
|
|
4448
4606
|
|
|
4449
4607
|
function claim() {
|
|
@@ -4454,26 +4612,26 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4454
4612
|
}();
|
|
4455
4613
|
|
|
4456
4614
|
_proto2.claimLpRewards = /*#__PURE__*/function () {
|
|
4457
|
-
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4458
|
-
return runtime_1.wrap(function
|
|
4615
|
+
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
|
|
4616
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
4459
4617
|
while (1) {
|
|
4460
|
-
switch (
|
|
4618
|
+
switch (_context11.prev = _context11.next) {
|
|
4461
4619
|
case 0:
|
|
4462
|
-
|
|
4463
|
-
|
|
4620
|
+
_context11.t0 = this.env.auriFairLaunch.connect(this._networkConnection.signer);
|
|
4621
|
+
_context11.next = 3;
|
|
4464
4622
|
return this._networkConnection.signer.getAddress();
|
|
4465
4623
|
|
|
4466
4624
|
case 3:
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
return
|
|
4625
|
+
_context11.t1 = _context11.sent;
|
|
4626
|
+
_context11.t2 = INF;
|
|
4627
|
+
return _context11.abrupt("return", _context11.t0.harvest.call(_context11.t0, _context11.t1, 0, _context11.t2));
|
|
4470
4628
|
|
|
4471
4629
|
case 6:
|
|
4472
4630
|
case "end":
|
|
4473
|
-
return
|
|
4631
|
+
return _context11.stop();
|
|
4474
4632
|
}
|
|
4475
4633
|
}
|
|
4476
|
-
},
|
|
4634
|
+
}, _callee11, this);
|
|
4477
4635
|
}));
|
|
4478
4636
|
|
|
4479
4637
|
function claimLpRewards() {
|
|
@@ -4484,22 +4642,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4484
4642
|
}();
|
|
4485
4643
|
|
|
4486
4644
|
_proto2.stake = /*#__PURE__*/function () {
|
|
4487
|
-
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4488
|
-
return runtime_1.wrap(function
|
|
4645
|
+
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(amount) {
|
|
4646
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
4489
4647
|
while (1) {
|
|
4490
|
-
switch (
|
|
4648
|
+
switch (_context12.prev = _context12.next) {
|
|
4491
4649
|
case 0:
|
|
4492
|
-
return
|
|
4650
|
+
return _context12.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
|
|
4493
4651
|
|
|
4494
4652
|
case 1:
|
|
4495
4653
|
case "end":
|
|
4496
|
-
return
|
|
4654
|
+
return _context12.stop();
|
|
4497
4655
|
}
|
|
4498
4656
|
}
|
|
4499
|
-
},
|
|
4657
|
+
}, _callee12, this);
|
|
4500
4658
|
}));
|
|
4501
4659
|
|
|
4502
|
-
function stake(
|
|
4660
|
+
function stake(_x9) {
|
|
4503
4661
|
return _stake.apply(this, arguments);
|
|
4504
4662
|
}
|
|
4505
4663
|
|
|
@@ -4507,22 +4665,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4507
4665
|
}();
|
|
4508
4666
|
|
|
4509
4667
|
_proto2.unstake = /*#__PURE__*/function () {
|
|
4510
|
-
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4511
|
-
return runtime_1.wrap(function
|
|
4668
|
+
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(amount) {
|
|
4669
|
+
return runtime_1.wrap(function _callee13$(_context13) {
|
|
4512
4670
|
while (1) {
|
|
4513
|
-
switch (
|
|
4671
|
+
switch (_context13.prev = _context13.next) {
|
|
4514
4672
|
case 0:
|
|
4515
|
-
return
|
|
4673
|
+
return _context13.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
|
|
4516
4674
|
|
|
4517
4675
|
case 1:
|
|
4518
4676
|
case "end":
|
|
4519
|
-
return
|
|
4677
|
+
return _context13.stop();
|
|
4520
4678
|
}
|
|
4521
4679
|
}
|
|
4522
|
-
},
|
|
4680
|
+
}, _callee13, this);
|
|
4523
4681
|
}));
|
|
4524
4682
|
|
|
4525
|
-
function unstake(
|
|
4683
|
+
function unstake(_x10) {
|
|
4526
4684
|
return _unstake.apply(this, arguments);
|
|
4527
4685
|
}
|
|
4528
4686
|
|
|
@@ -4556,5 +4714,5 @@ BigNumber.config({
|
|
|
4556
4714
|
DECIMAL_PLACES: 50
|
|
4557
4715
|
});
|
|
4558
4716
|
|
|
4559
|
-
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, 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, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getBlockBeforeTimestamp, getBlockTimestamp, getCurrentTimestamp, getDecimal, getQuery, isSameAddress, networkAddresses, validateAndParseAddress, valuateToken };
|
|
4717
|
+
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, 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, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getBlockBeforeTimestamp, getBlockTimestamp, getCurrentTimestamp, getDecimal, getQuery, getSymbol, isSameAddress, networkAddresses, symbolRecords, validateAndParseAddress, valuateToken };
|
|
4560
4718
|
//# sourceMappingURL=sdk.esm.js.map
|