@onekeyfe/hd-core 0.2.12 → 0.2.14

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 (44) hide show
  1. package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
  2. package/dist/api/cardano/helper/auxiliaryData.d.ts.map +1 -1
  3. package/dist/api/cardano/helper/cardanoInputs.d.ts.map +1 -1
  4. package/dist/api/cardano/helper/cardanoOutputs.d.ts.map +1 -1
  5. package/dist/api/cardano/helper/certificate.d.ts.map +1 -1
  6. package/dist/api/cardano/helper/witnesses.d.ts.map +1 -1
  7. package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
  8. package/dist/api/index.d.ts +0 -1
  9. package/dist/api/index.d.ts.map +1 -1
  10. package/dist/index.d.ts +5 -12
  11. package/dist/index.js +503 -220
  12. package/dist/inject.d.ts.map +1 -1
  13. package/dist/types/api/cardano.d.ts.map +1 -1
  14. package/dist/types/api/index.d.ts +0 -2
  15. package/dist/types/api/index.d.ts.map +1 -1
  16. package/dist/utils/homescreen.d.ts +231 -0
  17. package/dist/utils/homescreen.d.ts.map +1 -0
  18. package/dist/utils/index.d.ts +1 -0
  19. package/dist/utils/index.d.ts.map +1 -1
  20. package/dist/utils/patch.d.ts +1 -1
  21. package/dist/utils/patch.d.ts.map +1 -1
  22. package/package.json +4 -4
  23. package/src/api/cardano/CardanoGetAddress.ts +1 -1
  24. package/src/api/cardano/CardanoGetPublicKey.ts +1 -1
  25. package/src/api/cardano/CardanoSignTransaction.ts +7 -2
  26. package/src/api/cardano/helper/auxiliaryData.ts +0 -4
  27. package/src/api/cardano/helper/cardanoInputs.ts +2 -0
  28. package/src/api/cardano/helper/cardanoOutputs.ts +1 -0
  29. package/src/api/cardano/helper/certificate.ts +2 -0
  30. package/src/api/cardano/helper/witnesses.ts +2 -0
  31. package/src/api/device/DeviceUploadResource.ts +1 -3
  32. package/src/api/index.ts +0 -1
  33. package/src/data/messages/messages.json +368 -281
  34. package/src/inject.ts +0 -2
  35. package/src/types/api/cardano.ts +1 -0
  36. package/src/types/api/index.ts +0 -2
  37. package/src/utils/homescreen.ts +237 -0
  38. package/src/utils/index.ts +2 -0
  39. package/dist/api/cardano/CardanoSignMessage.d.ts +0 -14
  40. package/dist/api/cardano/CardanoSignMessage.d.ts.map +0 -1
  41. package/dist/types/api/cardanoSignMessage.d.ts +0 -16
  42. package/dist/types/api/cardanoSignMessage.d.ts.map +0 -1
  43. package/src/api/cardano/CardanoSignMessage.ts +0 -58
  44. package/src/types/api/cardanoSignMessage.ts +0 -22
@@ -13,7 +13,6 @@ import { PROTO } from '../../../constants';
13
13
 
14
14
  const transformCatalystRegistrationParameters = (
15
15
  catalystRegistrationParameters: CardanoCatalystRegistrationParameters
16
- // @ts-expect-error
17
16
  ): PROTO.CardanoCatalystRegistrationParametersType => {
18
17
  validateParams(catalystRegistrationParameters, [
19
18
  { name: 'votingPublicKey', type: 'string', required: true },
@@ -51,7 +50,6 @@ export const transformAuxiliaryData = (
51
50
 
52
51
  return {
53
52
  hash: auxiliaryData.hash,
54
- // @ts-expect-error
55
53
  catalyst_registration_parameters: catalystRegistrationParameters,
56
54
  };
57
55
  };
@@ -59,7 +57,6 @@ export const transformAuxiliaryData = (
59
57
  export const modifyAuxiliaryDataForBackwardsCompatibility = (
60
58
  auxiliary_data: PROTO.CardanoTxAuxiliaryData
61
59
  ): PROTO.CardanoTxAuxiliaryData => {
62
- // @ts-expect-error
63
60
  const { catalyst_registration_parameters } = auxiliary_data;
64
61
  if (catalyst_registration_parameters) {
65
62
  catalyst_registration_parameters.reward_address_parameters =
@@ -69,7 +66,6 @@ export const modifyAuxiliaryDataForBackwardsCompatibility = (
69
66
 
70
67
  return {
71
68
  ...auxiliary_data,
72
- // @ts-expect-error
73
69
  catalyst_registration_parameters,
74
70
  };
75
71
  }
@@ -10,6 +10,7 @@ export type InputWithPath = {
10
10
  };
11
11
 
12
12
  export type CollateralInputWithPath = {
13
+ // @ts-expect-error
13
14
  collateralInput: PROTO.CardanoTxCollateralInput;
14
15
  path?: Path;
15
16
  };
@@ -42,6 +43,7 @@ export const transformCollateralInput = (collateralInput: any): CollateralInputW
42
43
  };
43
44
  };
44
45
 
46
+ // @ts-expect-error
45
47
  export const transformReferenceInput = (referenceInput: any): PROTO.CardanoTxReferenceInput => {
46
48
  validateParams(referenceInput, [
47
49
  { name: 'prev_hash', type: 'string', required: true },
@@ -27,6 +27,7 @@ export const transformOutput = (output: any): OutputWithData => {
27
27
  output: {
28
28
  amount: output.amount,
29
29
  asset_groups_count: 0,
30
+ // @ts-expect-error
30
31
  datum_hash: output.datumHash,
31
32
  format: output.format,
32
33
  inline_datum_size: output.inlineDatum ? hexStringByteLength(output.inlineDatum) : undefined,
@@ -130,6 +130,7 @@ const transformPoolParameters = (
130
130
  validatePoolParameters(poolParameters);
131
131
 
132
132
  return {
133
+ // @ts-expect-error
133
134
  poolParameters: {
134
135
  pool_id: poolParameters.poolId,
135
136
  vrf_key_hash: poolParameters.vrfKeyHash,
@@ -187,6 +188,7 @@ export const transformCertificate = (
187
188
  type: certificate.type,
188
189
  path: certificate.path ? validatePath(certificate.path, 5) : undefined,
189
190
  script_hash: certificate.scriptHash,
191
+ // @ts-expect-error
190
192
  key_hash: certificate.keyHash,
191
193
  pool: certificate.pool,
192
194
  pool_parameters: poolParameters,
@@ -7,6 +7,7 @@ export const gatherWitnessPaths = (
7
7
  certificatesWithPoolOwnersAndRelays: CertificateWithPoolOwnersAndRelays[],
8
8
  withdrawals: PROTO.CardanoTxWithdrawal[],
9
9
  collateralInputsWithPath: CollateralInputWithPath[],
10
+ // @ts-expect-error
10
11
  requiredSigners: PROTO.CardanoTxRequiredSigner[],
11
12
  additionalWitnessRequests: Path[],
12
13
  signingMode: PROTO.CardanoTxSigningMode
@@ -42,6 +43,7 @@ export const gatherWitnessPaths = (
42
43
  }
43
44
 
44
45
  // gather Plutus-related paths
46
+ // @ts-expect-error
45
47
  if (signingMode === PROTO.CardanoTxSigningMode.PLUTUS_TRANSACTION) {
46
48
  collateralInputsWithPath.forEach(({ path }) => {
47
49
  if (path) _insert(path);
@@ -32,7 +32,6 @@ export default class DeviceUploadResource extends BaseMethod<ResourceUpload> {
32
32
  { name: 'thumbnailDataHex', type: 'string', required: true },
33
33
  { name: 'resType', type: 'number', required: true },
34
34
  { name: 'nftMetaData', type: 'string' },
35
- { name: 'file_name_no_ext', type: 'boolean' },
36
35
  ]);
37
36
 
38
37
  const { suffix, dataHex, thumbnailDataHex, resType, nftMetaData } = this
@@ -49,8 +48,7 @@ export default class DeviceUploadResource extends BaseMethod<ResourceUpload> {
49
48
  data_length: this.paramsData.data.byteLength,
50
49
  zoom_data_length: this.paramsData.thumbnailData.byteLength,
51
50
  res_type: resType,
52
- nft_metadata: nftMetaData,
53
- file_name_no_ext: this.payload.file_name_no_ext,
51
+ nft_meta_data: nftMetaData,
54
52
  };
55
53
  }
56
54
 
package/src/api/index.ts CHANGED
@@ -89,4 +89,3 @@ export { default as suiSignTransaction } from './sui/SuiSignTransaction';
89
89
  export { default as cardanoGetAddress } from './cardano/CardanoGetAddress';
90
90
  export { default as cardanoGetPublicKey } from './cardano/CardanoGetPublicKey';
91
91
  export { default as cardanoSignTransaction } from './cardano/CardanoSignTransaction';
92
- export { default as cardanoSignMessage } from './cardano/CardanoSignMessage';