@onekeyfe/hd-core 1.2.8-alpha.110 → 1.2.8-alpha.111
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__/logBlockEvent.test.ts +43 -0
- package/__tests__/search-devices.test.ts +0 -36
- package/__tests__/zcash-protobuf.test.ts +141 -0
- package/__tests__/zcash-sign-pczt.test.ts +387 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- 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/events/logBlockEvent.d.ts.map +1 -1
- package/dist/index.d.ts +36 -9
- package/dist/index.js +329 -2
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +2 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +4 -0
- package/dist/types/api/index.d.ts.map +1 -1
- 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/types/device.d.ts +0 -1
- package/dist/types/device.d.ts.map +1 -1
- 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/index.ts +2 -0
- package/src/api/zcash/ZcashGetAddress.ts +121 -0
- package/src/api/zcash/ZcashSignPczt.ts +155 -0
- package/src/data/messages/messages-protocol-v2.json +138 -1
- package/src/events/logBlockEvent.ts +4 -2
- package/src/inject.ts +4 -0
- package/src/types/api/export.ts +2 -0
- package/src/types/api/index.ts +8 -0
- package/src/types/api/zcashGetAddress.ts +36 -0
- package/src/types/api/zcashSignPczt.ts +18 -0
- package/src/types/device.ts +0 -6
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { bytesToHex } from '@noble/hashes/utils';
|
|
2
|
+
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
3
|
+
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { invalidParameter, validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { stripHexPrefix } from '../helpers/hexUtils';
|
|
7
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
8
|
+
|
|
9
|
+
import type { ZcashSignPczt as HardwareZcashSignPczt } from '@onekeyfe/hd-transport';
|
|
10
|
+
import type { TypedCall, TypedResponseMessage } from '../../device/DeviceCommands';
|
|
11
|
+
import type { ZcashSignedPczt } from '../../types/api/zcashSignPczt';
|
|
12
|
+
import type { DeviceFirmwareRange } from '../../types';
|
|
13
|
+
|
|
14
|
+
const CHUNK_BYTE_SIZE = 1024;
|
|
15
|
+
// Host memory sanity bound on the device-announced length, not a device limit.
|
|
16
|
+
const SIGNED_PCZT_SANITY_MAX_BYTES = 16 * 1024 * 1024;
|
|
17
|
+
|
|
18
|
+
export default class ZcashSignPczt extends BaseMethod<HardwareZcashSignPczt> {
|
|
19
|
+
pczt: Buffer = Buffer.alloc(0);
|
|
20
|
+
|
|
21
|
+
getSupportedProtocols() {
|
|
22
|
+
return ['V2'] as const;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
init() {
|
|
26
|
+
this.checkDeviceId = true;
|
|
27
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
28
|
+
this.strictCheckDeviceSupport = true;
|
|
29
|
+
|
|
30
|
+
validateParams(this.payload, [{ name: 'pczt', type: 'hexString', required: true }]);
|
|
31
|
+
|
|
32
|
+
// Reject odd-length hex instead of left-padding it, which would shift every nibble.
|
|
33
|
+
const pcztHex = stripHexPrefix(this.payload.pczt);
|
|
34
|
+
if (pcztHex.length % 2 !== 0) {
|
|
35
|
+
throw invalidParameter('pczt hex must have an even length');
|
|
36
|
+
}
|
|
37
|
+
this.pczt = Buffer.from(pcztHex, 'hex');
|
|
38
|
+
if (this.pczt.length === 0) {
|
|
39
|
+
throw invalidParameter('pczt is empty');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
this.params = {
|
|
43
|
+
pczt_length: this.pczt.length,
|
|
44
|
+
pczt_initial_chunk: bytesToHex(this.pczt.subarray(0, CHUNK_BYTE_SIZE)),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
getVersionRange(): DeviceFirmwareRange {
|
|
49
|
+
return {
|
|
50
|
+
model_pro2: {
|
|
51
|
+
min: '0.0.0',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Upload: the device decides every chunk length via ZcashPcztChunkRequest and
|
|
57
|
+
// the host must answer with exactly that many bytes.
|
|
58
|
+
uploadPczt = async (
|
|
59
|
+
typedCall: TypedCall,
|
|
60
|
+
res: TypedResponseMessage<'ZcashSignedPczt'> | TypedResponseMessage<'ZcashPcztChunkRequest'>,
|
|
61
|
+
offset: number
|
|
62
|
+
): Promise<TypedResponseMessage<'ZcashSignedPczt'>> => {
|
|
63
|
+
if (res.type === 'ZcashSignedPczt') {
|
|
64
|
+
if (offset !== this.pczt.length) {
|
|
65
|
+
throw ERRORS.TypedError(
|
|
66
|
+
HardwareErrorCode.ResponseUnexpectTypeError,
|
|
67
|
+
'device completed signing before receiving the whole pczt'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return res;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const { chunk_length: chunkLength } = res.message;
|
|
74
|
+
if (
|
|
75
|
+
!Number.isSafeInteger(chunkLength) ||
|
|
76
|
+
chunkLength <= 0 ||
|
|
77
|
+
offset + chunkLength > this.pczt.length
|
|
78
|
+
) {
|
|
79
|
+
throw ERRORS.TypedError(
|
|
80
|
+
HardwareErrorCode.ResponseUnexpectTypeError,
|
|
81
|
+
`device requested ${chunkLength} bytes at offset ${offset} of ${this.pczt.length}`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const chunk = this.pczt.subarray(offset, offset + chunkLength);
|
|
86
|
+
const next = await typedCall(
|
|
87
|
+
'ZcashPcztChunkAck',
|
|
88
|
+
['ZcashSignedPczt', 'ZcashPcztChunkRequest'],
|
|
89
|
+
{
|
|
90
|
+
data_chunk: bytesToHex(chunk),
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
return this.uploadPczt(typedCall, next, offset + chunkLength);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// Download: the host decides chunk lengths via ZcashSignedPcztChunkRequest
|
|
98
|
+
// until the announced pczt_length has been received.
|
|
99
|
+
downloadSignedPczt = async (
|
|
100
|
+
typedCall: TypedCall,
|
|
101
|
+
res: TypedResponseMessage<'ZcashSignedPczt'>
|
|
102
|
+
): Promise<Buffer> => {
|
|
103
|
+
const { pczt_length: total, pczt_initial_chunk: initial } = res.message;
|
|
104
|
+
if (!Number.isSafeInteger(total) || total <= 0 || total > SIGNED_PCZT_SANITY_MAX_BYTES) {
|
|
105
|
+
throw ERRORS.TypedError(
|
|
106
|
+
HardwareErrorCode.ResponseUnexpectTypeError,
|
|
107
|
+
`device announced invalid signed pczt length ${total}`
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const parts: Buffer[] = [Buffer.from(initial ?? '', 'hex')];
|
|
112
|
+
let received = parts[0].length;
|
|
113
|
+
if (received > total) {
|
|
114
|
+
throw ERRORS.TypedError(
|
|
115
|
+
HardwareErrorCode.ResponseUnexpectTypeError,
|
|
116
|
+
'device returned more initial pczt bytes than announced'
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
while (received < total) {
|
|
121
|
+
const chunkLength = Math.min(CHUNK_BYTE_SIZE, total - received);
|
|
122
|
+
const ack = await typedCall('ZcashSignedPcztChunkRequest', 'ZcashPcztChunkAck', {
|
|
123
|
+
chunk_length: chunkLength,
|
|
124
|
+
});
|
|
125
|
+
const chunk = Buffer.from(ack.message.data_chunk ?? '', 'hex');
|
|
126
|
+
if (chunk.length !== chunkLength) {
|
|
127
|
+
throw ERRORS.TypedError(
|
|
128
|
+
HardwareErrorCode.ResponseUnexpectTypeError,
|
|
129
|
+
`device returned ${chunk.length} of ${chunkLength} requested bytes at offset ${received} of ${total}`
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
parts.push(chunk);
|
|
133
|
+
received += chunk.length;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return Buffer.concat(parts);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
async run(): Promise<ZcashSignedPczt> {
|
|
140
|
+
const typedCall = this.device.getCommands().typedCall.bind(this.device.getCommands());
|
|
141
|
+
|
|
142
|
+
const first = await typedCall('ZcashSignPczt', ['ZcashSignedPczt', 'ZcashPcztChunkRequest'], {
|
|
143
|
+
...this.params,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const signed = await this.uploadPczt(
|
|
147
|
+
typedCall,
|
|
148
|
+
first,
|
|
149
|
+
Math.min(CHUNK_BYTE_SIZE, this.pczt.length)
|
|
150
|
+
);
|
|
151
|
+
const pczt = await this.downloadSignedPczt(typedCall, signed);
|
|
152
|
+
|
|
153
|
+
return { pczt: bytesToHex(pczt) };
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -11034,6 +11034,61 @@
|
|
|
11034
11034
|
}
|
|
11035
11035
|
}
|
|
11036
11036
|
},
|
|
11037
|
+
"ZcashSignPczt": {
|
|
11038
|
+
"fields": {
|
|
11039
|
+
"pczt_length": {
|
|
11040
|
+
"rule": "required",
|
|
11041
|
+
"type": "uint32",
|
|
11042
|
+
"id": 1
|
|
11043
|
+
},
|
|
11044
|
+
"pczt_initial_chunk": {
|
|
11045
|
+
"rule": "required",
|
|
11046
|
+
"type": "bytes",
|
|
11047
|
+
"id": 2
|
|
11048
|
+
}
|
|
11049
|
+
}
|
|
11050
|
+
},
|
|
11051
|
+
"ZcashPcztChunkRequest": {
|
|
11052
|
+
"fields": {
|
|
11053
|
+
"chunk_length": {
|
|
11054
|
+
"rule": "required",
|
|
11055
|
+
"type": "uint32",
|
|
11056
|
+
"id": 1
|
|
11057
|
+
}
|
|
11058
|
+
}
|
|
11059
|
+
},
|
|
11060
|
+
"ZcashPcztChunkAck": {
|
|
11061
|
+
"fields": {
|
|
11062
|
+
"data_chunk": {
|
|
11063
|
+
"rule": "required",
|
|
11064
|
+
"type": "bytes",
|
|
11065
|
+
"id": 1
|
|
11066
|
+
}
|
|
11067
|
+
}
|
|
11068
|
+
},
|
|
11069
|
+
"ZcashSignedPczt": {
|
|
11070
|
+
"fields": {
|
|
11071
|
+
"pczt_length": {
|
|
11072
|
+
"rule": "required",
|
|
11073
|
+
"type": "uint32",
|
|
11074
|
+
"id": 1
|
|
11075
|
+
},
|
|
11076
|
+
"pczt_initial_chunk": {
|
|
11077
|
+
"rule": "required",
|
|
11078
|
+
"type": "bytes",
|
|
11079
|
+
"id": 2
|
|
11080
|
+
}
|
|
11081
|
+
}
|
|
11082
|
+
},
|
|
11083
|
+
"ZcashSignedPcztChunkRequest": {
|
|
11084
|
+
"fields": {
|
|
11085
|
+
"chunk_length": {
|
|
11086
|
+
"rule": "required",
|
|
11087
|
+
"type": "uint32",
|
|
11088
|
+
"id": 1
|
|
11089
|
+
}
|
|
11090
|
+
}
|
|
11091
|
+
},
|
|
11037
11092
|
"wire_in": {
|
|
11038
11093
|
"type": "bool",
|
|
11039
11094
|
"id": 50002,
|
|
@@ -11459,6 +11514,11 @@
|
|
|
11459
11514
|
"MessageType_NeoAddress": 12302,
|
|
11460
11515
|
"MessageType_NeoSignTx": 12303,
|
|
11461
11516
|
"MessageType_NeoSignedTx": 12304,
|
|
11517
|
+
"MessageType_ZcashSignPczt": 12402,
|
|
11518
|
+
"MessageType_ZcashSignedPczt": 12403,
|
|
11519
|
+
"MessageType_ZcashPcztChunkRequest": 12404,
|
|
11520
|
+
"MessageType_ZcashPcztChunkAck": 12405,
|
|
11521
|
+
"MessageType_ZcashSignedPcztChunkRequest": 12406,
|
|
11462
11522
|
"MessageType_DeviceFactoryInfoSet": 60000,
|
|
11463
11523
|
"MessageType_DeviceFactoryInfoGet": 60001,
|
|
11464
11524
|
"MessageType_DeviceFactoryInfo": 60002,
|
|
@@ -11511,7 +11571,9 @@
|
|
|
11511
11571
|
"MessageType_PortfolioUpdate": 61400,
|
|
11512
11572
|
"MessageType_NftUpdate": 61500,
|
|
11513
11573
|
"MessageType_OnboardingStatusGet": 61600,
|
|
11514
|
-
"MessageType_OnboardingStatus": 61601
|
|
11574
|
+
"MessageType_OnboardingStatus": 61601,
|
|
11575
|
+
"MessageType_ZcashGetAddress": 12400,
|
|
11576
|
+
"MessageType_ZcashAddress": 12401
|
|
11515
11577
|
},
|
|
11516
11578
|
"reserved": [
|
|
11517
11579
|
[90, 92],
|
|
@@ -13730,6 +13792,81 @@
|
|
|
13730
13792
|
}
|
|
13731
13793
|
}
|
|
13732
13794
|
}
|
|
13795
|
+
},
|
|
13796
|
+
"ZcashAddressType": {
|
|
13797
|
+
"values": {
|
|
13798
|
+
"UNIFIED_ORCHARD_P2PKH": 0,
|
|
13799
|
+
"TRANSPARENT_P2PKH": 1,
|
|
13800
|
+
"UNIFIED_ORCHARD": 2
|
|
13801
|
+
}
|
|
13802
|
+
},
|
|
13803
|
+
"ZcashAddressScope": {
|
|
13804
|
+
"values": {
|
|
13805
|
+
"EXTERNAL": 0,
|
|
13806
|
+
"INTERNAL": 1
|
|
13807
|
+
}
|
|
13808
|
+
},
|
|
13809
|
+
"ZcashGetAddress": {
|
|
13810
|
+
"fields": {
|
|
13811
|
+
"address_n": {
|
|
13812
|
+
"rule": "repeated",
|
|
13813
|
+
"type": "uint32",
|
|
13814
|
+
"id": 1,
|
|
13815
|
+
"options": {
|
|
13816
|
+
"packed": false
|
|
13817
|
+
}
|
|
13818
|
+
},
|
|
13819
|
+
"show_display": {
|
|
13820
|
+
"type": "bool",
|
|
13821
|
+
"id": 2
|
|
13822
|
+
},
|
|
13823
|
+
"include_seed_fingerprint": {
|
|
13824
|
+
"type": "bool",
|
|
13825
|
+
"id": 3
|
|
13826
|
+
},
|
|
13827
|
+
"include_ufvk": {
|
|
13828
|
+
"type": "bool",
|
|
13829
|
+
"id": 4
|
|
13830
|
+
},
|
|
13831
|
+
"diversifier_index": {
|
|
13832
|
+
"type": "uint32",
|
|
13833
|
+
"id": 5,
|
|
13834
|
+
"options": {
|
|
13835
|
+
"default": 0
|
|
13836
|
+
}
|
|
13837
|
+
},
|
|
13838
|
+
"address_type": {
|
|
13839
|
+
"type": "ZcashAddressType",
|
|
13840
|
+
"id": 6,
|
|
13841
|
+
"options": {
|
|
13842
|
+
"default": "UNIFIED_ORCHARD_P2PKH"
|
|
13843
|
+
}
|
|
13844
|
+
},
|
|
13845
|
+
"scope": {
|
|
13846
|
+
"type": "ZcashAddressScope",
|
|
13847
|
+
"id": 7,
|
|
13848
|
+
"options": {
|
|
13849
|
+
"default": "EXTERNAL"
|
|
13850
|
+
}
|
|
13851
|
+
}
|
|
13852
|
+
}
|
|
13853
|
+
},
|
|
13854
|
+
"ZcashAddress": {
|
|
13855
|
+
"fields": {
|
|
13856
|
+
"address": {
|
|
13857
|
+
"rule": "required",
|
|
13858
|
+
"type": "string",
|
|
13859
|
+
"id": 1
|
|
13860
|
+
},
|
|
13861
|
+
"ufvk": {
|
|
13862
|
+
"type": "string",
|
|
13863
|
+
"id": 2
|
|
13864
|
+
},
|
|
13865
|
+
"seed_fingerprint": {
|
|
13866
|
+
"type": "bytes",
|
|
13867
|
+
"id": 3
|
|
13868
|
+
}
|
|
13869
|
+
}
|
|
13733
13870
|
}
|
|
13734
13871
|
}
|
|
13735
13872
|
}
|
|
@@ -8,8 +8,8 @@ export const LogBlockEvent: Set<string> = new Set([
|
|
|
8
8
|
UI_RESPONSE.RECEIVE_PASSPHRASE,
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
//
|
|
11
|
+
// Drop sensitive wallet payloads and large resource data before logger caches
|
|
12
|
+
// or log events can retain them, regardless of whether debug output is enabled.
|
|
13
13
|
const LogPayloadBlockMethod: Set<string> = new Set([
|
|
14
14
|
'btcDeriveContextHash',
|
|
15
15
|
'deviceUploadNft',
|
|
@@ -17,6 +17,8 @@ const LogPayloadBlockMethod: Set<string> = new Set([
|
|
|
17
17
|
'uploadPortfolio',
|
|
18
18
|
'fileWrite',
|
|
19
19
|
'fileRead',
|
|
20
|
+
'zcashGetAddress',
|
|
21
|
+
'zcashSignPczt',
|
|
20
22
|
]);
|
|
21
23
|
|
|
22
24
|
export function getLogBlockLabel(message: unknown): string | undefined {
|
package/src/inject.ts
CHANGED
|
@@ -504,4 +504,8 @@ export const createCoreApi = (
|
|
|
504
504
|
call({ ...params, connectId, deviceId, method: 'neoGetAddress' }),
|
|
505
505
|
neoSignTransaction: (connectId, deviceId, params) =>
|
|
506
506
|
call({ ...params, connectId, deviceId, method: 'neoSignTransaction' }),
|
|
507
|
+
zcashGetAddress: (connectId, deviceId, params) =>
|
|
508
|
+
call({ ...params, connectId, deviceId, method: 'zcashGetAddress' }),
|
|
509
|
+
zcashSignPczt: (connectId, deviceId, params) =>
|
|
510
|
+
call({ ...params, connectId, deviceId, method: 'zcashSignPczt' }),
|
|
507
511
|
});
|
package/src/types/api/export.ts
CHANGED
|
@@ -227,3 +227,5 @@ export type { BenfenAddress, BenfenGetAddressParams } from './benfenGetAddress';
|
|
|
227
227
|
export type { BenfenPublicKey, BenfenGetPublicKeyParams } from './benfenGetPublicKey';
|
|
228
228
|
export type { BenfenSignMessageParams } from './benfenSignMessage';
|
|
229
229
|
export type { BenfenSignedTx, BenfenSignTransactionParams } from './benfenSignTransaction';
|
|
230
|
+
export type { ZcashAddress, ZcashGetAddressParams } from './zcashGetAddress';
|
|
231
|
+
export type { ZcashSignedPczt, ZcashSignPcztParams } from './zcashSignPczt';
|
package/src/types/api/index.ts
CHANGED
|
@@ -154,6 +154,8 @@ import type { benfenSignTransaction } from './benfenSignTransaction';
|
|
|
154
154
|
import type { benfenSignMessage } from './benfenSignMessage';
|
|
155
155
|
import type { neoGetAddress } from './neoGetAddress';
|
|
156
156
|
import type { neoSignTransaction } from './neoSignTransaction';
|
|
157
|
+
import type { zcashGetAddress } from './zcashGetAddress';
|
|
158
|
+
import type { zcashSignPczt } from './zcashSignPczt';
|
|
157
159
|
import type { ConnectSettings } from '../settings';
|
|
158
160
|
import type { HardwareConnectProtocol } from '@onekeyfe/hd-shared';
|
|
159
161
|
|
|
@@ -472,4 +474,10 @@ export type CoreApi = {
|
|
|
472
474
|
*/
|
|
473
475
|
neoGetAddress: typeof neoGetAddress;
|
|
474
476
|
neoSignTransaction: typeof neoSignTransaction;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Zcash
|
|
480
|
+
*/
|
|
481
|
+
zcashGetAddress: typeof zcashGetAddress;
|
|
482
|
+
zcashSignPczt: typeof zcashSignPczt;
|
|
475
483
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ZcashAddressScope, ZcashAddressType } from '@onekeyfe/hd-transport';
|
|
2
|
+
|
|
3
|
+
import type { CommonParams, Response } from '../params';
|
|
4
|
+
|
|
5
|
+
export type ZcashAddress = {
|
|
6
|
+
path: string;
|
|
7
|
+
// ZIP-316 unified address or transparent P2PKH address
|
|
8
|
+
address: string;
|
|
9
|
+
// ZIP-316 unified full viewing key, present when includeUfvk was requested
|
|
10
|
+
ufvk?: string;
|
|
11
|
+
// ZIP-32 seed fingerprint (hex), present when includeSeedFingerprint was requested
|
|
12
|
+
seedFingerprint?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type ZcashGetAddressParams = {
|
|
16
|
+
// ZIP-32 account path, m/32'/133'/account'
|
|
17
|
+
path: string | number[];
|
|
18
|
+
showOnOneKey?: boolean;
|
|
19
|
+
diversifierIndex?: number;
|
|
20
|
+
addressType?: ZcashAddressType;
|
|
21
|
+
scope?: ZcashAddressScope;
|
|
22
|
+
includeUfvk?: boolean;
|
|
23
|
+
includeSeedFingerprint?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export declare function zcashGetAddress(
|
|
27
|
+
connectId: string,
|
|
28
|
+
deviceId: string,
|
|
29
|
+
params: CommonParams & ZcashGetAddressParams
|
|
30
|
+
): Response<ZcashAddress>;
|
|
31
|
+
|
|
32
|
+
export declare function zcashGetAddress(
|
|
33
|
+
connectId: string,
|
|
34
|
+
deviceId: string,
|
|
35
|
+
params: CommonParams & { bundle?: ZcashGetAddressParams[] }
|
|
36
|
+
): 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>;
|
package/src/types/device.ts
CHANGED
|
@@ -83,12 +83,6 @@ export type SearchDevice = {
|
|
|
83
83
|
deviceType: IDeviceType;
|
|
84
84
|
name: string;
|
|
85
85
|
commType: OneKeyDeviceCommType;
|
|
86
|
-
/**
|
|
87
|
-
* React Native and Electron BLE discovery only. Serial-number color letter ('A'-'Z')
|
|
88
|
-
* advertised by Pro2 / Neo, possibly remembered from an earlier advertisement in this
|
|
89
|
-
* process. Absent when unknown; the letter's meaning depends on deviceType.
|
|
90
|
-
*/
|
|
91
|
-
bleColorCode?: string;
|
|
92
86
|
};
|
|
93
87
|
|
|
94
88
|
/** Identity confirmed over USB. The descriptor path is only a transport address. */
|