1use crate::delegation::{self, OwnerProxySubKey};
5use crate::error::MixnetContractError;
6use crate::gateway::{Gateway, GatewayConfigUpdate};
7use crate::helpers::IntoBaseDecimal;
8use crate::mixnode::{MixNode, MixNodeConfigUpdate, NodeCostParams};
9use crate::nym_node::{NodeConfigUpdate, Role};
10use crate::pending_events::{EpochEventId, IntervalEventId};
11use crate::reward_params::{
12 ActiveSetUpdate, IntervalRewardParams, IntervalRewardingParamsUpdate, NodeRewardingParameters,
13 Performance, RewardedSetParams, RewardingParams, WorkFactor,
14};
15use crate::types::NodeId;
16use crate::{
17 ContractStateParamsUpdate, NymNode, OutdatedVersionWeights, RoleAssignment,
18 VersionScoreFormulaParams,
19};
20use crate::{OperatingCostRange, ProfitMarginRange};
21use cosmwasm_schema::cw_serde;
22use cosmwasm_std::{Coin, Decimal};
23use nym_contracts_common::{IdentityKey, Percent, signing::MessageSignature};
24use std::time::Duration;
25
26#[cfg(feature = "schema")]
27use crate::{
28 config_score::{CurrentNymNodeVersionResponse, NymNodeVersionHistoryResponse},
29 delegation::{
30 NodeDelegationResponse, PagedAllDelegationsResponse, PagedDelegatorDelegationsResponse,
31 PagedNodeDelegationsResponse,
32 },
33 gateway::{
34 GatewayBondResponse, GatewayOwnershipResponse, PagedGatewayResponse,
35 PreassignedGatewayIdsResponse,
36 },
37 interval::{CurrentIntervalResponse, EpochStatus},
38 key_rotation::{KeyRotationIdResponse, KeyRotationState},
39 mixnode::{
40 MixOwnershipResponse, MixStakeSaturationResponse, MixnodeDetailsByIdentityResponse,
41 MixnodeDetailsResponse, MixnodeRewardingDetailsResponse, PagedMixnodeBondsResponse,
42 PagedMixnodesDetailsResponse, PagedUnbondedMixnodesResponse, UnbondedMixnodeResponse,
43 },
44 nym_node::{
45 EpochAssignmentResponse, NodeDetailsByIdentityResponse, NodeDetailsResponse,
46 NodeOwnershipResponse, NodeRewardingDetailsResponse, PagedNymNodeBondsResponse,
47 PagedNymNodeDetailsResponse, PagedUnbondedNymNodesResponse, RolesMetadataResponse,
48 StakeSaturationResponse, UnbondedNodeResponse,
49 },
50 pending_events::{
51 NumberOfPendingEventsResponse, PendingEpochEventResponse, PendingEpochEventsResponse,
52 PendingIntervalEventResponse, PendingIntervalEventsResponse,
53 },
54 rewarding::{EstimatedCurrentEpochRewardResponse, PendingRewardResponse},
55 types::{ContractState, ContractStateParams},
56};
57#[cfg(feature = "schema")]
58use cosmwasm_schema::QueryResponses;
59#[cfg(feature = "schema")]
60use nym_contracts_common::{ContractBuildInformation, signing::Nonce};
61
62#[cw_serde]
63pub struct InstantiateMsg {
64 pub rewarding_validator_address: String,
65 pub vesting_contract_address: String,
66 pub node_families_contract_address: String,
67
68 pub rewarding_denom: String,
69 pub epochs_in_interval: u32,
70 pub epoch_duration: Duration,
71 pub initial_rewarding_params: InitialRewardingParams,
72
73 pub current_nym_node_version: String,
74
75 #[serde(default)]
76 pub version_score_weights: OutdatedVersionWeights,
77
78 #[serde(default)]
79 pub version_score_params: VersionScoreFormulaParams,
80
81 #[serde(default)]
82 pub profit_margin: ProfitMarginRange,
83
84 #[serde(default)]
85 pub interval_operating_cost: OperatingCostRange,
86
87 #[serde(default)]
88 pub key_validity_in_epochs: Option<u32>,
89}
90
91impl InstantiateMsg {
92 pub const MIN_KEY_ROTATION_VALIDITY: u32 = 3;
95 pub fn key_validity_in_epochs(&self) -> u32 {
96 self.key_validity_in_epochs.unwrap_or(24)
97 }
98}
99
100#[cw_serde]
101pub struct InitialRewardingParams {
102 pub initial_reward_pool: Decimal,
103 pub initial_staking_supply: Decimal,
104
105 pub staking_supply_scale_factor: Percent,
106 pub sybil_resistance: Percent,
107 pub active_set_work_factor: Decimal,
108 pub interval_pool_emission: Percent,
109
110 pub rewarded_set_params: RewardedSetParams,
111}
112
113impl InitialRewardingParams {
114 pub fn into_rewarding_params(
115 self,
116 epochs_in_interval: u32,
117 ) -> Result<RewardingParams, MixnetContractError> {
118 let epoch_reward_budget = self.initial_reward_pool
119 / epochs_in_interval.into_base_decimal()?
120 * self.interval_pool_emission;
121 let stake_saturation_point = self.initial_staking_supply
122 / self
123 .rewarded_set_params
124 .rewarded_set_size()
125 .into_base_decimal()?;
126
127 Ok(RewardingParams {
128 interval: IntervalRewardParams {
129 reward_pool: self.initial_reward_pool,
130 staking_supply: self.initial_staking_supply,
131 staking_supply_scale_factor: self.staking_supply_scale_factor,
132 epoch_reward_budget,
133 stake_saturation_point,
134 sybil_resistance: self.sybil_resistance,
135 active_set_work_factor: self.active_set_work_factor,
136 interval_pool_emission: self.interval_pool_emission,
137 },
138 rewarded_set: self.rewarded_set_params,
139 })
140 }
141}
142
143#[cw_serde]
144pub enum ExecuteMsg {
145 UpdateAdmin {
147 admin: String,
148 },
149
150 UpdateRewardingValidatorAddress {
152 address: String,
153 },
154 UpdateContractStateParams {
155 update: ContractStateParamsUpdate,
156 },
157 UpdateCurrentNymNodeSemver {
158 current_version: String,
159 },
160 UpdateActiveSetDistribution {
161 update: ActiveSetUpdate,
162 force_immediately: bool,
163 },
164 UpdateRewardingParams {
165 updated_params: IntervalRewardingParamsUpdate,
166 force_immediately: bool,
167 },
168 UpdateIntervalConfig {
169 epochs_in_interval: u32,
170 epoch_duration_secs: u64,
171 force_immediately: bool,
172 },
173
174 BeginEpochTransition {},
175 ReconcileEpochEvents {
176 limit: Option<u32>,
177 },
178 AssignRoles {
179 assignment: RoleAssignment,
180 },
181
182 BondMixnode {
184 mix_node: MixNode,
185 cost_params: NodeCostParams,
186 owner_signature: MessageSignature,
187 },
188 BondMixnodeOnBehalf {
189 mix_node: MixNode,
190 cost_params: NodeCostParams,
191 owner_signature: MessageSignature,
192 owner: String,
193 },
194 PledgeMore {},
195 PledgeMoreOnBehalf {
196 owner: String,
197 },
198 DecreasePledge {
199 decrease_by: Coin,
200 },
201 DecreasePledgeOnBehalf {
202 owner: String,
203 decrease_by: Coin,
204 },
205 UnbondMixnode {},
206 UnbondMixnodeOnBehalf {
207 owner: String,
208 },
209 #[serde(
210 alias = "UpdateMixnodeCostParams",
211 alias = "update_mixnode_cost_params"
212 )]
213 UpdateCostParams {
214 new_costs: NodeCostParams,
215 },
216 UpdateMixnodeCostParamsOnBehalf {
217 new_costs: NodeCostParams,
218 owner: String,
219 },
220 UpdateMixnodeConfig {
221 new_config: MixNodeConfigUpdate,
222 },
223 UpdateMixnodeConfigOnBehalf {
224 new_config: MixNodeConfigUpdate,
225 owner: String,
226 },
227 MigrateMixnode {},
228
229 BondGateway {
231 gateway: Gateway,
232 owner_signature: MessageSignature,
233 },
234 BondGatewayOnBehalf {
235 gateway: Gateway,
236 owner: String,
237 owner_signature: MessageSignature,
238 },
239 UnbondGateway {},
240 UnbondGatewayOnBehalf {
241 owner: String,
242 },
243 UpdateGatewayConfig {
244 new_config: GatewayConfigUpdate,
245 },
246 UpdateGatewayConfigOnBehalf {
247 new_config: GatewayConfigUpdate,
248 owner: String,
249 },
250 MigrateGateway {
251 cost_params: Option<NodeCostParams>,
252 },
253
254 BondNymNode {
256 node: NymNode,
257 cost_params: NodeCostParams,
258 owner_signature: MessageSignature,
259 },
260 UnbondNymNode {},
261 UpdateNodeConfig {
262 update: NodeConfigUpdate,
263 },
264
265 #[serde(alias = "DelegateToMixnode", alias = "delegate_to_mixnode")]
267 Delegate {
268 #[serde(alias = "mix_id")]
269 node_id: NodeId,
270 },
271 DelegateToMixnodeOnBehalf {
272 mix_id: NodeId,
273 delegate: String,
274 },
275 #[serde(alias = "UndelegateFromMixnode", alias = "undelegate_from_mixnode")]
276 Undelegate {
277 #[serde(alias = "mix_id")]
278 node_id: NodeId,
279 },
280 UndelegateFromMixnodeOnBehalf {
281 mix_id: NodeId,
282 delegate: String,
283 },
284
285 RewardNode {
287 #[serde(alias = "mix_id")]
288 node_id: NodeId,
289 params: NodeRewardingParameters,
290 },
291 WithdrawOperatorReward {},
292 WithdrawOperatorRewardOnBehalf {
293 owner: String,
294 },
295 WithdrawDelegatorReward {
296 #[serde(alias = "mix_id")]
297 node_id: NodeId,
298 },
299 WithdrawDelegatorRewardOnBehalf {
300 mix_id: NodeId,
301 owner: String,
302 },
303
304 MigrateVestedMixNode {},
306 MigrateVestedDelegation {
307 mix_id: NodeId,
308 },
309 AdminMigrateVestedMixNode {
312 owner: String,
313 },
314 AdminMigrateVestedDelegation {
317 mix_id: NodeId,
318 owner: String,
319 },
320 AdminBatchMigrateVestedDelegations {
323 entries: Vec<VestedDelegationMigrationEntry>,
324 },
325
326 #[cfg(feature = "contract-testing")]
328 TestingResolveAllPendingEvents {
329 limit: Option<u32>,
330 },
331}
332
333impl ExecuteMsg {
334 pub fn default_memo(&self) -> String {
335 match self {
336 ExecuteMsg::UpdateAdmin { admin } => format!("updating contract admin to {admin}"),
337 ExecuteMsg::UpdateRewardingValidatorAddress { address } => {
338 format!("updating rewarding validator to {address}")
339 }
340 ExecuteMsg::UpdateContractStateParams { .. } => {
341 "updating mixnet state parameters".into()
342 }
343 ExecuteMsg::UpdateCurrentNymNodeSemver { current_version } => {
344 format!("updating current nym-node semver to {current_version}")
345 }
346 ExecuteMsg::UpdateActiveSetDistribution {
347 force_immediately, ..
348 } => format!("updating active set distribution. forced: {force_immediately}"),
349 ExecuteMsg::UpdateRewardingParams {
350 force_immediately, ..
351 } => format!("updating mixnet rewarding parameters. forced: {force_immediately}"),
352 ExecuteMsg::UpdateIntervalConfig {
353 force_immediately, ..
354 } => format!("updating mixnet interval configuration. forced: {force_immediately}"),
355 ExecuteMsg::BeginEpochTransition {} => "beginning epoch transition".into(),
356 ExecuteMsg::ReconcileEpochEvents { .. } => "reconciling epoch events".into(),
357 ExecuteMsg::BondMixnode { mix_node, .. } => {
358 format!("bonding mixnode {}", mix_node.identity_key)
359 }
360 ExecuteMsg::BondMixnodeOnBehalf { mix_node, .. } => {
361 format!("bonding mixnode {} on behalf", mix_node.identity_key)
362 }
363 ExecuteMsg::PledgeMore {} => "pledging additional tokens".into(),
364 ExecuteMsg::PledgeMoreOnBehalf { .. } => "pledging additional tokens on behalf".into(),
365 ExecuteMsg::DecreasePledge { .. } => "decreasing mixnode pledge".into(),
366 ExecuteMsg::DecreasePledgeOnBehalf { .. } => {
367 "decreasing mixnode pledge on behalf".into()
368 }
369 ExecuteMsg::UnbondMixnode { .. } => "unbonding mixnode".into(),
370 ExecuteMsg::UnbondMixnodeOnBehalf { .. } => "unbonding mixnode on behalf".into(),
371 ExecuteMsg::UpdateCostParams { .. } => "updating mixnode cost parameters".into(),
372 ExecuteMsg::UpdateMixnodeCostParamsOnBehalf { .. } => {
373 "updating mixnode cost parameters on behalf".into()
374 }
375 ExecuteMsg::UpdateMixnodeConfig { .. } => "updating mixnode configuration".into(),
376 ExecuteMsg::UpdateMixnodeConfigOnBehalf { .. } => {
377 "updating mixnode configuration on behalf".into()
378 }
379 ExecuteMsg::BondGateway { gateway, .. } => {
380 format!("bonding gateway {}", gateway.identity_key)
381 }
382 ExecuteMsg::BondGatewayOnBehalf { gateway, .. } => {
383 format!("bonding gateway {} on behalf", gateway.identity_key)
384 }
385 ExecuteMsg::UnbondGateway { .. } => "unbonding gateway".into(),
386 ExecuteMsg::UnbondGatewayOnBehalf { .. } => "unbonding gateway on behalf".into(),
387 ExecuteMsg::UpdateGatewayConfig { .. } => "updating gateway configuration".into(),
388 ExecuteMsg::UpdateGatewayConfigOnBehalf { .. } => {
389 "updating gateway configuration on behalf".into()
390 }
391 ExecuteMsg::Delegate { node_id: mix_id } => format!("delegating to mixnode {mix_id}"),
392 ExecuteMsg::DelegateToMixnodeOnBehalf { mix_id, .. } => {
393 format!("delegating to mixnode {mix_id} on behalf")
394 }
395 ExecuteMsg::Undelegate { node_id: mix_id } => {
396 format!("removing delegation from mixnode {mix_id}")
397 }
398 ExecuteMsg::UndelegateFromMixnodeOnBehalf { mix_id, .. } => {
399 format!("removing delegation from mixnode {mix_id} on behalf")
400 }
401 ExecuteMsg::RewardNode { node_id, .. } => format!("rewarding node {node_id}"),
402 ExecuteMsg::WithdrawOperatorReward { .. } => "withdrawing operator reward".into(),
403 ExecuteMsg::WithdrawOperatorRewardOnBehalf { .. } => {
404 "withdrawing operator reward on behalf".into()
405 }
406 ExecuteMsg::WithdrawDelegatorReward { node_id: mix_id } => {
407 format!("withdrawing delegator reward from mixnode {mix_id}")
408 }
409 ExecuteMsg::WithdrawDelegatorRewardOnBehalf { mix_id, .. } => {
410 format!("withdrawing delegator reward from mixnode {mix_id} on behalf")
411 }
412 ExecuteMsg::MigrateVestedMixNode { .. } => "migrate vested mixnode".into(),
413 ExecuteMsg::MigrateVestedDelegation { .. } => "migrate vested delegation".to_string(),
414 ExecuteMsg::AdminMigrateVestedMixNode { owner } => {
415 format!("admin migrating vested mixnode of {owner}")
416 }
417 ExecuteMsg::AdminMigrateVestedDelegation { mix_id, owner } => {
418 format!("admin migrating vested delegation of {owner} on mixnode {mix_id}")
419 }
420 ExecuteMsg::AdminBatchMigrateVestedDelegations { entries } => {
421 format!("admin batch migrating {} vested delegations", entries.len())
422 }
423 ExecuteMsg::AssignRoles { .. } => "assigning epoch roles".into(),
424 ExecuteMsg::MigrateMixnode { .. } => "migrating legacy mixnode".into(),
425 ExecuteMsg::MigrateGateway { .. } => "migrating legacy gateway".into(),
426 ExecuteMsg::BondNymNode { .. } => "bonding nym-node".into(),
427 ExecuteMsg::UnbondNymNode { .. } => "unbonding nym-node".into(),
428 ExecuteMsg::UpdateNodeConfig { .. } => "updating node config".into(),
429
430 #[cfg(feature = "contract-testing")]
431 ExecuteMsg::TestingResolveAllPendingEvents { .. } => {
432 "resolving all pending events".into()
433 }
434 }
435 }
436}
437
438#[cw_serde]
439#[cfg_attr(feature = "schema", derive(QueryResponses))]
440pub enum QueryMsg {
441 #[cfg_attr(feature = "schema", returns(cw_controllers::AdminResponse))]
442 Admin {},
443
444 #[cfg_attr(feature = "schema", returns(ContractBuildInformation))]
447 GetContractVersion {},
448
449 #[serde(rename = "get_cw2_contract_version")]
451 #[cfg_attr(feature = "schema", returns(cw2::ContractVersion))]
452 GetCW2ContractVersion {},
453
454 #[cfg_attr(feature = "schema", returns(String))]
456 GetRewardingValidatorAddress {},
457
458 #[cfg_attr(feature = "schema", returns(ContractStateParams))]
460 GetStateParams {},
461
462 #[cfg_attr(feature = "schema", returns(ContractState))]
464 GetState {},
465
466 #[cfg_attr(feature = "schema", returns(CurrentNymNodeVersionResponse))]
468 GetCurrentNymNodeVersion {},
469
470 #[cfg_attr(feature = "schema", returns(NymNodeVersionHistoryResponse))]
472 GetNymNodeVersionHistory {
473 limit: Option<u32>,
475
476 start_after: Option<u32>,
478 },
479
480 #[cfg_attr(feature = "schema", returns(RewardingParams))]
482 GetRewardingParams {},
483
484 #[cfg_attr(feature = "schema", returns(EpochStatus))]
486 GetEpochStatus {},
487
488 #[cfg_attr(feature = "schema", returns(CurrentIntervalResponse))]
490 GetCurrentIntervalDetails {},
491
492 #[cfg_attr(feature = "schema", returns(PagedMixnodeBondsResponse))]
495 GetMixNodeBonds {
496 limit: Option<u32>,
498
499 start_after: Option<NodeId>,
501 },
502
503 #[cfg_attr(feature = "schema", returns(PagedMixnodesDetailsResponse))]
505 GetMixNodesDetailed {
506 limit: Option<u32>,
508
509 start_after: Option<NodeId>,
511 },
512
513 #[cfg_attr(feature = "schema", returns(PagedUnbondedMixnodesResponse))]
515 GetUnbondedMixNodes {
516 limit: Option<u32>,
518
519 start_after: Option<NodeId>,
521 },
522
523 #[cfg_attr(feature = "schema", returns(PagedUnbondedMixnodesResponse))]
525 GetUnbondedMixNodesByOwner {
526 owner: String,
528
529 limit: Option<u32>,
531
532 start_after: Option<NodeId>,
534 },
535
536 #[cfg_attr(feature = "schema", returns(PagedUnbondedMixnodesResponse))]
538 GetUnbondedMixNodesByIdentityKey {
539 identity_key: String,
541
542 limit: Option<u32>,
544
545 start_after: Option<NodeId>,
547 },
548
549 #[cfg_attr(feature = "schema", returns(MixOwnershipResponse))]
551 GetOwnedMixnode {
552 address: String,
554 },
555
556 #[cfg_attr(feature = "schema", returns(MixnodeDetailsResponse))]
558 GetMixnodeDetails {
559 mix_id: NodeId,
561 },
562
563 #[cfg_attr(feature = "schema", returns(MixnodeRewardingDetailsResponse))]
565 GetMixnodeRewardingDetails {
566 mix_id: NodeId,
568 },
569
570 #[cfg_attr(feature = "schema", returns(MixStakeSaturationResponse))]
572 GetStakeSaturation {
573 mix_id: NodeId,
575 },
576
577 #[cfg_attr(feature = "schema", returns(UnbondedMixnodeResponse))]
579 GetUnbondedMixNodeInformation {
580 mix_id: NodeId,
582 },
583
584 #[cfg_attr(feature = "schema", returns(MixnodeDetailsByIdentityResponse))]
586 GetBondedMixnodeDetailsByIdentity {
587 mix_identity: IdentityKey,
589 },
590
591 #[cfg_attr(feature = "schema", returns(PagedGatewayResponse))]
594 GetGateways {
595 start_after: Option<IdentityKey>,
597
598 limit: Option<u32>,
600 },
601
602 #[cfg_attr(feature = "schema", returns(GatewayBondResponse))]
604 GetGatewayBond {
605 identity: IdentityKey,
607 },
608
609 #[cfg_attr(feature = "schema", returns(GatewayOwnershipResponse))]
611 GetOwnedGateway {
612 address: String,
614 },
615
616 #[cfg_attr(feature = "schema", returns(PreassignedGatewayIdsResponse))]
618 GetPreassignedGatewayIds {
619 start_after: Option<IdentityKey>,
621
622 limit: Option<u32>,
624 },
625
626 #[cfg_attr(feature = "schema", returns(PagedNymNodeBondsResponse))]
629 GetNymNodeBondsPaged {
630 limit: Option<u32>,
632
633 start_after: Option<NodeId>,
635 },
636
637 #[cfg_attr(feature = "schema", returns(PagedNymNodeDetailsResponse))]
639 GetNymNodesDetailedPaged {
640 limit: Option<u32>,
642
643 start_after: Option<NodeId>,
645 },
646
647 #[cfg_attr(feature = "schema", returns(UnbondedNodeResponse))]
649 GetUnbondedNymNode {
650 node_id: NodeId,
652 },
653
654 #[cfg_attr(feature = "schema", returns(PagedUnbondedNymNodesResponse))]
656 GetUnbondedNymNodesPaged {
657 limit: Option<u32>,
659
660 start_after: Option<NodeId>,
662 },
663
664 #[cfg_attr(feature = "schema", returns(PagedUnbondedNymNodesResponse))]
666 GetUnbondedNymNodesByOwnerPaged {
667 owner: String,
669
670 limit: Option<u32>,
672
673 start_after: Option<NodeId>,
675 },
676
677 #[cfg_attr(feature = "schema", returns(PagedUnbondedNymNodesResponse))]
679 GetUnbondedNymNodesByIdentityKeyPaged {
680 identity_key: IdentityKey,
682
683 limit: Option<u32>,
685
686 start_after: Option<NodeId>,
688 },
689
690 #[cfg_attr(feature = "schema", returns(NodeOwnershipResponse))]
692 GetOwnedNymNode {
693 address: String,
695 },
696
697 #[cfg_attr(feature = "schema", returns(NodeDetailsResponse))]
699 GetNymNodeDetails {
700 node_id: NodeId,
702 },
703
704 #[cfg_attr(feature = "schema", returns(NodeDetailsByIdentityResponse))]
706 GetNymNodeDetailsByIdentityKey {
707 node_identity: IdentityKey,
709 },
710
711 #[cfg_attr(feature = "schema", returns(NodeRewardingDetailsResponse))]
713 GetNodeRewardingDetails {
714 node_id: NodeId,
716 },
717
718 #[cfg_attr(feature = "schema", returns(StakeSaturationResponse))]
720 GetNodeStakeSaturation {
721 node_id: NodeId,
723 },
724
725 #[cfg_attr(feature = "schema", returns(EpochAssignmentResponse))]
726 GetRoleAssignment { role: Role },
727
728 #[cfg_attr(feature = "schema", returns(RolesMetadataResponse))]
729 GetRewardedSetMetadata {},
730
731 #[cfg_attr(feature = "schema", returns(PagedNodeDelegationsResponse))]
734 #[serde(alias = "GetMixnodeDelegations", alias = "get_mixnode_delegations")]
735 GetNodeDelegations {
736 #[serde(alias = "mix_id")]
738 node_id: NodeId,
739
740 start_after: Option<OwnerProxySubKey>,
742
743 limit: Option<u32>,
745 },
746
747 #[cfg_attr(feature = "schema", returns(PagedDelegatorDelegationsResponse))]
749 GetDelegatorDelegations {
750 delegator: String,
754
755 start_after: Option<(NodeId, OwnerProxySubKey)>,
757
758 limit: Option<u32>,
760 },
761
762 #[cfg_attr(feature = "schema", returns(NodeDelegationResponse))]
764 GetDelegationDetails {
765 #[serde(alias = "mix_id")]
767 node_id: NodeId,
768
769 delegator: String,
771
772 proxy: Option<String>,
775 },
776
777 #[cfg_attr(feature = "schema", returns(PagedAllDelegationsResponse))]
779 GetAllDelegations {
780 start_after: Option<delegation::StorageKey>,
782
783 limit: Option<u32>,
785 },
786
787 #[cfg_attr(feature = "schema", returns(PendingRewardResponse))]
790 GetPendingOperatorReward {
791 address: String,
793 },
794
795 #[cfg_attr(feature = "schema", returns(PendingRewardResponse))]
797 #[serde(
798 alias = "GetPendingMixNodeOperatorReward",
799 alias = "get_pending_mix_node_operator_reward"
800 )]
801 GetPendingNodeOperatorReward {
802 #[serde(alias = "mix_id")]
804 node_id: NodeId,
805 },
806
807 #[cfg_attr(feature = "schema", returns(PendingRewardResponse))]
809 GetPendingDelegatorReward {
810 address: String,
812
813 #[serde(alias = "mix_id")]
815 node_id: NodeId,
816
817 proxy: Option<String>,
820 },
821
822 #[cfg_attr(feature = "schema", returns(EstimatedCurrentEpochRewardResponse))]
824 GetEstimatedCurrentEpochOperatorReward {
825 #[serde(alias = "mix_id")]
827 node_id: NodeId,
828
829 estimated_performance: Performance,
831
832 estimated_work: Option<WorkFactor>,
834 },
835
836 #[cfg_attr(feature = "schema", returns(EstimatedCurrentEpochRewardResponse))]
838 GetEstimatedCurrentEpochDelegatorReward {
839 address: String,
841
842 #[serde(alias = "mix_id")]
844 node_id: NodeId,
845
846 estimated_performance: Performance,
848
849 estimated_work: Option<WorkFactor>,
851 },
852
853 #[cfg_attr(feature = "schema", returns(PendingEpochEventsResponse))]
856 GetPendingEpochEvents {
857 limit: Option<u32>,
859
860 start_after: Option<u32>,
862 },
863
864 #[cfg_attr(feature = "schema", returns(PendingIntervalEventsResponse))]
866 GetPendingIntervalEvents {
867 limit: Option<u32>,
869
870 start_after: Option<u32>,
872 },
873
874 #[cfg_attr(feature = "schema", returns(PendingEpochEventResponse))]
876 GetPendingEpochEvent {
877 event_id: EpochEventId,
879 },
880
881 #[cfg_attr(feature = "schema", returns(PendingIntervalEventResponse))]
883 GetPendingIntervalEvent {
884 event_id: IntervalEventId,
886 },
887
888 #[cfg_attr(feature = "schema", returns(NumberOfPendingEventsResponse))]
890 GetNumberOfPendingEvents {},
891
892 #[cfg_attr(feature = "schema", returns(Nonce))]
895 GetSigningNonce {
896 address: String,
898 },
899
900 #[cfg_attr(feature = "schema", returns(KeyRotationState))]
902 GetKeyRotationState {},
904
905 #[cfg_attr(feature = "schema", returns(KeyRotationIdResponse))]
907 GetKeyRotationId {},
908}
909
910#[cw_serde]
911pub struct VestedDelegationMigrationEntry {
912 pub mix_id: NodeId,
913 pub owner: String,
914}
915
916#[cw_serde]
917pub struct MigrateMsg {
918 pub unsafe_skip_state_updates: Option<bool>,
919 pub vesting_contract_address: Option<String>,
920 pub node_families_contract_address: String,
921}