@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/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$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
- import AuriOracleABI from '@aurigami/contracts/artifacts/contracts/AuriOracle.sol/AuriOracle.json';
10
- import abis from '@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json';
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';
4
+ import abis$8 from '@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json';
5
+ import abis$9 from '@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json';
6
+ import abis$2 from '@aurigami/contracts/artifacts/contracts/AuriAirdrop.sol/AuriAirdrop.json';
7
+ import abis$3 from '@aurigami/contracts/artifacts/contracts/AuriFairLaunch.sol/AuriFairLaunch.json';
8
+ import abis$4 from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json';
9
+ import abis from '@aurigami/contracts/artifacts/contracts/AuriOracle.sol/AuriOracle.json';
10
+ import abis$1 from '@aurigami/contracts/artifacts/contracts/AuToken.sol/AuToken.json';
11
+ import abis$5 from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
12
+ import abis$a from '@aurigami/contracts/artifacts/contracts/EthRepayHelper.sol/EthRepayHelper.json';
13
+ import abis$6 from '@aurigami/contracts/artifacts/contracts/interfaces/EIP20Interface.sol/EIP20Interface.json';
14
+ import abis$d 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$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';
16
+ import abis$b from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json';
17
+ import abis$c from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
18
+ import abis$7 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';
@@ -26,21 +26,21 @@ import axios from 'axios';
26
26
 
27
27
  var index = {
28
28
  __proto__: null,
29
- AuriOracleABI: AuriOracleABI,
30
- AuTokenABI: abis,
29
+ AuriOracleABI: abis,
30
+ AuTokenABI: abis$1,
31
31
  IUniswapV2PairABI: IUniswapV2PairABI,
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
32
+ AuriAirdropABI: abis$2,
33
+ AuriFairLaunchABI: abis$3,
34
+ AuriLensABI: abis$4,
35
+ ComptrollerABI: abis$5,
36
+ EIP20InterfaceABI: abis$6,
37
+ ReferralDirectoryABI: abis$7,
38
+ AuErc20ABI: abis$8,
39
+ AuETHABI: abis$9,
40
+ EthRepayHelperABI: abis$a,
41
+ Multicall2ABI: abis$b,
42
+ PulpABI: abis$c,
43
+ AuriInternalLensABI: abis$d
44
44
  };
45
45
 
46
46
  var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
@@ -384,6 +384,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
384
384
  _this._auriInternalLens = null;
385
385
  _this._auriAirdrop = null;
386
386
  _this._referralDirectory = null;
387
+ _this._oracle = null;
387
388
  return _this;
388
389
  }
389
390
 
@@ -397,7 +398,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
397
398
  var _this2 = this;
398
399
 
399
400
  return networkAddresses.auTokens.map(function (auToken) {
400
- var contract = _this2.getContract(auToken.address, abis.abi);
401
+ var contract = _this2.getContract(auToken.address, abis$1.abi);
401
402
 
402
403
  contract.underlying = auToken.underlying;
403
404
  return contract;
@@ -408,7 +409,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
408
409
  key: "comptroller",
409
410
  get: function get() {
410
411
  if (!this._comptroller) {
411
- this._comptroller = this.getContract(networkAddresses.misc.COMPTROLLER, abis$4.abi);
412
+ this._comptroller = this.getContract(networkAddresses.misc.COMPTROLLER, abis$5.abi);
412
413
  }
413
414
 
414
415
  return this._comptroller;
@@ -417,7 +418,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
417
418
  key: "auriFairLaunch",
418
419
  get: function get() {
419
420
  if (!this._auriFairLaunch) {
420
- this._auriFairLaunch = this.getContract(networkAddresses.misc.AURIFAIRLAUNCH, abis$2.abi);
421
+ this._auriFairLaunch = this.getContract(networkAddresses.misc.AURIFAIRLAUNCH, abis$3.abi);
421
422
  }
422
423
 
423
424
  return this._auriFairLaunch;
@@ -426,7 +427,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
426
427
  key: "auriLens",
427
428
  get: function get() {
428
429
  if (!this._auriLens) {
429
- this._auriLens = this.getContract(networkAddresses.misc.AURILENS, abis$3.abi);
430
+ this._auriLens = this.getContract(networkAddresses.misc.AURILENS, abis$4.abi);
430
431
  }
431
432
 
432
433
  return this._auriLens;
@@ -435,7 +436,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
435
436
  key: "ply",
436
437
  get: function get() {
437
438
  if (!this._ply) {
438
- this._ply = this.getContract(networkAddresses.tokens.PLY, abis$5.abi);
439
+ this._ply = this.getContract(networkAddresses.tokens.PLY, abis$6.abi);
439
440
  }
440
441
 
441
442
  return this._ply;
@@ -444,7 +445,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
444
445
  key: "pulp",
445
446
  get: function get() {
446
447
  if (!this._pulp) {
447
- this._pulp = this.getContract(networkAddresses.tokens.PULP, abis$b.abi);
448
+ this._pulp = this.getContract(networkAddresses.tokens.PULP, abis$c.abi);
448
449
  }
449
450
 
450
451
  return this._pulp;
@@ -453,7 +454,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
453
454
  key: "auriInternalLens",
454
455
  get: function get() {
455
456
  if (!this._auriInternalLens) {
456
- this._auriInternalLens = this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$c.abi);
457
+ this._auriInternalLens = this.getContract(networkAddresses.misc.AURI_INTERNAL_LENS, abis$d.abi);
457
458
  }
458
459
 
459
460
  return this._auriInternalLens;
@@ -462,7 +463,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
462
463
  key: "auriAirdrop",
463
464
  get: function get() {
464
465
  if (!this._auriAirdrop) {
465
- this._auriAirdrop = this.getContract(networkAddresses.misc.AURI_AIRDROP, abis$1.abi);
466
+ this._auriAirdrop = this.getContract(networkAddresses.misc.AURI_AIRDROP, abis$2.abi);
466
467
  }
467
468
 
468
469
  return this._auriAirdrop;
@@ -471,11 +472,20 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
471
472
  key: "referralDirectory",
472
473
  get: function get() {
473
474
  if (!this._referralDirectory) {
474
- this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$6.abi);
475
+ this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$7.abi);
475
476
  }
476
477
 
477
478
  return this._referralDirectory;
478
479
  }
480
+ }, {
481
+ key: "oracle",
482
+ get: function get() {
483
+ if (!this._oracle) {
484
+ this._oracle = this.getContract(networkAddresses.misc.PRICE_ORACLE, abis.abi);
485
+ }
486
+
487
+ return this._oracle;
488
+ }
479
489
  }]);
480
490
 
481
491
  return AuriEnv;
@@ -2066,7 +2076,7 @@ function _fetchPriceFromOracle() {
2066
2076
  while (1) {
2067
2077
  switch (_context7.prev = _context7.next) {
2068
2078
  case 0:
2069
- oracleContract = new Contract(networkAddresses.misc.oracle, AuriOracleABI.abi, provider);
2079
+ oracleContract = new Contract(networkAddresses.misc.oracle, abis.abi, provider);
2070
2080
  _context7.next = 3;
2071
2081
  return oracleContract.getUnderlyingPrice(auTokenAddress)["catch"](function (e) {
2072
2082
  console.log("Unable to fetch price from oracle for " + auTokenAddress);
@@ -2116,7 +2126,7 @@ function _fetchUnderlyingTokensPrices() {
2116
2126
  while (1) {
2117
2127
  switch (_context8.prev = _context8.next) {
2118
2128
  case 0:
2119
- auriLens = new Contract(networkAddresses.misc.AURILENS, abis$3.abi, provider);
2129
+ auriLens = new Contract(networkAddresses.misc.AURILENS, abis$4.abi, provider);
2120
2130
  auTokenAddresses = networkAddresses.auTokens.map(function (auToken) {
2121
2131
  return auToken.address;
2122
2132
  });
@@ -2422,7 +2432,7 @@ var TransferEventQuery = /*#__PURE__*/function (_BlockchainEntityRead) {
2422
2432
  var _this;
2423
2433
 
2424
2434
  _this = _BlockchainEntityRead.call(this, networkConnection) || this;
2425
- _this.auToken = new Contract(tokenAddr, abis.abi, _this._networkConnection.provider);
2435
+ _this.auToken = new Contract(tokenAddr, abis$1.abi, _this._networkConnection.provider);
2426
2436
  return _this;
2427
2437
  }
2428
2438
  /**
@@ -2734,9 +2744,9 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2734
2744
  _this.env = new AuriEnv(networkConnection);
2735
2745
 
2736
2746
  if (isSameAddress(underlyingAsset, ETHAddress)) {
2737
- _this.auToken = new Contract(auToken, abis$8.abi, networkConnection.provider);
2747
+ _this.auToken = new Contract(auToken, abis$9.abi, networkConnection.provider);
2738
2748
  } else {
2739
- _this.auToken = new Contract(auToken, abis$7.abi, networkConnection.provider);
2749
+ _this.auToken = new Contract(auToken, abis$8.abi, networkConnection.provider);
2740
2750
  }
2741
2751
 
2742
2752
  _this.underlying = new Token(underlyingAsset, getDecimal(underlyingAsset));
@@ -3215,7 +3225,7 @@ var MoneyMarketReadWrite = /*#__PURE__*/function (_MoneyMarketRead) {
3215
3225
  var _this3;
3216
3226
 
3217
3227
  _this3 = _MoneyMarketRead.call(this, networkConnection, auToken, underlyingAsset) || this;
3218
- _this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$9.abi, networkConnection.provider);
3228
+ _this3._EthRepayHelper = new Contract(networkAddresses.misc.ETHREPAYHELPER, abis$a.abi, networkConnection.provider);
3219
3229
  return _this3;
3220
3230
  }
3221
3231
 
@@ -3429,7 +3439,7 @@ var MulticallRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3429
3439
  var _this;
3430
3440
 
3431
3441
  _this = _BlockchainEntityRead.call(this, networkConnection) || this;
3432
- _this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$a.abi, networkConnection.provider);
3442
+ _this.multicall = new Contract(networkAddresses.misc.MULTICALL, abis$b.abi, networkConnection.provider);
3433
3443
  return _this;
3434
3444
  }
3435
3445
  /**
@@ -4001,7 +4011,7 @@ var StakingRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4001
4011
  while (1) {
4002
4012
  switch (_context3.prev = _context3.next) {
4003
4013
  case 0:
4004
- lpContract = new Contract(networkAddresses.tokens.PLYWNEAR, abis$5.abi, this._networkConnection.provider);
4014
+ lpContract = new Contract(networkAddresses.tokens.PLYWNEAR, abis$6.abi, this._networkConnection.provider);
4005
4015
  _context3.next = 3;
4006
4016
  return lpContract.balanceOf(user);
4007
4017
 
@@ -4481,9 +4491,9 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4481
4491
  }
4482
4492
 
4483
4493
  _1E18 = BigNumber$1.from(10).pow(18);
4484
- oracle = this.env.getContract(networkAddresses.misc.oracle, AuriOracleABI.abi);
4494
+ oracle = this.env.getContract(networkAddresses.misc.oracle, abis.abi);
4485
4495
  tokens = tokenAddresses.map(function (addr) {
4486
- return _this3.env.getContract(addr, abis.abi);
4496
+ return _this3.env.getContract(addr, abis$1.abi);
4487
4497
  });
4488
4498
  _context5.next = 6;
4489
4499
  return oracle.getUnderlyingPrices(tokenAddresses);