pub struct FixedFee { /* private fields */ }
Expand description
A wrapper around Coin to help handle fixed fees (with multiples).
Implementations§
Source§impl FixedFee
impl FixedFee
Sourcepub fn quantity(self, qty: u128) -> Self
pub fn quantity(self, qty: u128) -> Self
Allows to collect the fee multiple times E.g., for namespaces, you want to charge the number of claimed namespaces times the fee for 1 namespace
Sourcepub fn assert_payment(self, msg_info: &MessageInfo) -> AbstractResult<Coin>
pub fn assert_payment(self, msg_info: &MessageInfo) -> AbstractResult<Coin>
Validates that the sent funds correspond exactly to the fixed fee Returns the fee object (a.k.a. self) for later use (e.g. transferring the paid fee to another address)
Sourcepub fn charge(self, msg_info: &mut MessageInfo) -> AbstractResult<Coin>
pub fn charge(self, msg_info: &mut MessageInfo) -> AbstractResult<Coin>
Validates that the sent funds include at least the fixed fee This mutates the msg_info so that the rest of the message execution doesn’t include those funds anymore. This acts as a toll on the sent funds Returns the fee object (a.k.a. self) for later use (e.g. transferring the paid fee to another address)
pub fn fee(&self) -> Coin
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FixedFee
impl<'de> Deserialize<'de> for FixedFee
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 FixedFee
impl JsonSchema for FixedFee
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(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &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 FixedFee
Auto Trait Implementations§
impl Freeze for FixedFee
impl RefUnwindSafe for FixedFee
impl Send for FixedFee
impl Sync for FixedFee
impl Unpin for FixedFee
impl UnwindSafe for FixedFee
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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