@aurigami/sdk 1.6.0 → 1.6.2
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 +9 -0
- package/dist/contracts/Multicall.d.ts +18 -0
- package/dist/contracts/Papermill.d.ts +8 -0
- package/dist/contracts/Referral.d.ts +44 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/sdk.cjs.development.js +449 -40
- 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 +447 -41
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/SDK.ts +66 -0
- package/src/consts/constants.ts +4 -0
- package/src/contracts/Multicall.ts +55 -0
- package/src/contracts/Papermill.ts +13 -0
- package/src/contracts/Referral.ts +98 -0
- package/src/contracts/index.ts +1 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -16,7 +16,9 @@ import EthRepayHelperABI from '@aurigami/contracts/artifacts/contracts/EthRepayH
|
|
|
16
16
|
import AuriFairLaunchABI from '@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json';
|
|
17
17
|
import EIP20InterfaceABI from '@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json';
|
|
18
18
|
import PulpABI from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
|
|
19
|
+
import ReferralDirectoryABI from '@aurigami/contracts/artifacts/contracts/ReferralDirectory.sol/ReferralDirectory.json';
|
|
19
20
|
import FaucetABI from '@aurigami/contracts/artifacts/contracts/mock/Faucet.sol/Faucet.json';
|
|
21
|
+
import Multicall2ABI from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json';
|
|
20
22
|
|
|
21
23
|
var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
|
|
22
24
|
var ETHAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
|
|
@@ -70,7 +72,11 @@ var networkAddresses = {
|
|
|
70
72
|
AURIFAIRLAUNCH: /*#__PURE__*/MAINNET_ADDRESSES.fairLaunch.toLowerCase(),
|
|
71
73
|
AURILENS: /*#__PURE__*/MAINNET_ADDRESSES.auriLens.toLowerCase(),
|
|
72
74
|
ETHREPAYHELPER: /*#__PURE__*/MAINNET_ADDRESSES.ethRepayHelper.toLowerCase(),
|
|
73
|
-
AURI_AIRDROP: /*#__PURE__*/MAINNET_ADDRESSES.auriAirdrop.toLowerCase()
|
|
75
|
+
AURI_AIRDROP: /*#__PURE__*/MAINNET_ADDRESSES.auriAirdrop.toLowerCase(),
|
|
76
|
+
MULTICALL: /*#__PURE__*/MAINNET_ADDRESSES.multicall.toLowerCase(),
|
|
77
|
+
TEAM_MULTISIG: /*#__PURE__*/'0x2D05FfFE70CE64c5954710D4C308dB31C8dBd8dE'.toLowerCase(),
|
|
78
|
+
PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
79
|
+
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLocaleLowerCase()
|
|
74
80
|
},
|
|
75
81
|
tokens: {
|
|
76
82
|
AURORA: /*#__PURE__*/'0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -107019,7 +107025,20 @@ var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
107019
107025
|
}
|
|
107020
107026
|
|
|
107021
107027
|
return getTimestampToUnlock;
|
|
107022
|
-
}()
|
|
107028
|
+
}()
|
|
107029
|
+
/**
|
|
107030
|
+
* Get the start timestamp of next week of the papermill contract.
|
|
107031
|
+
*
|
|
107032
|
+
* This is a sync function!
|
|
107033
|
+
*
|
|
107034
|
+
* @returns the timestamp in seconds
|
|
107035
|
+
*/
|
|
107036
|
+
;
|
|
107037
|
+
|
|
107038
|
+
_proto.getNextWeekTimestamp = function getNextWeekTimestamp() {
|
|
107039
|
+
var nextWeek = this.getWeek(getCurrentTimestamp()) + 1;
|
|
107040
|
+
return REWARD_CLAIM_START + ONE_WEEK * nextWeek;
|
|
107041
|
+
};
|
|
107023
107042
|
|
|
107024
107043
|
_proto.getUnlockPortionAt = /*#__PURE__*/function () {
|
|
107025
107044
|
var _getUnlockPortionAt = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(userAddress, timestamp) {
|
|
@@ -107153,6 +107172,236 @@ var Papermill = /*#__PURE__*/function (_BlockchainEntity) {
|
|
|
107153
107172
|
return Papermill;
|
|
107154
107173
|
}(BlockchainEntity);
|
|
107155
107174
|
|
|
107175
|
+
var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
107176
|
+
_inheritsLoose(ReferralRead, _BlockchainEntityRead);
|
|
107177
|
+
|
|
107178
|
+
function ReferralRead(networkConnection) {
|
|
107179
|
+
var _this;
|
|
107180
|
+
|
|
107181
|
+
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
107182
|
+
_this._referral = new Contract(networkAddresses.misc.REFERRAL, ReferralDirectoryABI.abi, networkConnection.provider);
|
|
107183
|
+
return _this;
|
|
107184
|
+
}
|
|
107185
|
+
/**
|
|
107186
|
+
* Generate a 10-character referral code
|
|
107187
|
+
* containing alphanumeric characters.
|
|
107188
|
+
*/
|
|
107189
|
+
|
|
107190
|
+
|
|
107191
|
+
var _proto = ReferralRead.prototype;
|
|
107192
|
+
|
|
107193
|
+
_proto.generateReferralCode = function generateReferralCode() {
|
|
107194
|
+
var letters = 'abcdefghijklmnopqrstuvwxyz';
|
|
107195
|
+
var numbers = '1234567890';
|
|
107196
|
+
var charset = letters + letters.toUpperCase() + numbers;
|
|
107197
|
+
var R = '';
|
|
107198
|
+
|
|
107199
|
+
for (var i = 0; i < 10; i++) {
|
|
107200
|
+
R += charset[Math.floor(Math.random() * charset.length)];
|
|
107201
|
+
}
|
|
107202
|
+
|
|
107203
|
+
return R;
|
|
107204
|
+
}
|
|
107205
|
+
/**
|
|
107206
|
+
* Get the referral code for a given address, returns empty string if not found.
|
|
107207
|
+
*
|
|
107208
|
+
* Called to check if a user has a referral code.
|
|
107209
|
+
*/
|
|
107210
|
+
;
|
|
107211
|
+
|
|
107212
|
+
_proto.getUserReferralCode =
|
|
107213
|
+
/*#__PURE__*/
|
|
107214
|
+
function () {
|
|
107215
|
+
var _getUserReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(userAddr) {
|
|
107216
|
+
var result;
|
|
107217
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
107218
|
+
while (1) {
|
|
107219
|
+
switch (_context.prev = _context.next) {
|
|
107220
|
+
case 0:
|
|
107221
|
+
_context.next = 2;
|
|
107222
|
+
return this._referral.userReferralCode(userAddr);
|
|
107223
|
+
|
|
107224
|
+
case 2:
|
|
107225
|
+
result = _context.sent;
|
|
107226
|
+
return _context.abrupt("return", ethers.utils.parseBytes32String(result));
|
|
107227
|
+
|
|
107228
|
+
case 4:
|
|
107229
|
+
case "end":
|
|
107230
|
+
return _context.stop();
|
|
107231
|
+
}
|
|
107232
|
+
}
|
|
107233
|
+
}, _callee, this);
|
|
107234
|
+
}));
|
|
107235
|
+
|
|
107236
|
+
function getUserReferralCode(_x) {
|
|
107237
|
+
return _getUserReferralCode.apply(this, arguments);
|
|
107238
|
+
}
|
|
107239
|
+
|
|
107240
|
+
return getUserReferralCode;
|
|
107241
|
+
}()
|
|
107242
|
+
/**
|
|
107243
|
+
* Get referral code that a user was referred by, returns empty string if not found.
|
|
107244
|
+
*/
|
|
107245
|
+
;
|
|
107246
|
+
|
|
107247
|
+
_proto.getReferralCodeUsed =
|
|
107248
|
+
/*#__PURE__*/
|
|
107249
|
+
function () {
|
|
107250
|
+
var _getReferralCodeUsed = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(userAddr) {
|
|
107251
|
+
var result;
|
|
107252
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
107253
|
+
while (1) {
|
|
107254
|
+
switch (_context2.prev = _context2.next) {
|
|
107255
|
+
case 0:
|
|
107256
|
+
_context2.next = 2;
|
|
107257
|
+
return this._referral.referralCodeUsed(userAddr);
|
|
107258
|
+
|
|
107259
|
+
case 2:
|
|
107260
|
+
result = _context2.sent;
|
|
107261
|
+
return _context2.abrupt("return", ethers.utils.parseBytes32String(result));
|
|
107262
|
+
|
|
107263
|
+
case 4:
|
|
107264
|
+
case "end":
|
|
107265
|
+
return _context2.stop();
|
|
107266
|
+
}
|
|
107267
|
+
}
|
|
107268
|
+
}, _callee2, this);
|
|
107269
|
+
}));
|
|
107270
|
+
|
|
107271
|
+
function getReferralCodeUsed(_x2) {
|
|
107272
|
+
return _getReferralCodeUsed.apply(this, arguments);
|
|
107273
|
+
}
|
|
107274
|
+
|
|
107275
|
+
return getReferralCodeUsed;
|
|
107276
|
+
}()
|
|
107277
|
+
/**
|
|
107278
|
+
* Get owner of a referral code, returns zero address if not found.
|
|
107279
|
+
*/
|
|
107280
|
+
;
|
|
107281
|
+
|
|
107282
|
+
_proto.getReferralCodeOwner =
|
|
107283
|
+
/*#__PURE__*/
|
|
107284
|
+
function () {
|
|
107285
|
+
var _getReferralCodeOwner = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(code) {
|
|
107286
|
+
var referralCode;
|
|
107287
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
107288
|
+
while (1) {
|
|
107289
|
+
switch (_context3.prev = _context3.next) {
|
|
107290
|
+
case 0:
|
|
107291
|
+
referralCode = ethers.utils.formatBytes32String(code);
|
|
107292
|
+
return _context3.abrupt("return", this._referral.referralCodeOwner(referralCode));
|
|
107293
|
+
|
|
107294
|
+
case 2:
|
|
107295
|
+
case "end":
|
|
107296
|
+
return _context3.stop();
|
|
107297
|
+
}
|
|
107298
|
+
}
|
|
107299
|
+
}, _callee3, this);
|
|
107300
|
+
}));
|
|
107301
|
+
|
|
107302
|
+
function getReferralCodeOwner(_x3) {
|
|
107303
|
+
return _getReferralCodeOwner.apply(this, arguments);
|
|
107304
|
+
}
|
|
107305
|
+
|
|
107306
|
+
return getReferralCodeOwner;
|
|
107307
|
+
}();
|
|
107308
|
+
|
|
107309
|
+
return ReferralRead;
|
|
107310
|
+
}(BlockchainEntityRead);
|
|
107311
|
+
var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
107312
|
+
_inheritsLoose(ReferralReadWrite, _ReferralRead);
|
|
107313
|
+
|
|
107314
|
+
function ReferralReadWrite() {
|
|
107315
|
+
return _ReferralRead.apply(this, arguments) || this;
|
|
107316
|
+
}
|
|
107317
|
+
|
|
107318
|
+
var _proto2 = ReferralReadWrite.prototype;
|
|
107319
|
+
|
|
107320
|
+
/**
|
|
107321
|
+
* Generate a referral code for a given address.
|
|
107322
|
+
*
|
|
107323
|
+
* Called when an user want to creates his own referral code
|
|
107324
|
+
*/
|
|
107325
|
+
_proto2.registerNewReferralCode =
|
|
107326
|
+
/*#__PURE__*/
|
|
107327
|
+
function () {
|
|
107328
|
+
var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
|
|
107329
|
+
var referralCode;
|
|
107330
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
107331
|
+
while (1) {
|
|
107332
|
+
switch (_context4.prev = _context4.next) {
|
|
107333
|
+
case 0:
|
|
107334
|
+
referralCode = ethers.utils.formatBytes32String(this.generateReferralCode());
|
|
107335
|
+
return _context4.abrupt("return", this._referral.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
|
|
107336
|
+
|
|
107337
|
+
case 2:
|
|
107338
|
+
case "end":
|
|
107339
|
+
return _context4.stop();
|
|
107340
|
+
}
|
|
107341
|
+
}
|
|
107342
|
+
}, _callee4, this);
|
|
107343
|
+
}));
|
|
107344
|
+
|
|
107345
|
+
function registerNewReferralCode() {
|
|
107346
|
+
return _registerNewReferralCode.apply(this, arguments);
|
|
107347
|
+
}
|
|
107348
|
+
|
|
107349
|
+
return registerNewReferralCode;
|
|
107350
|
+
}()
|
|
107351
|
+
/**
|
|
107352
|
+
* Called when an user confirms he is referred by a specified code
|
|
107353
|
+
*/
|
|
107354
|
+
;
|
|
107355
|
+
|
|
107356
|
+
_proto2.useReferralCode =
|
|
107357
|
+
/*#__PURE__*/
|
|
107358
|
+
function () {
|
|
107359
|
+
var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(code) {
|
|
107360
|
+
var referralCode;
|
|
107361
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
107362
|
+
while (1) {
|
|
107363
|
+
switch (_context5.prev = _context5.next) {
|
|
107364
|
+
case 0:
|
|
107365
|
+
referralCode = ethers.utils.formatBytes32String(code);
|
|
107366
|
+
return _context5.abrupt("return", this._referral.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
|
|
107367
|
+
|
|
107368
|
+
case 2:
|
|
107369
|
+
case "end":
|
|
107370
|
+
return _context5.stop();
|
|
107371
|
+
}
|
|
107372
|
+
}
|
|
107373
|
+
}, _callee5, this);
|
|
107374
|
+
}));
|
|
107375
|
+
|
|
107376
|
+
function useReferralCode(_x4) {
|
|
107377
|
+
return _useReferralCode.apply(this, arguments);
|
|
107378
|
+
}
|
|
107379
|
+
|
|
107380
|
+
return useReferralCode;
|
|
107381
|
+
}();
|
|
107382
|
+
|
|
107383
|
+
return ReferralReadWrite;
|
|
107384
|
+
}(ReferralRead);
|
|
107385
|
+
var Referral = /*#__PURE__*/function (_BlockchainEntity) {
|
|
107386
|
+
_inheritsLoose(Referral, _BlockchainEntity);
|
|
107387
|
+
|
|
107388
|
+
function Referral() {
|
|
107389
|
+
return _BlockchainEntity.call(this) || this;
|
|
107390
|
+
}
|
|
107391
|
+
|
|
107392
|
+
var _proto3 = Referral.prototype;
|
|
107393
|
+
|
|
107394
|
+
_proto3.read = function read(networkConnection) {
|
|
107395
|
+
return new ReferralRead(networkConnection);
|
|
107396
|
+
};
|
|
107397
|
+
|
|
107398
|
+
_proto3.readWrite = function readWrite(networkConnection) {
|
|
107399
|
+
return new ReferralReadWrite(networkConnection);
|
|
107400
|
+
};
|
|
107401
|
+
|
|
107402
|
+
return Referral;
|
|
107403
|
+
}(BlockchainEntity);
|
|
107404
|
+
|
|
107156
107405
|
var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
107157
107406
|
_inheritsLoose(StakingRead, _BlockchainEntityRead);
|
|
107158
107407
|
|
|
@@ -107431,6 +107680,92 @@ var Staking = /*#__PURE__*/function (_BlockchainEntity) {
|
|
|
107431
107680
|
return Staking;
|
|
107432
107681
|
}(BlockchainEntity);
|
|
107433
107682
|
|
|
107683
|
+
var MulticallRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
107684
|
+
_inheritsLoose(MulticallRead, _BlockchainEntityRead);
|
|
107685
|
+
|
|
107686
|
+
function MulticallRead(networkConnection) {
|
|
107687
|
+
var _this;
|
|
107688
|
+
|
|
107689
|
+
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
107690
|
+
_this._multicall = new Contract(networkAddresses.misc.MULTICALL, Multicall2ABI.abi, networkConnection.provider);
|
|
107691
|
+
return _this;
|
|
107692
|
+
}
|
|
107693
|
+
/**
|
|
107694
|
+
* Run multiple calls via multicall contract
|
|
107695
|
+
*/
|
|
107696
|
+
|
|
107697
|
+
|
|
107698
|
+
var _proto = MulticallRead.prototype;
|
|
107699
|
+
|
|
107700
|
+
_proto.aggregate =
|
|
107701
|
+
/*#__PURE__*/
|
|
107702
|
+
function () {
|
|
107703
|
+
var _aggregate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(calls) {
|
|
107704
|
+
var txns, i, _call$contract$popula, call, txn, response, decodedReturn, _i;
|
|
107705
|
+
|
|
107706
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
107707
|
+
while (1) {
|
|
107708
|
+
switch (_context.prev = _context.next) {
|
|
107709
|
+
case 0:
|
|
107710
|
+
txns = []; // prepare transactions
|
|
107711
|
+
|
|
107712
|
+
i = 0;
|
|
107713
|
+
|
|
107714
|
+
case 2:
|
|
107715
|
+
if (!(i < calls.length)) {
|
|
107716
|
+
_context.next = 11;
|
|
107717
|
+
break;
|
|
107718
|
+
}
|
|
107719
|
+
|
|
107720
|
+
call = calls[i];
|
|
107721
|
+
_context.next = 6;
|
|
107722
|
+
return (_call$contract$popula = call.contract.populateTransaction)[call.method].apply(_call$contract$popula, call.args);
|
|
107723
|
+
|
|
107724
|
+
case 6:
|
|
107725
|
+
txn = _context.sent;
|
|
107726
|
+
txns.push({
|
|
107727
|
+
target: txn.to,
|
|
107728
|
+
callData: txn.data
|
|
107729
|
+
});
|
|
107730
|
+
|
|
107731
|
+
case 8:
|
|
107732
|
+
i++;
|
|
107733
|
+
_context.next = 2;
|
|
107734
|
+
break;
|
|
107735
|
+
|
|
107736
|
+
case 11:
|
|
107737
|
+
_context.next = 13;
|
|
107738
|
+
return this._multicall.callStatic.aggregate(txns);
|
|
107739
|
+
|
|
107740
|
+
case 13:
|
|
107741
|
+
response = _context.sent;
|
|
107742
|
+
// parse results
|
|
107743
|
+
decodedReturn = [];
|
|
107744
|
+
|
|
107745
|
+
for (_i = 0; _i < calls.length; _i++) {
|
|
107746
|
+
decodedReturn.push(ethers.utils.defaultAbiCoder.decode(calls[_i].returnTypes, response.returnData[_i]));
|
|
107747
|
+
}
|
|
107748
|
+
|
|
107749
|
+
return _context.abrupt("return", decodedReturn);
|
|
107750
|
+
|
|
107751
|
+
case 17:
|
|
107752
|
+
case "end":
|
|
107753
|
+
return _context.stop();
|
|
107754
|
+
}
|
|
107755
|
+
}
|
|
107756
|
+
}, _callee, this);
|
|
107757
|
+
}));
|
|
107758
|
+
|
|
107759
|
+
function aggregate(_x) {
|
|
107760
|
+
return _aggregate.apply(this, arguments);
|
|
107761
|
+
}
|
|
107762
|
+
|
|
107763
|
+
return aggregate;
|
|
107764
|
+
}();
|
|
107765
|
+
|
|
107766
|
+
return MulticallRead;
|
|
107767
|
+
}(BlockchainEntityRead);
|
|
107768
|
+
|
|
107434
107769
|
var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
107435
107770
|
_inheritsLoose(SdkRead, _BlockchainEntityRead);
|
|
107436
107771
|
|
|
@@ -107761,7 +108096,78 @@ var SdkRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
107761
108096
|
},
|
|
107762
108097
|
newBorrowUtilization: newBorrowLimit.eq(0) ? newBorrowValuation.eq(0) ? 0 : 9999.99 : newBorrowValuation.div(newBorrowLimit).toNumber()
|
|
107763
108098
|
};
|
|
107764
|
-
}
|
|
108099
|
+
}
|
|
108100
|
+
/**
|
|
108101
|
+
* Get ply circulating supply.
|
|
108102
|
+
* It is calculated by the total supply, minus:
|
|
108103
|
+
* - Ply in team multisig contract
|
|
108104
|
+
* - Ply in comptroller contract
|
|
108105
|
+
* - Ply in fairlaunch contract
|
|
108106
|
+
* - Ply in vesting contract
|
|
108107
|
+
*/
|
|
108108
|
+
;
|
|
108109
|
+
|
|
108110
|
+
_proto.getPlyCirculatingSupply =
|
|
108111
|
+
/*#__PURE__*/
|
|
108112
|
+
function () {
|
|
108113
|
+
var _getPlyCirculatingSupply = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
|
|
108114
|
+
var plyContract, multicallRead, baseBalanceOfCall, callResults, circulatingSupply;
|
|
108115
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
108116
|
+
while (1) {
|
|
108117
|
+
switch (_context7.prev = _context7.next) {
|
|
108118
|
+
case 0:
|
|
108119
|
+
plyContract = new Contract(networkAddresses.tokens.PLY, EIP20InterfaceABI.abi, this._networkConnection.provider);
|
|
108120
|
+
multicallRead = new MulticallRead(this._networkConnection);
|
|
108121
|
+
baseBalanceOfCall = {
|
|
108122
|
+
contract: plyContract,
|
|
108123
|
+
method: 'balanceOf',
|
|
108124
|
+
returnTypes: ['uint256']
|
|
108125
|
+
};
|
|
108126
|
+
_context7.next = 5;
|
|
108127
|
+
return multicallRead.aggregate([// Get total supply
|
|
108128
|
+
_extends({}, baseBalanceOfCall, {
|
|
108129
|
+
method: 'totalSupply',
|
|
108130
|
+
args: []
|
|
108131
|
+
}), // balance in team multisig
|
|
108132
|
+
_extends({}, baseBalanceOfCall, {
|
|
108133
|
+
args: [networkAddresses.misc.TEAM_MULTISIG]
|
|
108134
|
+
}), // balance in comptroller
|
|
108135
|
+
_extends({}, baseBalanceOfCall, {
|
|
108136
|
+
args: [networkAddresses.misc.COMPTROLLER]
|
|
108137
|
+
}), // balance in fair launch
|
|
108138
|
+
_extends({}, baseBalanceOfCall, {
|
|
108139
|
+
args: [networkAddresses.misc.AURIFAIRLAUNCH]
|
|
108140
|
+
}), // balance in vesting contract
|
|
108141
|
+
_extends({}, baseBalanceOfCall, {
|
|
108142
|
+
args: [networkAddresses.misc.PLY_TOKEN_LOCK]
|
|
108143
|
+
})]);
|
|
108144
|
+
|
|
108145
|
+
case 5:
|
|
108146
|
+
callResults = _context7.sent;
|
|
108147
|
+
circulatingSupply = BigNumber$1.from(0);
|
|
108148
|
+
callResults.forEach(function (result, i) {
|
|
108149
|
+
if (i === 0) {
|
|
108150
|
+
circulatingSupply = result[0];
|
|
108151
|
+
} else {
|
|
108152
|
+
circulatingSupply = circulatingSupply.sub(result[0]);
|
|
108153
|
+
}
|
|
108154
|
+
});
|
|
108155
|
+
return _context7.abrupt("return", new TokenAmount(PLYToken, circulatingSupply.toString()));
|
|
108156
|
+
|
|
108157
|
+
case 9:
|
|
108158
|
+
case "end":
|
|
108159
|
+
return _context7.stop();
|
|
108160
|
+
}
|
|
108161
|
+
}
|
|
108162
|
+
}, _callee7, this);
|
|
108163
|
+
}));
|
|
108164
|
+
|
|
108165
|
+
function getPlyCirculatingSupply() {
|
|
108166
|
+
return _getPlyCirculatingSupply.apply(this, arguments);
|
|
108167
|
+
}
|
|
108168
|
+
|
|
108169
|
+
return getPlyCirculatingSupply;
|
|
108170
|
+
}();
|
|
107765
108171
|
|
|
107766
108172
|
return SdkRead;
|
|
107767
108173
|
}(BlockchainEntityRead);
|
|
@@ -107780,25 +108186,25 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
107780
108186
|
_proto2.claim =
|
|
107781
108187
|
/*#__PURE__*/
|
|
107782
108188
|
function () {
|
|
107783
|
-
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
107784
|
-
return runtime_1.wrap(function
|
|
108189
|
+
var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8() {
|
|
108190
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
107785
108191
|
while (1) {
|
|
107786
|
-
switch (
|
|
108192
|
+
switch (_context8.prev = _context8.next) {
|
|
107787
108193
|
case 0:
|
|
107788
|
-
|
|
107789
|
-
|
|
108194
|
+
_context8.t0 = this._comptroller.connect(this._networkConnection.signer);
|
|
108195
|
+
_context8.next = 3;
|
|
107790
108196
|
return this._networkConnection.signer.getAddress();
|
|
107791
108197
|
|
|
107792
108198
|
case 3:
|
|
107793
|
-
|
|
107794
|
-
return
|
|
108199
|
+
_context8.t1 = _context8.sent;
|
|
108200
|
+
return _context8.abrupt("return", _context8.t0['claimReward(uint8,address)'].call(_context8.t0, 0, _context8.t1));
|
|
107795
108201
|
|
|
107796
108202
|
case 5:
|
|
107797
108203
|
case "end":
|
|
107798
|
-
return
|
|
108204
|
+
return _context8.stop();
|
|
107799
108205
|
}
|
|
107800
108206
|
}
|
|
107801
|
-
},
|
|
108207
|
+
}, _callee8, this);
|
|
107802
108208
|
}));
|
|
107803
108209
|
|
|
107804
108210
|
function claim() {
|
|
@@ -107809,26 +108215,26 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
107809
108215
|
}();
|
|
107810
108216
|
|
|
107811
108217
|
_proto2.claimLpRewards = /*#__PURE__*/function () {
|
|
107812
|
-
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
107813
|
-
return runtime_1.wrap(function
|
|
108218
|
+
var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
|
|
108219
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
107814
108220
|
while (1) {
|
|
107815
|
-
switch (
|
|
108221
|
+
switch (_context9.prev = _context9.next) {
|
|
107816
108222
|
case 0:
|
|
107817
|
-
|
|
107818
|
-
|
|
108223
|
+
_context9.t0 = this._auriFairLaunch.connect(this._networkConnection.signer);
|
|
108224
|
+
_context9.next = 3;
|
|
107819
108225
|
return this._networkConnection.signer.getAddress();
|
|
107820
108226
|
|
|
107821
108227
|
case 3:
|
|
107822
|
-
|
|
107823
|
-
|
|
107824
|
-
return
|
|
108228
|
+
_context9.t1 = _context9.sent;
|
|
108229
|
+
_context9.t2 = INF;
|
|
108230
|
+
return _context9.abrupt("return", _context9.t0.harvest.call(_context9.t0, _context9.t1, 0, _context9.t2));
|
|
107825
108231
|
|
|
107826
108232
|
case 6:
|
|
107827
108233
|
case "end":
|
|
107828
|
-
return
|
|
108234
|
+
return _context9.stop();
|
|
107829
108235
|
}
|
|
107830
108236
|
}
|
|
107831
|
-
},
|
|
108237
|
+
}, _callee9, this);
|
|
107832
108238
|
}));
|
|
107833
108239
|
|
|
107834
108240
|
function claimLpRewards() {
|
|
@@ -107839,19 +108245,19 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
107839
108245
|
}();
|
|
107840
108246
|
|
|
107841
108247
|
_proto2.stake = /*#__PURE__*/function () {
|
|
107842
|
-
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
107843
|
-
return runtime_1.wrap(function
|
|
108248
|
+
var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(amount) {
|
|
108249
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
107844
108250
|
while (1) {
|
|
107845
|
-
switch (
|
|
108251
|
+
switch (_context10.prev = _context10.next) {
|
|
107846
108252
|
case 0:
|
|
107847
|
-
return
|
|
108253
|
+
return _context10.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
|
|
107848
108254
|
|
|
107849
108255
|
case 1:
|
|
107850
108256
|
case "end":
|
|
107851
|
-
return
|
|
108257
|
+
return _context10.stop();
|
|
107852
108258
|
}
|
|
107853
108259
|
}
|
|
107854
|
-
},
|
|
108260
|
+
}, _callee10, this);
|
|
107855
108261
|
}));
|
|
107856
108262
|
|
|
107857
108263
|
function stake(_x6) {
|
|
@@ -107862,19 +108268,19 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
107862
108268
|
}();
|
|
107863
108269
|
|
|
107864
108270
|
_proto2.unstake = /*#__PURE__*/function () {
|
|
107865
|
-
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
107866
|
-
return runtime_1.wrap(function
|
|
108271
|
+
var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(amount) {
|
|
108272
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
107867
108273
|
while (1) {
|
|
107868
|
-
switch (
|
|
108274
|
+
switch (_context11.prev = _context11.next) {
|
|
107869
108275
|
case 0:
|
|
107870
|
-
return
|
|
108276
|
+
return _context11.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
|
|
107871
108277
|
|
|
107872
108278
|
case 1:
|
|
107873
108279
|
case "end":
|
|
107874
|
-
return
|
|
108280
|
+
return _context11.stop();
|
|
107875
108281
|
}
|
|
107876
108282
|
}
|
|
107877
|
-
},
|
|
108283
|
+
}, _callee11, this);
|
|
107878
108284
|
}));
|
|
107879
108285
|
|
|
107880
108286
|
function unstake(_x7) {
|
|
@@ -107885,21 +108291,21 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
|
|
|
107885
108291
|
}();
|
|
107886
108292
|
|
|
107887
108293
|
_proto2.faucetDrip = /*#__PURE__*/function () {
|
|
107888
|
-
var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
108294
|
+
var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12() {
|
|
107889
108295
|
var faucet;
|
|
107890
|
-
return runtime_1.wrap(function
|
|
108296
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
107891
108297
|
while (1) {
|
|
107892
|
-
switch (
|
|
108298
|
+
switch (_context12.prev = _context12.next) {
|
|
107893
108299
|
case 0:
|
|
107894
108300
|
faucet = new Contract(networkAddresses.misc.FAUCET, FaucetABI.abi, this._networkConnection.provider);
|
|
107895
|
-
return
|
|
108301
|
+
return _context12.abrupt("return", faucet.connect(this._networkConnection.signer).drip());
|
|
107896
108302
|
|
|
107897
108303
|
case 2:
|
|
107898
108304
|
case "end":
|
|
107899
|
-
return
|
|
108305
|
+
return _context12.stop();
|
|
107900
108306
|
}
|
|
107901
108307
|
}
|
|
107902
|
-
},
|
|
108308
|
+
}, _callee12, this);
|
|
107903
108309
|
}));
|
|
107904
108310
|
|
|
107905
108311
|
function faucetDrip() {
|
|
@@ -107936,5 +108342,5 @@ BigNumber.config({
|
|
|
107936
108342
|
DECIMAL_PLACES: 50
|
|
107937
108343
|
});
|
|
107938
108344
|
|
|
107939
|
-
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, 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 };
|
|
108345
|
+
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, 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 };
|
|
107940
108346
|
//# sourceMappingURL=sdk.esm.js.map
|