ClientExt

Trait ClientExt 

Source
pub trait ClientExt<T, E>
where T: Serialize + Deserialize<'static> + Display, E: Fail,
{
Show 30 methods // Required methods fn get_peer_count(&self) -> Result<T, E>; fn get_peers_info(&self, extra: bool) -> Result<T, E>; fn get_license_info(&self) -> Result<T, E>; fn get_block_number(&self) -> Result<T, E>; fn send_raw_transaction( &mut self, transaction_option: TransactionOptions<'_>, ) -> Result<T, E>; fn get_block_by_hash( &self, hash: &str, transaction_info: bool, ) -> Result<T, E>; fn get_block_by_number( &self, height: &str, transaction_info: bool, ) -> Result<T, E>; fn get_transaction_receipt(&self, hash: &str) -> Result<T, E>; fn get_logs( &self, topic: Option<Vec<&str>>, address: Option<Vec<&str>>, from: Option<&str>, to: Option<&str>, ) -> Result<T, E>; fn call( &self, from: Option<&str>, to: &str, data: Option<&str>, height: &str, extra: bool, ) -> Result<T, E>; fn get_transaction(&self, hash: &str, in_pool: bool) -> Result<T, E>; fn get_transaction_count(&self, address: &str, height: &str) -> Result<T, E>; fn get_code(&self, address: &str, height: &str) -> Result<T, E>; fn get_abi(&self, address: &str, height: &str) -> Result<T, E>; fn get_balance(&self, address: &str, height: &str) -> Result<T, E>; fn new_filter( &self, topic: Option<Vec<&str>>, address: Option<Vec<&str>>, from: Option<&str>, to: Option<&str>, ) -> Result<T, E>; fn new_block_filter(&self) -> Result<T, E>; fn uninstall_filter(&self, filter_id: &str) -> Result<T, E>; fn get_filter_changes(&self, filter_id: &str) -> Result<T, E>; fn get_filter_logs(&self, filter_id: &str) -> Result<T, E>; fn get_transaction_proof(&self, hash: &str) -> Result<T, E>; fn get_metadata(&self, height: &str) -> Result<T, E>; fn get_block_header(&self, height: &str) -> Result<T, E>; fn get_state_proof( &self, address: &str, key: &str, height: &str, ) -> Result<T, E>; fn get_storage_at( &self, address: &str, key: &str, height: &str, ) -> Result<T, E>; fn get_version(&self) -> Result<T, E>; fn estimate_quota( &self, from: Option<&str>, to: &str, data: Option<&str>, height: &str, ) -> Result<T, E>; fn get_pool_tx_num(&self) -> Result<T, E>; fn operate_censored_address( &self, action: CensorAction, censor_addr: &str, ) -> Result<T, E>; fn get_censored_addr(&self) -> Result<T, E>;
}
Expand description

High level jsonrpc call

Documentation

JSONRPC methods:

  • peerCount
  • peersInfo
  • blockNumber
  • sendTransaction
  • getBlockByHash
  • getBlockByNumber
  • getTransactionReceipt
  • getLogs
  • call
  • getTransaction
  • getTransactionCount
  • getCode
  • getAbi
  • getBalance
  • newFilter
  • newBlockFilter
  • uninstallFilter
  • getFilterChanges
  • getFilterLogs
  • getTransactionProof
  • getMetaData
  • getBlockHeader
  • getStateProof
  • getStorageAt
  • getVersion
  • estimateQuota

Required Methods§

Source

fn get_peer_count(&self) -> Result<T, E>

peerCount: Get network peer count

Source

fn get_peers_info(&self, extra: bool) -> Result<T, E>

peersInfo: Get all peers information

Source

fn get_license_info(&self) -> Result<T, E>

licenseInfo: Get CITA license information

Source

fn get_block_number(&self) -> Result<T, E>

blockNumber: Get current height

Source

fn send_raw_transaction( &mut self, transaction_option: TransactionOptions<'_>, ) -> Result<T, E>

sendTransaction: Send a transaction and return transaction hash

Source

fn get_block_by_hash(&self, hash: &str, transaction_info: bool) -> Result<T, E>

getBlockByHash: Get block by hash

Source

fn get_block_by_number( &self, height: &str, transaction_info: bool, ) -> Result<T, E>

getBlockByNumber: Get block by number

Source

fn get_transaction_receipt(&self, hash: &str) -> Result<T, E>

getTransactionReceipt: Get transaction receipt

Source

fn get_logs( &self, topic: Option<Vec<&str>>, address: Option<Vec<&str>>, from: Option<&str>, to: Option<&str>, ) -> Result<T, E>

getLogs: Get logs

Source

fn call( &self, from: Option<&str>, to: &str, data: Option<&str>, height: &str, extra: bool, ) -> Result<T, E>

call: (readonly, will not save state change)

Source

fn get_transaction(&self, hash: &str, in_pool: bool) -> Result<T, E>

getTransaction: Get transaction by hash

Source

fn get_transaction_count(&self, address: &str, height: &str) -> Result<T, E>

getTransactionCount: Get transaction count of an account

Source

fn get_code(&self, address: &str, height: &str) -> Result<T, E>

getCode: Get the code of a contract

Source

fn get_abi(&self, address: &str, height: &str) -> Result<T, E>

getAbi: Get the ABI of a contract

Source

fn get_balance(&self, address: &str, height: &str) -> Result<T, E>

getBalance: Get the balance of a contract (TODO: return U256)

Source

fn new_filter( &self, topic: Option<Vec<&str>>, address: Option<Vec<&str>>, from: Option<&str>, to: Option<&str>, ) -> Result<T, E>

newFilter:

Source

fn new_block_filter(&self) -> Result<T, E>

newBlockFilter:

Source

fn uninstall_filter(&self, filter_id: &str) -> Result<T, E>

uninstallFilter: Uninstall a filter by its id

Source

fn get_filter_changes(&self, filter_id: &str) -> Result<T, E>

getFilterChanges: Get filter changes

Source

fn get_filter_logs(&self, filter_id: &str) -> Result<T, E>

getFilterLogs: Get filter logs

Source

fn get_transaction_proof(&self, hash: &str) -> Result<T, E>

getTransactionProof: Get proof of a transaction

Source

fn get_metadata(&self, height: &str) -> Result<T, E>

getMetaData: Get metadata

Source

fn get_block_header(&self, height: &str) -> Result<T, E>

getBlockHeader: Get block headers based on block height

Source

fn get_state_proof( &self, address: &str, key: &str, height: &str, ) -> Result<T, E>

getStateProof: Get the proof of the variable at the specified height

Source

fn get_storage_at(&self, address: &str, key: &str, height: &str) -> Result<T, E>

getStorageAt: Get the value of the key at the specified height

Source

fn get_version(&self) -> Result<T, E>

getVersion: Get release version info of all modules

Source

fn estimate_quota( &self, from: Option<&str>, to: &str, data: Option<&str>, height: &str, ) -> Result<T, E>

estimateQuota: Estimate a transaction’s quota used

Source

fn get_pool_tx_num(&self) -> Result<T, E>

get tx number in pool

Source

fn operate_censored_address( &self, action: CensorAction, censor_addr: &str, ) -> Result<T, E>

operate censorship address list

Source

fn get_censored_addr(&self) -> Result<T, E>

get censorship address list

Implementors§