pub struct Accounts<'a> { /* private fields */ }Expand description
Accounts dispatcher.
Check the example.
Implementations§
Source§impl<'a> Accounts<'a>
impl<'a> Accounts<'a>
Sourcepub async fn get_subaccounts(
&self,
address: &Address,
) -> Result<AddressResponse, Error>
pub async fn get_subaccounts( &self, address: &Address, ) -> Result<AddressResponse, Error>
Sourcepub async fn get_subaccount(
&self,
subaccount: &Subaccount,
) -> Result<SubaccountResponseObject, Error>
pub async fn get_subaccount( &self, subaccount: &Subaccount, ) -> Result<SubaccountResponseObject, Error>
Query for the subaccount, its current perpetual and asset positions, margin and collateral.
Sourcepub async fn get_parent_subaccount(
&self,
subaccount: &ParentSubaccount,
) -> Result<ParentSubaccountResponseObject, Error>
pub async fn get_parent_subaccount( &self, subaccount: &ParentSubaccount, ) -> Result<ParentSubaccountResponseObject, Error>
Query for the parent subaccount, its child subaccounts, equity, collateral and margin.
Sourcepub 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
pub async fn list_positions( &self, subaccount: &Subaccount, opts: Option<ListPositionsOpts>, ) -> Result<Vec<PerpetualPositionResponseObject>, Error>
Use get_subaccount_perpetual_positions instead
Check the example.
Sourcepub async fn get_subaccount_perpetual_positions(
&self,
subaccount: &Subaccount,
opts: Option<ListPositionsOpts>,
) -> Result<Vec<PerpetualPositionResponseObject>, Error>
pub async fn get_subaccount_perpetual_positions( &self, subaccount: &Subaccount, opts: Option<ListPositionsOpts>, ) -> Result<Vec<PerpetualPositionResponseObject>, Error>
Check the example.
Sourcepub 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
pub async fn list_parent_positions( &self, subaccount: &ParentSubaccount, opts: Option<ListPositionsOpts>, ) -> Result<Vec<PerpetualPositionResponseObject>, Error>
Use get_parent_subaccount_perpetual_positions instead
List all positions of a parent subaccount.
Sourcepub async fn get_parent_subaccount_perpetual_positions(
&self,
subaccount: &ParentSubaccount,
opts: Option<ListPositionsOpts>,
) -> Result<Vec<PerpetualPositionResponseObject>, Error>
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.
Sourcepub async fn get_asset_positions(
&self,
subaccount: &Subaccount,
) -> Result<Vec<AssetPositionResponseObject>, Error>
👎Deprecated since 0.3.0: Use get_subaccount_asset_positions instead
pub async fn get_asset_positions( &self, subaccount: &Subaccount, ) -> Result<Vec<AssetPositionResponseObject>, Error>
Use get_subaccount_asset_positions instead
Query for asset positions (size, buy/sell etc).
Sourcepub async fn get_subaccount_asset_positions(
&self,
subaccount: &Subaccount,
) -> Result<Vec<AssetPositionResponseObject>, Error>
pub async fn get_subaccount_asset_positions( &self, subaccount: &Subaccount, ) -> Result<Vec<AssetPositionResponseObject>, Error>
Query for asset positions (size, buy/sell etc).
Sourcepub async fn get_parent_asset_positions(
&self,
subaccount: &ParentSubaccount,
) -> Result<Vec<AssetPositionResponseObject>, Error>
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.
Sourcepub async fn get_transfers(
&self,
subaccount: &Subaccount,
opts: Option<GetTransfersOpts>,
) -> Result<Vec<TransferResponseObject>, Error>
👎Deprecated since 0.3.0: Use get_subaccount_transfers instead
pub async fn get_transfers( &self, subaccount: &Subaccount, opts: Option<GetTransfersOpts>, ) -> Result<Vec<TransferResponseObject>, Error>
Use get_subaccount_transfers instead
Sourcepub async fn get_subaccount_transfers(
&self,
subaccount: &Subaccount,
opts: Option<GetTransfersOpts>,
) -> Result<Vec<TransferResponseObject>, Error>
pub async fn get_subaccount_transfers( &self, subaccount: &Subaccount, opts: Option<GetTransfersOpts>, ) -> Result<Vec<TransferResponseObject>, Error>
Sourcepub 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
pub async fn get_parent_transfers( &self, subaccount: &ParentSubaccount, opts: Option<GetTransfersOpts>, ) -> Result<Vec<ParentSubaccountTransferResponseObject>, Error>
Use get_parent_subaccount_number_transfers instead
Query for transfers between subaccounts associated with a parent subaccount.
See also crate::node::NodeClient::transfer.
Sourcepub async fn get_parent_subaccount_number_transfers(
&self,
subaccount: &ParentSubaccount,
opts: Option<GetTransfersOpts>,
) -> Result<Vec<ParentSubaccountTransferResponseObject>, Error>
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.
Sourcepub async fn list_orders(
&self,
subaccount: &Subaccount,
opts: Option<ListOrdersOpts>,
) -> Result<ListOrdersResponse, Error>
👎Deprecated since 0.3.0: Use get_subaccount_orders instead
pub async fn list_orders( &self, subaccount: &Subaccount, opts: Option<ListOrdersOpts>, ) -> Result<ListOrdersResponse, Error>
Use get_subaccount_orders instead
Query for orders filtered by order params.
Sourcepub async fn get_subaccount_orders(
&self,
subaccount: &Subaccount,
opts: Option<ListOrdersOpts>,
) -> Result<ListOrdersResponse, Error>
pub async fn get_subaccount_orders( &self, subaccount: &Subaccount, opts: Option<ListOrdersOpts>, ) -> Result<ListOrdersResponse, Error>
Query for orders filtered by order params.
Sourcepub 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
pub async fn list_parent_orders( &self, subaccount: &ParentSubaccount, opts: Option<ListOrdersOpts>, ) -> Result<ListOrdersResponse, Error>
Use get_parent_subaccount_number_orders instead
Query for orders filtered by order params of a parent subaccount.
Sourcepub async fn get_parent_subaccount_number_orders(
&self,
subaccount: &ParentSubaccount,
opts: Option<ListOrdersOpts>,
) -> Result<ListOrdersResponse, Error>
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.
Sourcepub async fn get_order(
&self,
order_id: &OrderId,
) -> Result<OrderResponseObject, Error>
pub async fn get_order( &self, order_id: &OrderId, ) -> Result<OrderResponseObject, Error>
Query for the order.
Sourcepub async fn get_fills(
&self,
subaccount: &Subaccount,
opts: Option<GetFillsOpts>,
) -> Result<Vec<FillResponseObject>, Error>
👎Deprecated since 0.3.0: Use get_subaccount_fills instead
pub async fn get_fills( &self, subaccount: &Subaccount, opts: Option<GetFillsOpts>, ) -> Result<Vec<FillResponseObject>, Error>
Use get_subaccount_fills instead
Query for fills (i.e. filled orders data).
Sourcepub async fn get_subaccount_fills(
&self,
subaccount: &Subaccount,
opts: Option<GetFillsOpts>,
) -> Result<Vec<FillResponseObject>, Error>
pub async fn get_subaccount_fills( &self, subaccount: &Subaccount, opts: Option<GetFillsOpts>, ) -> Result<Vec<FillResponseObject>, Error>
Query for fills (i.e. filled orders data).
Sourcepub 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
pub async fn get_parent_fills( &self, subaccount: &ParentSubaccount, opts: Option<GetFillsOpts>, ) -> Result<Vec<FillResponseObject>, Error>
Use get_parent_subaccount_number_fills instead
Query for fills (i.e. filled orders data) for a parent subaccount.
Sourcepub async fn get_parent_subaccount_number_fills(
&self,
subaccount: &ParentSubaccount,
opts: Option<GetFillsOpts>,
) -> Result<Vec<FillResponseObject>, Error>
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.
Sourcepub 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
pub async fn get_historical_pnl( &self, subaccount: &Subaccount, opts: Option<GetHistoricalPnlOpts>, ) -> Result<Vec<PnlTicksResponseObject>, Error>
Use get_subaccount_historical_pnls instead
Query for profit and loss report for the specified time/block range.
Sourcepub async fn get_subaccount_historical_pnls(
&self,
subaccount: &Subaccount,
opts: Option<GetHistoricalPnlOpts>,
) -> Result<Vec<PnlTicksResponseObject>, Error>
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.
Sourcepub 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
pub async fn get_parent_historical_pnl( &self, subaccount: &ParentSubaccount, opts: Option<GetHistoricalPnlOpts>, ) -> Result<Vec<PnlTicksResponseObject>, Error>
Use get_parent_subaccount_number_historical_pnls instead
Query for profit and loss report for the specified time/block range of a parent subaccount.
Sourcepub async fn get_parent_subaccount_number_historical_pnls(
&self,
subaccount: &ParentSubaccount,
opts: Option<GetHistoricalPnlOpts>,
) -> Result<Vec<PnlTicksResponseObject>, Error>
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.
Sourcepub 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
pub async fn get_rewards( &self, address: &Address, opts: Option<GetTradingRewardsOpts>, ) -> Result<Vec<HistoricalBlockTradingReward>, Error>
Use get_historical_block_trading_rewards instead
Sourcepub async fn get_historical_block_trading_rewards(
&self,
address: &Address,
opts: Option<GetTradingRewardsOpts>,
) -> Result<Vec<HistoricalBlockTradingReward>, Error>
pub async fn get_historical_block_trading_rewards( &self, address: &Address, opts: Option<GetTradingRewardsOpts>, ) -> Result<Vec<HistoricalBlockTradingReward>, Error>
Sourcepub 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
pub async fn get_rewards_aggregated( &self, address: &Address, period: TradingRewardAggregationPeriod, opts: Option<GetAggregationsOpts>, ) -> Result<Vec<HistoricalTradingRewardAggregation>, Error>
Use get_historical_trading_rewards_aggregations instead
Sourcepub async fn get_historical_trading_rewards_aggregations(
&self,
address: &Address,
period: TradingRewardAggregationPeriod,
opts: Option<GetAggregationsOpts>,
) -> Result<Vec<HistoricalTradingRewardAggregation>, Error>
pub async fn get_historical_trading_rewards_aggregations( &self, address: &Address, period: TradingRewardAggregationPeriod, opts: Option<GetAggregationsOpts>, ) -> Result<Vec<HistoricalTradingRewardAggregation>, Error>
Sourcepub async fn get_transfers_between(
&self,
source_subaccount: &Subaccount,
recipient_subaccount: &Subaccount,
opts: Option<GetTransfersBetweenOpts>,
) -> Result<TransferBetweenResponse, Error>
pub async fn get_transfers_between( &self, source_subaccount: &Subaccount, recipient_subaccount: &Subaccount, opts: Option<GetTransfersBetweenOpts>, ) -> Result<TransferBetweenResponse, Error>
Query for transfers between subaccounts.
Sourcepub async fn search_trader(
&self,
search_param: &str,
) -> Result<TraderSearchResponse, Error>
pub async fn search_trader( &self, search_param: &str, ) -> Result<TraderSearchResponse, Error>
Search trader by query string (address, subaccount id, username, etc).
Sourcepub async fn get_funding_payments(
&self,
subaccount: &Subaccount,
opts: Option<GetFundingPaymentsOpts>,
) -> Result<FundingPaymentResponse, Error>
pub async fn get_funding_payments( &self, subaccount: &Subaccount, opts: Option<GetFundingPaymentsOpts>, ) -> Result<FundingPaymentResponse, Error>
Query for funding payments.
Sourcepub async fn get_funding_payments_for_parent_subaccount(
&self,
subaccount: &ParentSubaccount,
opts: Option<GetFundingPaymentsOpts>,
) -> Result<FundingPaymentResponse, Error>
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.
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> 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request