@bsv/sdk
Version:
BSV Blockchain Software Development Kit
25 lines • 1.43 kB
JavaScript
/**
* Insufficient funds in the available inputs to cover the cost of the required outputs
* and the transaction fee (${moreSatoshisNeeded} more satoshis are needed,
* for a total of ${totalSatoshisNeeded}), plus whatever would be required in order
* to pay the fee to unlock and spend the outputs used to provide the additional satoshis.
*/
export class WERR_INSUFFICIENT_FUNDS extends Error {
totalSatoshisNeeded;
moreSatoshisNeeded;
code;
isError = true;
/**
* @param totalSatoshisNeeded Total satoshis required to fund transactions after net of required inputs and outputs.
* @param moreSatoshisNeeded Shortfall on total satoshis required to fund transactions after net of required inputs and outputs.
*/
constructor(totalSatoshisNeeded, moreSatoshisNeeded) {
super(`Insufficient funds in the available inputs to cover the cost of the required outputs and the transaction fee (${moreSatoshisNeeded} more satoshis are needed, for a total of ${totalSatoshisNeeded}), plus whatever would be required in order to pay the fee to unlock and spend the outputs used to provide the additional satoshis.`);
this.totalSatoshisNeeded = totalSatoshisNeeded;
this.moreSatoshisNeeded = moreSatoshisNeeded;
this.code = 7;
this.name = this.constructor.name;
}
}
export default WERR_INSUFFICIENT_FUNDS;
//# sourceMappingURL=WERR_INSUFFICIENT_FUNDS.js.map