@aurigami/sdk 1.6.8 → 1.6.9
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 +1 -0
- 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 +206 -49
- 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 +213 -58
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/package.json +3 -3
- package/src/SDK.ts +8 -12
- 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 +51 -1
- package/src/entities/auriEnv.ts +14 -1
- package/src/helpers/helpers.ts +7 -0
- package/src/types/index.ts +6 -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,136 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3929
3940
|
return getPlyCirculatingSupply;
|
|
3930
3941
|
}();
|
|
3931
3942
|
|
|
3943
|
+
_proto.getUltilizations = /*#__PURE__*/function () {
|
|
3944
|
+
var _getUltilizations = /*#__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 getUltilizations(_x3) {
|
|
3968
|
+
return _getUltilizations.apply(this, arguments);
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3971
|
+
return getUltilizations;
|
|
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(infos);
|
|
4050
|
+
|
|
4051
|
+
case 31:
|
|
4052
|
+
_context5.next = 12;
|
|
4053
|
+
break;
|
|
4054
|
+
|
|
4055
|
+
case 33:
|
|
4056
|
+
return _context5.abrupt("return", res);
|
|
4057
|
+
|
|
4058
|
+
case 34:
|
|
4059
|
+
case "end":
|
|
4060
|
+
return _context5.stop();
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
}, _callee5, this);
|
|
4064
|
+
}));
|
|
4065
|
+
|
|
4066
|
+
function sneakAccounts(_x4, _x5) {
|
|
4067
|
+
return _sneakAccounts.apply(this, arguments);
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
return sneakAccounts;
|
|
4071
|
+
}();
|
|
4072
|
+
|
|
3932
4073
|
return MiscRead;
|
|
3933
4074
|
}(BlockchainEntityRead);
|
|
3934
4075
|
|
|
@@ -3939,7 +4080,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3939
4080
|
var _this;
|
|
3940
4081
|
|
|
3941
4082
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
3942
|
-
_this.referral = new Contract(networkAddresses.misc.REFERRAL, abis$
|
|
4083
|
+
_this.referral = new Contract(networkAddresses.misc.REFERRAL, abis$a.abi, networkConnection.provider);
|
|
3943
4084
|
return _this;
|
|
3944
4085
|
}
|
|
3945
4086
|
/**
|
|
@@ -4378,22 +4519,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4378
4519
|
|
|
4379
4520
|
_proto.getUltilizations = /*#__PURE__*/function () {
|
|
4380
4521
|
var _getUltilizations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(userAddr) {
|
|
4381
|
-
var helper, accountDetail, sumBorrow, sumCol;
|
|
4382
4522
|
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4383
4523
|
while (1) {
|
|
4384
4524
|
switch (_context8.prev = _context8.next) {
|
|
4385
4525
|
case 0:
|
|
4386
|
-
|
|
4387
|
-
_context8.next = 3;
|
|
4388
|
-
return helper.getAccountLiquidity(userAddr);
|
|
4389
|
-
|
|
4390
|
-
case 3:
|
|
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));
|
|
4526
|
+
return _context8.abrupt("return", this._misc.getUltilizations(userAddr));
|
|
4395
4527
|
|
|
4396
|
-
case
|
|
4528
|
+
case 1:
|
|
4397
4529
|
case "end":
|
|
4398
4530
|
return _context8.stop();
|
|
4399
4531
|
}
|
|
@@ -4408,6 +4540,29 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4408
4540
|
return getUltilizations;
|
|
4409
4541
|
}();
|
|
4410
4542
|
|
|
4543
|
+
_proto.sneakAccounts = /*#__PURE__*/function () {
|
|
4544
|
+
var _sneakAccounts = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(accounts, tokenAddresses) {
|
|
4545
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
4546
|
+
while (1) {
|
|
4547
|
+
switch (_context9.prev = _context9.next) {
|
|
4548
|
+
case 0:
|
|
4549
|
+
return _context9.abrupt("return", this._misc.sneakAccounts(accounts, tokenAddresses));
|
|
4550
|
+
|
|
4551
|
+
case 1:
|
|
4552
|
+
case "end":
|
|
4553
|
+
return _context9.stop();
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
}, _callee9, this);
|
|
4557
|
+
}));
|
|
4558
|
+
|
|
4559
|
+
function sneakAccounts(_x7, _x8) {
|
|
4560
|
+
return _sneakAccounts.apply(this, arguments);
|
|
4561
|
+
}
|
|
4562
|
+
|
|
4563
|
+
return sneakAccounts;
|
|
4564
|
+
}();
|
|
4565
|
+
|
|
4411
4566
|
return SdkRead;
|
|
4412
4567
|
}(BlockchainEntityRead);
|
|
4413
4568
|
var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
@@ -4425,25 +4580,25 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4425
4580
|
_proto2.claim =
|
|
4426
4581
|
/*#__PURE__*/
|
|
4427
4582
|
function () {
|
|
4428
|
-
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4429
|
-
return runtime_1.wrap(function
|
|
4583
|
+
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
|
|
4584
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
4430
4585
|
while (1) {
|
|
4431
|
-
switch (
|
|
4586
|
+
switch (_context10.prev = _context10.next) {
|
|
4432
4587
|
case 0:
|
|
4433
|
-
|
|
4434
|
-
|
|
4588
|
+
_context10.t0 = this.env.comptroller.connect(this._networkConnection.signer);
|
|
4589
|
+
_context10.next = 3;
|
|
4435
4590
|
return this._networkConnection.signer.getAddress();
|
|
4436
4591
|
|
|
4437
4592
|
case 3:
|
|
4438
|
-
|
|
4439
|
-
return
|
|
4593
|
+
_context10.t1 = _context10.sent;
|
|
4594
|
+
return _context10.abrupt("return", _context10.t0['claimReward(uint8,address)'].call(_context10.t0, 0, _context10.t1));
|
|
4440
4595
|
|
|
4441
4596
|
case 5:
|
|
4442
4597
|
case "end":
|
|
4443
|
-
return
|
|
4598
|
+
return _context10.stop();
|
|
4444
4599
|
}
|
|
4445
4600
|
}
|
|
4446
|
-
},
|
|
4601
|
+
}, _callee10, this);
|
|
4447
4602
|
}));
|
|
4448
4603
|
|
|
4449
4604
|
function claim() {
|
|
@@ -4454,26 +4609,26 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4454
4609
|
}();
|
|
4455
4610
|
|
|
4456
4611
|
_proto2.claimLpRewards = /*#__PURE__*/function () {
|
|
4457
|
-
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4458
|
-
return runtime_1.wrap(function
|
|
4612
|
+
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
|
|
4613
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
4459
4614
|
while (1) {
|
|
4460
|
-
switch (
|
|
4615
|
+
switch (_context11.prev = _context11.next) {
|
|
4461
4616
|
case 0:
|
|
4462
|
-
|
|
4463
|
-
|
|
4617
|
+
_context11.t0 = this.env.auriFairLaunch.connect(this._networkConnection.signer);
|
|
4618
|
+
_context11.next = 3;
|
|
4464
4619
|
return this._networkConnection.signer.getAddress();
|
|
4465
4620
|
|
|
4466
4621
|
case 3:
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
return
|
|
4622
|
+
_context11.t1 = _context11.sent;
|
|
4623
|
+
_context11.t2 = INF;
|
|
4624
|
+
return _context11.abrupt("return", _context11.t0.harvest.call(_context11.t0, _context11.t1, 0, _context11.t2));
|
|
4470
4625
|
|
|
4471
4626
|
case 6:
|
|
4472
4627
|
case "end":
|
|
4473
|
-
return
|
|
4628
|
+
return _context11.stop();
|
|
4474
4629
|
}
|
|
4475
4630
|
}
|
|
4476
|
-
},
|
|
4631
|
+
}, _callee11, this);
|
|
4477
4632
|
}));
|
|
4478
4633
|
|
|
4479
4634
|
function claimLpRewards() {
|
|
@@ -4484,22 +4639,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4484
4639
|
}();
|
|
4485
4640
|
|
|
4486
4641
|
_proto2.stake = /*#__PURE__*/function () {
|
|
4487
|
-
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4488
|
-
return runtime_1.wrap(function
|
|
4642
|
+
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(amount) {
|
|
4643
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
4489
4644
|
while (1) {
|
|
4490
|
-
switch (
|
|
4645
|
+
switch (_context12.prev = _context12.next) {
|
|
4491
4646
|
case 0:
|
|
4492
|
-
return
|
|
4647
|
+
return _context12.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
|
|
4493
4648
|
|
|
4494
4649
|
case 1:
|
|
4495
4650
|
case "end":
|
|
4496
|
-
return
|
|
4651
|
+
return _context12.stop();
|
|
4497
4652
|
}
|
|
4498
4653
|
}
|
|
4499
|
-
},
|
|
4654
|
+
}, _callee12, this);
|
|
4500
4655
|
}));
|
|
4501
4656
|
|
|
4502
|
-
function stake(
|
|
4657
|
+
function stake(_x9) {
|
|
4503
4658
|
return _stake.apply(this, arguments);
|
|
4504
4659
|
}
|
|
4505
4660
|
|
|
@@ -4507,22 +4662,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4507
4662
|
}();
|
|
4508
4663
|
|
|
4509
4664
|
_proto2.unstake = /*#__PURE__*/function () {
|
|
4510
|
-
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4511
|
-
return runtime_1.wrap(function
|
|
4665
|
+
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(amount) {
|
|
4666
|
+
return runtime_1.wrap(function _callee13$(_context13) {
|
|
4512
4667
|
while (1) {
|
|
4513
|
-
switch (
|
|
4668
|
+
switch (_context13.prev = _context13.next) {
|
|
4514
4669
|
case 0:
|
|
4515
|
-
return
|
|
4670
|
+
return _context13.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
|
|
4516
4671
|
|
|
4517
4672
|
case 1:
|
|
4518
4673
|
case "end":
|
|
4519
|
-
return
|
|
4674
|
+
return _context13.stop();
|
|
4520
4675
|
}
|
|
4521
4676
|
}
|
|
4522
|
-
},
|
|
4677
|
+
}, _callee13, this);
|
|
4523
4678
|
}));
|
|
4524
4679
|
|
|
4525
|
-
function unstake(
|
|
4680
|
+
function unstake(_x10) {
|
|
4526
4681
|
return _unstake.apply(this, arguments);
|
|
4527
4682
|
}
|
|
4528
4683
|
|
|
@@ -4556,5 +4711,5 @@ BigNumber.config({
|
|
|
4556
4711
|
DECIMAL_PLACES: 50
|
|
4557
4712
|
});
|
|
4558
4713
|
|
|
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 };
|
|
4714
|
+
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
4715
|
//# sourceMappingURL=sdk.esm.js.map
|