// Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 use crate::StateParams; use crate::{Gateway, IdentityKey, MixNode}; use cosmwasm_std::Addr; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct InstantiateMsg {} #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] #[serde(rename_all = "snake_case")] pub enum ExecuteMsg { BondMixnode { mix_node: MixNode, }, UnbondMixnode {}, BondGateway { gateway: Gateway, }, UnbondGateway {}, UpdateStateParams(StateParams), DelegateToMixnode { mix_identity: IdentityKey, }, UndelegateFromMixnode { mix_identity: IdentityKey, }, DelegateToGateway { gateway_identity: IdentityKey, }, UndelegateFromGateway { gateway_identity: IdentityKey, }, RewardMixnode { identity: IdentityKey, // percentage value in range 0-100 uptime: u32, }, RewardGateway { identity: IdentityKey, // percentage value in range 0-100 uptime: u32, }, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] #[serde(rename_all = "snake_case")] pub enum QueryMsg { GetMixNodes { limit: Option, start_after: Option, }, GetGateways { start_after: Option, limit: Option, }, OwnsMixnode { address: Addr, }, OwnsGateway { address: Addr, }, StateParams {}, GetMixDelegations { mix_identity: IdentityKey, start_after: Option, limit: Option, }, GetAllMixDelegations { start_after: Option>, limit: Option, }, GetReverseMixDelegations { delegation_owner: Addr, start_after: Option, limit: Option, }, GetMixDelegation { mix_identity: IdentityKey, address: Addr, }, GetGatewayDelegations { gateway_identity: IdentityKey, start_after: Option, limit: Option, }, GetAllGatewayDelegations { start_after: Option>, limit: Option, }, GetReverseGatewayDelegations { delegation_owner: Addr, start_after: Option, limit: Option, }, GetGatewayDelegation { gateway_identity: IdentityKey, address: Addr, }, LayerDistribution {}, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct MigrateMsg {}