@dfinity/nns
Version:
A library for interfacing with the Internet Computer's Network Nervous System.
51 lines (50 loc) • 2.12 kB
TypeScript
import { AccountIdentifier, SubAccount } from "@dfinity/ledger-icp";
import type { Principal } from "@dfinity/principal";
import type { NeuronInfo, ProposalInfo } from "../types/governance_converters";
/**
* Filter the neurons that are ineligible to vote to a proposal.
*
* This feature needs the ballots of the proposal to contains accurate data.
* If the proposal has settled, as the ballots of the proposal are emptied for archive purpose, the function might return a list of ineligible neurons that are actually neurons that have not voted but would have been eligible.
*
* Long story short, check the status of the proposal before using this function.
*
* @param {neurons; proposal;} params
* @param params.neurons The neurons to filter.
* @param params.proposal The proposal to match against the selected neurons.
*/
export declare const ineligibleNeurons: ({ neurons, proposal, }: {
neurons: NeuronInfo[];
proposal: ProposalInfo;
}) => NeuronInfo[];
/**
* Filter the neurons that can vote for a proposal - i.e. the neurons that have not voted yet and are eligible
*
* @param {neurons; proposal;} params
* @param params.neurons The neurons to filter.
* @param params.proposal The proposal to match against the selected neurons.
*/
export declare const votableNeurons: ({ neurons, proposal, }: {
neurons: NeuronInfo[];
proposal: ProposalInfo;
}) => NeuronInfo[];
/**
* Filter the neurons that have voted for a proposal.
*
* @param {neurons; proposal;} params
* @param params.neurons The neurons to filter.
* @param params.proposal The proposal for which some neurons might have already voted.
*/
export declare const votedNeurons: ({ neurons, proposal, }: {
neurons: NeuronInfo[];
proposal: ProposalInfo;
}) => NeuronInfo[];
export declare const memoToNeuronSubaccount: ({ controller, memo, }: {
controller: Principal;
memo: bigint;
}) => SubAccount;
export declare const memoToNeuronAccountIdentifier: ({ controller, memo, governanceCanisterId, }: {
controller: Principal;
memo: bigint;
governanceCanisterId: Principal;
}) => AccountIdentifier;