/** * This is the doc comment for pallet `PhragmenElection`'s calls. * * `PhragmenElection`'s storages: {@link: module:pangolin/phragmenElection/storages} * * @module pangolin/phragmenElection/calls */ import { Dispatch } from "../../../index"; import { ethers, BytesLike } from "ethers"; import { Metadata } from "@polkadot/types"; export declare const getPhragmenElection: (dispatch: Dispatch, metadata: Metadata) => { /** * Vote for a set of candidates for the upcoming round of election. This can be called to * set the initial votes, or update already existing votes. * * Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is * reserved. The deposit is based on the number of votes and can be updated over time. * * The `votes` should: * - not be empty. * - be less than the number of possible candidates. Note that all current members and * runners-up are also automatically candidates for the next round. * * If `value` is more than `who`'s free balance, then the maximum of the two is used. * * The dispatch origin of this call must be signed. * * ### Warning * * It is the responsibility of the caller to **NOT** place all of their balance into the * lock and keep some for further operations. * * @param {unknown} _votes Vec<[U8; 20]> * @param {unknown} _value Compact * @instance */ vote: (signer: ethers.Signer, _votes: unknown, _value: unknown) => Promise; /** * Similar to {@link: pangolin/phragmenElection/calls/vote}, but with scale encoded args. * * @param {BytesLike} argsBytes the args bytes * @instance */ voteH: (signer: ethers.Signer, argsBytes: BytesLike) => Promise; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * * @returns {CallAsParam} */ buildVoteCall: (_votes: unknown, _value: unknown) => import("../../../index").CallAsParam; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * Similar to buildVoteCall, but with scale encoded args. * * @returns {CallAsParam} */ buildVoteCallH: (argsBytes: BytesLike) => import("../../../index").CallAsParam; /** * Remove `origin` as a voter. * * This removes the lock and returns the deposit. * * The dispatch origin of this call must be signed and be a voter. * * @instance */ removeVoter: (signer: ethers.Signer) => Promise; /** * Similar to {@link: pangolin/phragmenElection/calls/removeVoter}, but with scale encoded args. * * @param {BytesLike} argsBytes the args bytes * @instance */ removeVoterH: (signer: ethers.Signer) => Promise; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * * @returns {CallAsParam} */ buildRemoveVoterCall: () => import("../../../index").CallAsParam; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * Similar to buildRemoveVoterCall, but with scale encoded args. * * @returns {CallAsParam} */ buildRemoveVoterCallH: (argsBytes: BytesLike) => import("../../../index").CallAsParam; /** * Submit oneself for candidacy. A fixed amount of deposit is recorded. * * All candidates are wiped at the end of the term. They either become a member/runner-up, * or leave the system while their deposit is slashed. * * The dispatch origin of this call must be signed. * * ### Warning * * Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`] * to get their deposit back. Losing the spot in an election will always lead to a slash. * * The number of current candidates must be provided as witness data. * ## Complexity * O(C + log(C)) where C is candidate_count. * * @param {unknown} _candidate_count Compact * @instance */ submitCandidacy: (signer: ethers.Signer, _candidate_count: unknown) => Promise; /** * Similar to {@link: pangolin/phragmenElection/calls/submitCandidacy}, but with scale encoded args. * * @param {BytesLike} argsBytes the args bytes * @instance */ submitCandidacyH: (signer: ethers.Signer, argsBytes: BytesLike) => Promise; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * * @returns {CallAsParam} */ buildSubmitCandidacyCall: (_candidate_count: unknown) => import("../../../index").CallAsParam; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * Similar to buildSubmitCandidacyCall, but with scale encoded args. * * @returns {CallAsParam} */ buildSubmitCandidacyCallH: (argsBytes: BytesLike) => import("../../../index").CallAsParam; /** * Renounce one's intention to be a candidate for the next election round. 3 potential * outcomes exist: * * - `origin` is a candidate and not elected in any set. In this case, the deposit is * unreserved, returned and origin is removed as a candidate. * - `origin` is a current runner-up. In this case, the deposit is unreserved, returned and * origin is removed as a runner-up. * - `origin` is a current member. In this case, the deposit is unreserved and origin is * removed as a member, consequently not being a candidate for the next round anymore. * Similar to [`remove_member`](Self::remove_member), if replacement runners exists, they * are immediately used. If the prime is renouncing, then no prime will exist until the * next round. * * The dispatch origin of this call must be signed, and have one of the above roles. * The type of renouncing must be provided as witness data. * * ## Complexity * - Renouncing::Candidate(count): O(count + log(count)) * - Renouncing::Member: O(1) * - Renouncing::RunnerUp: O(1) * * @param {unknown} _renouncing Enum<{0/Member: , 1/RunnerUp: , 2/Candidate: Compact}> * @instance */ renounceCandidacy: (signer: ethers.Signer, _renouncing: unknown) => Promise; /** * Similar to {@link: pangolin/phragmenElection/calls/renounceCandidacy}, but with scale encoded args. * * @param {BytesLike} argsBytes the args bytes * @instance */ renounceCandidacyH: (signer: ethers.Signer, argsBytes: BytesLike) => Promise; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * * @returns {CallAsParam} */ buildRenounceCandidacyCall: (_renouncing: unknown) => import("../../../index").CallAsParam; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * Similar to buildRenounceCandidacyCall, but with scale encoded args. * * @returns {CallAsParam} */ buildRenounceCandidacyCallH: (argsBytes: BytesLike) => import("../../../index").CallAsParam; /** * Remove a particular member from the set. This is effective immediately and the bond of * the outgoing member is slashed. * * If a runner-up is available, then the best runner-up will be removed and replaces the * outgoing member. Otherwise, if `rerun_election` is `true`, a new phragmen election is * started, else, nothing happens. * * If `slash_bond` is set to true, the bond of the member being removed is slashed. Else, * it is returned. * * The dispatch origin of this call must be root. * * Note that this does not affect the designated block number of the next election. * * ## Complexity * - Check details of remove_and_replace_member() and do_phragmen(). * * @param {unknown} _who [U8; 20] * @param {unknown} _slash_bond Bool * @param {unknown} _rerun_election Bool * @instance */ removeMember: (signer: ethers.Signer, _who: unknown, _slash_bond: unknown, _rerun_election: unknown) => Promise; /** * Similar to {@link: pangolin/phragmenElection/calls/removeMember}, but with scale encoded args. * * @param {BytesLike} argsBytes the args bytes * @instance */ removeMemberH: (signer: ethers.Signer, argsBytes: BytesLike) => Promise; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * * @returns {CallAsParam} */ buildRemoveMemberCall: (_who: unknown, _slash_bond: unknown, _rerun_election: unknown) => import("../../../index").CallAsParam; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * Similar to buildRemoveMemberCall, but with scale encoded args. * * @returns {CallAsParam} */ buildRemoveMemberCallH: (argsBytes: BytesLike) => import("../../../index").CallAsParam; /** * Clean all voters who are defunct (i.e. they do not serve any purpose at all). The * deposit of the removed voters are returned. * * This is an root function to be used only for cleaning the state. * * The dispatch origin of this call must be root. * * ## Complexity * - Check is_defunct_voter() details. * * @param {unknown} _num_voters U32 * @param {unknown} _num_defunct U32 * @instance */ cleanDefunctVoters: (signer: ethers.Signer, _num_voters: unknown, _num_defunct: unknown) => Promise; /** * Similar to {@link: pangolin/phragmenElection/calls/cleanDefunctVoters}, but with scale encoded args. * * @param {BytesLike} argsBytes the args bytes * @instance */ cleanDefunctVotersH: (signer: ethers.Signer, argsBytes: BytesLike) => Promise; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * * @returns {CallAsParam} */ buildCleanDefunctVotersCall: (_num_voters: unknown, _num_defunct: unknown) => import("../../../index").CallAsParam; /** * Build a call object to be used as a call param in other functions, such as `utilities.batchAll`. * Similar to buildCleanDefunctVotersCall, but with scale encoded args. * * @returns {CallAsParam} */ buildCleanDefunctVotersCallH: (argsBytes: BytesLike) => import("../../../index").CallAsParam; };