Struct cw_controllers::Claims

source ·
pub struct Claims<'a>(_);

Implementations§

source§

impl<'a> Claims<'a>

source

pub const fn new(storage_key: &'a str) -> 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<'a> RefUnwindSafe for Claims<'a>

§

impl<'a> Send for Claims<'a>

§

impl<'a> Sync for Claims<'a>

§

impl<'a> Unpin for Claims<'a>

§

impl<'a> UnwindSafe for Claims<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.