Macro cosmwasm_schema::write_api
source · write_api!() { /* proc-macro */ }
Expand description
Takes care of generating the interface description file for a contract. The body describes the message types included and allows setting contract name and version overrides.
The only obligatory field is instantiate
- to set the InstantiateMsg type.
Available fields
name
- contract name, crate name by defaultversion
- contract version, crate version by defaultinstantiate
- instantiate msg typequery
- query msg type, empty by defaultexecute
- execute msg type, empty by defaultmigrate
- migrate msg type, empty by defaultsudo
- sudo msg type, empty by default
Example
use cosmwasm_schema::{cw_serde, write_api};
#[cw_serde]
struct InstantiateMsg;
#[cw_serde]
struct MigrateMsg;
write_api! {
name: "cw20",
instantiate: InstantiateMsg,
migrate: MigrateMsg,
};