Skip to content

Commit

Permalink
fix: getRecentBlockhash deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
MGrgr committed Nov 13, 2024
1 parent e1e43ad commit a0fb6ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/store/stake-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const useStakePoolStore = defineStore('stake-pool', (): StakePoolStore =>
);

// watch(reserveStakeBalance, async (con) => {
// const { blockhash } = await con.getRecentBlockhash('max');
// const { blockhash } = await con.getLatestBlockhash('max');
// fees.txFee = (await con.getFeeCalculatorForBlockhash(blockhash)).value?.lamportsPerSignature ?? 0;
// // minRentBalance.value = (await con.getMinimumBalanceForRentExemption(STAKE_STATE_LEN)) + 1;
// }, { immediate: true });
Expand Down
4 changes: 2 additions & 2 deletions src/utils/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function sendTransaction(

let transaction = new Transaction({ feePayer: wallet.publicKey });
transaction.add(...instructions);
transaction.recentBlockhash = (await connection.getRecentBlockhash('finalized')).blockhash;
transaction.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash;

if (signers.length > 0) {
transaction.partialSign(...signers);
Expand Down Expand Up @@ -119,7 +119,7 @@ export const sendTransactions = async (
const transactions: Transaction[] = [];

if (!blockhash) {
blockhash = (await connection.getRecentBlockhash(commitment)).blockhash;
blockhash = (await connection.getLatestBlockhash(commitment)).blockhash;
}

for (let i = 0; i < instructionSet.length; i++) {
Expand Down

0 comments on commit a0fb6ea

Please sign in to comment.