pub struct Rpc {
    pub client: Client,
    pub url: Url,
    pub id_generator: IdGenerator,
}Fields§
§client: Client§url: Url§id_generator: IdGeneratorImplementations§
Source§impl Rpc
 
impl Rpc
pub fn new(uri: &str, client: Client) -> Self
pub fn get_block(&self, _hash: H256) -> Result<Option<BlockView>, Error>
pub fn get_fork_block(&self, _hash: H256) -> Result<Option<BlockView>, Error>
pub fn get_block_by_number( &self, _number: BlockNumber, ) -> Result<Option<BlockView>, Error>
pub fn get_header(&self, _hash: H256) -> Result<Option<HeaderView>, Error>
pub fn get_header_by_number( &self, _number: BlockNumber, ) -> Result<Option<HeaderView>, Error>
pub fn get_transaction( &self, _hash: H256, ) -> Result<Option<TransactionWithStatus>, Error>
pub fn get_block_hash( &self, _number: BlockNumber, ) -> Result<Option<H256>, Error>
pub fn get_tip_header(&self) -> Result<HeaderView, Error>
pub fn get_cells_by_lock_hash( &self, _lock_hash: H256, _from: BlockNumber, _to: BlockNumber, ) -> Result<Vec<CellOutputWithOutPoint>, Error>
pub fn get_live_cell( &self, _out_point: OutPoint, _with_data: bool, ) -> Result<CellWithStatus, Error>
pub fn get_tip_block_number(&self) -> Result<BlockNumber, Error>
pub fn get_current_epoch(&self) -> Result<EpochView, Error>
pub fn get_epoch_by_number( &self, number: EpochNumber, ) -> Result<Option<EpochView>, Error>
pub fn local_node_info(&self) -> Result<LocalNode, Error>
pub fn get_peers(&self) -> Result<Vec<RemoteNode>, Error>
pub fn get_banned_addresses(&self) -> Result<Vec<BannedAddr>, Error>
pub fn set_ban( &self, address: String, command: String, ban_time: Option<Timestamp>, absolute: Option<bool>, reason: Option<String>, ) -> Result<(), Error>
pub fn get_block_template( &self, bytes_limit: Option<Uint64>, proposals_limit: Option<Uint64>, max_version: Option<Version>, ) -> Result<BlockTemplate, Error>
pub fn submit_block( &self, _work_id: String, _data: Block, ) -> Result<H256, Error>
pub fn get_blockchain_info(&self) -> Result<ChainInfo, Error>
pub fn get_peers_state(&self) -> Result<Vec<PeerState>, Error>
pub fn compute_transaction_hash(&self, tx: Transaction) -> Result<H256, Error>
pub fn dry_run_transaction( &self, _tx: Transaction, ) -> Result<DryRunResult, Error>
pub fn send_transaction(&self, tx: Transaction) -> Result<H256, Error>
pub fn tx_pool_info(&self) -> Result<TxPoolInfo, Error>
pub fn send_alert(&self, alert: Alert) -> Result<(), Error>
pub fn add_node(&self, peer_id: String, address: String) -> Result<(), Error>
pub fn remove_node(&self, peer_id: String) -> Result<(), Error>
pub fn process_block_without_verify( &self, _data: Block, ) -> Result<Option<H256>, Error>
pub fn get_live_cells_by_lock_hash( &self, lock_hash: H256, page: Uint64, per_page: Uint64, reverse_order: Option<bool>, ) -> Result<Vec<LiveCell>, Error>
pub fn get_transactions_by_lock_hash( &self, lock_hash: H256, page: Uint64, per_page: Uint64, reverse_order: Option<bool>, ) -> Result<Vec<CellTransaction>, Error>
pub fn index_lock_hash( &self, lock_hash: H256, index_from: Option<BlockNumber>, ) -> Result<LockHashIndexState, Error>
pub fn deindex_lock_hash(&self, lock_hash: H256) -> Result<(), Error>
pub fn get_lock_hash_index_states( &self, ) -> Result<Vec<LockHashIndexState>, Error>
pub fn calculate_dao_maximum_withdraw( &self, _out_point: OutPoint, _hash: H256, ) -> Result<Capacity, Error>
pub fn get_cellbase_output_capacity_details( &self, _hash: H256, ) -> Result<Option<BlockReward>, Error>
pub fn broadcast_transaction( &self, tx: Transaction, cycles: Cycle, ) -> Result<H256, Error>
pub fn estimate_fee_rate( &self, expect_confirm_blocks: Uint64, ) -> Result<EstimateResult, Error>
Auto Trait Implementations§
impl !Freeze for Rpc
impl !RefUnwindSafe for Rpc
impl Send for Rpc
impl Sync for Rpc
impl Unpin for Rpc
impl !UnwindSafe for Rpc
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
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
 
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more