/** * Shared helpers for voting commands. */ import { ethers } from 'ethers'; import { OrgModules } from '../../lib/resolve'; import type { TxResult } from '../../lib/tx'; export interface VotingContracts { orgId: string; hybridVotingAddress: string | null; ddVotingAddress: string | null; } export declare function resolveVotingContracts(orgIdOrName: string, chainId?: number): Promise; interface ProposalCandidate { proposalId: string; title: string; status: string; endTimestamp?: string; } /** Test seam: fetch recent proposal titles for one voting contract. */ export declare function fetchRecentProposals(contractAddr: string, chainId?: number, first?: number): Promise; /** * Resolve a user-supplied --proposal argument to a numeric proposal ID. * * - Numeric input → returned as-is (no network round-trip). * - Anything else → fuzzy title query: the voting contract's recent * proposals are fetched from the subgraph and their (already decoded) * titles scored with Jaccard bestMatches at threshold 0.5. * - exactly one match → resolved with an info line * - multiple matches → interactive TTY: pick from the top 5; * non-TTY: CliError listing the candidates (exit 1) * - zero matches → CliError listing the 5 most recent titles * * opts.preferActive (used by `vote cast`): when several proposals match * but exactly ONE of them is still Active, that one wins — you can only * cast on an open proposal, so the ended homonyms are not ambiguity. */ export declare function resolveProposalId(input: string, contractAddr: string, chainId?: number, opts?: { preferActive?: boolean; }): Promise; export interface ExecutionCallInput { target: string; value?: string | number | ethers.BigNumber; data?: string; } /** * Governance-safety decode of proposal execution calls for the confirm * summary: each Call's target is resolved against the org's known module * addresses (named when recognized) and its calldata selector is decoded * to a function signature via the known ABIs. Never throws — undecodable * calls degrade to the raw selector so the human still sees SOMETHING. */ export declare function describeExecutionCalls(calls: ExecutionCallInput[], modules: Partial | null | undefined): string[]; /** * Parse an announceWinner receipt. The Executor catches failed sub-calls * and emits CallFailed / ProposalExecutionFailed while the OUTER tx still * succeeds — callers must treat innerFailure as an execution failure even * though result.success is true. */ export declare function parseAnnounceReceipt(result: TxResult): { winningOption?: string; valid?: boolean; executed: boolean; innerFailure: boolean; failedCalls: Array<{ index?: string; data?: string; }>; }; /** * callStatic probe shared by announce/execute pre-flights: would * announceWinner(id) revert right now (voting still open, already * executed, quorum edge...)? Returns the decoded reason on failure. */ export declare function announceWinnerProbe(contract: ethers.Contract, proposalId: number | string): Promise<{ ok: true; } | { ok: false; reason: string; }>; export {};