Skip to main content

Client

Struct Client 

Source
pub struct Client {
Show 31 fields pub api_url: String, pub ws_url: String, pub default_sub_account_id: Option<String>, pub default_account_id: Option<String>, pub catalogs: Arc<Manager>, pub realtime: Client, pub auth: AuthService, pub market_data: MarketDataService, pub market_overview: MarketOverviewService, pub zipper: ZipperService, pub chain_analytics: ChainAnalyticsService, pub heatmap: HeatmapService, pub lifecycle: LifecycleService, pub balances: BalancesService, pub orderbook: OrderbookService, pub orders: OrdersService, pub trades: TradesService, pub triggers: TriggersService, pub transfers: TransfersService, pub internal_transfers: InternalTransfersService, pub deposit: DepositService, pub api_keys: ApiKeysService, pub policies: PoliciesService, pub sub_accounts: SubAccountsService, pub address_book: AddressBookService, pub social_verification: SocialVerificationService, pub whiteboard: WhiteboardService, pub polychart: PolychartService, pub layout: LayoutService, pub guard_signer: GuardSignerService, pub withdraw: WithdrawService, /* private fields */
}
Expand description

Async Polyester SDK entrypoint.

Fields§

§api_url: String§ws_url: String§default_sub_account_id: Option<String>§default_account_id: Option<String>§catalogs: Arc<Manager>§realtime: Client§auth: AuthService§market_data: MarketDataService§market_overview: MarketOverviewService§zipper: ZipperService§chain_analytics: ChainAnalyticsService§heatmap: HeatmapService§lifecycle: LifecycleService§balances: BalancesService§orderbook: OrderbookService§orders: OrdersService§trades: TradesService§triggers: TriggersService§transfers: TransfersService§internal_transfers: InternalTransfersService§deposit: DepositService§api_keys: ApiKeysService§policies: PoliciesService§sub_accounts: SubAccountsService§address_book: AddressBookService§social_verification: SocialVerificationService§whiteboard: WhiteboardService§polychart: PolychartService§layout: LayoutService§guard_signer: GuardSignerService§withdraw: WithdrawService

Implementations§

Source§

impl Client

Source

pub fn new(config: Config) -> Result<Self>

Source

pub fn from_env() -> Result<Self>

Build from POLYESTER_API_KEY_ID / POLYESTER_API_PRIVATE_KEY / POLYESTER_ACCOUNT_ID.

Source

pub async fn hydrate_catalogs(&self) -> Result<()>

Hydrate spot + zipper catalogs. Returns an error when either fetch or parse leaves catalogs unusable.

Source

pub async fn wait_for_catalogs(&self) -> Result<()>

Wait until construction-time catalog hydration finishes.

Returns Err when hydration failed (HTTP/transport error, malformed config, or invalid scales). Concurrent waiters share one attempt.

Returns immediately when hydration was disabled in Config.

Source

pub fn catalogs_last_error(&self) -> Option<Error>

Most recent catalog hydration error, if any.

Auto Trait Implementations§

§

impl !Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl !UnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnsafeUnpin for Client

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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