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