Cw20

Struct Cw20 

Source
pub struct Cw20<Chain: BootEnvironment>(/* private fields */);

Implementations§

Source§

impl<Chain: BootEnvironment> Cw20<Chain>

Source

pub fn new(id: &str, chain: Chain) -> Self

Source

pub fn send( &self, msg: &impl Serialize, amount: u128, contract: String, ) -> Result<TxResponse<Chain>, BootError>

Source

pub fn transfer( &self, amount: u128, recipient: String, ) -> Result<TxResponse<Chain>, BootError>

Source

pub fn create_new<T: Into<Uint128>>( &self, minter: &Addr, balance: T, ) -> Result<TxResponse<Chain>, BootError>

Source

pub fn balance(&self, address: &Addr) -> Result<u128, BootError>

Source

pub fn mint( &self, recipient: impl Into<String>, amount: u128, ) -> Result<TxResponse<Chain>, BootError>

Source

pub fn increase_allowance( &self, spender: impl Into<String>, amount: u128, expires: Option<Expiration>, ) -> Result<TxResponse<Chain>, BootError>

Trait Implementations§

Source§

impl<Chain: Clone + BootEnvironment> Clone for Cw20<Chain>

Source§

fn clone(&self) -> Cw20<Chain>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Chain: BootEnvironment> ContractInstance<Chain> for Cw20<Chain>

Source§

fn as_instance(&self) -> &Contract<Chain>

Source§

fn as_instance_mut(&mut self) -> &mut Contract<Chain>

Source§

fn id(&self) -> String

Source§

fn address(&self) -> Result<Addr, BootError>

Source§

fn addr_str(&self) -> Result<String, BootError>

Source§

fn code_id(&self) -> Result<u64, BootError>

Source§

fn set_address(&self, address: &Addr)

Source§

fn set_code_id(&self, code_id: u64)

Source§

fn get_chain(&self) -> &Chain

Source§

impl<Chain: BootEnvironment> CwInterface for Cw20<Chain>

Auto Trait Implementations§

§

impl<Chain> Freeze for Cw20<Chain>
where Chain: Freeze,

§

impl<Chain> !RefUnwindSafe for Cw20<Chain>

§

impl<Chain> !Send for Cw20<Chain>

§

impl<Chain> !Sync for Cw20<Chain>

§

impl<Chain> Unpin for Cw20<Chain>
where Chain: Unpin,

§

impl<Chain> !UnwindSafe for Cw20<Chain>

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, Chain> BootExecute<Chain> for T
where T: CwInterface + ContractInstance<Chain>, Chain: BootEnvironment,

Source§

type ExecuteMsg = <T as CwInterface>::ExecuteMsg

Source§

fn execute( &self, execute_msg: &<T as BootExecute<Chain>>::ExecuteMsg, coins: Option<&[Coin]>, ) -> Result<<Chain as TxHandler>::Response, BootError>

Source§

impl<T, Chain> BootInstantiate<Chain> for T
where T: CwInterface + ContractInstance<Chain>, Chain: BootEnvironment,

Source§

type InstantiateMsg = <T as CwInterface>::InstantiateMsg

Source§

fn instantiate( &self, instantiate_msg: &<T as BootInstantiate<Chain>>::InstantiateMsg, admin: Option<&Addr>, coins: Option<&[Coin]>, ) -> Result<<Chain as TxHandler>::Response, BootError>

Source§

impl<T, Chain> BootMigrate<Chain> for T
where T: CwInterface + ContractInstance<Chain>, Chain: BootEnvironment,

Source§

type MigrateMsg = <T as CwInterface>::MigrateMsg

Source§

fn migrate( &self, migrate_msg: &<T as BootMigrate<Chain>>::MigrateMsg, new_code_id: u64, ) -> Result<<Chain as TxHandler>::Response, BootError>

Source§

impl<T, Chain> BootQuery<Chain> for T
where T: CwInterface + ContractInstance<Chain>, Chain: BootEnvironment,

Source§

type QueryMsg = <T as CwInterface>::QueryMsg

Source§

fn query<G>( &self, query_msg: &<T as BootQuery<Chain>>::QueryMsg, ) -> Result<G, BootError>

Source§

impl<T, Chain> BootUpload<Chain> for T
where T: ContractInstance<Chain>, Chain: BootEnvironment,

Source§

fn upload(&mut self) -> Result<<Chain as TxHandler>::Response, BootError>

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> CallAs for T

Source§

fn call_as(&self, sender: &Addr) -> Self

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.