@aurigami/sdk 1.7.6 → 1.7.7-dummy
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/consts/dummy.d.ts +3 -1
- package/dist/contracts/Airdrop.d.ts +2 -3
- package/dist/contracts/Referral.d.ts +15 -4
- package/dist/entities/auriEnv.d.ts +18 -9
- package/dist/sdk.cjs.development.js +279 -61
- 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 +279 -63
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +23 -0
- package/package.json +2 -2
- package/src/consts/dummy.ts +21 -2
- package/src/contracts/Airdrop.ts +6 -14
- package/src/contracts/Referral.ts +41 -18
- package/src/entities/auriEnv.ts +83 -31
- package/src/types/index.ts +24 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import { BigNumber as BigNumber$1, Contract, utils, ethers } from 'ethers';
|
|
3
3
|
import { Logger } from 'ethers/lib/utils';
|
|
4
|
-
import abis$
|
|
5
|
-
import abis$
|
|
6
|
-
import
|
|
7
|
-
import abis$
|
|
8
|
-
import abis$
|
|
4
|
+
import abis$7 from '@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json';
|
|
5
|
+
import abis$8 from '@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json';
|
|
6
|
+
import abis$1 from '@aurigami/contracts/artifacts/contracts/AuriAirdrop.sol/AuriAirdrop.json';
|
|
7
|
+
import abis$2 from '@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json';
|
|
8
|
+
import abis$3 from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json';
|
|
9
9
|
import AuriOracleABI from '@aurigami/contracts/artifacts/contracts/AuriOracle.sol/AuriOracle.json';
|
|
10
10
|
import abis from '@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json';
|
|
11
|
-
import abis$
|
|
12
|
-
import abis$
|
|
13
|
-
import abis$
|
|
14
|
-
import abis$
|
|
11
|
+
import abis$4 from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
|
|
12
|
+
import abis$9 from '@aurigami/contracts/artifacts/contracts/EthRepayHelper.sol/EthRepayHelper.json';
|
|
13
|
+
import abis$5 from '@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json';
|
|
14
|
+
import abis$c from '@aurigami/contracts/artifacts/contracts/mock/AuriInternalLens.sol/AuriInternalLens.json';
|
|
15
15
|
import IUniswapV2PairABI from '@aurigami/contracts/artifacts/contracts/mock/IUniswapV2Pair.sol/IUniswapV2Pair.json';
|
|
16
|
-
import abis$
|
|
17
|
-
import abis$
|
|
18
|
-
import abis$
|
|
16
|
+
import abis$a from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json';
|
|
17
|
+
import abis$b from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
|
|
18
|
+
import abis$6 from '@aurigami/contracts/artifacts/contracts/ReferralDirectory.sol/ReferralDirectory.json';
|
|
19
19
|
import MAINNET_ADDRESSES from '@aurigami/contracts/deployments/aurora_mainnet.json';
|
|
20
20
|
export { default as MAINNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_mainnet.json';
|
|
21
21
|
export { default as TESTNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_testnet.json';
|
|
@@ -29,18 +29,18 @@ var index = {
|
|
|
29
29
|
AuriOracleABI: AuriOracleABI,
|
|
30
30
|
AuTokenABI: abis,
|
|
31
31
|
IUniswapV2PairABI: IUniswapV2PairABI,
|
|
32
|
-
AuriAirdropABI:
|
|
33
|
-
AuriFairLaunchABI: abis$
|
|
34
|
-
AuriLensABI: abis$
|
|
35
|
-
ComptrollerABI: abis$
|
|
36
|
-
EIP20InterfaceABI: abis$
|
|
37
|
-
ReferralDirectoryABI: abis$
|
|
38
|
-
AuErc20ABI: abis$
|
|
39
|
-
AuETHABI: abis$
|
|
40
|
-
EthRepayHelperABI: abis$
|
|
41
|
-
Multicall2ABI: abis$
|
|
42
|
-
PulpABI: abis$
|
|
43
|
-
AuriInternalLensABI: abis$
|
|
32
|
+
AuriAirdropABI: abis$1,
|
|
33
|
+
AuriFairLaunchABI: abis$2,
|
|
34
|
+
AuriLensABI: abis$3,
|
|
35
|
+
ComptrollerABI: abis$4,
|
|
36
|
+
EIP20InterfaceABI: abis$5,
|
|
37
|
+
ReferralDirectoryABI: abis$6,
|
|
38
|
+
AuErc20ABI: abis$7,
|
|
39
|
+
AuETHABI: abis$8,
|
|
40
|
+
EthRepayHelperABI: abis$9,
|
|
41
|
+
Multicall2ABI: abis$a,
|
|
42
|
+
PulpABI: abis$b,
|
|
43
|
+
AuriInternalLensABI: abis$c
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
|
|
@@ -218,6 +218,25 @@ function _asyncToGenerator(fn) {
|
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
function _defineProperties(target, props) {
|
|
222
|
+
for (var i = 0; i < props.length; i++) {
|
|
223
|
+
var descriptor = props[i];
|
|
224
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
225
|
+
descriptor.configurable = true;
|
|
226
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
227
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
232
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
233
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
234
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
235
|
+
writable: false
|
|
236
|
+
});
|
|
237
|
+
return Constructor;
|
|
238
|
+
}
|
|
239
|
+
|
|
221
240
|
function _extends() {
|
|
222
241
|
_extends = Object.assign || function (target) {
|
|
223
242
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -325,20 +344,20 @@ var BlockchainEntity = /*#__PURE__*/function () {
|
|
|
325
344
|
var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
326
345
|
_inheritsLoose(AuriEnv, _BlockchainEntityRead);
|
|
327
346
|
|
|
328
|
-
function AuriEnv(
|
|
347
|
+
function AuriEnv() {
|
|
329
348
|
var _this;
|
|
330
349
|
|
|
331
|
-
_this = _BlockchainEntityRead.
|
|
332
|
-
_this.
|
|
333
|
-
_this.
|
|
334
|
-
_this.
|
|
335
|
-
_this.
|
|
336
|
-
_this.
|
|
337
|
-
|
|
338
|
-
_this.
|
|
350
|
+
_this = _BlockchainEntityRead.apply(this, arguments) || this;
|
|
351
|
+
_this._comptroller = null;
|
|
352
|
+
_this._auriFairLaunch = null;
|
|
353
|
+
_this._auriLens = null;
|
|
354
|
+
_this._ply = null;
|
|
355
|
+
_this._pulp = null;
|
|
356
|
+
_this._auriInternalLens = null;
|
|
357
|
+
_this._auriAirdrop = null;
|
|
358
|
+
_this._referralDirectory = null;
|
|
339
359
|
return _this;
|
|
340
|
-
}
|
|
341
|
-
|
|
360
|
+
}
|
|
342
361
|
|
|
343
362
|
var _proto = AuriEnv.prototype;
|
|
344
363
|
|
|
@@ -357,6 +376,80 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
357
376
|
});
|
|
358
377
|
};
|
|
359
378
|
|
|
379
|
+
_createClass(AuriEnv, [{
|
|
380
|
+
key: "comptroller",
|
|
381
|
+
get: function get() {
|
|
382
|
+
if (!this._comptroller) {
|
|
383
|
+
this._comptroller = this.getContract(networkAddresses.misc.COMPTROLLER, abis$4.abi);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return this._comptroller;
|
|
387
|
+
}
|
|
388
|
+
}, {
|
|
389
|
+
key: "auriFairLaunch",
|
|
390
|
+
get: function get() {
|
|
391
|
+
if (!this._auriFairLaunch) {
|
|
392
|
+
this._auriFairLaunch = this.getContract(networkAddresses.misc.AURIFAIRLAUNCH, abis$2.abi);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return this._auriFairLaunch;
|
|
396
|
+
}
|
|
397
|
+
}, {
|
|
398
|
+
key: "auriLens",
|
|
399
|
+
get: function get() {
|
|
400
|
+
if (!this._auriLens) {
|
|
401
|
+
this._auriLens = this.getContract(networkAddresses.misc.AURILENS, abis$3.abi);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return this._auriLens;
|
|
405
|
+
}
|
|
406
|
+
}, {
|
|
407
|
+
key: "ply",
|
|
408
|
+
get: function get() {
|
|
409
|
+
if (!this._ply) {
|
|
410
|
+
this._ply = this.getContract(networkAddresses.tokens.PLY, abis$5.abi);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return this._ply;
|
|
414
|
+
}
|
|
415
|
+
}, {
|
|
416
|
+
key: "pulp",
|
|
417
|
+
get: function get() {
|
|
418
|
+
if (!this._pulp) {
|
|
419
|
+
this._pulp = this.getContract(networkAddresses.tokens.PULP, abis$b.abi);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return this._pulp;
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
key: "auriInternalLens",
|
|
426
|
+
get: function get() {
|
|
427
|
+
if (!this._auriInternalLens) {
|
|
428
|
+
this._auriInternalLens = this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$c.abi);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return this._auriInternalLens;
|
|
432
|
+
}
|
|
433
|
+
}, {
|
|
434
|
+
key: "auriAirdrop",
|
|
435
|
+
get: function get() {
|
|
436
|
+
if (!this._auriAirdrop) {
|
|
437
|
+
this._auriAirdrop = this.getContract(networkAddresses.misc.AURI_AIRDROP, abis$1.abi);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return this._auriAirdrop;
|
|
441
|
+
}
|
|
442
|
+
}, {
|
|
443
|
+
key: "referralDirectory",
|
|
444
|
+
get: function get() {
|
|
445
|
+
if (!this._referralDirectory) {
|
|
446
|
+
this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$6.abi);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
return this._referralDirectory;
|
|
450
|
+
}
|
|
451
|
+
}]);
|
|
452
|
+
|
|
360
453
|
return AuriEnv;
|
|
361
454
|
}(BlockchainEntityRead);
|
|
362
455
|
|
|
@@ -1546,7 +1639,7 @@ var TokenAmount = /*#__PURE__*/function () {
|
|
|
1546
1639
|
return TokenAmount;
|
|
1547
1640
|
}();
|
|
1548
1641
|
|
|
1549
|
-
var dummyToken = /*#__PURE__*/new Token(
|
|
1642
|
+
var dummyToken = /*#__PURE__*/new Token(networkAddresses.tokens.WNEAR, 24);
|
|
1550
1643
|
var dummyPly = /*#__PURE__*/new Token('0x8729438eb15e2c8b576fcc6aecda6a148776c0f5', 18);
|
|
1551
1644
|
var dummyPlyAurora = /*#__PURE__*/new Token('0xE530dC2095Ef5653205CF5ea79F8979a7028065c', 18);
|
|
1552
1645
|
var dummyTokenAmount = /*#__PURE__*/new TokenAmount(dummyToken, '123.456', false);
|
|
@@ -1564,6 +1657,22 @@ var dummyUserMarketDetails = {
|
|
|
1564
1657
|
collateralRatio: 0.5,
|
|
1565
1658
|
underlyingPrice: '1'
|
|
1566
1659
|
};
|
|
1660
|
+
var referralRewardDummy1 = {
|
|
1661
|
+
campaign: 'testa',
|
|
1662
|
+
startTime: 1652882400,
|
|
1663
|
+
endTime: 1653573599,
|
|
1664
|
+
isReferrer: false,
|
|
1665
|
+
rewardTokenAmount: dummyTokenAmount,
|
|
1666
|
+
transactionHash: null
|
|
1667
|
+
};
|
|
1668
|
+
var referralRewardDummy2 = {
|
|
1669
|
+
campaign: 'testb',
|
|
1670
|
+
startTime: 1652882400,
|
|
1671
|
+
endTime: 1653573599,
|
|
1672
|
+
isReferrer: true,
|
|
1673
|
+
rewardTokenAmount: dummyTokenAmount2,
|
|
1674
|
+
transactionHash: '0x4da9657663b46ef18d150b897b28c7b717f16421978b52e3a06d91b54ca3548b'
|
|
1675
|
+
};
|
|
1567
1676
|
|
|
1568
1677
|
var AURIGAMI_API_END_POINT = 'https://api.aurigami.finance/app/';
|
|
1569
1678
|
function getApi(_x, _x2) {
|
|
@@ -1897,7 +2006,7 @@ function _fetchUnderlyingTokensPrices() {
|
|
|
1897
2006
|
while (1) {
|
|
1898
2007
|
switch (_context7.prev = _context7.next) {
|
|
1899
2008
|
case 0:
|
|
1900
|
-
auriLens = new Contract(networkAddresses.misc.AURILENS, abis$
|
|
2009
|
+
auriLens = new Contract(networkAddresses.misc.AURILENS, abis$3.abi, provider);
|
|
1901
2010
|
auTokenAddresses = networkAddresses.auTokens.map(function (auToken) {
|
|
1902
2011
|
return auToken.address;
|
|
1903
2012
|
});
|
|
@@ -2343,7 +2452,7 @@ var AirdropRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2343
2452
|
var _this;
|
|
2344
2453
|
|
|
2345
2454
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
2346
|
-
_this.
|
|
2455
|
+
_this.env = new AuriEnv(networkConnection);
|
|
2347
2456
|
return _this;
|
|
2348
2457
|
}
|
|
2349
2458
|
/**
|
|
@@ -2364,7 +2473,7 @@ var AirdropRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2364
2473
|
case 0:
|
|
2365
2474
|
tokenInstance = new Token(token, getDecimal(token));
|
|
2366
2475
|
_context.next = 3;
|
|
2367
|
-
return this.
|
|
2476
|
+
return this.env.auriAirdrop.getRedeemableReward(utils.formatBytes32String(campaign), token, user);
|
|
2368
2477
|
|
|
2369
2478
|
case 3:
|
|
2370
2479
|
rewards = _context.sent;
|
|
@@ -2408,7 +2517,7 @@ var AirdropReadWrite = /*#__PURE__*/function (_AirdropRead) {
|
|
|
2408
2517
|
switch (_context2.prev = _context2.next) {
|
|
2409
2518
|
case 0:
|
|
2410
2519
|
assert(campaigns.length == tokens.length, 'campaigns and tokens must have the same length');
|
|
2411
|
-
_context2.t0 = this.
|
|
2520
|
+
_context2.t0 = this.env.auriAirdrop.connect(this._networkConnection.signer);
|
|
2412
2521
|
_context2.t1 = campaigns.map(function (e) {
|
|
2413
2522
|
return utils.formatBytes32String(e);
|
|
2414
2523
|
});
|
|
@@ -2514,9 +2623,9 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2514
2623
|
_this.env = new AuriEnv(networkConnection);
|
|
2515
2624
|
|
|
2516
2625
|
if (isSameAddress(underlyingAsset, ETHAddress)) {
|
|
2517
|
-
_this.auToken = new Contract(auToken, abis$
|
|
2626
|
+
_this.auToken = new Contract(auToken, abis$8.abi, networkConnection.provider);
|
|
2518
2627
|
} else {
|
|
2519
|
-
_this.auToken = new Contract(auToken, abis$
|
|
2628
|
+
_this.auToken = new Contract(auToken, abis$7.abi, networkConnection.provider);
|
|
2520
2629
|
}
|
|
2521
2630
|
|
|
2522
2631
|
_this.underlying = new Token(underlyingAsset, getDecimal(underlyingAsset));
|
|
@@ -2979,7 +3088,7 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
|
|
|
2979
3088
|
var _this3;
|
|
2980
3089
|
|
|
2981
3090
|
_this3 = _MoneyMarketRead.call(this, networkConnection, auToken, underlyingAsset) || this;
|
|
2982
|
-
_this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$
|
|
3091
|
+
_this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$9.abi, networkConnection.provider);
|
|
2983
3092
|
return _this3;
|
|
2984
3093
|
}
|
|
2985
3094
|
|
|
@@ -3193,7 +3302,7 @@ var MulticallRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3193
3302
|
var _this;
|
|
3194
3303
|
|
|
3195
3304
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
3196
|
-
_this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$
|
|
3305
|
+
_this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$a.abi, networkConnection.provider);
|
|
3197
3306
|
return _this;
|
|
3198
3307
|
}
|
|
3199
3308
|
/**
|
|
@@ -3765,7 +3874,7 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3765
3874
|
while (1) {
|
|
3766
3875
|
switch (_context3.prev = _context3.next) {
|
|
3767
3876
|
case 0:
|
|
3768
|
-
lpContract = new Contract(networkAddresses.tokens.PLYWNEAR, abis$
|
|
3877
|
+
lpContract = new Contract(networkAddresses.tokens.PLYWNEAR, abis$5.abi, this._networkConnection.provider);
|
|
3769
3878
|
_context3.next = 3;
|
|
3770
3879
|
return lpContract.balanceOf(user);
|
|
3771
3880
|
|
|
@@ -4356,7 +4465,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4356
4465
|
var _this;
|
|
4357
4466
|
|
|
4358
4467
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
4359
|
-
_this.
|
|
4468
|
+
_this.env = new AuriEnv(networkConnection);
|
|
4360
4469
|
return _this;
|
|
4361
4470
|
}
|
|
4362
4471
|
/**
|
|
@@ -4396,7 +4505,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4396
4505
|
switch (_context.prev = _context.next) {
|
|
4397
4506
|
case 0:
|
|
4398
4507
|
_context.next = 2;
|
|
4399
|
-
return this.
|
|
4508
|
+
return this.env.referralDirectory.userReferralCode(userAddr);
|
|
4400
4509
|
|
|
4401
4510
|
case 2:
|
|
4402
4511
|
result = _context.sent;
|
|
@@ -4431,7 +4540,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4431
4540
|
switch (_context2.prev = _context2.next) {
|
|
4432
4541
|
case 0:
|
|
4433
4542
|
_context2.next = 2;
|
|
4434
|
-
return this.
|
|
4543
|
+
return this.env.referralDirectory.referralCodeUsed(userAddr);
|
|
4435
4544
|
|
|
4436
4545
|
case 2:
|
|
4437
4546
|
result = _context2.sent;
|
|
@@ -4466,7 +4575,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4466
4575
|
switch (_context3.prev = _context3.next) {
|
|
4467
4576
|
case 0:
|
|
4468
4577
|
referralCode = ethers.utils.formatBytes32String(code);
|
|
4469
|
-
return _context3.abrupt("return", this.
|
|
4578
|
+
return _context3.abrupt("return", this.env.referralDirectory.referralCodeOwner(referralCode));
|
|
4470
4579
|
|
|
4471
4580
|
case 2:
|
|
4472
4581
|
case "end":
|
|
@@ -4532,6 +4641,64 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4532
4641
|
}
|
|
4533
4642
|
|
|
4534
4643
|
return getReferralsList;
|
|
4644
|
+
}()
|
|
4645
|
+
/**
|
|
4646
|
+
* Array of rewards, sorted by time of the referral period (from latest to oldest)
|
|
4647
|
+
*/
|
|
4648
|
+
;
|
|
4649
|
+
|
|
4650
|
+
_proto.referralRewards =
|
|
4651
|
+
/*#__PURE__*/
|
|
4652
|
+
function () {
|
|
4653
|
+
var _referralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(userAddr) {
|
|
4654
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4655
|
+
while (1) {
|
|
4656
|
+
switch (_context5.prev = _context5.next) {
|
|
4657
|
+
case 0:
|
|
4658
|
+
return _context5.abrupt("return", [referralRewardDummy1, referralRewardDummy2]);
|
|
4659
|
+
|
|
4660
|
+
case 1:
|
|
4661
|
+
case "end":
|
|
4662
|
+
return _context5.stop();
|
|
4663
|
+
}
|
|
4664
|
+
}
|
|
4665
|
+
}, _callee5);
|
|
4666
|
+
}));
|
|
4667
|
+
|
|
4668
|
+
function referralRewards(_x5) {
|
|
4669
|
+
return _referralRewards.apply(this, arguments);
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4672
|
+
return referralRewards;
|
|
4673
|
+
}()
|
|
4674
|
+
/**
|
|
4675
|
+
* Top 50 reward earners from the last round, sorted by token amount
|
|
4676
|
+
*/
|
|
4677
|
+
;
|
|
4678
|
+
|
|
4679
|
+
_proto.leaderboard =
|
|
4680
|
+
/*#__PURE__*/
|
|
4681
|
+
function () {
|
|
4682
|
+
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
|
|
4683
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
4684
|
+
while (1) {
|
|
4685
|
+
switch (_context6.prev = _context6.next) {
|
|
4686
|
+
case 0:
|
|
4687
|
+
return _context6.abrupt("return", [referralRewardDummy2, referralRewardDummy1]);
|
|
4688
|
+
|
|
4689
|
+
case 1:
|
|
4690
|
+
case "end":
|
|
4691
|
+
return _context6.stop();
|
|
4692
|
+
}
|
|
4693
|
+
}
|
|
4694
|
+
}, _callee6);
|
|
4695
|
+
}));
|
|
4696
|
+
|
|
4697
|
+
function leaderboard() {
|
|
4698
|
+
return _leaderboard.apply(this, arguments);
|
|
4699
|
+
}
|
|
4700
|
+
|
|
4701
|
+
return leaderboard;
|
|
4535
4702
|
}();
|
|
4536
4703
|
|
|
4537
4704
|
return ReferralRead;
|
|
@@ -4553,21 +4720,21 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
4553
4720
|
_proto2.registerNewReferralCode =
|
|
4554
4721
|
/*#__PURE__*/
|
|
4555
4722
|
function () {
|
|
4556
|
-
var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4723
|
+
var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
|
|
4557
4724
|
var referralCode;
|
|
4558
|
-
return runtime_1.wrap(function
|
|
4725
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
4559
4726
|
while (1) {
|
|
4560
|
-
switch (
|
|
4727
|
+
switch (_context7.prev = _context7.next) {
|
|
4561
4728
|
case 0:
|
|
4562
4729
|
referralCode = ethers.utils.formatBytes32String(this.generateReferralCode());
|
|
4563
|
-
return
|
|
4730
|
+
return _context7.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
|
|
4564
4731
|
|
|
4565
4732
|
case 2:
|
|
4566
4733
|
case "end":
|
|
4567
|
-
return
|
|
4734
|
+
return _context7.stop();
|
|
4568
4735
|
}
|
|
4569
4736
|
}
|
|
4570
|
-
},
|
|
4737
|
+
}, _callee7, this);
|
|
4571
4738
|
}));
|
|
4572
4739
|
|
|
4573
4740
|
function registerNewReferralCode() {
|
|
@@ -4584,28 +4751,77 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
4584
4751
|
_proto2.useReferralCode =
|
|
4585
4752
|
/*#__PURE__*/
|
|
4586
4753
|
function () {
|
|
4587
|
-
var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4754
|
+
var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(code) {
|
|
4588
4755
|
var referralCode;
|
|
4589
|
-
return runtime_1.wrap(function
|
|
4756
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4590
4757
|
while (1) {
|
|
4591
|
-
switch (
|
|
4758
|
+
switch (_context8.prev = _context8.next) {
|
|
4592
4759
|
case 0:
|
|
4593
4760
|
referralCode = ethers.utils.formatBytes32String(code);
|
|
4594
|
-
return
|
|
4761
|
+
return _context8.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
|
|
4595
4762
|
|
|
4596
4763
|
case 2:
|
|
4597
4764
|
case "end":
|
|
4598
|
-
return
|
|
4765
|
+
return _context8.stop();
|
|
4599
4766
|
}
|
|
4600
4767
|
}
|
|
4601
|
-
},
|
|
4768
|
+
}, _callee8, this);
|
|
4602
4769
|
}));
|
|
4603
4770
|
|
|
4604
|
-
function useReferralCode(
|
|
4771
|
+
function useReferralCode(_x6) {
|
|
4605
4772
|
return _useReferralCode.apply(this, arguments);
|
|
4606
4773
|
}
|
|
4607
4774
|
|
|
4608
4775
|
return useReferralCode;
|
|
4776
|
+
}()
|
|
4777
|
+
/**
|
|
4778
|
+
* Claim all unclaimed rewards for a given user
|
|
4779
|
+
*/
|
|
4780
|
+
;
|
|
4781
|
+
|
|
4782
|
+
_proto2.claimReferralRewards =
|
|
4783
|
+
/*#__PURE__*/
|
|
4784
|
+
function () {
|
|
4785
|
+
var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
|
|
4786
|
+
var unclaimedRewards, campaigns, tokens;
|
|
4787
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
4788
|
+
while (1) {
|
|
4789
|
+
switch (_context9.prev = _context9.next) {
|
|
4790
|
+
case 0:
|
|
4791
|
+
_context9.t0 = this;
|
|
4792
|
+
_context9.next = 3;
|
|
4793
|
+
return this._networkConnection.signer.getAddress();
|
|
4794
|
+
|
|
4795
|
+
case 3:
|
|
4796
|
+
_context9.t1 = _context9.sent;
|
|
4797
|
+
_context9.next = 6;
|
|
4798
|
+
return _context9.t0.referralRewards.call(_context9.t0, _context9.t1);
|
|
4799
|
+
|
|
4800
|
+
case 6:
|
|
4801
|
+
unclaimedRewards = _context9.sent.filter(function (reward) {
|
|
4802
|
+
return reward.transactionHash == null;
|
|
4803
|
+
});
|
|
4804
|
+
campaigns = unclaimedRewards.map(function (reward) {
|
|
4805
|
+
return reward.campaign;
|
|
4806
|
+
});
|
|
4807
|
+
tokens = unclaimedRewards.map(function (reward) {
|
|
4808
|
+
return reward.rewardTokenAmount.token.address;
|
|
4809
|
+
});
|
|
4810
|
+
return _context9.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
|
|
4811
|
+
|
|
4812
|
+
case 10:
|
|
4813
|
+
case "end":
|
|
4814
|
+
return _context9.stop();
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
}, _callee9, this);
|
|
4818
|
+
}));
|
|
4819
|
+
|
|
4820
|
+
function claimReferralRewards() {
|
|
4821
|
+
return _claimReferralRewards.apply(this, arguments);
|
|
4822
|
+
}
|
|
4823
|
+
|
|
4824
|
+
return claimReferralRewards;
|
|
4609
4825
|
}();
|
|
4610
4826
|
|
|
4611
4827
|
return ReferralReadWrite;
|
|
@@ -5038,5 +5254,5 @@ BigNumber.config({
|
|
|
5038
5254
|
DECIMAL_PLACES: 50
|
|
5039
5255
|
});
|
|
5040
5256
|
|
|
5041
|
-
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, DEPOSIT_ONLY_TOKENS, 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, index as abis, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, symbolRecords, validateAndParseAddress, valuateToken };
|
|
5257
|
+
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, DEPOSIT_ONLY_TOKENS, 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, index as abis, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, symbolRecords, validateAndParseAddress, valuateToken };
|
|
5042
5258
|
//# sourceMappingURL=sdk.esm.js.map
|