vectis_wallet/interface/
plugins.rs

1use cosmwasm_std::{CosmosMsg, Response, StdError};
2use cw2::ContractVersion;
3use sylvia::types::{ExecCtx, QueryCtx};
4use sylvia::{interface, schemars};
5
6pub mod pre_tx_check_trait {
7    use super::*;
8
9    /// The trait for each authenticator contract
10    #[interface]
11    pub trait PreTxCheckTrait {
12        type Error: From<StdError>;
13
14        #[msg(query)]
15        fn pre_tx_check(&self, ctx: QueryCtx, msgs: Vec<CosmosMsg>) -> Result<bool, Self::Error>;
16
17        #[msg(query)]
18        fn contract_version(&self, ctx: QueryCtx) -> Result<ContractVersion, StdError>;
19    }
20}
21
22pub mod post_tx_hook_trait {
23    use super::*;
24
25    /// The trait for each authenticator contract
26    #[interface]
27    pub trait PostTxHookTrait {
28        type Error: From<StdError>;
29
30        #[msg(exec)]
31        fn post_tx_hook(&self, ctx: ExecCtx, msgs: Vec<CosmosMsg>)
32            -> Result<Response, Self::Error>;
33
34        #[msg(query)]
35        fn contract_version(&self, ctx: QueryCtx) -> Result<ContractVersion, StdError>;
36    }
37}