-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsg.rs
128 lines (99 loc) · 2.41 KB
/
msg.rs
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
use cosmwasm_schema::cw_serde;
use cosmwasm_std::Coin;
use secret_toolkit::permit::Permit;
use crate::state::{NetworkConfig, Powerup, AppStatus, Config};
#[cw_serde]
pub struct InstantiateMsg {
pub field_size: Option<u8>,
pub cell_cooldown: Option<u64>,
pub user_cooldown: Option<u64>,
pub win_threshold: Option<u16>,
pub network_configs: Vec<(String, NetworkConfig)>
}
#[cw_serde]
pub enum ExecuteMsg {
OpenCell {
cell_id: u8,
permit: Permit,
powerups: Vec<Powerup>,
power_up_autopay: Option<bool>
},
BuyPowerups {
powerups: Vec<Powerup>,
permit: Permit,
},
RedeemReward {
permit: Permit,
},
SetAppStatus {
status: AppStatus,
},
ForwardsFunds {
to_address: String,
amount: Vec<Coin>,
}
}
#[cw_serde]
pub enum IBCLifecycleComplete {
#[serde(rename = "ibc_ack")]
IBCAck {
/// The source channel (secret side) of the IBC packet
channel: String,
/// The sequence number that the packet was sent with
sequence: u64,
/// String encoded version of the ack as seen by OnAcknowledgementPacket(..)
ack: String,
/// Weather an ack is a success of failure according to the transfer spec
success: bool,
},
#[serde(rename = "ibc_timeout")]
IBCTimeout {
/// The source channel (secret side) of the IBC packet
channel: String,
/// The sequence number that the packet was sent with
sequence: u64,
},
}
#[cw_serde]
pub enum QueryMsg {
GetField {},
GetMyPowerups {
permit: Permit
},
AllNetworkConfigs {},
NetworkConfig {
denom: String
},
Main {
permit: Option<Permit>
},
Config {}
}
#[cw_serde]
pub enum SudoMsg {
#[serde(rename = "ibc_lifecycle_complete")]
IBCLifecycleComplete(IBCLifecycleComplete),
}
#[cw_serde]
pub struct TransferIBCRewardsMsg {
pub channel: String,
pub remote_address: String,
pub timeout: u64,
}
#[cw_serde]
pub struct OpenCellResponse {}
#[cw_serde]
pub struct CellResInfo {
pub open_at: u64,
}
#[cw_serde]
pub struct GetFieldResponse {
pub cells: Vec::<CellResInfo>
}
#[cw_serde]
pub struct MainPageResponse {
pub config: Config,
pub cells: Vec::<CellResInfo>,
pub powerups: Option<Vec::<(Powerup, u8)>>,
pub network_configs: Vec::<(String, NetworkConfig)>
}