@aurigami/sdk 1.5.8 → 1.5.10

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.d.ts CHANGED
@@ -27,6 +27,7 @@ export declare class SdkRead extends BlockchainEntityRead {
27
27
  }
28
28
  export declare class SdkReadWrite extends SdkRead {
29
29
  claim(): Promise<TransactionResponse>;
30
+ claimLpRewards(): Promise<TransactionResponse>;
30
31
  stake(amount: TokenAmount): Promise<TransactionResponse>;
31
32
  unstake(amount: TokenAmount): Promise<TransactionResponse>;
32
33
  faucetDrip(): Promise<TransactionResponse>;
@@ -3980,13 +3980,28 @@ var StakingReadWrite = /*#__PURE__*/function (_StakingRead) {
3980
3980
 
3981
3981
  _proto2.unstake = /*#__PURE__*/function () {
3982
3982
  var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(amount) {
3983
+ var msgSender, amountInput, stakedAmount, unstakeAmount;
3983
3984
  return runtime_1.wrap(function _callee6$(_context6) {
3984
3985
  while (1) {
3985
3986
  switch (_context6.prev = _context6.next) {
3986
3987
  case 0:
3987
- return _context6.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).withdraw(PLYWNEAR_POOL_ID, amount.rawAmount()));
3988
+ _context6.next = 2;
3989
+ return this._networkConnection.signer.getAddress();
3988
3990
 
3989
- case 1:
3991
+ case 2:
3992
+ msgSender = _context6.sent;
3993
+ amountInput = ethers.BigNumber.from(amount.rawAmount());
3994
+ _context6.t0 = ethers.BigNumber;
3995
+ _context6.next = 7;
3996
+ return this.stakeBalanceOf(msgSender);
3997
+
3998
+ case 7:
3999
+ _context6.t1 = _context6.sent.rawAmount();
4000
+ stakedAmount = _context6.t0.from.call(_context6.t0, _context6.t1);
4001
+ unstakeAmount = amountInput.lt(stakedAmount) ? amountInput : stakedAmount.sub(1);
4002
+ return _context6.abrupt("return", this._auriFairLaunch.connect(this._networkConnection.signer).withdraw(PLYWNEAR_POOL_ID, unstakeAmount));
4003
+
4004
+ case 11:
3990
4005
  case "end":
3991
4006
  return _context6.stop();
3992
4007
  }
@@ -4363,15 +4378,22 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4363
4378
  return claim;
4364
4379
  }();
4365
4380
 
4366
- _proto2.stake = /*#__PURE__*/function () {
4367
- var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
4381
+ _proto2.claimLpRewards = /*#__PURE__*/function () {
4382
+ var _claimLpRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8() {
4368
4383
  return runtime_1.wrap(function _callee8$(_context8) {
4369
4384
  while (1) {
4370
4385
  switch (_context8.prev = _context8.next) {
4371
4386
  case 0:
4372
- return _context8.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
4387
+ _context8.t0 = this._auriFairLaunch.connect(this._networkConnection.signer);
4388
+ _context8.next = 3;
4389
+ return this._networkConnection.signer.getAddress();
4373
4390
 
4374
- case 1:
4391
+ case 3:
4392
+ _context8.t1 = _context8.sent;
4393
+ _context8.t2 = INF;
4394
+ return _context8.abrupt("return", _context8.t0.harvest.call(_context8.t0, _context8.t1, 0, _context8.t2));
4395
+
4396
+ case 6:
4375
4397
  case "end":
4376
4398
  return _context8.stop();
4377
4399
  }
@@ -4379,20 +4401,20 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4379
4401
  }, _callee8, this);
4380
4402
  }));
4381
4403
 
4382
- function stake(_x6) {
4383
- return _stake.apply(this, arguments);
4404
+ function claimLpRewards() {
4405
+ return _claimLpRewards.apply(this, arguments);
4384
4406
  }
4385
4407
 
4386
- return stake;
4408
+ return claimLpRewards;
4387
4409
  }();
4388
4410
 
4389
- _proto2.unstake = /*#__PURE__*/function () {
4390
- var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(amount) {
4411
+ _proto2.stake = /*#__PURE__*/function () {
4412
+ var _stake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(amount) {
4391
4413
  return runtime_1.wrap(function _callee9$(_context9) {
4392
4414
  while (1) {
4393
4415
  switch (_context9.prev = _context9.next) {
4394
4416
  case 0:
4395
- return _context9.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
4417
+ return _context9.abrupt("return", new StakingReadWrite(this._networkConnection).stake(amount));
4396
4418
 
4397
4419
  case 1:
4398
4420
  case "end":
@@ -4402,6 +4424,29 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4402
4424
  }, _callee9, this);
4403
4425
  }));
4404
4426
 
4427
+ function stake(_x6) {
4428
+ return _stake.apply(this, arguments);
4429
+ }
4430
+
4431
+ return stake;
4432
+ }();
4433
+
4434
+ _proto2.unstake = /*#__PURE__*/function () {
4435
+ var _unstake = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(amount) {
4436
+ return runtime_1.wrap(function _callee10$(_context10) {
4437
+ while (1) {
4438
+ switch (_context10.prev = _context10.next) {
4439
+ case 0:
4440
+ return _context10.abrupt("return", new StakingReadWrite(this._networkConnection).unstake(amount));
4441
+
4442
+ case 1:
4443
+ case "end":
4444
+ return _context10.stop();
4445
+ }
4446
+ }
4447
+ }, _callee10, this);
4448
+ }));
4449
+
4405
4450
  function unstake(_x7) {
4406
4451
  return _unstake.apply(this, arguments);
4407
4452
  }
@@ -4410,21 +4455,21 @@ var SdkReadWrite = /*#__PURE__*/function (_SdkRead) {
4410
4455
  }();
4411
4456
 
4412
4457
  _proto2.faucetDrip = /*#__PURE__*/function () {
4413
- var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
4458
+ var _faucetDrip = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
4414
4459
  var faucet;
4415
- return runtime_1.wrap(function _callee10$(_context10) {
4460
+ return runtime_1.wrap(function _callee11$(_context11) {
4416
4461
  while (1) {
4417
- switch (_context10.prev = _context10.next) {
4462
+ switch (_context11.prev = _context11.next) {
4418
4463
  case 0:
4419
4464
  faucet = new ethers.Contract(networkAddresses.misc.FAUCET, FaucetABI.abi, this._networkConnection.provider);
4420
- return _context10.abrupt("return", faucet.connect(this._networkConnection.signer).drip());
4465
+ return _context11.abrupt("return", faucet.connect(this._networkConnection.signer).drip());
4421
4466
 
4422
4467
  case 2:
4423
4468
  case "end":
4424
- return _context10.stop();
4469
+ return _context11.stop();
4425
4470
  }
4426
4471
  }
4427
- }, _callee10, this);
4472
+ }, _callee11, this);
4428
4473
  }));
4429
4474
 
4430
4475
  function faucetDrip() {