Struct rosetta_client::Client

source ·
pub struct Client { /* private fields */ }
Expand description

The client struct to interface with a rosetta endpoint.

Implementations§

source§

impl Client

source

pub fn new(url: &str) -> Result<Self>

url should have the form http[s]://hostname:port.

source

pub async fn network_list(&self) -> Result<Vec<NetworkIdentifier>>

Make a call to the /network/list endpoint.

source

pub async fn network_options( &self, network_identifier: NetworkIdentifier ) -> Result<NetworkOptionsResponse>

Make a call to the /network/options endpoint.

source

pub async fn network_status( &self, network_identifier: NetworkIdentifier ) -> Result<NetworkStatusResponse>

Make a call to the /network/status endpoint.

source

pub async fn account_balance( &self, request: &AccountBalanceRequest ) -> Result<AccountBalanceResponse>

Make a call to the /account/balance endpoint.

source

pub async fn account_coins( &self, request: &AccountCoinsRequest ) -> Result<AccountCoinsResponse>

Make a call to the /account/coins endpoint.

source

pub async fn account_faucet( &self, request: &AccountFaucetRequest ) -> Result<TransactionIdentifierResponse>

Make a call to the /account/faucet endpoint.

source

pub async fn block(&self, request: &BlockRequest) -> Result<BlockResponse>

Make a call to the /block endpoint.

source

pub async fn block_transaction( &self, request: &BlockTransactionRequest ) -> Result<BlockTransactionResponse>

Make a call to the /block/transaction endpoint.

source

pub async fn mempool( &self, network_identifier: NetworkIdentifier ) -> Result<MempoolResponse>

Make a call to the /mempool endpoint.

source

pub async fn mempool_transaction( &self, request: &MempoolTransactionRequest ) -> Result<MempoolTransactionResponse>

Make a call to the /mempool/transaction endpoint.

source

pub async fn call(&self, request: &CallRequest) -> Result<CallResponse>

Make a call to the /call endpoint.

source

pub async fn construction_combine( &self, request: &ConstructionCombineRequest ) -> Result<ConstructionCombineResponse>

Make a call to the /construction/combine endpoint.

source

pub async fn construction_derive( &self, request: &ConstructionDeriveRequest ) -> Result<ConstructionDeriveResponse>

Make a call to the /construction/derive endpoint.

source

pub async fn construction_hash( &self, request: &ConstructionHashRequest ) -> Result<TransactionIdentifierResponse>

Make a call to the /construction/hash endpoint.

source

pub async fn construction_metadata( &self, request: &ConstructionMetadataRequest ) -> Result<ConstructionMetadataResponse>

Make a call to the /construction/metadata endpoint.

source

pub async fn construction_parse( &self, request: &ConstructionParseRequest ) -> Result<ConstructionParseResponse>

Make a call to the /construction/parse endpoint.

source

pub async fn construction_payloads( &self, request: &ConstructionPayloadsRequest ) -> Result<ConstructionPayloadsResponse>

Make a call to the /construction/payloads endpoint.

source

pub async fn construction_preprocess( &self, request: &ConstructionPreprocessRequest ) -> Result<ConstructionPreprocessResponse>

Make a call to the /construction/preprocess endpoint.

source

pub async fn construction_submit( &self, request: &ConstructionSubmitRequest ) -> Result<TransactionIdentifierResponse>

Make a call to the /construction/submit endpoint.

source

pub async fn events_blocks( &self, request: &EventsBlocksRequest ) -> Result<EventsBlocksResponse>

Make a call to the /events/blocks endpoint.

source

pub async fn search_transactions( &self, request: &SearchTransactionsRequest ) -> Result<SearchTransactionsResponse>

Make a call to the /search/transactions endpoint.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

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

§

fn vzip(self) -> V