@bigmi/core
Version:
TypeScript library for Bitcoin apps.
40 lines • 1.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WaitForTransactionReceiptTimeoutError = exports.TransactionReceiptNotFoundError = exports.TransactionNotFoundError = void 0;
const base_js_1 = require("./base.js");
class TransactionNotFoundError extends base_js_1.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',
});
}
}
exports.TransactionNotFoundError = TransactionNotFoundError;
class TransactionReceiptNotFoundError extends base_js_1.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',
});
}
}
exports.TransactionReceiptNotFoundError = TransactionReceiptNotFoundError;
class WaitForTransactionReceiptTimeoutError extends base_js_1.BaseError {
constructor({ hash }) {
super(`Timed out while waiting for transaction with hash "${hash}" to be confirmed.`, { name: 'WaitForTransactionReceiptTimeoutError' });
}
}
exports.WaitForTransactionReceiptTimeoutError = WaitForTransactionReceiptTimeoutError;
//# sourceMappingURL=transaction.js.map