pub trait ClientExt<T, E>{
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
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§
Sourcefn get_peer_count(&self) -> Result<T, E>
fn get_peer_count(&self) -> Result<T, E>
peerCount: Get network peer count
Sourcefn get_peers_info(&self, extra: bool) -> Result<T, E>
fn get_peers_info(&self, extra: bool) -> Result<T, E>
peersInfo: Get all peers information
Sourcefn get_license_info(&self) -> Result<T, E>
fn get_license_info(&self) -> Result<T, E>
licenseInfo: Get CITA license information
Sourcefn get_block_number(&self) -> Result<T, E>
fn get_block_number(&self) -> Result<T, E>
blockNumber: Get current height
Sourcefn send_raw_transaction(
&mut self,
transaction_option: TransactionOptions<'_>,
) -> Result<T, E>
fn send_raw_transaction( &mut self, transaction_option: TransactionOptions<'_>, ) -> Result<T, E>
sendTransaction: Send a transaction and return transaction hash
Sourcefn get_block_by_hash(&self, hash: &str, transaction_info: bool) -> Result<T, E>
fn get_block_by_hash(&self, hash: &str, transaction_info: bool) -> Result<T, E>
getBlockByHash: Get block by hash
Sourcefn get_block_by_number(
&self,
height: &str,
transaction_info: bool,
) -> Result<T, E>
fn get_block_by_number( &self, height: &str, transaction_info: bool, ) -> Result<T, E>
getBlockByNumber: Get block by number
Sourcefn get_transaction_receipt(&self, hash: &str) -> Result<T, E>
fn get_transaction_receipt(&self, hash: &str) -> Result<T, E>
getTransactionReceipt: Get transaction receipt
Sourcefn get_logs(
&self,
topic: Option<Vec<&str>>,
address: Option<Vec<&str>>,
from: Option<&str>,
to: Option<&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>
getLogs: Get logs
Sourcefn call(
&self,
from: Option<&str>,
to: &str,
data: Option<&str>,
height: &str,
extra: bool,
) -> Result<T, E>
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)
Sourcefn get_transaction(&self, hash: &str, in_pool: bool) -> Result<T, E>
fn get_transaction(&self, hash: &str, in_pool: bool) -> Result<T, E>
getTransaction: Get transaction by hash
Sourcefn get_transaction_count(&self, address: &str, height: &str) -> Result<T, E>
fn get_transaction_count(&self, address: &str, height: &str) -> Result<T, E>
getTransactionCount: Get transaction count of an account
Sourcefn get_code(&self, address: &str, height: &str) -> Result<T, E>
fn get_code(&self, address: &str, height: &str) -> Result<T, E>
getCode: Get the code of a contract
Sourcefn get_abi(&self, address: &str, height: &str) -> Result<T, E>
fn get_abi(&self, address: &str, height: &str) -> Result<T, E>
getAbi: Get the ABI of a contract
Sourcefn get_balance(&self, address: &str, height: &str) -> Result<T, E>
fn get_balance(&self, address: &str, height: &str) -> Result<T, E>
getBalance: Get the balance of a contract (TODO: return U256)
Sourcefn new_filter(
&self,
topic: Option<Vec<&str>>,
address: Option<Vec<&str>>,
from: Option<&str>,
to: Option<&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>
newFilter:
Sourcefn new_block_filter(&self) -> Result<T, E>
fn new_block_filter(&self) -> Result<T, E>
newBlockFilter:
Sourcefn uninstall_filter(&self, filter_id: &str) -> Result<T, E>
fn uninstall_filter(&self, filter_id: &str) -> Result<T, E>
uninstallFilter: Uninstall a filter by its id
Sourcefn get_filter_changes(&self, filter_id: &str) -> Result<T, E>
fn get_filter_changes(&self, filter_id: &str) -> Result<T, E>
getFilterChanges: Get filter changes
Sourcefn get_filter_logs(&self, filter_id: &str) -> Result<T, E>
fn get_filter_logs(&self, filter_id: &str) -> Result<T, E>
getFilterLogs: Get filter logs
Sourcefn get_transaction_proof(&self, hash: &str) -> Result<T, E>
fn get_transaction_proof(&self, hash: &str) -> Result<T, E>
getTransactionProof: Get proof of a transaction
Sourcefn get_metadata(&self, height: &str) -> Result<T, E>
fn get_metadata(&self, height: &str) -> Result<T, E>
getMetaData: Get metadata
Sourcefn get_block_header(&self, height: &str) -> Result<T, E>
fn get_block_header(&self, height: &str) -> Result<T, E>
getBlockHeader: Get block headers based on block height
Sourcefn get_state_proof(
&self,
address: &str,
key: &str,
height: &str,
) -> Result<T, E>
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
Sourcefn get_storage_at(&self, address: &str, key: &str, height: &str) -> Result<T, E>
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
Sourcefn get_version(&self) -> Result<T, E>
fn get_version(&self) -> Result<T, E>
getVersion: Get release version info of all modules
Sourcefn estimate_quota(
&self,
from: Option<&str>,
to: &str,
data: Option<&str>,
height: &str,
) -> Result<T, E>
fn estimate_quota( &self, from: Option<&str>, to: &str, data: Option<&str>, height: &str, ) -> Result<T, E>
estimateQuota: Estimate a transaction’s quota used
Sourcefn get_pool_tx_num(&self) -> Result<T, E>
fn get_pool_tx_num(&self) -> Result<T, E>
get tx number in pool
Sourcefn operate_censored_address(
&self,
action: CensorAction,
censor_addr: &str,
) -> Result<T, E>
fn operate_censored_address( &self, action: CensorAction, censor_addr: &str, ) -> Result<T, E>
operate censorship address list
Sourcefn get_censored_addr(&self) -> Result<T, E>
fn get_censored_addr(&self) -> Result<T, E>
get censorship address list