-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathhardware-error-mappings.ts
More file actions
116 lines (111 loc) · 3.65 KB
/
Copy pathhardware-error-mappings.ts
File metadata and controls
116 lines (111 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import { ErrorCode, Severity, Category } from './hardware-errors-enums';
export const LEDGER_ERROR_MAPPINGS = {
'0x9000': {
code: ErrorCode.Success,
message: 'Operation successful',
severity: Severity.Info,
category: Category.Success,
},
'0x6300': {
code: ErrorCode.AuthenticationFailed,
message: 'Authentication failed',
severity: Severity.Err,
category: Category.Authentication,
userMessage: 'Authentication failed. Please verify your credentials.',
},
'0x63c0': {
code: ErrorCode.AuthenticationPinAttemptsRemaining,
message: 'PIN attempts remaining',
severity: Severity.Warning,
category: Category.Authentication,
userMessage: 'Incorrect PIN. Please try again.',
},
'0x6982': {
code: ErrorCode.AuthenticationSecurityCondition,
message: 'Security conditions not satisfied',
severity: Severity.Err,
category: Category.Authentication,
userMessage:
'Device is locked or access rights are insufficient. Please unlock your device.',
},
'0x6985': {
code: ErrorCode.UserRejected,
message: 'User rejected action on device',
severity: Severity.Warning,
category: Category.UserAction,
userMessage:
'Transaction was rejected. Please approve on your device to continue.',
},
'0x9804': {
code: ErrorCode.AuthenticationSecurityCondition,
message: 'App update required',
severity: Severity.Err,
category: Category.Authentication,
userMessage: 'Please update your Ledger app to continue.',
},
'0x9808': {
code: ErrorCode.AuthenticationFailed,
message: 'Contradiction in secret code status',
severity: Severity.Err,
category: Category.Authentication,
},
'0x9840': {
code: ErrorCode.AuthenticationDeviceBlocked,
message: 'Code blocked',
severity: Severity.Critical,
category: Category.Authentication,
userMessage:
'Your device is blocked due to too many failed attempts. Please follow device recovery procedures.',
},
'0x650f': {
code: ErrorCode.ConnectionClosed,
message: 'App closed or connection issue',
severity: Severity.Err,
category: Category.Connection,
userMessage:
'Connection lost or app closed. Please open the corresponding app on your Ledger device.',
},
'0x5515': {
code: ErrorCode.AuthenticationDeviceLocked,
message: 'Device is locked',
severity: Severity.Err,
category: Category.Authentication,
userMessage: 'Please unlock your Ledger device to continue.',
},
'0x5501': {
code: ErrorCode.UserRejected,
message: 'User refused on device',
severity: Severity.Warning,
category: Category.UserAction,
userMessage:
'Operation was rejected. Please approve on your device to continue.',
},
'0x6a80': {
code: ErrorCode.DeviceStateBlindSignNotSupported,
message: 'Blind signing not supported',
severity: Severity.Err,
category: Category.DeviceState,
userMessage: 'Blind signing is not supported on this device.',
},
'0x6d00': {
code: ErrorCode.DeviceStateOnlyV4Supported,
message: 'Ledger Only V4 supported',
severity: Severity.Err,
category: Category.DeviceState,
userMessage: 'Only V4 is supported on this device.',
},
'0x6e00': {
code: ErrorCode.DeviceStateEthAppClosed,
message: 'Ethereum app closed',
severity: Severity.Err,
category: Category.DeviceState,
userMessage: 'Ethereum app is closed. Please open it to continue.',
},
'0x6501': {
code: ErrorCode.DeviceStateEthAppOutOfDate,
message: 'Ethereum app out of date',
severity: Severity.Err,
category: Category.DeviceState,
userMessage: 'Ethereum app is out of date. Please update it to continue.',
},
};