Struct web3_rust_wrapper::Web3Manager
source · [−]pub struct Web3Manager {
pub web3http: Web3<Http>,
pub web3web_socket: Web3<WebSocket>,
/* private fields */
}Fields
web3http: Web3<Http>web3web_socket: Web3<WebSocket>Implementations
sourceimpl Web3Manager
impl Web3Manager
pub async fn instance_contract(
&self,
plain_contract_address: &str,
abi_path: &[u8]
) -> Result<Contract<Http>, Box<dyn Error>>
pub fn generate_deadline(&self) -> Result<U256, SystemTimeError>
pub async fn swap_eth_for_exact_tokens(
&self,
account: H160,
contract_instance: &Contract<Http>,
token_amount: &str,
pairs: &[&str]
) -> Result<H256, Box<dyn Error>>
pub async fn get_out_estimated_tokens_for_tokens(
&self,
contract_instance: &Contract<Http>,
pair_a: &str,
pair_b: &str,
amount: &str
) -> U256
pub async fn set_token_balances(&mut self)
pub async fn last_nonce(&self) -> U256
pub async fn load_account(
&mut self,
plain_address: &str,
plain_private_key: &str
) -> &mut Web3Manager
pub async fn new(http_url: &str, websocket_url: &str) -> Web3Manager
pub async fn gas_price(&self) -> U256
pub async fn get_block(&self) -> U64
pub async fn query_contract<P, T>(
&self,
contract_instance: &Contract<Http>,
func: &str,
params: P
) -> T where
P: Tokenize,
T: Tokenizable,
pub async fn send_raw_transaction(&self, raw_transaction: Bytes) -> H256
pub async fn sign_transaction(
&self,
account: H160,
transact_obj: TransactionParameters
) -> SignedTransaction
pub fn encode_tx_parameters(
&self,
nonce: U256,
to: Address,
value: U256,
gas: U256,
gas_price: U256,
data: Bytes
) -> TransactionParameters
pub fn encode_tx_data<P>(
&self,
contract: &Contract<Http>,
func: &str,
params: P
) -> Bytes where
P: Tokenize,
pub async fn estimate_tx_gas<P>(
&self,
contract: &Contract<Http>,
func: &str,
params: P,
value: &str
) -> U256 where
P: Tokenize,
pub fn first_loaded_account(&self) -> H160
pub async fn approve_erc20_token(
&self,
account: H160,
contract_instance: &Contract<Http>,
spender: &str,
value: &str
) -> H256
pub async fn sign_and_send_tx<P: Clone>(
&self,
account: H160,
contract_instance: &Contract<Http>,
func: &str,
params: &P,
value: &str
) -> H256 where
P: Tokenize,
pub async fn sent_erc20_token(
&self,
account: H160,
contract_instance: &Contract<Http>,
to: &str,
token_amount: &str
) -> H256
Trait Implementations
sourceimpl Clone for Web3Manager
impl Clone for Web3Manager
sourcefn clone(&self) -> Web3Manager
fn clone(&self) -> Web3Manager
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Web3Manager
impl Send for Web3Manager
impl Sync for Web3Manager
impl Unpin for Web3Manager
impl !UnwindSafe for Web3Manager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more