|
1 | | -//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/release-2025-07-03_03-27-base/rs/sns/governance/canister/governance.did> |
| 1 | +//! Candid for canister `sns_governance` obtained by `scripts/update_ic_commit` from: <https://raw.githubusercontent.com/dfinity/ic/fccfa2c7c7cba9e5485ad0b48823990e24a67f40/rs/sns/governance/canister/governance.did> |
2 | 2 | type Account = record { |
3 | 3 | owner : opt principal; |
4 | 4 | subaccount : opt Subaccount; |
@@ -254,10 +254,43 @@ type GetMetricsRequest = record { |
254 | 254 | time_window_seconds : opt nat64; |
255 | 255 | }; |
256 | 256 |
|
| 257 | +type TreasuryMetrics = record { |
| 258 | + // Same as, e.g., `TransferSnsTreasuryFunds.from_treasury`. |
| 259 | + treasury : int32; |
| 260 | + |
| 261 | + // A human-readable identified for this treasury, e.g., "ICP". |
| 262 | + name : opt text; |
| 263 | + |
| 264 | + // The source of truth for the treasury balance is this ledger canister / account. |
| 265 | + ledger_canister_id : opt principal; |
| 266 | + account : opt Account; |
| 267 | + |
| 268 | + // The regularly updated amount of tokens in this treasury. |
| 269 | + amount_e8s : opt nat64; |
| 270 | + // The amount of tokens in this treasury at the end of swap finalization. |
| 271 | + original_amount_e8s : opt nat64; |
| 272 | + |
| 273 | + // When the metrics were last updated. |
| 274 | + timestamp_seconds : opt nat64; |
| 275 | +}; |
| 276 | + |
| 277 | +type VotingPowerMetrics = record { |
| 278 | + governance_total_potential_voting_power : opt nat64; |
| 279 | + |
| 280 | + // When the metrics were last updated. |
| 281 | + timestamp_seconds : opt nat64; |
| 282 | +}; |
| 283 | + |
257 | 284 | type Metrics = record { |
258 | 285 | num_recently_submitted_proposals : opt nat64; |
259 | 286 | num_recently_executed_proposals: opt nat64; |
| 287 | + |
260 | 288 | last_ledger_block_timestamp : opt nat64; |
| 289 | + |
| 290 | + // The metrics below are cached (albeit this is an implementation detail). |
| 291 | + treasury_metrics : opt vec TreasuryMetrics; |
| 292 | + voting_power_metrics : opt VotingPowerMetrics; |
| 293 | + genesis_timestamp_seconds : opt nat64; |
261 | 294 | }; |
262 | 295 |
|
263 | 296 | type GetMetricsResult = variant { |
@@ -360,6 +393,8 @@ type GovernanceCachedMetrics = record { |
360 | 393 | dissolving_neurons_count : nat64; |
361 | 394 | dissolving_neurons_e8s_buckets : vec record { nat64; float64 }; |
362 | 395 | timestamp_seconds : nat64; |
| 396 | + treasury_metrics : vec TreasuryMetrics; |
| 397 | + voting_power_metrics : opt VotingPowerMetrics; |
363 | 398 | }; |
364 | 399 |
|
365 | 400 | type GovernanceError = record { |
@@ -950,6 +985,7 @@ service : (Governance) -> { |
950 | 985 | get_maturity_modulation : (record {}) -> (GetMaturityModulationResponse); |
951 | 986 | get_metadata : (record {}) -> (GetMetadataResponse) query; |
952 | 987 | get_metrics : (GetMetricsRequest) -> (GetMetricsResponse) composite_query; |
| 988 | + get_metrics_replicated : (GetMetricsRequest) -> (GetMetricsResponse); |
953 | 989 | get_mode : (record {}) -> (GetModeResponse) query; |
954 | 990 | get_nervous_system_parameters : (null) -> (NervousSystemParameters) query; |
955 | 991 | get_neuron : (GetNeuron) -> (GetNeuronResponse) query; |
|
0 commit comments