chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
24 lines • 824 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfirmedTransaction = void 0;
class ConfirmedTransaction {
waitToBeConfirmed() {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve) => {
// First check before starting the interval
if (await this.isConfirmed()) {
resolve();
}
else {
const intervalId = setInterval(async () => {
if (await this.isConfirmed()) {
clearInterval(intervalId);
resolve();
}
}, 10000);
}
});
}
}
exports.ConfirmedTransaction = ConfirmedTransaction;
//# sourceMappingURL=ConfirmedTransaction.js.map