chore: Switch solana commitment to confirmed to reduced blockhash expiration (#1313)

This commit is contained in:
Adegoke David 2024-02-26 20:55:49 +01:00 committed by GitHub
parent 05728eeb54
commit 206276f0e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -263,7 +263,7 @@ class SolanaWalletClient {
required Ed25519HDKeyPair ownerKeypair,
List<String> references = const [],
}) async {
const commitment = Commitment.finalized;
const commitment = Commitment.confirmed;
final latestBlockhash =
await _client!.rpcClient.getLatestBlockhash(commitment: commitment).value;
@ -468,7 +468,10 @@ class SolanaWalletClient {
required SignedTx signedTransaction,
required Commitment commitment,
}) async {
final signature = await _client!.rpcClient.sendTransaction(signedTransaction.encode());
final signature = await _client!.rpcClient.sendTransaction(
signedTransaction.encode(),
preflightCommitment: commitment,
);
_client!.waitForSignatureStatus(signature, status: commitment);