@aurigami/sdk 1.17.5 → 1.18.1

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
@@ -17,6 +17,7 @@ import abis$a from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/
17
17
  import abis$b from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
18
18
  import abis$6 from '@aurigami/contracts/artifacts/contracts/ReferralDirectoryV2.sol/ReferralDirectoryV2.json';
19
19
  import abis$d from '@aurigami/contracts/artifacts/contracts/plygame/PlyGame.sol/PlyGame.json';
20
+ import abis$e from '@aurigami/contracts/artifacts/contracts/PlyTokenLock.sol/PlyTokenLock.json';
20
21
  import MAINNET_ADDRESSES from '@aurigami/contracts/deployments/aurora_mainnet.json';
21
22
  export { default as MAINNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_mainnet.json';
22
23
  export { default as TESTNET_ADDRESSES } from '@aurigami/contracts/deployments/aurora_testnet.json';
@@ -44,7 +45,8 @@ var index = {
44
45
  Multicall2ABI: abis$a,
45
46
  PulpABI: abis$b,
46
47
  AuriInternalLensABI: abis$c,
47
- PlyGameABI: abis$d
48
+ PlyGameABI: abis$d,
49
+ PlyTokenLockABI: abis$e
48
50
  };
49
51
 
50
52
  var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
@@ -1069,6 +1071,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
1069
1071
  _this._referralDirectoryV2 = null;
1070
1072
  _this._oracle = null;
1071
1073
  _this._plygame = null;
1074
+ _this._plyTokenLock = null;
1072
1075
  return _this;
1073
1076
  }
1074
1077
  var _proto = AuriEnv.prototype;
@@ -1182,6 +1185,14 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
1182
1185
  }
1183
1186
  return this._plygame;
1184
1187
  }
1188
+ }, {
1189
+ key: "plyTokenLock",
1190
+ get: function get() {
1191
+ if (!this._plyTokenLock) {
1192
+ this._plyTokenLock = this.getContract(networkAddresses.misc.PLY_TOKEN_LOCK, abis$e.abi);
1193
+ }
1194
+ return this._plyTokenLock;
1195
+ }
1185
1196
  }]);
1186
1197
  return AuriEnv;
1187
1198
  }(BlockchainEntityRead);
@@ -2729,7 +2740,7 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2729
2740
  }
2730
2741
  _context13.t0 = helpers;
2731
2742
  _context13.next = 9;
2732
- return fetchValuation(TokenAmount.fromAddressAndAmount(networkAddresses.tokens.META, '1000000', false), this._networkConnection.provider);
2743
+ return fetchValuation(TokenAmount.fromAddressAndAmount(networkAddresses.tokens.META, '750000', false), this._networkConnection.provider);
2733
2744
  case 9:
2734
2745
  _context13.t1 = _context13.sent;
2735
2746
  _context13.t2 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
@@ -2777,7 +2788,7 @@ var MoneyMarketRead = /*#__PURE__*/function (_BlockchainEntityRead) {
2777
2788
  }
2778
2789
  _context14.t0 = helpers;
2779
2790
  _context14.next = 13;
2780
- return fetchValuation(TokenAmount.fromAddressAndAmount(networkAddresses.tokens.STADER, '83.35', false), this._networkConnection.provider);
2791
+ return fetchValuation(TokenAmount.fromAddressAndAmount(networkAddresses.tokens.STADER, '95', false), this._networkConnection.provider);
2781
2792
  case 13:
2782
2793
  _context14.t1 = _context14.sent;
2783
2794
  _context14.t2 = underlyingPrice.multipliedBy(totalDeposited.formattedAmount());
@@ -5272,6 +5283,84 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5272
5283
  return MiscRead;
5273
5284
  }(BlockchainEntityRead);
5274
5285
 
5286
+ var PlyTokenLockRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5287
+ _inheritsLoose(PlyTokenLockRead, _BlockchainEntityRead);
5288
+ function PlyTokenLockRead(networkConnection) {
5289
+ var _this;
5290
+ _this = _BlockchainEntityRead.call(this, networkConnection) || this;
5291
+ _this.env = new AuriEnv(networkConnection);
5292
+ return _this;
5293
+ }
5294
+ var _proto = PlyTokenLockRead.prototype;
5295
+ _proto.getClaimableAmount = /*#__PURE__*/function () {
5296
+ var _getClaimableAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(recipient) {
5297
+ var claimableAmount;
5298
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
5299
+ while (1) switch (_context.prev = _context.next) {
5300
+ case 0:
5301
+ _context.next = 2;
5302
+ return this.env.plyTokenLock.callStatic.claimableBalance(recipient);
5303
+ case 2:
5304
+ claimableAmount = _context.sent;
5305
+ return _context.abrupt("return", new TokenAmount(new Token(PLYToken.address, 18), claimableAmount.toString(), true));
5306
+ case 4:
5307
+ case "end":
5308
+ return _context.stop();
5309
+ }
5310
+ }, _callee, this);
5311
+ }));
5312
+ function getClaimableAmount(_x) {
5313
+ return _getClaimableAmount.apply(this, arguments);
5314
+ }
5315
+ return getClaimableAmount;
5316
+ }();
5317
+ return PlyTokenLockRead;
5318
+ }(BlockchainEntityRead);
5319
+ var PlyTokenLockReadWrite = /*#__PURE__*/function (_PlyTokenLockRead) {
5320
+ _inheritsLoose(PlyTokenLockReadWrite, _PlyTokenLockRead);
5321
+ function PlyTokenLockReadWrite() {
5322
+ return _PlyTokenLockRead.apply(this, arguments) || this;
5323
+ }
5324
+ var _proto2 = PlyTokenLockReadWrite.prototype;
5325
+ _proto2.claim = /*#__PURE__*/function () {
5326
+ var _claim = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(recipient, amount) {
5327
+ var amountToClaim;
5328
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
5329
+ while (1) switch (_context2.prev = _context2.next) {
5330
+ case 0:
5331
+ amountToClaim = BigNumber$1.from(amount.rawAmount());
5332
+ _context2.next = 3;
5333
+ return this.env.plyTokenLock.connect(this._networkConnection.signer).claim(recipient, amountToClaim);
5334
+ case 3:
5335
+ return _context2.abrupt("return", _context2.sent);
5336
+ case 4:
5337
+ case "end":
5338
+ return _context2.stop();
5339
+ }
5340
+ }, _callee2, this);
5341
+ }));
5342
+ function claim(_x2, _x3) {
5343
+ return _claim.apply(this, arguments);
5344
+ }
5345
+ return claim;
5346
+ }();
5347
+ return PlyTokenLockReadWrite;
5348
+ }(PlyTokenLockRead);
5349
+ var PlyTokenLock = /*#__PURE__*/function (_BlockchainEntity) {
5350
+ _inheritsLoose(PlyTokenLock, _BlockchainEntity);
5351
+ function PlyTokenLock() {
5352
+ return _BlockchainEntity.call(this) || this;
5353
+ }
5354
+ var _proto3 = PlyTokenLock.prototype;
5355
+ _proto3.read = function read(networkConnection) {
5356
+ return new PlyTokenLockRead(networkConnection);
5357
+ };
5358
+ _proto3.readWrite = function readWrite(networkConnection) {
5359
+ return new PlyTokenLockReadWrite(networkConnection);
5360
+ };
5361
+ return PlyTokenLock;
5362
+ }(BlockchainEntity);
5363
+
5275
5364
  var NOTIFICATION_API_END_POINT = 'https://api.aurigami.finance/notification/';
5276
5365
  function postApi(_x3, _x4) {
5277
5366
  return _postApi.apply(this, arguments);
@@ -5714,5 +5803,5 @@ BigNumber.config({
5714
5803
  DECIMAL_PLACES: 50
5715
5804
  });
5716
5805
 
5717
- export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, AURORA_PLUS_API_PREFIX, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, CACHE_TIMEOUT, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, Pulp, PulpRead, PulpReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SD_INCENTIVE_IN_SD, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcNetApy, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchHistoricalLPPositions, fetchHistoricalLPPrice, fetchHistoricalPULPPrice, fetchHistoricalPrice, fetchHistoricalPriceByLP, fetchHistoricalPriceFromOracle, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromDefiLlama, fetchPriceFromDefiLlamaAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sleep, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
5806
+ export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, AURORA_PLUS_API_PREFIX, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, CACHE_TIMEOUT, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, PlyTokenLock, PlyTokenLockRead, PlyTokenLockReadWrite, Pulp, PulpRead, PulpReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SD_INCENTIVE_IN_SD, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcNetApy, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchHistoricalLPPositions, fetchHistoricalLPPrice, fetchHistoricalPULPPrice, fetchHistoricalPrice, fetchHistoricalPriceByLP, fetchHistoricalPriceFromOracle, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromDefiLlama, fetchPriceFromDefiLlamaAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sleep, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
5718
5807
  //# sourceMappingURL=sdk.esm.js.map