pub struct Client { /* private fields */ }Expand description
Client for Monaco Protocol API
REST API for the Monaco Protocol hybrid CLOB exchange.
Version: 1.0.0
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Self
pub fn new(baseurl: &str) -> Self
Create a new client.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Sourcepub fn new_with_client(baseurl: &str, client: Client) -> Self
pub fn new_with_client(baseurl: &str, client: Client) -> Self
Construct a new client with an existing reqwest::Client,
allowing more control over its configuration.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Source§impl Client
impl Client
Sourcepub async fn get_user_balances<'a>(
&'a self,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
) -> Result<ResponseValue<GetBalancesResponse>, Error<()>>
pub async fn get_user_balances<'a>( &'a self, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, ) -> Result<ResponseValue<GetBalancesResponse>, Error<()>>
Get user balances
Get user balances.
Get the current user’s token balances with pagination support. Returns available, locked, and total balance for each token.
Sends a GET request to /api/v1/accounts/balances
Arguments:
page: Page number (1-indexed)page_size: Items per page (max 100)
Sourcepub async fn get_user_balance_by_asset<'a>(
&'a self,
asset_id: &'a str,
) -> Result<ResponseValue<GetBalanceByAssetResponse>, Error<()>>
pub async fn get_user_balance_by_asset<'a>( &'a self, asset_id: &'a str, ) -> Result<ResponseValue<GetBalanceByAssetResponse>, Error<()>>
Get user balance by asset
Get user balance by asset.
Get the current user’s balance for a specific asset. Returns available, locked, and total balance. If no balance exists for a valid asset, returns zero balances. If the asset ID is invalid or not found, returns 404.
Sends a GET request to /api/v1/accounts/balances/{asset_id}
Sourcepub async fn get_user_profile<'a>(
&'a self,
) -> Result<ResponseValue<GetProfileResponse>, Error<()>>
pub async fn get_user_profile<'a>( &'a self, ) -> Result<ResponseValue<GetProfileResponse>, Error<()>>
Get user profile
Get user profile.
Get the current user’s profile with token balances, recent movements,
and recent orders. Use source to control data source: hot_storage
(fast, real-time), cold_storage (historical), or both (hybrid).
Sends a GET request to /api/v1/accounts/me
Sourcepub async fn get_portfolio_stats<'a>(
&'a self,
period: Option<&'a str>,
) -> Result<ResponseValue<GetPortfolioStatsResponse>, Error<()>>
pub async fn get_portfolio_stats<'a>( &'a self, period: Option<&'a str>, ) -> Result<ResponseValue<GetPortfolioStatsResponse>, Error<()>>
Get portfolio stats
Get portfolio stats.
Get aggregate portfolio statistics for the authenticated user, scoped by time period. Includes volume, PnL, fees, equity, and win/loss metrics.
Sends a GET request to /api/v1/accounts/me/portfolio
Sourcepub async fn get_portfolio_chart<'a>(
&'a self,
metric: Option<&'a str>,
period: Option<&'a str>,
) -> Result<ResponseValue<GetPortfolioChartResponse>, Error<()>>
pub async fn get_portfolio_chart<'a>( &'a self, metric: Option<&'a str>, period: Option<&'a str>, ) -> Result<ResponseValue<GetPortfolioChartResponse>, Error<()>>
Get portfolio chart time series
Get portfolio chart time series.
Get bucketed time series data for portfolio charts. Supports volume and PnL metrics with configurable time periods and automatic bucket sizing.
Sends a GET request to /api/v1/accounts/me/portfolio/chart
Sourcepub async fn get_user_movements<'a>(
&'a self,
asset_id: Option<&'a Uuid>,
entry_type: Option<GetUserMovementsEntryType>,
order_by: Option<GetUserMovementsOrderBy>,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
transaction_type: Option<GetUserMovementsTransactionType>,
) -> Result<ResponseValue<GetMovementsResponse>, Error<()>>
pub async fn get_user_movements<'a>( &'a self, asset_id: Option<&'a Uuid>, entry_type: Option<GetUserMovementsEntryType>, order_by: Option<GetUserMovementsOrderBy>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, transaction_type: Option<GetUserMovementsTransactionType>, ) -> Result<ResponseValue<GetMovementsResponse>, Error<()>>
Get user movements
Get user movements.
Get the current user’s ledger movements (transaction history) with pagination and filtering support.
Sends a GET request to /api/v1/accounts/movements
Arguments:
asset_id: Asset identifier (UUID)entry_type: Ledger entry typeorder_by: Sort direction for created_atpage: Page number (1-indexed)page_size: Items per page (max 100)transaction_type: Transaction type
Sourcepub async fn list_sub_accounts_with_balances<'a>(
&'a self,
) -> Result<ResponseValue<ListSubAccountsResponse>, Error<()>>
pub async fn list_sub_accounts_with_balances<'a>( &'a self, ) -> Result<ResponseValue<ListSubAccountsResponse>, Error<()>>
List sub-accounts with balances
List sub-accounts with balances.
List all sub-accounts with their token balances for a master account. Only returns sub-accounts that belong to the same application as the requesting user.
Sends a GET request to /api/v1/accounts/sub-accounts
Sourcepub async fn create_sub_account_limit<'a>(
&'a self,
body: &'a CreateLimitRequest,
) -> Result<ResponseValue<CreateLimitResponse>, Error<()>>
pub async fn create_sub_account_limit<'a>( &'a self, body: &'a CreateLimitRequest, ) -> Result<ResponseValue<CreateLimitResponse>, Error<()>>
Create sub-account limit
Create sub-account limit.
Create a new limit for a sub-account. Only master accounts can create limits for their sub-accounts.
Sends a POST request to /api/v1/accounts/sub-accounts/limits
Sourcepub async fn get_sub_account_limits<'a>(
&'a self,
sub_account_id: &'a str,
) -> Result<ResponseValue<GetLimitsResponse>, Error<()>>
pub async fn get_sub_account_limits<'a>( &'a self, sub_account_id: &'a str, ) -> Result<ResponseValue<GetLimitsResponse>, Error<()>>
Get sub-account limits
Get sub-account limits.
Get all limits for a sub-account. Users can only view limits for their own accounts or their sub-accounts.
Sends a GET request to /api/v1/accounts/sub-accounts/{sub_account_id}/limits
Sourcepub async fn update_sub_account_limit<'a>(
&'a self,
sub_account_id: &'a str,
asset_id: &'a str,
body: &'a UpdateLimitRequest,
) -> Result<ResponseValue<UpdateLimitResponse>, Error<()>>
pub async fn update_sub_account_limit<'a>( &'a self, sub_account_id: &'a str, asset_id: &'a str, body: &'a UpdateLimitRequest, ) -> Result<ResponseValue<UpdateLimitResponse>, Error<()>>
Update sub-account limit
Update sub-account limit.
Update an existing limit for a sub-account. Only master accounts can update limits for their sub-accounts.
Sends a PUT request to /api/v1/accounts/sub-accounts/{sub_account_id}/limits/{asset_id}
Sourcepub async fn delete_sub_account_limit<'a>(
&'a self,
sub_account_id: &'a str,
asset_id: &'a str,
limit_id: Option<&'a Uuid>,
) -> Result<ResponseValue<DeleteLimitResponse>, Error<()>>
pub async fn delete_sub_account_limit<'a>( &'a self, sub_account_id: &'a str, asset_id: &'a str, limit_id: Option<&'a Uuid>, ) -> Result<ResponseValue<DeleteLimitResponse>, Error<()>>
Delete sub-account limit
Delete sub-account limit.
Delete a limit for a sub-account. Only master accounts can delete limits for their sub-accounts.
Sends a DELETE request to /api/v1/accounts/sub-accounts/{sub_account_id}/limits/{asset_id}
Arguments:
sub_account_idasset_idlimit_id: Limit identifier (UUID)
Sourcepub async fn get_user_trades<'a>(
&'a self,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
trading_pair_id: Option<&'a Uuid>,
) -> Result<ResponseValue<GetUserTradesResponse>, Error<()>>
pub async fn get_user_trades<'a>( &'a self, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, trading_pair_id: Option<&'a Uuid>, ) -> Result<ResponseValue<GetUserTradesResponse>, Error<()>>
Get user trade history
Get user trades.
Get the authenticated user’s trade history with pagination. Returns trades where the user was either maker or taker, with user-specific side and fee information.
Sends a GET request to /api/v1/accounts/trades
Arguments:
page: Page number (1-indexed)page_size: Items per page (max 100)trading_pair_id: Trading pair identifier (UUID)
Sourcepub async fn list_application_balances<'a>(
&'a self,
asset_id: Option<&'a Uuid>,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
user_id: Option<&'a Uuid>,
) -> Result<ResponseValue<ListAppBalancesResponse>, Error<()>>
pub async fn list_application_balances<'a>( &'a self, asset_id: Option<&'a Uuid>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, user_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListAppBalancesResponse>, Error<()>>
List application balances
List application balances.
Returns a paginated list of all user balances for this application. Requires backend authentication via secret key.
Sends a GET request to /api/v1/applications/balances
Arguments:
asset_id: Asset identifier (UUID)page: Page number (1-indexed)page_size: Items per page (max 100)user_id: User identifier (UUID)
Sourcepub async fn get_application_config<'a>(
&'a self,
) -> Result<ResponseValue<GetConfigResponse>, Error<()>>
pub async fn get_application_config<'a>( &'a self, ) -> Result<ResponseValue<GetConfigResponse>, Error<()>>
Get application configuration
Get application configuration.
Returns the configuration for the authenticated application including allowed origins, webhook URL, and vault contract address.
Sends a GET request to /api/v1/applications/config
Sourcepub async fn list_application_movements<'a>(
&'a self,
asset_id: Option<&'a Uuid>,
entry_type: Option<ListApplicationMovementsEntryType>,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
transaction_type: Option<ListApplicationMovementsTransactionType>,
user_id: Option<&'a Uuid>,
) -> Result<ResponseValue<ListAppMovementsResponse>, Error<()>>
pub async fn list_application_movements<'a>( &'a self, asset_id: Option<&'a Uuid>, entry_type: Option<ListApplicationMovementsEntryType>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, transaction_type: Option<ListApplicationMovementsTransactionType>, user_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListAppMovementsResponse>, Error<()>>
List application movements
List application movements.
Returns a paginated list of all ledger movements (deposits, withdrawals, trades, etc.) for this application. Requires backend authentication via secret key.
Sends a GET request to /api/v1/applications/movements
Arguments:
asset_id: Asset identifier (UUID)entry_type: Ledger entry typepage: Page number (1-indexed)page_size: Items per page (max 100)transaction_type: Transaction typeuser_id: User identifier (UUID)
Sourcepub async fn list_application_orders<'a>(
&'a self,
order_type: Option<ListApplicationOrdersOrderType>,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
side: Option<ListApplicationOrdersSide>,
status: Option<&'a ListApplicationOrdersStatus>,
trading_pair_id: Option<&'a Uuid>,
user_id: Option<&'a Uuid>,
) -> Result<ResponseValue<ListAppOrdersResponse>, Error<()>>
pub async fn list_application_orders<'a>( &'a self, order_type: Option<ListApplicationOrdersOrderType>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, side: Option<ListApplicationOrdersSide>, status: Option<&'a ListApplicationOrdersStatus>, trading_pair_id: Option<&'a Uuid>, user_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListAppOrdersResponse>, Error<()>>
List application orders
List application orders.
Returns a paginated list of all orders for this application. Requires backend authentication via secret key.
Sends a GET request to /api/v1/applications/orders
Arguments:
order_type: Order typepage: Page number (1-indexed)page_size: Items per page (max 100)side: Order sidestatus: Order status (single value or comma-separated list)trading_pair_id: Trading pair identifier (UUID)user_id: User identifier (UUID)
Sourcepub async fn list_application_users<'a>(
&'a self,
account_type: Option<ListApplicationUsersAccountType>,
address: &'a ListApplicationUsersAddress,
is_active: Option<bool>,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
) -> Result<ResponseValue<ListAppUsersResponse>, Error<()>>
pub async fn list_application_users<'a>( &'a self, account_type: Option<ListApplicationUsersAccountType>, address: &'a ListApplicationUsersAddress, is_active: Option<bool>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, ) -> Result<ResponseValue<ListAppUsersResponse>, Error<()>>
List application users
List application users.
Returns a paginated list of all users for this application. Requires backend authentication via secret key.
Sends a GET request to /api/v1/applications/users
Arguments:
account_type: Account type filteraddress: Wallet addressis_activepage: Page number (1-indexed)page_size: Items per page (max 100)
Sourcepub async fn authenticate_backend<'a>(
&'a self,
body: &'a BackendAuthRequest,
) -> Result<ResponseValue<BackendAuthResponse>, Error<()>>
pub async fn authenticate_backend<'a>( &'a self, body: &'a BackendAuthRequest, ) -> Result<ResponseValue<BackendAuthResponse>, Error<()>>
Backend service authentication
Backend service authentication.
Authenticate a backend service using a secret key. Returns a long-lived access token for server-to-server API access.
Sends a POST request to /api/v1/auth/backend
Sourcepub async fn create_challenge<'a>(
&'a self,
body: &'a ChallengeRequest,
) -> Result<ResponseValue<ChallengeResponse>, Error<()>>
pub async fn create_challenge<'a>( &'a self, body: &'a ChallengeRequest, ) -> Result<ResponseValue<ChallengeResponse>, Error<()>>
Create authentication challenge
Create authentication challenge.
Generate a cryptographic challenge (nonce) for wallet-based authentication. The user must sign the returned message with their private key to prove ownership of the wallet.
Sends a POST request to /api/v1/auth/challenge
Sourcepub async fn refresh_token<'a>(
&'a self,
body: &'a RefreshRequest,
) -> Result<ResponseValue<RefreshResponse>, Error<()>>
pub async fn refresh_token<'a>( &'a self, body: &'a RefreshRequest, ) -> Result<ResponseValue<RefreshResponse>, Error<()>>
Refresh access token
Refresh access token.
Generate a new access token using a valid refresh token. The refresh token remains valid for future use.
Sends a POST request to /api/v1/auth/refresh
Sourcepub async fn revoke_session<'a>(
&'a self,
body: &'a RevokeRequest,
) -> Result<ResponseValue<RevokeResponse>, Error<()>>
pub async fn revoke_session<'a>( &'a self, body: &'a RevokeRequest, ) -> Result<ResponseValue<RevokeResponse>, Error<()>>
Revoke current session
Revoke current session.
Revoke the current authenticated session, invalidating the access token. The user will need to authenticate again.
Sends a POST request to /api/v1/auth/revoke
Sourcepub async fn verify_signature<'a>(
&'a self,
body: &'a VerifyRequest,
) -> Result<ResponseValue<VerifyResponse>, Error<()>>
pub async fn verify_signature<'a>( &'a self, body: &'a VerifyRequest, ) -> Result<ResponseValue<VerifyResponse>, Error<()>>
Verify signature and authenticate
Verify signature and authenticate.
Verify the signed challenge message and create an authenticated session. Returns JWT tokens for subsequent API access.
Sends a POST request to /api/v1/auth/verify
Sourcepub async fn mint_tokens<'a>(
&'a self,
) -> Result<ResponseValue<MintTokensResponse>, Error<()>>
pub async fn mint_tokens<'a>( &'a self, ) -> Result<ResponseValue<MintTokensResponse>, Error<()>>
Mint all testnet tokens
Mint all testnet tokens.
Mint all available testnet tokens to the authenticated user’s address. Rate limited per 24 hours.
Sends a POST request to /api/v1/faucet/mint
Sourcepub async fn simulate_fees<'a>(
&'a self,
order_type: Option<SimulateFeesOrderType>,
price: &'a SimulateFeesPrice,
quantity: &'a SimulateFeesQuantity,
side: SimulateFeesSide,
slippage_tolerance_bps: Option<i32>,
trading_pair_id: &'a Uuid,
) -> Result<ResponseValue<SimulateFeesResponse>, Error<()>>
pub async fn simulate_fees<'a>( &'a self, order_type: Option<SimulateFeesOrderType>, price: &'a SimulateFeesPrice, quantity: &'a SimulateFeesQuantity, side: SimulateFeesSide, slippage_tolerance_bps: Option<i32>, trading_pair_id: &'a Uuid, ) -> Result<ResponseValue<SimulateFeesResponse>, Error<()>>
Simulate fees for a potential order
Simulate fees for a potential order.
Returns exact fee breakdown for a specific order before placing it, including Monaco protocol fees, application fees, total amounts, and the maximum quantity affordable at the given price.
Sends a GET request to /api/v1/fees/simulate
Arguments:
order_type: Order typeprice: Price as decimal stringquantity: Quantity as decimal stringside: Order sideslippage_tolerance_bpstrading_pair_id: Trading pair identifier (UUID)
Sourcepub async fn list_trading_pairs<'a>(
&'a self,
base_token: Option<&'a str>,
is_active: Option<bool>,
market_type: Option<ListTradingPairsMarketType>,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
quote_token: Option<&'a str>,
) -> Result<ResponseValue<ListTradingPairsResponse>, Error<()>>
pub async fn list_trading_pairs<'a>( &'a self, base_token: Option<&'a str>, is_active: Option<bool>, market_type: Option<ListTradingPairsMarketType>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, quote_token: Option<&'a str>, ) -> Result<ResponseValue<ListTradingPairsResponse>, Error<()>>
Trading Pairs
Trading Pairs
Get paginated list of trading pairs with optional filtering by market type, base token, quote token, and active status.
Sends a GET request to /api/v1/market/pairs
Arguments:
base_tokenis_activemarket_type: Filter by market typepage: Page number (1-indexed)page_size: Items per page (max 100)quote_token
Sourcepub async fn get_candles<'a>(
&'a self,
trading_pair_id: &'a str,
interval: &'a str,
end_time: Option<i64>,
limit: Option<NonZeroU32>,
start_time: Option<i64>,
) -> Result<ResponseValue<GetCandlesResponse>, Error<()>>
pub async fn get_candles<'a>( &'a self, trading_pair_id: &'a str, interval: &'a str, end_time: Option<i64>, limit: Option<NonZeroU32>, start_time: Option<i64>, ) -> Result<ResponseValue<GetCandlesResponse>, Error<()>>
Candlestick Data
Candlestick Data
Get OHLCV (Open, High, Low, Close, Volume) candlestick data for a trading pair with configurable interval and time range.
Sends a GET request to /api/v1/market/pairs/charts/candlestick/{trading_pair_id}/{interval}
Arguments:
trading_pair_idintervalend_time: End time as Unix timestamp (milliseconds)limit: Max candles to return (max 1000)start_time: Start time as Unix timestamp (milliseconds)
Sourcepub async fn get_trading_pair_by_id<'a>(
&'a self,
trading_pair_id: &'a str,
) -> Result<ResponseValue<GetTradingPairResponse>, Error<()>>
pub async fn get_trading_pair_by_id<'a>( &'a self, trading_pair_id: &'a str, ) -> Result<ResponseValue<GetTradingPairResponse>, Error<()>>
Trading Pair By ID
Trading Pair By ID
Get a specific trading pair by its UUID.
Sends a GET request to /api/v1/market/pairs/{trading_pair_id}
Sourcepub async fn get_market_metadata<'a>(
&'a self,
trading_pair_id: &'a str,
) -> Result<ResponseValue<GetMarketMetadataResponse>, Error<()>>
pub async fn get_market_metadata<'a>( &'a self, trading_pair_id: &'a str, ) -> Result<ResponseValue<GetMarketMetadataResponse>, Error<()>>
Market Metadata
Market Metadata
Returns current price (from latest candle), 24h statistics (high, low, volume, change), and market initialization timestamp. 24h fields will be null if less than 24 hours of data available.
Sends a GET request to /api/v1/market/pairs/{trading_pair_id}/metadata
Sourcepub async fn get_orderbook_snapshot<'a>(
&'a self,
trading_pair_id: &'a str,
denomination: Option<GetOrderbookSnapshotDenomination>,
levels: Option<NonZeroU32>,
magnitude: Option<GetOrderbookSnapshotMagnitude>,
trading_mode: Option<GetOrderbookSnapshotTradingMode>,
) -> Result<ResponseValue<GetOrderbookResponse>, Error<()>>
pub async fn get_orderbook_snapshot<'a>( &'a self, trading_pair_id: &'a str, denomination: Option<GetOrderbookSnapshotDenomination>, levels: Option<NonZeroU32>, magnitude: Option<GetOrderbookSnapshotMagnitude>, trading_mode: Option<GetOrderbookSnapshotTradingMode>, ) -> Result<ResponseValue<GetOrderbookResponse>, Error<()>>
Orderbook Snapshot
Orderbook Snapshot
Get the complete orderbook snapshot for a trading pair showing all bids and asks with their price levels. This is a public endpoint that does not require authentication.
Sends a GET request to /api/v1/orderbook/{trading_pair_id}
Arguments:
trading_pair_iddenomination: Price denominationlevels: Number of price levels (max 100)magnitude: Price grouping magnitudetrading_mode: Trading mode
Sourcepub async fn get_orders<'a>(
&'a self,
order_by: Option<GetOrdersOrderBy>,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
status: Option<&'a GetOrdersStatus>,
trading_pair_id: Option<&'a Uuid>,
) -> Result<ResponseValue<ListOrdersResponse>, Error<()>>
pub async fn get_orders<'a>( &'a self, order_by: Option<GetOrdersOrderBy>, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, status: Option<&'a GetOrdersStatus>, trading_pair_id: Option<&'a Uuid>, ) -> Result<ResponseValue<ListOrdersResponse>, Error<()>>
Get user orders
Get user orders.
Get orders for the authenticated user with pagination and optional filtering by status and trading pair.
Sends a GET request to /api/v1/orders
Arguments:
order_by: Sort direction for created_atpage: Page number (1-indexed)page_size: Items per page (max 100)status: Order status (single value or comma-separated list)trading_pair_id: Trading pair identifier (UUID)
Sourcepub async fn create_order<'a>(
&'a self,
body: &'a CreateOrderRequest,
) -> Result<ResponseValue<CreateOrderResponse>, Error<()>>
pub async fn create_order<'a>( &'a self, body: &'a CreateOrderRequest, ) -> Result<ResponseValue<CreateOrderResponse>, Error<()>>
Create new order
Create new order.
Create a new order and process it through the matching engine. The order will be matched against existing orders in the orderbook.
Sends a POST request to /api/v1/orders
Sourcepub async fn batch_cancel_orders<'a>(
&'a self,
body: &'a BatchCancelOrdersRequest,
) -> Result<ResponseValue<BatchCancelOrdersResponse>, Error<()>>
pub async fn batch_cancel_orders<'a>( &'a self, body: &'a BatchCancelOrdersRequest, ) -> Result<ResponseValue<BatchCancelOrdersResponse>, Error<()>>
Batch cancel specific orders
Batch cancel specific orders.
Cancel multiple specific orders by their IDs. For canceling all orders, use /batch-cancel-all or /batch-cancel-all/{trading_pair_id}.
Sends a POST request to /api/v1/orders/batch-cancel
Sourcepub async fn batch_cancel_all<'a>(
&'a self,
) -> Result<ResponseValue<BatchCancelAllResponse>, Error<()>>
pub async fn batch_cancel_all<'a>( &'a self, ) -> Result<ResponseValue<BatchCancelAllResponse>, Error<()>>
Cancel all orders
Cancel all orders.
Cancel all active orders for the authenticated user. To cancel orders for a specific trading pair, use /batch-cancel-all/{trading_pair_id}.
Sends a POST request to /api/v1/orders/batch-cancel-all
Sourcepub async fn batch_cancel_all_by_pair<'a>(
&'a self,
trading_pair_id: &'a str,
) -> Result<ResponseValue<BatchCancelAllResponse>, Error<()>>
pub async fn batch_cancel_all_by_pair<'a>( &'a self, trading_pair_id: &'a str, ) -> Result<ResponseValue<BatchCancelAllResponse>, Error<()>>
Cancel all orders for a trading pair
Cancel all orders for a trading pair.
Cancel all active orders for the authenticated user on a specific trading pair.
Sends a POST request to /api/v1/orders/batch-cancel-all/{trading_pair_id}
Sourcepub async fn batch_create_orders<'a>(
&'a self,
body: &'a BatchCreateOrdersRequest,
) -> Result<ResponseValue<BatchCreateOrdersResponse>, Error<()>>
pub async fn batch_create_orders<'a>( &'a self, body: &'a BatchCreateOrdersRequest, ) -> Result<ResponseValue<BatchCreateOrdersResponse>, Error<()>>
Batch create orders
Batch create orders.
Create multiple orders in a single batch. Each order is processed sequentially through the matching engine.
Sends a POST request to /api/v1/orders/batch-create
Sourcepub async fn batch_replace_orders<'a>(
&'a self,
body: &'a BatchReplaceOrdersRequest,
) -> Result<ResponseValue<BatchReplaceOrdersResponse>, Error<()>>
pub async fn batch_replace_orders<'a>( &'a self, body: &'a BatchReplaceOrdersRequest, ) -> Result<ResponseValue<BatchReplaceOrdersResponse>, Error<()>>
Batch replace orders
Batch replace orders.
Replace multiple orders in a single batch. Each order is processed sequentially through the matching engine.
Sends a POST request to /api/v1/orders/batch-replace
Sourcepub async fn cancel_order<'a>(
&'a self,
body: &'a CancelOrderRequest,
) -> Result<ResponseValue<CancelOrderResponse>, Error<()>>
pub async fn cancel_order<'a>( &'a self, body: &'a CancelOrderRequest, ) -> Result<ResponseValue<CancelOrderResponse>, Error<()>>
Cancel existing order
Cancel existing order.
Cancel an existing order and unlock the reserved funds. Only orders that are not yet filled can be cancelled.
Sends a POST request to /api/v1/orders/cancel
Sourcepub async fn get_order_by_id<'a>(
&'a self,
order_id: &'a str,
) -> Result<ResponseValue<GetOrderResponse>, Error<()>>
pub async fn get_order_by_id<'a>( &'a self, order_id: &'a str, ) -> Result<ResponseValue<GetOrderResponse>, Error<()>>
Get order by ID
Get order by ID.
Get a single order by its ID. Users can only access their own orders.
Sends a GET request to /api/v1/orders/{order_id}
Sourcepub async fn replace_order<'a>(
&'a self,
order_id: &'a str,
body: &'a ReplaceOrderRequest,
) -> Result<ResponseValue<ReplaceOrderResponse>, Error<()>>
pub async fn replace_order<'a>( &'a self, order_id: &'a str, body: &'a ReplaceOrderRequest, ) -> Result<ResponseValue<ReplaceOrderResponse>, Error<()>>
Replace existing order
Replace existing order.
Replaces an existing order with new parameters by canceling the original order and creating a new one with the updated price/quantity. Priority is lost in the order book.
Sends a PUT request to /api/v1/orders/{order_id}
Sourcepub async fn get_trade_by_id<'a>(
&'a self,
trade_id: &'a str,
) -> Result<ResponseValue<GetTradeByIdResponse>, Error<()>>
pub async fn get_trade_by_id<'a>( &'a self, trade_id: &'a str, ) -> Result<ResponseValue<GetTradeByIdResponse>, Error<()>>
Get Trade by ID
Get Trade by ID
Retrieve a single trade by its unique identifier.
Sends a GET request to /api/v1/trades/by-id/{trade_id}
Sourcepub async fn get_trades<'a>(
&'a self,
trading_pair_id: &'a str,
page: Option<NonZeroU32>,
page_size: Option<NonZeroU32>,
) -> Result<ResponseValue<GetTradesResponse>, Error<()>>
pub async fn get_trades<'a>( &'a self, trading_pair_id: &'a str, page: Option<NonZeroU32>, page_size: Option<NonZeroU32>, ) -> Result<ResponseValue<GetTradesResponse>, Error<()>>
Recent Trades
Recent Trades
Get recent trades for a trading pair sorted by execution time.
Sends a GET request to /api/v1/trades/{trading_pair_id}
Arguments:
trading_pair_idpage: Page number (1-indexed)page_size: Max trades to return (max 100)
Sourcepub async fn submit_whitelist<'a>(
&'a self,
body: &'a SubmitWhitelistRequest,
) -> Result<ResponseValue<SubmitWhitelistResponse>, Error<()>>
pub async fn submit_whitelist<'a>( &'a self, body: &'a SubmitWhitelistRequest, ) -> Result<ResponseValue<SubmitWhitelistResponse>, Error<()>>
Submit whitelist application
Submit whitelist application.
Submit a whitelist application to join Monaco Protocol. The user will be created with is_active = false and will need to be approved by an admin.
Sends a POST request to /api/v1/whitelist
Sourcepub async fn health_check<'a>(
&'a self,
) -> Result<ResponseValue<PublicHealthCheckResponse>, Error<()>>
pub async fn health_check<'a>( &'a self, ) -> Result<ResponseValue<PublicHealthCheckResponse>, Error<()>>
Health check
Health check.
Returns the current health status of the API gateway and its connected services. Can be used for monitoring and load balancer health checks.
Sends a GET request to /health