chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
38 lines • 1.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CannotParseAmount = exports.CannotDerive = exports.NotEnoughFundsError = void 0;
class NotEnoughFundsError extends Error {
missingFunds;
constructor(missingFunds) {
if (missingFunds) {
super(`Wallet does not have enough funds. ${missingFunds.baseAmount} ${missingFunds.baseSymbol} needed.`);
}
else {
super('Wallet does not have enough funds.');
}
this.missingFunds = missingFunds;
if (Error.captureStackTrace)
Error.captureStackTrace(this, NotEnoughFundsError);
this.name = this.constructor.name;
}
}
exports.NotEnoughFundsError = NotEnoughFundsError;
class CannotDerive extends Error {
constructor() {
super('Derivation path are not supported (Are you using an imported private key?)');
if (Error.captureStackTrace)
Error.captureStackTrace(this, CannotDerive);
this.name = this.constructor.name;
}
}
exports.CannotDerive = CannotDerive;
class CannotParseAmount extends Error {
constructor(amountStr) {
super(`Invalid amount: ${amountStr}`);
if (Error.captureStackTrace)
Error.captureStackTrace(this, CannotDerive);
this.name = this.constructor.name;
}
}
exports.CannotParseAmount = CannotParseAmount;
//# sourceMappingURL=errors.js.map