pub struct Clob { /* private fields */ }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 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
pub async fn sign_order(&self, order: &Order) -> Result<SignedOrder, ClobError>
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
Mutably borrows from an owned value. Read more
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>
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