ic-query 0.102.0

Internet Computer query library for CloudEngine, NNS, SNS, ICRC, system canisters, and public network metadata
Documentation
//! External Governance Candid mappings for Query payloads.
//! Numeric labels preserve protocol identity independently of report JSON names.

use super::{
    NnsGovernanceDecimal, NnsGovernanceEconomics, NnsGovernanceMaturityModulation,
    NnsGovernanceMetricBucket, NnsGovernanceMetrics, NnsGovernanceNeuronSubsetMetrics,
    NnsGovernancePercentage, NnsGovernanceProposalId, NnsGovernanceRewardEvent,
    NnsNeuronsFundEconomics, NnsNeuronsFundMatchedFundingCurveCoefficients,
    NnsVotingPowerEconomics,
};

ic_platform::candid_record! {
    NnsGovernanceMetrics {
        64_139_100 => total_maturity_e8s_equivalent: u64,
        64_319_398 => not_dissolving_neurons_e8s_buckets: Vec<NnsGovernanceMetricBucket<f64>>,
        116_308_094 => dissolving_neurons_staked_maturity_e8s_equivalent_sum: u64,
        361_396_971 => garbage_collectable_neurons_count: u64,
        524_287_292 => dissolving_neurons_staked_maturity_e8s_equivalent_buckets: Vec<NnsGovernanceMetricBucket<f64>>,
        612_418_056 => neurons_with_invalid_stake_count: u64,
        643_562_901 => not_dissolving_neurons_count_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        657_809_292 => ect_neuron_count: u64,
        689_140_193 => total_supply_icp: u64,
        716_885_334 => neurons_with_less_than_6_months_dissolve_delay_count: u64,
        735_109_124 => dissolved_neurons_count: u64,
        789_595_768 => community_fund_total_maturity_e8s_equivalent: u64,
        1_070_302_186 => total_staked_e8s_seed: u64,
        1_075_481_524 => total_staked_maturity_e8s_equivalent_ect: u64,
        1_180_545_217 => total_maturity_disbursements_in_progress_e8s_equivalent: u64,
        1_213_539_238 => total_staked_e8s: u64,
        1_452_660_198 => fully_lost_voting_power_neuron_subset_metrics: Option<NnsGovernanceNeuronSubsetMetrics>,
        1_477_896_267 => not_dissolving_neurons_count: u64,
        1_509_536_710 => total_locked_e8s: u64,
        1_530_367_005 => neurons_fund_total_active_neurons: u64,
        1_555_150_911 => total_voting_power_non_self_authenticating_controller: Option<u64>,
        1_563_662_813 => total_staked_maturity_e8s_equivalent: u64,
        1_616_214_525 => not_dissolving_neurons_e8s_buckets_ect: Vec<NnsGovernanceMetricBucket<f64>>,
        1_634_122_936 => spawning_neurons_count: u64,
        1_722_644_012 => declining_voting_power_neuron_subset_metrics: Option<NnsGovernanceNeuronSubsetMetrics>,
        1_891_577_341 => total_staked_e8s_ect: u64,
        1_931_125_010 => not_dissolving_neurons_staked_maturity_e8s_equivalent_sum: u64,
        1_956_497_621 => dissolved_neurons_e8s: u64,
        2_087_657_249 => total_staked_e8s_non_self_authenticating_controller: Option<u64>,
        2_146_714_710 => dissolving_neurons_e8s_buckets_seed: Vec<NnsGovernanceMetricBucket<f64>>,
        2_572_901_799 => neurons_with_less_than_6_months_dissolve_delay_e8s: u64,
        2_865_610_704 => not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets: Vec<NnsGovernanceMetricBucket<f64>>,
        3_109_729_705 => dissolving_neurons_count_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        3_129_040_657 => dissolving_neurons_e8s_buckets_ect: Vec<NnsGovernanceMetricBucket<f64>>,
        3_308_082_587 => non_self_authenticating_controller_neuron_subset_metrics: Option<NnsGovernanceNeuronSubsetMetrics>,
        3_356_847_199 => dissolving_neurons_count: u64,
        3_611_048_634 => dissolving_neurons_e8s_buckets: Vec<NnsGovernanceMetricBucket<f64>>,
        3_764_528_723 => total_staked_maturity_e8s_equivalent_seed: u64,
        3_776_962_058 => community_fund_total_staked_e8s: u64,
        4_088_903_658 => not_dissolving_neurons_e8s_buckets_seed: Vec<NnsGovernanceMetricBucket<f64>>,
        4_129_362_460 => public_neuron_subset_metrics: Option<NnsGovernanceNeuronSubsetMetrics>,
        4_174_818_006 => timestamp_seconds: u64,
        4_192_124_817 => seed_neuron_count: u64,
    }
}

ic_platform::candid_record! {
    NnsGovernanceNeuronSubsetMetrics {
        64_139_100 => total_maturity_e8s_equivalent: Option<u64>,
        571_917_665 => maturity_e8s_equivalent_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        595_236_471 => voting_power_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        1_213_539_238 => total_staked_e8s: Option<u64>,
        1_248_019_663 => count: Option<u64>,
        1_302_295_889 => deciding_voting_power_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        1_563_662_813 => total_staked_maturity_e8s_equivalent: Option<u64>,
        2_102_687_177 => total_potential_voting_power: Option<u64>,
        2_272_666_636 => total_deciding_voting_power: Option<u64>,
        2_422_195_916 => staked_maturity_e8s_equivalent_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        2_856_808_725 => staked_e8s_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        3_162_047_432 => total_voting_power: Option<u64>,
        3_212_820_920 => potential_voting_power_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
        3_403_578_905 => count_buckets: Vec<NnsGovernanceMetricBucket<u64>>,
    }
}

ic_platform::candid_record! {
    ///
    /// NnsGovernanceNeuronId
    ///
    /// External NNS Governance neuron identifier shared by neuron and proposal queries.
    ///

    #[derive(Clone, Debug, Eq, PartialEq)]
    pub(in crate::nns) struct NnsGovernanceNeuronId {
        23_515 => pub(in crate::nns) id: u64,
    }
}

ic_platform::candid_record! {
    ///
    /// GovernanceError
    ///
    /// Native Candid Governance application error.
    ///

    pub(in crate::nns) struct GovernanceError {
        1_389_388_560 => pub(in crate::nns) error_message: String,
        3_790_638_545 => pub(in crate::nns) error_type: i32,
    }
}

ic_platform::candid_record! {
    ///
    /// GetMaturityModulationRequest
    ///
    /// Native empty Candid request for current maturity modulation.
    ///

    pub(super) struct GetMaturityModulationRequest {

    }
}

ic_platform::candid_record! {
    ///
    /// GetMaturityModulationResponse
    ///
    /// Native Candid response containing optional current maturity modulation.
    ///

    pub(super) struct GetMaturityModulationResponse {
        890_920_426 => pub(super) maturity_modulation: Option<NnsGovernanceMaturityModulation>,
    }
}

ic_platform::candid_record! {
    NnsGovernanceEconomics {
        971_299_358 => neuron_minimum_stake_e8s: u64,
        1_054_624_780 => voting_power_economics: Option<NnsVotingPowerEconomics>,
        1_250_131_262 => max_proposals_to_keep_per_topic: u32,
        1_283_033_022 => neuron_management_fee_per_proposal_e8s: u64,
        1_659_864_270 => reject_cost_e8s: u64,
        2_542_156_934 => transaction_fee_e8s: u64,
        2_862_146_885 => neuron_spawn_dissolve_delay_seconds: u64,
        3_422_818_451 => minimum_icp_xdr_rate: u64,
        3_706_990_837 => maximum_node_provider_rewards_e8s: u64,
        4_054_232_611 => neurons_fund_economics: Option<NnsNeuronsFundEconomics>,
    }
}

ic_platform::candid_record! {
    NnsNeuronsFundEconomics {
        1_535_296_321 => maximum_icp_xdr_rate: Option<NnsGovernancePercentage>,
        1_978_531_718 => neurons_fund_matched_funding_curve_coefficients: Option<NnsNeuronsFundMatchedFundingCurveCoefficients>,
        2_180_866_854 => max_theoretical_neurons_fund_participation_amount_xdr: Option<NnsGovernanceDecimal>,
        3_422_818_451 => minimum_icp_xdr_rate: Option<NnsGovernancePercentage>,
    }
}

ic_platform::candid_record! {
    NnsNeuronsFundMatchedFundingCurveCoefficients {
        688_756_867 => contribution_threshold_xdr: Option<NnsGovernanceDecimal>,
        691_827_592 => one_third_participation_milestone_xdr: Option<NnsGovernanceDecimal>,
        3_352_325_897 => full_participation_milestone_xdr: Option<NnsGovernanceDecimal>,
    }
}

ic_platform::candid_record! {
    NnsGovernancePercentage {
        4_250_201_284 => basis_points: Option<u64>,
    }
}

ic_platform::candid_record! {
    NnsGovernanceDecimal {
        793_255_938 => human_readable: Option<String>,
    }
}

ic_platform::candid_record! {
    NnsVotingPowerEconomics {
        629_662_281 => start_reducing_voting_power_after_seconds: Option<u64>,
        1_557_369_601 => neuron_minimum_dissolve_delay_to_vote_seconds: Option<u64>,
        3_463_696_956 => clear_following_after_seconds: Option<u64>,
    }
}

ic_platform::candid_record! {
    NnsGovernanceRewardEvent {
        152_559_150 => rounds_since_last_distribution: Option<u64>,
        196_247_458 => day_after_genesis: u64,
        924_276_133 => actual_timestamp_seconds: u64,
        2_803_390_394 => total_available_e8s_equivalent: u64,
        3_763_951_912 => latest_round_available_e8s_equivalent: Option<u64>,
        3_883_749_765 => distributed_e8s_equivalent: u64,
        4_193_836_411 => settled_proposals: Vec<NnsGovernanceProposalId>,
    }
}

ic_platform::candid_record! {
    NnsGovernanceProposalId {
        23_515 => id: u64,
    }
}

ic_platform::candid_record! {
    NnsGovernanceMaturityModulation {
        2_967_627_151 => current_value_permyriad: Option<i32>,
        3_369_011_470 => updated_at_timestamp_seconds: Option<u64>,
    }
}

pub(super) type GetMetricsResult = Result<NnsGovernanceMetrics, GovernanceError>;

ic_platform::candid_record! {
    NnsGovernanceMetricBucket<u64> {
        0 => key: u64,
        1 => value: u64,
    }
}

ic_platform::candid_record! {
    NnsGovernanceMetricBucket<f64> {
        0 => key: u64,
        1 => value: f64,
    }
}