[][src]Struct cw20::Cw20Contract

pub struct Cw20Contract(pub HumanAddr);

Cw20Contract is a wrapper around HumanAddr that provides a lot of helpers for working with this.

If you wish to persist this, convert to Cw20CanonicalContract via .canonical()

Implementations

impl Cw20Contract[src]

pub fn addr(&self) -> HumanAddr[src]

pub fn canonical<A: Api>(&self, api: &A) -> StdResult<Cw20CanonicalContract>[src]

Convert this address to a form fit for storage

pub fn call<T: Into<Cw20HandleMsg>>(&self, msg: T) -> StdResult<CosmosMsg>[src]

pub fn balance<Q: Querier>(
    &self,
    querier: &Q,
    address: HumanAddr
) -> StdResult<Uint128>
[src]

Get token balance for the given address

pub fn meta<Q: Querier>(&self, querier: &Q) -> StdResult<TokenInfoResponse>[src]

Get metadata from the contract. This is a good check that the address is a valid Cw20 contract.

pub fn allowance<Q: Querier>(
    &self,
    querier: &Q,
    owner: HumanAddr,
    spender: HumanAddr
) -> StdResult<AllowanceResponse>
[src]

Get allowance of spender to use owner's account

pub fn minter<Q: Querier>(
    &self,
    querier: &Q
) -> StdResult<Option<MinterResponse>>
[src]

Find info on who can mint, and how much

pub fn has_allowance<Q: Querier>(&self, querier: &Q) -> bool[src]

returns true if the contract supports the allowance extension

pub fn is_mintable<Q: Querier>(&self, querier: &Q) -> bool[src]

returns true if the contract supports the mintable extension

Trait Implementations

impl Clone for Cw20Contract[src]

impl Debug for Cw20Contract[src]

impl<'de> Deserialize<'de> for Cw20Contract[src]

impl JsonSchema for Cw20Contract[src]

impl PartialEq<Cw20Contract> for Cw20Contract[src]

impl Serialize for Cw20Contract[src]

impl StructuralPartialEq for Cw20Contract[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.