@aurigami/sdk 1.9.7 → 1.10.0
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/entities/auriEnv.d.ts +11 -1
- package/dist/interactors/Papermill.d.ts +1 -1
- package/dist/sdk.cjs.development.js +180 -155
- 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 +181 -156
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/a.ts.log +29 -0
- package/src/entities/auriEnv.ts +32 -1
- package/src/interactors/Papermill.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, Comptroller, IERC20,
|
|
1
|
+
import { AuErc20, AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, AuriOracle, Comptroller, IERC20, PULP, ReferralDirectory } from '@aurigami/contracts/typechain';
|
|
2
2
|
import { Contract } from 'ethers';
|
|
3
3
|
import { AuTokenWithUnderlying } from '../types';
|
|
4
4
|
import { BlockchainEntityRead } from './BlockchainEntity';
|
|
@@ -14,6 +14,16 @@ export declare class AuriEnv extends BlockchainEntityRead {
|
|
|
14
14
|
private _oracle;
|
|
15
15
|
getContract<CType extends Contract>(address: string, abi: any): CType;
|
|
16
16
|
getAuTokenContracts(): AuTokenWithUnderlying[];
|
|
17
|
+
/**
|
|
18
|
+
* Get AuErc20 contract by its address or underlying name.
|
|
19
|
+
*
|
|
20
|
+
* Either address or underlyingName must be provided
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
getAuErc20Contract({ address, underlyingName, }: {
|
|
24
|
+
address?: string;
|
|
25
|
+
underlyingName?: string;
|
|
26
|
+
}): AuErc20;
|
|
17
27
|
get comptroller(): Comptroller;
|
|
18
28
|
get auriFairLaunch(): AuriFairLaunch;
|
|
19
29
|
get auriLens(): AuriLens;
|
|
@@ -12,7 +12,7 @@ export declare class PapermillRead extends BlockchainEntityRead {
|
|
|
12
12
|
* Get all unclaimed PLY reward of the user in all markets + all staking pools
|
|
13
13
|
*/
|
|
14
14
|
getUnclaimedPlyReward(userAddress: Address): Promise<TokenAmount>;
|
|
15
|
-
|
|
15
|
+
getWeek(timestamp: number): number;
|
|
16
16
|
/**
|
|
17
17
|
* Get all locking details of the user in all markets + all staking pools
|
|
18
18
|
*/
|
|
@@ -24,8 +24,8 @@ var abis$c = _interopDefault(require('@aurigami/contracts/artifacts/contracts/PU
|
|
|
24
24
|
var abis$d = _interopDefault(require('@aurigami/contracts/artifacts/contracts/ReferralDirectory.sol/ReferralDirectory.json'));
|
|
25
25
|
var MAINNET_ADDRESSES = _interopDefault(require('@aurigami/contracts/deployments/aurora_mainnet.json'));
|
|
26
26
|
var aurora_testnet_json = _interopDefault(require('@aurigami/contracts/deployments/aurora_testnet.json'));
|
|
27
|
-
var abstractSigner = require('@ethersproject/abstract-signer');
|
|
28
27
|
var axios = _interopDefault(require('axios'));
|
|
28
|
+
var abstractSigner = require('@ethersproject/abstract-signer');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -342,160 +342,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
342
342
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
-
var BlockchainEntityRead = function BlockchainEntityRead(networkConnection) {
|
|
346
|
-
this._networkConnection = networkConnection;
|
|
347
|
-
};
|
|
348
|
-
var BlockchainEntityReadWrite = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
349
|
-
_inheritsLoose(BlockchainEntityReadWrite, _BlockchainEntityRead);
|
|
350
|
-
|
|
351
|
-
function BlockchainEntityReadWrite(networkConnection) {
|
|
352
|
-
if (!(networkConnection.signer instanceof abstractSigner.Signer)) {
|
|
353
|
-
throw Error('Signer is not provided when constructing BlockchainEntityReadWrite');
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
return _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
return BlockchainEntityReadWrite;
|
|
360
|
-
}(BlockchainEntityRead);
|
|
361
|
-
var BlockchainEntity = /*#__PURE__*/function () {
|
|
362
|
-
function BlockchainEntity() {}
|
|
363
|
-
|
|
364
|
-
var _proto = BlockchainEntity.prototype;
|
|
365
|
-
|
|
366
|
-
_proto.read = function read(networkConnection) {
|
|
367
|
-
return new BlockchainEntityRead(networkConnection);
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
_proto.readWrite = function readWrite(networkConnection) {
|
|
371
|
-
return new BlockchainEntityReadWrite(networkConnection);
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
return BlockchainEntity;
|
|
375
|
-
}();
|
|
376
|
-
|
|
377
|
-
var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
378
|
-
_inheritsLoose(AuriEnv, _BlockchainEntityRead);
|
|
379
|
-
|
|
380
|
-
function AuriEnv() {
|
|
381
|
-
var _this;
|
|
382
|
-
|
|
383
|
-
_this = _BlockchainEntityRead.apply(this, arguments) || this;
|
|
384
|
-
_this._comptroller = null;
|
|
385
|
-
_this._auriFairLaunch = null;
|
|
386
|
-
_this._auriLens = null;
|
|
387
|
-
_this._ply = null;
|
|
388
|
-
_this._pulp = null;
|
|
389
|
-
_this._auriInternalLens = null;
|
|
390
|
-
_this._auriAirdrop = null;
|
|
391
|
-
_this._referralDirectory = null;
|
|
392
|
-
_this._oracle = null;
|
|
393
|
-
return _this;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
var _proto = AuriEnv.prototype;
|
|
397
|
-
|
|
398
|
-
_proto.getContract = function getContract(address, abi) {
|
|
399
|
-
return new ethers.Contract(address, abi, this._networkConnection.provider);
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
_proto.getAuTokenContracts = function getAuTokenContracts() {
|
|
403
|
-
var _this2 = this;
|
|
404
|
-
|
|
405
|
-
return networkAddresses.auTokens.map(function (auToken) {
|
|
406
|
-
var contract = _this2.getContract(auToken.address, abis$6.abi);
|
|
407
|
-
|
|
408
|
-
contract.underlying = auToken.underlying;
|
|
409
|
-
return contract;
|
|
410
|
-
});
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
_createClass(AuriEnv, [{
|
|
414
|
-
key: "comptroller",
|
|
415
|
-
get: function get() {
|
|
416
|
-
if (!this._comptroller) {
|
|
417
|
-
this._comptroller = this.getContract(networkAddresses.misc.COMPTROLLER, abis$7.abi);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return this._comptroller;
|
|
421
|
-
}
|
|
422
|
-
}, {
|
|
423
|
-
key: "auriFairLaunch",
|
|
424
|
-
get: function get() {
|
|
425
|
-
if (!this._auriFairLaunch) {
|
|
426
|
-
this._auriFairLaunch = this.getContract(networkAddresses.misc.AURIFAIRLAUNCH, abis$3.abi);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
return this._auriFairLaunch;
|
|
430
|
-
}
|
|
431
|
-
}, {
|
|
432
|
-
key: "auriLens",
|
|
433
|
-
get: function get() {
|
|
434
|
-
if (!this._auriLens) {
|
|
435
|
-
this._auriLens = this.getContract(networkAddresses.misc.AURILENS, abis$4.abi);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
return this._auriLens;
|
|
439
|
-
}
|
|
440
|
-
}, {
|
|
441
|
-
key: "ply",
|
|
442
|
-
get: function get() {
|
|
443
|
-
if (!this._ply) {
|
|
444
|
-
this._ply = this.getContract(networkAddresses.tokens.PLY, abis$9.abi);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
return this._ply;
|
|
448
|
-
}
|
|
449
|
-
}, {
|
|
450
|
-
key: "pulp",
|
|
451
|
-
get: function get() {
|
|
452
|
-
if (!this._pulp) {
|
|
453
|
-
this._pulp = this.getContract(networkAddresses.tokens.PULP, abis$c.abi);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
return this._pulp;
|
|
457
|
-
}
|
|
458
|
-
}, {
|
|
459
|
-
key: "auriInternalLens",
|
|
460
|
-
get: function get() {
|
|
461
|
-
if (!this._auriInternalLens) {
|
|
462
|
-
this._auriInternalLens = this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$a.abi);
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
return this._auriInternalLens;
|
|
466
|
-
}
|
|
467
|
-
}, {
|
|
468
|
-
key: "auriAirdrop",
|
|
469
|
-
get: function get() {
|
|
470
|
-
if (!this._auriAirdrop) {
|
|
471
|
-
this._auriAirdrop = this.getContract(networkAddresses.misc.AURI_AIRDROP, abis$2.abi);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
return this._auriAirdrop;
|
|
475
|
-
}
|
|
476
|
-
}, {
|
|
477
|
-
key: "referralDirectory",
|
|
478
|
-
get: function get() {
|
|
479
|
-
if (!this._referralDirectory) {
|
|
480
|
-
this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$d.abi);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
return this._referralDirectory;
|
|
484
|
-
}
|
|
485
|
-
}, {
|
|
486
|
-
key: "oracle",
|
|
487
|
-
get: function get() {
|
|
488
|
-
if (!this._oracle) {
|
|
489
|
-
this._oracle = this.getContract(networkAddresses.misc.oracle, abis$5.abi);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
return this._oracle;
|
|
493
|
-
}
|
|
494
|
-
}]);
|
|
495
|
-
|
|
496
|
-
return AuriEnv;
|
|
497
|
-
}(BlockchainEntityRead);
|
|
498
|
-
|
|
499
345
|
function createCommonjsModule(fn, module) {
|
|
500
346
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
501
347
|
}
|
|
@@ -1635,6 +1481,185 @@ function devLog(message) {
|
|
|
1635
1481
|
}
|
|
1636
1482
|
}
|
|
1637
1483
|
|
|
1484
|
+
var BlockchainEntityRead = function BlockchainEntityRead(networkConnection) {
|
|
1485
|
+
this._networkConnection = networkConnection;
|
|
1486
|
+
};
|
|
1487
|
+
var BlockchainEntityReadWrite = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
1488
|
+
_inheritsLoose(BlockchainEntityReadWrite, _BlockchainEntityRead);
|
|
1489
|
+
|
|
1490
|
+
function BlockchainEntityReadWrite(networkConnection) {
|
|
1491
|
+
if (!(networkConnection.signer instanceof abstractSigner.Signer)) {
|
|
1492
|
+
throw Error('Signer is not provided when constructing BlockchainEntityReadWrite');
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
return _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
return BlockchainEntityReadWrite;
|
|
1499
|
+
}(BlockchainEntityRead);
|
|
1500
|
+
var BlockchainEntity = /*#__PURE__*/function () {
|
|
1501
|
+
function BlockchainEntity() {}
|
|
1502
|
+
|
|
1503
|
+
var _proto = BlockchainEntity.prototype;
|
|
1504
|
+
|
|
1505
|
+
_proto.read = function read(networkConnection) {
|
|
1506
|
+
return new BlockchainEntityRead(networkConnection);
|
|
1507
|
+
};
|
|
1508
|
+
|
|
1509
|
+
_proto.readWrite = function readWrite(networkConnection) {
|
|
1510
|
+
return new BlockchainEntityReadWrite(networkConnection);
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
return BlockchainEntity;
|
|
1514
|
+
}();
|
|
1515
|
+
|
|
1516
|
+
var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
1517
|
+
_inheritsLoose(AuriEnv, _BlockchainEntityRead);
|
|
1518
|
+
|
|
1519
|
+
function AuriEnv() {
|
|
1520
|
+
var _this;
|
|
1521
|
+
|
|
1522
|
+
_this = _BlockchainEntityRead.apply(this, arguments) || this;
|
|
1523
|
+
_this._comptroller = null;
|
|
1524
|
+
_this._auriFairLaunch = null;
|
|
1525
|
+
_this._auriLens = null;
|
|
1526
|
+
_this._ply = null;
|
|
1527
|
+
_this._pulp = null;
|
|
1528
|
+
_this._auriInternalLens = null;
|
|
1529
|
+
_this._auriAirdrop = null;
|
|
1530
|
+
_this._referralDirectory = null;
|
|
1531
|
+
_this._oracle = null;
|
|
1532
|
+
return _this;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
var _proto = AuriEnv.prototype;
|
|
1536
|
+
|
|
1537
|
+
_proto.getContract = function getContract(address, abi) {
|
|
1538
|
+
return new ethers.Contract(address, abi, this._networkConnection.provider);
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1541
|
+
_proto.getAuTokenContracts = function getAuTokenContracts() {
|
|
1542
|
+
var _this2 = this;
|
|
1543
|
+
|
|
1544
|
+
return networkAddresses.auTokens.map(function (auToken) {
|
|
1545
|
+
var contract = _this2.getContract(auToken.address, abis$6.abi);
|
|
1546
|
+
|
|
1547
|
+
contract.underlying = auToken.underlying;
|
|
1548
|
+
return contract;
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Get AuErc20 contract by its address or underlying name.
|
|
1553
|
+
*
|
|
1554
|
+
* Either address or underlyingName must be provided
|
|
1555
|
+
*
|
|
1556
|
+
*/
|
|
1557
|
+
;
|
|
1558
|
+
|
|
1559
|
+
_proto.getAuErc20Contract = function getAuErc20Contract(_ref) {
|
|
1560
|
+
var address = _ref.address,
|
|
1561
|
+
underlyingName = _ref.underlyingName;
|
|
1562
|
+
assert(address !== undefined || underlyingName !== undefined, 'Either address or underlyingName must be provided');
|
|
1563
|
+
|
|
1564
|
+
if (underlyingName) {
|
|
1565
|
+
var _networkAddresses$auT;
|
|
1566
|
+
|
|
1567
|
+
address = (_networkAddresses$auT = networkAddresses.auTokens.find(function (auToken) {
|
|
1568
|
+
return auToken.name == 'au' + underlyingName;
|
|
1569
|
+
})) == null ? void 0 : _networkAddresses$auT.address;
|
|
1570
|
+
console.log(address);
|
|
1571
|
+
assert(address !== undefined, "AuToken with underlying " + underlyingName + " not found");
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
return this.getContract(address, abis.abi);
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
_createClass(AuriEnv, [{
|
|
1578
|
+
key: "comptroller",
|
|
1579
|
+
get: function get() {
|
|
1580
|
+
if (!this._comptroller) {
|
|
1581
|
+
this._comptroller = this.getContract(networkAddresses.misc.COMPTROLLER, abis$7.abi);
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
return this._comptroller;
|
|
1585
|
+
}
|
|
1586
|
+
}, {
|
|
1587
|
+
key: "auriFairLaunch",
|
|
1588
|
+
get: function get() {
|
|
1589
|
+
if (!this._auriFairLaunch) {
|
|
1590
|
+
this._auriFairLaunch = this.getContract(networkAddresses.misc.AURIFAIRLAUNCH, abis$3.abi);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
return this._auriFairLaunch;
|
|
1594
|
+
}
|
|
1595
|
+
}, {
|
|
1596
|
+
key: "auriLens",
|
|
1597
|
+
get: function get() {
|
|
1598
|
+
if (!this._auriLens) {
|
|
1599
|
+
this._auriLens = this.getContract(networkAddresses.misc.AURILENS, abis$4.abi);
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
return this._auriLens;
|
|
1603
|
+
}
|
|
1604
|
+
}, {
|
|
1605
|
+
key: "ply",
|
|
1606
|
+
get: function get() {
|
|
1607
|
+
if (!this._ply) {
|
|
1608
|
+
this._ply = this.getContract(networkAddresses.tokens.PLY, abis$9.abi);
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
return this._ply;
|
|
1612
|
+
}
|
|
1613
|
+
}, {
|
|
1614
|
+
key: "pulp",
|
|
1615
|
+
get: function get() {
|
|
1616
|
+
if (!this._pulp) {
|
|
1617
|
+
this._pulp = this.getContract(networkAddresses.tokens.PULP, abis$c.abi);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
return this._pulp;
|
|
1621
|
+
}
|
|
1622
|
+
}, {
|
|
1623
|
+
key: "auriInternalLens",
|
|
1624
|
+
get: function get() {
|
|
1625
|
+
if (!this._auriInternalLens) {
|
|
1626
|
+
this._auriInternalLens = this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$a.abi);
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
return this._auriInternalLens;
|
|
1630
|
+
}
|
|
1631
|
+
}, {
|
|
1632
|
+
key: "auriAirdrop",
|
|
1633
|
+
get: function get() {
|
|
1634
|
+
if (!this._auriAirdrop) {
|
|
1635
|
+
this._auriAirdrop = this.getContract(networkAddresses.misc.AURI_AIRDROP, abis$2.abi);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
return this._auriAirdrop;
|
|
1639
|
+
}
|
|
1640
|
+
}, {
|
|
1641
|
+
key: "referralDirectory",
|
|
1642
|
+
get: function get() {
|
|
1643
|
+
if (!this._referralDirectory) {
|
|
1644
|
+
this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$d.abi);
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
return this._referralDirectory;
|
|
1648
|
+
}
|
|
1649
|
+
}, {
|
|
1650
|
+
key: "oracle",
|
|
1651
|
+
get: function get() {
|
|
1652
|
+
if (!this._oracle) {
|
|
1653
|
+
this._oracle = this.getContract(networkAddresses.misc.oracle, abis$5.abi);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
return this._oracle;
|
|
1657
|
+
}
|
|
1658
|
+
}]);
|
|
1659
|
+
|
|
1660
|
+
return AuriEnv;
|
|
1661
|
+
}(BlockchainEntityRead);
|
|
1662
|
+
|
|
1638
1663
|
var Token = function Token(address, decimals) {
|
|
1639
1664
|
this.address = address.toLowerCase();
|
|
1640
1665
|
this.decimals = decimals;
|