Skip to main content

Accounts

Struct Accounts 

Source
pub struct Accounts<'a> { /* private fields */ }
Expand description

Accounts dispatcher.

Check the example.

Implementations§

Source§

impl<'a> Accounts<'a>

Source

pub async fn get_subaccounts( &self, address: &Address, ) -> Result<AddressResponse, Error>

Query for all subaccounts infos.

Compare with Self::get_subaccount.

Reference.

Source

pub async fn get_subaccount( &self, subaccount: &Subaccount, ) -> Result<SubaccountResponseObject, Error>

Query for the subaccount, its current perpetual and asset positions, margin and collateral.

Reference.

Source

pub async fn get_parent_subaccount( &self, subaccount: &ParentSubaccount, ) -> Result<ParentSubaccountResponseObject, Error>

Query for the parent subaccount, its child subaccounts, equity, collateral and margin.

Reference.

Source

pub async fn list_positions( &self, subaccount: &Subaccount, opts: Option<ListPositionsOpts>, ) -> Result<Vec<PerpetualPositionResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_subaccount_perpetual_positions instead

Source

pub async fn get_subaccount_perpetual_positions( &self, subaccount: &Subaccount, opts: Option<ListPositionsOpts>, ) -> Result<Vec<PerpetualPositionResponseObject>, Error>

Source

pub async fn list_parent_positions( &self, subaccount: &ParentSubaccount, opts: Option<ListPositionsOpts>, ) -> Result<Vec<PerpetualPositionResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_parent_subaccount_perpetual_positions instead

List all positions of a parent subaccount.

Reference.

Source

pub async fn get_parent_subaccount_perpetual_positions( &self, subaccount: &ParentSubaccount, opts: Option<ListPositionsOpts>, ) -> Result<Vec<PerpetualPositionResponseObject>, Error>

List all positions of a parent subaccount.

Reference.

Source

pub async fn get_asset_positions( &self, subaccount: &Subaccount, ) -> Result<Vec<AssetPositionResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_subaccount_asset_positions instead

Query for asset positions (size, buy/sell etc).

Reference.

Source

pub async fn get_subaccount_asset_positions( &self, subaccount: &Subaccount, ) -> Result<Vec<AssetPositionResponseObject>, Error>

Query for asset positions (size, buy/sell etc).

Reference.

Source

pub async fn get_parent_asset_positions( &self, subaccount: &ParentSubaccount, ) -> Result<Vec<AssetPositionResponseObject>, Error>

Query for asset positions (size, buy/sell etc) for a parent subaccount.

Reference.

Source

pub async fn get_transfers( &self, subaccount: &Subaccount, opts: Option<GetTransfersOpts>, ) -> Result<Vec<TransferResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_subaccount_transfers instead

Query for transfers between subaccounts.

See also crate::node::NodeClient::transfer.

Reference.

Source

pub async fn get_subaccount_transfers( &self, subaccount: &Subaccount, opts: Option<GetTransfersOpts>, ) -> Result<Vec<TransferResponseObject>, Error>

Query for transfers between subaccounts.

See also crate::node::NodeClient::transfer.

Reference.

Source

pub async fn get_parent_transfers( &self, subaccount: &ParentSubaccount, opts: Option<GetTransfersOpts>, ) -> Result<Vec<ParentSubaccountTransferResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_parent_subaccount_number_transfers instead

Query for transfers between subaccounts associated with a parent subaccount.

See also crate::node::NodeClient::transfer.

Reference.

Source

pub async fn get_parent_subaccount_number_transfers( &self, subaccount: &ParentSubaccount, opts: Option<GetTransfersOpts>, ) -> Result<Vec<ParentSubaccountTransferResponseObject>, Error>

Query for transfers between subaccounts associated with a parent subaccount.

See also crate::node::NodeClient::transfer.

Reference.

Source

pub async fn list_orders( &self, subaccount: &Subaccount, opts: Option<ListOrdersOpts>, ) -> Result<ListOrdersResponse, Error>

👎Deprecated since 0.3.0:

Use get_subaccount_orders instead

Query for orders filtered by order params.

Reference.

Source

pub async fn get_subaccount_orders( &self, subaccount: &Subaccount, opts: Option<ListOrdersOpts>, ) -> Result<ListOrdersResponse, Error>

Query for orders filtered by order params.

Reference.

Source

pub async fn list_parent_orders( &self, subaccount: &ParentSubaccount, opts: Option<ListOrdersOpts>, ) -> Result<ListOrdersResponse, Error>

👎Deprecated since 0.3.0:

Use get_parent_subaccount_number_orders instead

Query for orders filtered by order params of a parent subaccount.

Reference.

Source

pub async fn get_parent_subaccount_number_orders( &self, subaccount: &ParentSubaccount, opts: Option<ListOrdersOpts>, ) -> Result<ListOrdersResponse, Error>

Query for orders filtered by order params of a parent subaccount.

Reference.

Source

pub async fn get_order( &self, order_id: &OrderId, ) -> Result<OrderResponseObject, Error>

Query for the order.

Reference.

Source

pub async fn get_fills( &self, subaccount: &Subaccount, opts: Option<GetFillsOpts>, ) -> Result<Vec<FillResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_subaccount_fills instead

Query for fills (i.e. filled orders data).

Reference.

Source

pub async fn get_subaccount_fills( &self, subaccount: &Subaccount, opts: Option<GetFillsOpts>, ) -> Result<Vec<FillResponseObject>, Error>

Query for fills (i.e. filled orders data).

Reference.

Source

pub async fn get_parent_fills( &self, subaccount: &ParentSubaccount, opts: Option<GetFillsOpts>, ) -> Result<Vec<FillResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_parent_subaccount_number_fills instead

Query for fills (i.e. filled orders data) for a parent subaccount.

Reference.

Source

pub async fn get_parent_subaccount_number_fills( &self, subaccount: &ParentSubaccount, opts: Option<GetFillsOpts>, ) -> Result<Vec<FillResponseObject>, Error>

Query for fills (i.e. filled orders data) for a parent subaccount.

Reference.

Source

pub async fn get_historical_pnl( &self, subaccount: &Subaccount, opts: Option<GetHistoricalPnlOpts>, ) -> Result<Vec<PnlTicksResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_subaccount_historical_pnls instead

Query for profit and loss report for the specified time/block range.

Reference.

Source

pub async fn get_subaccount_historical_pnls( &self, subaccount: &Subaccount, opts: Option<GetHistoricalPnlOpts>, ) -> Result<Vec<PnlTicksResponseObject>, Error>

Query for profit and loss report for the specified time/block range.

Reference.

Source

pub async fn get_parent_historical_pnl( &self, subaccount: &ParentSubaccount, opts: Option<GetHistoricalPnlOpts>, ) -> Result<Vec<PnlTicksResponseObject>, Error>

👎Deprecated since 0.3.0:

Use get_parent_subaccount_number_historical_pnls instead

Query for profit and loss report for the specified time/block range of a parent subaccount.

Reference.

Source

pub async fn get_parent_subaccount_number_historical_pnls( &self, subaccount: &ParentSubaccount, opts: Option<GetHistoricalPnlOpts>, ) -> Result<Vec<PnlTicksResponseObject>, Error>

Query for profit and loss report for the specified time/block range of a parent subaccount.

Reference.

Source

pub async fn get_rewards( &self, address: &Address, opts: Option<GetTradingRewardsOpts>, ) -> Result<Vec<HistoricalBlockTradingReward>, Error>

👎Deprecated since 0.3.0:

Use get_historical_block_trading_rewards instead

Get trader’s rewards.

See also Trading Rewards.

Reference.

Source

pub async fn get_historical_block_trading_rewards( &self, address: &Address, opts: Option<GetTradingRewardsOpts>, ) -> Result<Vec<HistoricalBlockTradingReward>, Error>

Get trader’s rewards.

See also Trading Rewards.

Reference.

Source

pub async fn get_rewards_aggregated( &self, address: &Address, period: TradingRewardAggregationPeriod, opts: Option<GetAggregationsOpts>, ) -> Result<Vec<HistoricalTradingRewardAggregation>, Error>

👎Deprecated since 0.3.0:

Use get_historical_trading_rewards_aggregations instead

Get trader’s rewards aggregation.

See also Self::get_historical_block_trading_rewards.

Reference.

Source

pub async fn get_historical_trading_rewards_aggregations( &self, address: &Address, period: TradingRewardAggregationPeriod, opts: Option<GetAggregationsOpts>, ) -> Result<Vec<HistoricalTradingRewardAggregation>, Error>

Get trader’s rewards aggregation.

See also Self::get_historical_block_trading_rewards.

Reference.

Source

pub async fn get_transfers_between( &self, source_subaccount: &Subaccount, recipient_subaccount: &Subaccount, opts: Option<GetTransfersBetweenOpts>, ) -> Result<TransferBetweenResponse, Error>

Query for transfers between subaccounts.

Reference

Source

pub async fn search_trader( &self, search_param: &str, ) -> Result<TraderSearchResponse, Error>

Search trader by query string (address, subaccount id, username, etc).

Reference

Source

pub async fn get_funding_payments( &self, subaccount: &Subaccount, opts: Option<GetFundingPaymentsOpts>, ) -> Result<FundingPaymentResponse, Error>

Query for funding payments.

Reference.

Source

pub async fn get_funding_payments_for_parent_subaccount( &self, subaccount: &ParentSubaccount, opts: Option<GetFundingPaymentsOpts>, ) -> Result<FundingPaymentResponse, Error>

Query for funding payments for a parent subaccount.

Reference.

Auto Trait Implementations§

§

impl<'a> Freeze for Accounts<'a>

§

impl<'a> !RefUnwindSafe for Accounts<'a>

§

impl<'a> Send for Accounts<'a>

§

impl<'a> Sync for Accounts<'a>

§

impl<'a> Unpin for Accounts<'a>

§

impl<'a> UnsafeUnpin for Accounts<'a>

§

impl<'a> !UnwindSafe for Accounts<'a>

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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