abstract_ica/
action.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
use cosmwasm_std::{Binary, Coin, CosmosMsg};

/// Interchain Account Action
#[cosmwasm_schema::cw_serde]
#[non_exhaustive]
pub enum IcaAction {
    // Execute on the ICA
    Execute(IcaExecute),
    // Query on the ICA
    // Query(IcaQuery),
    // Send funds to the ICA
    Fund {
        funds: Vec<Coin>,
        // Optional receiver address
        // Should be formatted in expected formatting
        // EVM: HexBinary
        // Cosmos: Addr
        receiver: Option<Binary>,
        memo: Option<String>,
    },
    // ... other actions?
}

#[cosmwasm_schema::cw_serde]
#[non_exhaustive]
pub enum IcaExecute {
    Evm {
        msgs: Vec<polytone_evm::evm::EvmMsg<String>>,
        callback: Option<polytone_evm::callbacks::CallbackRequest>,
    },
    // Cosmos {
    //     msgs: Vec<CosmosMsg>,
    //     callback: Option<CallbackRequest>,
    // },
}

// pub enum IcaQuery {
// 	Evm {
// 		// encoded data
// 		// ...
// 	},
// 	Cosmos {
// 	    // Encoded data
// 		// ...
// 	}
// }

#[cosmwasm_schema::cw_serde]
pub struct IcaActionResponse {
    /// messages that call the underlying implementations (be it polytone/cw-ica-controller/etc)
    pub msgs: Vec<CosmosMsg>,
}