@aurigami/sdk 1.5.0-dummy-1 → 1.5.0-dummy-2

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.
@@ -17,7 +17,7 @@ export declare class PapermillRead extends BlockchainEntityRead {
17
17
  getPulpBalance(userAddress: Address): Promise<TokenAmount>;
18
18
  getUnclaimedPlyReward(userAddress: Address): Promise<TokenAmount>;
19
19
  getLockingDetails(userAddress: Address): Promise<UserLockingDetails>;
20
- getTimestampToUnlock(userAddress: Address, targetUnlockPortion: number): number;
20
+ getTimestampToUnlock(userAddress: Address, targetUnlockPortion: number): Promise<number>;
21
21
  }
22
22
  export declare class PapermillReadWrite extends PapermillRead {
23
23
  constructor(networkConnection: NetworkConnection);
@@ -3557,15 +3557,34 @@ var PapermillRead = /*#__PURE__*/function (_BlockchainEntityRead) {
3557
3557
  return getLockingDetails;
3558
3558
  }();
3559
3559
 
3560
- _proto.getTimestampToUnlock = function getTimestampToUnlock(userAddress, targetUnlockPortion) {
3561
- var lockPortion = 100 - targetUnlockPortion;
3560
+ _proto.getTimestampToUnlock = /*#__PURE__*/function () {
3561
+ var _getTimestampToUnlock = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(userAddress, targetUnlockPortion) {
3562
+ var weekId;
3563
+ return runtime_1.wrap(function _callee5$(_context5) {
3564
+ while (1) {
3565
+ switch (_context5.prev = _context5.next) {
3566
+ case 0:
3567
+ _context5.next = 2;
3568
+ return this._auriLens.getWeekToUnlock(this._pulp.address, userAddress, targetUnlockPortion * 100);
3562
3569
 
3563
- if (lockPortion >= 95) {
3564
- return REWARD_CLAIM_START;
3570
+ case 2:
3571
+ weekId = _context5.sent;
3572
+ return _context5.abrupt("return", REWARD_CLAIM_START + ONE_WEEK * weekId.toNumber());
3573
+
3574
+ case 4:
3575
+ case "end":
3576
+ return _context5.stop();
3577
+ }
3578
+ }
3579
+ }, _callee5, this);
3580
+ }));
3581
+
3582
+ function getTimestampToUnlock(_x5, _x6) {
3583
+ return _getTimestampToUnlock.apply(this, arguments);
3565
3584
  }
3566
3585
 
3567
- return REWARD_CLAIM_START + ONE_WEEK * Math.round((95 - lockPortion) / 2);
3568
- };
3586
+ return getTimestampToUnlock;
3587
+ }();
3569
3588
 
3570
3589
  return PapermillRead;
3571
3590
  }(BlockchainEntityRead);
@@ -3579,22 +3598,22 @@ var PapermillReadWrite = /*#__PURE__*/function (_PapermillRead) {
3579
3598
  var _proto2 = PapermillReadWrite.prototype;
3580
3599
 
3581
3600
  _proto2.redeem = /*#__PURE__*/function () {
3582
- var _redeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(recipient, amount) {
3583
- return runtime_1.wrap(function _callee5$(_context5) {
3601
+ var _redeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(recipient, amount) {
3602
+ return runtime_1.wrap(function _callee6$(_context6) {
3584
3603
  while (1) {
3585
- switch (_context5.prev = _context5.next) {
3604
+ switch (_context6.prev = _context6.next) {
3586
3605
  case 0:
3587
- return _context5.abrupt("return", this._pulp.connect(this._networkConnection.signer).redeem(recipient, amount.rawAmount()));
3606
+ return _context6.abrupt("return", this._pulp.connect(this._networkConnection.signer).redeem(recipient, amount.rawAmount()));
3588
3607
 
3589
3608
  case 1:
3590
3609
  case "end":
3591
- return _context5.stop();
3610
+ return _context6.stop();
3592
3611
  }
3593
3612
  }
3594
- }, _callee5, this);
3613
+ }, _callee6, this);
3595
3614
  }));
3596
3615
 
3597
- function redeem(_x5, _x6) {
3616
+ function redeem(_x7, _x8) {
3598
3617
  return _redeem.apply(this, arguments);
3599
3618
  }
3600
3619
 
@@ -3602,28 +3621,28 @@ var PapermillReadWrite = /*#__PURE__*/function (_PapermillRead) {
3602
3621
  }();
3603
3622
 
3604
3623
  _proto2.selfRedeem = /*#__PURE__*/function () {
3605
- var _selfRedeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(amount) {
3624
+ var _selfRedeem = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(amount) {
3606
3625
  var msgSender;
3607
- return runtime_1.wrap(function _callee6$(_context6) {
3626
+ return runtime_1.wrap(function _callee7$(_context7) {
3608
3627
  while (1) {
3609
- switch (_context6.prev = _context6.next) {
3628
+ switch (_context7.prev = _context7.next) {
3610
3629
  case 0:
3611
- _context6.next = 2;
3630
+ _context7.next = 2;
3612
3631
  return this._networkConnection.signer.getAddress();
3613
3632
 
3614
3633
  case 2:
3615
- msgSender = _context6.sent;
3616
- return _context6.abrupt("return", this.redeem(msgSender, amount));
3634
+ msgSender = _context7.sent;
3635
+ return _context7.abrupt("return", this.redeem(msgSender, amount));
3617
3636
 
3618
3637
  case 4:
3619
3638
  case "end":
3620
- return _context6.stop();
3639
+ return _context7.stop();
3621
3640
  }
3622
3641
  }
3623
- }, _callee6, this);
3642
+ }, _callee7, this);
3624
3643
  }));
3625
3644
 
3626
- function selfRedeem(_x7) {
3645
+ function selfRedeem(_x9) {
3627
3646
  return _selfRedeem.apply(this, arguments);
3628
3647
  }
3629
3648