UNPKG

@muirglacier/jellyfish-transaction-builder

Version:

A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin

73 lines 3.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TxnBuilderError = exports.TxnBuilderErrorType = void 0; var TxnBuilderErrorType; (function (TxnBuilderErrorType) { /** * No prevouts available to create a transaction */ TxnBuilderErrorType[TxnBuilderErrorType["NO_PREVOUTS"] = 0] = "NO_PREVOUTS"; /** * Required balance is not enough to create a transaction */ TxnBuilderErrorType[TxnBuilderErrorType["MIN_BALANCE_NOT_ENOUGH"] = 1] = "MIN_BALANCE_NOT_ENOUGH"; /** * Current fee is over the fixed MAX_FEE_RATE */ TxnBuilderErrorType[TxnBuilderErrorType["OVER_MAX_FEE_RATE"] = 2] = "OVER_MAX_FEE_RATE"; /** * Invalid fee rate */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_FEE_RATE"] = 3] = "INVALID_FEE_RATE"; /** * Unable to sign transaction due to error in TransactionSigner */ TxnBuilderErrorType[TxnBuilderErrorType["SIGN_TRANSACTION_ERROR"] = 4] = "SIGN_TRANSACTION_ERROR"; /** * Invalid conversion output `TokenBalance`, must consist only valid DFI balance */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_UTXOS_TO_ACCOUNT_OUTPUT"] = 5] = "INVALID_UTXOS_TO_ACCOUNT_OUTPUT"; /** * Invalid input `TokenBalances` array length must be one */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_ADD_LIQUIDITY_INPUT"] = 6] = "INVALID_ADD_LIQUIDITY_INPUT"; /** * Invalid conversion input `TokenBalances`, must consist only valid DFI balance */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_ACCOUNT_TO_UTXOS_INPUT"] = 7] = "INVALID_ACCOUNT_TO_UTXOS_INPUT"; /** * Invalid `AppointOracle` input */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_APPOINT_ORACLE_INPUT"] = 8] = "INVALID_APPOINT_ORACLE_INPUT"; /** * Invalid `UpdateOracle` input */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_UPDATE_ORACLE_INPUT"] = 9] = "INVALID_UPDATE_ORACLE_INPUT"; /** * Invalid public key length */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_PUB_KEY_LENGTH"] = 10] = "INVALID_PUB_KEY_LENGTH"; /** * Invalid `CreateOrder` amountToFill */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_ICX_CREATE_ORDER_AMOUNT_TO_FILL"] = 11] = "INVALID_ICX_CREATE_ORDER_AMOUNT_TO_FILL"; /** * Invalid `CreateVoc` amount, should be 0 */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_VOC_AMOUNT"] = 12] = "INVALID_VOC_AMOUNT"; /** * Invalid `CreateVoc` address, should be an empty stack */ TxnBuilderErrorType[TxnBuilderErrorType["INVALID_VOC_ADDRESS"] = 13] = "INVALID_VOC_ADDRESS"; })(TxnBuilderErrorType = exports.TxnBuilderErrorType || (exports.TxnBuilderErrorType = {})); /** * Error while constructing a transaction. */ class TxnBuilderError extends Error { constructor(type, message) { super(message); this.type = type; } } exports.TxnBuilderError = TxnBuilderError; //# sourceMappingURL=txn_builder_error.js.map