@onekeyfe/hd-transport 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.eslintrc +21 -0
  2. package/README.md +3 -0
  3. package/dist/constants.d.ts +5 -0
  4. package/dist/constants.d.ts.map +1 -0
  5. package/dist/index.d.ts +2725 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +742 -0
  8. package/dist/serialization/index.d.ts +5 -0
  9. package/dist/serialization/index.d.ts.map +1 -0
  10. package/dist/serialization/protobuf/decode.d.ts +6 -0
  11. package/dist/serialization/protobuf/decode.d.ts.map +1 -0
  12. package/dist/serialization/protobuf/encode.d.ts +5 -0
  13. package/dist/serialization/protobuf/encode.d.ts.map +1 -0
  14. package/dist/serialization/protobuf/index.d.ts +4 -0
  15. package/dist/serialization/protobuf/index.d.ts.map +1 -0
  16. package/dist/serialization/protobuf/messages.d.ts +11 -0
  17. package/dist/serialization/protobuf/messages.d.ts.map +1 -0
  18. package/dist/serialization/protocol/decode.d.ts +11 -0
  19. package/dist/serialization/protocol/decode.d.ts.map +1 -0
  20. package/dist/serialization/protocol/encode.d.ts +11 -0
  21. package/dist/serialization/protocol/encode.d.ts.map +1 -0
  22. package/dist/serialization/protocol/index.d.ts +3 -0
  23. package/dist/serialization/protocol/index.d.ts.map +1 -0
  24. package/dist/serialization/receive.d.ts +8 -0
  25. package/dist/serialization/receive.d.ts.map +1 -0
  26. package/dist/serialization/send.d.ts +6 -0
  27. package/dist/serialization/send.d.ts.map +1 -0
  28. package/dist/types/index.d.ts +3 -0
  29. package/dist/types/index.d.ts.map +1 -0
  30. package/dist/types/messages.d.ts +1954 -0
  31. package/dist/types/messages.d.ts.map +1 -0
  32. package/dist/types/transport.d.ts +42 -0
  33. package/dist/types/transport.d.ts.map +1 -0
  34. package/dist/utils/highlevel-checks.d.ts +10 -0
  35. package/dist/utils/highlevel-checks.d.ts.map +1 -0
  36. package/dist/utils/protobuf.d.ts +2 -0
  37. package/dist/utils/protobuf.d.ts.map +1 -0
  38. package/package.json +27 -0
  39. package/src/constants.ts +4 -0
  40. package/src/index.ts +28 -0
  41. package/src/serialization/index.ts +6 -0
  42. package/src/serialization/protobuf/decode.ts +83 -0
  43. package/src/serialization/protobuf/encode.ts +79 -0
  44. package/src/serialization/protobuf/index.ts +3 -0
  45. package/src/serialization/protobuf/messages.ts +37 -0
  46. package/src/serialization/protocol/decode.ts +48 -0
  47. package/src/serialization/protocol/encode.ts +59 -0
  48. package/src/serialization/protocol/index.ts +2 -0
  49. package/src/serialization/receive.ts +18 -0
  50. package/src/serialization/send.ts +39 -0
  51. package/src/types/index.ts +2 -0
  52. package/src/types/messages.ts +2489 -0
  53. package/src/types/transport.ts +51 -0
  54. package/src/utils/highlevel-checks.ts +88 -0
  55. package/src/utils/protobuf.ts +24 -0
  56. package/tsconfig.json +7 -0
@@ -0,0 +1,2489 @@
1
+ // This file is auto generated from data/messages/message.json
2
+
3
+ // custom type uint32/64 may be represented as string
4
+ export type UintType = string | number;
5
+
6
+ type Empty = Record<string, never>;
7
+
8
+ // BinanceGetAddress
9
+ export type BinanceGetAddress = {
10
+ address_n: number[];
11
+ show_display?: boolean;
12
+ };
13
+
14
+ // BinanceAddress
15
+ export type BinanceAddress = {
16
+ address: string;
17
+ };
18
+
19
+ // BinanceGetPublicKey
20
+ export type BinanceGetPublicKey = {
21
+ address_n: number[];
22
+ show_display?: boolean;
23
+ };
24
+
25
+ // BinancePublicKey
26
+ export type BinancePublicKey = {
27
+ public_key: string;
28
+ };
29
+
30
+ // BinanceSignTx
31
+ export type BinanceSignTx = {
32
+ address_n: number[];
33
+ msg_count: number;
34
+ account_number: number;
35
+ chain_id?: string;
36
+ memo?: string;
37
+ sequence: number;
38
+ source: number;
39
+ };
40
+
41
+ // BinanceTxRequest
42
+ export type BinanceTxRequest = Record<string, never>;
43
+
44
+ export type BinanceCoin = {
45
+ amount: UintType;
46
+ denom: string;
47
+ };
48
+
49
+ export type BinanceInputOutput = {
50
+ address: string;
51
+ coins: BinanceCoin[];
52
+ };
53
+
54
+ // BinanceTransferMsg
55
+ export type BinanceTransferMsg = {
56
+ inputs: BinanceInputOutput[];
57
+ outputs: BinanceInputOutput[];
58
+ };
59
+
60
+ export enum BinanceOrderType {
61
+ OT_UNKNOWN = 0,
62
+ MARKET = 1,
63
+ LIMIT = 2,
64
+ OT_RESERVED = 3,
65
+ }
66
+
67
+ export enum BinanceOrderSide {
68
+ SIDE_UNKNOWN = 0,
69
+ BUY = 1,
70
+ SELL = 2,
71
+ }
72
+
73
+ export enum BinanceTimeInForce {
74
+ TIF_UNKNOWN = 0,
75
+ GTE = 1,
76
+ TIF_RESERVED = 2,
77
+ IOC = 3,
78
+ }
79
+
80
+ // BinanceOrderMsg
81
+ export type BinanceOrderMsg = {
82
+ id?: string;
83
+ ordertype: BinanceOrderType;
84
+ price: number;
85
+ quantity: number;
86
+ sender?: string;
87
+ side: BinanceOrderSide;
88
+ symbol?: string;
89
+ timeinforce: BinanceTimeInForce;
90
+ };
91
+
92
+ // BinanceCancelMsg
93
+ export type BinanceCancelMsg = {
94
+ refid?: string;
95
+ sender?: string;
96
+ symbol?: string;
97
+ };
98
+
99
+ // BinanceSignedTx
100
+ export type BinanceSignedTx = {
101
+ signature: string;
102
+ public_key: string;
103
+ };
104
+
105
+ export enum Enum_InputScriptType {
106
+ SPENDADDRESS = 0,
107
+ SPENDMULTISIG = 1,
108
+ EXTERNAL = 2,
109
+ SPENDWITNESS = 3,
110
+ SPENDP2SHWITNESS = 4,
111
+ SPENDTAPROOT = 5,
112
+ }
113
+ export type InputScriptType = keyof typeof Enum_InputScriptType;
114
+
115
+ export enum Enum_OutputScriptType {
116
+ PAYTOADDRESS = 0,
117
+ PAYTOSCRIPTHASH = 1,
118
+ PAYTOMULTISIG = 2,
119
+ PAYTOOPRETURN = 3,
120
+ PAYTOWITNESS = 4,
121
+ PAYTOP2SHWITNESS = 5,
122
+ PAYTOTAPROOT = 6,
123
+ }
124
+ export type OutputScriptType = keyof typeof Enum_OutputScriptType;
125
+
126
+ export enum DecredStakingSpendType {
127
+ SSGen = 0,
128
+ SSRTX = 1,
129
+ }
130
+
131
+ export enum AmountUnit {
132
+ BITCOIN = 0,
133
+ MILLIBITCOIN = 1,
134
+ MICROBITCOIN = 2,
135
+ SATOSHI = 3,
136
+ }
137
+
138
+ // HDNodeType
139
+ export type HDNodeType = {
140
+ depth: number;
141
+ fingerprint: number;
142
+ child_num: number;
143
+ chain_code: string;
144
+ private_key?: string;
145
+ public_key: string;
146
+ };
147
+
148
+ export type HDNodePathType = {
149
+ node: HDNodeType | string;
150
+ address_n: number[];
151
+ };
152
+
153
+ // MultisigRedeemScriptType
154
+ export type MultisigRedeemScriptType = {
155
+ pubkeys: HDNodePathType[];
156
+ signatures: string[];
157
+ m: number;
158
+ nodes?: HDNodeType[];
159
+ address_n?: number[];
160
+ };
161
+
162
+ // GetPublicKey
163
+ export type GetPublicKey = {
164
+ address_n: number[];
165
+ ecdsa_curve_name?: string;
166
+ show_display?: boolean;
167
+ coin_name?: string;
168
+ script_type?: InputScriptType;
169
+ ignore_xpub_magic?: boolean;
170
+ };
171
+
172
+ // PublicKey
173
+ export type PublicKey = {
174
+ node: HDNodeType;
175
+ xpub: string;
176
+ root_fingerprint?: number;
177
+ };
178
+
179
+ // GetAddress
180
+ export type GetAddress = {
181
+ address_n: number[];
182
+ coin_name?: string;
183
+ show_display?: boolean;
184
+ multisig?: MultisigRedeemScriptType;
185
+ script_type?: InputScriptType;
186
+ ignore_xpub_magic?: boolean;
187
+ };
188
+
189
+ // Address
190
+ export type Address = {
191
+ address: string;
192
+ mac?: string;
193
+ };
194
+
195
+ // GetOwnershipId
196
+ export type GetOwnershipId = {
197
+ address_n: number[];
198
+ coin_name?: string;
199
+ multisig?: MultisigRedeemScriptType;
200
+ script_type?: InputScriptType;
201
+ };
202
+
203
+ // OwnershipId
204
+ export type OwnershipId = {
205
+ ownership_id: string;
206
+ };
207
+
208
+ // SignMessage
209
+ export type SignMessage = {
210
+ address_n: number[];
211
+ message: string;
212
+ coin_name?: string;
213
+ script_type?: InputScriptType;
214
+ no_script_type?: boolean;
215
+ };
216
+
217
+ // MessageSignature
218
+ export type MessageSignature = {
219
+ address: string;
220
+ signature: string;
221
+ };
222
+
223
+ // VerifyMessage
224
+ export type VerifyMessage = {
225
+ address: string;
226
+ signature: string;
227
+ message: string;
228
+ coin_name?: string;
229
+ };
230
+
231
+ // SignTx
232
+ export type SignTx = {
233
+ outputs_count: number;
234
+ inputs_count: number;
235
+ coin_name?: string;
236
+ version?: number;
237
+ lock_time?: number;
238
+ expiry?: number;
239
+ overwintered?: boolean;
240
+ version_group_id?: number;
241
+ timestamp?: number;
242
+ branch_id?: number;
243
+ amount_unit?: AmountUnit;
244
+ decred_staking_ticket?: boolean;
245
+ };
246
+
247
+ export enum Enum_RequestType {
248
+ TXINPUT = 0,
249
+ TXOUTPUT = 1,
250
+ TXMETA = 2,
251
+ TXFINISHED = 3,
252
+ TXEXTRADATA = 4,
253
+ TXORIGINPUT = 5,
254
+ TXORIGOUTPUT = 6,
255
+ TXPAYMENTREQ = 7,
256
+ }
257
+ export type RequestType = keyof typeof Enum_RequestType;
258
+
259
+ export type TxRequestDetailsType = {
260
+ request_index: number;
261
+ tx_hash?: string;
262
+ extra_data_len?: number;
263
+ extra_data_offset?: number;
264
+ };
265
+
266
+ export type TxRequestSerializedType = {
267
+ signature_index?: number;
268
+ signature?: string;
269
+ serialized_tx?: string;
270
+ };
271
+
272
+ // TxRequest
273
+ export type TxRequest = {
274
+ request_type: RequestType;
275
+ details: TxRequestDetailsType;
276
+ serialized?: TxRequestSerializedType;
277
+ };
278
+
279
+ // TxInputType replacement
280
+ // TxInputType needs more exact types
281
+ // differences: external input (no address_n + required script_pubkey)
282
+
283
+ export type InternalInputScriptType = Exclude<InputScriptType, 'EXTERNAL'>;
284
+
285
+ type CommonTxInputType = {
286
+ prev_hash: string; // required: previous transaction hash (reversed)
287
+ prev_index: number; // required: previous transaction index
288
+ amount: UintType; // required
289
+ sequence?: number;
290
+ multisig?: MultisigRedeemScriptType;
291
+ decred_tree?: number;
292
+ orig_hash?: string; // RBF
293
+ orig_index?: number; // RBF
294
+ decred_staking_spend?: DecredStakingSpendType;
295
+ script_pubkey?: string; // required if script_type=EXTERNAL
296
+ script_sig?: string; // used by EXTERNAL, depending on script_pubkey
297
+ witness?: string; // used by EXTERNAL, depending on script_pubkey
298
+ ownership_proof?: string; // used by EXTERNAL, depending on script_pubkey
299
+ commitment_data?: string; // used by EXTERNAL, depending on ownership_proof
300
+ };
301
+
302
+ export type TxInputType =
303
+ | (CommonTxInputType & {
304
+ address_n: number[];
305
+ script_type?: InternalInputScriptType;
306
+ })
307
+ | (CommonTxInputType & {
308
+ address_n?: typeof undefined;
309
+ script_type: 'EXTERNAL';
310
+ script_pubkey: string;
311
+ });
312
+
313
+ export type TxInput = TxInputType;
314
+
315
+ // TxInputType replacement end
316
+
317
+ export type TxOutputBinType = {
318
+ amount: UintType;
319
+ script_pubkey: string;
320
+ decred_script_version?: number;
321
+ };
322
+
323
+ // TxOutputType replacement
324
+ // TxOutputType needs more exact types
325
+ // differences: external output (no address_n), opreturn output (no address_n, no address)
326
+
327
+ export type ChangeOutputScriptType = Exclude<OutputScriptType, 'PAYTOOPRETURN'>;
328
+
329
+ export type TxOutputType =
330
+ | {
331
+ address: string;
332
+ address_n?: typeof undefined;
333
+ script_type: 'PAYTOADDRESS';
334
+ amount: UintType;
335
+ multisig?: MultisigRedeemScriptType;
336
+ orig_hash?: string;
337
+ orig_index?: number;
338
+ payment_req_index?: number;
339
+ }
340
+ | {
341
+ address?: typeof undefined;
342
+ address_n: number[];
343
+ script_type: ChangeOutputScriptType;
344
+ amount: UintType;
345
+ multisig?: MultisigRedeemScriptType;
346
+ orig_hash?: string;
347
+ orig_index?: number;
348
+ payment_req_index?: number;
349
+ }
350
+ | {
351
+ address?: typeof undefined;
352
+ address_n?: typeof undefined;
353
+ amount: '0';
354
+ op_return_data: string;
355
+ script_type: 'PAYTOOPRETURN';
356
+ orig_hash?: string;
357
+ orig_index?: number;
358
+ payment_req_index?: number;
359
+ };
360
+
361
+ export type TxOutput = TxOutputType;
362
+
363
+ // - TxOutputType replacement end
364
+
365
+ // PrevTx
366
+ export type PrevTx = {
367
+ version: number;
368
+ lock_time: number;
369
+ inputs_count: number;
370
+ outputs_count: number;
371
+ extra_data_len?: number;
372
+ expiry?: number;
373
+ version_group_id?: number;
374
+ timestamp?: number;
375
+ branch_id?: number;
376
+ };
377
+
378
+ // PrevInput
379
+ export type PrevInput = {
380
+ prev_hash: string;
381
+ prev_index: number;
382
+ script_sig: string;
383
+ sequence: number;
384
+ decred_tree?: number;
385
+ };
386
+
387
+ // PrevOutput
388
+ export type PrevOutput = {
389
+ amount: UintType;
390
+ script_pubkey: string;
391
+ decred_script_version?: number;
392
+ };
393
+
394
+ export type TextMemo = {
395
+ text: string;
396
+ };
397
+
398
+ export type RefundMemo = {
399
+ address: string;
400
+ mac: string;
401
+ };
402
+
403
+ export type CoinPurchaseMemo = {
404
+ coin_type: number;
405
+ amount: UintType;
406
+ address: string;
407
+ mac: string;
408
+ };
409
+
410
+ export type PaymentRequestMemo = {
411
+ text_memo?: TextMemo;
412
+ refund_memo?: RefundMemo;
413
+ coin_purchase_memo?: CoinPurchaseMemo;
414
+ };
415
+
416
+ // TxAckPaymentRequest
417
+ export type TxAckPaymentRequest = {
418
+ nonce?: string;
419
+ recipient_name: string;
420
+ memos?: PaymentRequestMemo[];
421
+ amount?: UintType;
422
+ signature: string;
423
+ };
424
+
425
+ // TxAck
426
+
427
+ // TxAck replacement
428
+ // TxAck needs more exact types
429
+ // PrevInput and TxInputType requires exact responses in TxAckResponse
430
+ // main difference: PrevInput should not contain address_n (unexpected field by protobuf)
431
+
432
+ export type TxAckResponse =
433
+ | {
434
+ inputs: Array<TxInputType | PrevInput>;
435
+ }
436
+ | {
437
+ bin_outputs: TxOutputBinType[];
438
+ }
439
+ | {
440
+ outputs: TxOutputType[];
441
+ }
442
+ | {
443
+ extra_data: string;
444
+ }
445
+ | {
446
+ version?: number;
447
+ lock_time?: number;
448
+ inputs_cnt: number;
449
+ outputs_cnt: number;
450
+ extra_data?: string;
451
+ extra_data_len?: number;
452
+ timestamp?: number;
453
+ version_group_id?: number;
454
+ expiry?: number;
455
+ branch_id?: number;
456
+ };
457
+
458
+ export type TxAck = {
459
+ tx: TxAckResponse;
460
+ };
461
+ // - TxAck replacement end
462
+
463
+ export type TxAckInputWrapper = {
464
+ input: TxInput;
465
+ };
466
+
467
+ // TxAckInput
468
+ export type TxAckInput = {
469
+ tx: TxAckInputWrapper;
470
+ };
471
+
472
+ export type TxAckOutputWrapper = {
473
+ output: TxOutput;
474
+ };
475
+
476
+ // TxAckOutput
477
+ export type TxAckOutput = {
478
+ tx: TxAckOutputWrapper;
479
+ };
480
+
481
+ // TxAckPrevMeta
482
+ export type TxAckPrevMeta = {
483
+ tx: PrevTx;
484
+ };
485
+
486
+ export type TxAckPrevInputWrapper = {
487
+ input: PrevInput;
488
+ };
489
+
490
+ // TxAckPrevInput
491
+ export type TxAckPrevInput = {
492
+ tx: TxAckPrevInputWrapper;
493
+ };
494
+
495
+ export type TxAckPrevOutputWrapper = {
496
+ output: PrevOutput;
497
+ };
498
+
499
+ // TxAckPrevOutput
500
+ export type TxAckPrevOutput = {
501
+ tx: TxAckPrevOutputWrapper;
502
+ };
503
+
504
+ export type TxAckPrevExtraDataWrapper = {
505
+ extra_data_chunk: string;
506
+ };
507
+
508
+ // TxAckPrevExtraData
509
+ export type TxAckPrevExtraData = {
510
+ tx: TxAckPrevExtraDataWrapper;
511
+ };
512
+
513
+ // GetOwnershipProof
514
+ export type GetOwnershipProof = {
515
+ address_n: number[];
516
+ coin_name?: string;
517
+ script_type?: InputScriptType;
518
+ multisig?: MultisigRedeemScriptType;
519
+ user_confirmation?: boolean;
520
+ ownership_ids?: string[];
521
+ commitment_data?: string;
522
+ };
523
+
524
+ // OwnershipProof
525
+ export type OwnershipProof = {
526
+ ownership_proof: string;
527
+ signature: string;
528
+ };
529
+
530
+ // AuthorizeCoinJoin
531
+ export type AuthorizeCoinJoin = {
532
+ coordinator: string;
533
+ max_rounds: number;
534
+ max_coordinator_fee_rate: number;
535
+ max_fee_per_kvbyte: number;
536
+ address_n: number[];
537
+ coin_name?: string;
538
+ script_type?: InputScriptType;
539
+ amount_unit?: AmountUnit;
540
+ };
541
+
542
+ // FirmwareErase
543
+ export type FirmwareErase = {
544
+ length?: number;
545
+ };
546
+
547
+ // FirmwareRequest
548
+ export type FirmwareRequest = {
549
+ offset?: number;
550
+ length?: number;
551
+ };
552
+
553
+ // FirmwareUpload
554
+ export type FirmwareUpload = {
555
+ payload: Buffer | ArrayBuffer;
556
+ hash?: string;
557
+ };
558
+
559
+ // SelfTest
560
+ export type SelfTest = {
561
+ payload?: string;
562
+ };
563
+
564
+ export enum CardanoDerivationType {
565
+ LEDGER = 0,
566
+ ICARUS = 1,
567
+ ICARUS_TREZOR = 2,
568
+ }
569
+
570
+ export enum CardanoAddressType {
571
+ BASE = 0,
572
+ BASE_SCRIPT_KEY = 1,
573
+ BASE_KEY_SCRIPT = 2,
574
+ BASE_SCRIPT_SCRIPT = 3,
575
+ POINTER = 4,
576
+ POINTER_SCRIPT = 5,
577
+ ENTERPRISE = 6,
578
+ ENTERPRISE_SCRIPT = 7,
579
+ BYRON = 8,
580
+ REWARD = 14,
581
+ REWARD_SCRIPT = 15,
582
+ }
583
+
584
+ export enum CardanoNativeScriptType {
585
+ PUB_KEY = 0,
586
+ ALL = 1,
587
+ ANY = 2,
588
+ N_OF_K = 3,
589
+ INVALID_BEFORE = 4,
590
+ INVALID_HEREAFTER = 5,
591
+ }
592
+
593
+ export enum CardanoNativeScriptHashDisplayFormat {
594
+ HIDE = 0,
595
+ BECH32 = 1,
596
+ POLICY_ID = 2,
597
+ }
598
+
599
+ export enum CardanoCertificateType {
600
+ STAKE_REGISTRATION = 0,
601
+ STAKE_DEREGISTRATION = 1,
602
+ STAKE_DELEGATION = 2,
603
+ STAKE_POOL_REGISTRATION = 3,
604
+ }
605
+
606
+ export enum CardanoPoolRelayType {
607
+ SINGLE_HOST_IP = 0,
608
+ SINGLE_HOST_NAME = 1,
609
+ MULTIPLE_HOST_NAME = 2,
610
+ }
611
+
612
+ export enum CardanoTxAuxiliaryDataSupplementType {
613
+ NONE = 0,
614
+ CATALYST_REGISTRATION_SIGNATURE = 1,
615
+ }
616
+
617
+ export enum CardanoTxSigningMode {
618
+ ORDINARY_TRANSACTION = 0,
619
+ POOL_REGISTRATION_AS_OWNER = 1,
620
+ MULTISIG_TRANSACTION = 2,
621
+ PLUTUS_TRANSACTION = 3,
622
+ }
623
+
624
+ export enum CardanoTxWitnessType {
625
+ BYRON_WITNESS = 0,
626
+ SHELLEY_WITNESS = 1,
627
+ }
628
+
629
+ // CardanoBlockchainPointerType
630
+ export type CardanoBlockchainPointerType = {
631
+ block_index: number;
632
+ tx_index: number;
633
+ certificate_index: number;
634
+ };
635
+
636
+ // CardanoNativeScript
637
+ export type CardanoNativeScript = {
638
+ type: CardanoNativeScriptType;
639
+ scripts?: CardanoNativeScript[];
640
+ key_hash?: string;
641
+ key_path?: number[];
642
+ required_signatures_count?: number;
643
+ invalid_before?: UintType;
644
+ invalid_hereafter?: UintType;
645
+ };
646
+
647
+ // CardanoGetNativeScriptHash
648
+ export type CardanoGetNativeScriptHash = {
649
+ script: CardanoNativeScript;
650
+ display_format: CardanoNativeScriptHashDisplayFormat;
651
+ derivation_type: CardanoDerivationType;
652
+ };
653
+
654
+ // CardanoNativeScriptHash
655
+ export type CardanoNativeScriptHash = {
656
+ script_hash: string;
657
+ };
658
+
659
+ // CardanoAddressParametersType
660
+ export type CardanoAddressParametersType = {
661
+ address_type: CardanoAddressType;
662
+ address_n: number[];
663
+ address_n_staking: number[];
664
+ staking_key_hash?: string;
665
+ certificate_pointer?: CardanoBlockchainPointerType;
666
+ script_payment_hash?: string;
667
+ script_staking_hash?: string;
668
+ };
669
+
670
+ // CardanoGetAddress
671
+ export type CardanoGetAddress = {
672
+ show_display?: boolean;
673
+ protocol_magic: number;
674
+ network_id: number;
675
+ address_parameters: CardanoAddressParametersType;
676
+ derivation_type: CardanoDerivationType;
677
+ };
678
+
679
+ // CardanoAddress
680
+ export type CardanoAddress = {
681
+ address: string;
682
+ };
683
+
684
+ // CardanoGetPublicKey
685
+ export type CardanoGetPublicKey = {
686
+ address_n: number[];
687
+ show_display?: boolean;
688
+ derivation_type: CardanoDerivationType;
689
+ };
690
+
691
+ // CardanoPublicKey
692
+ export type CardanoPublicKey = {
693
+ xpub: string;
694
+ node: HDNodeType;
695
+ };
696
+
697
+ // CardanoSignTxInit
698
+ export type CardanoSignTxInit = {
699
+ signing_mode: CardanoTxSigningMode;
700
+ protocol_magic: number;
701
+ network_id: number;
702
+ inputs_count: number;
703
+ outputs_count: number;
704
+ fee: UintType;
705
+ ttl?: UintType;
706
+ certificates_count: number;
707
+ withdrawals_count: number;
708
+ has_auxiliary_data: boolean;
709
+ validity_interval_start?: UintType;
710
+ witness_requests_count: number;
711
+ minting_asset_groups_count: number;
712
+ derivation_type: CardanoDerivationType;
713
+ include_network_id?: boolean;
714
+ script_data_hash?: string;
715
+ collateral_inputs_count: number;
716
+ required_signers_count: number;
717
+ };
718
+
719
+ // CardanoTxInput
720
+ export type CardanoTxInput = {
721
+ prev_hash: string;
722
+ prev_index: number;
723
+ };
724
+
725
+ // CardanoTxOutput
726
+ export type CardanoTxOutput = {
727
+ address?: string;
728
+ address_parameters?: CardanoAddressParametersType;
729
+ amount: UintType;
730
+ asset_groups_count: number;
731
+ datum_hash?: string;
732
+ };
733
+
734
+ // CardanoAssetGroup
735
+ export type CardanoAssetGroup = {
736
+ policy_id: string;
737
+ tokens_count: number;
738
+ };
739
+
740
+ // CardanoToken
741
+ export type CardanoToken = {
742
+ asset_name_bytes: string;
743
+ amount?: UintType;
744
+ mint_amount?: UintType;
745
+ };
746
+
747
+ // CardanoPoolOwner
748
+ export type CardanoPoolOwner = {
749
+ staking_key_path?: number[];
750
+ staking_key_hash?: string;
751
+ };
752
+
753
+ // CardanoPoolRelayParameters
754
+ export type CardanoPoolRelayParameters = {
755
+ type: CardanoPoolRelayType;
756
+ ipv4_address?: string;
757
+ ipv6_address?: string;
758
+ host_name?: string;
759
+ port?: number;
760
+ };
761
+
762
+ // CardanoPoolMetadataType
763
+ export type CardanoPoolMetadataType = {
764
+ url: string;
765
+ hash: string;
766
+ };
767
+
768
+ // CardanoPoolParametersType
769
+ export type CardanoPoolParametersType = {
770
+ pool_id: string;
771
+ vrf_key_hash: string;
772
+ pledge: UintType;
773
+ cost: UintType;
774
+ margin_numerator: UintType;
775
+ margin_denominator: UintType;
776
+ reward_account: string;
777
+ owners: CardanoPoolOwner[];
778
+ relays: CardanoPoolRelayParameters[];
779
+ metadata?: CardanoPoolMetadataType;
780
+ owners_count: number;
781
+ relays_count: number;
782
+ };
783
+
784
+ // CardanoTxCertificate
785
+ export type CardanoTxCertificate = {
786
+ type: CardanoCertificateType;
787
+ path?: number[];
788
+ pool?: string;
789
+ pool_parameters?: CardanoPoolParametersType;
790
+ script_hash?: string;
791
+ key_hash?: string;
792
+ };
793
+
794
+ // CardanoTxWithdrawal
795
+ export type CardanoTxWithdrawal = {
796
+ path?: number[];
797
+ amount: UintType;
798
+ script_hash?: string;
799
+ key_hash?: string;
800
+ };
801
+
802
+ // CardanoCatalystRegistrationParametersType
803
+ export type CardanoCatalystRegistrationParametersType = {
804
+ voting_public_key: string;
805
+ staking_path: number[];
806
+ reward_address_parameters: CardanoAddressParametersType;
807
+ nonce: UintType;
808
+ };
809
+
810
+ // CardanoTxAuxiliaryData
811
+ export type CardanoTxAuxiliaryData = {
812
+ catalyst_registration_parameters?: CardanoCatalystRegistrationParametersType;
813
+ hash?: string;
814
+ };
815
+
816
+ // CardanoTxMint
817
+ export type CardanoTxMint = {
818
+ asset_groups_count: number;
819
+ };
820
+
821
+ // CardanoTxCollateralInput
822
+ export type CardanoTxCollateralInput = {
823
+ prev_hash: string;
824
+ prev_index: number;
825
+ };
826
+
827
+ // CardanoTxRequiredSigner
828
+ export type CardanoTxRequiredSigner = {
829
+ key_hash?: string;
830
+ key_path?: number[];
831
+ };
832
+
833
+ // CardanoTxItemAck
834
+ export type CardanoTxItemAck = Empty;
835
+
836
+ // CardanoTxAuxiliaryDataSupplement
837
+ export type CardanoTxAuxiliaryDataSupplement = {
838
+ type: CardanoTxAuxiliaryDataSupplementType;
839
+ auxiliary_data_hash?: string;
840
+ catalyst_signature?: string;
841
+ };
842
+
843
+ // CardanoTxWitnessRequest
844
+ export type CardanoTxWitnessRequest = {
845
+ path: number[];
846
+ };
847
+
848
+ // CardanoTxWitnessResponse
849
+ export type CardanoTxWitnessResponse = {
850
+ type: CardanoTxWitnessType;
851
+ pub_key: string;
852
+ signature: string;
853
+ chain_code?: string;
854
+ };
855
+
856
+ // CardanoTxHostAck
857
+ export type CardanoTxHostAck = Empty;
858
+
859
+ // CardanoTxBodyHash
860
+ export type CardanoTxBodyHash = {
861
+ tx_hash: string;
862
+ };
863
+
864
+ // CardanoSignTxFinished
865
+ export type CardanoSignTxFinished = Empty;
866
+
867
+ export type CardanoTxInputType = {
868
+ address_n?: number[];
869
+ prev_hash: string;
870
+ prev_index: number;
871
+ };
872
+
873
+ export type CardanoTokenType = {
874
+ asset_name_bytes: string;
875
+ amount: UintType;
876
+ };
877
+
878
+ export type CardanoAssetGroupType = {
879
+ policy_id: string;
880
+ tokens: CardanoTokenType[];
881
+ };
882
+
883
+ export type CardanoTxOutputType = {
884
+ address?: string;
885
+ amount: UintType;
886
+ address_parameters?: CardanoAddressParametersType;
887
+ token_bundle: CardanoAssetGroupType[];
888
+ };
889
+
890
+ export type CardanoPoolOwnerType = {
891
+ staking_key_path?: number[];
892
+ staking_key_hash?: string;
893
+ };
894
+
895
+ export type CardanoPoolRelayParametersType = {
896
+ type: CardanoPoolRelayType;
897
+ ipv4_address?: string;
898
+ ipv6_address?: string;
899
+ host_name?: string;
900
+ port?: number;
901
+ };
902
+
903
+ export type CardanoTxCertificateType = {
904
+ type: CardanoCertificateType;
905
+ path?: number[];
906
+ pool?: string;
907
+ pool_parameters?: CardanoPoolParametersType;
908
+ };
909
+
910
+ export type CardanoTxWithdrawalType = {
911
+ path: number[];
912
+ amount: UintType;
913
+ };
914
+
915
+ export type CardanoTxAuxiliaryDataType = {
916
+ blob?: string;
917
+ catalyst_registration_parameters?: CardanoCatalystRegistrationParametersType;
918
+ };
919
+
920
+ // CardanoSignTx
921
+ export type CardanoSignTx = {
922
+ inputs: CardanoTxInputType[];
923
+ outputs: CardanoTxOutputType[];
924
+ protocol_magic: number;
925
+ fee: UintType;
926
+ ttl?: UintType;
927
+ network_id: number;
928
+ certificates: CardanoTxCertificateType[];
929
+ withdrawals: CardanoTxWithdrawalType[];
930
+ validity_interval_start?: UintType;
931
+ auxiliary_data?: CardanoTxAuxiliaryDataType;
932
+ };
933
+
934
+ // CardanoSignedTxChunk
935
+ export type CardanoSignedTxChunk = {
936
+ signed_tx_chunk: string;
937
+ };
938
+
939
+ // CardanoSignedTxChunkAck
940
+ export type CardanoSignedTxChunkAck = Empty;
941
+
942
+ // CardanoSignedTx
943
+ export type CardanoSignedTx = {
944
+ tx_hash: string;
945
+ serialized_tx?: string;
946
+ };
947
+
948
+ // Success
949
+ export type Success = {
950
+ message: string;
951
+ };
952
+
953
+ export enum FailureType {
954
+ Failure_UnexpectedMessage = 1,
955
+ Failure_ButtonExpected = 2,
956
+ Failure_DataError = 3,
957
+ Failure_ActionCancelled = 4,
958
+ Failure_PinExpected = 5,
959
+ Failure_PinCancelled = 6,
960
+ Failure_PinInvalid = 7,
961
+ Failure_InvalidSignature = 8,
962
+ Failure_ProcessError = 9,
963
+ Failure_NotEnoughFunds = 10,
964
+ Failure_NotInitialized = 11,
965
+ Failure_PinMismatch = 12,
966
+ Failure_WipeCodeMismatch = 13,
967
+ Failure_InvalidSession = 14,
968
+ Failure_FirmwareError = 99,
969
+ }
970
+
971
+ // Failure
972
+ export type Failure = {
973
+ code?: FailureType | string;
974
+ message?: string;
975
+ };
976
+
977
+ export enum Enum_ButtonRequestType {
978
+ ButtonRequest_Other = 1,
979
+ ButtonRequest_FeeOverThreshold = 2,
980
+ ButtonRequest_ConfirmOutput = 3,
981
+ ButtonRequest_ResetDevice = 4,
982
+ ButtonRequest_ConfirmWord = 5,
983
+ ButtonRequest_WipeDevice = 6,
984
+ ButtonRequest_ProtectCall = 7,
985
+ ButtonRequest_SignTx = 8,
986
+ ButtonRequest_FirmwareCheck = 9,
987
+ ButtonRequest_Address = 10,
988
+ ButtonRequest_PublicKey = 11,
989
+ ButtonRequest_MnemonicWordCount = 12,
990
+ ButtonRequest_MnemonicInput = 13,
991
+ _Deprecated_ButtonRequest_PassphraseType = 14,
992
+ ButtonRequest_UnknownDerivationPath = 15,
993
+ ButtonRequest_RecoveryHomepage = 16,
994
+ ButtonRequest_Success = 17,
995
+ ButtonRequest_Warning = 18,
996
+ ButtonRequest_PassphraseEntry = 19,
997
+ ButtonRequest_PinEntry = 20,
998
+ }
999
+ export type ButtonRequestType = keyof typeof Enum_ButtonRequestType;
1000
+
1001
+ // ButtonRequest
1002
+ export type ButtonRequest = {
1003
+ code?: ButtonRequestType;
1004
+ pages?: number;
1005
+ };
1006
+
1007
+ // ButtonAck
1008
+ export type ButtonAck = Empty;
1009
+
1010
+ export enum Enum_PinMatrixRequestType {
1011
+ PinMatrixRequestType_Current = 1,
1012
+ PinMatrixRequestType_NewFirst = 2,
1013
+ PinMatrixRequestType_NewSecond = 3,
1014
+ PinMatrixRequestType_WipeCodeFirst = 4,
1015
+ PinMatrixRequestType_WipeCodeSecond = 5,
1016
+ }
1017
+ export type PinMatrixRequestType = keyof typeof Enum_PinMatrixRequestType;
1018
+
1019
+ // PinMatrixRequest
1020
+ export type PinMatrixRequest = {
1021
+ type?: PinMatrixRequestType;
1022
+ };
1023
+
1024
+ // PinMatrixAck
1025
+ export type PinMatrixAck = {
1026
+ pin: string;
1027
+ };
1028
+
1029
+ // PassphraseRequest
1030
+ export type PassphraseRequest = {
1031
+ _on_device?: boolean;
1032
+ };
1033
+
1034
+ // PassphraseAck
1035
+ export type PassphraseAck = {
1036
+ passphrase?: string;
1037
+ _state?: string;
1038
+ on_device?: boolean;
1039
+ };
1040
+
1041
+ // Deprecated_PassphraseStateRequest
1042
+ export type Deprecated_PassphraseStateRequest = {
1043
+ state?: string;
1044
+ };
1045
+
1046
+ // Deprecated_PassphraseStateAck
1047
+ export type Deprecated_PassphraseStateAck = Empty;
1048
+
1049
+ // CipherKeyValue
1050
+ export type CipherKeyValue = {
1051
+ address_n: number[];
1052
+ key: string;
1053
+ value: string;
1054
+ encrypt?: boolean;
1055
+ ask_on_encrypt?: boolean;
1056
+ ask_on_decrypt?: boolean;
1057
+ iv?: string;
1058
+ };
1059
+
1060
+ // CipheredKeyValue
1061
+ export type CipheredKeyValue = {
1062
+ value: string;
1063
+ };
1064
+
1065
+ // IdentityType
1066
+ export type IdentityType = {
1067
+ proto?: string;
1068
+ user?: string;
1069
+ host?: string;
1070
+ port?: string;
1071
+ path?: string;
1072
+ index?: number;
1073
+ };
1074
+
1075
+ // SignIdentity
1076
+ export type SignIdentity = {
1077
+ identity: IdentityType;
1078
+ challenge_hidden?: string;
1079
+ challenge_visual?: string;
1080
+ ecdsa_curve_name?: string;
1081
+ };
1082
+
1083
+ // SignedIdentity
1084
+ export type SignedIdentity = {
1085
+ address: string;
1086
+ public_key: string;
1087
+ signature: string;
1088
+ };
1089
+
1090
+ // GetECDHSessionKey
1091
+ export type GetECDHSessionKey = {
1092
+ identity: IdentityType;
1093
+ peer_public_key: string;
1094
+ ecdsa_curve_name?: string;
1095
+ };
1096
+
1097
+ // ECDHSessionKey
1098
+ export type ECDHSessionKey = {
1099
+ session_key: string;
1100
+ public_key?: string;
1101
+ };
1102
+
1103
+ export enum DebugButton {
1104
+ NO = 0,
1105
+ YES = 1,
1106
+ INFO = 2,
1107
+ }
1108
+
1109
+ // EosGetPublicKey
1110
+ export type EosGetPublicKey = {
1111
+ address_n: number[];
1112
+ show_display?: boolean;
1113
+ };
1114
+
1115
+ // EosPublicKey
1116
+ export type EosPublicKey = {
1117
+ wif_public_key: string;
1118
+ raw_public_key: string;
1119
+ };
1120
+
1121
+ export type EosTxHeader = {
1122
+ expiration: number;
1123
+ ref_block_num: number;
1124
+ ref_block_prefix: number;
1125
+ max_net_usage_words: number;
1126
+ max_cpu_usage_ms: number;
1127
+ delay_sec: number;
1128
+ };
1129
+
1130
+ // EosSignTx
1131
+ export type EosSignTx = {
1132
+ address_n: number[];
1133
+ chain_id: string;
1134
+ header: EosTxHeader;
1135
+ num_actions: number;
1136
+ };
1137
+
1138
+ // EosTxActionRequest
1139
+ export type EosTxActionRequest = {
1140
+ data_size?: number;
1141
+ };
1142
+
1143
+ export type EosAsset = {
1144
+ amount: UintType;
1145
+ symbol: string;
1146
+ };
1147
+
1148
+ export type EosPermissionLevel = {
1149
+ actor: string;
1150
+ permission: string;
1151
+ };
1152
+
1153
+ export type EosAuthorizationKey = {
1154
+ type?: number;
1155
+ key: string;
1156
+ address_n?: number[];
1157
+ weight: number;
1158
+ };
1159
+
1160
+ export type EosAuthorizationAccount = {
1161
+ account: EosPermissionLevel;
1162
+ weight: number;
1163
+ };
1164
+
1165
+ export type EosAuthorizationWait = {
1166
+ wait_sec: number;
1167
+ weight: number;
1168
+ };
1169
+
1170
+ export type EosAuthorization = {
1171
+ threshold: number;
1172
+ keys: EosAuthorizationKey[];
1173
+ accounts: EosAuthorizationAccount[];
1174
+ waits: EosAuthorizationWait[];
1175
+ };
1176
+
1177
+ export type EosActionCommon = {
1178
+ account: string;
1179
+ name: string;
1180
+ authorization: EosPermissionLevel[];
1181
+ };
1182
+
1183
+ export type EosActionTransfer = {
1184
+ sender: string;
1185
+ receiver: string;
1186
+ quantity: EosAsset;
1187
+ memo: string;
1188
+ };
1189
+
1190
+ export type EosActionDelegate = {
1191
+ sender: string;
1192
+ receiver: string;
1193
+ net_quantity: EosAsset;
1194
+ cpu_quantity: EosAsset;
1195
+ transfer: boolean;
1196
+ };
1197
+
1198
+ export type EosActionUndelegate = {
1199
+ sender: string;
1200
+ receiver: string;
1201
+ net_quantity: EosAsset;
1202
+ cpu_quantity: EosAsset;
1203
+ };
1204
+
1205
+ export type EosActionRefund = {
1206
+ owner: string;
1207
+ };
1208
+
1209
+ export type EosActionBuyRam = {
1210
+ payer: string;
1211
+ receiver: string;
1212
+ quantity: EosAsset;
1213
+ };
1214
+
1215
+ export type EosActionBuyRamBytes = {
1216
+ payer: string;
1217
+ receiver: string;
1218
+ bytes: number;
1219
+ };
1220
+
1221
+ export type EosActionSellRam = {
1222
+ account: string;
1223
+ bytes: number;
1224
+ };
1225
+
1226
+ export type EosActionVoteProducer = {
1227
+ voter: string;
1228
+ proxy: string;
1229
+ producers: string[];
1230
+ };
1231
+
1232
+ export type EosActionUpdateAuth = {
1233
+ account: string;
1234
+ permission: string;
1235
+ parent: string;
1236
+ auth: EosAuthorization;
1237
+ };
1238
+
1239
+ export type EosActionDeleteAuth = {
1240
+ account: string;
1241
+ permission: string;
1242
+ };
1243
+
1244
+ export type EosActionLinkAuth = {
1245
+ account: string;
1246
+ code: string;
1247
+ type: string;
1248
+ requirement: string;
1249
+ };
1250
+
1251
+ export type EosActionUnlinkAuth = {
1252
+ account: string;
1253
+ code: string;
1254
+ type: string;
1255
+ };
1256
+
1257
+ export type EosActionNewAccount = {
1258
+ creator: string;
1259
+ name: string;
1260
+ owner: EosAuthorization;
1261
+ active: EosAuthorization;
1262
+ };
1263
+
1264
+ export type EosActionUnknown = {
1265
+ data_size: number;
1266
+ data_chunk: string;
1267
+ };
1268
+
1269
+ // EosTxActionAck
1270
+ export type EosTxActionAck = {
1271
+ common: EosActionCommon;
1272
+ transfer?: EosActionTransfer;
1273
+ delegate?: EosActionDelegate;
1274
+ undelegate?: EosActionUndelegate;
1275
+ refund?: EosActionRefund;
1276
+ buy_ram?: EosActionBuyRam;
1277
+ buy_ram_bytes?: EosActionBuyRamBytes;
1278
+ sell_ram?: EosActionSellRam;
1279
+ vote_producer?: EosActionVoteProducer;
1280
+ update_auth?: EosActionUpdateAuth;
1281
+ delete_auth?: EosActionDeleteAuth;
1282
+ link_auth?: EosActionLinkAuth;
1283
+ unlink_auth?: EosActionUnlinkAuth;
1284
+ new_account?: EosActionNewAccount;
1285
+ unknown?: EosActionUnknown;
1286
+ };
1287
+
1288
+ // EosSignedTx
1289
+ export type EosSignedTx = {
1290
+ signature: string;
1291
+ };
1292
+
1293
+ // EthereumSignTypedData
1294
+ export type EthereumSignTypedData = {
1295
+ address_n: number[];
1296
+ primary_type: string;
1297
+ metamask_v4_compat?: boolean;
1298
+ };
1299
+
1300
+ // EthereumTypedDataStructRequest
1301
+ export type EthereumTypedDataStructRequest = {
1302
+ name: string;
1303
+ };
1304
+
1305
+ export enum EthereumDataType {
1306
+ UINT = 1,
1307
+ INT = 2,
1308
+ BYTES = 3,
1309
+ STRING = 4,
1310
+ BOOL = 5,
1311
+ ADDRESS = 6,
1312
+ ARRAY = 7,
1313
+ STRUCT = 8,
1314
+ }
1315
+
1316
+ export type EthereumFieldType = {
1317
+ data_type: EthereumDataType;
1318
+ size?: number;
1319
+ entry_type?: EthereumFieldType;
1320
+ struct_name?: string;
1321
+ };
1322
+
1323
+ export type EthereumStructMember = {
1324
+ type: EthereumFieldType;
1325
+ name: string;
1326
+ };
1327
+
1328
+ // EthereumTypedDataStructAck
1329
+ export type EthereumTypedDataStructAck = {
1330
+ members: EthereumStructMember[];
1331
+ };
1332
+
1333
+ // EthereumTypedDataValueRequest
1334
+ export type EthereumTypedDataValueRequest = {
1335
+ member_path: number[];
1336
+ };
1337
+
1338
+ // EthereumTypedDataValueAck
1339
+ export type EthereumTypedDataValueAck = {
1340
+ value: string;
1341
+ };
1342
+
1343
+ // EthereumGetPublicKey
1344
+ export type EthereumGetPublicKey = {
1345
+ address_n: number[];
1346
+ show_display?: boolean;
1347
+ };
1348
+
1349
+ // EthereumPublicKey
1350
+ export type EthereumPublicKey = {
1351
+ node: HDNodeType;
1352
+ xpub: string;
1353
+ };
1354
+
1355
+ // EthereumGetAddress
1356
+ export type EthereumGetAddress = {
1357
+ address_n: number[];
1358
+ show_display?: boolean;
1359
+ };
1360
+
1361
+ // EthereumAddress
1362
+ export type EthereumAddress = {
1363
+ _old_address?: string;
1364
+ address: string;
1365
+ };
1366
+
1367
+ // EthereumSignTx
1368
+ export type EthereumSignTx = {
1369
+ address_n: number[];
1370
+ nonce?: string;
1371
+ gas_price: string;
1372
+ gas_limit: string;
1373
+ to?: string;
1374
+ value?: string;
1375
+ data_initial_chunk?: string;
1376
+ data_length?: number;
1377
+ chain_id: number;
1378
+ tx_type?: number;
1379
+ };
1380
+
1381
+ export type EthereumAccessList = {
1382
+ address: string;
1383
+ storage_keys: string[];
1384
+ };
1385
+
1386
+ // EthereumSignTxEIP1559
1387
+ export type EthereumSignTxEIP1559 = {
1388
+ address_n: number[];
1389
+ nonce: string;
1390
+ max_gas_fee: string;
1391
+ max_priority_fee: string;
1392
+ gas_limit: string;
1393
+ to?: string;
1394
+ value: string;
1395
+ data_initial_chunk?: string;
1396
+ data_length: number;
1397
+ chain_id: number;
1398
+ access_list: EthereumAccessList[];
1399
+ };
1400
+
1401
+ // EthereumTxRequest
1402
+ export type EthereumTxRequest = {
1403
+ data_length?: number;
1404
+ signature_v?: number;
1405
+ signature_r?: string;
1406
+ signature_s?: string;
1407
+ };
1408
+
1409
+ // EthereumTxAck
1410
+ export type EthereumTxAck = {
1411
+ data_chunk: string;
1412
+ };
1413
+
1414
+ // EthereumSignMessage
1415
+ export type EthereumSignMessage = {
1416
+ address_n: number[];
1417
+ message: string;
1418
+ };
1419
+
1420
+ // EthereumSignMessageEIP712
1421
+ export type EthereumSignMessageEIP712 = {
1422
+ address_n: number[];
1423
+ domain_hash: string;
1424
+ message_hash: string;
1425
+ };
1426
+
1427
+ // EthereumMessageSignature
1428
+ export type EthereumMessageSignature = {
1429
+ signature: string;
1430
+ address: string;
1431
+ };
1432
+
1433
+ // EthereumVerifyMessage
1434
+ export type EthereumVerifyMessage = {
1435
+ signature: string;
1436
+ message: string;
1437
+ address: string;
1438
+ };
1439
+
1440
+ // EthereumSignTypedHash
1441
+ export type EthereumSignTypedHash = {
1442
+ address_n: number[];
1443
+ domain_separator_hash: string;
1444
+ message_hash?: string;
1445
+ };
1446
+
1447
+ // EthereumTypedDataSignature
1448
+ export type EthereumTypedDataSignature = {
1449
+ signature: string;
1450
+ address: string;
1451
+ };
1452
+
1453
+ export enum Enum_BackupType {
1454
+ Bip39 = 0,
1455
+ Slip39_Basic = 1,
1456
+ Slip39_Advanced = 2,
1457
+ }
1458
+ export type BackupType = keyof typeof Enum_BackupType;
1459
+
1460
+ export enum Enum_SafetyCheckLevel {
1461
+ Strict = 0,
1462
+ PromptAlways = 1,
1463
+ PromptTemporarily = 2,
1464
+ }
1465
+ export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
1466
+
1467
+ // Initialize
1468
+ export type Initialize = {
1469
+ session_id?: string;
1470
+ _skip_passphrase?: boolean;
1471
+ derive_cardano?: boolean;
1472
+ };
1473
+
1474
+ // GetFeatures
1475
+ export type GetFeatures = Empty;
1476
+
1477
+ export enum Enum_Capability {
1478
+ Capability_Bitcoin = 1,
1479
+ Capability_Bitcoin_like = 2,
1480
+ Capability_Binance = 3,
1481
+ Capability_Cardano = 4,
1482
+ Capability_Crypto = 5,
1483
+ Capability_EOS = 6,
1484
+ Capability_Ethereum = 7,
1485
+ Capability_Lisk = 8,
1486
+ Capability_Monero = 9,
1487
+ Capability_NEM = 10,
1488
+ Capability_Ripple = 11,
1489
+ Capability_Stellar = 12,
1490
+ Capability_Tezos = 13,
1491
+ Capability_U2F = 14,
1492
+ Capability_Shamir = 15,
1493
+ Capability_ShamirGroups = 16,
1494
+ Capability_PassphraseEntry = 17,
1495
+ }
1496
+ export type Capability = keyof typeof Enum_Capability;
1497
+
1498
+ // Features
1499
+ export type Features = {
1500
+ vendor: string;
1501
+ onekey_serial: string;
1502
+ se_ver: string;
1503
+ serial_no: string;
1504
+ onekey_version: string;
1505
+ ble_ver: string;
1506
+ ble_enable: boolean;
1507
+ major_version: number;
1508
+ minor_version: number;
1509
+ patch_version: number;
1510
+ bootloader_mode: boolean | null;
1511
+ device_id: string | null;
1512
+ pin_protection: boolean | null;
1513
+ passphrase_protection: boolean | null;
1514
+ language: string | null;
1515
+ label: string | null;
1516
+ initialized: boolean | null;
1517
+ revision: string | null;
1518
+ bootloader_hash: string | null;
1519
+ imported: boolean | null;
1520
+ unlocked: boolean | null;
1521
+ _passphrase_cached?: boolean;
1522
+ firmware_present: boolean | null;
1523
+ needs_backup: boolean | null;
1524
+ flags: number | null;
1525
+ model: string;
1526
+ fw_major: number | null;
1527
+ fw_minor: number | null;
1528
+ fw_patch: number | null;
1529
+ fw_vendor: string | null;
1530
+ unfinished_backup: boolean | null;
1531
+ no_backup: boolean | null;
1532
+ recovery_mode: boolean | null;
1533
+ capabilities: Capability[];
1534
+ backup_type: BackupType | null;
1535
+ sd_card_present: boolean | null;
1536
+ sd_protection: boolean | null;
1537
+ wipe_code_protection: boolean | null;
1538
+ session_id: string | null;
1539
+ passphrase_always_on_device: boolean | null;
1540
+ safety_checks: SafetyCheckLevel | null;
1541
+ auto_lock_delay_ms: number | null;
1542
+ display_rotation: number | null;
1543
+ experimental_features: boolean | null;
1544
+ };
1545
+
1546
+ // LockDevice
1547
+ export type LockDevice = Empty;
1548
+
1549
+ // EndSession
1550
+ export type EndSession = Empty;
1551
+
1552
+ // ApplySettings
1553
+ export type ApplySettings = {
1554
+ language?: string;
1555
+ label?: string;
1556
+ use_passphrase?: boolean;
1557
+ homescreen?: string;
1558
+ _passphrase_source?: number;
1559
+ auto_lock_delay_ms?: number;
1560
+ display_rotation?: number;
1561
+ passphrase_always_on_device?: boolean;
1562
+ safety_checks?: SafetyCheckLevel;
1563
+ experimental_features?: boolean;
1564
+ };
1565
+
1566
+ // ApplyFlags
1567
+ export type ApplyFlags = {
1568
+ flags: number;
1569
+ };
1570
+
1571
+ // ChangePin
1572
+ export type ChangePin = {
1573
+ remove?: boolean;
1574
+ };
1575
+
1576
+ // ChangeWipeCode
1577
+ export type ChangeWipeCode = {
1578
+ remove?: boolean;
1579
+ };
1580
+
1581
+ export enum SdProtectOperationType {
1582
+ DISABLE = 0,
1583
+ ENABLE = 1,
1584
+ REFRESH = 2,
1585
+ }
1586
+
1587
+ // SdProtect
1588
+ export type SdProtect = {
1589
+ operation: SdProtectOperationType;
1590
+ };
1591
+
1592
+ // Ping
1593
+ export type Ping = {
1594
+ message?: string;
1595
+ button_protection?: boolean;
1596
+ };
1597
+
1598
+ // Cancel
1599
+ export type Cancel = Empty;
1600
+
1601
+ // GetEntropy
1602
+ export type GetEntropy = {
1603
+ size: number;
1604
+ };
1605
+
1606
+ // Entropy
1607
+ export type Entropy = {
1608
+ entropy: string;
1609
+ };
1610
+
1611
+ // GetFirmwareHash
1612
+ export type GetFirmwareHash = {
1613
+ challenge?: string;
1614
+ };
1615
+
1616
+ // FirmwareHash
1617
+ export type FirmwareHash = {
1618
+ hash: string;
1619
+ };
1620
+
1621
+ // GetFirmware
1622
+ export type GetFirmware = Empty;
1623
+
1624
+ // FirmwareChunk
1625
+ export type FirmwareChunk = {
1626
+ chunk: string;
1627
+ };
1628
+
1629
+ // FirmwareChunkAck
1630
+ export type FirmwareChunkAck = Empty;
1631
+
1632
+ // WipeDevice
1633
+ export type WipeDevice = Empty;
1634
+
1635
+ // ResetDevice
1636
+ export type ResetDevice = {
1637
+ display_random?: boolean;
1638
+ strength?: number;
1639
+ passphrase_protection?: boolean;
1640
+ pin_protection?: boolean;
1641
+ language?: string;
1642
+ label?: string;
1643
+ u2f_counter?: number;
1644
+ skip_backup?: boolean;
1645
+ no_backup?: boolean;
1646
+ backup_type?: string | number;
1647
+ };
1648
+
1649
+ // BackupDevice
1650
+ export type BackupDevice = Empty;
1651
+
1652
+ // EntropyRequest
1653
+ export type EntropyRequest = Empty;
1654
+
1655
+ // EntropyAck
1656
+ export type EntropyAck = {
1657
+ entropy: string;
1658
+ };
1659
+
1660
+ export enum RecoveryDeviceType {
1661
+ RecoveryDeviceType_ScrambledWords = 0,
1662
+ RecoveryDeviceType_Matrix = 1,
1663
+ }
1664
+
1665
+ // RecoveryDevice
1666
+ export type RecoveryDevice = {
1667
+ word_count?: number;
1668
+ passphrase_protection?: boolean;
1669
+ pin_protection?: boolean;
1670
+ language?: string;
1671
+ label?: string;
1672
+ enforce_wordlist?: boolean;
1673
+ type?: RecoveryDeviceType;
1674
+ u2f_counter?: number;
1675
+ dry_run?: boolean;
1676
+ };
1677
+
1678
+ export enum Enum_WordRequestType {
1679
+ WordRequestType_Plain = 0,
1680
+ WordRequestType_Matrix9 = 1,
1681
+ WordRequestType_Matrix6 = 2,
1682
+ }
1683
+ export type WordRequestType = keyof typeof Enum_WordRequestType;
1684
+
1685
+ // WordRequest
1686
+ export type WordRequest = {
1687
+ type: WordRequestType;
1688
+ };
1689
+
1690
+ // WordAck
1691
+ export type WordAck = {
1692
+ word: string;
1693
+ };
1694
+
1695
+ // SetU2FCounter
1696
+ export type SetU2FCounter = {
1697
+ u2f_counter: number;
1698
+ };
1699
+
1700
+ // GetNextU2FCounter
1701
+ export type GetNextU2FCounter = Empty;
1702
+
1703
+ // NextU2FCounter
1704
+ export type NextU2FCounter = {
1705
+ u2f_counter: number;
1706
+ };
1707
+
1708
+ // DoPreauthorized
1709
+ export type DoPreauthorized = Empty;
1710
+
1711
+ // PreauthorizedRequest
1712
+ export type PreauthorizedRequest = Empty;
1713
+
1714
+ // CancelAuthorization
1715
+ export type CancelAuthorization = Empty;
1716
+
1717
+ // BixinReboot
1718
+ export type BixinReboot = Empty;
1719
+
1720
+ // RebootToBootloader
1721
+ export type RebootToBootloader = Empty;
1722
+
1723
+ // GetNonce
1724
+ export type GetNonce = Empty;
1725
+
1726
+ // Nonce
1727
+ export type Nonce = {
1728
+ nonce: string;
1729
+ };
1730
+
1731
+ // NEMGetAddress
1732
+ export type NEMGetAddress = {
1733
+ address_n: number[];
1734
+ network?: number;
1735
+ show_display?: boolean;
1736
+ };
1737
+
1738
+ // NEMAddress
1739
+ export type NEMAddress = {
1740
+ address: string;
1741
+ };
1742
+
1743
+ export type NEMTransactionCommon = {
1744
+ address_n?: number[];
1745
+ network?: number;
1746
+ timestamp: number;
1747
+ fee: UintType;
1748
+ deadline: number;
1749
+ signer?: string;
1750
+ };
1751
+
1752
+ export type NEMMosaic = {
1753
+ namespace: string;
1754
+ mosaic: string;
1755
+ quantity: number;
1756
+ };
1757
+
1758
+ export type NEMTransfer = {
1759
+ recipient: string;
1760
+ amount: UintType;
1761
+ payload?: string;
1762
+ public_key?: string;
1763
+ mosaics?: NEMMosaic[];
1764
+ };
1765
+
1766
+ export type NEMProvisionNamespace = {
1767
+ namespace: string;
1768
+ parent?: string;
1769
+ sink: string;
1770
+ fee: UintType;
1771
+ };
1772
+
1773
+ export enum NEMMosaicLevy {
1774
+ MosaicLevy_Absolute = 1,
1775
+ MosaicLevy_Percentile = 2,
1776
+ }
1777
+
1778
+ export type NEMMosaicDefinition = {
1779
+ name?: string;
1780
+ ticker?: string;
1781
+ namespace: string;
1782
+ mosaic: string;
1783
+ divisibility?: number;
1784
+ levy?: NEMMosaicLevy;
1785
+ fee?: UintType;
1786
+ levy_address?: string;
1787
+ levy_namespace?: string;
1788
+ levy_mosaic?: string;
1789
+ supply?: number;
1790
+ mutable_supply?: boolean;
1791
+ transferable?: boolean;
1792
+ description: string;
1793
+ networks?: number[];
1794
+ };
1795
+
1796
+ export type NEMMosaicCreation = {
1797
+ definition: NEMMosaicDefinition;
1798
+ sink: string;
1799
+ fee: UintType;
1800
+ };
1801
+
1802
+ export enum NEMSupplyChangeType {
1803
+ SupplyChange_Increase = 1,
1804
+ SupplyChange_Decrease = 2,
1805
+ }
1806
+
1807
+ export type NEMMosaicSupplyChange = {
1808
+ namespace: string;
1809
+ mosaic: string;
1810
+ type: NEMSupplyChangeType;
1811
+ delta: number;
1812
+ };
1813
+
1814
+ export enum NEMModificationType {
1815
+ CosignatoryModification_Add = 1,
1816
+ CosignatoryModification_Delete = 2,
1817
+ }
1818
+
1819
+ export type NEMCosignatoryModification = {
1820
+ type: NEMModificationType;
1821
+ public_key: string;
1822
+ };
1823
+
1824
+ export type NEMAggregateModification = {
1825
+ modifications?: NEMCosignatoryModification[];
1826
+ relative_change?: number;
1827
+ };
1828
+
1829
+ export enum NEMImportanceTransferMode {
1830
+ ImportanceTransfer_Activate = 1,
1831
+ ImportanceTransfer_Deactivate = 2,
1832
+ }
1833
+
1834
+ export type NEMImportanceTransfer = {
1835
+ mode: NEMImportanceTransferMode;
1836
+ public_key: string;
1837
+ };
1838
+
1839
+ // NEMSignTx
1840
+ export type NEMSignTx = {
1841
+ transaction: NEMTransactionCommon;
1842
+ multisig?: NEMTransactionCommon;
1843
+ transfer?: NEMTransfer;
1844
+ cosigning?: boolean;
1845
+ provision_namespace?: NEMProvisionNamespace;
1846
+ mosaic_creation?: NEMMosaicCreation;
1847
+ supply_change?: NEMMosaicSupplyChange;
1848
+ aggregate_modification?: NEMAggregateModification;
1849
+ importance_transfer?: NEMImportanceTransfer;
1850
+ };
1851
+
1852
+ // NEMSignedTx
1853
+ export type NEMSignedTx = {
1854
+ data: string;
1855
+ signature: string;
1856
+ };
1857
+
1858
+ // NEMDecryptMessage
1859
+ export type NEMDecryptMessage = {
1860
+ address_n: number[];
1861
+ network?: number;
1862
+ public_key?: string;
1863
+ payload?: string;
1864
+ };
1865
+
1866
+ // NEMDecryptedMessage
1867
+ export type NEMDecryptedMessage = {
1868
+ payload: string;
1869
+ };
1870
+
1871
+ // RippleGetAddress
1872
+ export type RippleGetAddress = {
1873
+ address_n: number[];
1874
+ show_display?: boolean;
1875
+ };
1876
+
1877
+ // RippleAddress
1878
+ export type RippleAddress = {
1879
+ address: string;
1880
+ };
1881
+
1882
+ export type RipplePayment = {
1883
+ amount: UintType;
1884
+ destination: string;
1885
+ destination_tag?: number;
1886
+ };
1887
+
1888
+ // RippleSignTx
1889
+ export type RippleSignTx = {
1890
+ address_n: number[];
1891
+ fee: UintType;
1892
+ flags?: number;
1893
+ sequence: number;
1894
+ last_ledger_sequence?: number;
1895
+ payment: RipplePayment;
1896
+ };
1897
+
1898
+ // RippleSignedTx
1899
+ export type RippleSignedTx = {
1900
+ signature: string;
1901
+ serialized_tx: string;
1902
+ };
1903
+
1904
+ export enum StellarAssetType {
1905
+ NATIVE = 0,
1906
+ ALPHANUM4 = 1,
1907
+ ALPHANUM12 = 2,
1908
+ }
1909
+
1910
+ // StellarAsset
1911
+ export type StellarAsset = {
1912
+ type: StellarAssetType;
1913
+ code?: string;
1914
+ issuer?: string;
1915
+ };
1916
+
1917
+ // StellarGetAddress
1918
+ export type StellarGetAddress = {
1919
+ address_n: number[];
1920
+ show_display?: boolean;
1921
+ };
1922
+
1923
+ // StellarAddress
1924
+ export type StellarAddress = {
1925
+ address: string;
1926
+ };
1927
+
1928
+ export enum StellarMemoType {
1929
+ NONE = 0,
1930
+ TEXT = 1,
1931
+ ID = 2,
1932
+ HASH = 3,
1933
+ RETURN = 4,
1934
+ }
1935
+
1936
+ // StellarSignTx
1937
+ export type StellarSignTx = {
1938
+ address_n: number[];
1939
+ network_passphrase: string;
1940
+ source_account: string;
1941
+ fee: UintType;
1942
+ sequence_number: UintType;
1943
+ timebounds_start: number;
1944
+ timebounds_end: number;
1945
+ memo_type: StellarMemoType;
1946
+ memo_text?: string;
1947
+ memo_id?: string;
1948
+ memo_hash?: Buffer | string;
1949
+ num_operations: number;
1950
+ };
1951
+
1952
+ // StellarTxOpRequest
1953
+ export type StellarTxOpRequest = Empty;
1954
+
1955
+ // StellarPaymentOp
1956
+ export type StellarPaymentOp = {
1957
+ source_account?: string;
1958
+ destination_account: string;
1959
+ asset: StellarAsset;
1960
+ amount: UintType;
1961
+ };
1962
+
1963
+ // StellarCreateAccountOp
1964
+ export type StellarCreateAccountOp = {
1965
+ source_account?: string;
1966
+ new_account: string;
1967
+ starting_balance: UintType;
1968
+ };
1969
+
1970
+ // StellarPathPaymentStrictReceiveOp
1971
+ export type StellarPathPaymentStrictReceiveOp = {
1972
+ source_account?: string;
1973
+ send_asset: StellarAsset;
1974
+ send_max: UintType;
1975
+ destination_account: string;
1976
+ destination_asset: StellarAsset;
1977
+ destination_amount: UintType;
1978
+ paths?: StellarAsset[];
1979
+ };
1980
+
1981
+ // StellarPathPaymentStrictSendOp
1982
+ export type StellarPathPaymentStrictSendOp = {
1983
+ source_account?: string;
1984
+ send_asset: StellarAsset;
1985
+ send_amount: UintType;
1986
+ destination_account: string;
1987
+ destination_asset: StellarAsset;
1988
+ destination_min: UintType;
1989
+ paths?: StellarAsset[];
1990
+ };
1991
+
1992
+ // StellarManageSellOfferOp
1993
+ export type StellarManageSellOfferOp = {
1994
+ source_account?: string;
1995
+ selling_asset: StellarAsset;
1996
+ buying_asset: StellarAsset;
1997
+ amount: UintType;
1998
+ price_n: number;
1999
+ price_d: number;
2000
+ offer_id: UintType;
2001
+ };
2002
+
2003
+ // StellarManageBuyOfferOp
2004
+ export type StellarManageBuyOfferOp = {
2005
+ source_account?: string;
2006
+ selling_asset: StellarAsset;
2007
+ buying_asset: StellarAsset;
2008
+ amount: UintType;
2009
+ price_n: number;
2010
+ price_d: number;
2011
+ offer_id: UintType;
2012
+ };
2013
+
2014
+ // StellarCreatePassiveSellOfferOp
2015
+ export type StellarCreatePassiveSellOfferOp = {
2016
+ source_account?: string;
2017
+ selling_asset: StellarAsset;
2018
+ buying_asset: StellarAsset;
2019
+ amount: UintType;
2020
+ price_n: number;
2021
+ price_d: number;
2022
+ };
2023
+
2024
+ export enum StellarSignerType {
2025
+ ACCOUNT = 0,
2026
+ PRE_AUTH = 1,
2027
+ HASH = 2,
2028
+ }
2029
+
2030
+ // StellarSetOptionsOp
2031
+ export type StellarSetOptionsOp = {
2032
+ source_account?: string;
2033
+ inflation_destination_account?: string;
2034
+ clear_flags?: number;
2035
+ set_flags?: number;
2036
+ master_weight?: UintType;
2037
+ low_threshold?: UintType;
2038
+ medium_threshold?: UintType;
2039
+ high_threshold?: UintType;
2040
+ home_domain?: string;
2041
+ signer_type?: StellarSignerType;
2042
+ signer_key?: Buffer | string;
2043
+ signer_weight?: number;
2044
+ };
2045
+
2046
+ // StellarChangeTrustOp
2047
+ export type StellarChangeTrustOp = {
2048
+ source_account?: string;
2049
+ asset: StellarAsset;
2050
+ limit: UintType;
2051
+ };
2052
+
2053
+ // StellarAllowTrustOp
2054
+ export type StellarAllowTrustOp = {
2055
+ source_account?: string;
2056
+ trusted_account: string;
2057
+ asset_type: StellarAssetType;
2058
+ asset_code?: string;
2059
+ is_authorized: boolean;
2060
+ };
2061
+
2062
+ // StellarAccountMergeOp
2063
+ export type StellarAccountMergeOp = {
2064
+ source_account?: string;
2065
+ destination_account: string;
2066
+ };
2067
+
2068
+ // StellarManageDataOp
2069
+ export type StellarManageDataOp = {
2070
+ source_account?: string;
2071
+ key: string;
2072
+ value?: Buffer | string;
2073
+ };
2074
+
2075
+ // StellarBumpSequenceOp
2076
+ export type StellarBumpSequenceOp = {
2077
+ source_account?: string;
2078
+ bump_to: UintType;
2079
+ };
2080
+
2081
+ // StellarSignedTx
2082
+ export type StellarSignedTx = {
2083
+ public_key: string;
2084
+ signature: string;
2085
+ };
2086
+
2087
+ // TezosGetAddress
2088
+ export type TezosGetAddress = {
2089
+ address_n: number[];
2090
+ show_display?: boolean;
2091
+ };
2092
+
2093
+ // TezosAddress
2094
+ export type TezosAddress = {
2095
+ address: string;
2096
+ };
2097
+
2098
+ // TezosGetPublicKey
2099
+ export type TezosGetPublicKey = {
2100
+ address_n: number[];
2101
+ show_display?: boolean;
2102
+ };
2103
+
2104
+ // TezosPublicKey
2105
+ export type TezosPublicKey = {
2106
+ public_key: string;
2107
+ };
2108
+
2109
+ export enum TezosContractType {
2110
+ Implicit = 0,
2111
+ Originated = 1,
2112
+ }
2113
+
2114
+ export type TezosContractID = {
2115
+ tag: number;
2116
+ hash: Uint8Array;
2117
+ };
2118
+
2119
+ export type TezosRevealOp = {
2120
+ source: Uint8Array;
2121
+ fee: UintType;
2122
+ counter: number;
2123
+ gas_limit: number;
2124
+ storage_limit: number;
2125
+ public_key: Uint8Array;
2126
+ };
2127
+
2128
+ export type TezosManagerTransfer = {
2129
+ destination: TezosContractID;
2130
+ amount: UintType;
2131
+ };
2132
+
2133
+ export type TezosParametersManager = {
2134
+ set_delegate?: Uint8Array;
2135
+ cancel_delegate?: boolean;
2136
+ transfer?: TezosManagerTransfer;
2137
+ };
2138
+
2139
+ export type TezosTransactionOp = {
2140
+ source: Uint8Array;
2141
+ fee: UintType;
2142
+ counter: number;
2143
+ gas_limit: number;
2144
+ storage_limit: number;
2145
+ amount: UintType;
2146
+ destination: TezosContractID;
2147
+ parameters?: number[];
2148
+ parameters_manager?: TezosParametersManager;
2149
+ };
2150
+
2151
+ export type TezosOriginationOp = {
2152
+ source: Uint8Array;
2153
+ fee: UintType;
2154
+ counter: number;
2155
+ gas_limit: number;
2156
+ storage_limit: number;
2157
+ manager_pubkey?: string;
2158
+ balance: number;
2159
+ spendable?: boolean;
2160
+ delegatable?: boolean;
2161
+ delegate?: Uint8Array;
2162
+ script: string | number[];
2163
+ };
2164
+
2165
+ export type TezosDelegationOp = {
2166
+ source: Uint8Array;
2167
+ fee: UintType;
2168
+ counter: number;
2169
+ gas_limit: number;
2170
+ storage_limit: number;
2171
+ delegate: Uint8Array;
2172
+ };
2173
+
2174
+ export type TezosProposalOp = {
2175
+ source: string;
2176
+ period: number;
2177
+ proposals: string[];
2178
+ };
2179
+
2180
+ export enum TezosBallotType {
2181
+ Yay = 0,
2182
+ Nay = 1,
2183
+ Pass = 2,
2184
+ }
2185
+
2186
+ export type TezosBallotOp = {
2187
+ source: string;
2188
+ period: number;
2189
+ proposal: string;
2190
+ ballot: TezosBallotType;
2191
+ };
2192
+
2193
+ // TezosSignTx
2194
+ export type TezosSignTx = {
2195
+ address_n: number[];
2196
+ branch: Uint8Array;
2197
+ reveal?: TezosRevealOp;
2198
+ transaction?: TezosTransactionOp;
2199
+ origination?: TezosOriginationOp;
2200
+ delegation?: TezosDelegationOp;
2201
+ proposal?: TezosProposalOp;
2202
+ ballot?: TezosBallotOp;
2203
+ };
2204
+
2205
+ // TezosSignedTx
2206
+ export type TezosSignedTx = {
2207
+ signature: string;
2208
+ sig_op_contents: string;
2209
+ operation_hash: string;
2210
+ };
2211
+
2212
+ // custom connect definitions
2213
+ export type MessageType = {
2214
+ BinanceGetAddress: BinanceGetAddress;
2215
+ BinanceAddress: BinanceAddress;
2216
+ BinanceGetPublicKey: BinanceGetPublicKey;
2217
+ BinancePublicKey: BinancePublicKey;
2218
+ BinanceSignTx: BinanceSignTx;
2219
+ BinanceTxRequest: BinanceTxRequest;
2220
+ BinanceCoin: BinanceCoin;
2221
+ BinanceInputOutput: BinanceInputOutput;
2222
+ BinanceTransferMsg: BinanceTransferMsg;
2223
+ BinanceOrderMsg: BinanceOrderMsg;
2224
+ BinanceCancelMsg: BinanceCancelMsg;
2225
+ BinanceSignedTx: BinanceSignedTx;
2226
+ HDNodeType: HDNodeType;
2227
+ HDNodePathType: HDNodePathType;
2228
+ MultisigRedeemScriptType: MultisigRedeemScriptType;
2229
+ GetPublicKey: GetPublicKey;
2230
+ PublicKey: PublicKey;
2231
+ GetAddress: GetAddress;
2232
+ Address: Address;
2233
+ GetOwnershipId: GetOwnershipId;
2234
+ OwnershipId: OwnershipId;
2235
+ SignMessage: SignMessage;
2236
+ MessageSignature: MessageSignature;
2237
+ VerifyMessage: VerifyMessage;
2238
+ SignTx: SignTx;
2239
+ TxRequestDetailsType: TxRequestDetailsType;
2240
+ TxRequestSerializedType: TxRequestSerializedType;
2241
+ TxRequest: TxRequest;
2242
+ TxInputType: TxInputType;
2243
+ TxOutputBinType: TxOutputBinType;
2244
+ TxOutputType: TxOutputType;
2245
+ PrevTx: PrevTx;
2246
+ PrevInput: PrevInput;
2247
+ PrevOutput: PrevOutput;
2248
+ TextMemo: TextMemo;
2249
+ RefundMemo: RefundMemo;
2250
+ CoinPurchaseMemo: CoinPurchaseMemo;
2251
+ PaymentRequestMemo: PaymentRequestMemo;
2252
+ TxAckPaymentRequest: TxAckPaymentRequest;
2253
+ TxAck: TxAck;
2254
+ TxAckInputWrapper: TxAckInputWrapper;
2255
+ TxAckInput: TxAckInput;
2256
+ TxAckOutputWrapper: TxAckOutputWrapper;
2257
+ TxAckOutput: TxAckOutput;
2258
+ TxAckPrevMeta: TxAckPrevMeta;
2259
+ TxAckPrevInputWrapper: TxAckPrevInputWrapper;
2260
+ TxAckPrevInput: TxAckPrevInput;
2261
+ TxAckPrevOutputWrapper: TxAckPrevOutputWrapper;
2262
+ TxAckPrevOutput: TxAckPrevOutput;
2263
+ TxAckPrevExtraDataWrapper: TxAckPrevExtraDataWrapper;
2264
+ TxAckPrevExtraData: TxAckPrevExtraData;
2265
+ GetOwnershipProof: GetOwnershipProof;
2266
+ OwnershipProof: OwnershipProof;
2267
+ AuthorizeCoinJoin: AuthorizeCoinJoin;
2268
+ FirmwareErase: FirmwareErase;
2269
+ FirmwareRequest: FirmwareRequest;
2270
+ FirmwareUpload: FirmwareUpload;
2271
+ SelfTest: SelfTest;
2272
+ CardanoBlockchainPointerType: CardanoBlockchainPointerType;
2273
+ CardanoNativeScript: CardanoNativeScript;
2274
+ CardanoGetNativeScriptHash: CardanoGetNativeScriptHash;
2275
+ CardanoNativeScriptHash: CardanoNativeScriptHash;
2276
+ CardanoAddressParametersType: CardanoAddressParametersType;
2277
+ CardanoGetAddress: CardanoGetAddress;
2278
+ CardanoAddress: CardanoAddress;
2279
+ CardanoGetPublicKey: CardanoGetPublicKey;
2280
+ CardanoPublicKey: CardanoPublicKey;
2281
+ CardanoSignTxInit: CardanoSignTxInit;
2282
+ CardanoTxInput: CardanoTxInput;
2283
+ CardanoTxOutput: CardanoTxOutput;
2284
+ CardanoAssetGroup: CardanoAssetGroup;
2285
+ CardanoToken: CardanoToken;
2286
+ CardanoPoolOwner: CardanoPoolOwner;
2287
+ CardanoPoolRelayParameters: CardanoPoolRelayParameters;
2288
+ CardanoPoolMetadataType: CardanoPoolMetadataType;
2289
+ CardanoPoolParametersType: CardanoPoolParametersType;
2290
+ CardanoTxCertificate: CardanoTxCertificate;
2291
+ CardanoTxWithdrawal: CardanoTxWithdrawal;
2292
+ CardanoCatalystRegistrationParametersType: CardanoCatalystRegistrationParametersType;
2293
+ CardanoTxAuxiliaryData: CardanoTxAuxiliaryData;
2294
+ CardanoTxMint: CardanoTxMint;
2295
+ CardanoTxCollateralInput: CardanoTxCollateralInput;
2296
+ CardanoTxRequiredSigner: CardanoTxRequiredSigner;
2297
+ CardanoTxItemAck: CardanoTxItemAck;
2298
+ CardanoTxAuxiliaryDataSupplement: CardanoTxAuxiliaryDataSupplement;
2299
+ CardanoTxWitnessRequest: CardanoTxWitnessRequest;
2300
+ CardanoTxWitnessResponse: CardanoTxWitnessResponse;
2301
+ CardanoTxHostAck: CardanoTxHostAck;
2302
+ CardanoTxBodyHash: CardanoTxBodyHash;
2303
+ CardanoSignTxFinished: CardanoSignTxFinished;
2304
+ CardanoTxInputType: CardanoTxInputType;
2305
+ CardanoTokenType: CardanoTokenType;
2306
+ CardanoAssetGroupType: CardanoAssetGroupType;
2307
+ CardanoTxOutputType: CardanoTxOutputType;
2308
+ CardanoPoolOwnerType: CardanoPoolOwnerType;
2309
+ CardanoPoolRelayParametersType: CardanoPoolRelayParametersType;
2310
+ CardanoTxCertificateType: CardanoTxCertificateType;
2311
+ CardanoTxWithdrawalType: CardanoTxWithdrawalType;
2312
+ CardanoTxAuxiliaryDataType: CardanoTxAuxiliaryDataType;
2313
+ CardanoSignTx: CardanoSignTx;
2314
+ CardanoSignedTxChunk: CardanoSignedTxChunk;
2315
+ CardanoSignedTxChunkAck: CardanoSignedTxChunkAck;
2316
+ CardanoSignedTx: CardanoSignedTx;
2317
+ Success: Success;
2318
+ Failure: Failure;
2319
+ ButtonRequest: ButtonRequest;
2320
+ ButtonAck: ButtonAck;
2321
+ PinMatrixRequest: PinMatrixRequest;
2322
+ PinMatrixAck: PinMatrixAck;
2323
+ PassphraseRequest: PassphraseRequest;
2324
+ PassphraseAck: PassphraseAck;
2325
+ Deprecated_PassphraseStateRequest: Deprecated_PassphraseStateRequest;
2326
+ Deprecated_PassphraseStateAck: Deprecated_PassphraseStateAck;
2327
+ CipherKeyValue: CipherKeyValue;
2328
+ CipheredKeyValue: CipheredKeyValue;
2329
+ IdentityType: IdentityType;
2330
+ SignIdentity: SignIdentity;
2331
+ SignedIdentity: SignedIdentity;
2332
+ GetECDHSessionKey: GetECDHSessionKey;
2333
+ ECDHSessionKey: ECDHSessionKey;
2334
+ EosGetPublicKey: EosGetPublicKey;
2335
+ EosPublicKey: EosPublicKey;
2336
+ EosTxHeader: EosTxHeader;
2337
+ EosSignTx: EosSignTx;
2338
+ EosTxActionRequest: EosTxActionRequest;
2339
+ EosAsset: EosAsset;
2340
+ EosPermissionLevel: EosPermissionLevel;
2341
+ EosAuthorizationKey: EosAuthorizationKey;
2342
+ EosAuthorizationAccount: EosAuthorizationAccount;
2343
+ EosAuthorizationWait: EosAuthorizationWait;
2344
+ EosAuthorization: EosAuthorization;
2345
+ EosActionCommon: EosActionCommon;
2346
+ EosActionTransfer: EosActionTransfer;
2347
+ EosActionDelegate: EosActionDelegate;
2348
+ EosActionUndelegate: EosActionUndelegate;
2349
+ EosActionRefund: EosActionRefund;
2350
+ EosActionBuyRam: EosActionBuyRam;
2351
+ EosActionBuyRamBytes: EosActionBuyRamBytes;
2352
+ EosActionSellRam: EosActionSellRam;
2353
+ EosActionVoteProducer: EosActionVoteProducer;
2354
+ EosActionUpdateAuth: EosActionUpdateAuth;
2355
+ EosActionDeleteAuth: EosActionDeleteAuth;
2356
+ EosActionLinkAuth: EosActionLinkAuth;
2357
+ EosActionUnlinkAuth: EosActionUnlinkAuth;
2358
+ EosActionNewAccount: EosActionNewAccount;
2359
+ EosActionUnknown: EosActionUnknown;
2360
+ EosTxActionAck: EosTxActionAck;
2361
+ EosSignedTx: EosSignedTx;
2362
+ EthereumSignTypedData: EthereumSignTypedData;
2363
+ EthereumTypedDataStructRequest: EthereumTypedDataStructRequest;
2364
+ EthereumFieldType: EthereumFieldType;
2365
+ EthereumStructMember: EthereumStructMember;
2366
+ EthereumTypedDataStructAck: EthereumTypedDataStructAck;
2367
+ EthereumTypedDataValueRequest: EthereumTypedDataValueRequest;
2368
+ EthereumTypedDataValueAck: EthereumTypedDataValueAck;
2369
+ EthereumGetPublicKey: EthereumGetPublicKey;
2370
+ EthereumPublicKey: EthereumPublicKey;
2371
+ EthereumGetAddress: EthereumGetAddress;
2372
+ EthereumAddress: EthereumAddress;
2373
+ EthereumSignTx: EthereumSignTx;
2374
+ EthereumAccessList: EthereumAccessList;
2375
+ EthereumSignTxEIP1559: EthereumSignTxEIP1559;
2376
+ EthereumTxRequest: EthereumTxRequest;
2377
+ EthereumTxAck: EthereumTxAck;
2378
+ EthereumSignMessage: EthereumSignMessage;
2379
+ EthereumSignMessageEIP712: EthereumSignMessageEIP712;
2380
+ EthereumMessageSignature: EthereumMessageSignature;
2381
+ EthereumVerifyMessage: EthereumVerifyMessage;
2382
+ EthereumSignTypedHash: EthereumSignTypedHash;
2383
+ EthereumTypedDataSignature: EthereumTypedDataSignature;
2384
+ Initialize: Initialize;
2385
+ GetFeatures: GetFeatures;
2386
+ Features: Features;
2387
+ LockDevice: LockDevice;
2388
+ EndSession: EndSession;
2389
+ ApplySettings: ApplySettings;
2390
+ ApplyFlags: ApplyFlags;
2391
+ ChangePin: ChangePin;
2392
+ ChangeWipeCode: ChangeWipeCode;
2393
+ SdProtect: SdProtect;
2394
+ Ping: Ping;
2395
+ Cancel: Cancel;
2396
+ GetEntropy: GetEntropy;
2397
+ Entropy: Entropy;
2398
+ GetFirmwareHash: GetFirmwareHash;
2399
+ FirmwareHash: FirmwareHash;
2400
+ GetFirmware: GetFirmware;
2401
+ FirmwareChunk: FirmwareChunk;
2402
+ FirmwareChunkAck: FirmwareChunkAck;
2403
+ WipeDevice: WipeDevice;
2404
+ ResetDevice: ResetDevice;
2405
+ BackupDevice: BackupDevice;
2406
+ EntropyRequest: EntropyRequest;
2407
+ EntropyAck: EntropyAck;
2408
+ RecoveryDevice: RecoveryDevice;
2409
+ WordRequest: WordRequest;
2410
+ WordAck: WordAck;
2411
+ SetU2FCounter: SetU2FCounter;
2412
+ GetNextU2FCounter: GetNextU2FCounter;
2413
+ NextU2FCounter: NextU2FCounter;
2414
+ DoPreauthorized: DoPreauthorized;
2415
+ PreauthorizedRequest: PreauthorizedRequest;
2416
+ CancelAuthorization: CancelAuthorization;
2417
+ BixinReboot: BixinReboot;
2418
+ RebootToBootloader: RebootToBootloader;
2419
+ GetNonce: GetNonce;
2420
+ Nonce: Nonce;
2421
+ NEMGetAddress: NEMGetAddress;
2422
+ NEMAddress: NEMAddress;
2423
+ NEMTransactionCommon: NEMTransactionCommon;
2424
+ NEMMosaic: NEMMosaic;
2425
+ NEMTransfer: NEMTransfer;
2426
+ NEMProvisionNamespace: NEMProvisionNamespace;
2427
+ NEMMosaicDefinition: NEMMosaicDefinition;
2428
+ NEMMosaicCreation: NEMMosaicCreation;
2429
+ NEMMosaicSupplyChange: NEMMosaicSupplyChange;
2430
+ NEMCosignatoryModification: NEMCosignatoryModification;
2431
+ NEMAggregateModification: NEMAggregateModification;
2432
+ NEMImportanceTransfer: NEMImportanceTransfer;
2433
+ NEMSignTx: NEMSignTx;
2434
+ NEMSignedTx: NEMSignedTx;
2435
+ NEMDecryptMessage: NEMDecryptMessage;
2436
+ NEMDecryptedMessage: NEMDecryptedMessage;
2437
+ RippleGetAddress: RippleGetAddress;
2438
+ RippleAddress: RippleAddress;
2439
+ RipplePayment: RipplePayment;
2440
+ RippleSignTx: RippleSignTx;
2441
+ RippleSignedTx: RippleSignedTx;
2442
+ StellarAsset: StellarAsset;
2443
+ StellarGetAddress: StellarGetAddress;
2444
+ StellarAddress: StellarAddress;
2445
+ StellarSignTx: StellarSignTx;
2446
+ StellarTxOpRequest: StellarTxOpRequest;
2447
+ StellarPaymentOp: StellarPaymentOp;
2448
+ StellarCreateAccountOp: StellarCreateAccountOp;
2449
+ StellarPathPaymentStrictReceiveOp: StellarPathPaymentStrictReceiveOp;
2450
+ StellarPathPaymentStrictSendOp: StellarPathPaymentStrictSendOp;
2451
+ StellarManageSellOfferOp: StellarManageSellOfferOp;
2452
+ StellarManageBuyOfferOp: StellarManageBuyOfferOp;
2453
+ StellarCreatePassiveSellOfferOp: StellarCreatePassiveSellOfferOp;
2454
+ StellarSetOptionsOp: StellarSetOptionsOp;
2455
+ StellarChangeTrustOp: StellarChangeTrustOp;
2456
+ StellarAllowTrustOp: StellarAllowTrustOp;
2457
+ StellarAccountMergeOp: StellarAccountMergeOp;
2458
+ StellarManageDataOp: StellarManageDataOp;
2459
+ StellarBumpSequenceOp: StellarBumpSequenceOp;
2460
+ StellarSignedTx: StellarSignedTx;
2461
+ TezosGetAddress: TezosGetAddress;
2462
+ TezosAddress: TezosAddress;
2463
+ TezosGetPublicKey: TezosGetPublicKey;
2464
+ TezosPublicKey: TezosPublicKey;
2465
+ TezosContractID: TezosContractID;
2466
+ TezosRevealOp: TezosRevealOp;
2467
+ TezosManagerTransfer: TezosManagerTransfer;
2468
+ TezosParametersManager: TezosParametersManager;
2469
+ TezosTransactionOp: TezosTransactionOp;
2470
+ TezosOriginationOp: TezosOriginationOp;
2471
+ TezosDelegationOp: TezosDelegationOp;
2472
+ TezosProposalOp: TezosProposalOp;
2473
+ TezosBallotOp: TezosBallotOp;
2474
+ TezosSignTx: TezosSignTx;
2475
+ TezosSignedTx: TezosSignedTx;
2476
+ };
2477
+
2478
+ export type MessageKey = keyof MessageType;
2479
+
2480
+ export type MessageResponse<T extends MessageKey> = {
2481
+ type: T;
2482
+ message: MessageType[T];
2483
+ };
2484
+
2485
+ export type TypedCall = <T extends MessageKey, R extends MessageKey>(
2486
+ type: T,
2487
+ resType: R,
2488
+ message?: MessageType[T]
2489
+ ) => Promise<MessageResponse<R>>;