@aurigami/sdk 1.12.0 → 1.12.1-beta1

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
@@ -15,7 +15,7 @@ import abis$d from '@aurigami/contracts/artifacts/contracts/mock/AuriInternalLen
15
15
  import IUniswapV2PairABI from '@aurigami/contracts/artifacts/contracts/mock/IUniswapV2Pair.sol/IUniswapV2Pair.json';
16
16
  import abis$b from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json';
17
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';
18
+ import abis$7 from '@aurigami/contracts/artifacts/contracts/ReferralDirectoryV2.sol/ReferralDirectoryV2.json';
19
19
  import abis$e from '@aurigami/contracts/artifacts/contracts/plygame/PlyGame.sol/PlyGame.json';
20
20
  import MAINNET_ADDRESSES from '@aurigami/contracts/deployments/aurora_mainnet.json';
21
21
  export { default as MAINNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_mainnet.json';
@@ -35,7 +35,7 @@ var index = {
35
35
  AuriLensABI: abis$4,
36
36
  ComptrollerABI: abis$5,
37
37
  EIP20InterfaceABI: abis$6,
38
- ReferralDirectoryABI: abis$7,
38
+ ReferralDirectoryV2ABI: abis$7,
39
39
  AuErc20ABI: abis$8,
40
40
  AuETHABI: abis$9,
41
41
  EthRepayHelperABI: abis$a,
@@ -110,6 +110,7 @@ var networkAddresses = {
110
110
  PULP_CONTRACT: /*#__PURE__*/'0x04ac48711bcdc45b4d223fb021e09da73c71095e'.toLowerCase(),
111
111
  PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
112
112
  REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
113
+ REFERRAL_V2: /*#__PURE__*/'0xCECd147409B2d64A9A2E5418e3E471E8af19E0bd'.toLowerCase(),
113
114
  AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase(),
114
115
  PLYGAME: /*#__PURE__*/MAINNET_ADDRESSES.plyGame.toLowerCase()
115
116
  },
@@ -1571,7 +1572,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
1571
1572
  _this._pulp = null;
1572
1573
  _this._auriInternalLens = null;
1573
1574
  _this._auriAirdrop = null;
1574
- _this._referralDirectory = null;
1575
+ _this._referralDirectoryV2 = null;
1575
1576
  _this._oracle = null;
1576
1577
  _this._plygame = null;
1577
1578
  return _this;
@@ -1682,13 +1683,13 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
1682
1683
  return this._auriAirdrop;
1683
1684
  }
1684
1685
  }, {
1685
- key: "referralDirectory",
1686
+ key: "referralDirectoryV2",
1686
1687
  get: function get() {
1687
- if (!this._referralDirectory) {
1688
- this._referralDirectory = this.getContract(networkAddresses.misc.REFERRAL, abis$7.abi);
1688
+ if (!this._referralDirectoryV2) {
1689
+ this._referralDirectoryV2 = this.getContract(networkAddresses.misc.REFERRAL_V2, abis$7.abi);
1689
1690
  }
1690
1691
 
1691
- return this._referralDirectory;
1692
+ return this._referralDirectoryV2;
1692
1693
  }
1693
1694
  }, {
1694
1695
  key: "oracle",
@@ -5110,7 +5111,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5110
5111
  switch (_context.prev = _context.next) {
5111
5112
  case 0:
5112
5113
  _context.next = 2;
5113
- return this.env.referralDirectory.userReferralCode(userAddr);
5114
+ return this.env.referralDirectoryV2.userReferralCode(userAddr);
5114
5115
 
5115
5116
  case 2:
5116
5117
  result = _context.sent;
@@ -5145,7 +5146,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5145
5146
  switch (_context2.prev = _context2.next) {
5146
5147
  case 0:
5147
5148
  _context2.next = 2;
5148
- return this.env.referralDirectory.referralCodeUsed(userAddr);
5149
+ return this.env.referralDirectoryV2.referralCodeUsed(userAddr);
5149
5150
 
5150
5151
  case 2:
5151
5152
  result = _context2.sent;
@@ -5180,7 +5181,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5180
5181
  switch (_context3.prev = _context3.next) {
5181
5182
  case 0:
5182
5183
  referralCode = ethers.utils.formatBytes32String(code);
5183
- return _context3.abrupt("return", this.env.referralDirectory.referralCodeOwner(referralCode));
5184
+ return _context3.abrupt("return", this.env.referralDirectoryV2.referralCodeOwner(referralCode));
5184
5185
 
5185
5186
  case 2:
5186
5187
  case "end":
@@ -5453,20 +5454,18 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5453
5454
  switch (_context9.prev = _context9.next) {
5454
5455
  case 0:
5455
5456
  _context9.next = 2;
5456
- return getApi('/referral/whitelisted', {
5457
- address: address
5458
- });
5457
+ return this.env.referralDirectoryV2.isUserWhitelisted(address);
5459
5458
 
5460
5459
  case 2:
5461
5460
  result = _context9.sent;
5462
- return _context9.abrupt("return", result.isWhitelisted);
5461
+ return _context9.abrupt("return", result.eq(1));
5463
5462
 
5464
5463
  case 4:
5465
5464
  case "end":
5466
5465
  return _context9.stop();
5467
5466
  }
5468
5467
  }
5469
- }, _callee9);
5468
+ }, _callee9, this);
5470
5469
  }));
5471
5470
 
5472
5471
  function isWhitelistedAddress(_x9) {
@@ -5478,19 +5477,13 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5478
5477
 
5479
5478
  _proto.isOnAuroraPlus = /*#__PURE__*/function () {
5480
5479
  var _isOnAuroraPlus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(address) {
5481
- var resp;
5482
5480
  return runtime_1.wrap(function _callee10$(_context10) {
5483
5481
  while (1) {
5484
5482
  switch (_context10.prev = _context10.next) {
5485
5483
  case 0:
5486
- _context10.next = 2;
5487
- return axios.get(AURORA_PLUS_API_PREFIX + address);
5484
+ return _context10.abrupt("return", true);
5488
5485
 
5489
- case 2:
5490
- resp = _context10.sent;
5491
- return _context10.abrupt("return", resp.data.status == 'active');
5492
-
5493
- case 4:
5486
+ case 1:
5494
5487
  case "end":
5495
5488
  return _context10.stop();
5496
5489
  }
@@ -5593,7 +5586,7 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5593
5586
  switch (_context13.prev = _context13.next) {
5594
5587
  case 0:
5595
5588
  referralCode = ethers.utils.formatBytes32String(this.generateReferralCode());
5596
- return _context13.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5589
+ return _context13.abrupt("return", this.env.referralDirectoryV2.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5597
5590
 
5598
5591
  case 2:
5599
5592
  case "end":
@@ -5624,7 +5617,7 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5624
5617
  switch (_context14.prev = _context14.next) {
5625
5618
  case 0:
5626
5619
  referralCode = ethers.utils.formatBytes32String(code);
5627
- return _context14.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5620
+ return _context14.abrupt("return", this.env.referralDirectoryV2.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5628
5621
 
5629
5622
  case 2:
5630
5623
  case "end":