pub struct Contract<T: Transport> { /* private fields */ }
Expand description
Ethereum Contract Interface
Implementations§
Source§impl<T: Transport> Contract<T>
impl<T: Transport> Contract<T>
Sourcepub async fn signed_call_with_confirmations(
&self,
func: &str,
params: impl Tokenize,
options: Options,
confirmations: usize,
key: impl Key,
) -> Result<TransactionReceipt>
pub async fn signed_call_with_confirmations( &self, func: &str, params: impl Tokenize, options: Options, confirmations: usize, key: impl Key, ) -> Result<TransactionReceipt>
Execute a signed contract function and wait for confirmations
Source§impl<T: Transport> Contract<T>
impl<T: Transport> Contract<T>
Sourcepub fn new(eth: Eth<T>, address: Address, abi: Contract) -> Self
pub fn new(eth: Eth<T>, address: Address, abi: Contract) -> Self
Creates new Contract Interface given blockchain address and ABI
Sourcepub fn from_json(eth: Eth<T>, address: Address, json: &[u8]) -> Result<Self>
pub fn from_json(eth: Eth<T>, address: Address, json: &[u8]) -> Result<Self>
Creates new Contract Interface given blockchain address and JSON containing ABI
Sourcepub async fn call<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options,
) -> Result<H256>where
P: Tokenize,
pub async fn call<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options,
) -> Result<H256>where
P: Tokenize,
Execute a contract function
Sourcepub async fn call_with_confirmations(
&self,
func: &str,
params: impl Tokenize,
from: Address,
options: Options,
confirmations: usize,
) -> Result<TransactionReceipt>
pub async fn call_with_confirmations( &self, func: &str, params: impl Tokenize, from: Address, options: Options, confirmations: usize, ) -> Result<TransactionReceipt>
Execute a contract function and wait for confirmations
Sourcepub async fn estimate_gas<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options,
) -> Result<U256>where
P: Tokenize,
pub async fn estimate_gas<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options,
) -> Result<U256>where
P: Tokenize,
Estimate gas required for this function call.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Contract<T>where
T: Freeze,
impl<T> RefUnwindSafe for Contract<T>where
T: RefUnwindSafe,
impl<T> Send for Contract<T>where
T: Send,
impl<T> Sync for Contract<T>where
T: Sync,
impl<T> Unpin for Contract<T>where
T: Unpin,
impl<T> UnwindSafe for Contract<T>where
T: UnwindSafe,
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