@bigmi/core
Version:
TypeScript library for Bitcoin apps.
34 lines • 1.45 kB
JavaScript
import { BaseError } from './base.js';
export class TransactionNotFoundError extends BaseError {
constructor({ blockHash, blockNumber, blockTag, hash, index, }) {
let identifier = 'Transaction';
if (blockTag && index !== undefined) {
identifier = `Transaction at block time "${blockTag}" at index "${index}"`;
}
if (blockHash && index !== undefined) {
identifier = `Transaction at block hash "${blockHash}" at index "${index}"`;
}
if (blockNumber && index !== undefined) {
identifier = `Transaction at block number "${blockNumber}" at index "${index}"`;
}
if (hash) {
identifier = `Transaction with hash "${hash}"`;
}
super(`${identifier} could not be found.`, {
name: 'TransactionNotFoundError',
});
}
}
export class TransactionReceiptNotFoundError extends BaseError {
constructor({ hash }) {
super(`Transaction receipt with hash "${hash}" could not be found. The Transaction may not be processed on a block yet.`, {
name: 'TransactionReceiptNotFoundError',
});
}
}
export class WaitForTransactionReceiptTimeoutError extends BaseError {
constructor({ hash }) {
super(`Timed out while waiting for transaction with hash "${hash}" to be confirmed.`, { name: 'WaitForTransactionReceiptTimeoutError' });
}
}
//# sourceMappingURL=transaction.js.map