@aurigami/sdk 1.9.5 → 1.9.6
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 +3 -1
- package/dist/sdk.cjs.development.js +41 -31
- 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 +57 -47
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/auriEnv.ts +12 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, Comptroller, IERC20, PULP, ReferralDirectory } from '@aurigami/contracts/typechain';
|
|
1
|
+
import { AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, Comptroller, IERC20, AuriOracle, PULP, ReferralDirectory } from '@aurigami/contracts/typechain';
|
|
2
2
|
import { Contract } from 'ethers';
|
|
3
3
|
import { AuTokenWithUnderlying } from '../types';
|
|
4
4
|
import { BlockchainEntityRead } from './BlockchainEntity';
|
|
@@ -11,6 +11,7 @@ export declare class AuriEnv extends BlockchainEntityRead {
|
|
|
11
11
|
private _auriInternalLens;
|
|
12
12
|
private _auriAirdrop;
|
|
13
13
|
private _referralDirectory;
|
|
14
|
+
private _oracle;
|
|
14
15
|
getContract<CType extends Contract>(address: string, abi: any): CType;
|
|
15
16
|
getAuTokenContracts(): AuTokenWithUnderlying[];
|
|
16
17
|
get comptroller(): Comptroller;
|
|
@@ -21,4 +22,5 @@ export declare class AuriEnv extends BlockchainEntityRead {
|
|
|
21
22
|
get auriInternalLens(): AuriInternalLens;
|
|
22
23
|
get auriAirdrop(): AuriAirdrop;
|
|
23
24
|
get referralDirectory(): ReferralDirectory;
|
|
25
|
+
get oracle(): AuriOracle;
|
|
24
26
|
}
|
|
@@ -12,16 +12,16 @@ var abis$1 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/Au
|
|
|
12
12
|
var abis$2 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriAirdrop.sol/AuriAirdrop.json'));
|
|
13
13
|
var abis$3 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json'));
|
|
14
14
|
var abis$4 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json'));
|
|
15
|
-
var
|
|
16
|
-
var abis$
|
|
17
|
-
var abis$
|
|
18
|
-
var abis$
|
|
19
|
-
var abis$
|
|
20
|
-
var abis$
|
|
15
|
+
var abis$5 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuriOracle.sol/AuriOracle.json'));
|
|
16
|
+
var abis$6 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json'));
|
|
17
|
+
var abis$7 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json'));
|
|
18
|
+
var abis$8 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/EthRepayHelper.sol/EthRepayHelper.json'));
|
|
19
|
+
var abis$9 = _interopDefault(require('@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json'));
|
|
20
|
+
var abis$a = _interopDefault(require('@aurigami/contracts/artifacts/contracts/mock/AuriInternalLens.sol/AuriInternalLens.json'));
|
|
21
21
|
var IUniswapV2PairABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/mock/IUniswapV2Pair.sol/IUniswapV2Pair.json'));
|
|
22
|
-
var abis$
|
|
23
|
-
var abis$
|
|
24
|
-
var abis$
|
|
22
|
+
var abis$b = _interopDefault(require('@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json'));
|
|
23
|
+
var abis$c = _interopDefault(require('@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json'));
|
|
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
27
|
var abstractSigner = require('@ethersproject/abstract-signer');
|
|
@@ -31,21 +31,21 @@ var axios = _interopDefault(require('axios'));
|
|
|
31
31
|
|
|
32
32
|
var index = {
|
|
33
33
|
__proto__: null,
|
|
34
|
-
AuriOracleABI:
|
|
35
|
-
AuTokenABI: abis$
|
|
34
|
+
AuriOracleABI: abis$5,
|
|
35
|
+
AuTokenABI: abis$6,
|
|
36
36
|
IUniswapV2PairABI: IUniswapV2PairABI,
|
|
37
37
|
AuriAirdropABI: abis$2,
|
|
38
38
|
AuriFairLaunchABI: abis$3,
|
|
39
39
|
AuriLensABI: abis$4,
|
|
40
|
-
ComptrollerABI: abis$
|
|
41
|
-
EIP20InterfaceABI: abis$
|
|
42
|
-
ReferralDirectoryABI: abis$
|
|
40
|
+
ComptrollerABI: abis$7,
|
|
41
|
+
EIP20InterfaceABI: abis$9,
|
|
42
|
+
ReferralDirectoryABI: abis$d,
|
|
43
43
|
AuErc20ABI: abis,
|
|
44
44
|
AuETHABI: abis$1,
|
|
45
|
-
EthRepayHelperABI: abis$
|
|
46
|
-
Multicall2ABI: abis$
|
|
47
|
-
PulpABI: abis$
|
|
48
|
-
AuriInternalLensABI: abis$
|
|
45
|
+
EthRepayHelperABI: abis$8,
|
|
46
|
+
Multicall2ABI: abis$b,
|
|
47
|
+
PulpABI: abis$c,
|
|
48
|
+
AuriInternalLensABI: abis$a
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
|
|
@@ -389,6 +389,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
389
389
|
_this._auriInternalLens = null;
|
|
390
390
|
_this._auriAirdrop = null;
|
|
391
391
|
_this._referralDirectory = null;
|
|
392
|
+
_this._oracle = null;
|
|
392
393
|
return _this;
|
|
393
394
|
}
|
|
394
395
|
|
|
@@ -402,7 +403,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
402
403
|
var _this2 = this;
|
|
403
404
|
|
|
404
405
|
return networkAddresses.auTokens.map(function (auToken) {
|
|
405
|
-
var contract = _this2.getContract(auToken.address, abis$
|
|
406
|
+
var contract = _this2.getContract(auToken.address, abis$6.abi);
|
|
406
407
|
|
|
407
408
|
contract.underlying = auToken.underlying;
|
|
408
409
|
return contract;
|
|
@@ -413,7 +414,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
413
414
|
key: "comptroller",
|
|
414
415
|
get: function get() {
|
|
415
416
|
if (!this._comptroller) {
|
|
416
|
-
this._comptroller = this.getContract(networkAddresses.misc.COMPTROLLER, abis$
|
|
417
|
+
this._comptroller = this.getContract(networkAddresses.misc.COMPTROLLER, abis$7.abi);
|
|
417
418
|
}
|
|
418
419
|
|
|
419
420
|
return this._comptroller;
|
|
@@ -440,7 +441,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
440
441
|
key: "ply",
|
|
441
442
|
get: function get() {
|
|
442
443
|
if (!this._ply) {
|
|
443
|
-
this._ply = this.getContract(networkAddresses.tokens.PLY, abis$
|
|
444
|
+
this._ply = this.getContract(networkAddresses.tokens.PLY, abis$9.abi);
|
|
444
445
|
}
|
|
445
446
|
|
|
446
447
|
return this._ply;
|
|
@@ -449,7 +450,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
449
450
|
key: "pulp",
|
|
450
451
|
get: function get() {
|
|
451
452
|
if (!this._pulp) {
|
|
452
|
-
this._pulp = this.getContract(networkAddresses.tokens.PULP, abis$
|
|
453
|
+
this._pulp = this.getContract(networkAddresses.tokens.PULP, abis$c.abi);
|
|
453
454
|
}
|
|
454
455
|
|
|
455
456
|
return this._pulp;
|
|
@@ -458,7 +459,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
458
459
|
key: "auriInternalLens",
|
|
459
460
|
get: function get() {
|
|
460
461
|
if (!this._auriInternalLens) {
|
|
461
|
-
this._auriInternalLens = this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$
|
|
462
|
+
this._auriInternalLens = this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$a.abi);
|
|
462
463
|
}
|
|
463
464
|
|
|
464
465
|
return this._auriInternalLens;
|
|
@@ -476,11 +477,20 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
476
477
|
key: "referralDirectory",
|
|
477
478
|
get: function get() {
|
|
478
479
|
if (!this._referralDirectory) {
|
|
479
|
-
this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$
|
|
480
|
+
this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$d.abi);
|
|
480
481
|
}
|
|
481
482
|
|
|
482
483
|
return this._referralDirectory;
|
|
483
484
|
}
|
|
485
|
+
}, {
|
|
486
|
+
key: "oracle",
|
|
487
|
+
get: function get() {
|
|
488
|
+
if (!this._oracle) {
|
|
489
|
+
this._oracle = this.getContract(networkAddresses.misc.PRICE_ORACLE, abis$5.abi);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return this._oracle;
|
|
493
|
+
}
|
|
484
494
|
}]);
|
|
485
495
|
|
|
486
496
|
return AuriEnv;
|
|
@@ -2071,7 +2081,7 @@ function _fetchPriceFromOracle() {
|
|
|
2071
2081
|
while (1) {
|
|
2072
2082
|
switch (_context7.prev = _context7.next) {
|
|
2073
2083
|
case 0:
|
|
2074
|
-
oracleContract = new ethers.Contract(networkAddresses.misc.oracle,
|
|
2084
|
+
oracleContract = new ethers.Contract(networkAddresses.misc.oracle, abis$5.abi, provider);
|
|
2075
2085
|
_context7.next = 3;
|
|
2076
2086
|
return oracleContract.getUnderlyingPrice(auTokenAddress)["catch"](function (e) {
|
|
2077
2087
|
console.log("Unable to fetch price from oracle for " + auTokenAddress);
|
|
@@ -2427,7 +2437,7 @@ var TransferEventQuery = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
2427
2437
|
var _this;
|
|
2428
2438
|
|
|
2429
2439
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
2430
|
-
_this.auToken = new ethers.Contract(tokenAddr, abis$
|
|
2440
|
+
_this.auToken = new ethers.Contract(tokenAddr, abis$6.abi, _this._networkConnection.provider);
|
|
2431
2441
|
return _this;
|
|
2432
2442
|
}
|
|
2433
2443
|
/**
|
|
@@ -3216,7 +3226,7 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
|
|
|
3216
3226
|
var _this3;
|
|
3217
3227
|
|
|
3218
3228
|
_this3 = _MoneyMarketRead.call(this, networkConnection, auToken, underlyingAsset) || this;
|
|
3219
|
-
_this3._EthRepayHelper = new ethers.Contract(networkAddresses.misc.ETHREPAYHELPER, abis$
|
|
3229
|
+
_this3._EthRepayHelper = new ethers.Contract(networkAddresses.misc.ETHREPAYHELPER, abis$8.abi, networkConnection.provider);
|
|
3220
3230
|
return _this3;
|
|
3221
3231
|
}
|
|
3222
3232
|
|
|
@@ -3430,7 +3440,7 @@ var MulticallRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
3430
3440
|
var _this;
|
|
3431
3441
|
|
|
3432
3442
|
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
3433
|
-
_this.multicall = new ethers.Contract(networkAddresses.misc.MULTICALL, abis$
|
|
3443
|
+
_this.multicall = new ethers.Contract(networkAddresses.misc.MULTICALL, abis$b.abi, networkConnection.provider);
|
|
3434
3444
|
return _this;
|
|
3435
3445
|
}
|
|
3436
3446
|
/**
|
|
@@ -4002,7 +4012,7 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4002
4012
|
while (1) {
|
|
4003
4013
|
switch (_context3.prev = _context3.next) {
|
|
4004
4014
|
case 0:
|
|
4005
|
-
lpContract = new ethers.Contract(networkAddresses.tokens.PLYWNEAR, abis$
|
|
4015
|
+
lpContract = new ethers.Contract(networkAddresses.tokens.PLYWNEAR, abis$9.abi, this._networkConnection.provider);
|
|
4006
4016
|
_context3.next = 3;
|
|
4007
4017
|
return lpContract.balanceOf(user);
|
|
4008
4018
|
|
|
@@ -4482,9 +4492,9 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4482
4492
|
}
|
|
4483
4493
|
|
|
4484
4494
|
_1E18 = ethers.BigNumber.from(10).pow(18);
|
|
4485
|
-
oracle = this.env.getContract(networkAddresses.misc.oracle,
|
|
4495
|
+
oracle = this.env.getContract(networkAddresses.misc.oracle, abis$5.abi);
|
|
4486
4496
|
tokens = tokenAddresses.map(function (addr) {
|
|
4487
|
-
return _this3.env.getContract(addr, abis$
|
|
4497
|
+
return _this3.env.getContract(addr, abis$6.abi);
|
|
4488
4498
|
});
|
|
4489
4499
|
_context5.next = 6;
|
|
4490
4500
|
return oracle.getUnderlyingPrices(tokenAddresses);
|