@onekeyfe/hd-transport 0.1.41 → 0.1.44

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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as protobuf from 'protobufjs/light';
2
2
  import * as Long from 'long';
3
- import * as ByteBufferJS from 'bytebuffer';
3
+ import ByteBuffer from 'bytebuffer';
4
4
  import { Buffer } from 'buffer';
5
5
 
6
6
  /******************************************************************************
@@ -30,12 +30,6 @@ function __rest(s, e) {
30
30
  return t;
31
31
  }
32
32
 
33
- function getDefaultExportFromNamespaceIfPresent(n) {
34
- return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n.default : n;
35
- }
36
-
37
- const ByteBuffer = getDefaultExportFromNamespaceIfPresent(ByteBufferJS);
38
-
39
33
  const primitiveTypes = [
40
34
  'bool',
41
35
  'string',
@@ -456,7 +450,6 @@ var Enum_RequestType;
456
450
  Enum_RequestType[Enum_RequestType["TXEXTRADATA"] = 4] = "TXEXTRADATA";
457
451
  Enum_RequestType[Enum_RequestType["TXORIGINPUT"] = 5] = "TXORIGINPUT";
458
452
  Enum_RequestType[Enum_RequestType["TXORIGOUTPUT"] = 6] = "TXORIGOUTPUT";
459
- Enum_RequestType[Enum_RequestType["TXPAYMENTREQ"] = 7] = "TXPAYMENTREQ";
460
453
  })(Enum_RequestType || (Enum_RequestType = {}));
461
454
  var CardanoDerivationType;
462
455
  (function (CardanoDerivationType) {
@@ -516,7 +509,6 @@ var CardanoTxSigningMode;
516
509
  CardanoTxSigningMode[CardanoTxSigningMode["ORDINARY_TRANSACTION"] = 0] = "ORDINARY_TRANSACTION";
517
510
  CardanoTxSigningMode[CardanoTxSigningMode["POOL_REGISTRATION_AS_OWNER"] = 1] = "POOL_REGISTRATION_AS_OWNER";
518
511
  CardanoTxSigningMode[CardanoTxSigningMode["MULTISIG_TRANSACTION"] = 2] = "MULTISIG_TRANSACTION";
519
- CardanoTxSigningMode[CardanoTxSigningMode["PLUTUS_TRANSACTION"] = 3] = "PLUTUS_TRANSACTION";
520
512
  })(CardanoTxSigningMode || (CardanoTxSigningMode = {}));
521
513
  var CardanoTxWitnessType;
522
514
  (function (CardanoTxWitnessType) {
@@ -571,13 +563,9 @@ var Enum_PinMatrixRequestType;
571
563
  Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_NewSecond"] = 3] = "PinMatrixRequestType_NewSecond";
572
564
  Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_WipeCodeFirst"] = 4] = "PinMatrixRequestType_WipeCodeFirst";
573
565
  Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_WipeCodeSecond"] = 5] = "PinMatrixRequestType_WipeCodeSecond";
566
+ Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_BackupFirst"] = 6] = "PinMatrixRequestType_BackupFirst";
567
+ Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_BackupSecond"] = 7] = "PinMatrixRequestType_BackupSecond";
574
568
  })(Enum_PinMatrixRequestType || (Enum_PinMatrixRequestType = {}));
575
- var DebugButton;
576
- (function (DebugButton) {
577
- DebugButton[DebugButton["NO"] = 0] = "NO";
578
- DebugButton[DebugButton["YES"] = 1] = "YES";
579
- DebugButton[DebugButton["INFO"] = 2] = "INFO";
580
- })(DebugButton || (DebugButton = {}));
581
569
  var EthereumDataType;
582
570
  (function (EthereumDataType) {
583
571
  EthereumDataType[EthereumDataType["UINT"] = 1] = "UINT";
@@ -621,6 +609,12 @@ var Enum_Capability;
621
609
  Enum_Capability[Enum_Capability["Capability_ShamirGroups"] = 16] = "Capability_ShamirGroups";
622
610
  Enum_Capability[Enum_Capability["Capability_PassphraseEntry"] = 17] = "Capability_PassphraseEntry";
623
611
  })(Enum_Capability || (Enum_Capability = {}));
612
+ var ExportType;
613
+ (function (ExportType) {
614
+ ExportType[ExportType["SeedEncExportType_NO"] = 0] = "SeedEncExportType_NO";
615
+ ExportType[ExportType["SeedEncExportType_YES"] = 1] = "SeedEncExportType_YES";
616
+ ExportType[ExportType["MnemonicPlainExportType_YES"] = 2] = "MnemonicPlainExportType_YES";
617
+ })(ExportType || (ExportType = {}));
624
618
  var SdProtectOperationType;
625
619
  (function (SdProtectOperationType) {
626
620
  SdProtectOperationType[SdProtectOperationType["DISABLE"] = 0] = "DISABLE";
@@ -638,6 +632,18 @@ var Enum_WordRequestType;
638
632
  Enum_WordRequestType[Enum_WordRequestType["WordRequestType_Matrix9"] = 1] = "WordRequestType_Matrix9";
639
633
  Enum_WordRequestType[Enum_WordRequestType["WordRequestType_Matrix6"] = 2] = "WordRequestType_Matrix6";
640
634
  })(Enum_WordRequestType || (Enum_WordRequestType = {}));
635
+ var SeedRequestType;
636
+ (function (SeedRequestType) {
637
+ SeedRequestType[SeedRequestType["SeedRequestType_Gen"] = 0] = "SeedRequestType_Gen";
638
+ SeedRequestType[SeedRequestType["SeedRequestType_EncExport"] = 1] = "SeedRequestType_EncExport";
639
+ SeedRequestType[SeedRequestType["SeedRequestType_EncImport"] = 2] = "SeedRequestType_EncImport";
640
+ })(SeedRequestType || (SeedRequestType = {}));
641
+ var WL_OperationType;
642
+ (function (WL_OperationType) {
643
+ WL_OperationType[WL_OperationType["WL_OperationType_Add"] = 0] = "WL_OperationType_Add";
644
+ WL_OperationType[WL_OperationType["WL_OperationType_Delete"] = 1] = "WL_OperationType_Delete";
645
+ WL_OperationType[WL_OperationType["WL_OperationType_Inquire"] = 2] = "WL_OperationType_Inquire";
646
+ })(WL_OperationType || (WL_OperationType = {}));
641
647
  var NEMMosaicLevy;
642
648
  (function (NEMMosaicLevy) {
643
649
  NEMMosaicLevy[NEMMosaicLevy["MosaicLevy_Absolute"] = 1] = "MosaicLevy_Absolute";
@@ -689,6 +695,11 @@ var TezosBallotType;
689
695
  TezosBallotType[TezosBallotType["Nay"] = 1] = "Nay";
690
696
  TezosBallotType[TezosBallotType["Pass"] = 2] = "Pass";
691
697
  })(TezosBallotType || (TezosBallotType = {}));
698
+ var CommandFlags;
699
+ (function (CommandFlags) {
700
+ CommandFlags[CommandFlags["Default"] = 0] = "Default";
701
+ CommandFlags[CommandFlags["Factory_Only"] = 1] = "Factory_Only";
702
+ })(CommandFlags || (CommandFlags = {}));
692
703
 
693
704
  var messages = /*#__PURE__*/Object.freeze({
694
705
  __proto__: null,
@@ -712,14 +723,16 @@ var messages = /*#__PURE__*/Object.freeze({
712
723
  get FailureType () { return FailureType; },
713
724
  get Enum_ButtonRequestType () { return Enum_ButtonRequestType; },
714
725
  get Enum_PinMatrixRequestType () { return Enum_PinMatrixRequestType; },
715
- get DebugButton () { return DebugButton; },
716
726
  get EthereumDataType () { return EthereumDataType; },
717
727
  get Enum_BackupType () { return Enum_BackupType; },
718
728
  get Enum_SafetyCheckLevel () { return Enum_SafetyCheckLevel; },
719
729
  get Enum_Capability () { return Enum_Capability; },
730
+ get ExportType () { return ExportType; },
720
731
  get SdProtectOperationType () { return SdProtectOperationType; },
721
732
  get RecoveryDeviceType () { return RecoveryDeviceType; },
722
733
  get Enum_WordRequestType () { return Enum_WordRequestType; },
734
+ get SeedRequestType () { return SeedRequestType; },
735
+ get WL_OperationType () { return WL_OperationType; },
723
736
  get NEMMosaicLevy () { return NEMMosaicLevy; },
724
737
  get NEMSupplyChangeType () { return NEMSupplyChangeType; },
725
738
  get NEMModificationType () { return NEMModificationType; },
@@ -728,7 +741,8 @@ var messages = /*#__PURE__*/Object.freeze({
728
741
  get StellarMemoType () { return StellarMemoType; },
729
742
  get StellarSignerType () { return StellarSignerType; },
730
743
  get TezosContractType () { return TezosContractType; },
731
- get TezosBallotType () { return TezosBallotType; }
744
+ get TezosBallotType () { return TezosBallotType; },
745
+ get CommandFlags () { return CommandFlags; }
732
746
  });
733
747
 
734
748
  protobuf.util.Long = Long;
@@ -743,4 +757,4 @@ var index = {
743
757
  decodeProtocol,
744
758
  };
745
759
 
746
- export { AmountUnit, BUFFER_SIZE, BinanceOrderSide, BinanceOrderType, BinanceTimeInForce, COMMON_HEADER_SIZE, CardanoAddressType, CardanoCertificateType, CardanoDerivationType, CardanoNativeScriptHashDisplayFormat, CardanoNativeScriptType, CardanoPoolRelayType, CardanoTxAuxiliaryDataSupplementType, CardanoTxSigningMode, CardanoTxWitnessType, DebugButton, DecredStakingSpendType, Enum_BackupType, Enum_ButtonRequestType, Enum_Capability, Enum_InputScriptType, Enum_OutputScriptType, Enum_PinMatrixRequestType, Enum_RequestType, Enum_SafetyCheckLevel, Enum_WordRequestType, EthereumDataType, FailureType, HEADER_SIZE, MESSAGE_HEADER_BYTE, MESSAGE_TOP_CHAR, messages as Messages, NEMImportanceTransferMode, NEMModificationType, NEMMosaicLevy, NEMSupplyChangeType, RecoveryDeviceType, SdProtectOperationType, StellarAssetType, StellarMemoType, StellarSignerType, TezosBallotType, TezosContractType, index as default };
760
+ export { AmountUnit, BUFFER_SIZE, BinanceOrderSide, BinanceOrderType, BinanceTimeInForce, COMMON_HEADER_SIZE, CardanoAddressType, CardanoCertificateType, CardanoDerivationType, CardanoNativeScriptHashDisplayFormat, CardanoNativeScriptType, CardanoPoolRelayType, CardanoTxAuxiliaryDataSupplementType, CardanoTxSigningMode, CardanoTxWitnessType, CommandFlags, DecredStakingSpendType, Enum_BackupType, Enum_ButtonRequestType, Enum_Capability, Enum_InputScriptType, Enum_OutputScriptType, Enum_PinMatrixRequestType, Enum_RequestType, Enum_SafetyCheckLevel, Enum_WordRequestType, EthereumDataType, ExportType, FailureType, HEADER_SIZE, MESSAGE_HEADER_BYTE, MESSAGE_TOP_CHAR, messages as Messages, NEMImportanceTransferMode, NEMModificationType, NEMMosaicLevy, NEMSupplyChangeType, RecoveryDeviceType, SdProtectOperationType, SeedRequestType, StellarAssetType, StellarMemoType, StellarSignerType, TezosBallotType, TezosContractType, WL_OperationType, index as default };
@@ -1,5 +1,5 @@
1
1
  import { Type } from 'protobufjs/light';
2
- import { ByteBuffer } from '../../utils';
2
+ import ByteBuffer from 'bytebuffer';
3
3
  export declare const decode: (Message: Type, data: ByteBuffer) => {
4
4
  [key: string]: any;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protobuf/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuEzC,eAAO,MAAM,MAAM,YAAa,IAAI,QAAQ,UAAU;;CAUrD,CAAC"}
1
+ {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protobuf/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,kBAAkB,CAAC;AACxD,OAAO,UAAU,MAAM,YAAY,CAAC;AAuEpC,eAAO,MAAM,MAAM,YAAa,IAAI,QAAQ,UAAU;;CAUrD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Type } from 'protobufjs/light';
2
+ import ByteBuffer from 'bytebuffer';
2
3
  export declare function patch(Message: Type, payload: any): any;
3
- export declare const encode: (Message: Type, data: Record<string, unknown>) => any;
4
+ export declare const encode: (Message: Type, data: Record<string, unknown>) => ByteBuffer;
4
5
  //# sourceMappingURL=encode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protobuf/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAuBxC,wBAAgB,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OA4ChD;AAED,eAAO,MAAM,MAAM,YAAa,IAAI,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,QASlE,CAAC"}
1
+ {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protobuf/encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,UAAU,MAAM,YAAY,CAAC;AAqBpC,wBAAgB,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OA4ChD;AAED,eAAO,MAAM,MAAM,YAAa,IAAI,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,eASlE,CAAC"}
@@ -1,11 +1,11 @@
1
- import { ByteBuffer } from '../../utils';
1
+ import ByteBuffer from 'bytebuffer';
2
2
  export declare const decode: (byteBuffer: ByteBuffer) => {
3
3
  typeId: number;
4
- buffer: import("bytebuffer");
4
+ buffer: ByteBuffer;
5
5
  };
6
6
  export declare const decodeChunked: (bytes: ArrayBuffer) => {
7
7
  length: number;
8
8
  typeId: number;
9
- restBuffer: any;
9
+ restBuffer: ByteBuffer;
10
10
  };
11
11
  //# sourceMappingURL=decode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protocol/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAyBzC,eAAO,MAAM,MAAM,eAAgB,UAAU;;;CAO5C,CAAC;AAIF,eAAO,MAAM,aAAa,UAAW,WAAW;;;;CAW/C,CAAC"}
1
+ {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protocol/decode.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAyBpC,eAAO,MAAM,MAAM,eAAgB,UAAU;;;CAO5C,CAAC;AAIF,eAAO,MAAM,aAAa,UAAW,WAAW;;;;CAW/C,CAAC"}
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ import ByteBuffer from 'bytebuffer';
2
3
  declare type Options<Chunked> = {
3
4
  chunked: Chunked;
4
5
  addTrezorHeaders: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protocol/encode.ts"],"names":[],"mappings":";AAIA,aAAK,OAAO,CAAC,OAAO,IAAI;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,iBAAS,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC;AACpE,iBAAS,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;AA+CnE,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/serialization/protocol/encode.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAIpC,aAAK,OAAO,CAAC,OAAO,IAAI;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,iBAAS,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC;AACpE,iBAAS,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC;AA+CnE,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { Root } from 'protobufjs/light';
3
+ import ByteBuffer from 'bytebuffer';
3
4
  export declare function buildOne(messages: Root, name: string, data: Record<string, unknown>): Buffer;
4
5
  export declare const buildEncodeBuffers: (messages: Root, name: string, data: Record<string, unknown>) => Buffer[];
5
- export declare const buildBuffers: (messages: Root, name: string, data: Record<string, unknown>) => import("bytebuffer")[];
6
+ export declare const buildBuffers: (messages: Root, name: string, data: Record<string, unknown>) => ByteBuffer[];
6
7
  //# sourceMappingURL=send.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/serialization/send.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AASxC,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UASnF;AAED,eAAO,MAAM,kBAAkB,aAAc,IAAI,QAAQ,MAAM,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,aAQ7F,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,IAAI,QAAQ,MAAM,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,2BAsBvF,CAAC"}
1
+ {"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/serialization/send.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AAQpC,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UASnF;AAED,eAAO,MAAM,kBAAkB,aAAc,IAAI,QAAQ,MAAM,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,aAQ7F,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,IAAI,QAAQ,MAAM,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,iBAsBvF,CAAC"}