Skip to main content

bybit/http/
user.rs

1use serde::Deserialize;
2
3use crate::VipLevel;
4
5#[derive(Debug, Deserialize, PartialEq)]
6#[serde(rename_all = "camelCase")]
7pub struct APIKeyInformation {
8    /// Unique ID. Internal use
9    pub id: String,
10    /// The remark
11    pub note: String,
12    /// Api key
13    pub api_key: String,
14    /// 0:Read and Write. 1:Read only
15    pub read_only: i64,
16    /// Always ""
17    pub secret: String,
18    /// The types of permission
19    pub permissions: APIKeyPermissions,
20    /// IP bound
21    pub ips: Vec<String>,
22    /// The type of api key. 1:personal, 2:connected to the third-party app
23    #[serde(rename = "type")]
24    pub key_type: i64,
25    /// The remaining valid days of api key. Only for those api key with no IP bound or the password has been changed
26    pub deadline_day: u64,
27    /// The expiry day of the api key. Only for those api key with no IP bound or the password has been changed
28    pub expired_at: String,
29    /// The create day of the api key
30    pub created_at: String,
31    /// Whether the account to which the account upgrade to unified trade account. 0:regular account; 1:unified trade account
32    pub uta: i64,
33    /// User ID
34    #[serde(rename = "userID")]
35    pub user_id: i64,
36    /// Inviter ID (the UID of the account which invited this account to the platform)
37    #[serde(rename = "inviterID")]
38    pub inviter_id: i64,
39    /// VIP Level
40    pub vip_level: VipLevel,
41    /// Market maker level
42    pub mkt_maker_level: String,
43    /// Affiliate Id. 0 represents that there is no binding relationship.
44    #[serde(rename = "affiliateID")]
45    pub affiliate_id: i64,
46    /// Rsa public key
47    pub rsa_public_key: String,
48    /// If this api key belongs to master account or not
49    pub is_master: bool,
50    /// The main account uid. Returns "0" when the endpoint is called by main account
51    pub parent_uid: String,
52    /// Personal account kyc level. LEVEL_DEFAULT, LEVEL_1, LEVEL_2
53    pub kyc_level: String,
54    /// Personal account kyc region
55    pub kyc_region: String,
56}
57
58#[derive(Debug, Deserialize, PartialEq)]
59#[serde(rename_all = "PascalCase")]
60pub struct APIKeyPermissions {
61    /// Permission of contract trade Order, Position
62    pub contract_trade: Vec<String>,
63    /// Permission of spot SpotTrade
64    pub spot: Vec<String>,
65    /// Permission of wallet AccountTransfer, SubMemberTransfer(master account), SubMemberTransferList(sub account), Withdraw(master account)
66    pub wallet: Vec<String>,
67    /// Permission of USDC Contract. It supports trade option and USDC perpetual. OptionsTrade
68    pub options: Vec<String>,
69    /// Unified account has this permission by default DerivativesTrade
70    /// For classic account, it is always []
71    pub derivatives: Vec<String>,
72    /// Permission of convert ExchangeHistory
73    pub exchange: Vec<String>,
74    /// Permission of earn product Earn
75    #[serde(default)]
76    pub earn: Vec<String>,
77    /// Permission of blocktrade. Not applicable to subaccount, always []
78    pub block_trade: Vec<String>,
79    /// Permission of Affiliate. Only affiliate can have this permission, otherwise always []
80    pub affiliate: Vec<String>,
81    /// Always [] as Master Trader account just use ContractTrade to start CopyTrading
82    pub copy_trading: Vec<String>,
83}