af_iperps::graphql

Trait GraphQlClientExt

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

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

Provided Methods§

Source

fn clearing_house_orders( &self, package: Address, ch: ObjectId, version: Option<Version>, asks: bool, ) -> impl Stream<Item = Result<(u128, Order), Error<Self::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: ObjectId, ch_version: Option<Version>, ) -> impl Stream<Item = Result<(u128, Order), Error<Self::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: ObjectId, ) -> impl Future<Output = Result<OrderMaps, Error<Self::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: ObjectId, ) -> impl Future<Output = Result<MoveInstance<Vault>, ChVaultError<Self::Error>>> + Send

The unparsed clearing house’s collateral Vault.

Source

fn clearing_house_positions( &self, ch: ObjectId, version: Option<Version>, ) -> impl Stream<Item = Result<(u64, MoveInstance<Position>), Error<Self::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", so this trait is not object safe.

Implementors§