pub struct WrappedNativeTokenContractRef { /* private fields */ }Expand description
WrappedNativeToken Contract Ref.
Implementations§
Source§impl WrappedNativeTokenContractRef
impl WrappedNativeTokenContractRef
Sourcepub fn withdraw_to(&mut self, recipient: &Address, amount: &U256)
pub fn withdraw_to(&mut self, recipient: &Address, amount: &U256)
Withdraws native tokens from the contract to a specific recipient. This allows the caller to burn their wrapped tokens and send the native tokens directly to a different address, avoiding the need for intermediate transfers.
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.
Trait Implementations§
Source§impl ContractRef for WrappedNativeTokenContractRef
impl ContractRef for WrappedNativeTokenContractRef
Source§impl SchemaErrors for WrappedNativeTokenContractRef
Available on non-WebAssembly only.
impl SchemaErrors for WrappedNativeTokenContractRef
Available on non-WebAssembly only.
Source§impl SchemaEvents for WrappedNativeTokenContractRef
Available on non-WebAssembly only.
impl SchemaEvents for WrappedNativeTokenContractRef
Available on non-WebAssembly only.
Source§fn custom_types() -> Vec<Option<CustomType>>
fn custom_types() -> Vec<Option<CustomType>>
Returns a vector of CustomTypes. Read more
Auto Trait Implementations§
impl Freeze for WrappedNativeTokenContractRef
impl !RefUnwindSafe for WrappedNativeTokenContractRef
impl !Send for WrappedNativeTokenContractRef
impl !Sync for WrappedNativeTokenContractRef
impl Unpin for WrappedNativeTokenContractRef
impl !UnwindSafe for WrappedNativeTokenContractRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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