@onekeyfe/hd-core 1.2.8-alpha.125 → 1.2.8-alpha.127
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/__tests__/allNetworkGetAddress-privacy-networks.test.ts +78 -0
- package/__tests__/logBlockEvent.test.ts +292 -0
- package/__tests__/monero-get-address.test.ts +147 -0
- package/__tests__/monero-key-image-sync.test.ts +272 -0
- package/__tests__/monero-sign-transaction.test.ts +436 -0
- package/__tests__/zcash-protobuf.test.ts +141 -0
- package/__tests__/zcash-sign-pczt.test.ts +446 -0
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
- package/dist/api/helpers/pathUtils.d.ts +1 -0
- package/dist/api/helpers/pathUtils.d.ts.map +1 -1
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/monero/MoneroGetAddress.d.ts +11 -0
- package/dist/api/monero/MoneroGetAddress.d.ts.map +1 -0
- package/dist/api/monero/MoneroGetWatchKey.d.ts +11 -0
- package/dist/api/monero/MoneroGetWatchKey.d.ts.map +1 -0
- package/dist/api/monero/MoneroKeyImageSync.d.ts +20 -0
- package/dist/api/monero/MoneroKeyImageSync.d.ts.map +1 -0
- package/dist/api/monero/MoneroSignTransaction.d.ts +17 -0
- package/dist/api/monero/MoneroSignTransaction.d.ts.map +1 -0
- package/dist/api/monero/helpers.d.ts +5 -0
- package/dist/api/monero/helpers.d.ts.map +1 -0
- package/dist/api/zcash/ZcashGetAddress.d.ts +12 -0
- package/dist/api/zcash/ZcashGetAddress.d.ts.map +1 -0
- package/dist/api/zcash/ZcashSignPczt.d.ts +16 -0
- package/dist/api/zcash/ZcashSignPczt.d.ts.map +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/events/logBlockEvent.d.ts +10 -0
- package/dist/events/logBlockEvent.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +1 -0
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +140 -4
- package/dist/index.js +866 -11
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/allNetworkGetAddress.d.ts +5 -1
- package/dist/types/api/allNetworkGetAddress.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +6 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +12 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/moneroGetAddress.d.ts +15 -0
- package/dist/types/api/moneroGetAddress.d.ts.map +1 -0
- package/dist/types/api/moneroGetWatchKey.d.ts +15 -0
- package/dist/types/api/moneroGetWatchKey.d.ts.map +1 -0
- package/dist/types/api/moneroKeyImageSync.d.ts +24 -0
- package/dist/types/api/moneroKeyImageSync.d.ts.map +1 -0
- package/dist/types/api/moneroSignTransaction.d.ts +32 -0
- package/dist/types/api/moneroSignTransaction.d.ts.map +1 -0
- package/dist/types/api/zcashGetAddress.d.ts +22 -0
- package/dist/types/api/zcashGetAddress.d.ts.map +1 -0
- package/dist/types/api/zcashSignPczt.d.ts +9 -0
- package/dist/types/api/zcashSignPczt.d.ts.map +1 -0
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +2 -0
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +38 -1
- package/src/api/helpers/pathUtils.ts +23 -0
- package/src/api/index.ts +7 -0
- package/src/api/monero/MoneroGetAddress.ts +71 -0
- package/src/api/monero/MoneroGetWatchKey.ts +69 -0
- package/src/api/monero/MoneroKeyImageSync.ts +164 -0
- package/src/api/monero/MoneroSignTransaction.ts +319 -0
- package/src/api/monero/helpers.ts +28 -0
- package/src/api/zcash/ZcashGetAddress.ts +119 -0
- package/src/api/zcash/ZcashSignPczt.ts +152 -0
- package/src/core/index.ts +4 -3
- package/src/data/messages/messages-protocol-v2.json +138 -1
- package/src/events/logBlockEvent.ts +55 -3
- package/src/events/ui-request.ts +1 -0
- package/src/inject.ts +13 -0
- package/src/types/api/allNetworkGetAddress.ts +9 -1
- package/src/types/api/export.ts +15 -0
- package/src/types/api/index.ts +20 -0
- package/src/types/api/moneroGetAddress.ts +27 -0
- package/src/types/api/moneroGetWatchKey.ts +28 -0
- package/src/types/api/moneroKeyImageSync.ts +45 -0
- package/src/types/api/moneroSignTransaction.ts +54 -0
- package/src/types/api/zcashGetAddress.ts +35 -0
- 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>;
|