pub struct WrappedNativeTokenHostRef { /* private fields */ }Expand description
WrappedNativeToken Host Ref.
Implementations§
source§impl WrappedNativeTokenHostRef
impl WrappedNativeTokenHostRef
sourcepub fn allowance(&self, owner: &Address, spender: &Address) -> U256
pub fn allowance(&self, owner: &Address, spender: &Address) -> U256
Sets the allowance for spender to spend amount of the caller’s tokens.
sourcepub fn balance_of(&self, address: &Address) -> U256
pub fn balance_of(&self, address: &Address) -> U256
Returns the balance of address.
sourcepub fn total_supply(&self) -> U256
pub fn total_supply(&self) -> U256
Returns the total supply of the token.
sourcepub fn approve(&mut self, spender: &Address, amount: &U256)
pub fn approve(&mut self, spender: &Address, amount: &U256)
Approves spender to spend amount of the caller’s tokens.
sourcepub fn transfer_from(
&mut self,
owner: &Address,
recipient: &Address,
amount: &U256,
)
pub fn transfer_from( &mut self, owner: &Address, recipient: &Address, amount: &U256, )
Transfers amount of the owners tokens to recipient using allowance.
source§impl WrappedNativeTokenHostRef
impl WrappedNativeTokenHostRef
sourcepub fn try_init(&mut self) -> OdraResult<()>
pub fn try_init(&mut self) -> OdraResult<()>
Initializes the contract with the metadata.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_deposit(&mut self) -> OdraResult<()>
pub fn try_deposit(&mut self) -> OdraResult<()>
Deposits native tokens into the contract.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_withdraw(&mut self, amount: &U256) -> OdraResult<()>
pub fn try_withdraw(&mut self, amount: &U256) -> OdraResult<()>
Withdraws native tokens from the contract.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_allowance(
&self,
owner: &Address,
spender: &Address,
) -> OdraResult<U256>
pub fn try_allowance( &self, owner: &Address, spender: &Address, ) -> OdraResult<U256>
Sets the allowance for spender to spend amount of the caller’s tokens.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_balance_of(&self, address: &Address) -> OdraResult<U256>
pub fn try_balance_of(&self, address: &Address) -> OdraResult<U256>
Returns the balance of address.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_total_supply(&self) -> OdraResult<U256>
pub fn try_total_supply(&self) -> OdraResult<U256>
Returns the total supply of the token.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_decimals(&self) -> OdraResult<u8>
pub fn try_decimals(&self) -> OdraResult<u8>
Returns the number of decimals used by the token.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_symbol(&self) -> OdraResult<String>
pub fn try_symbol(&self) -> OdraResult<String>
Returns the symbol of the token.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_name(&self) -> OdraResult<String>
pub fn try_name(&self) -> OdraResult<String>
Returns the name of the token.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_approve(
&mut self,
spender: &Address,
amount: &U256,
) -> OdraResult<()>
pub fn try_approve( &mut self, spender: &Address, amount: &U256, ) -> OdraResult<()>
Approves spender to spend amount of the caller’s tokens.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_transfer_from(
&mut self,
owner: &Address,
recipient: &Address,
amount: &U256,
) -> OdraResult<()>
pub fn try_transfer_from( &mut self, owner: &Address, recipient: &Address, amount: &U256, ) -> OdraResult<()>
Transfers amount of the owners tokens to recipient using allowance.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_transfer(
&mut self,
recipient: &Address,
amount: &U256,
) -> OdraResult<()>
pub fn try_transfer( &mut self, recipient: &Address, amount: &U256, ) -> OdraResult<()>
Transfers amount of the caller’s tokens to recipient.
Does not fail in case of error, returns odra::OdraResult instead.