solana_remote_wallet/
ledger_error.rs

1use {num_derive::FromPrimitive, thiserror::Error};
2
3#[derive(Error, Debug, Clone, FromPrimitive, PartialEq, Eq)]
4pub enum LedgerError {
5    #[error("Solana app not open on Ledger device")]
6    NoAppResponse = 0x6700,
7
8    #[error("Ledger sdk exception")]
9    SdkException = 0x6801,
10
11    #[error("Ledger invalid parameter")]
12    SdkInvalidParameter = 0x6802,
13
14    #[error("Ledger overflow")]
15    SdkExceptionOverflow = 0x6803,
16
17    #[error("Ledger security exception")]
18    SdkExceptionSecurity = 0x6804,
19
20    #[error("Ledger invalid CRC")]
21    SdkInvalidCrc = 0x6805,
22
23    #[error("Ledger invalid checksum")]
24    SdkInvalidChecksum = 0x6806,
25
26    #[error("Ledger invalid counter")]
27    SdkInvalidCounter = 0x6807,
28
29    #[error("Ledger operation not supported")]
30    SdkNotSupported = 0x6808,
31
32    #[error("Ledger invalid state")]
33    SdkInvalidState = 0x6809,
34
35    #[error("Ledger timeout")]
36    SdkTimeout = 0x6810,
37
38    #[error("Ledger PIC exception")]
39    SdkExceptionPic = 0x6811,
40
41    #[error("Ledger app exit exception")]
42    SdkExceptionAppExit = 0x6812,
43
44    #[error("Ledger IO overflow exception")]
45    SdkExceptionIoOverflow = 0x6813,
46
47    #[error("Ledger IO header exception")]
48    SdkExceptionIoHeader = 0x6814,
49
50    #[error("Ledger IO state exception")]
51    SdkExceptionIoState = 0x6815,
52
53    #[error("Ledger IO reset exception")]
54    SdkExceptionIoReset = 0x6816,
55
56    #[error("Ledger CX port exception")]
57    SdkExceptionCxPort = 0x6817,
58
59    #[error("Ledger system exception")]
60    SdkExceptionSystem = 0x6818,
61
62    #[error("Ledger out of space")]
63    SdkNotEnoughSpace = 0x6819,
64
65    #[error("Ledger invalid counter")]
66    NoApduReceived = 0x6982,
67
68    #[error("Ledger operation rejected by the user")]
69    UserCancel = 0x6985,
70
71    #[error("Ledger received invalid Solana message")]
72    SolanaInvalidMessage = 0x6a80,
73
74    #[error("Ledger received message with invalid header")]
75    SolanaInvalidMessageHeader = 0x6a81,
76
77    #[error("Ledger received message in invalid format")]
78    SolanaInvalidMessageFormat = 0x6a82,
79
80    #[error("Ledger received message with invalid size")]
81    SolanaInvalidMessageSize = 0x6a83,
82
83    #[error("Solana summary finalization failed on Ledger device")]
84    SolanaSummaryFinalizeFailed = 0x6f00,
85
86    #[error("Solana summary update failed on Ledger device")]
87    SolanaSummaryUpdateFailed = 0x6f01,
88
89    #[error("Ledger received unimplemented instruction")]
90    UnimplementedInstruction = 0x6d00,
91
92    #[error("Ledger received invalid CLA")]
93    InvalidCla = 0x6e00,
94}