Skip to main content

GraphQlClientExt

Trait GraphQlClientExt 

Source
pub trait GraphQlClientExt: GraphQlClient + Sized {
    // Provided methods
    fn clearing_house_orders(
        &self,
        package: Address,
        ch: Address,
        at_checkpoint: Option<u64>,
        asks: bool,
    ) -> impl Stream<Item = Result<(u128, Order), Error<<Self as GraphQlClient>::Error>>> + '_ { ... }
    fn map_orders(
        &self,
        map: Address,
        at_checkpoint: Option<Version>,
    ) -> impl Stream<Item = Result<(u128, Order), Error<<Self as GraphQlClient>::Error>>> + '_ { ... }
    fn order_maps(
        &self,
        package: Address,
        ch: Address,
    ) -> impl Future<Output = Result<OrderMaps, Error<<Self as GraphQlClient>::Error>>> + Send + '_ { ... }
    fn clearing_house_vault(
        &self,
        package: Address,
        ch: Address,
    ) -> impl Future<Output = Result<MoveInstance<Vault>, ChVaultError<Self::Error>>> + Send + '_ { ... }
    fn clearing_house_positions(
        &self,
        ch: Address,
        at_checkpoint: Option<u64>,
    ) -> impl Stream<Item = Result<(u64, MoveInstance<Position>), Error<<Self as GraphQlClient>::Error>>> + '_ { ... }
}
Expand description

Extension trait to GraphQlClient collecting all defined queries in one place.

Provided Methods§

Source

fn clearing_house_orders( &self, package: Address, ch: Address, at_checkpoint: Option<u64>, asks: bool, ) -> impl Stream<Item = Result<(u128, Order), Error<<Self as GraphQlClient>::Error>>> + '_

Snapshot of the orders on one side of the orderbook, rooted at the ClearingHouse id and version.

If you already know the object ID of the orders Map, then map_orders is more efficient.

Source

fn map_orders( &self, map: Address, at_checkpoint: Option<Version>, ) -> impl Stream<Item = Result<(u128, Order), Error<<Self as GraphQlClient>::Error>>> + '_

Snapshot of the orders on one side of the orderbook, rooted at the Map id and ClearingHouse version.

To find the Map id, you can use order_maps.

Source

fn order_maps( &self, package: Address, ch: Address, ) -> impl Future<Output = Result<OrderMaps, Error<<Self as GraphQlClient>::Error>>> + Send + '_

Object IDs of the orderbook and asks/bids maps for a market.

These never change, so you can query them once and save them.

Source

fn clearing_house_vault( &self, package: Address, ch: Address, ) -> impl Future<Output = Result<MoveInstance<Vault>, ChVaultError<Self::Error>>> + Send + '_

The unparsed clearing house’s collateral Vault.

Source

fn clearing_house_positions( &self, ch: Address, at_checkpoint: Option<u64>, ) -> impl Stream<Item = Result<(u64, MoveInstance<Position>), Error<<Self as GraphQlClient>::Error>>> + '_

Snapshot of positions under the ClearingHouse.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§