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
//!    Bindings for message execution on Kujira Core

use cosmwasm_schema::cw_serde;
use cosmwasm_std::{Addr, Coin, CosmosMsg, CustomMsg, Timestamp, Uint128};

use crate::{denom::Denom, ica::IcaMsg};

#[cw_serde]
pub enum KujiraMsg {
    Auth(AuthMsg),
    Batch(BatchMsg),
    Denom(DenomMsg),
    Ica(IcaMsg),
}

impl CustomMsg for KujiraMsg {}

impl From<KujiraMsg> for CosmosMsg<KujiraMsg> {
    fn from(msg: KujiraMsg) -> Self {
        CosmosMsg::Custom(msg)
    }
}

#[cw_serde]
pub enum AuthMsg {
    CreateVestingAccount {
        to_address: Addr,
        amount: Vec<Coin>,
        end_time: Option<Timestamp>,
        delayed: Option<bool>,
    },
}

impl From<AuthMsg> for CosmosMsg<KujiraMsg> {
    fn from(msg: AuthMsg) -> Self {
        KujiraMsg::Auth(msg).into()
    }
}

#[cw_serde]
pub enum BatchMsg {
    WithdrawAllDelegatorRewards {},
}

#[cw_serde]
pub enum DenomMsg {
    Create {
        subdenom: Denom,
    },
    ChangeAdmin {
        denom: Denom,
        address: Addr,
    },
    Mint {
        denom: Denom,
        amount: Uint128,
        recipient: Addr,
    },
    Burn {
        denom: Denom,
        amount: Uint128,
    },
}

impl From<DenomMsg> for CosmosMsg<KujiraMsg> {
    fn from(msg: DenomMsg) -> Self {
        KujiraMsg::Denom(msg).into()
    }
}