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,
}
cw-cyber/contracts/cw-cyber-gift/src/msg.rs
ฯ 0.0%
use JsonSchema;
use ;
use ;
use Expiration;
use CyberMsg;