Macro cosmwasm_schema::generate_api
source · generate_api!() { /* proc-macro */ }
Expand description
Generates an Api
for the contract. The body describes the message
types exported in the schema and allows setting contract name and version overrides.
The only obligatory field is instantiate
- to set the InstantiateMsg type.
Available fields
See write_api
.
Example
use cosmwasm_schema::{cw_serde, generate_api};
#[cw_serde]
struct InstantiateMsg;
#[cw_serde]
struct MigrateMsg;
let api = generate_api! {
name: "cw20",
instantiate: InstantiateMsg,
migrate: MigrateMsg,
}.render();