import { ethers } from 'ethers'; import type Pod from './Pod'; import { SafeTransaction } from './lib/services/transaction-service'; export declare type ProposalStatus = 'active' | 'passed' | 'executed' | 'rejected' | 'queued'; export declare type ProposalType = InstanceType; /** * The Proposal object is the interface for interacting with any Proposals. * Can be gotten via the Pod object, through {@link Pod.getProposals}. */ export default class Proposal { /** @property Pod object this Proposal is associated with */ pod: Pod; /** @property Proposal ID, i.e., the Gnosis nonce. This is not necessarily a unique number */ id: number; /** @property Proposal status, i.e., 'active', 'passed', 'rejected', or 'queued', */ status: ProposalStatus; /** * @property Whether or not this proposal corresponds to a superproposal */ isSubProposal?: boolean; /** @property Array of addresses that approved */ approvals: string[]; /** @property Array of addresses that rejected */ rejections: string[]; /** @property Number of votes required to pass/reject a proposal */ threshold: number; /** * @ignore * @property SafeTransaction object, used mostly internally */ safeTransaction: SafeTransaction; /** * @ignore * @property The associated reject SafeTransaction, if there is one. Used internally. */ rejectTransaction?: SafeTransaction; /** @property Name of smart contract method being called, if there is one */ method?: string; /** @property Parameters for the smart contract function being called, if there is one */ parameters?: { name: string; type: string; value: string; }[]; /** @property Eth value of transfer in Wei, if there is one */ value: string; timestamp: Date; /** * Transforms a Safe Transaction object into one of our Proposals. * @param safeTransaction * @param rejectTransaction - Optional reject transaction */ constructor(Pod: Pod, podNonce: number, safeTransaction: SafeTransaction, rejectTransaction?: SafeTransaction); /** * Votes to approve the proposal * @param signer - Signer of pod member * @throws If signer already approved proposal * @throws If signer is not a pod member * @throws If there was an error approving Proposal */ approve: (signer: ethers.Signer) => Promise; /** * Votes to reject the proposal * @param signer - Signer of pod member * @throws If signer has already rejected proposal * @throws If signer was not pod member * @throws If error rejecting proposal */ reject: (signer: ethers.Signer) => Promise; /** * Executes proposal * @param signer - Signer of pod member * @throws If not enough approvals to execute * @throws If signer was not part of the pod */ executeApprove: (signer: ethers.Signer) => Promise; /** * Executes the rejection of proposal * @param signer - Signer of pod member * @throws If not enough rejections to execute * @throws If signer was not part of the pod */ executeReject: (signer: ethers.Signer) => Promise; }