-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathaccount_public_info.h
295 lines (283 loc) · 8.73 KB
/
account_public_info.h
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
#ifndef _ACCOUNT_PUBLIC_INFO_H
#define _ACCOUNT_PUBLIC_INFO_H
#include "stdint.h"
#include "stdbool.h"
#include "gui_home_widgets.h"
#include "multi_sig_wallet_manager.h"
#include "rsa.h"
#include "bip39.h"
typedef struct {
int32_t addressType;
int32_t addressIndex;
} AccountSettingsItem_t;
typedef enum {
XPUB_TYPE_BTC,
XPUB_TYPE_BTC_LEGACY,
XPUB_TYPE_BTC_NATIVE_SEGWIT,
XPUB_TYPE_BTC_TAPROOT,
#ifdef WEB3_VERSION
XPUB_TYPE_LTC,
XPUB_TYPE_DASH,
XPUB_TYPE_BCH,
XPUB_TYPE_ETH_BIP44_STANDARD,
XPUB_TYPE_ETH_LEDG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L_BIP44_CHANGE_15,
XPUB_TYPE_SOL_BIP44_CHANGE_16,
XPUB_TYPE_SOL_BIP44_CHANGE_17,
XPUB_TYPE_SOL_BIP44_CHANGE_18,
XPUB_TYPE_SOL_BIP44_CHANGE_19,
XPUB_TYPE_SOL_BIP44_CHANGE_20,
XPUB_TYPE_SOL_BIP44_CHANGE_21,
XPUB_TYPE_SOL_BIP44_CHANGE_22,
XPUB_TYPE_SOL_BIP44_CHANGE_23,
XPUB_TYPE_SOL_BIP44_CHANGE_24,
XPUB_TYPE_SOL_BIP44_CHANGE_25,
XPUB_TYPE_SOL_BIP44_CHANGE_26,
XPUB_TYPE_SOL_BIP44_CHANGE_27,
XPUB_TYPE_SOL_BIP44_CHANGE_28,
XPUB_TYPE_SOL_BIP44_CHANGE_29,
XPUB_TYPE_SOL_BIP44_CHANGE_30,
XPUB_TYPE_SOL_BIP44_CHANGE_31,
XPUB_TYPE_SOL_BIP44_CHANGE_32,
XPUB_TYPE_SOL_BIP44_CHANGE_33,
XPUB_TYPE_SOL_BIP44_CHANGE_34,
XPUB_TYPE_SOL_BIP44_CHANGE_35,
XPUB_TYPE_SOL_BIP44_CHANGE_36,
XPUB_TYPE_SOL_BIP44_CHANGE_37,
XPUB_TYPE_SOL_BIP44_CHANGE_38,
XPUB_TYPE_SOL_BIP44_CHANGE_39,
XPUB_TYPE_SOL_BIP44_CHANGE_40,
XPUB_TYPE_SOL_BIP44_CHANGE_41,
XPUB_TYPE_SOL_BIP44_CHANGE_42,
XPUB_TYPE_SOL_BIP44_CHANGE_43,
XPUB_TYPE_SOL_BIP44_CHANGE_44,
XPUB_TYPE_SOL_BIP44_CHANGE_45,
XPUB_TYPE_SOL_BIP44_CHANGE_46,
XPUB_TYPE_SOL_BIP44_CHANGE_47,
XPUB_TYPE_SOL_BIP44_CHANGE_48,
XPUB_TYPE_SOL_BIP44_CHANGE_49,
XPUB_TYPE_SUI_0,
XPUB_TYPE_SUI_1,
XPUB_TYPE_SUI_2,
XPUB_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14,
XPUB_TYPE_LEDGER_ADA_15,
XPUB_TYPE_LEDGER_ADA_16,
XPUB_TYPE_LEDGER_ADA_17,
XPUB_TYPE_LEDGER_ADA_18,
XPUB_TYPE_LEDGER_ADA_19,
XPUB_TYPE_LEDGER_ADA_20,
XPUB_TYPE_LEDGER_ADA_21,
XPUB_TYPE_LEDGER_ADA_22,
XPUB_TYPE_LEDGER_ADA_23,
XPUB_TYPE_ARWEAVE,
XPUB_TYPE_STELLAR_0,
XPUB_TYPE_STELLAR_1,
XPUB_TYPE_STELLAR_2,
XPUB_TYPE_STELLAR_3,
XPUB_TYPE_STELLAR_4,
XPUB_TYPE_TON_BIP39,
XPUB_TYPE_TON_NATIVE,
PUBLIC_INFO_TON_CHECKSUM,
#endif
#ifdef CYPHERPUNK_VERSION
ZCASH_UFVK_ENCRYPTED_0,
XPUB_TYPE_MONERO_0,
XPUB_TYPE_MONERO_PVK_0,
#endif
#ifdef BTC_ONLY
XPUB_TYPE_BTC_TEST,
XPUB_TYPE_BTC_LEGACY_TEST,
XPUB_TYPE_BTC_NATIVE_SEGWIT_TEST,
XPUB_TYPE_BTC_TAPROOT_TEST,
XPUB_TYPE_BTC_MULTI_SIG_P2SH,
XPUB_TYPE_BTC_MULTI_SIG_P2WSH_P2SH,
XPUB_TYPE_BTC_MULTI_SIG_P2WSH,
XPUB_TYPE_BTC_MULTI_SIG_P2SH_TEST,
XPUB_TYPE_BTC_MULTI_SIG_P2WSH_P2SH_TEST,
XPUB_TYPE_BTC_MULTI_SIG_P2WSH_TEST,
#endif
XPUB_TYPE_NUM,
} ChainType;
bool GetIsTempAccount(void);
int32_t AccountPublicInfoSwitch(uint8_t accountIndex, const char *password, bool newKey);
int32_t TempAccountPublicInfo(uint8_t accountIndex, const char *password, bool set);
void DeleteAccountPublicInfo(uint8_t accountIndex);
char *GetCurrentAccountPublicKey(ChainType chain);
uint8_t SpecifiedXPubExist(const char *xPub, bool isTon);
void AccountPublicInfoTest(int argc, char *argv[]);
bool GetFirstReceive(const char* chainName);
void SetFirstReceive(const char* chainName, bool isFirst);
void AccountPublicHomeCoinGet(WalletState_t *walletList, uint8_t count);
char *GetXPubPath(uint8_t index);
void CalculateTonChecksum(uint8_t *entropy, char* output);
uint32_t GetAccountReceiveIndex(const char* chainName);
void SetAccountReceiveIndex(const char* chainName, uint32_t index);
uint32_t GetAccountReceivePath(const char* chainName);
void SetAccountReceivePath(const char* chainName, uint32_t index);
uint32_t GetAccountIndex(const char* chainName);
void SetAccountIndex(const char* chainName, uint32_t index);
void SetConnectWalletPathIndex(const char* walletName, uint32_t index);
uint32_t GetConnectWalletPathIndex(const char* walletName);
uint32_t GetConnectWalletAccountIndex(const char* walletName);
void SetConnectWalletAccountIndex(const char* walletName, uint32_t index);
uint32_t GetConnectWalletNetwork(const char* walletName);
void SetConnectWalletNetwork(const char* walletName, uint32_t index);
#ifdef WEB3_VERSION
ChainType CheckSolPathSupport(char *path);
#endif
#ifdef BTC_ONLY
void ExportMultiSigXpub(ChainType chainType);
void MultiSigWalletSave(const char *password, MultiSigWalletManager_t *manager);
int32_t MultiSigWalletGet(uint8_t accountIndex, const char *password, MultiSigWalletManager_t *manager);
void SetAccountMultiReceiveIndex(uint32_t index, char *verifyCode);
uint32_t GetAccountMultiReceiveIndex(char *verifyCode);
uint32_t GetAccountTestReceiveIndex(const char* chainName);
void SetAccountTestReceiveIndex(const char* chainName, uint32_t index);
uint32_t GetAccountTestReceivePath(const char* chainName);
void SetAccountTestReceivePath(const char* chainName, uint32_t index);
void DeleteAccountMultiReceiveIndex(uint32_t index, char *verifyCode);
#endif
#endif