#controller #callback #derive #macro #interface #enums #cw-ica-controller

macro cw-ica-controller-derive

This crate contains macros for deriving cw-ica-controller interfaces

2 releases

0.4.2 Jan 28, 2024
0.4.1 Jan 27, 2024

#100 in #callback

Download history 31/week @ 2024-06-25 10/week @ 2024-07-02 36/week @ 2024-07-09 244/week @ 2024-07-16 142/week @ 2024-07-23 119/week @ 2024-07-30 187/week @ 2024-08-06 202/week @ 2024-08-13 34/week @ 2024-08-20 57/week @ 2024-08-27 181/week @ 2024-09-03 42/week @ 2024-09-10 38/week @ 2024-09-17 111/week @ 2024-09-24 192/week @ 2024-10-01 294/week @ 2024-10-08

639 downloads per month
Used in cw-ica-controller

Apache-2.0

7KB

cw-ica-controller-derive - ICA Controller Derive

This crate provides a derive macro for contracts receiving ICA controller callback messages. This crate's macros are not intended to be used directly, but rather as a dependency of the cw-ica-controller crate where it is re-exported under the cw_ica_controller::helpers.

This allows the users of the cw-ica-controller crate to easily merge the required callback message enum variant into their ExecuteMsg enum.

Usage

I will show the usage of this crate (from the cw-ica-controller crate) in testing/contracts/callback-counter/src/msg.rs.

use cosmwasm_schema::{cw_serde, QueryResponses};
use cw_ica_controller::helpers::ica_callback_execute;

#[cw_serde]
pub struct InstantiateMsg {}

#[ica_callback_execute]
#[cw_serde]
pub enum ExecuteMsg {}

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    /// GetCallbackCounter returns the callback counter.
    #[returns(crate::state::CallbackCounter)]
    GetCallbackCounter {},
}

Dependencies

~1.5MB
~36K SLoC