pub struct NeoToken<'a, P: JsonRpcProvider> { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl<'de, 'a, P> Deserialize<'de> for NeoToken<'a, P>where
P: Default + JsonRpcProvider,
impl<'de, 'a, P> Deserialize<'de> for NeoToken<'a, P>where
P: Default + JsonRpcProvider,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, P: JsonRpcProvider> FungibleTokenTrait<'a, P> for NeoToken<'a, P>
impl<'a, P: JsonRpcProvider> FungibleTokenTrait<'a, P> for NeoToken<'a, P>
const BALANCE_OF: &'static str = "balanceOf"
const TRANSFER: &'static str = "transfer"
fn get_balance_of<'life0, 'life1, 'async_trait>(
&'life0 self,
script_hash: &'life1 ScriptHash,
) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_balance_of_hash160<'life0, 'life1, 'async_trait>(
&'life0 self,
script_hash: &'life1 H160,
) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_total_balance<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 Wallet,
) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transfer_from_account<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Account,
to: &'life2 ScriptHash,
amount: i32,
data: Option<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn transfer_from_hash160<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ScriptHash,
to: &'life2 ScriptHash,
amount: i32,
data: Option<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn build_transfer_script<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ScriptHash,
to: &'life2 ScriptHash,
amount: i32,
data: Option<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn transfer_from_account_to_nns<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 Account,
to: &'life2 NNSName,
amount: i32,
data: Option<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn transfer_from_hash160_to_nns<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
from: &'life1 ScriptHash,
to: &'life2 NNSName,
amount: i32,
data: Option<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, P>, ContractError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl<'a, P: JsonRpcProvider> Serialize for NeoToken<'a, P>
impl<'a, P: JsonRpcProvider> Serialize for NeoToken<'a, P>
Source§impl<'a, P: JsonRpcProvider> SmartContractTrait<'a> for NeoToken<'a, P>
impl<'a, P: JsonRpcProvider> SmartContractTrait<'a> for NeoToken<'a, P>
type P = P
fn script_hash(&self) -> H160
fn set_script_hash(&mut self, script_hash: H160)
fn provider(&self) -> Option<&RpcClient<P>>
const DEFAULT_ITERATOR_COUNT: usize = 100usize
fn name<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_name(&mut self, _name: String)
fn invoke_function<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<TransactionBuilder<'_, Self::P>, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn build_invoke_function_script<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_string<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_int<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<i32, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_bool<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<bool, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_invoke_function<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
signers: Vec<Signer>,
) -> Pin<Box<dyn Future<Output = Result<InvocationResult, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn throw_if_fault_state( &self, output: &InvocationResult, ) -> Result<(), ContractError>
fn call_function_returning_script_hash<'life0, 'life1, 'async_trait>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_function_returning_iterator<'life0, 'life1, 'async_trait, U>( &'life0 self, function: &'life1 str, params: Vec<ContractParameter>, mapper: Arc<dyn Fn(StackItem) -> U + Send + Sync>, ) -> Pin<Box<dyn Future<Output = Result<NeoIterator<'_, U, Self::P>, ContractError>> + Send + 'async_trait>>
fn call_function_and_unwrap_iterator<'life0, 'life1, 'async_trait, U>(
&'life0 self,
function: &'life1 str,
params: Vec<ContractParameter>,
_max_items: usize,
mapper: impl 'async_trait + Fn(StackItem) -> U + Send,
) -> Pin<Box<dyn Future<Output = Result<Vec<U>, ContractError>> + Send + 'async_trait>>where
U: 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calc_native_contract_hash(contract_name: &str) -> Result<H160, ContractError>
fn calc_contract_hash( sender: H160, nef_checksum: u32, contract_name: &str, ) -> Result<H160, ContractError>
fn get_manifest<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ContractManifest> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for NeoToken<'a, P>
impl<'a, P: JsonRpcProvider> TokenTrait<'a, P> for NeoToken<'a, P>
fn total_supply(&self) -> Option<u64>
fn set_total_supply(&mut self, total_supply: u64)
fn decimals(&self) -> Option<u8>
fn set_decimals(&mut self, decimals: u8)
fn symbol(&self) -> Option<String>
fn set_symbol(&mut self, symbol: String)
fn resolve_nns_text_record<'life0, 'life1, 'async_trait>(
&'life0 self,
_name: &'life1 NNSName,
) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
const TOTAL_SUPPLY: &'static str = "totalSupply"
const SYMBOL: &'static str = "symbol"
const DECIMALS: &'static str = "decimals"
fn get_total_supply<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u64, ContractError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn get_decimals<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u8, ContractError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn get_symbol<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn to_fractions(&self, amount: u64, decimals: u32) -> Result<i32, ContractError>
fn to_fractions_decimal( &self, amount: Decimal, decimals: u32, ) -> Result<u64, ContractError>
fn to_decimals_u64(&self, fractions: u64, decimals: u32) -> Decimal
fn to_decimals(&self, amount: i64, decimals: u32) -> Decimal
Auto Trait Implementations§
impl<'a, P> Freeze for NeoToken<'a, P>
impl<'a, P> !RefUnwindSafe for NeoToken<'a, P>
impl<'a, P> Send for NeoToken<'a, P>
impl<'a, P> Sync for NeoToken<'a, P>
impl<'a, P> Unpin for NeoToken<'a, P>
impl<'a, P> !UnwindSafe for NeoToken<'a, P>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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