@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.
package/lib/stake.js CHANGED
@@ -8848,13 +8848,12 @@ const _SolanaStakingClient = class _SolanaStakingClient {
8848
8848
  throw new Error("Deposit amount must be greater than zero.");
8849
8849
  }
8850
8850
  try {
8851
- const tx = yield this.depositClient.buildDepositTx(amountLamports);
8852
- const { tx: prepared, blockhash, lastValidBlockHeight } = yield this.prepareTx(tx);
8853
- const signed = yield this.signTransaction(prepared);
8854
- return yield this.sendAndConfirmHttp(signed, {
8855
- blockhash,
8856
- lastValidBlockHeight
8857
- });
8851
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8852
+ const ix = yield this.depositClient.buildDepositTx(amountLamports);
8853
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8854
+ const prepared = yield this.prepareTx(tx);
8855
+ const signed = yield this.signTransaction(prepared.tx);
8856
+ return this.sendAndConfirmHttp(signed, prepared);
8858
8857
  } catch (err) {
8859
8858
  throw new Error(`Failed to deposit Solana: ${err}`);
8860
8859
  }
@@ -8867,13 +8866,12 @@ const _SolanaStakingClient = class _SolanaStakingClient {
8867
8866
  throw new Error("Withdraw amount must be greater than zero.");
8868
8867
  }
8869
8868
  try {
8870
- const tx = yield this.depositClient.buildWithdrawTx(amountLamports);
8871
- const { tx: prepared, blockhash, lastValidBlockHeight } = yield this.prepareTx(tx);
8872
- const signed = yield this.signTransaction(prepared);
8873
- return yield this.sendAndConfirmHttp(signed, {
8874
- blockhash,
8875
- lastValidBlockHeight
8876
- });
8869
+ const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8870
+ const ix = yield this.depositClient.buildWithdrawTx(amountLamports);
8871
+ const tx = new web3_js.Transaction().add(cuIx, ix);
8872
+ const prepared = yield this.prepareTx(tx);
8873
+ const signed = yield this.signTransaction(prepared.tx);
8874
+ return this.sendAndConfirmHttp(signed, prepared);
8877
8875
  } catch (err) {
8878
8876
  throw new Error(`Failed to withdraw Solana: ${err}`);
8879
8877
  }
@@ -8928,12 +8926,9 @@ const _SolanaStakingClient = class _SolanaStakingClient {
8928
8926
  const cuIx = web3_js.ComputeBudgetProgram.setComputeUnitLimit({ units: 4e5 });
8929
8927
  const ix = yield this.tokenClient.buildPurchaseIx(amountLamports, user);
8930
8928
  const tx = new web3_js.Transaction().add(cuIx, ix);
8931
- const { tx: prepared, blockhash, lastValidBlockHeight } = yield this.prepareTx(tx);
8932
- const signed = yield this.signTransaction(prepared);
8933
- return yield this.sendAndConfirmHttp(signed, {
8934
- blockhash,
8935
- lastValidBlockHeight
8936
- });
8929
+ const prepared = yield this.prepareTx(tx);
8930
+ const signed = yield this.signTransaction(prepared.tx);
8931
+ return this.sendAndConfirmHttp(signed, prepared);
8937
8932
  } catch (err) {
8938
8933
  throw new Error(`Failed to buy liqSOL pretokens: ${err}`);
8939
8934
  }