pub struct ActionFee {
pub action: String,
pub asset: String,
pub amount: Uint128,
pub receiver: Option<Addr>,
}
Fields§
§action: String
§asset: String
§amount: Uint128
§receiver: Option<Addr>
Implementations§
Source§impl ActionFee
impl ActionFee
pub fn new(action: String, asset: String, amount: Uint128) -> Self
pub fn with_receive(&self, receiver: Addr) -> Self
Sourcepub fn validate_asset(&self, api: &dyn Api) -> Result<(), ContractError>
pub fn validate_asset(&self, api: &dyn Api) -> Result<(), ContractError>
Valiades the provided asset for an action fee An asset is valid if it fits the format “cw20:address” or “native:denom” If the asset type is cw20 the address is also validated TODO: Add denom validation in future cosmwasm version
Sourcepub fn get_asset_string(&self) -> Result<&str, ContractError>
pub fn get_asset_string(&self) -> Result<&str, ContractError>
Gets the asset string without the asset type
i.e. cw20:address would return “address” or native:denom would return “denom”
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ActionFee
impl<'de> Deserialize<'de> for ActionFee
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for ActionFee
impl JsonSchema for ActionFee
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreimpl StructuralPartialEq for ActionFee
Auto Trait Implementations§
impl Freeze for ActionFee
impl RefUnwindSafe for ActionFee
impl Send for ActionFee
impl Sync for ActionFee
impl Unpin for ActionFee
impl UnwindSafe for ActionFee
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
Mutably borrows from an owned value. Read more