Skip to content

Commit

Permalink
getSignatureStatus -> getSignatureStatuses
Browse files Browse the repository at this point in the history
  • Loading branch information
vl-dev committed Aug 27, 2024
1 parent 5aaed9a commit b96398d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/libs/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ export const confirmTxs = async (
if (!sigBuffer) { throw new Error('No transaction signature.'); }
const sig = bs58.encode(sigBuffer);
// eslint-disable-next-line no-await-in-loop
const status = await connection.getSignatureStatus(sig, {
const statuses = await connection.getSignatureStatuses([sig], {
searchTransactionHistory: true,
});
const statusValue = status.value?.confirmationStatus;
if (!statuses || statuses.value.length === 0) {
console.log('No statuses found.');
finished = false;
continue;
}
const status = statuses.value[0];
const statusValue = status?.confirmationStatus;
console.log('Confirmation status: ', statusValue);
if (statusValue !== txStatus && statusValue !== 'finalized') {
finished = false;
Expand Down

0 comments on commit b96398d

Please sign in to comment.