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