@aurigami/sdk 1.6.7 → 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 +207 -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 +214 -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 +2 -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';
|
|
@@ -82,7 +82,8 @@ var networkAddresses = {
|
|
|
82
82
|
MULTICALL: /*#__PURE__*/MAINNET_ADDRESSES.multicall.toLowerCase(),
|
|
83
83
|
TEAM_MULTISIG: /*#__PURE__*/'0x2D05FfFE70CE64c5954710D4C308dB31C8dBd8dE'.toLowerCase(),
|
|
84
84
|
PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
85
|
-
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.
|
|
85
|
+
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
|
|
86
|
+
AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase()
|
|
86
87
|
},
|
|
87
88
|
tokens: {
|
|
88
89
|
AURORA: /*#__PURE__*/'0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -312,6 +313,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
312
313
|
_this.ply = _this.getContract(networkAddresses.tokens.PLY, abis$3.abi);
|
|
313
314
|
_this.pulp = _this.getContract(networkAddresses.tokens.PULP, abis$4.abi); // this.faucet = this.getContract<Faucet>(networkAddresses.misc.FAUCET, abis.FaucetABI.abi);
|
|
314
315
|
|
|
316
|
+
_this.auriInternalLens = _this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$5.abi);
|
|
315
317
|
return _this;
|
|
316
318
|
} // public faucet: Faucet;
|
|
317
319
|
|
|
@@ -1085,6 +1087,10 @@ try {
|
|
|
1085
1087
|
}
|
|
1086
1088
|
});
|
|
1087
1089
|
|
|
1090
|
+
var symbolRecords = /*#__PURE__*/Object.fromEntries( /*#__PURE__*/networkAddresses.auTokens.map(function (e) {
|
|
1091
|
+
return [e.address.toLowerCase(), e.name];
|
|
1092
|
+
}));
|
|
1093
|
+
|
|
1088
1094
|
var AURORA_API_BASE_URL = 'https://api.aurorascan.dev/api';
|
|
1089
1095
|
function getQuery(_x, _x2, _x3) {
|
|
1090
1096
|
return _getQuery.apply(this, arguments);
|
|
@@ -1160,6 +1166,11 @@ function getDecimal(address) {
|
|
|
1160
1166
|
assert(decimalRecords[addressLowercase] != undefined, 'Decimal not found for ' + address);
|
|
1161
1167
|
return decimalRecords[addressLowercase];
|
|
1162
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
|
+
}
|
|
1163
1174
|
function calcLMRewardApr(rewardsValue, totalStakeValue, frequencyPerYear) {
|
|
1164
1175
|
if (rewardsValue.isZero()) {
|
|
1165
1176
|
return new BigNumber(0);
|
|
@@ -2030,6 +2041,7 @@ var helpers = {
|
|
|
2030
2041
|
getCurrentTimestamp: getCurrentTimestamp,
|
|
2031
2042
|
validateAndParseAddress: validateAndParseAddress,
|
|
2032
2043
|
getDecimal: getDecimal,
|
|
2044
|
+
getSymbol: getSymbol,
|
|
2033
2045
|
calcLMRewardApr: calcLMRewardApr,
|
|
2034
2046
|
getBlockTimestamp: getBlockTimestamp,
|
|
2035
2047
|
getBlockBeforeTimestamp: getBlockBeforeTimestamp,
|
|
@@ -2229,9 +2241,9 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2229
2241
|
_this.env = new AuriEnv(networkConnection);
|
|
2230
2242
|
|
|
2231
2243
|
if (isSameAddress(underlyingAsset, ETHAddress)) {
|
|
2232
|
-
_this.auToken = new Contract(auToken, abis$5.abi, networkConnection.provider);
|
|
2233
|
-
} else {
|
|
2234
2244
|
_this.auToken = new Contract(auToken, abis$6.abi, networkConnection.provider);
|
|
2245
|
+
} else {
|
|
2246
|
+
_this.auToken = new Contract(auToken, abis$7.abi, networkConnection.provider);
|
|
2235
2247
|
}
|
|
2236
2248
|
|
|
2237
2249
|
_this.underlying = new Token(underlyingAsset, getDecimal(underlyingAsset));
|
|
@@ -2694,7 +2706,7 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
|
|
|
2694
2706
|
var _this3;
|
|
2695
2707
|
|
|
2696
2708
|
_this3 = _MoneyMarketRead.call(this, networkConnection, auToken, underlyingAsset) || this;
|
|
2697
|
-
_this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$
|
|
2709
|
+
_this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$8.abi, networkConnection.provider);
|
|
2698
2710
|
return _this3;
|
|
2699
2711
|
}
|
|
2700
2712
|
|
|
@@ -2908,7 +2920,7 @@ var MulticallRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2908
2920
|
var _this;
|
|
2909
2921
|
|
|
2910
2922
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
2911
|
-
_this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$
|
|
2923
|
+
_this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$9.abi, networkConnection.provider);
|
|
2912
2924
|
return _this;
|
|
2913
2925
|
}
|
|
2914
2926
|
/**
|
|
@@ -3928,6 +3940,136 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3928
3940
|
return getPlyCirculatingSupply;
|
|
3929
3941
|
}();
|
|
3930
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
|
+
|
|
3931
4073
|
return MiscRead;
|
|
3932
4074
|
}(BlockchainEntityRead);
|
|
3933
4075
|
|
|
@@ -3938,7 +4080,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3938
4080
|
var _this;
|
|
3939
4081
|
|
|
3940
4082
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
3941
|
-
_this.referral = new Contract(networkAddresses.misc.REFERRAL, abis$
|
|
4083
|
+
_this.referral = new Contract(networkAddresses.misc.REFERRAL, abis$a.abi, networkConnection.provider);
|
|
3942
4084
|
return _this;
|
|
3943
4085
|
}
|
|
3944
4086
|
/**
|
|
@@ -4377,22 +4519,13 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4377
4519
|
|
|
4378
4520
|
_proto.getUltilizations = /*#__PURE__*/function () {
|
|
4379
4521
|
var _getUltilizations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(userAddr) {
|
|
4380
|
-
var helper, accountDetail, sumBorrow, sumCol;
|
|
4381
4522
|
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4382
4523
|
while (1) {
|
|
4383
4524
|
switch (_context8.prev = _context8.next) {
|
|
4384
4525
|
case 0:
|
|
4385
|
-
|
|
4386
|
-
_context8.next = 3;
|
|
4387
|
-
return helper.getAccountLiquidity(userAddr);
|
|
4388
|
-
|
|
4389
|
-
case 3:
|
|
4390
|
-
accountDetail = _context8.sent;
|
|
4391
|
-
sumBorrow = new BigNumber(accountDetail.sumBorrowPlusEffects.toString());
|
|
4392
|
-
sumCol = new BigNumber(accountDetail.sumCollateral.toString());
|
|
4393
|
-
return _context8.abrupt("return", sumBorrow.dividedBy(sumCol));
|
|
4526
|
+
return _context8.abrupt("return", this._misc.getUltilizations(userAddr));
|
|
4394
4527
|
|
|
4395
|
-
case
|
|
4528
|
+
case 1:
|
|
4396
4529
|
case "end":
|
|
4397
4530
|
return _context8.stop();
|
|
4398
4531
|
}
|
|
@@ -4407,6 +4540,29 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4407
4540
|
return getUltilizations;
|
|
4408
4541
|
}();
|
|
4409
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
|
+
|
|
4410
4566
|
return SdkRead;
|
|
4411
4567
|
}(BlockchainEntityRead);
|
|
4412
4568
|
var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
@@ -4424,25 +4580,25 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4424
4580
|
_proto2.claim =
|
|
4425
4581
|
/*#__PURE__*/
|
|
4426
4582
|
function () {
|
|
4427
|
-
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4428
|
-
return runtime_1.wrap(function
|
|
4583
|
+
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
|
|
4584
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
4429
4585
|
while (1) {
|
|
4430
|
-
switch (
|
|
4586
|
+
switch (_context10.prev = _context10.next) {
|
|
4431
4587
|
case 0:
|
|
4432
|
-
|
|
4433
|
-
|
|
4588
|
+
_context10.t0 = this.env.comptroller.connect(this._networkConnection.signer);
|
|
4589
|
+
_context10.next = 3;
|
|
4434
4590
|
return this._networkConnection.signer.getAddress();
|
|
4435
4591
|
|
|
4436
4592
|
case 3:
|
|
4437
|
-
|
|
4438
|
-
return
|
|
4593
|
+
_context10.t1 = _context10.sent;
|
|
4594
|
+
return _context10.abrupt("return", _context10.t0['claimReward(uint8,address)'].call(_context10.t0, 0, _context10.t1));
|
|
4439
4595
|
|
|
4440
4596
|
case 5:
|
|
4441
4597
|
case "end":
|
|
4442
|
-
return
|
|
4598
|
+
return _context10.stop();
|
|
4443
4599
|
}
|
|
4444
4600
|
}
|
|
4445
|
-
},
|
|
4601
|
+
}, _callee10, this);
|
|
4446
4602
|
}));
|
|
4447
4603
|
|
|
4448
4604
|
function claim() {
|
|
@@ -4453,26 +4609,26 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4453
4609
|
}();
|
|
4454
4610
|
|
|
4455
4611
|
_proto2.claimLpRewards = /*#__PURE__*/function () {
|
|
4456
|
-
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4457
|
-
return runtime_1.wrap(function
|
|
4612
|
+
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
|
|
4613
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
4458
4614
|
while (1) {
|
|
4459
|
-
switch (
|
|
4615
|
+
switch (_context11.prev = _context11.next) {
|
|
4460
4616
|
case 0:
|
|
4461
|
-
|
|
4462
|
-
|
|
4617
|
+
_context11.t0 = this.env.auriFairLaunch.connect(this._networkConnection.signer);
|
|
4618
|
+
_context11.next = 3;
|
|
4463
4619
|
return this._networkConnection.signer.getAddress();
|
|
4464
4620
|
|
|
4465
4621
|
case 3:
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
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));
|
|
4469
4625
|
|
|
4470
4626
|
case 6:
|
|
4471
4627
|
case "end":
|
|
4472
|
-
return
|
|
4628
|
+
return _context11.stop();
|
|
4473
4629
|
}
|
|
4474
4630
|
}
|
|
4475
|
-
},
|
|
4631
|
+
}, _callee11, this);
|
|
4476
4632
|
}));
|
|
4477
4633
|
|
|
4478
4634
|
function claimLpRewards() {
|
|
@@ -4483,22 +4639,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4483
4639
|
}();
|
|
4484
4640
|
|
|
4485
4641
|
_proto2.stake = /*#__PURE__*/function () {
|
|
4486
|
-
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4487
|
-
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) {
|
|
4488
4644
|
while (1) {
|
|
4489
|
-
switch (
|
|
4645
|
+
switch (_context12.prev = _context12.next) {
|
|
4490
4646
|
case 0:
|
|
4491
|
-
return
|
|
4647
|
+
return _context12.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
|
|
4492
4648
|
|
|
4493
4649
|
case 1:
|
|
4494
4650
|
case "end":
|
|
4495
|
-
return
|
|
4651
|
+
return _context12.stop();
|
|
4496
4652
|
}
|
|
4497
4653
|
}
|
|
4498
|
-
},
|
|
4654
|
+
}, _callee12, this);
|
|
4499
4655
|
}));
|
|
4500
4656
|
|
|
4501
|
-
function stake(
|
|
4657
|
+
function stake(_x9) {
|
|
4502
4658
|
return _stake.apply(this, arguments);
|
|
4503
4659
|
}
|
|
4504
4660
|
|
|
@@ -4506,22 +4662,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
4506
4662
|
}();
|
|
4507
4663
|
|
|
4508
4664
|
_proto2.unstake = /*#__PURE__*/function () {
|
|
4509
|
-
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4510
|
-
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) {
|
|
4511
4667
|
while (1) {
|
|
4512
|
-
switch (
|
|
4668
|
+
switch (_context13.prev = _context13.next) {
|
|
4513
4669
|
case 0:
|
|
4514
|
-
return
|
|
4670
|
+
return _context13.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
|
|
4515
4671
|
|
|
4516
4672
|
case 1:
|
|
4517
4673
|
case "end":
|
|
4518
|
-
return
|
|
4674
|
+
return _context13.stop();
|
|
4519
4675
|
}
|
|
4520
4676
|
}
|
|
4521
|
-
},
|
|
4677
|
+
}, _callee13, this);
|
|
4522
4678
|
}));
|
|
4523
4679
|
|
|
4524
|
-
function unstake(
|
|
4680
|
+
function unstake(_x10) {
|
|
4525
4681
|
return _unstake.apply(this, arguments);
|
|
4526
4682
|
}
|
|
4527
4683
|
|
|
@@ -4555,5 +4711,5 @@ BigNumber.config({
|
|
|
4555
4711
|
DECIMAL_PLACES: 50
|
|
4556
4712
|
});
|
|
4557
4713
|
|
|
4558
|
-
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 };
|
|
4559
4715
|
//# sourceMappingURL=sdk.esm.js.map
|