1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use cosmwasm_std::Uint128;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use super::handle_msg::NetworkSettings;

#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub owner: Option<String>,
    pub bulk_distributor_settings: BulkSettings,
    pub dx_token_settings: DxTokenSettings,
    pub network_settings: NetworkSettings,
    pub validators: Vec<ValidatorSetting>,
    pub external_source_operator: Option<String>, // multisign wallet on source chain that will do the cross chain operations
}

#[derive(Serialize, Deserialize, Eq, PartialEq, Debug, Clone, JsonSchema)]
pub struct BulkSettings {
    pub existing_address: Option<String>,
    pub code_id: Option<u64>,
    pub distribute_rewards_over: u64,
}

#[derive(Serialize, Deserialize, Eq, PartialEq, Debug, Clone, JsonSchema)]
pub struct DxTokenSettings {
    pub existing_address: Option<String>,
    pub create_token: Option<CreateDxTokenSettings>,
}

#[derive(Serialize, Deserialize, Eq, PartialEq, Debug, Clone, JsonSchema)]
pub struct CreateDxTokenSettings {
    pub code_id: u64,
    pub name: String,
    pub symbol: String,
    pub label: String,
    pub decimals: u8,
}

#[derive(Serialize, Deserialize, Eq, PartialEq, Debug, Clone, JsonSchema)]
pub struct ValidatorSetting {
    pub address: String,
    pub per: Uint128, // with precision of 10000 <=> 100% && 10 <=> 0.1%
}