@wireio/stake 1.0.0 → 1.0.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.
@@ -8567,13 +8567,12 @@ const _SolanaStakingClient = class _SolanaStakingClient {
8567
8567
  throw new Error("Deposit amount must be greater than zero.");
8568
8568
  }
8569
8569
  try {
8570
- const tx = await this.depositClient.buildDepositTx(amountLamports);
8571
- const { tx: prepared, blockhash, lastValidBlockHeight } = await this.prepareTx(tx);
8572
- const signed = await this.signTransaction(prepared);
8573
- return await this.sendAndConfirmHttp(signed, {
8574
- blockhash,
8575
- lastValidBlockHeight
8576
- });
8570
+ const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8571
+ const ix = await this.depositClient.buildDepositTx(amountLamports);
8572
+ const tx = new Transaction().add(cuIx, ix);
8573
+ const prepared = await this.prepareTx(tx);
8574
+ const signed = await this.signTransaction(prepared.tx);
8575
+ return this.sendAndConfirmHttp(signed, prepared);
8577
8576
  } catch (err) {
8578
8577
  throw new Error(`Failed to deposit Solana: ${err}`);
8579
8578
  }
@@ -8584,13 +8583,12 @@ const _SolanaStakingClient = class _SolanaStakingClient {
8584
8583
  throw new Error("Withdraw amount must be greater than zero.");
8585
8584
  }
8586
8585
  try {
8587
- const tx = await this.depositClient.buildWithdrawTx(amountLamports);
8588
- const { tx: prepared, blockhash, lastValidBlockHeight } = await this.prepareTx(tx);
8589
- const signed = await this.signTransaction(prepared);
8590
- return await this.sendAndConfirmHttp(signed, {
8591
- blockhash,
8592
- lastValidBlockHeight
8593
- });
8586
+ const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8587
+ const ix = await this.depositClient.buildWithdrawTx(amountLamports);
8588
+ const tx = new Transaction().add(cuIx, ix);
8589
+ const prepared = await this.prepareTx(tx);
8590
+ const signed = await this.signTransaction(prepared.tx);
8591
+ return this.sendAndConfirmHttp(signed, prepared);
8594
8592
  } catch (err) {
8595
8593
  throw new Error(`Failed to withdraw Solana: ${err}`);
8596
8594
  }
@@ -8639,12 +8637,9 @@ const _SolanaStakingClient = class _SolanaStakingClient {
8639
8637
  const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8640
8638
  const ix = await this.tokenClient.buildPurchaseIx(amountLamports, user);
8641
8639
  const tx = new Transaction().add(cuIx, ix);
8642
- const { tx: prepared, blockhash, lastValidBlockHeight } = await this.prepareTx(tx);
8643
- const signed = await this.signTransaction(prepared);
8644
- return await this.sendAndConfirmHttp(signed, {
8645
- blockhash,
8646
- lastValidBlockHeight
8647
- });
8640
+ const prepared = await this.prepareTx(tx);
8641
+ const signed = await this.signTransaction(prepared.tx);
8642
+ return this.sendAndConfirmHttp(signed, prepared);
8648
8643
  } catch (err) {
8649
8644
  throw new Error(`Failed to buy liqSOL pretokens: ${err}`);
8650
8645
  }