@onekeyfe/hd-transport 0.2.15 → 0.2.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport",
3
- "version": "0.2.15",
3
+ "version": "0.2.17",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -26,5 +26,5 @@
26
26
  "long": "^4.0.0",
27
27
  "protobufjs": "^6.11.2"
28
28
  },
29
- "gitHead": "81f195d70997b6875fee3c1f7f6d458e4223c78a"
29
+ "gitHead": "d41357f21ad61f8ad3d245b3066766ca5c0bf1be"
30
30
  }
@@ -649,6 +649,11 @@ export enum CardanoNativeScriptHashDisplayFormat {
649
649
  POLICY_ID = 2,
650
650
  }
651
651
 
652
+ export enum CardanoTxOutputSerializationFormat {
653
+ ARRAY_LEGACY = 0,
654
+ MAP_BABBAGE = 1,
655
+ }
656
+
652
657
  export enum CardanoCertificateType {
653
658
  STAKE_REGISTRATION = 0,
654
659
  STAKE_DEREGISTRATION = 1,
@@ -664,13 +669,19 @@ export enum CardanoPoolRelayType {
664
669
 
665
670
  export enum CardanoTxAuxiliaryDataSupplementType {
666
671
  NONE = 0,
667
- CATALYST_REGISTRATION_SIGNATURE = 1,
672
+ GOVERNANCE_REGISTRATION_SIGNATURE = 1,
673
+ }
674
+
675
+ export enum CardanoGovernanceRegistrationFormat {
676
+ CIP15 = 0,
677
+ CIP36 = 1,
668
678
  }
669
679
 
670
680
  export enum CardanoTxSigningMode {
671
681
  ORDINARY_TRANSACTION = 0,
672
682
  POOL_REGISTRATION_AS_OWNER = 1,
673
683
  MULTISIG_TRANSACTION = 2,
684
+ PLUTUS_TRANSACTION = 3,
674
685
  }
675
686
 
676
687
  export enum CardanoTxWitnessType {
@@ -767,7 +778,7 @@ export type CardanoSignTxInit = {
767
778
  collateral_inputs_count: number;
768
779
  required_signers_count: number;
769
780
  has_collateral_return?: boolean;
770
- total_collateral?: UintType;
781
+ total_collateral?: number;
771
782
  reference_inputs_count?: number;
772
783
  };
773
784
 
@@ -783,6 +794,10 @@ export type CardanoTxOutput = {
783
794
  address_parameters?: CardanoAddressParametersType;
784
795
  amount: UintType;
785
796
  asset_groups_count: number;
797
+ datum_hash?: string;
798
+ format?: CardanoTxOutputSerializationFormat;
799
+ inline_datum_size?: number;
800
+ reference_script_size?: number;
786
801
  };
787
802
 
788
803
  // CardanoAssetGroup
@@ -798,6 +813,16 @@ export type CardanoToken = {
798
813
  mint_amount?: UintType;
799
814
  };
800
815
 
816
+ // CardanoTxInlineDatumChunk
817
+ export type CardanoTxInlineDatumChunk = {
818
+ data: string;
819
+ };
820
+
821
+ // CardanoTxReferenceScriptChunk
822
+ export type CardanoTxReferenceScriptChunk = {
823
+ data: string;
824
+ };
825
+
801
826
  // CardanoPoolOwner
802
827
  export type CardanoPoolOwner = {
803
828
  staking_key_path?: number[];
@@ -828,8 +853,6 @@ export type CardanoPoolParametersType = {
828
853
  margin_numerator: UintType;
829
854
  margin_denominator: UintType;
830
855
  reward_account: string;
831
- owners: CardanoPoolOwner[];
832
- relays: CardanoPoolRelayParameters[];
833
856
  metadata?: CardanoPoolMetadataType;
834
857
  owners_count: number;
835
858
  relays_count: number;
@@ -842,6 +865,7 @@ export type CardanoTxCertificate = {
842
865
  pool?: string;
843
866
  pool_parameters?: CardanoPoolParametersType;
844
867
  script_hash?: string;
868
+ key_hash?: string;
845
869
  };
846
870
 
847
871
  // CardanoTxWithdrawal
@@ -849,19 +873,29 @@ export type CardanoTxWithdrawal = {
849
873
  path?: number[];
850
874
  amount: UintType;
851
875
  script_hash?: string;
876
+ key_hash?: string;
852
877
  };
853
878
 
854
- // CardanoCatalystRegistrationParametersType
855
- export type CardanoCatalystRegistrationParametersType = {
879
+ // CardanoGovernanceRegistrationDelegation
880
+ export type CardanoGovernanceRegistrationDelegation = {
856
881
  voting_public_key: string;
882
+ weight: number;
883
+ };
884
+
885
+ // CardanoGovernanceRegistrationParametersType
886
+ export type CardanoGovernanceRegistrationParametersType = {
887
+ voting_public_key?: string;
857
888
  staking_path: number[];
858
889
  reward_address_parameters: CardanoAddressParametersType;
859
- nonce: UintType;
890
+ nonce: number;
891
+ format?: CardanoGovernanceRegistrationFormat;
892
+ delegations: CardanoGovernanceRegistrationDelegation[];
893
+ voting_purpose?: number;
860
894
  };
861
895
 
862
896
  // CardanoTxAuxiliaryData
863
897
  export type CardanoTxAuxiliaryData = {
864
- catalyst_registration_parameters?: CardanoCatalystRegistrationParametersType;
898
+ governance_registration_parameters?: CardanoGovernanceRegistrationParametersType;
865
899
  hash?: string;
866
900
  };
867
901
 
@@ -870,6 +904,24 @@ export type CardanoTxMint = {
870
904
  asset_groups_count: number;
871
905
  };
872
906
 
907
+ // CardanoTxCollateralInput
908
+ export type CardanoTxCollateralInput = {
909
+ prev_hash: string;
910
+ prev_index: number;
911
+ };
912
+
913
+ // CardanoTxRequiredSigner
914
+ export type CardanoTxRequiredSigner = {
915
+ key_hash?: string;
916
+ key_path?: number[];
917
+ };
918
+
919
+ // CardanoTxReferenceInput
920
+ export type CardanoTxReferenceInput = {
921
+ prev_hash: string;
922
+ prev_index: number;
923
+ };
924
+
873
925
  // CardanoTxItemAck
874
926
  export type CardanoTxItemAck = {};
875
927
 
@@ -877,7 +929,7 @@ export type CardanoTxItemAck = {};
877
929
  export type CardanoTxAuxiliaryDataSupplement = {
878
930
  type: CardanoTxAuxiliaryDataSupplementType;
879
931
  auxiliary_data_hash?: string;
880
- catalyst_signature?: string;
932
+ governance_signature?: string;
881
933
  };
882
934
 
883
935
  // CardanoTxWitnessRequest
@@ -904,85 +956,18 @@ export type CardanoTxBodyHash = {
904
956
  // CardanoSignTxFinished
905
957
  export type CardanoSignTxFinished = {};
906
958
 
907
- export type CardanoTxInputType = {
908
- address_n?: number[];
909
- prev_hash: string;
910
- prev_index: number;
911
- };
912
-
913
- export type CardanoTokenType = {
914
- asset_name_bytes: string;
915
- amount: UintType;
916
- };
917
-
918
- export type CardanoAssetGroupType = {
919
- policy_id: string;
920
- tokens: CardanoTokenType[];
921
- };
922
-
923
- export type CardanoTxOutputType = {
924
- address?: string;
925
- amount: UintType;
926
- address_parameters?: CardanoAddressParametersType;
927
- token_bundle: CardanoAssetGroupType[];
928
- };
929
-
930
- export type CardanoPoolOwnerType = {
931
- staking_key_path?: number[];
932
- staking_key_hash?: string;
933
- };
934
-
935
- export type CardanoPoolRelayParametersType = {
936
- type: CardanoPoolRelayType;
937
- ipv4_address?: string;
938
- ipv6_address?: string;
939
- host_name?: string;
940
- port?: number;
941
- };
942
-
943
- export type CardanoTxCertificateType = {
944
- type: CardanoCertificateType;
945
- path?: number[];
946
- pool?: string;
947
- pool_parameters?: CardanoPoolParametersType;
948
- };
949
-
950
- export type CardanoTxWithdrawalType = {
951
- path: number[];
952
- amount: UintType;
953
- };
954
-
955
- export type CardanoTxAuxiliaryDataType = {
956
- blob?: string;
957
- catalyst_registration_parameters?: CardanoCatalystRegistrationParametersType;
958
- };
959
-
960
- // CardanoSignTx
961
- export type CardanoSignTx = {
962
- inputs: CardanoTxInputType[];
963
- outputs: CardanoTxOutputType[];
964
- protocol_magic: number;
965
- fee: UintType;
966
- ttl?: UintType;
959
+ // CardanoSignMessage
960
+ export type CardanoSignMessage = {
961
+ address_n: number[];
962
+ message: string;
963
+ derivation_type: CardanoDerivationType;
967
964
  network_id: number;
968
- certificates: CardanoTxCertificateType[];
969
- withdrawals: CardanoTxWithdrawalType[];
970
- validity_interval_start?: UintType;
971
- auxiliary_data?: CardanoTxAuxiliaryDataType;
972
965
  };
973
966
 
974
- // CardanoSignedTxChunk
975
- export type CardanoSignedTxChunk = {
976
- signed_tx_chunk: string;
977
- };
978
-
979
- // CardanoSignedTxChunkAck
980
- export type CardanoSignedTxChunkAck = {};
981
-
982
- // CardanoSignedTx
983
- export type CardanoSignedTx = {
984
- tx_hash: string;
985
- serialized_tx?: string;
967
+ // CardanoMessageSignature
968
+ export type CardanoMessageSignature = {
969
+ signature: string;
970
+ key: string;
986
971
  };
987
972
 
988
973
  // Success
@@ -1432,6 +1417,7 @@ export type EthereumSignTypedData = {
1432
1417
  address_n: number[];
1433
1418
  primary_type: string;
1434
1419
  metamask_v4_compat?: boolean;
1420
+ chain_id?: number;
1435
1421
  };
1436
1422
 
1437
1423
  // EthereumTypedDataStructRequest
@@ -1481,6 +1467,7 @@ export type EthereumTypedDataValueAck = {
1481
1467
  export type EthereumGetPublicKey = {
1482
1468
  address_n: number[];
1483
1469
  show_display?: boolean;
1470
+ chain_id?: number;
1484
1471
  };
1485
1472
 
1486
1473
  // EthereumPublicKey
@@ -1493,6 +1480,7 @@ export type EthereumPublicKey = {
1493
1480
  export type EthereumGetAddress = {
1494
1481
  address_n: number[];
1495
1482
  show_display?: boolean;
1483
+ chain_id?: number;
1496
1484
  };
1497
1485
 
1498
1486
  // EthereumAddress
@@ -1552,6 +1540,7 @@ export type EthereumTxAck = {
1552
1540
  export type EthereumSignMessage = {
1553
1541
  address_n: number[];
1554
1542
  message: string;
1543
+ chain_id?: number;
1555
1544
  };
1556
1545
 
1557
1546
  // EthereumMessageSignature
@@ -1565,6 +1554,7 @@ export type EthereumVerifyMessage = {
1565
1554
  signature: string;
1566
1555
  message: string;
1567
1556
  address: string;
1557
+ chain_id?: number;
1568
1558
  };
1569
1559
 
1570
1560
  // EthereumSignMessageEIP712
@@ -1579,6 +1569,7 @@ export type EthereumSignTypedHash = {
1579
1569
  address_n: number[];
1580
1570
  domain_separator_hash: string;
1581
1571
  message_hash?: string;
1572
+ chain_id?: number;
1582
1573
  };
1583
1574
 
1584
1575
  // EthereumTypedDataSignature
@@ -1587,6 +1578,28 @@ export type EthereumTypedDataSignature = {
1587
1578
  address: string;
1588
1579
  };
1589
1580
 
1581
+ // FilecoinGetAddress
1582
+ export type FilecoinGetAddress = {
1583
+ address_n: number[];
1584
+ show_display?: boolean;
1585
+ };
1586
+
1587
+ // FilecoinAddress
1588
+ export type FilecoinAddress = {
1589
+ address?: string;
1590
+ };
1591
+
1592
+ // FilecoinSignTx
1593
+ export type FilecoinSignTx = {
1594
+ address_n: number[];
1595
+ raw_tx: string;
1596
+ };
1597
+
1598
+ // FilecoinSignedTx
1599
+ export type FilecoinSignedTx = {
1600
+ signature: string;
1601
+ };
1602
+
1590
1603
  export enum Enum_BackupType {
1591
1604
  Bip39 = 0,
1592
1605
  Slip39_Basic = 1,
@@ -2024,8 +2037,9 @@ export type ResourceUpload = {
2024
2037
  extension: string;
2025
2038
  data_length: number;
2026
2039
  res_type: ResourceType;
2027
- zoom_data_length: number;
2028
2040
  nft_meta_data?: string;
2041
+ zoom_data_length: number;
2042
+ file_name_no_ext?: string;
2029
2043
  };
2030
2044
 
2031
2045
  // ZoomRequest
@@ -2258,6 +2272,28 @@ export type NEMDecryptedMessage = {
2258
2272
  payload: string;
2259
2273
  };
2260
2274
 
2275
+ // PolkadotGetAddress
2276
+ export type PolkadotGetAddress = {
2277
+ address_n: number[];
2278
+ show_display?: boolean;
2279
+ };
2280
+
2281
+ // PolkadotAddress
2282
+ export type PolkadotAddress = {
2283
+ address?: string;
2284
+ };
2285
+
2286
+ // PolkadotSignTx
2287
+ export type PolkadotSignTx = {
2288
+ address_n: number[];
2289
+ raw_tx: string;
2290
+ };
2291
+
2292
+ // PolkadotSignedTx
2293
+ export type PolkadotSignedTx = {
2294
+ signature: string;
2295
+ };
2296
+
2261
2297
  // RippleGetAddress
2262
2298
  export type RippleGetAddress = {
2263
2299
  address_n: number[];
@@ -2848,15 +2884,21 @@ export type MessageType = {
2848
2884
  CardanoTxOutput: CardanoTxOutput;
2849
2885
  CardanoAssetGroup: CardanoAssetGroup;
2850
2886
  CardanoToken: CardanoToken;
2887
+ CardanoTxInlineDatumChunk: CardanoTxInlineDatumChunk;
2888
+ CardanoTxReferenceScriptChunk: CardanoTxReferenceScriptChunk;
2851
2889
  CardanoPoolOwner: CardanoPoolOwner;
2852
2890
  CardanoPoolRelayParameters: CardanoPoolRelayParameters;
2853
2891
  CardanoPoolMetadataType: CardanoPoolMetadataType;
2854
2892
  CardanoPoolParametersType: CardanoPoolParametersType;
2855
2893
  CardanoTxCertificate: CardanoTxCertificate;
2856
2894
  CardanoTxWithdrawal: CardanoTxWithdrawal;
2857
- CardanoCatalystRegistrationParametersType: CardanoCatalystRegistrationParametersType;
2895
+ CardanoGovernanceRegistrationDelegation: CardanoGovernanceRegistrationDelegation;
2896
+ CardanoGovernanceRegistrationParametersType: CardanoGovernanceRegistrationParametersType;
2858
2897
  CardanoTxAuxiliaryData: CardanoTxAuxiliaryData;
2859
2898
  CardanoTxMint: CardanoTxMint;
2899
+ CardanoTxCollateralInput: CardanoTxCollateralInput;
2900
+ CardanoTxRequiredSigner: CardanoTxRequiredSigner;
2901
+ CardanoTxReferenceInput: CardanoTxReferenceInput;
2860
2902
  CardanoTxItemAck: CardanoTxItemAck;
2861
2903
  CardanoTxAuxiliaryDataSupplement: CardanoTxAuxiliaryDataSupplement;
2862
2904
  CardanoTxWitnessRequest: CardanoTxWitnessRequest;
@@ -2864,19 +2906,8 @@ export type MessageType = {
2864
2906
  CardanoTxHostAck: CardanoTxHostAck;
2865
2907
  CardanoTxBodyHash: CardanoTxBodyHash;
2866
2908
  CardanoSignTxFinished: CardanoSignTxFinished;
2867
- CardanoTxInputType: CardanoTxInputType;
2868
- CardanoTokenType: CardanoTokenType;
2869
- CardanoAssetGroupType: CardanoAssetGroupType;
2870
- CardanoTxOutputType: CardanoTxOutputType;
2871
- CardanoPoolOwnerType: CardanoPoolOwnerType;
2872
- CardanoPoolRelayParametersType: CardanoPoolRelayParametersType;
2873
- CardanoTxCertificateType: CardanoTxCertificateType;
2874
- CardanoTxWithdrawalType: CardanoTxWithdrawalType;
2875
- CardanoTxAuxiliaryDataType: CardanoTxAuxiliaryDataType;
2876
- CardanoSignTx: CardanoSignTx;
2877
- CardanoSignedTxChunk: CardanoSignedTxChunk;
2878
- CardanoSignedTxChunkAck: CardanoSignedTxChunkAck;
2879
- CardanoSignedTx: CardanoSignedTx;
2909
+ CardanoSignMessage: CardanoSignMessage;
2910
+ CardanoMessageSignature: CardanoMessageSignature;
2880
2911
  Success: Success;
2881
2912
  Failure: Failure;
2882
2913
  ButtonRequest: ButtonRequest;
@@ -2960,6 +2991,10 @@ export type MessageType = {
2960
2991
  EthereumSignMessageEIP712: EthereumSignMessageEIP712;
2961
2992
  EthereumSignTypedHash: EthereumSignTypedHash;
2962
2993
  EthereumTypedDataSignature: EthereumTypedDataSignature;
2994
+ FilecoinGetAddress: FilecoinGetAddress;
2995
+ FilecoinAddress: FilecoinAddress;
2996
+ FilecoinSignTx: FilecoinSignTx;
2997
+ FilecoinSignedTx: FilecoinSignedTx;
2963
2998
  Initialize: Initialize;
2964
2999
  GetFeatures: GetFeatures;
2965
3000
  Features: Features;
@@ -3049,6 +3084,10 @@ export type MessageType = {
3049
3084
  NEMSignedTx: NEMSignedTx;
3050
3085
  NEMDecryptMessage: NEMDecryptMessage;
3051
3086
  NEMDecryptedMessage: NEMDecryptedMessage;
3087
+ PolkadotGetAddress: PolkadotGetAddress;
3088
+ PolkadotAddress: PolkadotAddress;
3089
+ PolkadotSignTx: PolkadotSignTx;
3090
+ PolkadotSignedTx: PolkadotSignedTx;
3052
3091
  RippleGetAddress: RippleGetAddress;
3053
3092
  RippleAddress: RippleAddress;
3054
3093
  RipplePayment: RipplePayment;
@@ -3127,5 +3166,5 @@ export type MessageResponse<T extends MessageKey> = {
3127
3166
  export type TypedCall = <T extends MessageKey, R extends MessageKey>(
3128
3167
  type: T,
3129
3168
  resType: R,
3130
- message?: MessageType[T]
3169
+ message?: MessageType[T],
3131
3170
  ) => Promise<MessageResponse<R>>;