Struct soroban_contracts::token::TokenClient
source · pub struct TokenClient {
pub env: Env,
pub contract_id: BytesN<{ _ }>,
}Fields§
§env: Env§contract_id: BytesN<{ _ }>Implementations§
source§impl Client
impl Client
pub fn new(env: &Env, contract_id: &impl IntoVal<Env, BytesN<{ _ }>>) -> Self
pub fn initialize( &self, admin: &Address, decimal: &u32, name: &Bytes, symbol: &Bytes )
pub fn try_initialize( &self, admin: &Address, decimal: &u32, name: &Bytes, symbol: &Bytes ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn clawback(&self, admin: &Address, from: &Address, amount: &i128)
pub fn try_clawback( &self, admin: &Address, from: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn mint(&self, admin: &Address, to: &Address, amount: &i128)
pub fn try_mint( &self, admin: &Address, to: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn set_admin(&self, admin: &Address, new_admin: &Address)
pub fn try_set_admin( &self, admin: &Address, new_admin: &Address ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn set_auth(&self, admin: &Address, id: &Address, authorize: &bool)
pub fn try_set_auth( &self, admin: &Address, id: &Address, authorize: &bool ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn incr_allow(&self, from: &Address, spender: &Address, amount: &i128)
pub fn try_incr_allow( &self, from: &Address, spender: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn decr_allow(&self, from: &Address, spender: &Address, amount: &i128)
pub fn try_decr_allow( &self, from: &Address, spender: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn xfer(&self, from: &Address, to: &Address, amount: &i128)
pub fn try_xfer( &self, from: &Address, to: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn xfer_from( &self, spender: &Address, from: &Address, to: &Address, amount: &i128 )
pub fn try_xfer_from( &self, spender: &Address, from: &Address, to: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn burn(&self, from: &Address, amount: &i128)
pub fn try_burn( &self, from: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn burn_from(&self, spender: &Address, from: &Address, amount: &i128)
pub fn try_burn_from( &self, spender: &Address, from: &Address, amount: &i128 ) -> Result<Result<(), <() as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn balance(&self, id: &Address) -> i128
pub fn try_balance( &self, id: &Address ) -> Result<Result<i128, <i128 as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn spendable(&self, id: &Address) -> i128
pub fn try_spendable( &self, id: &Address ) -> Result<Result<i128, <i128 as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn allowance(&self, from: &Address, spender: &Address) -> i128
pub fn try_allowance( &self, from: &Address, spender: &Address ) -> Result<Result<i128, <i128 as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn decimals(&self) -> u32
pub fn try_decimals( &self ) -> Result<Result<u32, <u32 as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn name(&self) -> Bytes
pub fn try_name( &self ) -> Result<Result<Bytes, <Bytes as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
pub fn symbol(&self) -> Bytes
pub fn try_symbol( &self ) -> Result<Result<Bytes, <Bytes as TryFromVal<Env, RawVal>>::Error>, Result<Status, <Status as TryFrom<Status>>::Error>>
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
§impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere
C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
impl<T, U, V, E, C> Compare<(T, U, V)> for Cwhere C: Compare<T, Error = E, Error = E, Error = E> + Compare<U> + Compare<V>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.