Add getSignatureStatus()
This commit is contained in:
@ -35,10 +35,10 @@ function showBalance() {
|
||||
|
||||
function confirmTransaction(signature) {
|
||||
console.log('Confirming transaction:', signature);
|
||||
return connection.confirmTransaction(signature)
|
||||
return connection.getSignatureStatus(signature)
|
||||
.then((confirmation) => {
|
||||
if (!confirmation) {
|
||||
throw new Error('Transaction was not confirmed');
|
||||
if (confirmation !== 'Confirmed') {
|
||||
throw new Error(`Transaction was not confirmed (${confirmation})`);
|
||||
}
|
||||
console.log('Transaction confirmed');
|
||||
});
|
||||
|
Reference in New Issue
Block a user