pub struct RpcClient {
pub(crate) http_client: HttpClient<HttpBackend>,
}Expand description
Rpc client
Fields§
§http_client: HttpClient<HttpBackend>Implementations§
source§impl RpcClient
impl RpcClient
sourcepub async fn from_url(url: &str, http_config: &HttpConfig) -> RpcClient
pub async fn from_url(url: &str, http_config: &HttpConfig) -> RpcClient
Default constructor
sourcepub async fn node_sign_message(&self, message: Vec<u8>) -> RpcResult<PubkeySig>
pub async fn node_sign_message(&self, message: Vec<u8>) -> RpcResult<PubkeySig>
Sign message with node’s key. Returns the public key that signed the message and the signature.
sourcepub async fn add_staking_secret_keys(
&self,
secret_keys: Vec<String>,
) -> RpcResult<()>
pub async fn add_staking_secret_keys( &self, secret_keys: Vec<String>, ) -> RpcResult<()>
Add a vector of new secret keys for the node to use to stake. No confirmation to expect.
sourcepub async fn remove_staking_addresses(
&self,
addresses: Vec<Address>,
) -> RpcResult<()>
pub async fn remove_staking_addresses( &self, addresses: Vec<Address>, ) -> RpcResult<()>
Remove a vector of addresses used to stake. No confirmation to expect.
sourcepub async fn get_staking_addresses(&self) -> RpcResult<PreHashSet<Address>>
pub async fn get_staking_addresses(&self) -> RpcResult<PreHashSet<Address>>
Return hash-set of staking addresses.
sourcepub async fn node_ban_by_ip(&self, ips: Vec<IpAddr>) -> RpcResult<()>
pub async fn node_ban_by_ip(&self, ips: Vec<IpAddr>) -> RpcResult<()>
Bans given ip address(es) No confirmation to expect.
sourcepub async fn node_ban_by_id(&self, ids: Vec<NodeId>) -> RpcResult<()>
pub async fn node_ban_by_id(&self, ids: Vec<NodeId>) -> RpcResult<()>
Bans given node id(s) No confirmation to expect.
sourcepub async fn node_unban_by_ip(&self, ips: Vec<IpAddr>) -> RpcResult<()>
pub async fn node_unban_by_ip(&self, ips: Vec<IpAddr>) -> RpcResult<()>
Unban given ip address(es) No confirmation to expect.
sourcepub async fn node_unban_by_id(&self, ids: Vec<NodeId>) -> RpcResult<()>
pub async fn node_unban_by_id(&self, ids: Vec<NodeId>) -> RpcResult<()>
Unban given node id(s) No confirmation to expect.
sourcepub async fn node_peers_whitelist(&self) -> RpcResult<Vec<IpAddr>>
pub async fn node_peers_whitelist(&self) -> RpcResult<Vec<IpAddr>>
Returns node peers whitelist IP address(es).
sourcepub async fn node_add_to_peers_whitelist(
&self,
ips: Vec<IpAddr>,
) -> RpcResult<()>
pub async fn node_add_to_peers_whitelist( &self, ips: Vec<IpAddr>, ) -> RpcResult<()>
Add IP address(es) to node peers whitelist.
sourcepub async fn node_remove_from_peers_whitelist(
&self,
ips: Vec<IpAddr>,
) -> RpcResult<()>
pub async fn node_remove_from_peers_whitelist( &self, ips: Vec<IpAddr>, ) -> RpcResult<()>
Remove IP address(es) to node peers whitelist.
sourcepub async fn node_bootstrap_whitelist(&self) -> RpcResult<Vec<IpAddr>>
pub async fn node_bootstrap_whitelist(&self) -> RpcResult<Vec<IpAddr>>
Returns node bootstrap whitelist IP address(es).
sourcepub async fn node_bootstrap_whitelist_allow_all(&self) -> RpcResult<()>
pub async fn node_bootstrap_whitelist_allow_all(&self) -> RpcResult<()>
Allow everyone to bootstrap from the node. remove bootstrap whitelist configuration file.
sourcepub async fn node_add_to_bootstrap_whitelist(
&self,
ips: Vec<IpAddr>,
) -> RpcResult<()>
pub async fn node_add_to_bootstrap_whitelist( &self, ips: Vec<IpAddr>, ) -> RpcResult<()>
Add IP address(es) to node bootstrap whitelist.
sourcepub async fn node_remove_from_bootstrap_whitelist(
&self,
ips: Vec<IpAddr>,
) -> RpcResult<()>
pub async fn node_remove_from_bootstrap_whitelist( &self, ips: Vec<IpAddr>, ) -> RpcResult<()>
Remove IP address(es) to bootstrap whitelist.
sourcepub async fn node_bootstrap_blacklist(&self) -> RpcResult<Vec<IpAddr>>
pub async fn node_bootstrap_blacklist(&self) -> RpcResult<Vec<IpAddr>>
Returns node bootstrap blacklist IP address(es).
sourcepub async fn node_add_to_bootstrap_blacklist(
&self,
ips: Vec<IpAddr>,
) -> RpcResult<()>
pub async fn node_add_to_bootstrap_blacklist( &self, ips: Vec<IpAddr>, ) -> RpcResult<()>
Add IP address(es) to node bootstrap blacklist.
sourcepub async fn node_remove_from_bootstrap_blacklist(
&self,
ips: Vec<IpAddr>,
) -> RpcResult<()>
pub async fn node_remove_from_bootstrap_blacklist( &self, ips: Vec<IpAddr>, ) -> RpcResult<()>
Remove IP address(es) to bootstrap blacklist.
sourcepub async fn get_status(&self) -> RpcResult<NodeStatus>
pub async fn get_status(&self) -> RpcResult<NodeStatus>
summary of the current state: time, last final blocks (hash, thread, slot, timestamp), clique count, connected nodes count
sourcepub async fn get_slots_transfers(
&self,
slots: Vec<Slot>,
) -> RpcResult<Vec<Vec<Transfer>>>
pub async fn get_slots_transfers( &self, slots: Vec<Slot>, ) -> RpcResult<Vec<Vec<Transfer>>>
Returns the transfers for slots
pub(crate) async fn _get_cliques(&self) -> RpcResult<Vec<Clique>>
sourcepub(crate) async fn _get_stakers(&self) -> RpcResult<PreHashMap<Address, u64>>
pub(crate) async fn _get_stakers(&self) -> RpcResult<PreHashMap<Address, u64>>
Returns the active stakers and their roll counts for the current cycle.
sourcepub async fn get_operations(
&self,
operation_ids: Vec<OperationId>,
) -> RpcResult<Vec<OperationInfo>>
pub async fn get_operations( &self, operation_ids: Vec<OperationId>, ) -> RpcResult<Vec<OperationInfo>>
Returns operation(s) information associated to a given list of operation(s) ID(s).
sourcepub async fn get_endorsements(
&self,
endorsement_ids: Vec<EndorsementId>,
) -> RpcResult<Vec<EndorsementInfo>>
pub async fn get_endorsements( &self, endorsement_ids: Vec<EndorsementId>, ) -> RpcResult<Vec<EndorsementInfo>>
Returns endorsement(s) information associated to a given list of endorsement(s) ID(s)
sourcepub async fn get_blocks(
&self,
block_ids: Vec<BlockId>,
) -> RpcResult<Vec<BlockInfo>>
pub async fn get_blocks( &self, block_ids: Vec<BlockId>, ) -> RpcResult<Vec<BlockInfo>>
Returns block(s) information associated to a given list of block(s) ID(s)
sourcepub async fn get_filtered_sc_output_event(
&self,
filter: EventFilter,
) -> RpcResult<Vec<SCOutputEvent>>
pub async fn get_filtered_sc_output_event( &self, filter: EventFilter, ) -> RpcResult<Vec<SCOutputEvent>>
Get events emitted by smart contracts with various filters
sourcepub(crate) async fn _get_graph_interval(
&self,
time_interval: TimeInterval,
) -> RpcResult<Vec<BlockSummary>>
pub(crate) async fn _get_graph_interval( &self, time_interval: TimeInterval, ) -> RpcResult<Vec<BlockSummary>>
Get the block graph within the specified time interval.
Optional parameters: from <time_start> (included) and to <time_end> (excluded) millisecond timestamp
sourcepub async fn get_addresses(
&self,
addresses: Vec<Address>,
) -> RpcResult<Vec<AddressInfo>>
pub async fn get_addresses( &self, addresses: Vec<Address>, ) -> RpcResult<Vec<AddressInfo>>
Get info by addresses
sourcepub async fn get_datastore_entries(
&self,
input: Vec<DatastoreEntryInput>,
) -> RpcResult<Vec<DatastoreEntryOutput>>
pub async fn get_datastore_entries( &self, input: Vec<DatastoreEntryInput>, ) -> RpcResult<Vec<DatastoreEntryOutput>>
Get datastore entries
sourcepub async fn send_operations(
&self,
operations: Vec<OperationInput>,
) -> RpcResult<Vec<OperationId>>
pub async fn send_operations( &self, operations: Vec<OperationInput>, ) -> RpcResult<Vec<OperationId>>
Adds operations to pool. Returns operations that were ok and sent to pool.
sourcepub async fn execute_read_only_bytecode(
&self,
read_only_execution: ReadOnlyBytecodeExecution,
) -> RpcResult<ExecuteReadOnlyResponse>
pub async fn execute_read_only_bytecode( &self, read_only_execution: ReadOnlyBytecodeExecution, ) -> RpcResult<ExecuteReadOnlyResponse>
execute read only bytecode
sourcepub async fn execute_read_only_call(
&self,
read_only_execution: ReadOnlyCall,
) -> RpcResult<ExecuteReadOnlyResponse>
pub async fn execute_read_only_call( &self, read_only_execution: ReadOnlyCall, ) -> RpcResult<ExecuteReadOnlyResponse>
execute read only SC call
Auto Trait Implementations§
impl Freeze for RpcClient
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl !UnwindSafe for RpcClient
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.