@onekeyfe/hd-core 0.2.16 → 0.2.18

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 (68) hide show
  1. package/dist/api/cardano/helper/cardanoInputs.d.ts.map +1 -1
  2. package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
  3. package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
  4. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  5. package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
  6. package/dist/api/evm/EVMSignTypedData.d.ts +1 -0
  7. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  8. package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
  9. package/dist/api/filecoin/FilecoinGetAddress.d.ts +17 -0
  10. package/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -0
  11. package/dist/api/filecoin/FilecoinSignTransaction.d.ts +19 -0
  12. package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -0
  13. package/dist/api/index.d.ts +2 -0
  14. package/dist/api/index.d.ts.map +1 -1
  15. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  16. package/dist/index.d.ts +34 -3
  17. package/dist/index.js +433 -276
  18. package/dist/inject.d.ts.map +1 -1
  19. package/dist/types/api/cardano.d.ts.map +1 -1
  20. package/dist/types/api/evmGetAddress.d.ts +1 -0
  21. package/dist/types/api/evmGetAddress.d.ts.map +1 -1
  22. package/dist/types/api/evmGetPublicKey.d.ts +1 -0
  23. package/dist/types/api/evmGetPublicKey.d.ts.map +1 -1
  24. package/dist/types/api/evmSignMessage.d.ts +1 -0
  25. package/dist/types/api/evmSignMessage.d.ts.map +1 -1
  26. package/dist/types/api/evmSignTypedData.d.ts +1 -0
  27. package/dist/types/api/evmSignTypedData.d.ts.map +1 -1
  28. package/dist/types/api/evmVerifyMessage.d.ts +1 -0
  29. package/dist/types/api/evmVerifyMessage.d.ts.map +1 -1
  30. package/dist/types/api/export.d.ts +2 -0
  31. package/dist/types/api/export.d.ts.map +1 -1
  32. package/dist/types/api/filecoinGetAddress.d.ts +14 -0
  33. package/dist/types/api/filecoinGetAddress.d.ts.map +1 -0
  34. package/dist/types/api/filecoinSignTransaction.d.ts +14 -0
  35. package/dist/types/api/filecoinSignTransaction.d.ts.map +1 -0
  36. package/dist/types/api/index.d.ts +4 -0
  37. package/dist/types/api/index.d.ts.map +1 -1
  38. package/dist/utils/patch.d.ts +1 -1
  39. package/dist/utils/patch.d.ts.map +1 -1
  40. package/package.json +4 -4
  41. package/src/api/device/DeviceUploadResource.ts +6 -0
  42. package/src/api/evm/EVMGetAddress.ts +2 -0
  43. package/src/api/evm/EVMGetPublicKey.ts +2 -0
  44. package/src/api/evm/EVMSignMessage.ts +3 -1
  45. package/src/api/evm/EVMSignTypedData.ts +8 -3
  46. package/src/api/evm/EVMVerifyMessage.ts +2 -0
  47. package/src/api/filecoin/FilecoinGetAddress.ts +71 -0
  48. package/src/api/filecoin/FilecoinSignTransaction.ts +54 -0
  49. package/src/api/helpers/stringUtils.ts +1 -1
  50. package/src/api/index.ts +3 -0
  51. package/src/api/stellar/StellarSignTransaction.ts +5 -2
  52. package/src/api/xrp/XrpGetAddress.ts +1 -1
  53. package/src/api/xrp/XrpSignTransaction.ts +1 -1
  54. package/src/data/messages/messages.json +463 -419
  55. package/src/inject.ts +5 -0
  56. package/src/types/api/cardano.ts +0 -1
  57. package/src/types/api/evmGetAddress.ts +1 -0
  58. package/src/types/api/evmGetPublicKey.ts +1 -0
  59. package/src/types/api/evmSignMessage.ts +1 -0
  60. package/src/types/api/evmSignTypedData.ts +1 -0
  61. package/src/types/api/evmVerifyMessage.ts +1 -0
  62. package/src/types/api/export.ts +3 -0
  63. package/src/types/api/filecoinGetAddress.ts +23 -0
  64. package/src/types/api/filecoinSignTransaction.ts +23 -0
  65. package/src/types/api/index.ts +9 -0
  66. package/src/types/api/nearSignTransaction.ts +1 -1
  67. package/src/types/api/tronGetAddress.ts +2 -2
  68. package/src/types/api/tronSignTransaction.ts +1 -1
package/src/inject.ts CHANGED
@@ -214,6 +214,11 @@ export const inject = ({
214
214
  call({ ...params, connectId, deviceId, method: 'cardanoGetPublicKey' }),
215
215
  cardanoSignTransaction: (connectId, deviceId, params) =>
216
216
  call({ ...params, connectId, deviceId, method: 'cardanoSignTransaction' }),
217
+
218
+ filecoinGetAddress: (connectId, deviceId, params) =>
219
+ call({ ...params, connectId, deviceId, method: 'filecoinGetAddress' }),
220
+ filecoinSignTransaction: (connectId, deviceId, params) =>
221
+ call({ ...params, connectId, deviceId, method: 'filecoinSignTransaction' }),
217
222
  };
218
223
  return api;
219
224
  };
@@ -99,7 +99,6 @@ export type CardanoOutput = (
99
99
  amount: string;
100
100
  tokenBundle?: CardanoAssetGroup[];
101
101
  datumHash?: string;
102
- // @ts-expect-error
103
102
  format?: PROTO.CardanoTxOutputSerializationFormat;
104
103
  inlineDatum?: string;
105
104
  referenceScript?: string;
@@ -8,6 +8,7 @@ export type EVMAddress = {
8
8
  export type EVMGetAddressParams = {
9
9
  path: string | number[];
10
10
  showOnOneKey?: boolean;
11
+ chainId?: number;
11
12
  };
12
13
 
13
14
  export declare function evmGetAddress(
@@ -8,6 +8,7 @@ export type EVMPublicKey = {
8
8
  export type EVMGetPublicKeyParams = {
9
9
  path: string | number[];
10
10
  showOnOneKey?: boolean;
11
+ chainId?: number;
11
12
  };
12
13
 
13
14
  export declare function evmGetPublicKey(
@@ -4,6 +4,7 @@ import type { CommonParams, Response } from '../params';
4
4
  export type EVMSignMessageParams = {
5
5
  path: string | number[];
6
6
  messageHex: string;
7
+ chainId?: number;
7
8
  };
8
9
 
9
10
  export declare function evmSignMessage(
@@ -32,6 +32,7 @@ export type EVMSignTypedDataParams = {
32
32
  data: EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>;
33
33
  domainHash?: string;
34
34
  messageHash?: string;
35
+ chainId?: number;
35
36
  };
36
37
 
37
38
  export declare function evmSignTypedData(
@@ -5,6 +5,7 @@ export type EVMVerifyMessageParams = {
5
5
  address: string;
6
6
  messageHex: string;
7
7
  signature: string;
8
+ chainId?: number;
8
9
  };
9
10
 
10
11
  export declare function evmVerifyMessage(
@@ -118,3 +118,6 @@ export type {
118
118
  } from './cardanoGetAddress';
119
119
 
120
120
  export type { CardanoSignTransaction, CardanoSignedTxData } from './cardano';
121
+
122
+ export type { FilecoinAddress, FilecoinGetAddressParams } from './filecoinGetAddress';
123
+ export type { FilecoinSignTransactionParams, FilecoinSignedTx } from './filecoinSignTransaction';
@@ -0,0 +1,23 @@
1
+ import { FilecoinAddress as HardwareFilecoinAddress } from '@onekeyfe/hd-transport';
2
+ import type { CommonParams, Response } from '../params';
3
+
4
+ export type FilecoinAddress = {
5
+ path: string;
6
+ } & HardwareFilecoinAddress;
7
+
8
+ export type FilecoinGetAddressParams = {
9
+ path: string | number[];
10
+ showOnOneKey?: boolean;
11
+ };
12
+
13
+ export declare function filecoinGetAddress(
14
+ connectId: string,
15
+ deviceId: string,
16
+ params: CommonParams & FilecoinGetAddressParams
17
+ ): Response<FilecoinAddress>;
18
+
19
+ export declare function filecoinGetAddress(
20
+ connectId: string,
21
+ deviceId: string,
22
+ params: CommonParams & { bundle?: FilecoinGetAddressParams[] }
23
+ ): Response<Array<FilecoinAddress>>;
@@ -0,0 +1,23 @@
1
+ import { FilecoinSignedTx as HardwareFilecoinSignedTx } from '@onekeyfe/hd-transport';
2
+ import type { CommonParams, Response } from '../params';
3
+
4
+ export type FilecoinSignedTx = {
5
+ path: string;
6
+ } & HardwareFilecoinSignedTx;
7
+
8
+ export type FilecoinSignTransactionParams = {
9
+ path: string | number[];
10
+ rawTx?: string;
11
+ };
12
+
13
+ export declare function filecoinSignTransaction(
14
+ connectId: string,
15
+ deviceId: string,
16
+ params: CommonParams & FilecoinSignTransactionParams
17
+ ): Response<FilecoinSignedTx>;
18
+
19
+ export declare function filecoinSignTransaction(
20
+ connectId: string,
21
+ deviceId: string,
22
+ params: CommonParams & { bundle?: FilecoinSignTransactionParams[] }
23
+ ): Response<Array<FilecoinSignedTx>>;
@@ -95,6 +95,9 @@ import { cardanoGetAddress } from './cardanoGetAddress';
95
95
  import { cardanoGetPublicKey } from './cardanoGetPublicKey';
96
96
  import { cardanoSignTransaction } from './cardanoSignTransaction';
97
97
 
98
+ import { filecoinGetAddress } from './filecoinGetAddress';
99
+ import { filecoinSignTransaction } from './filecoinSignTransaction';
100
+
98
101
  export * from './export';
99
102
 
100
103
  export type CoreApi = {
@@ -253,4 +256,10 @@ export type CoreApi = {
253
256
  cardanoGetAddress: typeof cardanoGetAddress;
254
257
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
255
258
  cardanoSignTransaction: typeof cardanoSignTransaction;
259
+
260
+ /**
261
+ * Filecoin function
262
+ */
263
+ filecoinGetAddress: typeof filecoinGetAddress;
264
+ filecoinSignTransaction: typeof filecoinSignTransaction;
256
265
  };
@@ -9,5 +9,5 @@ export type NearSignTransactionParams = {
9
9
  export declare function nearSignTransaction(
10
10
  connectId: string,
11
11
  deviceId: string,
12
- params: CommonParams & NearSignTransactionParams,
12
+ params: CommonParams & NearSignTransactionParams
13
13
  ): Response<NearSignedTx>;
@@ -13,11 +13,11 @@ export type TronGetAddressParams = {
13
13
  export declare function tronGetAddress(
14
14
  connectId: string,
15
15
  deviceId: string,
16
- params: CommonParams & TronGetAddressParams,
16
+ params: CommonParams & TronGetAddressParams
17
17
  ): Response<TronAddress>;
18
18
 
19
19
  export declare function tronGetAddress(
20
20
  connectId: string,
21
21
  deviceId: string,
22
- params: CommonParams & { bundle?: TronGetAddressParams[] },
22
+ params: CommonParams & { bundle?: TronGetAddressParams[] }
23
23
  ): Response<Array<TronAddress>>;
@@ -37,5 +37,5 @@ export type TronSignTransactionParams = {
37
37
  export declare function tronSignTransaction(
38
38
  connectId: string,
39
39
  deviceId: string,
40
- params: CommonParams & TronSignTransactionParams,
40
+ params: CommonParams & TronSignTransactionParams
41
41
  ): Response<TronSignedTx>;