Skip to main content

binance/wallet/
enums.rs

1//! Enum definitions for the Binance Wallet API.
2
3use serde::{Deserialize, Serialize};
4use serde_repr::{Deserialize_repr, Serialize_repr};
5
6/// Deposit status reported by the deposit-history endpoint.
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize_repr, Serialize_repr)]
8#[repr(u8)]
9pub enum DepositStatus {
10    Pending = 0,
11    /// Credited but cannot withdraw yet.
12    CreditedButCannotWithdraw = 6,
13    /// Wrong deposit (e.g. wrong address / chain).
14    WrongDeposit = 7,
15    /// Waiting for user confirmation.
16    WaitingUserConfirm = 8,
17    Success = 1,
18}
19
20/// Withdraw status reported by the withdraw-history endpoint.
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize_repr, Serialize_repr)]
22#[repr(u8)]
23pub enum WithdrawStatus {
24    EmailSent = 0,
25    Cancelled = 1,
26    AwaitingApproval = 2,
27    Rejected = 3,
28    Processing = 4,
29    Failure = 5,
30    Completed = 6,
31}
32
33/// Account / wallet a universal transfer operates on.
34///
35/// Used as the `type` parameter on `/sapi/v1/asset/transfer`.
36#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
37#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
38pub enum UniversalTransferType {
39    MainUmfuture,
40    MainCmfuture,
41    MainMargin,
42    UmfutureMain,
43    UmfutureMargin,
44    CmfutureMain,
45    CmfutureMargin,
46    MarginMain,
47    MarginUmfuture,
48    MarginCmfuture,
49    IsolatedmarginMargin,
50    MarginIsolatedmargin,
51    IsolatedmarginIsolatedmargin,
52    MainFunding,
53    FundingMain,
54    FundingUmfuture,
55    UmfutureFunding,
56    MarginFunding,
57    FundingMargin,
58    FundingCmfuture,
59    CmfutureFunding,
60}