pub struct RestClient { /* private fields */ }Expand description
A Cosmos + QoreChain REST read client.
Implementations§
Source§impl RestClient
impl RestClient
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Creates a RestClient for the given base URL using a fresh HTTP client.
Sourcepub fn with_client(base_url: impl Into<String>, http: Client) -> Self
pub fn with_client(base_url: impl Into<String>, http: Client) -> Self
Creates a RestClient for the given base URL using the supplied HTTP
client (e.g. one shared across the SDK).
Sourcepub async fn get(&self, path: &str, query: &[(&str, &str)]) -> Result<Value>
pub async fn get(&self, path: &str, query: &[(&str, &str)]) -> Result<Value>
Generic GET escape hatch for any documented REST route. The response body
is parsed into a serde_json::Value.
Sourcepub async fn get_all_balances(&self, address: &str) -> Result<Value>
pub async fn get_all_balances(&self, address: &str) -> Result<Value>
Returns all balances for a Cosmos account.
Sourcepub async fn get_ai_stats(&self) -> Result<Value>
pub async fn get_ai_stats(&self) -> Result<Value>
Returns the AI engine statistics.
Sourcepub async fn get_fee_estimate(&self, urgency: &str) -> Result<Value>
pub async fn get_fee_estimate(&self, urgency: &str) -> Result<Value>
Returns an AI-assisted fee estimate for the given urgency
("fast", "normal", "slow").
Sourcepub async fn get_bridge_chains(&self) -> Result<Value>
pub async fn get_bridge_chains(&self) -> Result<Value>
Returns the supported bridge chains.
Sourcepub async fn get_pqc_account(&self, address: &str) -> Result<Value>
pub async fn get_pqc_account(&self, address: &str) -> Result<Value>
Returns the PQC account record for an address.
Sourcepub async fn get_reputation(&self, validator_address: &str) -> Result<Value>
pub async fn get_reputation(&self, validator_address: &str) -> Result<Value>
Returns the reputation record for a validator address.
Sourcepub async fn get_burn_stats(&self) -> Result<Value>
pub async fn get_burn_stats(&self) -> Result<Value>
Returns the token burn statistics.
Sourcepub async fn get_xqore_position(&self, address: &str) -> Result<Value>
pub async fn get_xqore_position(&self, address: &str) -> Result<Value>
Returns the xQORE position for an address.
Sourcepub async fn get_inflation_rate(&self) -> Result<Value>
pub async fn get_inflation_rate(&self) -> Result<Value>
Returns the current inflation rate.
Trait Implementations§
Source§impl Clone for RestClient
impl Clone for RestClient
Source§fn clone(&self) -> RestClient
fn clone(&self) -> RestClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RestClient
impl !UnwindSafe for RestClient
impl Freeze for RestClient
impl Send for RestClient
impl Sync for RestClient
impl Unpin for RestClient
impl UnsafeUnpin for RestClient
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