pub struct Clob { /* private fields */ }Expand description
CLOB (Central Limit Order Book) trading client for Polymarket.
Provides authenticated order creation, signing, and submission, plus read-only
market data and order book access. Use Clob::public() for unauthenticated
read-only access, or Clob::builder() for full trading capabilities.
Implementations§
Source§impl Clob
impl Clob
Sourcepub fn new(
private_key: impl Into<String>,
credentials: Credentials,
) -> Result<Self, ClobError>
pub fn new( private_key: impl Into<String>, credentials: Credentials, ) -> Result<Self, ClobError>
Create a new CLOB client with default configuration
Sourcepub fn builder(
private_key: impl Into<String>,
credentials: Credentials,
) -> Result<ClobBuilder, ClobError>
pub fn builder( private_key: impl Into<String>, credentials: Credentials, ) -> Result<ClobBuilder, ClobError>
Create a new CLOB client builder with required authentication
Sourcepub fn from_account(account: Account) -> Result<Self, ClobError>
pub fn from_account(account: Account) -> Result<Self, ClobError>
Create a new CLOB client from an Account
Sourcepub fn account_api(&self) -> Result<AccountApi, ClobError>
pub fn account_api(&self) -> Result<AccountApi, ClobError>
Get account API namespace
Sourcepub fn notifications(&self) -> Result<Notifications, ClobError>
pub fn notifications(&self) -> Result<Notifications, ClobError>
Get notifications namespace
Sourcepub fn rewards(&self) -> Result<Rewards, ClobError>
pub fn rewards(&self) -> Result<Rewards, ClobError>
Get rewards namespace for liquidity reward operations
Sourcepub async fn create_order(
&self,
params: &CreateOrderParams,
options: Option<PartialCreateOrderOptions>,
) -> Result<Order, ClobError>
pub async fn create_order( &self, params: &CreateOrderParams, options: Option<PartialCreateOrderOptions>, ) -> Result<Order, ClobError>
Create an unsigned order from parameters
Sourcepub async fn create_market_order(
&self,
params: &MarketOrderArgs,
options: Option<PartialCreateOrderOptions>,
) -> Result<Order, ClobError>
pub async fn create_market_order( &self, params: &MarketOrderArgs, options: Option<PartialCreateOrderOptions>, ) -> Result<Order, ClobError>
Create an unsigned market order from parameters
Sourcepub async fn sign_order(&self, order: &Order) -> Result<SignedOrder, ClobError>
pub async fn sign_order(&self, order: &Order) -> Result<SignedOrder, ClobError>
Sign an order using the configured account’s EIP-712 signer.
Sourcepub async fn post_orders(
&self,
orders: &[SignedOrderPayload],
) -> Result<Vec<OrderResponse>, ClobError>
pub async fn post_orders( &self, orders: &[SignedOrderPayload], ) -> Result<Vec<OrderResponse>, ClobError>
Post multiple signed orders (up to 15)
Sourcepub async fn post_order(
&self,
signed_order: &SignedOrder,
order_type: OrderKind,
post_only: bool,
) -> Result<OrderResponse, ClobError>
pub async fn post_order( &self, signed_order: &SignedOrder, order_type: OrderKind, post_only: bool, ) -> Result<OrderResponse, ClobError>
Post a signed order
Sourcepub async fn place_order(
&self,
params: &CreateOrderParams,
options: Option<PartialCreateOrderOptions>,
) -> Result<OrderResponse, ClobError>
pub async fn place_order( &self, params: &CreateOrderParams, options: Option<PartialCreateOrderOptions>, ) -> Result<OrderResponse, ClobError>
Create, sign, and post an order (convenience method)
Sourcepub async fn place_market_order(
&self,
params: &MarketOrderArgs,
options: Option<PartialCreateOrderOptions>,
) -> Result<OrderResponse, ClobError>
pub async fn place_market_order( &self, params: &MarketOrderArgs, options: Option<PartialCreateOrderOptions>, ) -> Result<OrderResponse, ClobError>
Create, sign, and post a market order (convenience method)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Clob
impl !RefUnwindSafe for Clob
impl Send for Clob
impl Sync for Clob
impl Unpin for Clob
impl UnsafeUnpin for Clob
impl !UnwindSafe for Clob
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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