pub struct Client { /* private fields */ }Expand description
Client for Bullet Trading API
REST API for the Bullet exchange. Provides Binance FAPI-compatible endpoints for trading, account management, and market data.
Version: 0.1.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 account_config<'a>(
&'a self,
address: &'a str,
) -> Result<ResponseValue<ByteStream>, Error<ApiErrorResponse>>
pub async fn account_config<'a>( &'a self, address: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<ApiErrorResponse>>
Futures Account Configuration
Sends a GET request to /fapi/v1/accountConfig
Sourcepub async fn all_orders<'a>(
&'a self,
address: Option<&'a str>,
end_time: Option<i64>,
limit: Option<u64>,
order_id: Option<i64>,
start_time: Option<i64>,
symbol: Option<&'a str>,
) -> Result<ResponseValue<PaginatedResponseHistoricalOrder>, Error<ApiErrorResponse>>
pub async fn all_orders<'a>( &'a self, address: Option<&'a str>, end_time: Option<i64>, limit: Option<u64>, order_id: Option<i64>, start_time: Option<i64>, symbol: Option<&'a str>, ) -> Result<ResponseValue<PaginatedResponseHistoricalOrder>, Error<ApiErrorResponse>>
All Orders (order history from ClickHouse)
Sends a GET request to /fapi/v1/allOrders
Arguments:
address: Account address (required on first request, encoded in cursor for subsequent)end_time: End time in microsecondslimit: Number of results (default 500, max 1000)order_id: Return orders with orderId >= this valuestart_time: Start time in microsecondssymbol: Trading pair symbol (optional filter)
Sourcepub async fn borrow_lend_pools<'a>(
&'a self,
symbol: Option<&'a str>,
) -> Result<ResponseValue<Vec<BorrowLendPoolResponse>>, Error<ApiErrorResponse>>
pub async fn borrow_lend_pools<'a>( &'a self, symbol: Option<&'a str>, ) -> Result<ResponseValue<Vec<BorrowLendPoolResponse>>, Error<ApiErrorResponse>>
Borrow Lend Pools - Doesnt exist in Binance
Sends a GET request to /fapi/v1/borrowLendPools
Arguments:
symbol: Symbol
Sourcepub async fn commission_rate<'a>(
&'a self,
address: &'a str,
symbol: &'a str,
) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>
pub async fn commission_rate<'a>( &'a self, address: &'a str, symbol: &'a str, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>
User Commission Rate (USER_DATA)
Sends a GET request to /fapi/v1/commissionRate
Sourcepub async fn order_book<'a>(
&'a self,
limit: Option<i32>,
symbol: &'a str,
) -> Result<ResponseValue<OrderBook>, Error<ApiErrorResponse>>
pub async fn order_book<'a>( &'a self, limit: Option<i32>, symbol: &'a str, ) -> Result<ResponseValue<OrderBook>, Error<ApiErrorResponse>>
Get orderbook
Sends a GET request to /fapi/v1/depth
Arguments:
limit: Limit (default 20, max 1000)symbol: Symbol
Sourcepub async fn exchange_info<'a>(
&'a self,
) -> Result<ResponseValue<ExchangeInfo>, Error<ApiErrorResponse>>
pub async fn exchange_info<'a>( &'a self, ) -> Result<ResponseValue<ExchangeInfo>, Error<ApiErrorResponse>>
Get current exchange trading rules and symbol information
Sends a GET request to /fapi/v1/exchangeInfo
Sourcepub async fn funding_rate<'a>(
&'a self,
symbol: Option<&'a str>,
) -> Result<ResponseValue<FundingRate>, Error<ApiErrorResponse>>
pub async fn funding_rate<'a>( &'a self, symbol: Option<&'a str>, ) -> Result<ResponseValue<FundingRate>, Error<ApiErrorResponse>>
Latest price for a symbol or symbols
Sends a GET request to /fapi/v1/fundingRate
Arguments:
symbol: Symbol
Sourcepub async fn insurance_balance<'a>(
&'a self,
) -> Result<ResponseValue<Vec<InsuranceBalance>>, Error<ApiErrorResponse>>
pub async fn insurance_balance<'a>( &'a self, ) -> Result<ResponseValue<Vec<InsuranceBalance>>, Error<ApiErrorResponse>>
Query Insurance Fund Balance Snapshot
Sends a GET request to /fapi/v1/insuranceBalance
Sourcepub async fn leverage_bracket<'a>(
&'a self,
symbol: Option<&'a str>,
) -> Result<ResponseValue<Vec<LeverageBracket>>, Error<ApiErrorResponse>>
pub async fn leverage_bracket<'a>( &'a self, symbol: Option<&'a str>, ) -> Result<ResponseValue<Vec<LeverageBracket>>, Error<ApiErrorResponse>>
Notional and Leverage Brackets (USER_DATA)
Sends a GET request to /fapi/v1/leverageBracket
Sourcepub async fn open_interest<'a>(
&'a self,
) -> Result<ResponseValue<Vec<OpenInterest>>, Error<ApiErrorResponse>>
pub async fn open_interest<'a>( &'a self, ) -> Result<ResponseValue<Vec<OpenInterest>>, Error<ApiErrorResponse>>
Open interest per market
Sends a GET request to /fapi/v1/openInterest
Sourcepub async fn query_open_order<'a>(
&'a self,
address: &'a str,
client_order_id: Option<i64>,
order_id: Option<i64>,
symbol: &'a str,
) -> Result<ResponseValue<BinanceOrder>, Error<ApiErrorResponse>>
pub async fn query_open_order<'a>( &'a self, address: &'a str, client_order_id: Option<i64>, order_id: Option<i64>, symbol: &'a str, ) -> Result<ResponseValue<BinanceOrder>, Error<ApiErrorResponse>>
Query Current Open Order
Sends a GET request to /fapi/v1/openOrder
Sourcepub async fn query_open_orders<'a>(
&'a self,
address: &'a str,
symbol: &'a str,
) -> Result<ResponseValue<Vec<BinanceOrder>>, Error<ApiErrorResponse>>
pub async fn query_open_orders<'a>( &'a self, address: &'a str, symbol: &'a str, ) -> Result<ResponseValue<Vec<BinanceOrder>>, Error<ApiErrorResponse>>
Query All Open Orders
Sends a GET request to /fapi/v1/openOrders
Arguments:
address: Account addresssymbol: Trading pair symbol
Sourcepub async fn ping<'a>(
&'a self,
) -> Result<ResponseValue<PingResponse>, Error<ApiErrorResponse>>
pub async fn ping<'a>( &'a self, ) -> Result<ResponseValue<PingResponse>, Error<ApiErrorResponse>>
Test connectivity to the Rest API
Sends a GET request to /fapi/v1/ping
Sourcepub async fn rate_limit_order<'a>(
&'a self,
) -> Result<ResponseValue<ByteStream>, Error<ApiErrorResponse>>
pub async fn rate_limit_order<'a>( &'a self, ) -> Result<ResponseValue<ByteStream>, Error<ApiErrorResponse>>
Query User Rate Limit (USER_DATA)
Sends a GET request to /fapi/v1/rateLimit/order
Sourcepub async fn symbol_config<'a>(
&'a self,
address: &'a str,
symbol: Option<&'a str>,
) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>
pub async fn symbol_config<'a>( &'a self, address: &'a str, symbol: Option<&'a str>, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>
Symbol Configuration (USER_DATA)
Sends a GET request to /fapi/v1/symbolConfig
Sourcepub async fn ticker_24hr<'a>(
&'a self,
) -> Result<ResponseValue<Vec<Ticker24hr>>, Error<ApiErrorResponse>>
pub async fn ticker_24hr<'a>( &'a self, ) -> Result<ResponseValue<Vec<Ticker24hr>>, Error<ApiErrorResponse>>
24 hour rolling window price change statistics. returns all markets — no per-symbol filtering (intentional, dataset is small)
Sends a GET request to /fapi/v1/ticker/24hr
Sourcepub async fn ticker_price<'a>(
&'a self,
symbol: Option<&'a str>,
) -> Result<ResponseValue<Vec<PriceTicker>>, Error<ApiErrorResponse>>
pub async fn ticker_price<'a>( &'a self, symbol: Option<&'a str>, ) -> Result<ResponseValue<Vec<PriceTicker>>, Error<ApiErrorResponse>>
Latest price for a symbol or symbols
Sends a GET request to /fapi/v1/ticker/price
Arguments:
symbol: Symbol
Sourcepub async fn time<'a>(
&'a self,
) -> Result<ResponseValue<TimeResponse>, Error<ApiErrorResponse>>
pub async fn time<'a>( &'a self, ) -> Result<ResponseValue<TimeResponse>, Error<ApiErrorResponse>>
Test connectivity to the Rest API and get the current server time
Sends a GET request to /fapi/v1/time
Sourcepub async fn recent_trades<'a>(
&'a self,
limit: Option<i32>,
symbol: &'a str,
) -> Result<ResponseValue<Vec<Trade>>, Error<ApiErrorResponse>>
pub async fn recent_trades<'a>( &'a self, limit: Option<i32>, symbol: &'a str, ) -> Result<ResponseValue<Vec<Trade>>, Error<ApiErrorResponse>>
Recent Trades List
Sends a GET request to /fapi/v1/trades
Arguments:
limit: Default 100; max 1000symbol: Symbol
Sourcepub async fn user_deposits<'a>(
&'a self,
address: Option<&'a str>,
end_time: Option<i64>,
limit: Option<u64>,
start_time: Option<i64>,
) -> Result<ResponseValue<PaginatedResponseUserDeposit>, Error<ApiErrorResponse>>
pub async fn user_deposits<'a>( &'a self, address: Option<&'a str>, end_time: Option<i64>, limit: Option<u64>, start_time: Option<i64>, ) -> Result<ResponseValue<PaginatedResponseUserDeposit>, Error<ApiErrorResponse>>
User Deposit History
Sends a GET request to /fapi/v1/userDeposits
Arguments:
address: Account address (required on first request, encoded in cursor for subsequent)end_time: End time in microsecondslimit: Number of results (default 500, max 1000)start_time: Start time in microseconds
Sourcepub async fn user_funding_payments<'a>(
&'a self,
address: Option<&'a str>,
end_time: Option<i64>,
limit: Option<u64>,
start_time: Option<i64>,
symbol: Option<&'a str>,
) -> Result<ResponseValue<PaginatedResponseUserFundingPayment>, Error<ApiErrorResponse>>
pub async fn user_funding_payments<'a>( &'a self, address: Option<&'a str>, end_time: Option<i64>, limit: Option<u64>, start_time: Option<i64>, symbol: Option<&'a str>, ) -> Result<ResponseValue<PaginatedResponseUserFundingPayment>, Error<ApiErrorResponse>>
User Funding Payment History
Sends a GET request to /fapi/v1/userFundingPayments
Arguments:
address: Account address (required on first request, encoded in cursor for subsequent)end_time: End time in microseconds (optional filter)limit: Number of results (default 500, max 1000)start_time: Start time in microseconds (optional filter)symbol: Trading pair symbol (optional filter)
Sourcepub async fn user_liquidations<'a>(
&'a self,
address: Option<&'a str>,
end_time: Option<i64>,
limit: Option<u64>,
start_time: Option<i64>,
symbol: Option<&'a str>,
) -> Result<ResponseValue<PaginatedResponseUserLiquidation>, Error<ApiErrorResponse>>
pub async fn user_liquidations<'a>( &'a self, address: Option<&'a str>, end_time: Option<i64>, limit: Option<u64>, start_time: Option<i64>, symbol: Option<&'a str>, ) -> Result<ResponseValue<PaginatedResponseUserLiquidation>, Error<ApiErrorResponse>>
User Liquidation History
Sends a GET request to /fapi/v1/userLiquidations
Arguments:
address: Account address (required on first request, encoded in cursor for subsequent)end_time: End time in microseconds (optional filter)limit: Number of results (default 500, max 1000)start_time: Start time in microseconds (optional filter)symbol: Trading pair symbol (optional filter)
Sourcepub async fn user_trades<'a>(
&'a self,
address: Option<&'a str>,
end_time: Option<i64>,
limit: Option<u64>,
start_time: Option<i64>,
symbol: Option<&'a str>,
) -> Result<ResponseValue<PaginatedResponseUserTrade>, Error<ApiErrorResponse>>
pub async fn user_trades<'a>( &'a self, address: Option<&'a str>, end_time: Option<i64>, limit: Option<u64>, start_time: Option<i64>, symbol: Option<&'a str>, ) -> Result<ResponseValue<PaginatedResponseUserTrade>, Error<ApiErrorResponse>>
Account Trade List
Sends a GET request to /fapi/v1/userTrades
Arguments:
address: Account address (required on first request, encoded in cursor for subsequent)end_time: End time in microseconds (optional filter)limit: Number of results (default 500, max 1000)start_time: Start time in microseconds (optional filter)symbol: Trading pair symbol (optional filter)
Sourcepub async fn user_withdrawals<'a>(
&'a self,
address: Option<&'a str>,
end_time: Option<i64>,
limit: Option<u64>,
start_time: Option<i64>,
) -> Result<ResponseValue<PaginatedResponseUserWithdrawal>, Error<ApiErrorResponse>>
pub async fn user_withdrawals<'a>( &'a self, address: Option<&'a str>, end_time: Option<i64>, limit: Option<u64>, start_time: Option<i64>, ) -> Result<ResponseValue<PaginatedResponseUserWithdrawal>, Error<ApiErrorResponse>>
User Withdrawal History
Sends a GET request to /fapi/v1/userWithdrawals
Arguments:
address: Account address (required on first request, encoded in cursor for subsequent)end_time: End time in microsecondslimit: Number of results (default 500, max 1000)start_time: Start time in microseconds
Sourcepub async fn account_info<'a>(
&'a self,
address: &'a str,
) -> Result<ResponseValue<Account>, Error<ApiErrorResponse>>
pub async fn account_info<'a>( &'a self, address: &'a str, ) -> Result<ResponseValue<Account>, Error<ApiErrorResponse>>
Get current account information
Sends a GET request to /fapi/v3/account
Sourcepub async fn account_balance<'a>(
&'a self,
address: &'a str,
) -> Result<ResponseValue<Vec<Balance>>, Error<ApiErrorResponse>>
pub async fn account_balance<'a>( &'a self, address: &'a str, ) -> Result<ResponseValue<Vec<Balance>>, Error<ApiErrorResponse>>
Get account balance
Sends a GET request to /fapi/v3/balance
Sourcepub async fn health<'a>(
&'a self,
) -> Result<ResponseValue<ByteStream>, Error<ApiErrorResponse>>
pub async fn health<'a>( &'a self, ) -> Result<ResponseValue<ByteStream>, Error<ApiErrorResponse>>
Get health of the API
Sends a GET request to /health
Sourcepub async fn ready<'a>(
&'a self,
) -> Result<ResponseValue<ReadinessStatus>, Error<ApiErrorResponse>>
pub async fn ready<'a>( &'a self, ) -> Result<ResponseValue<ReadinessStatus>, Error<ApiErrorResponse>>
readiness probe — 200 when all components healthy, 503 otherwise
Sends a GET request to /health/ready
Sourcepub async fn constants<'a>(
&'a self,
) -> Result<ResponseValue<RollupConstants>, Error<ApiErrorResponse>>
pub async fn constants<'a>( &'a self, ) -> Result<ResponseValue<RollupConstants>, Error<ApiErrorResponse>>
Get the rollup constants
Sends a GET request to /rollup/constants
Sourcepub async fn schema<'a>(
&'a self,
) -> Result<ResponseValue<Map<String, Value>>, Error<ApiErrorResponse>>
pub async fn schema<'a>( &'a self, ) -> Result<ResponseValue<Map<String, Value>>, Error<ApiErrorResponse>>
Get the rollup schema (unwrapped)
Sends a GET request to /rollup/schema
Sourcepub async fn submit_tx<'a>(
&'a self,
body: &'a SubmitTxRequest,
) -> Result<ResponseValue<SubmitTxResponse>, Error<ApiErrorResponse>>
pub async fn submit_tx<'a>( &'a self, body: &'a SubmitTxRequest, ) -> Result<ResponseValue<SubmitTxResponse>, Error<ApiErrorResponse>>
Submit a transaction to the rollup
Sends a POST request to /tx/submit