import BigNumber from 'bignumber.js'; import { ApiClient } from '../.'; export declare enum ProposalType { COMMUNITY_FUND_REQUEST = "CommunityFundRequest", BLOCK_REWARD_RELLOCATION = "BlockRewardRellocation", VOTE_OF_CONFIDENCE = "VoteOfConfidence" } export declare enum ProposalStatus { VOTING = "Voting", REJECTED = "Rejected", COMPLETED = "Completed" } export declare enum ListProposalsType { CFP = "cfp", BRP = "brp", VOC = "voc", ALL = "all" } export declare enum ListProposalsStatus { VOTING = "voting", REJECTED = "rejected", COMPLETED = "completed", ALL = "all" } export declare enum VoteDecision { YES = "yes", NO = "no", NEUTRAL = "neutral" } export declare enum MasternodeType { MINE = "mine", ALL = "all" } /** * Governance RPCs for DeFi Blockchain */ export declare class Governance { private readonly client; constructor(client: ApiClient); /** * Creates a Community Fund Request. * * @param {CFPData} data Community fund proposal data * @param {string} data.title Title of community fund request * @param {BigNumber} data.amount Amount per period * @param {string} data.payoutAddress Any valid address to receive the funds * @param {number} [data.cycles=1] Number of cycles for periodic fund request. Defaults to one cycle. * @param {UTXO[]} [utxos = []] Specific utxos to spend * @param {string} [utxos.txid] The transaction id * @param {number} [utxos.vout] The output number * @return {Promise} txid */ createCfp(data: CFPData, utxos?: UTXO[]): Promise; /** * Returns information about the proposal. * * @param {string} proposalId Proposal id * @return {Promise} Information about the proposal */ getProposal(proposalId: string): Promise; /** * Creates a Vote of Confidence. * * @param {string} title Vote of confidence's title * @param {UTXO[]} [utxos = []] Specific utxos to spend * @param {string} [utxos.txid] The transaction id * @param {number} [utxos.vout] The output number * @return {Promise} txid */ createVoc(title: string, utxos?: UTXO[]): Promise; /** * Returns list of proposals. * * @param {Object} options List proposal filter options * @param {ListProposalsType} [options.type=ListProposalsType.ALL] type of proposals * @param {ListProposalsStatus} [options.status=ListProposalsStatus.ALL] status of proposals * @return {Promise} */ listProposals({ type, status }?: { type?: ListProposalsType | undefined; status?: ListProposalsStatus | undefined; }): Promise; /** * Vote on a community proposal. * * @param {VoteData} data Vote data * @param {string} data.proposalId Proposal id * @param {number} data.masternodeId Masternode id * @param {VoteDecision} data.decision Vote decision. See VoteDecision. * @param {UTXO[]} [utxos = []] Specific utxos to spend * @param {string} [utxos.txid] The transaction id * @param {string} [utxos.vout] The output number * @return {Promise} txid */ vote(data: VoteData, utxos?: UTXO[]): Promise; /** * Returns information about proposal votes. * * @param {string} proposalId Proposal id * @param {MasternodeType | string} [masternode=MasternodeType.MINE] masternode id or reserved words 'mine' to list votes for all owned accounts or 'all' to list all votes * @return {Promise} Proposal vote information */ listVotes(proposalId: string, masternode?: MasternodeType | string): Promise; } export interface CFPData { title: string; amount: BigNumber; payoutAddress: string; cycles?: number; } /** Input UTXO */ export interface UTXO { /** transaction id */ txid: string; /** output number */ vout: number; } export interface ProposalInfo { proposalId: string; title: string; type: ProposalType; status: ProposalStatus; amount: BigNumber; cyclesPaid: number; totalCycles: number; finalizeAfter: number; payoutAddress: string; } export interface VoteData { proposalId: string; masternodeId: string; decision: VoteDecision; } export interface ListVotesResult { proposalId: string; masternodeId: string; cycle: number; vote: string; } //# sourceMappingURL=governance.d.ts.map