UNPKG

@bsv/wallet-toolbox-client

Version:
90 lines 3.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.specOpThrowReviewActions = exports.specOpFailedActions = exports.specOpNoSendActions = exports.specOpSetWalletChangeParams = exports.specOpInvalidChange = exports.specOpWalletBalance = exports.ProvenTxReqNonTerminalStatus = exports.ProvenTxReqTerminalStatus = void 0; exports.isListOutputsSpecOp = isListOutputsSpecOp; exports.isListActionsSpecOp = isListActionsSpecOp; exports.isCreateActionSpecOp = isCreateActionSpecOp; exports.ProvenTxReqTerminalStatus = ['completed', 'invalid', 'doubleSpend']; exports.ProvenTxReqNonTerminalStatus = [ 'sending', 'unsent', 'nosend', 'unknown', 'nonfinal', 'unprocessed', 'unmined', 'callback', 'unconfirmed' ]; /** * `listOutputs` special operation basket name value. * * Returns wallet's current change balance in the `totalOutputs` result property. * The `outputs` result property will always be an empty array. */ exports.specOpWalletBalance = '893b7646de0e1c9f741bd6e9169b76a8847ae34adef7bef1e6a285371206d2e8'; /** * `listOutputs` special operation basket name value. * * Returns currently spendable wallet change outputs that fail to validate as unspent transaction outputs. * * Optional tag value 'release'. If present, updates invalid change outputs to not spendable. * * Optional tag value 'all'. If present, processes all spendable true outputs, independent of baskets. */ exports.specOpInvalidChange = '5a76fd430a311f8bc0553859061710a4475c19fed46e2ff95969aa918e612e57'; /** * `listOutputs` special operation basket name value. * * Updates the wallet's automatic change management parameters. * * Tag at index 0 is the new desired number of spendable change outputs to maintain. * * Tag at index 1 is the new target for minimum satoshis when creating new change outputs. */ exports.specOpSetWalletChangeParams = 'a4979d28ced8581e9c1c92f1001cc7cb3aabf8ea32e10888ad898f0a509a3929'; /** * @param basket Output basket name value. * @returns true iff the `basket` name is a reserved `listOutputs` special operation identifier. */ function isListOutputsSpecOp(basket) { return [exports.specOpWalletBalance, exports.specOpInvalidChange, exports.specOpSetWalletChangeParams].indexOf(basket) >= 0; } /** * `listActions` special operation label name value. * * Processes only actions currently with status 'nosend' * * Optional label value 'abort'. If present, runs abortAction on all the actions returned. */ exports.specOpNoSendActions = 'ac6b20a3bb320adafecd637b25c84b792ad828d3aa510d05dc841481f664277d'; /** * `listActions` special operation label name value. * * Processes only actions currently with status 'failed' * * Optional label value 'unfail'. If present, sets status to 'unfail', which queues them for attempted recovery by the Monitor. */ exports.specOpFailedActions = '97d4eb1e49215e3374cc2c1939a7c43a55e95c7427bf2d45ed63e3b4e0c88153'; /** * @param label Action / Transaction label name value. * @returns true iff the `label` name is a reserved `listActions` special operation identifier. */ function isListActionsSpecOp(label) { return [exports.specOpNoSendActions, exports.specOpFailedActions].indexOf(label) >= 0; } /** * `createAction` special operation label name value. * * Causes WERR_REVIEW_ACTIONS throw with dummy properties. * */ exports.specOpThrowReviewActions = 'a496e747fc3ad5fabdd4ae8f91184e71f87539bd3d962aa2548942faaaf0047a'; /** * @param label Action / Transaction label name value. * @returns true iff the `label` name is a reserved `createAction` special operation identifier. */ function isCreateActionSpecOp(label) { return [exports.specOpThrowReviewActions].indexOf(label) >= 0; } //# sourceMappingURL=types.js.map