import { ApiClient } from '../.'; export declare enum MasternodeState { PRE_ENABLED = "PRE_ENABLED", ENABLED = "ENABLED", PRE_RESIGNED = "PRE_RESIGNED", RESIGNED = "RESIGNED", PRE_BANNED = "PRE_BANNED", BANNED = "BANNED", UNKNOWN = "UNKNOWN" } export declare enum MasternodeTimeLock { FIVE_YEAR = "FIVEYEARTIMELOCK", TEN_YEAR = "TENYEARTIMELOCK" } /** * Masternode RPCs for DeFi Blockchain */ export declare class Masternode { private readonly client; constructor(client: ApiClient); /** * Creates a masternode creation transaction with given owner and operator addresses. * * @param {string} ownerAddress Any valid address for keeping collateral amount * @param {string} [operatorAddress] Masternode operator auth address (P2PKH only, unique). If empty, owner address will be used. * @param {CreateMasternodeOptions} [options] * @param {UTXO[]} [options.utxos = []] * @param {string} [options.utxos.txid] The transaction id * @param {string} [options.utxos.vout] The output number * @param {MasternodeTimeLock} [options.timelock] specify a fix period (5 or 10 years) lock which cannot be resigned and cannot spend the collateral * @return {Promise} */ createMasternode(ownerAddress: string, operatorAddress?: string, options?: CreateMasternodeOptions): Promise; /** * Returns information about multiple masternodes. * * @param {MasternodePagination} pagination * @param {string} [pagination.start] * @param {boolean} [pagination.including_start = true] Include starting position. * @param {string} [pagination.limit = 100] Maximum number of orders to return. * @param {boolean} [verbose = true] Flag for verbose list. Only ids are returned when false. * @return {Promise>} */ listMasternodes(pagination?: MasternodePagination, verbose?: boolean): Promise>; /** * Returns information about multiple masternodes. * * @param {MasternodePagination} pagination * @param {string} [pagination.start] * @param {boolean} [pagination.including_start = true] Include starting position. * @param {string} [pagination.limit = 100] Maximum number of orders to return. * @param {boolean} verbose true * @return {Promise>} */ listMasternodes(pagination: MasternodePagination, verbose: true): Promise>; /** * Returns information about multiple masternodes. * * @param {MasternodePagination} pagination * @param {string} [pagination.start] * @param {boolean} [pagination.including_start = true] Include starting position. * @param {string} [pagination.limit = 100] Maximum number of orders to return. * @param {boolean} verbose false. * @return {Promise>} */ listMasternodes(pagination: MasternodePagination, verbose: false): Promise>; /** * Returns information about a single masternode * * @param {string} masternodeId The masternode's id. * @return {Promise} */ getMasternode(masternodeId: string): Promise>; /** * Creates a masternode creation transaction with given owner and operator addresses. * * @param {MasternodeBlock} identifier * @param {string} [identifier.id] Masternode's id. * @param {string} [identifier.ownerAddress] Masternode owner address. * @param {string} [identifier.operatorAddress] Masternode operator address. * @param {number} [depth] Maximum depth, from the genesis block is the default. * @return {Promise>} */ getMasternodeBlocks(identifier: MasternodeBlock, depth?: number): Promise>; /** * Creates a transaction resigning a masternode. * * @param {string} masternodeId The masternode's id. * @param {UTXO[]} [utxos = []] Array of specified utxos to spend. * @param {string} [utxos.txid] The transaction id. * @param {number} [utxos.vout] The output number. * @return {Promise} Resignation Transaction. */ resignMasternode(masternodeId: string, utxos?: UTXO[]): Promise; /** * Creates (and submits to local node and network) a masternode update transaction which update the masternode operator addresses, spending the given inputs.. * The last optional argument (may be empty array) is an array of specific UTXOs to spend. * * @param {string} masternodeId The masternode's id. * @param {UpdateMasternodeValues} values * @param {string} [values.ownerAddress] The new masternode owner address, requires masternode collateral fee (P2PKH or P2WPKH). * @param {string} [values.operatorAddress] The new masternode operator address (P2PKH or P2WPKH). * @param {string} [values.rewardAddress] Masternode`s new reward address, empty "" to remove reward address. * @param {UTXO[]} [utxos = []] Array of specified utxos to spend. * @param {string} [utxos.txid] The transaction id. * @param {number} [utxos.vout] The output number. * @return {Promise} The hex-encoded hash of broadcasted transaction. */ updateMasternode(masternodeId: string, values: UpdateMasternodeValues, utxos?: UTXO[]): Promise; /** * Set special governance variables * * @param {Record} input json object * @param {UTXO[]} [utxos = []] Specific utxos to spend * @param {string} [utxos.txid] The transaction id * @param {string} [utxos.vout] The output number * @return {Promise} hash * */ setGov(input: Record, utxos?: UTXO[]): Promise; /** * Set special governance variables with activation height specified * * @param {Record} input json object * @param {number} activationHeight * @param {UTXO[]} [utxos = []] Specific utxos to spend * @param {string} [utxos.txid] The transaction id * @param {string} [utxos.vout] The output number * @return {Promise} hash * */ setGovHeight(input: Record, activationHeight: number, utxos?: UTXO[]): Promise; /** * Unset special governance variables * * @param {Record} variables json object * @param {UTXO[]} [utxos = []] Specific utxos to spend * @param {string} [utxos.txid] The transaction id * @param {string} [utxos.vout] The output number * @return {Promise} hash * */ unsetGov(variables: Record, utxos?: UTXO[]): Promise; /** * Get information about governance variable * * @param {string} name governance name * @return {Promise>} governance information as json object */ getGov(name: string): Promise>; /** * List all governance variables together if any with activation height * * @example * [ * [ { govVarKey: value }, { : value } ], * [ { govVarKey2: value }, { : value } ] * ] * * @returns {Promise>>>} */ listGovs(): Promise>>>; /** * Checks that custom transaction was affected on chain * * @param {string} transactionId transaction hash * @param {number} blockHeight height of block which contain transaction * @return {Promise} indicate that custom transaction was affected on chain */ isAppliedCustomTransaction(transactionId: string, blockHeight: number): Promise; /** * Returns the auth and confirm anchor masternode teams at current or specified height * * @param {number} blockHeight The height of block which contain tx * @returns {Promise} */ getAnchorTeams(blockHeight?: number): Promise; /** * Returns number of unique masternodes in the last specified number of blocks. * * @param {number} [blockCount=20160] The number of blocks to check for unique masternodes. * @return {Promise} Number of unique masternodes seen */ getActiveMasternodeCount(blockCount?: number): Promise; /** * Returns an array of anchors if any * @return Promise> */ listAnchors(): Promise>; /** * Clears the memory pool and returns a list of the removed transaction ids. * @return {Promise} Array of removed transaction ids */ clearMempool(): Promise; } export interface UTXO { txid: string; vout: number; } export interface CreateMasternodeOptions { utxos: UTXO[]; timelock?: MasternodeTimeLock; } export interface MasternodePagination { start?: string; including_start?: boolean; limit?: number; } export interface MasternodeBlock { id?: string; ownerAddress?: string; operatorAddress?: string; } export interface MasternodeInfo { ownerAuthAddress: string; operatorAuthAddress: string; rewardAddress: string; creationHeight: number; resignHeight: number; resignTx: string; collateralTx: string; state: MasternodeState; mintedBlocks: number; ownerIsMine: boolean; operatorIsMine: boolean; localMasternode: boolean; targetMultiplier?: number; targetMultipliers?: number[]; timelock?: number; } export interface MasternodeAnchor { anchorHeight: number; anchorHash: string; rewardAddress: string; dfiRewardHash: string; btcAnchorHeight: number; btcAnchorHash: string; confirmSignHash: string; } export interface AnchorTeamResult { auth: string[]; confirm: string[]; } export interface MasternodeResult { [id: string]: T; } export interface UpdateMasternodeValues { ownerAddress?: string; operatorAddress?: string; rewardAddress?: string; } //# sourceMappingURL=masternode.d.ts.map