pub struct CkbRpcClient { /* private fields */ }Implementations§
Source§impl CkbRpcClient
impl CkbRpcClient
pub fn new(uri: &str) -> Self
pub fn with_builder<F>(uri: &str, f: F) -> Result<Self, Error>
pub fn post<PARAM, RET>( &self, method: &str, params: PARAM, ) -> Result<RET, RpcError>
pub fn get_block(&self, hash: H256) -> Result<Option<BlockView>, RpcError>
pub fn get_block_by_number( &self, number: BlockNumber, ) -> Result<Option<BlockView>, RpcError>
pub fn get_block_hash( &self, number: BlockNumber, ) -> Result<Option<H256>, RpcError>
pub fn get_block_filter( &self, block_hash: H256, ) -> Result<Option<BlockFilter>, RpcError>
pub fn get_current_epoch(&self) -> Result<EpochView, RpcError>
pub fn get_epoch_by_number( &self, number: EpochNumber, ) -> Result<Option<EpochView>, RpcError>
pub fn get_header(&self, hash: H256) -> Result<Option<HeaderView>, RpcError>
pub fn get_header_by_number( &self, number: BlockNumber, ) -> Result<Option<HeaderView>, RpcError>
pub fn get_live_cell( &self, out_point: OutPoint, with_data: bool, ) -> Result<CellWithStatus, RpcError>
pub fn get_tip_block_number(&self) -> Result<BlockNumber, RpcError>
pub fn get_tip_header(&self) -> Result<HeaderView, RpcError>
pub fn get_transaction( &self, hash: H256, ) -> Result<Option<TransactionWithStatusResponse>, RpcError>
pub fn get_transaction_proof( &self, tx_hashes: Vec<H256>, block_hash: Option<H256>, ) -> Result<TransactionProof, RpcError>
pub fn verify_transaction_proof( &self, tx_proof: TransactionProof, ) -> Result<Vec<H256>, RpcError>
pub fn get_transaction_and_witness_proof( &self, tx_hashes: Vec<H256>, block_hash: Option<H256>, ) -> Result<TransactionAndWitnessProof, RpcError>
pub fn verify_transaction_and_witness_proof( &self, tx_proof: TransactionAndWitnessProof, ) -> Result<Vec<H256>, RpcError>
pub fn get_fork_block( &self, block_hash: H256, ) -> Result<Option<BlockView>, RpcError>
pub fn get_consensus(&self) -> Result<Consensus, RpcError>
pub fn get_deployments_info(&self) -> Result<DeploymentsInfo, RpcError>
pub fn get_block_median_time( &self, block_hash: H256, ) -> Result<Option<Timestamp>, RpcError>
pub fn get_block_economic_state( &self, block_hash: H256, ) -> Result<Option<BlockEconomicState>, RpcError>
pub fn estimate_cycles( &self, tx: Transaction, ) -> Result<EstimateCycles, RpcError>
pub fn get_fee_rate_statics( &self, target: Option<Uint64>, ) -> Result<Option<FeeRateStatistics>, RpcError>
pub fn get_fee_rate_statistics( &self, target: Option<Uint64>, ) -> Result<Option<FeeRateStatistics>, RpcError>
pub fn get_indexer_tip(&self) -> Result<Option<Tip>, RpcError>
pub fn get_cells( &self, search_key: SearchKey, order: Order, limit: Uint32, after: Option<JsonBytes>, ) -> Result<Pagination<Cell>, RpcError>
pub fn get_transactions( &self, search_key: SearchKey, order: Order, limit: Uint32, after: Option<JsonBytes>, ) -> Result<Pagination<Tx>, RpcError>
pub fn get_cells_capacity( &self, search_key: SearchKey, ) -> Result<Option<CellsCapacity>, RpcError>
pub fn get_banned_addresses(&self) -> Result<Vec<BannedAddr>, RpcError>
pub fn get_peers(&self) -> Result<Vec<RemoteNode>, RpcError>
pub fn local_node_info(&self) -> Result<LocalNode, RpcError>
pub fn set_ban( &self, address: String, command: String, ban_time: Option<Timestamp>, absolute: Option<bool>, reason: Option<String>, ) -> Result<(), RpcError>
pub fn sync_state(&self) -> Result<SyncState, RpcError>
pub fn set_network_active(&self, state: bool) -> Result<(), RpcError>
pub fn add_node(&self, peer_id: String, address: String) -> Result<(), RpcError>
pub fn remove_node(&self, peer_id: String) -> Result<(), RpcError>
pub fn clear_banned_addresses(&self) -> Result<(), RpcError>
pub fn ping_peers(&self) -> Result<(), RpcError>
pub fn send_transaction( &self, tx: Transaction, outputs_validator: Option<OutputsValidator>, ) -> Result<H256, RpcError>
pub fn remove_transaction(&self, tx_hash: H256) -> Result<bool, RpcError>
pub fn tx_pool_info(&self) -> Result<TxPoolInfo, RpcError>
pub fn get_pool_tx_detail_info( &self, tx_hash: H256, ) -> Result<PoolTxDetailInfo, RpcError>
pub fn clear_tx_pool(&self) -> Result<(), RpcError>
pub fn get_raw_tx_pool( &self, verbose: Option<bool>, ) -> Result<RawTxPool, RpcError>
pub fn tx_pool_ready(&self) -> Result<bool, RpcError>
pub fn test_tx_pool_accept( &self, tx: Transaction, outputs_validator: Option<OutputsValidator>, ) -> Result<EntryCompleted, RpcError>
pub fn clear_tx_verify_queue(&self) -> Result<(), RpcError>
pub fn get_blockchain_info(&self) -> Result<ChainInfo, RpcError>
pub fn get_block_template( &self, bytes_limit: Option<Uint64>, proposals_limit: Option<Uint64>, max_version: Option<Version>, ) -> Result<BlockTemplate, RpcError>
pub fn submit_block( &self, _work_id: String, _data: Block, ) -> Result<H256, RpcError>
pub fn send_alert(&self, alert: Alert) -> Result<(), RpcError>
pub fn process_block_without_verify( &self, data: Block, broadcast: bool, ) -> Result<Option<H256>, RpcError>
pub fn truncate(&self, target_tip_hash: H256) -> Result<(), RpcError>
pub fn generate_block(&self) -> Result<H256, RpcError>
pub fn generate_epochs( &self, num_epochs: EpochNumberWithFraction, ) -> Result<EpochNumberWithFraction, RpcError>
pub fn notify_transaction(&self, tx: Transaction) -> Result<H256, RpcError>
pub fn calculate_dao_field( &self, block_template: BlockTemplate, ) -> Result<JsonBytes, RpcError>
pub fn generate_block_with_template( &self, block_template: BlockTemplate, ) -> Result<H256, RpcError>
pub fn jemalloc_profiling_dump(&self) -> Result<String, RpcError>
pub fn update_main_logger( &self, config: MainLoggerConfig, ) -> Result<(), RpcError>
pub fn set_extra_logger( &self, name: String, config_opt: Option<ExtraLoggerConfig>, ) -> Result<(), RpcError>
pub fn calculate_dao_maximum_withdraw( &self, out_point: OutPoint, kind: DaoWithdrawingCalculationKind, ) -> Result<Capacity, RpcError>
Source§impl CkbRpcClient
impl CkbRpcClient
pub fn get_packed_block( &self, hash: H256, ) -> Result<Option<JsonBytes>, RpcError>
Sourcepub fn get_block_with_cycles(
&self,
hash: H256,
) -> Result<Option<(BlockView, Vec<Cycle>)>, RpcError>
pub fn get_block_with_cycles( &self, hash: H256, ) -> Result<Option<(BlockView, Vec<Cycle>)>, RpcError>
Same as get_block except with parameter with_cycles and return BlockResponse
pub fn get_packed_block_with_cycles( &self, hash: H256, ) -> Result<Option<(JsonBytes, Vec<Cycle>)>, RpcError>
Sourcepub fn get_packed_block_by_number(
&self,
number: BlockNumber,
) -> Result<Option<JsonBytes>, RpcError>
pub fn get_packed_block_by_number( &self, number: BlockNumber, ) -> Result<Option<JsonBytes>, RpcError>
Same as get_block_by_number except with parameter with_cycles and return BlockResponse
pub fn get_block_by_number_with_cycles( &self, number: BlockNumber, ) -> Result<Option<(BlockView, Vec<Cycle>)>, RpcError>
pub fn get_packed_block_by_number_with_cycles( &self, number: BlockNumber, ) -> Result<Option<(JsonBytes, Vec<Cycle>)>, RpcError>
pub fn get_packed_header( &self, hash: H256, ) -> Result<Option<JsonBytes>, RpcError>
pub fn get_packed_header_by_number( &self, number: BlockNumber, ) -> Result<Option<JsonBytes>, RpcError>
pub fn get_live_cell_with_include_tx_pool( &self, out_point: OutPoint, with_data: bool, include_tx_pool: bool, ) -> Result<CellWithStatus, RpcError>
pub fn get_only_committed_transaction( &self, hash: H256, ) -> Result<TransactionWithStatusResponse, RpcError>
pub fn get_packed_transaction( &self, hash: H256, ) -> Result<TransactionWithStatusResponse, RpcError>
pub fn get_only_committed_packed_transaction( &self, hash: H256, ) -> Result<TransactionWithStatusResponse, RpcError>
pub fn get_transaction_status( &self, hash: H256, ) -> Result<TransactionWithStatusResponse, RpcError>
pub fn get_only_committed_transaction_status( &self, hash: H256, ) -> Result<TransactionWithStatusResponse, RpcError>
pub fn get_packed_tip_header(&self) -> Result<JsonBytes, RpcError>
pub fn get_packed_fork_block( &self, block_hash: H256, ) -> Result<Option<JsonBytes>, RpcError>
Trait Implementations§
Source§impl Clone for CkbRpcClient
impl Clone for CkbRpcClient
Source§impl From<&CkbRpcClient> for CkbRpcAsyncClient
Available on non-WebAssembly only.
impl From<&CkbRpcClient> for CkbRpcAsyncClient
Available on non-WebAssembly only.
Source§fn from(value: &CkbRpcClient) -> Self
fn from(value: &CkbRpcClient) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for CkbRpcClient
impl !RefUnwindSafe for CkbRpcClient
impl Send for CkbRpcClient
impl Sync for CkbRpcClient
impl Unpin for CkbRpcClient
impl !UnwindSafe for CkbRpcClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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