Skip to main content

NativeClient

Struct NativeClient 

Source
pub struct NativeClient<C> { /* private fields */ }
Expand description

A native adapter around a caller-owned JSON-RPC transport. Calls submit exactly once. Unknown result variants retain their complete raw result.

Implementations§

Source§

impl<C> NativeClient<C>

Source

pub fn new(inner: C) -> NativeClient<C>

Wrap an existing transport without connecting or changing its settings.

Source

pub fn into_inner(self) -> C

Recover the caller’s transport.

Source§

impl<C> NativeClient<C>
where C: ClientT + Sync,

Source

pub async fn get_version_info( &self, request: EmptyRequest, ) -> Result<DecodedResponse<VersionInfo>, NativeClientError>

Describe compatibility and configured methods. Accepts omitted params, {}, [], or null; clients send {}.

Source

pub async fn get_network_info( &self, request: EmptyRequest, ) -> Result<DecodedResponse<NetworkInfo>, NativeClientError>

Read the signing network identity. Accepts omitted params, {}, [], or null; clients send {}.

Source

pub async fn get_chain_tip( &self, request: EmptyRequest, ) -> Result<DecodedResponse<ChainTip>, NativeClientError>

Read the committed chain tip. Accepts omitted params, {}, [], or null; clients send {}.

Source

pub async fn get_chain_config( &self, request: EmptyRequest, ) -> Result<DecodedResponse<ChainConfig>, NativeClientError>

Read the chain configuration and observation height. Accepts omitted params, {}, [], or null; clients send {}.

Source

pub async fn get_server_limits( &self, request: EmptyRequest, ) -> Result<DecodedResponse<ServerLimits>, NativeClientError>

Read configured request limits. Accepts omitted params, {}, [], or null; clients send {}.

Source

pub async fn send_transaction( &self, request: SendTransactionRequest, ) -> Result<DecodedResponse<SendTransactionResult>, NativeClientError>

Submit a signed envelope for authoritative admission.

Source

pub async fn get_transaction_status( &self, request: TransactionQuery, ) -> Result<DecodedResponse<TransactionStatus>, NativeClientError>

Read retained transaction observations.

Source

pub async fn get_transaction_receipt( &self, request: TransactionQuery, ) -> Result<DecodedResponse<Option<TransactionReceipt>>, NativeClientError>

Read indexed execution, or null when no receipt is available.

Source

pub async fn simulate_invocation( &self, request: SimulateInvocationRequest, ) -> Result<DecodedResponse<SimulationResult>, NativeClientError>

Simulate an invocation without committing state.

Source

pub async fn simulate_invocations( &self, request: SimulateInvocationsRequest, ) -> Result<DecodedResponse<SimulationResults>, NativeClientError>

Simulate a batch against one state snapshot.

Source

pub async fn get_storage( &self, request: StorageQuery, ) -> Result<DecodedResponse<StorageResult>, NativeClientError>

Read serialized storage at an address.

Source

pub async fn get_balance( &self, request: AddressQuery, ) -> Result<DecodedResponse<BalanceResult>, NativeClientError>

Read native token balance and its state height.

Source

pub async fn get_registered_auth( &self, request: AddressQuery, ) -> Result<DecodedResponse<RegisteredAuthResult>, NativeClientError>

Read registered authorization at an address.

Source

pub async fn get_events( &self, request: EventQuery, ) -> Result<DecodedResponse<EventPage>, NativeClientError>

Scan indexed events matching the supplied filters.

Source

pub async fn get_transactions_by_root_address( &self, request: RootAddressQuery, ) -> Result<DecodedResponse<TransactionRefPage>, NativeClientError>

Read transactions whose root invocation targets the address, excluding internal calls and incoming transfers.

Source

pub async fn get_block_by_height( &self, request: BlockQuery, ) -> Result<DecodedResponse<Option<BlockInfo>>, NativeClientError>

Read committed block metadata, or null when unavailable.

Source

pub async fn get_transactions_by_block( &self, request: BlockPageRequest, ) -> Result<DecodedResponse<TransactionRefPage>, NativeClientError>

Read a page of transactions in a committed block.

Source

pub async fn request_airdrop( &self, request: AirdropRequest, ) -> Result<DecodedResponse<AirdropAttempt>, NativeClientError>

Request one faucet funding attempt. Receipt polling is a separate operation.

Source

pub async fn fund_account( &self, request: FundAccountRequest, ) -> Result<DecodedResponse<FundingSubmission>, NativeClientError>

Submit a local funding transfer.

Source

pub async fn get_pending_transaction_count( &self, request: EmptyRequest, ) -> Result<DecodedResponse<PendingTransactionCount>, NativeClientError>

Read the local scheduler pending count. Accepts omitted params, {}, [], or null; clients send {}.

Trait Implementations§

Source§

impl<C> Clone for NativeClient<C>
where C: Clone,

Source§

fn clone(&self) -> NativeClient<C>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C> Debug for NativeClient<C>
where C: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<C> ReceiptSource for NativeClient<C>
where C: ClientT + Sync,

Source§

async fn transaction_receipt( &self, hash: TxHash, ) -> Result<DecodedResponse<Option<TransactionReceipt>>, NativeClientError>

Read the committed receipt, including failed execution, or current absence.
Source§

async fn transaction_status( &self, hash: TxHash, ) -> Result<DecodedResponse<TransactionStatus>, NativeClientError>

Read an advisory status. Errors do not erase prior observations.

Auto Trait Implementations§

§

impl<C> Freeze for NativeClient<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for NativeClient<C>
where C: RefUnwindSafe,

§

impl<C> Send for NativeClient<C>
where C: Send,

§

impl<C> Sync for NativeClient<C>
where C: Sync,

§

impl<C> Unpin for NativeClient<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for NativeClient<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for NativeClient<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StaticIfNoAlloc for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more