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