use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use cosmwasm_std::{CosmosMsg, Decimal, Uint128, Uint64};
use cw_utils::Expiration;
use cyber_std::CyberMsg;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub owner: Option<String>,
    pub passport: String,
    pub treasury: String,
    pub allowed_native: String,
    pub initial_balance: Uint128,
    pub coefficient_up: Uint128,
    pub coefficient_down: Uint128,
    pub coefficient: Uint128,
    pub target_claim: Uint64,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    Execute {
        msgs: Vec<CosmosMsg<CyberMsg>>,
    },
    UpdateOwner {
        new_owner: Option<String>,
    },
    UpdateTreasuryAddr {
        new_treasury_addr: String,
    },
    UpdateTarget {
        new_target: Uint64,
    },
    UpdateCoefficients {
        new_coefficient_up: Uint128,
        new_coefficient_down: Uint128,
    },
    RegisterMerkleRoot {
        /// MerkleRoot is hex-encoded merkle root.
        merkle_root: String,
    },
    Claim {
        nickname: String,
        gift_claiming_address: String,
        gift_amount: Uint128,
        /// Proof is hex-encoded merkle proof.
        proof: Vec<String>,
    },
    Release {
        gift_address: String,
    },
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Config {},
    State {},
    MerkleRoot {},
    IsClaimed { address: String },
    Claim { address: String },
    ReleaseState { address: String },
    ReleaseStageState { stage: u8 },
    AllReleaseStageStates {},
}

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub struct ConfigResponse {
    pub owner: Option<String>,
    pub passport: String,
    pub target_claim: Uint64,
    pub allowed_native: String,
    pub initial_balance: Uint128,
    pub coefficient_up: Uint128,
    pub coefficient_down: Uint128,
}

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub struct StateResponse {
    pub current_balance: Uint128,
    pub coefficient: Decimal,
    pub claims: Uint64,
    pub releases: Uint64,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct MerkleRootResponse {
    /// MerkleRoot is hex-encoded merkle root.
    pub merkle_root: String,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct IsClaimedResponse {
    pub is_claimed: bool,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ClaimResponse {
    pub claim: Uint128,
    pub multiplier: Decimal,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ReleaseStateResponse {
    pub address: String,
    pub balance_claim: Uint128,
    pub stage: Uint64,
    pub stage_expiration: Expiration,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ReleaseStageStateResponse {
    pub releases: u32,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct AllReleaseStageStateResponse {
    pub releases: Vec<u32>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct SignatureResponse {
    pub signed: bool,
}

#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
#[serde(rename_all = "snake_case")]
pub struct AddressResponse {
    pub address: String,
}

Dimensions

cw-cyber/contracts/graph-filter/src/msg.rs
cw-cyber/contracts/std-test/src/msg.rs
cw-cyber/packages/cyber-std/src/msg.rs
cw-cyber/contracts/litium-stake/src/msg.rs
cw-cyber/contracts/hub-tokens/src/msg.rs
cw-cyber/contracts/hub-libs/src/msg.rs
cw-cyber/contracts/litium-refer/src/msg.rs
cw-cyber/contracts/litium-wrap/src/msg.rs
cw-cyber/contracts/hub-skills/src/msg.rs
cw-cyber/contracts/cw-cyber-passport/src/msg.rs
cw-cyber/contracts/litium-mine/src/msg.rs
cw-cyber/contracts/litium-core/src/msg.rs
cw-cyber/contracts/hub-protocols/src/msg.rs
cw-cyber/contracts/hub-networks/src/msg.rs
cw-cyber/contracts/cw-cyber-subgraph/src/msg.rs
cw-cyber/contracts/cybernet/src/msg.rs
cw-cyber/contracts/hub-channels/src/msg.rs
cw-cyber/packages/cyber-std/src/tokenfactory/msg.rs

Local Graph