bpx_api_types/
account.rs

1use rust_decimal::Decimal;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5#[serde(rename_all = "camelCase")]
6pub struct AccountSettings {
7    pub auto_borrow_settlements: bool,
8    pub auto_lend: bool,
9    pub auto_realize_pnl: bool,
10    pub auto_repay_borrows: bool,
11    pub borrow_limit: Decimal,
12    pub futures_maker_fee: Decimal,
13    pub futures_taker_fee: Decimal,
14    pub leverage_limit: Decimal,
15    pub limit_orders: u32,
16    pub liquidating: bool,
17    pub position_limit: Decimal,
18    pub spot_maker_fee: Decimal,
19    pub spot_taker_fee: Decimal,
20    pub trigger_orders: u32,
21}
22
23#[derive(Debug, Clone, Serialize, Deserialize)]
24#[serde(rename_all = "camelCase")]
25pub struct AccountMaxBorrow {
26    pub max_borrow_quantity: Decimal,
27    pub symbol: String,
28}
29
30#[derive(Debug, Clone, Serialize, Deserialize)]
31#[serde(rename_all = "camelCase")]
32pub struct AccountMaxWithdrawal {
33    pub auto_borrow: Option<bool>,
34    pub auto_lend_redeem: Option<bool>,
35    pub max_withdrawal_quantity: Decimal,
36    pub symbol: String,
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize, Default)]
40#[serde(rename_all = "camelCase")]
41pub struct UpdateAccountPayload {
42    #[serde(skip_serializing_if = "Option::is_none")]
43    pub auto_borrow_settlements: Option<bool>,
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub auto_lend: Option<bool>,
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub auto_repay_borrows: Option<bool>,
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub leverage_limit: Option<Decimal>,
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize, Default)]
53#[serde(rename_all = "camelCase")]
54pub struct ConvertDustPayload {
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub symbol: Option<String>,
57}