Trait wasm_deploy::contract::Contract
source · pub trait Contract: Send + Sync + Debug + Display + FromStr<Err = ParseError> + IntoEnumIterator + 'static {
// Required methods
fn name(&self) -> String;
fn admin(&self) -> String;
fn instantiate_msg(&self) -> Option<Box<dyn Msg>>;
// Provided methods
fn bin_name(&self) -> String { ... }
fn execute(&self) -> Result<Box<dyn Msg>> { ... }
fn query(&self) -> Result<Box<dyn Msg>> { ... }
fn cw20_send(&self) -> Result<Box<dyn Msg>> { ... }
fn external_instantiate_msgs(
&self
) -> Vec<ExternalInstantiate<Box<dyn Msg>>> { ... }
fn migrate_msg(&self) -> Option<Box<dyn Msg>> { ... }
fn set_config_msg(&self) -> Option<Box<dyn Msg>> { ... }
fn set_up_msgs(&self) -> Vec<Box<dyn Msg>> { ... }
fn path(&self) -> PathBuf { ... }
}Expand description
This trait represents a contract that can be deployed.
Required Methods§
sourcefn name(&self) -> String
fn name(&self) -> String
This is the name of the contract and represents how it will appear in the cli.
sourcefn admin(&self) -> String
fn admin(&self) -> String
This is the address of the contract admin. It is required when instantiating.
sourcefn instantiate_msg(&self) -> Option<Box<dyn Msg>>
fn instantiate_msg(&self) -> Option<Box<dyn Msg>>
This method gets the preprogrammed instantiate msg for the contract.
Provided Methods§
sourcefn bin_name(&self) -> String
fn bin_name(&self) -> String
This is the name of the generated binary. It defaults to the contract name. If you have multiple contracts that share the same code then you can use this, in conjunction with the path method.
sourcefn execute(&self) -> Result<Box<dyn Msg>>
fn execute(&self) -> Result<Box<dyn Msg>>
This method allows executing a contract. interactive-parse should be used to generate the msg.
sourcefn query(&self) -> Result<Box<dyn Msg>>
fn query(&self) -> Result<Box<dyn Msg>>
This method allows querying a contract. interactive-parse should be used to generate the msg.
sourcefn cw20_send(&self) -> Result<Box<dyn Msg>>
fn cw20_send(&self) -> Result<Box<dyn Msg>>
This method allows sending a cw20 token with an attached message to a contract. interactive-parse should be used to generate the msg.
sourcefn external_instantiate_msgs(&self) -> Vec<ExternalInstantiate<Box<dyn Msg>>>
fn external_instantiate_msgs(&self) -> Vec<ExternalInstantiate<Box<dyn Msg>>>
This method will instantiate an external contract via code_id alongside a local contract.
sourcefn migrate_msg(&self) -> Option<Box<dyn Msg>>
fn migrate_msg(&self) -> Option<Box<dyn Msg>>
This method gets the preprogrammed migrate msg for the contract.
sourcefn set_config_msg(&self) -> Option<Box<dyn Msg>>
fn set_config_msg(&self) -> Option<Box<dyn Msg>>
This method gets the preprogrammed set config msg for the contract.
sourcefn set_up_msgs(&self) -> Vec<Box<dyn Msg>>
fn set_up_msgs(&self) -> Vec<Box<dyn Msg>>
This method gets the preprogrammed set up for the contract.