File tree 4 files changed +12
-6
lines changed
4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change
1
+ ## 2.6
2
+
3
+ - Added Transaction send helpers. ` prepareTransactionWithCompute() ` and ` sendTransactionWithRetry() `
4
+ - Added Transaction Parser helper functions ` getIdlParsedAccountData() ` , ` parseAnchorTransactionEvents() ` and ` getIdlParsedInstructionData() `
5
+ - Fixed ` createAccountsMintsAndTokenAccounts() ` function to use correct commitment and not ` max ` blockhash
6
+ - Fixed ` confirmTransaction() ` to not use correct commitment
7
+
1
8
## 2.5
2
9
3
10
- Add ` makeTokenMint() `
Original file line number Diff line number Diff line change @@ -250,12 +250,11 @@ const makeAndSendAndConfirmTransaction = async (
250
250
signers : Array < Signer > ,
251
251
payer : Keypair ,
252
252
) => {
253
- const latestBlockhash = ( await connection . getLatestBlockhash ( "max" ) )
254
- . blockhash ;
253
+ const latestBlockhash = await connection . getLatestBlockhash ( "confirmed" ) ;
255
254
256
255
const messageV0 = new TransactionMessage ( {
257
256
payerKey : payer . publicKey ,
258
- recentBlockhash : latestBlockhash ,
257
+ recentBlockhash : latestBlockhash . blockhash ,
259
258
instructions,
260
259
} ) . compileToV0Message ( ) ;
261
260
const transaction = new VersionedTransaction ( messageV0 ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export const confirmTransaction = async (
32
32
signature : string ,
33
33
commitment : Commitment = "confirmed" ,
34
34
) : Promise < string > => {
35
- const block = await connection . getLatestBlockhash ( ) ;
35
+ const block = await connection . getLatestBlockhash ( commitment ) ;
36
36
const rpcResponse = await connection . confirmTransaction (
37
37
{
38
38
signature,
@@ -213,7 +213,7 @@ export async function sendTransactionWithRetry(
213
213
let status : SignatureStatus | null = null ;
214
214
let retries = 0 ;
215
215
// Setting a minimum to decrease spam and for the confirmation to work
216
- let delayBetweenRetries = Math . max ( initialDelayMs , 500 ) ;
216
+ let delayBetweenRetries = Math . max ( initialDelayMs , 500 ) ;
217
217
218
218
while ( retries < maxRetries ) {
219
219
try {
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ describe("makeTokenMint", () => {
72
72
describe ( "createAccountsMintsAndTokenAccounts" , ( ) => {
73
73
test ( "createAccountsMintsAndTokenAccounts works" , async ( ) => {
74
74
const payer = Keypair . generate ( ) ;
75
- const connection = new Connection ( LOCALHOST ) ;
75
+ const connection = new Connection ( LOCALHOST , "confirmed" ) ;
76
76
await airdropIfRequired (
77
77
connection ,
78
78
payer . publicKey ,
You can’t perform that action at this time.
0 commit comments