[][src]Struct in3::eth1::api::Api

pub struct Api { /* fields omitted */ }

Primary interface for the Ethereum JSON RPC API.

Implementations

impl Api[src]

pub async fn get_storage_at<'_>(
    &'_ mut self,
    address: Address,
    key: U256,
    block: BlockNumber
) -> In3Result<U256>
[src]

Returns the value from a storage position at a given address.

Arguments

  • address - address of the storage.
  • key - position in the storage.
  • block - BlockNumber

pub async fn get_code<'_>(
    &'_ mut self,
    address: Address,
    block: BlockNumber
) -> In3Result<Bytes>
[src]

Returns code at a given address.

Arguments

pub async fn get_balance<'_>(
    &'_ mut self,
    address: Address,
    block: BlockNumber
) -> In3Result<U256>
[src]

Returns the balance of the account of given address.

Arguments

pub async fn block_number<'_>(&'_ mut self) -> In3Result<U256>[src]

Returns the number of most recent block.

pub async fn gas_price<'_>(&'_ mut self) -> In3Result<U256>[src]

Returns the current price per gas in wei.

pub async fn get_block_by_number<'_>(
    &'_ mut self,
    block: BlockNumber,
    include_tx: bool
) -> In3Result<Block>
[src]

Returns information about a block by block number.

Arguments

  • block - BlockNumber
  • include_tx - boolean which if true returns the full transaction objects otherwise only the hashes of the transactions.

pub async fn get_block_by_hash<'_>(
    &'_ mut self,
    hash: Hash,
    include_tx: bool
) -> In3Result<Block>
[src]

Returns information about a block by hash.

Arguments

  • hash - hash of a block.
  • include_tx - boolean which if true returns the full transaction objects otherwise only the hashes of the transactions.

pub async fn get_logs<'_>(
    &'_ mut self,
    filter_options: Value
) -> In3Result<Vec<Log>>
[src]

Returns an array of all logs matching a given filter object.

Arguments

  • filter_options - options serialized as a JSON object -
    • fromBlock: (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.
    • toBlock: (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.
    • address: (optional) Contract address or a list of addresses from which logs should originate.
    • topics: (optional) Array of 32 Bytes DATA topics. Each topic can also be an array of DATA with "or" options.

pub async fn new_filter<'_>(
    &'_ mut self,
    filter_options: Value
) -> In3Result<U256>
[src]

Creates a filter object, based on filter options.

Arguments

  • filter_options - options serialized as a JSON object -
    • fromBlock: (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.
    • toBlock: (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.
    • address: (optional) Contract address or a list of addresses from which logs should originate.
    • topics: (optional) Array of 32 Bytes DATA topics. Each topic can also be an array of DATA with "or" options.

pub async fn new_block_filter<'_>(&'_ mut self) -> In3Result<U256>[src]

Creates a filter in the node, to notify when a new block arrives.

pub async fn new_pending_transaction_filter<'_>(&'_ mut self) -> In3Result<U256>[src]

Creates a filter in the node, to notify when new pending transactions arrive.

Panics

This function is not implemented and calls to it will panic.

pub async fn uninstall_filter<'_>(
    &'_ mut self,
    filter_id: U256
) -> In3Result<bool>
[src]

Uninstalls a filter with given id.

Arguments

  • filter_id - id of filter that needs to be uninstalled.

pub async fn get_filter_changes<'_>(
    &'_ mut self,
    filter_id: U256
) -> In3Result<FilterChanges>
[src]

Polling method for a filter, which returns an array of logs which occurred since last poll.

Arguments

  • filter_id - id of filter that must be polled.

pub async fn get_filter_logs<'_>(
    &'_ mut self,
    filter_id: U256
) -> In3Result<Vec<Log>>
[src]

Returns an array of all logs matching filter with given id.

Arguments

  • filter_id - id of filter that must be matched against.

pub async fn chain_id<'_>(&'_ mut self) -> In3Result<U256>[src]

Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.

pub async fn get_block_transaction_count_by_hash<'_>(
    &'_ mut self,
    hash: Hash
) -> In3Result<U256>
[src]

Returns the number of transactions in a block from a block matching the given block hash.

Arguments

  • hash - hash of a block.

pub async fn get_block_transaction_count_by_number<'_>(
    &'_ mut self,
    block: BlockNumber
) -> In3Result<U256>
[src]

Returns the number of transactions in a block matching the given block number.

Arguments

pub async fn call<'_>(
    &'_ mut self,
    transaction: CallTransaction,
    block: BlockNumber
) -> In3Result<Bytes>
[src]

Executes a new message call immediately without creating a transaction on the block chain.

Arguments

pub async fn estimate_gas<'_>(
    &'_ mut self,
    transaction: CallTransaction,
    block: BlockNumber
) -> In3Result<U256>
[src]

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.

Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.

Arguments

pub async fn get_transaction_by_hash<'_>(
    &'_ mut self,
    hash: Hash
) -> In3Result<Transaction>
[src]

Returns the information about a transaction requested by transaction hash.

Arguments

  • hash - hash of transaction.

pub async fn get_transaction_by_block_hash_and_index<'_>(
    &'_ mut self,
    hash: Hash,
    index: U256
) -> In3Result<Transaction>
[src]

Returns information about a transaction by block hash and transaction index position.

Arguments

  • hash - hash of a block.
  • index - transaction index position.

pub async fn get_transaction_by_block_number_and_index<'_>(
    &'_ mut self,
    block: BlockNumber,
    index: U256
) -> In3Result<Transaction>
[src]

Returns information about a transaction by block number and transaction index position.

Arguments

  • block - BlockNumber
  • index - transaction index position.

pub async fn get_transaction_count<'_>(
    &'_ mut self,
    address: Address,
    block: BlockNumber
) -> In3Result<U256>
[src]

Returns the number of transactions sent from an address.

Arguments

pub async fn get_uncle_by_block_number_and_index<'_>(
    &'_ mut self,
    block: BlockNumber,
    index: U256
) -> In3Result<Block>
[src]

Returns information about a uncle of a block by number and uncle index position.

Arguments

  • block - BlockNumber
  • index - the uncle's index position.

pub async fn get_uncle_by_block_hash_and_index<'_>(
    &'_ mut self,
    hash: Hash,
    index: U256
) -> In3Result<Block>
[src]

Returns information about a uncle of a block by hash and uncle index position.

Arguments

  • hash - hash of a block.
  • index - the uncle's index position.

pub async fn get_uncle_count_by_block_hash<'_>(
    &'_ mut self,
    hash: Hash
) -> In3Result<U256>
[src]

Returns the number of uncles in a block from a block matching the given block hash.

Arguments

  • hash - hash of a block.

pub async fn get_uncle_count_by_block_number<'_>(
    &'_ mut self,
    block: BlockNumber
) -> In3Result<U256>
[src]

Returns the number of uncles in a block from a block matching the given block number.

Arguments

pub async fn send_transaction<'_>(
    &'_ mut self,
    transaction: OutgoingTransaction
) -> In3Result<Hash>
[src]

Creates new message call transaction or a contract creation, if the data field contains code.

Arguments

pub async fn send_raw_transaction<'_>(
    &'_ mut self,
    data: Bytes
) -> In3Result<Hash>
[src]

Creates new message call transaction or a contract creation for signed transactions.

Arguments

  • data - signed transaction data as bytes.

pub async fn get_transaction_receipt<'_>(
    &'_ mut self,
    transaction_hash: Hash
) -> In3Result<TransactionReceipt>
[src]

Returns the receipt of a transaction by transaction hash.

Arguments

  • transaction_hash - hash of a transaction.

Trait Implementations

impl Api for Api[src]

fn new(client: Box<dyn ClientTrait>) -> Self[src]

Creates an eth1::Api instance by consuming a Client.

fn client(&mut self) -> &mut Box<dyn ClientTrait>[src]

Get a mutable reference to an eth1::Api's associated Client.

Auto Trait Implementations

impl !RefUnwindSafe for Api

impl !Send for Api

impl !Sync for Api

impl Unpin for Api

impl !UnwindSafe for Api

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,