pub struct LimitlessClient { /* private fields */ }Expand description
The primary entry point for all Limitless Exchange API operations.
Every REST endpoint and convenience method is available directly on this
struct. The internal manager types (Markets, Trader, Portfolio,
Navigation, Stream) are still available through accessor methods
when you need them, but for the common case you never have to think about
them.
§Authentication
Credentials are read automatically from environment variables
LIMITLESS_API_KEY and LIMITLESS_API_SECRET when not explicitly set
on the builder.
Implementations§
Source§impl LimitlessClient
impl LimitlessClient
Sourcepub fn builder() -> LimitlessClientBuilder
pub fn builder() -> LimitlessClientBuilder
Create a new LimitlessClientBuilder.
Sourcepub fn raw_client(&self) -> &Client
pub fn raw_client(&self) -> &Client
Access the underlying HTTP client for custom / advanced requests.
Sourcepub fn set_credentials(
&mut self,
api_key: Option<String>,
secret_key: Option<String>,
)
pub fn set_credentials( &mut self, api_key: Option<String>, secret_key: Option<String>, )
Update credentials at runtime.
Sourcepub fn retry_config(&self) -> &RetryConfig
pub fn retry_config(&self) -> &RetryConfig
The current retry configuration.
Access the raw Navigation manager.
Sourcepub async fn browse_active(
&self,
category_id: Option<u64>,
page: Option<u64>,
limit: Option<u64>,
sort_by: Option<String>,
trade_type: Option<String>,
automation_type: Option<String>,
) -> Result<ActiveMarketsResponse, LimitlessError>
pub async fn browse_active( &self, category_id: Option<u64>, page: Option<u64>, limit: Option<u64>, sort_by: Option<String>, trade_type: Option<String>, automation_type: Option<String>, ) -> Result<ActiveMarketsResponse, LimitlessError>
Browse all active (unresolved) markets with optional filters.
Sourcepub async fn get_category_counts(
&self,
) -> Result<CategoryCountResponse, LimitlessError>
pub async fn get_category_counts( &self, ) -> Result<CategoryCountResponse, LimitlessError>
Get the count of active markets per category.
Sourcepub async fn get_active_slugs(&self) -> Result<Vec<ActiveSlug>, LimitlessError>
pub async fn get_active_slugs(&self) -> Result<Vec<ActiveSlug>, LimitlessError>
Get all active market slugs with metadata.
Sourcepub async fn get_market(
&self,
address_or_slug: &str,
) -> Result<MarketDetail, LimitlessError>
pub async fn get_market( &self, address_or_slug: &str, ) -> Result<MarketDetail, LimitlessError>
Get detailed market information by address or slug.
Sourcepub async fn get_oracle_candles(
&self,
address_or_slug: &str,
interval: Option<&str>,
from: Option<u64>,
to: Option<u64>,
) -> Result<OracleCandlesResponse, LimitlessError>
pub async fn get_oracle_candles( &self, address_or_slug: &str, interval: Option<&str>, from: Option<u64>, to: Option<u64>, ) -> Result<OracleCandlesResponse, LimitlessError>
Get Chainlink oracle candlestick data for a market.
Sourcepub async fn get_feed_events(
&self,
slug: &str,
page: Option<u64>,
limit: Option<u64>,
) -> Result<FeedEventsResponse, LimitlessError>
pub async fn get_feed_events( &self, slug: &str, page: Option<u64>, limit: Option<u64>, ) -> Result<FeedEventsResponse, LimitlessError>
Get feed events (trades, orders, liquidity) for a market.
Sourcepub async fn search_markets(
&self,
query: &str,
limit: Option<u64>,
page: Option<u64>,
similarity_threshold: Option<f64>,
) -> Result<SearchResponse, LimitlessError>
pub async fn search_markets( &self, query: &str, limit: Option<u64>, page: Option<u64>, similarity_threshold: Option<f64>, ) -> Result<SearchResponse, LimitlessError>
Semantic search for markets using natural language queries.
Sourcepub async fn create_order(
&self,
order_request: &str,
) -> Result<CreateOrderResponse, LimitlessError>
pub async fn create_order( &self, order_request: &str, ) -> Result<CreateOrderResponse, LimitlessError>
Create a new order from a raw JSON body.
Sourcepub async fn order_status_batch(
&self,
request_body: &str,
) -> Result<OrderStatusBatchResponse, LimitlessError>
pub async fn order_status_batch( &self, request_body: &str, ) -> Result<OrderStatusBatchResponse, LimitlessError>
Fetch statuses for multiple orders in batch.
Sourcepub async fn cancel_combined(
&self,
request_body: &str,
) -> Result<CancelOrderResponse, LimitlessError>
pub async fn cancel_combined( &self, request_body: &str, ) -> Result<CancelOrderResponse, LimitlessError>
Cancel a single order by orderId or clientOrderId.
Sourcepub async fn cancel_batch(
&self,
request_body: &str,
) -> Result<CancelBatchResponse, LimitlessError>
pub async fn cancel_batch( &self, request_body: &str, ) -> Result<CancelBatchResponse, LimitlessError>
Cancel multiple orders by internal orderIds.
Sourcepub async fn cancel_order_by_id(
&self,
order_id: &str,
) -> Result<CancelOrderResponse, LimitlessError>
pub async fn cancel_order_by_id( &self, order_id: &str, ) -> Result<CancelOrderResponse, LimitlessError>
Cancel a single order by internal orderId.
Sourcepub async fn cancel_all_in_market(
&self,
slug: &str,
) -> Result<CancelAllResponse, LimitlessError>
pub async fn cancel_all_in_market( &self, slug: &str, ) -> Result<CancelAllResponse, LimitlessError>
Cancel all orders for the authenticated user in a specific market.
Sourcepub async fn get_orderbook(
&self,
slug: &str,
) -> Result<OrderbookResponse, LimitlessError>
pub async fn get_orderbook( &self, slug: &str, ) -> Result<OrderbookResponse, LimitlessError>
Get the current orderbook for a market.
Sourcepub async fn get_historical_prices(
&self,
slug: &str,
interval: Option<&str>,
) -> Result<Vec<HistoricalPriceData>, LimitlessError>
pub async fn get_historical_prices( &self, slug: &str, interval: Option<&str>, ) -> Result<Vec<HistoricalPriceData>, LimitlessError>
Get historical price data for a market.
Sourcepub async fn get_locked_balance(
&self,
slug: &str,
) -> Result<LockedBalanceResponse, LimitlessError>
pub async fn get_locked_balance( &self, slug: &str, ) -> Result<LockedBalanceResponse, LimitlessError>
Get the amount of funds locked in open orders.
Sourcepub async fn get_user_orders(
&self,
slug: &str,
statuses: Option<&[&str]>,
limit: Option<u64>,
) -> Result<UserOrdersResponse, LimitlessError>
pub async fn get_user_orders( &self, slug: &str, statuses: Option<&[&str]>, limit: Option<u64>, ) -> Result<UserOrdersResponse, LimitlessError>
Get all orders placed by the authenticated user in a market.
Sourcepub async fn get_market_events(
&self,
slug: &str,
page: Option<u64>,
limit: Option<u64>,
) -> Result<MarketEventsResponse, LimitlessError>
pub async fn get_market_events( &self, slug: &str, page: Option<u64>, limit: Option<u64>, ) -> Result<MarketEventsResponse, LimitlessError>
Get recent market events (trades, orders, liquidity changes).
Sourcepub async fn buy_gtc(
&self,
private_key: &str,
market_slug: &str,
token_id: &str,
price: f64,
size: f64,
owner_id: u64,
) -> Result<CreateOrderResponse, LimitlessError>
pub async fn buy_gtc( &self, private_key: &str, market_slug: &str, token_id: &str, price: f64, size: f64, owner_id: u64, ) -> Result<CreateOrderResponse, LimitlessError>
Place a GTC buy limit order — one call does it all.
Automatically fetches the venue contract, builds, signs, and submits.
Sourcepub async fn sell_gtc(
&self,
private_key: &str,
market_slug: &str,
token_id: &str,
price: f64,
size: f64,
owner_id: u64,
) -> Result<CreateOrderResponse, LimitlessError>
pub async fn sell_gtc( &self, private_key: &str, market_slug: &str, token_id: &str, price: f64, size: f64, owner_id: u64, ) -> Result<CreateOrderResponse, LimitlessError>
Place a GTC sell limit order — one call does it all.
Sourcepub async fn buy_fok(
&self,
private_key: &str,
market_slug: &str,
token_id: &str,
usdc_amount: f64,
owner_id: u64,
) -> Result<CreateOrderResponse, LimitlessError>
pub async fn buy_fok( &self, private_key: &str, market_slug: &str, token_id: &str, usdc_amount: f64, owner_id: u64, ) -> Result<CreateOrderResponse, LimitlessError>
Place a FOK buy market order — one call does it all.
Sourcepub async fn sell_fok(
&self,
private_key: &str,
market_slug: &str,
token_id: &str,
share_amount: f64,
owner_id: u64,
) -> Result<CreateOrderResponse, LimitlessError>
pub async fn sell_fok( &self, private_key: &str, market_slug: &str, token_id: &str, share_amount: f64, owner_id: u64, ) -> Result<CreateOrderResponse, LimitlessError>
Place a FOK sell market order — one call does it all.
Sourcepub async fn cancel_all(
&self,
slug: &str,
) -> Result<CancelAllResponse, LimitlessError>
pub async fn cancel_all( &self, slug: &str, ) -> Result<CancelAllResponse, LimitlessError>
Cancel all open orders in a market (convenience alias).
Sourcepub async fn get_profile(
&self,
account: &str,
) -> Result<ProfileResponse, LimitlessError>
pub async fn get_profile( &self, account: &str, ) -> Result<ProfileResponse, LimitlessError>
Get your own profile by wallet address.
Sourcepub async fn get_trades(&self) -> Result<Vec<TradeEntry>, LimitlessError>
pub async fn get_trades(&self) -> Result<Vec<TradeEntry>, LimitlessError>
Retrieve all AMM trades for the authenticated user.
Sourcepub async fn get_positions(&self) -> Result<PositionsResponse, LimitlessError>
pub async fn get_positions(&self) -> Result<PositionsResponse, LimitlessError>
Retrieve all active positions with P&L and market values.
Sourcepub async fn get_pnl_chart(
&self,
timeframe: Option<&str>,
) -> Result<PnlChartResponse, LimitlessError>
pub async fn get_pnl_chart( &self, timeframe: Option<&str>, ) -> Result<PnlChartResponse, LimitlessError>
Get PnL chart data.
Sourcepub async fn get_points(&self) -> Result<PointsResponse, LimitlessError>
pub async fn get_points(&self) -> Result<PointsResponse, LimitlessError>
Get points breakdown for the authenticated user.
Sourcepub async fn get_history(
&self,
cursor: Option<&str>,
limit: Option<u64>,
) -> Result<HistoryResponse, LimitlessError>
pub async fn get_history( &self, cursor: Option<&str>, limit: Option<u64>, ) -> Result<HistoryResponse, LimitlessError>
Get cursor-paginated portfolio history.
Sourcepub async fn get_allowance(
&self,
allowance_type: &str,
spender: Option<&str>,
) -> Result<AllowanceResponse, LimitlessError>
pub async fn get_allowance( &self, allowance_type: &str, spender: Option<&str>, ) -> Result<AllowanceResponse, LimitlessError>
Check USDC allowance for CLOB or NegRisk trading.
Get the full hierarchical navigation tree.
Sourcepub async fn get_page_by_path(
&self,
path: &str,
) -> Result<MarketPage, LimitlessError>
pub async fn get_page_by_path( &self, path: &str, ) -> Result<MarketPage, LimitlessError>
Resolve a URL path to a market page configuration.
Sourcepub async fn list_page_markets(
&self,
page_id: &str,
cursor: Option<&str>,
page: Option<u64>,
limit: Option<u64>,
sort_by: Option<&str>,
filters: Option<&BTreeMap<String, String>>,
) -> Result<PageMarketsResponse, LimitlessError>
pub async fn list_page_markets( &self, page_id: &str, cursor: Option<&str>, page: Option<u64>, limit: Option<u64>, sort_by: Option<&str>, filters: Option<&BTreeMap<String, String>>, ) -> Result<PageMarketsResponse, LimitlessError>
List markets belonging to a specific market page.
Sourcepub async fn list_property_keys(
&self,
) -> Result<Vec<PropertyKey>, LimitlessError>
pub async fn list_property_keys( &self, ) -> Result<Vec<PropertyKey>, LimitlessError>
List all property keys with their options.
Sourcepub async fn get_property_key(
&self,
key_id: &str,
) -> Result<PropertyKey, LimitlessError>
pub async fn get_property_key( &self, key_id: &str, ) -> Result<PropertyKey, LimitlessError>
Get a specific property key by ID.
Sourcepub async fn list_property_options(
&self,
key_id: &str,
parent_id: Option<&str>,
) -> Result<Vec<PropertyOption>, LimitlessError>
pub async fn list_property_options( &self, key_id: &str, parent_id: Option<&str>, ) -> Result<Vec<PropertyOption>, LimitlessError>
List options for a specific property key.
Sourcepub async fn ws_ping(&self) -> Result<(), LimitlessError>
pub async fn ws_ping(&self) -> Result<(), LimitlessError>
Test WebSocket connectivity with a ping/pong.
Sourcepub async fn ws_subscribe<F>(&self, handler: F) -> Result<(), LimitlessError>
pub async fn ws_subscribe<F>(&self, handler: F) -> Result<(), LimitlessError>
Subscribe to WebSocket events with a handler callback.
Sourcepub async fn ws_subscribe_with_commands<F>(
&self,
cmd_receiver: UnboundedReceiver<String>,
handler: F,
) -> Result<(), LimitlessError>
pub async fn ws_subscribe_with_commands<F>( &self, cmd_receiver: UnboundedReceiver<String>, handler: F, ) -> Result<(), LimitlessError>
Subscribe to WebSocket events with dynamic command support.
Trait Implementations§
Source§impl Clone for LimitlessClient
impl Clone for LimitlessClient
Source§fn clone(&self) -> LimitlessClient
fn clone(&self) -> LimitlessClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more