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 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, Error>
pub fn from_json(
eth: Eth<T>,
address: Address,
json: &[u8]
) -> Result<Self, Error>
Creates new Contract Interface given blockchain address and JSON containing ABI
sourcepub fn call<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options
) -> CallFuture<H256, T::Out>where
P: Tokenize,
pub fn call<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options
) -> CallFuture<H256, T::Out>where
P: Tokenize,
Execute a contract function
sourcepub fn call_with_confirmations<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options,
confirmations: usize
) -> SendTransactionWithConfirmation<T>where
P: Tokenize,
pub fn call_with_confirmations<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options,
confirmations: usize
) -> SendTransactionWithConfirmation<T>where
P: Tokenize,
Execute a contract function and wait for confirmations
sourcepub fn estimate_gas<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options
) -> CallFuture<U256, T::Out>where
P: Tokenize,
pub fn estimate_gas<P>(
&self,
func: &str,
params: P,
from: Address,
options: Options
) -> CallFuture<U256, T::Out>where
P: Tokenize,
Estimate gas required for this function call.
sourcepub fn query<R, A, B, P>(
&self,
func: &str,
params: P,
from: A,
options: Options,
block: B
) -> QueryResult<R, T::Out>where
R: Detokenize,
A: Into<Option<Address>>,
B: Into<Option<BlockNumber>>,
P: Tokenize,
pub fn query<R, A, B, P>(
&self,
func: &str,
params: P,
from: A,
options: Options,
block: B
) -> QueryResult<R, T::Out>where
R: Detokenize,
A: Into<Option<Address>>,
B: Into<Option<BlockNumber>>,
P: Tokenize,
Call constant function