pub enum ArchwayMsg {
UpdateContractMetadata {
contract_address: Option<String>,
owner_address: Option<String>,
rewards_address: Option<String>,
},
SetFlatFee {
contract_address: String,
flat_fee_amount: Coin,
},
WithdrawRewards {
records_limit: Option<u64>,
record_ids: Vec<u64>,
},
}Expand description
Custom messages to interact with the Archway Network bindings.
Those messages work in conjunction with the cosmwasm_std::CosmosMsg::Custom variant.
§Examples
use cosmwasm_std::CosmosMsg;
use archway_bindings::ArchwayMsg;
let msg: CosmosMsg<ArchwayMsg> = CosmosMsg::Custom(
ArchwayMsg::UpdateContractMetadata {
contract_address: Some(String::from("contract_address")),
owner_address: Some(String::from("owner")),
rewards_address: Some(String::from("rewards")),
}
);Variants§
UpdateContractMetadata
Updates a contract’s metadata. Either owner_address or rewards_address must be provided.
Fields
SetFlatFee
Sets a premium fee for a contract. This action should be executed from a contract only if
it’s set as the owner_address in the metadata of contract_address. The tx will fail if
the contract_address has no metadata.
WithdrawRewards
Withdraws rewards from the contract. This action should be executed from a contract only if
it’s set as the rewards_address in a contract metadata. Only one of records_limit or
record_ids should be set.
§See also
Implementations§
Source§impl ArchwayMsg
impl ArchwayMsg
Sourcepub fn update_rewards_ownership(owner_address: impl Into<String>) -> Self
pub fn update_rewards_ownership(owner_address: impl Into<String>) -> Self
Creates an ArchwayMsg to update the current contract’s metadata ownership.
§Arguments
owner_address- The new owner address.
Sourcepub fn update_external_rewards_ownership(
contract_address: impl Into<String>,
owner_address: impl Into<String>,
) -> Self
pub fn update_external_rewards_ownership( contract_address: impl Into<String>, owner_address: impl Into<String>, ) -> Self
Creates an ArchwayMsg to update the ownership of an external contract metadata.
§Arguments
contract_address- The other contract address.owner_address- The new owner address.
Sourcepub fn update_rewards_address(rewards_address: impl Into<String>) -> Self
pub fn update_rewards_address(rewards_address: impl Into<String>) -> Self
Creates an ArchwayMsg to update the current contract’s rewards address.
§Arguments
rewards_address- The new rewards address.
Sourcepub fn update_external_rewards_address(
contract_address: impl Into<String>,
rewards_address: impl Into<String>,
) -> Self
pub fn update_external_rewards_address( contract_address: impl Into<String>, rewards_address: impl Into<String>, ) -> Self
Creates an ArchwayMsg to update the rewards address of an external contract metadata.
§Arguments
contract_address- The other contract address.rewards_address- The new rewards address.
Sourcepub fn set_flat_fee(contract_address: impl Into<String>, amount: Coin) -> Self
pub fn set_flat_fee(contract_address: impl Into<String>, amount: Coin) -> Self
Creates an ArchwayMsg to set a flat fee for a contract.
This action should be executed from a contract only if it’s set as the owner_address in
the metadata of contract_address. The tx will fail if the contract_address has no
metadata.
§Arguments
contract_address- The contract address.amount- The flat fee amount.
Sourcepub fn withdraw_max_rewards() -> Self
pub fn withdraw_max_rewards() -> Self
Creates an ArchwayMsg to withdraw all rewards from the contract up to the maximum limit
of records specified by the governance parameter rewards.MaxWithdrawRecords.
This action should be executed from a contract only if its set as the rewards_address in
a contract metadata.
Sourcepub fn withdraw_rewards_by_limit(limit: u64) -> Self
pub fn withdraw_rewards_by_limit(limit: u64) -> Self
Creates an ArchwayMsg to withdraw rewards from the contract.
This action should be executed from a contract only if its set as the rewards_address in
a contract metadata.
§Arguments
limit- Withdraw rewards up to a specified limit.
Sourcepub fn withdraw_rewards_by_ids(record_ids: Vec<u64>) -> Self
pub fn withdraw_rewards_by_ids(record_ids: Vec<u64>) -> Self
Creates an ArchwayMsg to withdraw rewards from the contract by a list of record IDs.
This action should be executed from a contract only if its set as the rewards_address in
a contract metadata.
§Arguments
record_ids- List of record IDs to withdraw rewards from the rewards pool.
Trait Implementations§
Source§impl Clone for ArchwayMsg
impl Clone for ArchwayMsg
Source§fn clone(&self) -> ArchwayMsg
fn clone(&self) -> ArchwayMsg
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArchwayMsg
impl Debug for ArchwayMsg
Source§impl<'de> Deserialize<'de> for ArchwayMsg
impl<'de> Deserialize<'de> for ArchwayMsg
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 From<ArchwayMsg> for CosmosMsg<ArchwayMsg>
impl From<ArchwayMsg> for CosmosMsg<ArchwayMsg>
Source§fn from(msg: ArchwayMsg) -> Self
fn from(msg: ArchwayMsg) -> Self
Source§impl JsonSchema for ArchwayMsg
impl JsonSchema for ArchwayMsg
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 more