Using connection.confirmTransaction
getting the following error:
confirmTransaction error: Cannot assign to read only property '_nextClientSubscriptionId' of object '#<Connection>'
const blockdetails = await connection.getLatestBlockhash();
tx.lastValidBlockHeight = blockdetails.lastValidBlockHeight;
tx.recentBlockhash = blockdetails.blockhash;
tx.feePayer = payer.publicKey;
const signedTx = await payer.signTransaction(tx);
const sendOptions: SendOptions = {
maxRetries: 3,
preflightCommitment: "processed",
skipPreflight: true,
};
const txnSignature = await connection.sendRawTransaction(
signedTx.serialize(),
sendOptions
;
const confirmStrategy: BlockheightBasedTransactionConfirmationStrategy = {
signature: txnSignature,
blockhash: blockdetails.blockhash,
lastValidBlockHeight: blockdetails.lastValidBlockHeight,
};
const conf = await connection.confirmTransaction(
confirmStrategy,
"processed"
);
confirmStrategy
, the oldAPI
gotsignature
andcommitment
only.