Struct cw_controllers::Claims

source ·
pub struct Claims(/* private fields */);

Implementations§

source§

impl Claims

source

pub const fn new(storage_key: &'static str) -> Self

source

pub fn new_dyn(storage_key: impl Into<Namespace>) -> Self

source

pub fn create_claim( &self, storage: &mut dyn Storage, addr: &Addr, amount: Uint128, release_at: Expiration ) -> StdResult<()>

This creates a claim, such that the given address can claim an amount of tokens after the release date.

source

pub fn claim_tokens( &self, storage: &mut dyn Storage, addr: &Addr, block: &BlockInfo, cap: Option<Uint128> ) -> StdResult<Uint128>

This iterates over all mature claims for the address, and removes them, up to an optional cap. it removes the finished claims and returns the total amount of tokens to be released.

source

pub fn query_claims<Q: CustomQuery>( &self, deps: Deps<'_, Q>, address: &Addr ) -> StdResult<ClaimsResponse>

Auto Trait Implementations§

§

impl Freeze for Claims

§

impl RefUnwindSafe for Claims

§

impl Send for Claims

§

impl Sync for Claims

§

impl Unpin for Claims

§

impl UnwindSafe for Claims

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<U> As for U

source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.