@aurigami/sdk 1.17.4 → 1.18.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.
@@ -14,4 +14,5 @@ import Multicall2ABI from '@aurigami/contracts/artifacts/contracts/mock/Multical
14
14
  import PulpABI from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
15
15
  import ReferralDirectoryV2ABI from '@aurigami/contracts/artifacts/contracts/ReferralDirectoryV2.sol/ReferralDirectoryV2.json';
16
16
  import PlyGameABI from '@aurigami/contracts/artifacts/contracts/plygame/PlyGame.sol/PlyGame.json';
17
- export { AuriOracleABI, AuTokenABI, IUniswapV2PairABI, AuriAirdropABI, AuriFairLaunchABI, AuriLensABI, ComptrollerABI, EIP20InterfaceABI, ReferralDirectoryV2ABI, AuErc20ABI, AuETHABI, EthRepayHelperABI, Multicall2ABI, PulpABI, AuriInternalLensABI, PlyGameABI, };
17
+ import PlyTokenLockABI from '@aurigami/contracts/artifacts/contracts/PlyTokenLock.sol/PlyTokenLock.json';
18
+ export { AuriOracleABI, AuTokenABI, IUniswapV2PairABI, AuriAirdropABI, AuriFairLaunchABI, AuriLensABI, ComptrollerABI, EIP20InterfaceABI, ReferralDirectoryV2ABI, AuErc20ABI, AuETHABI, EthRepayHelperABI, Multicall2ABI, PulpABI, AuriInternalLensABI, PlyGameABI, PlyTokenLockABI, };
@@ -1,4 +1,4 @@
1
- import { AuErc20, AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, AuriOracle, Comptroller, IERC20, PlyGame, PULP, ReferralDirectoryV2 } from '@aurigami/contracts/typechain';
1
+ import { AuErc20, AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, AuriOracle, Comptroller, IERC20, PlyGame, PULP, ReferralDirectoryV2, PlyTokenLock } from '@aurigami/contracts/typechain';
2
2
  import { Contract } from 'ethers';
3
3
  import { AuTokenWithUnderlying } from '../types';
4
4
  import { BlockchainEntityRead } from './BlockchainEntity';
@@ -13,6 +13,7 @@ export declare class AuriEnv extends BlockchainEntityRead {
13
13
  private _referralDirectoryV2;
14
14
  private _oracle;
15
15
  private _plygame;
16
+ private _plyTokenLock;
16
17
  getContract<CType extends Contract>(address: string, abi: any): CType;
17
18
  getAuTokenContracts(): AuTokenWithUnderlying[];
18
19
  /**
@@ -35,4 +36,5 @@ export declare class AuriEnv extends BlockchainEntityRead {
35
36
  get referralDirectoryV2(): ReferralDirectoryV2;
36
37
  get oracle(): AuriOracle;
37
38
  get plygame(): PlyGame;
39
+ get plyTokenLock(): PlyTokenLock;
38
40
  }
@@ -0,0 +1,16 @@
1
+ import { TransactionResponse } from '@ethersproject/abstract-provider';
2
+ import { AuriEnv, BlockchainEntity, BlockchainEntityRead, TokenAmount } from '../entities';
3
+ import { Address, NetworkConnection } from '../types';
4
+ export declare class PlyTokenLockRead extends BlockchainEntityRead {
5
+ readonly env: AuriEnv;
6
+ constructor(networkConnection: NetworkConnection);
7
+ getClaimableAmount(recipient: Address): Promise<TokenAmount>;
8
+ }
9
+ export declare class PlyTokenLockReadWrite extends PlyTokenLockRead {
10
+ claim(recipient: Address, amount: TokenAmount): Promise<TransactionResponse>;
11
+ }
12
+ export declare class PlyTokenLock extends BlockchainEntity {
13
+ constructor();
14
+ read(networkConnection: NetworkConnection): PlyTokenLockRead;
15
+ readWrite(networkConnection: NetworkConnection): PlyTokenLockReadWrite;
16
+ }
@@ -6,3 +6,4 @@ export * from './Pulp';
6
6
  export * from './Referral';
7
7
  export * from './Staking';
8
8
  export * from './misc';
9
+ export * from './PlyTokenLock';
@@ -23,6 +23,7 @@ var abis$a = _interopDefault(require('@aurigami/contracts/artifacts/contracts/mo
23
23
  var abis$b = _interopDefault(require('@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json'));
24
24
  var abis$c = _interopDefault(require('@aurigami/contracts/artifacts/contracts/ReferralDirectoryV2.sol/ReferralDirectoryV2.json'));
25
25
  var abis$d = _interopDefault(require('@aurigami/contracts/artifacts/contracts/plygame/PlyGame.sol/PlyGame.json'));
26
+ var abis$e = _interopDefault(require('@aurigami/contracts/artifacts/contracts/PlyTokenLock.sol/PlyTokenLock.json'));
26
27
  var MAINNET_ADDRESSES = _interopDefault(require('@aurigami/contracts/deployments/aurora_mainnet.json'));
27
28
  var aurora_testnet_json = _interopDefault(require('@aurigami/contracts/deployments/aurora_testnet.json'));
28
29
  var axios = _interopDefault(require('axios'));
@@ -49,7 +50,8 @@ var index = {
49
50
  Multicall2ABI: abis$a,
50
51
  PulpABI: abis$b,
51
52
  AuriInternalLensABI: abis$9,
52
- PlyGameABI: abis$d
53
+ PlyGameABI: abis$d,
54
+ PlyTokenLockABI: abis$e
53
55
  };
54
56
 
55
57
  var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
@@ -1074,6 +1076,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
1074
1076
  _this._referralDirectoryV2 = null;
1075
1077
  _this._oracle = null;
1076
1078
  _this._plygame = null;
1079
+ _this._plyTokenLock = null;
1077
1080
  return _this;
1078
1081
  }
1079
1082
  var _proto = AuriEnv.prototype;
@@ -1187,6 +1190,14 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
1187
1190
  }
1188
1191
  return this._plygame;
1189
1192
  }
1193
+ }, {
1194
+ key: "plyTokenLock",
1195
+ get: function get() {
1196
+ if (!this._plyTokenLock) {
1197
+ this._plyTokenLock = this.getContract(networkAddresses.misc.PLY_TOKEN_LOCK, abis$e.abi);
1198
+ }
1199
+ return this._plyTokenLock;
1200
+ }
1190
1201
  }]);
1191
1202
  return AuriEnv;
1192
1203
  }(BlockchainEntityRead);
@@ -3972,7 +3983,7 @@ var PulpReadWrite = /*#__PURE__*/function (_PulpRead) {
3972
3983
  while (1) switch (_context2.prev = _context2.next) {
3973
3984
  case 0:
3974
3985
  amountToRedeem = ethers.BigNumber.from(amount.rawAmount());
3975
- return _context2.abrupt("return", this.env.pulp.redeem(recipient, amountToRedeem));
3986
+ return _context2.abrupt("return", this.env.pulp.connect(this._networkConnection.signer).redeem(recipient, amountToRedeem));
3976
3987
  case 2:
3977
3988
  case "end":
3978
3989
  return _context2.stop();
@@ -5275,6 +5286,84 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5275
5286
  return MiscRead;
5276
5287
  }(BlockchainEntityRead);
5277
5288
 
5289
+ var PlyTokenLockRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5290
+ _inheritsLoose(PlyTokenLockRead, _BlockchainEntityRead);
5291
+ function PlyTokenLockRead(networkConnection) {
5292
+ var _this;
5293
+ _this = _BlockchainEntityRead.call(this, networkConnection) || this;
5294
+ _this.env = new AuriEnv(networkConnection);
5295
+ return _this;
5296
+ }
5297
+ var _proto = PlyTokenLockRead.prototype;
5298
+ _proto.getClaimableAmount = /*#__PURE__*/function () {
5299
+ var _getClaimableAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(recipient) {
5300
+ var claimableAmount;
5301
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
5302
+ while (1) switch (_context.prev = _context.next) {
5303
+ case 0:
5304
+ _context.next = 2;
5305
+ return this.env.plyTokenLock.callStatic.claimableBalance(recipient);
5306
+ case 2:
5307
+ claimableAmount = _context.sent;
5308
+ return _context.abrupt("return", new TokenAmount(new Token(PLYToken.address, 18), claimableAmount.toString(), true));
5309
+ case 4:
5310
+ case "end":
5311
+ return _context.stop();
5312
+ }
5313
+ }, _callee, this);
5314
+ }));
5315
+ function getClaimableAmount(_x) {
5316
+ return _getClaimableAmount.apply(this, arguments);
5317
+ }
5318
+ return getClaimableAmount;
5319
+ }();
5320
+ return PlyTokenLockRead;
5321
+ }(BlockchainEntityRead);
5322
+ var PlyTokenLockReadWrite = /*#__PURE__*/function (_PlyTokenLockRead) {
5323
+ _inheritsLoose(PlyTokenLockReadWrite, _PlyTokenLockRead);
5324
+ function PlyTokenLockReadWrite() {
5325
+ return _PlyTokenLockRead.apply(this, arguments) || this;
5326
+ }
5327
+ var _proto2 = PlyTokenLockReadWrite.prototype;
5328
+ _proto2.claim = /*#__PURE__*/function () {
5329
+ var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(recipient, amount) {
5330
+ var amountToClaim;
5331
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5332
+ while (1) switch (_context2.prev = _context2.next) {
5333
+ case 0:
5334
+ amountToClaim = ethers.BigNumber.from(amount.rawAmount());
5335
+ _context2.next = 3;
5336
+ return this.env.plyTokenLock.connect(this._networkConnection.signer).claim(recipient, amountToClaim);
5337
+ case 3:
5338
+ return _context2.abrupt("return", _context2.sent);
5339
+ case 4:
5340
+ case "end":
5341
+ return _context2.stop();
5342
+ }
5343
+ }, _callee2, this);
5344
+ }));
5345
+ function claim(_x2, _x3) {
5346
+ return _claim.apply(this, arguments);
5347
+ }
5348
+ return claim;
5349
+ }();
5350
+ return PlyTokenLockReadWrite;
5351
+ }(PlyTokenLockRead);
5352
+ var PlyTokenLock = /*#__PURE__*/function (_BlockchainEntity) {
5353
+ _inheritsLoose(PlyTokenLock, _BlockchainEntity);
5354
+ function PlyTokenLock() {
5355
+ return _BlockchainEntity.call(this) || this;
5356
+ }
5357
+ var _proto3 = PlyTokenLock.prototype;
5358
+ _proto3.read = function read(networkConnection) {
5359
+ return new PlyTokenLockRead(networkConnection);
5360
+ };
5361
+ _proto3.readWrite = function readWrite(networkConnection) {
5362
+ return new PlyTokenLockReadWrite(networkConnection);
5363
+ };
5364
+ return PlyTokenLock;
5365
+ }(BlockchainEntity);
5366
+
5278
5367
  var NOTIFICATION_API_END_POINT = 'https://api.aurigami.finance/notification/';
5279
5368
  function postApi(_x3, _x4) {
5280
5369
  return _postApi.apply(this, arguments);
@@ -5759,6 +5848,9 @@ exports.PapermillReadWrite = PapermillReadWrite;
5759
5848
  exports.PlyGame = PlyGame;
5760
5849
  exports.PlyGameRead = PlyGameRead;
5761
5850
  exports.PlyGameReadWrite = PlyGameReadWrite;
5851
+ exports.PlyTokenLock = PlyTokenLock;
5852
+ exports.PlyTokenLockRead = PlyTokenLockRead;
5853
+ exports.PlyTokenLockReadWrite = PlyTokenLockReadWrite;
5762
5854
  exports.Pulp = Pulp;
5763
5855
  exports.PulpRead = PulpRead;
5764
5856
  exports.PulpReadWrite = PulpReadWrite;