@onekeyfe/hd-core 1.2.8-alpha.126 → 1.2.8-alpha.128

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 (81) hide show
  1. package/__tests__/allNetworkGetAddress-privacy-networks.test.ts +78 -0
  2. package/__tests__/logBlockEvent.test.ts +292 -0
  3. package/__tests__/monero-get-address.test.ts +147 -0
  4. package/__tests__/monero-key-image-sync.test.ts +272 -0
  5. package/__tests__/monero-sign-transaction.test.ts +436 -0
  6. package/__tests__/zcash-protobuf.test.ts +141 -0
  7. package/__tests__/zcash-sign-pczt.test.ts +446 -0
  8. package/dist/api/BaseMethod.d.ts.map +1 -1
  9. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  10. package/dist/api/helpers/pathUtils.d.ts +1 -0
  11. package/dist/api/helpers/pathUtils.d.ts.map +1 -1
  12. package/dist/api/index.d.ts +6 -0
  13. package/dist/api/index.d.ts.map +1 -1
  14. package/dist/api/monero/MoneroGetAddress.d.ts +11 -0
  15. package/dist/api/monero/MoneroGetAddress.d.ts.map +1 -0
  16. package/dist/api/monero/MoneroGetWatchKey.d.ts +11 -0
  17. package/dist/api/monero/MoneroGetWatchKey.d.ts.map +1 -0
  18. package/dist/api/monero/MoneroKeyImageSync.d.ts +20 -0
  19. package/dist/api/monero/MoneroKeyImageSync.d.ts.map +1 -0
  20. package/dist/api/monero/MoneroSignTransaction.d.ts +17 -0
  21. package/dist/api/monero/MoneroSignTransaction.d.ts.map +1 -0
  22. package/dist/api/monero/helpers.d.ts +5 -0
  23. package/dist/api/monero/helpers.d.ts.map +1 -0
  24. package/dist/api/zcash/ZcashGetAddress.d.ts +12 -0
  25. package/dist/api/zcash/ZcashGetAddress.d.ts.map +1 -0
  26. package/dist/api/zcash/ZcashSignPczt.d.ts +16 -0
  27. package/dist/api/zcash/ZcashSignPczt.d.ts.map +1 -0
  28. package/dist/core/index.d.ts.map +1 -1
  29. package/dist/events/logBlockEvent.d.ts +10 -0
  30. package/dist/events/logBlockEvent.d.ts.map +1 -1
  31. package/dist/events/ui-request.d.ts +1 -0
  32. package/dist/events/ui-request.d.ts.map +1 -1
  33. package/dist/index.d.ts +140 -4
  34. package/dist/index.js +866 -11
  35. package/dist/inject.d.ts.map +1 -1
  36. package/dist/types/api/allNetworkGetAddress.d.ts +5 -1
  37. package/dist/types/api/allNetworkGetAddress.d.ts.map +1 -1
  38. package/dist/types/api/export.d.ts +6 -0
  39. package/dist/types/api/export.d.ts.map +1 -1
  40. package/dist/types/api/index.d.ts +12 -0
  41. package/dist/types/api/index.d.ts.map +1 -1
  42. package/dist/types/api/moneroGetAddress.d.ts +15 -0
  43. package/dist/types/api/moneroGetAddress.d.ts.map +1 -0
  44. package/dist/types/api/moneroGetWatchKey.d.ts +15 -0
  45. package/dist/types/api/moneroGetWatchKey.d.ts.map +1 -0
  46. package/dist/types/api/moneroKeyImageSync.d.ts +24 -0
  47. package/dist/types/api/moneroKeyImageSync.d.ts.map +1 -0
  48. package/dist/types/api/moneroSignTransaction.d.ts +32 -0
  49. package/dist/types/api/moneroSignTransaction.d.ts.map +1 -0
  50. package/dist/types/api/zcashGetAddress.d.ts +22 -0
  51. package/dist/types/api/zcashGetAddress.d.ts.map +1 -0
  52. package/dist/types/api/zcashSignPczt.d.ts +9 -0
  53. package/dist/types/api/zcashSignPczt.d.ts.map +1 -0
  54. package/dist/utils/patch.d.ts +1 -1
  55. package/dist/utils/patch.d.ts.map +1 -1
  56. package/package.json +4 -4
  57. package/src/api/BaseMethod.ts +2 -0
  58. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +38 -1
  59. package/src/api/helpers/pathUtils.ts +23 -0
  60. package/src/api/index.ts +7 -0
  61. package/src/api/monero/MoneroGetAddress.ts +71 -0
  62. package/src/api/monero/MoneroGetWatchKey.ts +69 -0
  63. package/src/api/monero/MoneroKeyImageSync.ts +164 -0
  64. package/src/api/monero/MoneroSignTransaction.ts +319 -0
  65. package/src/api/monero/helpers.ts +28 -0
  66. package/src/api/zcash/ZcashGetAddress.ts +119 -0
  67. package/src/api/zcash/ZcashSignPczt.ts +152 -0
  68. package/src/core/index.ts +4 -3
  69. package/src/data/messages/messages-protocol-v2.json +138 -1
  70. package/src/events/logBlockEvent.ts +55 -3
  71. package/src/events/ui-request.ts +1 -0
  72. package/src/inject.ts +13 -0
  73. package/src/types/api/allNetworkGetAddress.ts +9 -1
  74. package/src/types/api/export.ts +15 -0
  75. package/src/types/api/index.ts +20 -0
  76. package/src/types/api/moneroGetAddress.ts +27 -0
  77. package/src/types/api/moneroGetWatchKey.ts +28 -0
  78. package/src/types/api/moneroKeyImageSync.ts +45 -0
  79. package/src/types/api/moneroSignTransaction.ts +54 -0
  80. package/src/types/api/zcashGetAddress.ts +35 -0
  81. package/src/types/api/zcashSignPczt.ts +18 -0
@@ -0,0 +1,54 @@
1
+ import type { MoneroTransactionData, MoneroTransactionSourceEntry } from '@onekeyfe/hd-transport';
2
+ import type { CommonParams, Response } from '../params';
3
+
4
+ export type MoneroSignTransactionParams = {
5
+ // Account path, m/44'/128'/account'
6
+ path: string | number[];
7
+ // 0 mainnet, 1 testnet, 2 stagenet
8
+ networkType?: number;
9
+ // Init data in protobuf field names; outputs include the change, in final order
10
+ tsxData: MoneroTransactionData;
11
+ // One source entry per input, in original order, each with its full ring
12
+ inputs: MoneroTransactionSourceEntry[];
13
+ };
14
+
15
+ // Raw device output, hex unless noted. The host assembles the transaction.
16
+ export type MoneroSignTransactionResult = {
17
+ // Original input index of each sorted input
18
+ origIndices: number[];
19
+ // Serialized tx.vin entries, sorted by key image (descending)
20
+ vinis: string[];
21
+ // Pseudo-output commitments from SignInputAck, sorted order
22
+ pseudoOuts: string[];
23
+ // Sealed CLSAG signatures, sorted order; openingKey unseals them
24
+ signatures: string[];
25
+ // Serialized tx.vout entries, output order
26
+ txOuts: string[];
27
+ // Output key and commitment (64 bytes each), output order
28
+ outPks: string[];
29
+ // Encrypted 8-byte amounts, output order
30
+ ecdhInfos: string[];
31
+ // Aggregated Bulletproof+ without V
32
+ rsig: string;
33
+ extra: string;
34
+ txPrefixHash: string;
35
+ fullMessageHash: string;
36
+ rv: {
37
+ // Decimal piconero
38
+ txnFee: string;
39
+ message: string;
40
+ rvType: number;
41
+ };
42
+ openingKey: string;
43
+ // Tx private keys sealed by the device for later proofs (MoneroGetTxKeyRequest), with the
44
+ // salts that rederive the sealing key; wallet2 keeps them as salt1, salt2, enc_keys
45
+ salt: string;
46
+ randMult: string;
47
+ txEncKeys: string;
48
+ };
49
+
50
+ export declare function moneroSignTransaction(
51
+ connectId: string,
52
+ deviceId: string,
53
+ params: CommonParams & MoneroSignTransactionParams
54
+ ): Response<MoneroSignTransactionResult>;
@@ -0,0 +1,35 @@
1
+ import type { ZcashAddressScope, ZcashAddressType } from '@onekeyfe/hd-transport';
2
+ import type { CommonParams, Response } from '../params';
3
+
4
+ export type ZcashAddress = {
5
+ path: string;
6
+ // ZIP-316 unified address or transparent P2PKH address
7
+ address: string;
8
+ // ZIP-316 unified full viewing key, present when includeUfvk was requested
9
+ ufvk?: string;
10
+ // ZIP-32 seed fingerprint (hex), present when includeSeedFingerprint was requested
11
+ seedFingerprint?: string;
12
+ };
13
+
14
+ export type ZcashGetAddressParams = {
15
+ // ZIP-32 account path, m/32'/133'/account'
16
+ path: string | number[];
17
+ showOnOneKey?: boolean;
18
+ diversifierIndex?: number;
19
+ addressType?: ZcashAddressType;
20
+ scope?: ZcashAddressScope;
21
+ includeUfvk?: boolean;
22
+ includeSeedFingerprint?: boolean;
23
+ };
24
+
25
+ export declare function zcashGetAddress(
26
+ connectId: string,
27
+ deviceId: string,
28
+ params: CommonParams & ZcashGetAddressParams
29
+ ): Response<ZcashAddress>;
30
+
31
+ export declare function zcashGetAddress(
32
+ connectId: string,
33
+ deviceId: string,
34
+ params: CommonParams & { bundle?: ZcashGetAddressParams[] }
35
+ ): Response<Array<ZcashAddress>>;
@@ -0,0 +1,18 @@
1
+ import type { CommonParams, Response } from '../params';
2
+
3
+ export type ZcashSignPcztParams = {
4
+ // Unproved PCZT (v2, tx v6) as hex; the device signs it and returns a
5
+ // redacted copy with signatures filled in.
6
+ pczt: string;
7
+ };
8
+
9
+ export type ZcashSignedPczt = {
10
+ // Signed, redacted PCZT as hex
11
+ pczt: string;
12
+ };
13
+
14
+ export declare function zcashSignPczt(
15
+ connectId: string,
16
+ deviceId: string,
17
+ params: CommonParams & ZcashSignPcztParams
18
+ ): Response<ZcashSignedPczt>;