Struct AlgodClient

Source
pub struct AlgodClient { /* private fields */ }
Expand description

Client for interacting with the Algorand protocol daemon

Implementations§

Source§

impl AlgodClient

Source

pub fn new(address: &str, token: &str) -> AlgodClient

Source

pub fn new_with_headers( address: &str, token: &str, headers: HeaderMap, ) -> AlgodClient

Source

pub fn health(&self) -> Result<(), Error>

Returns Ok if healthy

Source

pub fn versions(&self) -> Result<Version, Error>

Retrieves the current version

Source

pub fn status(&self) -> Result<NodeStatus, Error>

Gets the current node status

Source

pub fn status_after_block(&self, round: Round) -> Result<NodeStatus, Error>

Waits for a block to appear after the specified round and returns the node status at the time

Source

pub fn block(&self, round: Round) -> Result<Block, Error>

Get the block for the given round

Source

pub fn ledger_supply(&self) -> Result<Supply, Error>

Gets the current supply reported by the ledger

Source

pub fn account_information(&self, address: &str) -> Result<Account, Error>

Source

pub fn pending_transactions( &self, limit: u64, ) -> Result<PendingTransactions, Error>

Gets a list of unconfirmed transactions currently in the transaction pool

Sorted by priority in decreasing order and truncated at the specified limit, or returns all if specified limit is 0

Source

pub fn pending_transaction_information( &self, transaction_id: &str, ) -> Result<Transaction, Error>

Get a specified pending transaction

Source

pub fn transactions( &self, address: &str, first_round: Option<Round>, last_round: Option<Round>, from_date: Option<String>, to_date: Option<String>, limit: Option<u64>, ) -> Result<TransactionList, Error>

Get a list of confirmed transactions, limited to filters if specified

Source

pub fn send_transaction( &self, signed_transaction: &SignedTransaction, ) -> Result<TransactionID, Error>

Broadcasts a transaction to the network

Source

pub fn raw_transaction(&self, raw: &[u8]) -> Result<TransactionID, Error>

Broadcasts a raw transaction to the network

Source

pub fn transaction(&self, transaction_id: &str) -> Result<Transaction, Error>

Gets the information of a single transaction

Source

pub fn transaction_information( &self, address: &str, transaction_id: &str, ) -> Result<Transaction, Error>

Gets a specific confirmed transaction

Source

pub fn suggested_fee(&self) -> Result<TransactionFee, Error>

Gets suggested fee in units of micro-Algos per byte

Source

pub fn transaction_params(&self) -> Result<TransactionParams, Error>

Gets parameters for constructing a new transaction

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 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<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

Source§

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

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,