canic_core/spec/sns/
mod.rs

1//!
2//! SNS governance candid bindings kept in a single spot with uniform naming.
3//!
4
5use crate::spec::prelude::*;
6
7///
8/// ListNeurons
9/// Request payload for SNS `list_neurons` with optional principal filtering.
10///
11
12#[derive(CandidType, Deserialize)]
13pub struct ListNeurons {
14    pub of_principal: Option<Principal>,
15    pub limit: u32,
16    pub start_page_at: Option<NeuronId>,
17}
18
19///
20/// NeuronId
21/// Wrapper around the raw bytes identifying an SNS neuron.
22///
23
24#[derive(CandidType, Clone, Debug, Deserialize)]
25pub struct NeuronId {
26    pub id: ByteBuf,
27}
28
29///
30/// ListNeuronsResponse
31/// Response payload containing the returned SNS neurons.
32///
33
34#[derive(CandidType, Deserialize)]
35pub struct ListNeuronsResponse {
36    pub neurons: Vec<Neuron>,
37}
38
39///
40/// Neuron
41/// Simplified view of an SNS neuron record used in ops modules.
42///
43
44#[derive(CandidType, Deserialize)]
45pub struct Neuron {
46    pub id: Option<NeuronId>,
47    pub staked_maturity_e8s_equivalent: Option<u64>,
48    pub maturity_e8s_equivalent: u64,
49    pub cached_neuron_stake_e8s: u64,
50    pub created_timestamp_seconds: u64,
51}