#[non_exhaustive]pub enum WasmMsg {
Execute {
contract_addr: String,
msg: Binary,
funds: Vec<Coin>,
},
Instantiate {
admin: Option<String>,
code_id: u64,
msg: Binary,
funds: Vec<Coin>,
label: String,
},
Instantiate2 {
admin: Option<String>,
code_id: u64,
label: String,
msg: Binary,
funds: Vec<Coin>,
salt: Binary,
},
Migrate {
contract_addr: String,
new_code_id: u64,
msg: Binary,
},
UpdateAdmin {
contract_addr: String,
admin: String,
},
ClearAdmin {
contract_addr: String,
},
}
Expand description
The message types of the wasm module.
See https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Execute
Dispatches a call to another contract at a known address (with known ABI).
This is translated to a MsgExecuteContract.
sender
is automatically filled with the current contract’s address.
Fields
Instantiate
Instantiates a new contracts from previously uploaded Wasm code.
The contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2.
This is translated to a MsgInstantiateContract.
sender
is automatically filled with the current contract’s address.
Fields
Instantiate2
Instantiates a new contracts from previously uploaded Wasm code
using a predictable address derivation algorithm implemented in
[cosmwasm_std::instantiate2_address
].
This is translated to a MsgInstantiateContract2.
sender
is automatically filled with the current contract’s address.
fix_msg
is automatically set to false.
Fields
Migrate
Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.
Only the contract admin (as defined in wasmd), if any, is able to make this call.
This is translated to a MsgMigrateContract.
sender
is automatically filled with the current contract’s address.
Fields
UpdateAdmin
Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.
ClearAdmin
Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WasmMsg
impl<'de> Deserialize<'de> for WasmMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for WasmMsg
impl JsonSchema for WasmMsg
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreimpl Eq for WasmMsg
impl StructuralPartialEq for WasmMsg
Auto Trait Implementations§
impl Freeze for WasmMsg
impl RefUnwindSafe for WasmMsg
impl Send for WasmMsg
impl Sync for WasmMsg
impl Unpin for WasmMsg
impl UnwindSafe for WasmMsg
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more