@onekeyfe/hd-core 1.2.8-alpha.111 → 1.2.8-alpha.113
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 +0 -43
- package/__tests__/protocol-v2.test.ts +239 -0
- package/dist/api/FirmwareUpdateV4.d.ts +3 -0
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/index.d.ts +0 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/events/logBlockEvent.d.ts.map +1 -1
- package/dist/index.d.ts +3 -36
- package/dist/index.js +156 -365
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +0 -2
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +0 -4
- package/dist/types/api/index.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/FirmwareUpdateV4.ts +216 -51
- package/src/api/index.ts +0 -2
- package/src/data/messages/messages-protocol-v2.json +1 -138
- package/src/events/logBlockEvent.ts +2 -4
- package/src/inject.ts +0 -4
- package/src/types/api/export.ts +0 -2
- package/src/types/api/index.ts +0 -8
- package/__tests__/zcash-protobuf.test.ts +0 -141
- package/__tests__/zcash-sign-pczt.test.ts +0 -387
- package/dist/api/zcash/ZcashGetAddress.d.ts +0 -12
- package/dist/api/zcash/ZcashGetAddress.d.ts.map +0 -1
- package/dist/api/zcash/ZcashSignPczt.d.ts +0 -16
- package/dist/api/zcash/ZcashSignPczt.d.ts.map +0 -1
- package/dist/types/api/zcashGetAddress.d.ts +0 -22
- package/dist/types/api/zcashGetAddress.d.ts.map +0 -1
- package/dist/types/api/zcashSignPczt.d.ts +0 -9
- package/dist/types/api/zcashSignPczt.d.ts.map +0 -1
- package/src/api/zcash/ZcashGetAddress.ts +0 -121
- package/src/api/zcash/ZcashSignPczt.ts +0 -155
- package/src/types/api/zcashGetAddress.ts +0 -36
- package/src/types/api/zcashSignPczt.ts +0 -18
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { EDeviceType, ERRORS, HardwareError, HardwareErrorCode, wait } from '@onekeyfe/hd-shared';
|
|
2
2
|
import JSZip from 'jszip';
|
|
3
|
+
import semver from 'semver';
|
|
3
4
|
import {
|
|
4
5
|
DeviceRebootType,
|
|
5
6
|
DeviceSessionPinType,
|
|
6
7
|
PROTOCOL_V2_BLE_FILE_CHUNK_SIZE,
|
|
7
8
|
PROTOCOL_V2_BLE_FILE_READ_CHUNK_SIZE,
|
|
8
9
|
PROTOCOL_V2_BLE_FIRMWARE_FILE_CHUNK_SIZE,
|
|
10
|
+
PROTOCOL_V2_FILE_WRITE_PIPELINE_WINDOW,
|
|
9
11
|
PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE,
|
|
10
12
|
} from '@onekeyfe/hd-transport';
|
|
11
13
|
import { sha256 } from '@noble/hashes/sha256';
|
|
@@ -101,6 +103,14 @@ const PROTOCOL_V2_CONNECT_POLL_INTERVAL = 500;
|
|
|
101
103
|
const PROTOCOL_V2_CONNECT_SINGLE_TIMEOUT = 75 * 1000;
|
|
102
104
|
const PROTOCOL_V2_DEVICE_INFO_READY_TIMEOUT = 30 * 1000;
|
|
103
105
|
const PROTOCOL_V2_FILE_TRANSFER_RETRY_COUNT = 3;
|
|
106
|
+
// Bootloaders with the 2048-byte BLE UART FIFO have no room beside one waiting FileWrite
|
|
107
|
+
// frame, so a second in-flight write can overflow it and lose a chunk. Firmware has not yet
|
|
108
|
+
// confirmed which bootloader version ships the 4096-byte FIFO, nor that the BLE coprocessor
|
|
109
|
+
// queues absorb two back-to-back frames.
|
|
110
|
+
// TEST ONLY: 1.0.2 also matches released bootloaders with the 2048-byte FIFO, so this build
|
|
111
|
+
// must only update test devices flashed with the 4096-byte FIFO bootloader. Replace it with
|
|
112
|
+
// the first released version that ships the 4096-byte FIFO before any release.
|
|
113
|
+
const PROTOCOL_V2_BLE_FILE_WRITE_WINDOW_MIN_BOOTLOADER_VERSION: string | undefined = '1.0.2';
|
|
104
114
|
const PROTOCOL_V2_TRANSFER_PROGRESS_HEARTBEAT_MS = 1000;
|
|
105
115
|
const PROTOCOL_V2_INSTALL_STATUS_CONFLICT_CODE = 'FirmwareInstallStatusConflict';
|
|
106
116
|
const PROTOCOL_V2_INSTALL_FAILED_CODE = 'FirmwareInstallFailed';
|
|
@@ -170,6 +180,18 @@ export function assertProtocolV2FirmwareTargetsSupported(
|
|
|
170
180
|
throw ERRORS.TypedError(HardwareErrorCode.DeviceNotSupportMethod, message);
|
|
171
181
|
}
|
|
172
182
|
|
|
183
|
+
/** Whether the running bootloader accepts a second in-flight BLE FilesystemFileWrite. */
|
|
184
|
+
export function supportsProtocolV2BleFileWriteWindow(
|
|
185
|
+
bootloaderVersion: string,
|
|
186
|
+
minBootloaderVersion = PROTOCOL_V2_BLE_FILE_WRITE_WINDOW_MIN_BOOTLOADER_VERSION
|
|
187
|
+
) {
|
|
188
|
+
return (
|
|
189
|
+
!!minBootloaderVersion &&
|
|
190
|
+
!!semver.valid(bootloaderVersion) &&
|
|
191
|
+
semver.gte(bootloaderVersion, minBootloaderVersion)
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
173
195
|
const getProtocolV2DeviceTransferProgress = (
|
|
174
196
|
bytesBeforeChunk: number,
|
|
175
197
|
bytesAfterChunk: number,
|
|
@@ -2163,12 +2185,20 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
2163
2185
|
|
|
2164
2186
|
if (totalSize > 0) {
|
|
2165
2187
|
const elapsedMs = Math.max(Date.now() - transferStartedAt, 0);
|
|
2188
|
+
const rateBytesPerSecond =
|
|
2189
|
+
elapsedMs > 0 ? Math.round((totalSize / elapsedMs) * 1000) : undefined;
|
|
2166
2190
|
this.postProgressMessage(100, 'transferData', {
|
|
2167
2191
|
transferredBytes: totalSize,
|
|
2168
2192
|
totalBytes: totalSize,
|
|
2169
|
-
rateBytesPerSecond
|
|
2193
|
+
rateBytesPerSecond,
|
|
2170
2194
|
elapsedMs,
|
|
2171
2195
|
});
|
|
2196
|
+
Log.debug('[FirmwareUpdateV4] Protocol V2 transfer completed', {
|
|
2197
|
+
files: resourcesToSync.length + installSources.length,
|
|
2198
|
+
totalBytes: totalSize,
|
|
2199
|
+
elapsedMs,
|
|
2200
|
+
rateBytesPerSecond,
|
|
2201
|
+
});
|
|
2172
2202
|
}
|
|
2173
2203
|
if (stagedInstallTargets.length === 0) {
|
|
2174
2204
|
return;
|
|
@@ -2179,10 +2209,16 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
2179
2209
|
target_id: item.targetId,
|
|
2180
2210
|
path: item.path,
|
|
2181
2211
|
}));
|
|
2212
|
+
// Includes the wait for on-device confirmation.
|
|
2213
|
+
const installStartedAt = Date.now();
|
|
2182
2214
|
try {
|
|
2183
2215
|
await this.protocolV2StartFirmwareUpdate({ targets });
|
|
2184
2216
|
await wait(PROTOCOL_V2_INSTALL_STATUS_INITIAL_DELAY);
|
|
2185
2217
|
await this.waitForProtocolV2FirmwareUpdateComplete(targets, true);
|
|
2218
|
+
Log.debug('[FirmwareUpdateV4] Protocol V2 install completed', {
|
|
2219
|
+
targets: targets.length,
|
|
2220
|
+
elapsedMs: Math.max(Date.now() - installStartedAt, 0),
|
|
2221
|
+
});
|
|
2186
2222
|
} finally {
|
|
2187
2223
|
this.device?.clearCancelableAction();
|
|
2188
2224
|
}
|
|
@@ -2201,66 +2237,96 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
2201
2237
|
totalSize: number;
|
|
2202
2238
|
transferStartedAt?: number;
|
|
2203
2239
|
}) {
|
|
2240
|
+
const reportConfirmedChunk = (chunkEnd: number) => {
|
|
2241
|
+
const transferredBytes = processedSize + chunkEnd;
|
|
2242
|
+
const now = Date.now();
|
|
2243
|
+
const elapsedMs = Math.max(now - transferStartedAt, 0);
|
|
2244
|
+
const progress = Math.min(Math.ceil((transferredBytes / totalSize) * 100), 99);
|
|
2245
|
+
const shouldPostProgress =
|
|
2246
|
+
transferredBytes >= this.protocolV2LastTransferredBytes &&
|
|
2247
|
+
(progress !== this.protocolV2LastTransferProgress ||
|
|
2248
|
+
now - this.protocolV2LastTransferProgressAt >=
|
|
2249
|
+
PROTOCOL_V2_TRANSFER_PROGRESS_HEARTBEAT_MS ||
|
|
2250
|
+
chunkEnd === source.size);
|
|
2251
|
+
if (shouldPostProgress) {
|
|
2252
|
+
this.protocolV2LastTransferProgress = progress;
|
|
2253
|
+
this.protocolV2LastTransferProgressAt = now;
|
|
2254
|
+
this.protocolV2LastTransferredBytes = transferredBytes;
|
|
2255
|
+
this.postProgressMessage(progress, 'transferData', {
|
|
2256
|
+
transferredBytes,
|
|
2257
|
+
totalBytes: totalSize,
|
|
2258
|
+
rateBytesPerSecond:
|
|
2259
|
+
elapsedMs > 0 ? Math.round((transferredBytes / elapsedMs) * 1000) : undefined,
|
|
2260
|
+
elapsedMs,
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
};
|
|
2204
2264
|
let lastError: unknown;
|
|
2205
2265
|
for (let attempt = 1; attempt <= PROTOCOL_V2_FILE_TRANSFER_RETRY_COUNT; attempt += 1) {
|
|
2206
2266
|
this.throwIfAborted();
|
|
2267
|
+
const attemptStartedAt = Date.now();
|
|
2207
2268
|
try {
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
throw ERRORS.TypedError(
|
|
2231
|
-
HardwareErrorCode.EmmcFileWriteFirmwareError,
|
|
2232
|
-
`invalid processed_byte ${rawProcessedByte} for offset ${sourceOffset}`
|
|
2269
|
+
const chunkSize = this.getProtocolV2FirmwareChunkSize('write', filePath);
|
|
2270
|
+
const windowed = this.shouldUseProtocolV2BleFileWriteWindow();
|
|
2271
|
+
if (windowed) {
|
|
2272
|
+
await this.writeProtocolV2SourceWindowed({
|
|
2273
|
+
source,
|
|
2274
|
+
filePath,
|
|
2275
|
+
chunkSize,
|
|
2276
|
+
processedSize,
|
|
2277
|
+
totalSize,
|
|
2278
|
+
onChunkConfirmed: reportConfirmedChunk,
|
|
2279
|
+
});
|
|
2280
|
+
} else {
|
|
2281
|
+
await writeFirmwareByteSource({
|
|
2282
|
+
source,
|
|
2283
|
+
chunkSize,
|
|
2284
|
+
write: async ({ data, sourceOffset, length, first }) => {
|
|
2285
|
+
this.throwIfAborted();
|
|
2286
|
+
const chunkEnd = sourceOffset + length;
|
|
2287
|
+
const deviceProgress = getProtocolV2DeviceTransferProgress(
|
|
2288
|
+
processedSize + sourceOffset,
|
|
2289
|
+
processedSize + chunkEnd,
|
|
2290
|
+
totalSize
|
|
2233
2291
|
);
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2292
|
+
const response = await this.fileWriteChunk(
|
|
2293
|
+
filePath,
|
|
2294
|
+
source.size,
|
|
2295
|
+
sourceOffset,
|
|
2296
|
+
data,
|
|
2297
|
+
first,
|
|
2298
|
+
deviceProgress
|
|
2299
|
+
);
|
|
2300
|
+
const rawProcessedByte = response.message.processed_byte;
|
|
2301
|
+
const nextOffset =
|
|
2302
|
+
rawProcessedByte === undefined ? chunkEnd : Number(rawProcessedByte);
|
|
2303
|
+
if (!Number.isFinite(nextOffset) || nextOffset !== chunkEnd) {
|
|
2304
|
+
throw ERRORS.TypedError(
|
|
2305
|
+
HardwareErrorCode.EmmcFileWriteFirmwareError,
|
|
2306
|
+
`invalid processed_byte ${rawProcessedByte} for offset ${sourceOffset}`
|
|
2307
|
+
);
|
|
2308
|
+
}
|
|
2309
|
+
reportConfirmedChunk(chunkEnd);
|
|
2310
|
+
return length;
|
|
2311
|
+
},
|
|
2312
|
+
});
|
|
2313
|
+
}
|
|
2314
|
+
Log.debug('[FirmwareUpdateV4] Protocol V2 file transferred', {
|
|
2315
|
+
path: filePath,
|
|
2316
|
+
bytes: source.size,
|
|
2317
|
+
elapsedMs: Math.max(Date.now() - attemptStartedAt, 0),
|
|
2318
|
+
attempt,
|
|
2319
|
+
fileWriteWindow: windowed ? PROTOCOL_V2_FILE_WRITE_PIPELINE_WINDOW : 1,
|
|
2259
2320
|
});
|
|
2260
2321
|
return processedSize + source.size;
|
|
2261
2322
|
} catch (error) {
|
|
2262
2323
|
this.throwIfAborted();
|
|
2263
2324
|
lastError = error;
|
|
2325
|
+
Log.debug('[FirmwareUpdateV4] Protocol V2 file transfer attempt failed', {
|
|
2326
|
+
path: filePath,
|
|
2327
|
+
attempt,
|
|
2328
|
+
error: getProtocolV2UnknownErrorText(error),
|
|
2329
|
+
});
|
|
2264
2330
|
if (attempt < PROTOCOL_V2_FILE_TRANSFER_RETRY_COUNT) {
|
|
2265
2331
|
await this.recoverProtocolV2FileTransfer();
|
|
2266
2332
|
this.throwIfAborted();
|
|
@@ -3192,6 +3258,105 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
3192
3258
|
return writeRes;
|
|
3193
3259
|
}
|
|
3194
3260
|
|
|
3261
|
+
private shouldUseProtocolV2BleFileWriteWindow(
|
|
3262
|
+
minBootloaderVersion = PROTOCOL_V2_BLE_FILE_WRITE_WINDOW_MIN_BOOTLOADER_VERSION
|
|
3263
|
+
) {
|
|
3264
|
+
const env = DataManager.getSettings('env');
|
|
3265
|
+
// These adapters queue frames that arrive while no read is pending. LowLevel plugins are not
|
|
3266
|
+
// required to keep notifications between receive() calls, so they stay serial.
|
|
3267
|
+
if (
|
|
3268
|
+
(env !== 'react-native' && env !== 'desktop-web-ble') ||
|
|
3269
|
+
!this.isProtocolV2BootloaderMode()
|
|
3270
|
+
) {
|
|
3271
|
+
return false;
|
|
3272
|
+
}
|
|
3273
|
+
// The transfer runs in the device's current bootloader, not the one being installed.
|
|
3274
|
+
const bootloaderVersion = getDeviceBootloaderVersion(this.device.features).join('.');
|
|
3275
|
+
const enabled = supportsProtocolV2BleFileWriteWindow(bootloaderVersion, minBootloaderVersion);
|
|
3276
|
+
Log.debug('[FirmwareUpdateV4] BLE FileWrite window', {
|
|
3277
|
+
enabled,
|
|
3278
|
+
bootloaderVersion,
|
|
3279
|
+
bootloaderBuildId: this.device.features?.verify?.bootloaderBuildId,
|
|
3280
|
+
});
|
|
3281
|
+
return enabled;
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
/**
|
|
3285
|
+
* Streams one staged file as a single ordered FilesystemFileWrite pipeline. Every chunk is
|
|
3286
|
+
* still confirmed by the device; a failure restarts the whole file like the serial path.
|
|
3287
|
+
* Cancellation and source errors only stop the pipeline and are raised after the transport
|
|
3288
|
+
* call returns: an error thrown inside it would invalidate the BLE link.
|
|
3289
|
+
*/
|
|
3290
|
+
private async writeProtocolV2SourceWindowed({
|
|
3291
|
+
source,
|
|
3292
|
+
filePath,
|
|
3293
|
+
chunkSize,
|
|
3294
|
+
processedSize,
|
|
3295
|
+
totalSize,
|
|
3296
|
+
onChunkConfirmed,
|
|
3297
|
+
}: {
|
|
3298
|
+
source: FirmwareByteSource;
|
|
3299
|
+
filePath: string;
|
|
3300
|
+
chunkSize: number;
|
|
3301
|
+
processedSize: number;
|
|
3302
|
+
totalSize: number;
|
|
3303
|
+
onChunkConfirmed: (chunkEnd: number) => void;
|
|
3304
|
+
}) {
|
|
3305
|
+
let sendOffset = 0;
|
|
3306
|
+
let sourceError: Error | undefined;
|
|
3307
|
+
const readRequest = async () => {
|
|
3308
|
+
const offset = sendOffset;
|
|
3309
|
+
const length = Math.min(chunkSize, source.size - offset);
|
|
3310
|
+
const data = await source.readAt(offset, length);
|
|
3311
|
+
sendOffset += length;
|
|
3312
|
+
return {
|
|
3313
|
+
file: { path: filePath, offset, total_size: source.size, data },
|
|
3314
|
+
overwrite: offset === 0,
|
|
3315
|
+
append: false,
|
|
3316
|
+
ui_percentage: getProtocolV2DeviceTransferProgress(
|
|
3317
|
+
processedSize + offset,
|
|
3318
|
+
processedSize + sendOffset,
|
|
3319
|
+
totalSize
|
|
3320
|
+
),
|
|
3321
|
+
};
|
|
3322
|
+
};
|
|
3323
|
+
const nextRequest = async () => {
|
|
3324
|
+
if (this.abortSignal?.aborted || sendOffset >= source.size) return undefined;
|
|
3325
|
+
try {
|
|
3326
|
+
return await readRequest();
|
|
3327
|
+
} catch (error) {
|
|
3328
|
+
sourceError = error;
|
|
3329
|
+
return undefined;
|
|
3330
|
+
}
|
|
3331
|
+
};
|
|
3332
|
+
this.throwIfAborted();
|
|
3333
|
+
if (source.size === 0) return;
|
|
3334
|
+
const firstRequest = await readRequest();
|
|
3335
|
+
|
|
3336
|
+
const env = DataManager.getSettings('env');
|
|
3337
|
+
const response = await this.device
|
|
3338
|
+
.getCommands()
|
|
3339
|
+
.typedCall('FilesystemFileWrite', 'FilesystemFile', firstRequest, {
|
|
3340
|
+
timeoutMs: env === 'react-native' ? PROTOCOL_V2_FILE_WRITE_RESPONSE_TIMEOUT : undefined,
|
|
3341
|
+
writeWithResponse: false,
|
|
3342
|
+
fileWritePipeline: {
|
|
3343
|
+
next: nextRequest,
|
|
3344
|
+
onResponse: confirmed => {
|
|
3345
|
+
onChunkConfirmed(Number(confirmed.message.processed_byte));
|
|
3346
|
+
},
|
|
3347
|
+
},
|
|
3348
|
+
});
|
|
3349
|
+
this.throwIfAborted();
|
|
3350
|
+
if (sourceError) throw sourceError;
|
|
3351
|
+
const rawProcessedByte = response.message.processed_byte;
|
|
3352
|
+
if (Number(rawProcessedByte) !== source.size) {
|
|
3353
|
+
throw ERRORS.TypedError(
|
|
3354
|
+
HardwareErrorCode.EmmcFileWriteFirmwareError,
|
|
3355
|
+
`invalid processed_byte ${rawProcessedByte} for file size ${source.size}`
|
|
3356
|
+
);
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3195
3360
|
private async recoverProtocolV2FileTransfer() {
|
|
3196
3361
|
const env = DataManager.getSettings('env');
|
|
3197
3362
|
if (DataManager.isBleConnect(env)) {
|
package/src/api/index.ts
CHANGED
|
@@ -175,5 +175,3 @@ export { default as benfenSignTransaction } from './benfen/BenfenSignTransaction
|
|
|
175
175
|
|
|
176
176
|
export { default as neoGetAddress } from './neo/NeoGetAddress';
|
|
177
177
|
export { default as neoSignTransaction } from './neo/NeoSignTransaction';
|
|
178
|
-
export { default as zcashGetAddress } from './zcash/ZcashGetAddress';
|
|
179
|
-
export { default as zcashSignPczt } from './zcash/ZcashSignPczt';
|
|
@@ -11034,61 +11034,6 @@
|
|
|
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
|
-
},
|
|
11092
11037
|
"wire_in": {
|
|
11093
11038
|
"type": "bool",
|
|
11094
11039
|
"id": 50002,
|
|
@@ -11514,11 +11459,6 @@
|
|
|
11514
11459
|
"MessageType_NeoAddress": 12302,
|
|
11515
11460
|
"MessageType_NeoSignTx": 12303,
|
|
11516
11461
|
"MessageType_NeoSignedTx": 12304,
|
|
11517
|
-
"MessageType_ZcashSignPczt": 12402,
|
|
11518
|
-
"MessageType_ZcashSignedPczt": 12403,
|
|
11519
|
-
"MessageType_ZcashPcztChunkRequest": 12404,
|
|
11520
|
-
"MessageType_ZcashPcztChunkAck": 12405,
|
|
11521
|
-
"MessageType_ZcashSignedPcztChunkRequest": 12406,
|
|
11522
11462
|
"MessageType_DeviceFactoryInfoSet": 60000,
|
|
11523
11463
|
"MessageType_DeviceFactoryInfoGet": 60001,
|
|
11524
11464
|
"MessageType_DeviceFactoryInfo": 60002,
|
|
@@ -11571,9 +11511,7 @@
|
|
|
11571
11511
|
"MessageType_PortfolioUpdate": 61400,
|
|
11572
11512
|
"MessageType_NftUpdate": 61500,
|
|
11573
11513
|
"MessageType_OnboardingStatusGet": 61600,
|
|
11574
|
-
"MessageType_OnboardingStatus": 61601
|
|
11575
|
-
"MessageType_ZcashGetAddress": 12400,
|
|
11576
|
-
"MessageType_ZcashAddress": 12401
|
|
11514
|
+
"MessageType_OnboardingStatus": 61601
|
|
11577
11515
|
},
|
|
11578
11516
|
"reserved": [
|
|
11579
11517
|
[90, 92],
|
|
@@ -13792,81 +13730,6 @@
|
|
|
13792
13730
|
}
|
|
13793
13731
|
}
|
|
13794
13732
|
}
|
|
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
|
-
}
|
|
13870
13733
|
}
|
|
13871
13734
|
}
|
|
13872
13735
|
}
|
|
@@ -8,8 +8,8 @@ export const LogBlockEvent: Set<string> = new Set([
|
|
|
8
8
|
UI_RESPONSE.RECEIVE_PASSPHRASE,
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
//
|
|
11
|
+
// These resource/file APIs did not exist in 1.1.32. Skip the payload so
|
|
12
|
+
// the log layer does not copy huge Base64 or binary data.
|
|
13
13
|
const LogPayloadBlockMethod: Set<string> = new Set([
|
|
14
14
|
'btcDeriveContextHash',
|
|
15
15
|
'deviceUploadNft',
|
|
@@ -17,8 +17,6 @@ const LogPayloadBlockMethod: Set<string> = new Set([
|
|
|
17
17
|
'uploadPortfolio',
|
|
18
18
|
'fileWrite',
|
|
19
19
|
'fileRead',
|
|
20
|
-
'zcashGetAddress',
|
|
21
|
-
'zcashSignPczt',
|
|
22
20
|
]);
|
|
23
21
|
|
|
24
22
|
export function getLogBlockLabel(message: unknown): string | undefined {
|
package/src/inject.ts
CHANGED
|
@@ -504,8 +504,4 @@ 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' }),
|
|
511
507
|
});
|
package/src/types/api/export.ts
CHANGED
|
@@ -227,5 +227,3 @@ 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,8 +154,6 @@ 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';
|
|
159
157
|
import type { ConnectSettings } from '../settings';
|
|
160
158
|
import type { HardwareConnectProtocol } from '@onekeyfe/hd-shared';
|
|
161
159
|
|
|
@@ -474,10 +472,4 @@ export type CoreApi = {
|
|
|
474
472
|
*/
|
|
475
473
|
neoGetAddress: typeof neoGetAddress;
|
|
476
474
|
neoSignTransaction: typeof neoSignTransaction;
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* Zcash
|
|
480
|
-
*/
|
|
481
|
-
zcashGetAddress: typeof zcashGetAddress;
|
|
482
|
-
zcashSignPczt: typeof zcashSignPczt;
|
|
483
475
|
};
|