pub struct SecureClient { /* private fields */ }Expand description
Authenticated Polymarket client for trading and account-scoped CLOB operations.
Implementations§
Source§impl SecureClient
impl SecureClient
pub fn builder() -> SecureClientBuilder
pub fn public(&self) -> &PublicClient
pub fn credentials(&self) -> &ApiCredentials
pub fn wallet(&self) -> Address
pub fn environment(&self) -> &Environment
Sourcepub async fn setup_trading_approvals(
&self,
) -> Result<(), SetupTradingApprovalsError>
pub async fn setup_trading_approvals( &self, ) -> Result<(), SetupTradingApprovalsError>
Syncs balance/allowance state with the CLOB. Call before first trade.
pub async fn place_limit_order( &self, request: PlaceLimitOrderRequest, ) -> Result<PlaceOrderResponse, PlaceOrderError>
pub async fn place_market_order( &self, request: PlaceMarketOrderRequest, ) -> Result<PlaceOrderResponse, PlaceOrderError>
pub async fn fetch_order( &self, request: FetchOrderRequest, ) -> Result<OpenOrder, FetchOrderError>
pub async fn list_open_orders( &self, request: ListOpenOrdersRequest, ) -> Result<Vec<OpenOrder>, ListOpenOrdersError>
pub async fn cancel_order( &self, request: CancelOrderRequest, ) -> Result<CancelOrderResponse, CancelOrderError>
pub async fn cancel_market_orders( &self, request: CancelMarketOrdersRequest, ) -> Result<CancelOrderResponse, CancelOrderError>
Source§impl SecureClient
impl SecureClient
pub fn list_positions( &self, request: ListPositionsRequest, ) -> Result<ListPositionsPaginator, ListPositionsError>
pub async fn fetch_portfolio_value( &self, request: FetchPortfolioValueRequest, ) -> Result<Vec<PortfolioValue>, FetchPortfolioValueError>
pub fn list_activity( &self, request: ListActivityRequest, ) -> Result<ListActivityPaginator, ListActivityError>
pub async fn list_account_trades( &self, request: ListAccountTradesRequest, ) -> Result<Vec<AccountTrade>, ListAccountTradesError>
pub async fn fetch_notifications( &self, ) -> Result<Vec<Notification>, FetchNotificationsError>
pub async fn fetch_order_scoring( &self, request: FetchOrderScoringRequest, ) -> Result<bool, FetchOrderScoringError>
pub async fn list_current_rewards( &self, ) -> Result<Vec<CurrentReward>, ListCurrentRewardsError>
Source§impl SecureClient
impl SecureClient
pub async fn split_position( &self, request: SplitPositionRequest, ) -> Result<TransactionOutcome, WalletOperationError>
pub async fn merge_positions( &self, request: MergePositionsRequest, ) -> Result<TransactionOutcome, WalletOperationError>
pub async fn redeem_positions( &self, request: RedeemPositionsRequest, ) -> Result<TransactionOutcome, WalletOperationError>
Source§impl SecureClient
impl SecureClient
Sourcepub fn subscribe(
&self,
specs: Vec<SubscriptionSpec>,
) -> Result<SubscriptionHandle, SubscribeError>
pub fn subscribe( &self, specs: Vec<SubscriptionSpec>, ) -> Result<SubscriptionHandle, SubscribeError>
Subscribe to realtime channels, including authenticated user events.
Methods from Deref<Target = PublicClient>§
pub fn environment(&self) -> &Environment
pub fn list_markets( &self, request: ListMarketsRequest, ) -> Result<Paginator<Vec<Market>, ListMarketsError>, UserInputError>
pub async fn fetch_market( &self, request: FetchMarketRequest, ) -> Result<Market, FetchMarketError>
pub fn list_events( &self, request: ListEventsRequest, ) -> Result<Paginator<Vec<Event>, ListEventsError>, UserInputError>
pub async fn fetch_midpoint( &self, request: FetchMidpointRequest, ) -> Result<String, FetchMidpointError>
pub async fn fetch_order_book( &self, request: FetchOrderBookRequest, ) -> Result<OrderBook, FetchOrderBookError>
pub fn list_positions( &self, request: ListPositionsRequest, ) -> Result<ListPositionsPaginator, ListPositionsError>
pub async fn fetch_portfolio_value( &self, request: FetchPortfolioValueRequest, ) -> Result<Vec<PortfolioValue>, FetchPortfolioValueError>
pub fn list_activity( &self, request: ListActivityRequest, ) -> Result<ListActivityPaginator, ListActivityError>
Sourcepub fn subscribe(
&self,
specs: Vec<SubscriptionSpec>,
) -> Result<SubscriptionHandle, SubscribeError>
pub fn subscribe( &self, specs: Vec<SubscriptionSpec>, ) -> Result<SubscriptionHandle, SubscribeError>
Subscribe to one or more realtime channels.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SecureClient
impl !UnwindSafe for SecureClient
impl Freeze for SecureClient
impl Send for SecureClient
impl Sync for SecureClient
impl Unpin for SecureClient
impl UnsafeUnpin for SecureClient
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more