Struct cw_controllers::Claims
source · pub struct Claims<'a>(_);
Implementations§
source§impl<'a> Claims<'a>
impl<'a> Claims<'a>
pub const fn new(storage_key: &'a str) -> Self
sourcepub fn create_claim(
&self,
storage: &mut dyn Storage,
addr: &Addr,
amount: Uint128,
release_at: Expiration
) -> StdResult<()>
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.
sourcepub fn claim_tokens(
&self,
storage: &mut dyn Storage,
addr: &Addr,
block: &BlockInfo,
cap: Option<Uint128>
) -> StdResult<Uint128>
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.