@onekeyfe/hd-core 1.2.0-alpha.19 → 1.2.0-alpha.20
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__/AllNetworkGetAddressBase.tracing.test.ts +75 -0
- package/__tests__/DeviceCommands.test.ts +143 -7
- package/__tests__/RequestQueue.test.ts +106 -0
- package/__tests__/UploadPortfolio.test.ts +46 -0
- package/__tests__/core-dispose.test.ts +34 -0
- package/__tests__/core-error-output.test.ts +39 -0
- package/__tests__/device-lifecycle-events.test.ts +117 -0
- package/__tests__/device-pool-state.test.ts +20 -1
- package/__tests__/device-settings.test.ts +184 -6
- package/__tests__/device-state-events.test.ts +1 -2
- package/__tests__/device-state-mapper.test.ts +33 -26
- package/__tests__/device-state-store.test.ts +1 -34
- package/__tests__/device-utils.test.ts +106 -0
- package/__tests__/device-wallet-session-store.test.ts +65 -29
- package/__tests__/deviceSettings.test.ts +21 -12
- package/__tests__/evmLedgerLegacySafety.test.ts +2 -2
- package/__tests__/evmSignTypedData.test.ts +80 -0
- package/__tests__/filesystemValidation.test.ts +53 -0
- package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +402 -0
- package/__tests__/get-device-state.test.ts +77 -41
- package/__tests__/logBlockEvent.test.ts +24 -11
- package/__tests__/networkUtils.test.ts +386 -0
- package/__tests__/open-wallet-session-error-response.test.ts +43 -0
- package/__tests__/open-wallet-session.test.ts +559 -0
- package/__tests__/protocol-v2.test.ts +756 -452
- package/__tests__/public-device-state-api.test.ts +113 -13
- package/__tests__/public-pro2-api-boundary.test.ts +91 -0
- package/__tests__/search-devices.test.ts +43 -0
- package/dist/api/BaseMethod.d.ts +3 -0
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
- package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
- package/dist/api/ClearSessionCache.d.ts.map +1 -1
- package/dist/api/DirList.d.ts.map +1 -1
- package/dist/api/FileRead.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV2.d.ts +2 -2
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +3 -2
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/OpenWalletSession.d.ts +14 -0
- package/dist/api/OpenWalletSession.d.ts.map +1 -0
- package/dist/api/PathInfo.d.ts.map +1 -1
- package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
- package/dist/api/SearchDevices.d.ts +3 -0
- package/dist/api/SearchDevices.d.ts.map +1 -1
- package/dist/api/UploadPortfolio.d.ts.map +1 -1
- package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
- package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
- package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
- package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
- package/dist/api/device/DeviceSettings.d.ts.map +1 -1
- package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceWipe.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +7 -3
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/api/helpers/filesystemValidation.d.ts +3 -0
- package/dist/api/helpers/filesystemValidation.d.ts.map +1 -1
- package/dist/api/helpers/paramsValidator.d.ts +1 -0
- package/dist/api/helpers/paramsValidator.d.ts.map +1 -1
- package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -1
- package/dist/api/index.d.ts +7 -11
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +1 -1
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/core/RequestQueue.d.ts +17 -1
- package/dist/core/RequestQueue.d.ts.map +1 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +6 -5
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +5 -5
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/device/DevicePool.d.ts +1 -0
- package/dist/device/DevicePool.d.ts.map +1 -1
- package/dist/device/DeviceStateMapper.d.ts +2 -2
- package/dist/device/DeviceStateMapper.d.ts.map +1 -1
- package/dist/device/DeviceStateProjector.d.ts +1 -2
- package/dist/device/DeviceStateProjector.d.ts.map +1 -1
- package/dist/device/DeviceStateStore.d.ts +1 -3
- package/dist/device/DeviceStateStore.d.ts.map +1 -1
- package/dist/device/DeviceWalletSessionStore.d.ts +6 -1
- package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -1
- package/dist/device/cloneDeviceState.d.ts +2 -0
- package/dist/device/cloneDeviceState.d.ts.map +1 -0
- package/dist/deviceProfile/buildDeviceFeatures.d.ts +3 -1
- package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
- package/dist/events/logBlockEvent.d.ts.map +1 -1
- package/dist/index.d.ts +608 -75
- package/dist/index.js +2287 -1706
- package/dist/inject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
- package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/features.d.ts +11 -4
- package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/index.d.ts +2 -2
- package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +16 -0
- package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/walletSession.d.ts +8 -3
- package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -1
- package/dist/types/api/checkAllFirmwareRelease.d.ts +1 -2
- package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
- package/dist/types/api/deviceSettings.d.ts +1 -0
- package/dist/types/api/deviceSettings.d.ts.map +1 -1
- package/dist/types/api/deviceUnlock.d.ts +1 -1
- package/dist/types/api/deviceUnlock.d.ts.map +1 -1
- package/dist/types/api/getFeatures.d.ts.map +1 -1
- package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
- package/dist/types/api/getPassphraseState.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +13 -15
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/openWalletSession.d.ts +41 -0
- package/dist/types/api/openWalletSession.d.ts.map +1 -0
- package/dist/types/api/protocolV2.d.ts +6 -11
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/device.d.ts +2 -9
- package/dist/types/device.d.ts.map +1 -1
- package/dist/utils/assets.d.ts +2 -1
- package/dist/utils/assets.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesCompat.d.ts +13 -0
- package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
- package/dist/utils/deviceFeaturesUtils.d.ts +11 -1
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts +9 -8
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/deviceSettings.d.ts +2 -0
- package/dist/utils/deviceSettings.d.ts.map +1 -1
- package/dist/utils/deviceVersionUtils.d.ts +6 -5
- package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/networkUtils.d.ts +9 -1
- package/dist/utils/networkUtils.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/dist/utils/pro2Wallpaper.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +17 -10
- package/src/api/CheckBootloaderRelease.ts +1 -2
- package/src/api/CheckFirmwareRelease.ts +1 -2
- package/src/api/ClearSessionCache.ts +0 -4
- package/src/api/DirList.ts +5 -3
- package/src/api/DirMake.ts +3 -3
- package/src/api/DirRemove.ts +3 -3
- package/src/api/FileDelete.ts +3 -3
- package/src/api/FileRead.ts +9 -6
- package/src/api/FileWrite.ts +3 -3
- package/src/api/FirmwareUpdate.ts +4 -4
- package/src/api/FirmwareUpdateV2.ts +133 -45
- package/src/api/FirmwareUpdateV3.ts +3 -5
- package/src/api/FirmwareUpdateV4.ts +192 -154
- package/src/api/GetPassphraseState.ts +10 -16
- package/src/api/OpenWalletSession.ts +221 -0
- package/src/api/PathInfo.ts +5 -3
- package/src/api/PromptWebDeviceAccess.ts +2 -3
- package/src/api/SearchDevices.ts +6 -2
- package/src/api/UploadPortfolio.ts +12 -3
- package/src/api/alephium/AlephiumSignTransaction.ts +2 -2
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +4 -8
- package/src/api/benfen/BenfenGetAddress.ts +1 -1
- package/src/api/btc/BTCGetPublicKey.ts +1 -1
- package/src/api/device/DeviceChangePin.ts +1 -0
- package/src/api/device/DeviceFullyUploadResource.ts +4 -5
- package/src/api/device/DeviceSettings.ts +93 -0
- package/src/api/device/DeviceUpdateBootloader.ts +1 -2
- package/src/api/device/DeviceWipe.ts +1 -0
- package/src/api/evm/EVMSignTypedData.ts +3 -5
- package/src/api/evm/legacyV1/getAddress.ts +2 -2
- package/src/api/evm/legacyV1/getPublicKey.ts +2 -2
- package/src/api/evm/legacyV1/signMessage.ts +2 -2
- package/src/api/evm/legacyV1/signTypedData.ts +2 -2
- package/src/api/evm/legacyV1/signTypedHash.ts +2 -2
- package/src/api/evm/legacyV1/verifyMessage.ts +2 -2
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +3 -3
- package/src/api/firmware/getBinary.ts +8 -3
- package/src/api/helpers/batchGetPublickeys.ts +2 -2
- package/src/api/helpers/filesystemValidation.ts +61 -0
- package/src/api/helpers/paramsValidator.ts +1 -1
- package/src/api/helpers/protocolV2FileWrite.ts +3 -2
- package/src/api/index.ts +9 -12
- package/src/api/nervos/NervosSignTransaction.ts +2 -2
- package/src/api/nexa/NexaSignTransaction.ts +1 -1
- package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +1 -1
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +1 -1
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +4 -4
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +6 -5
- package/src/api/protocol-v2/DeviceInfoGet.ts +4 -4
- package/src/api/protocol-v2/DeviceReboot.ts +1 -1
- package/src/api/protocol-v2/DeviceSettingsPageShow.ts +11 -8
- package/src/api/protocol-v2/DeviceSettingsSet.ts +4 -11
- package/src/api/protocol-v2/FilesystemFormat.ts +1 -1
- package/src/api/protocol-v2/FilesystemPermissionFix.ts +1 -1
- package/src/api/protocol-v2/Ping.ts +1 -1
- package/src/api/protocol-v2/ProtocolInfoRequest.ts +1 -1
- package/src/api/utils.ts +1 -3
- package/src/core/RequestQueue.ts +107 -6
- package/src/core/index.ts +91 -46
- package/src/data/messages/messages-protocol-v2.json +25 -79
- package/src/data-manager/DataManager.ts +6 -6
- package/src/device/Device.ts +186 -102
- package/src/device/DeviceCommands.ts +51 -21
- package/src/device/DeviceFeaturesState.ts +4 -4
- package/src/device/DevicePool.ts +17 -3
- package/src/device/DeviceStateMapper.ts +13 -29
- package/src/device/DeviceStateProjector.ts +11 -8
- package/src/device/DeviceStateStore.ts +11 -52
- package/src/device/DeviceWalletSessionStore.ts +31 -4
- package/src/device/cloneDeviceState.ts +39 -0
- package/src/device/deviceIdentity.ts +2 -2
- package/src/deviceProfile/buildDeviceFeatures.ts +29 -88
- package/src/events/logBlockEvent.ts +8 -1
- package/src/inject.ts +14 -24
- package/src/protocols/protocol-v2/deviceSession.ts +24 -0
- package/src/protocols/protocol-v2/features.ts +37 -49
- package/src/protocols/protocol-v2/firmware.ts +1 -1
- package/src/protocols/protocol-v2/index.ts +2 -3
- package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +61 -0
- package/src/protocols/protocol-v2/uiInteraction.ts +4 -3
- package/src/protocols/protocol-v2/walletSession.ts +57 -146
- package/src/types/api/checkAllFirmwareRelease.ts +1 -2
- package/src/types/api/deviceSettings.ts +1 -0
- package/src/types/api/deviceUnlock.ts +1 -1
- package/src/types/api/firmwareUpdate.ts +5 -5
- package/src/types/api/getDeviceState.ts +1 -1
- package/src/types/api/getFeatures.ts +3 -0
- package/src/types/api/getOnekeyFeatures.ts +3 -0
- package/src/types/api/getPassphraseState.ts +6 -0
- package/src/types/api/index.ts +16 -23
- package/src/types/api/openWalletSession.ts +64 -0
- package/src/types/api/protocolV2.ts +36 -18
- package/src/types/device.ts +20 -14
- package/src/types/params.ts +1 -1
- package/src/types/settings.ts +8 -8
- package/src/utils/assets.ts +4 -1
- package/src/utils/deviceFeaturesCompat.ts +173 -0
- package/src/utils/deviceFeaturesUtils.ts +9 -8
- package/src/utils/deviceInfoUtils.ts +26 -64
- package/src/utils/deviceSettings.ts +18 -11
- package/src/utils/deviceVersionUtils.ts +25 -44
- package/src/utils/findDefectiveBatchDevice.ts +3 -3
- package/src/utils/index.ts +2 -5
- package/src/utils/networkUtils.ts +270 -14
- package/src/utils/pro2Wallpaper.ts +11 -13
- package/src/utils/tracing.ts +2 -2
- package/dist/api/internal.d.ts +0 -4
- package/dist/api/internal.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceSessionOpen.d.ts +0 -28
- package/dist/api/protocol-v2/DeviceSessionOpen.d.ts.map +0 -1
- package/src/api/internal.ts +0 -9
- package/src/api/protocol-v2/DeviceSessionOpen.ts +0 -100
|
@@ -1,37 +1,10 @@
|
|
|
1
1
|
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { assertCompleteDeviceSession } from './deviceSession';
|
|
4
4
|
import { isDeviceLockedError } from './lockedError';
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { DeviceSessionGet } from '@onekeyfe/hd-transport';
|
|
7
7
|
import type { Device } from '../../device/Device';
|
|
8
|
-
import type { PassphrasePromptResponse } from '../../device/DeviceCommands';
|
|
9
|
-
|
|
10
|
-
const getErrorText = (error: unknown) => {
|
|
11
|
-
if (error instanceof Error) return `${error.name} ${error.message}`;
|
|
12
|
-
if (typeof error === 'string') return error;
|
|
13
|
-
if (error && typeof error === 'object') {
|
|
14
|
-
const record = error as Record<string, unknown>;
|
|
15
|
-
return [record.code, record.errorCode, record.message, record.reason]
|
|
16
|
-
.filter(value => value !== undefined && value !== null)
|
|
17
|
-
.join(' ');
|
|
18
|
-
}
|
|
19
|
-
return String(error ?? '');
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const isProtocolV2InvalidSessionError = (error: unknown) =>
|
|
23
|
-
getErrorText(error).toLowerCase().includes('failure_invalidsession');
|
|
24
|
-
|
|
25
|
-
const normalizeHostPassphrase = (passphrase: string | undefined) => {
|
|
26
|
-
const normalized = (passphrase ?? '').normalize('NFKD');
|
|
27
|
-
if (!normalized || normalized.includes('\0') || normalized.length > 50) {
|
|
28
|
-
throw ERRORS.TypedError(
|
|
29
|
-
HardwareErrorCode.CallMethodInvalidParameter,
|
|
30
|
-
'Invalid hidden wallet passphrase.'
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
return normalized;
|
|
34
|
-
};
|
|
35
8
|
|
|
36
9
|
export async function requestProtocolV2DeviceStatus(device: Device) {
|
|
37
10
|
const { message } = await device.commands.typedCall('DeviceStatusGet', 'DeviceStatus', {});
|
|
@@ -43,69 +16,16 @@ export async function refreshProtocolV2DeviceStatus(device: Device) {
|
|
|
43
16
|
return device.updateProtocolV2Status(status);
|
|
44
17
|
}
|
|
45
18
|
|
|
46
|
-
const
|
|
19
|
+
const getDeviceSession = async (device: Device, request: DeviceSessionGet) => {
|
|
47
20
|
try {
|
|
48
|
-
return await device.commands.typedCall('
|
|
21
|
+
return await device.commands.typedCall('DeviceSessionGet', 'DeviceSession', request);
|
|
49
22
|
} catch (error) {
|
|
50
23
|
if (!isDeviceLockedError(error)) {
|
|
51
24
|
throw error;
|
|
52
25
|
}
|
|
53
26
|
await device.unlockDevice();
|
|
54
|
-
return device.commands.typedCall('
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const createHiddenWalletRequest = (
|
|
59
|
-
response: PassphrasePromptResponse
|
|
60
|
-
): {
|
|
61
|
-
request: DeviceSessionOpen;
|
|
62
|
-
deviceEvent?: typeof DEVICE.PASSPHRASE_ON_DEVICE | typeof DEVICE.ATTACH_PIN_ON_DEVICE;
|
|
63
|
-
} => {
|
|
64
|
-
if (response.attachPinOnDevice) {
|
|
65
|
-
return {
|
|
66
|
-
request: {
|
|
67
|
-
select: {
|
|
68
|
-
attach_pin_on_device: {},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
deviceEvent: DEVICE.ATTACH_PIN_ON_DEVICE,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (response.passphraseOnDevice) {
|
|
76
|
-
return {
|
|
77
|
-
request: {
|
|
78
|
-
select: {
|
|
79
|
-
passphrase_on_device: {},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
deviceEvent: DEVICE.PASSPHRASE_ON_DEVICE,
|
|
83
|
-
};
|
|
27
|
+
return device.commands.typedCall('DeviceSessionGet', 'DeviceSession', request);
|
|
84
28
|
}
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
request: {
|
|
88
|
-
select: {
|
|
89
|
-
host_passphrase: { passphrase: normalizeHostPassphrase(response.passphrase) },
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const openSelectedHiddenWallet = async (
|
|
96
|
-
device: Device,
|
|
97
|
-
promptPayload: PassphraseRequestPayload
|
|
98
|
-
) => {
|
|
99
|
-
const response = await device.commands.promptPassphrase(promptPayload, {
|
|
100
|
-
cancelDeviceOnReject: false,
|
|
101
|
-
});
|
|
102
|
-
const { request, deviceEvent } = createHiddenWalletRequest(response);
|
|
103
|
-
|
|
104
|
-
if (deviceEvent) {
|
|
105
|
-
device.emit(deviceEvent, device, promptPayload);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return openDeviceSession(device, request);
|
|
109
29
|
};
|
|
110
30
|
|
|
111
31
|
export async function getProtocolV2WalletSession(
|
|
@@ -122,75 +42,66 @@ export async function getProtocolV2WalletSession(
|
|
|
122
42
|
|
|
123
43
|
const expectedPassphraseState = options?.expectedPassphraseState ?? device.passphraseState;
|
|
124
44
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// 标准钱包不需要 DeviceSession。锁屏时先解锁刷新状态,
|
|
133
|
-
// 确认未开启 passphrase 后不得再生成或传递隐藏钱包 passphraseState。
|
|
134
|
-
if (options?.onlyMainPin || device.getCurrentPassphraseProtection() === false) {
|
|
135
|
-
return {
|
|
136
|
-
passphraseState: undefined,
|
|
137
|
-
newSession: undefined,
|
|
138
|
-
unlockedAttachPin: false,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const cachedSessionId =
|
|
143
|
-
typeof device.getInternalState === 'function' ? device.getInternalState() : undefined;
|
|
144
|
-
let response;
|
|
145
|
-
let recoveryFailed = false;
|
|
45
|
+
// Unlock with PIN first. DeviceSessionGet operates on the wallet selected by
|
|
46
|
+
// the device unlock flow; Protocol V2 does not accept a host passphrase here.
|
|
47
|
+
if (device.features?.unlocked === false) {
|
|
48
|
+
await device.unlockDevice();
|
|
49
|
+
}
|
|
146
50
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
recoveryFailed = true;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
51
|
+
// A standard wallet needs no DeviceSession. After unlock confirms passphrase is
|
|
52
|
+
// disabled, do not create or forward a hidden-wallet passphraseState.
|
|
53
|
+
if (options?.onlyMainPin || device.getCurrentPassphraseProtection() === false) {
|
|
54
|
+
return {
|
|
55
|
+
passphraseState: undefined,
|
|
56
|
+
newSession: undefined,
|
|
57
|
+
unlockedAttachPin: device.features?.unlockedAttachPin ?? false,
|
|
58
|
+
resumed: false,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
160
61
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
expectedPassphraseState,
|
|
166
|
-
existsAttachPinUser: device.features?.attachToPinEnabled === true,
|
|
167
|
-
};
|
|
168
|
-
response = await openSelectedHiddenWallet(device, promptPayload);
|
|
169
|
-
}
|
|
62
|
+
const cachedSessionId =
|
|
63
|
+
typeof device.getInternalState === 'function' ? device.getInternalState() : undefined;
|
|
64
|
+
let response;
|
|
65
|
+
let resumed = false;
|
|
170
66
|
|
|
171
|
-
|
|
172
|
-
|
|
67
|
+
if (cachedSessionId && expectedPassphraseState) {
|
|
68
|
+
try {
|
|
69
|
+
response = await getDeviceSession(device, { session_id: cachedSessionId });
|
|
70
|
+
resumed = true;
|
|
71
|
+
} catch (error) {
|
|
173
72
|
device.clearInternalState();
|
|
174
|
-
throw
|
|
73
|
+
throw error;
|
|
175
74
|
}
|
|
75
|
+
}
|
|
176
76
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
device.getCurrentDeviceId(),
|
|
181
|
-
message.session_id,
|
|
182
|
-
options?.initSession ? null : device.features?.sessionId ?? null
|
|
183
|
-
);
|
|
77
|
+
if (!response) {
|
|
78
|
+
response = await getDeviceSession(device, {});
|
|
79
|
+
}
|
|
184
80
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
unlockedAttachPin: device.features?.unlockedAttachPin ?? undefined,
|
|
189
|
-
};
|
|
81
|
+
const { message } = response;
|
|
82
|
+
try {
|
|
83
|
+
assertCompleteDeviceSession(message);
|
|
190
84
|
} catch (error) {
|
|
191
|
-
|
|
192
|
-
device.clearInternalState();
|
|
193
|
-
}
|
|
85
|
+
device.clearInternalState();
|
|
194
86
|
throw error;
|
|
195
87
|
}
|
|
88
|
+
if (expectedPassphraseState && expectedPassphraseState !== message.btc_test_address) {
|
|
89
|
+
device.clearInternalState();
|
|
90
|
+
throw ERRORS.TypedError(HardwareErrorCode.DeviceCheckPassphraseStateError);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
device.updateInternalState(
|
|
94
|
+
true,
|
|
95
|
+
message.btc_test_address,
|
|
96
|
+
device.getCurrentDeviceId(),
|
|
97
|
+
message.session_id,
|
|
98
|
+
options?.initSession ? null : device.features?.sessionId ?? null
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
passphraseState: message.btc_test_address,
|
|
103
|
+
newSession: message.session_id,
|
|
104
|
+
unlockedAttachPin: device.features?.unlockedAttachPin ?? undefined,
|
|
105
|
+
resumed,
|
|
106
|
+
};
|
|
196
107
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { IBLEFirmwareReleaseInfo } from '../settings';
|
|
2
2
|
import type { EFirmwareType } from '@onekeyfe/hd-shared';
|
|
3
|
-
import type { Features } from '@onekeyfe/hd-transport';
|
|
4
3
|
import type { CommonParams, Response } from '../params';
|
|
5
|
-
import type { IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus } from '../device';
|
|
4
|
+
import type { Features, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus } from '../device';
|
|
6
5
|
|
|
7
6
|
export type FirmwareRelease = {
|
|
8
7
|
shouldUpdate?: boolean;
|
|
@@ -58,8 +58,8 @@ export interface FirmwareUpdateV3Params {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* firmwareUpdateV4
|
|
62
|
-
*
|
|
61
|
+
* firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
|
|
62
|
+
* Except for romloader, each field maps to a target accepted by bootloader.
|
|
63
63
|
*/
|
|
64
64
|
export type FirmwareUpdateV4Target =
|
|
65
65
|
| 'boot'
|
|
@@ -78,7 +78,7 @@ export interface FirmwareUpdateV4Params {
|
|
|
78
78
|
firmwareType?: EFirmwareType;
|
|
79
79
|
targetsToUpdate?: FirmwareUpdateV4Target[];
|
|
80
80
|
|
|
81
|
-
/** FW_MGMT_TARGET_ROMLOADER = 2
|
|
81
|
+
/** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */
|
|
82
82
|
romloaderBinary?: ArrayBuffer;
|
|
83
83
|
/** FW_MGMT_TARGET_BOOTLOADER = 3 */
|
|
84
84
|
bootloaderBinary?: ArrayBuffer;
|
|
@@ -95,8 +95,8 @@ export interface FirmwareUpdateV4Params {
|
|
|
95
95
|
se04Binary?: ArrayBuffer;
|
|
96
96
|
forcedUpdateRes?: boolean;
|
|
97
97
|
/**
|
|
98
|
-
* RESC bundle okpkg
|
|
99
|
-
*
|
|
98
|
+
* RESC bundle okpkg files written directly to devicePath through FilesystemFileWrite.
|
|
99
|
+
* Manual mode installs them without version comparison.
|
|
100
100
|
*/
|
|
101
101
|
resourceBundleFiles?: Array<{
|
|
102
102
|
binary: ArrayBuffer;
|
|
@@ -7,7 +7,7 @@ export type GetDeviceStateParams = CommonParams & {
|
|
|
7
7
|
scope?: DeviceStateScope;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/** Internal state-read options, not part of the public CoreApi. */
|
|
11
11
|
export type DeviceStateReadOptions = {
|
|
12
12
|
refreshSections?: DeviceStateSection[];
|
|
13
13
|
includeRaw?: boolean;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { CommonParams, Response } from '../params';
|
|
2
2
|
import type { Features } from '../device';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2 devices.
|
|
6
|
+
*/
|
|
4
7
|
export declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { CommonParams, Response } from '../params';
|
|
2
2
|
import type { OnekeyFeatures } from '../device';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`.
|
|
6
|
+
*/
|
|
4
7
|
export declare function getOnekeyFeatures(
|
|
5
8
|
connectId?: string,
|
|
6
9
|
params?: CommonParams
|
|
@@ -2,6 +2,12 @@ import type { CommonParams, Response } from '../params';
|
|
|
2
2
|
|
|
3
3
|
export type GetPassphraseStateParams = CommonParams;
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Legacy Protocol V1 wallet API.
|
|
7
|
+
*
|
|
8
|
+
* This remains supported for Protocol V1 integrations. New cross-protocol integrations
|
|
9
|
+
* and all Protocol V2 callers should use `openWalletSession`.
|
|
10
|
+
*/
|
|
5
11
|
export declare function getPassphraseState(
|
|
6
12
|
connectId?: string,
|
|
7
13
|
params?: GetPassphraseStateParams
|
package/src/types/api/index.ts
CHANGED
|
@@ -4,10 +4,12 @@ import type {
|
|
|
4
4
|
deviceFirmwareUpdate,
|
|
5
5
|
deviceGetFirmwareUpdateStatus,
|
|
6
6
|
deviceGetOnboardingStatus,
|
|
7
|
+
deviceInfoGet,
|
|
7
8
|
deviceReboot,
|
|
8
|
-
|
|
9
|
+
deviceSettingsGet,
|
|
9
10
|
deviceSettingsPageShow,
|
|
10
11
|
deviceSettingsSet,
|
|
12
|
+
deviceStatusGet,
|
|
11
13
|
deviceUploadWallpaper,
|
|
12
14
|
dirList,
|
|
13
15
|
dirMake,
|
|
@@ -15,14 +17,7 @@ import type {
|
|
|
15
17
|
fileDelete,
|
|
16
18
|
fileRead,
|
|
17
19
|
fileWrite,
|
|
18
|
-
filesystemDirList,
|
|
19
|
-
filesystemDirMake,
|
|
20
|
-
filesystemDirRemove,
|
|
21
|
-
filesystemFileDelete,
|
|
22
|
-
filesystemFileRead,
|
|
23
|
-
filesystemFileWrite,
|
|
24
20
|
filesystemFormat,
|
|
25
|
-
filesystemPathInfoQuery,
|
|
26
21
|
filesystemPermissionFix,
|
|
27
22
|
pathInfo,
|
|
28
23
|
ping,
|
|
@@ -46,6 +41,7 @@ import type { getFeatures } from './getFeatures';
|
|
|
46
41
|
import type { getDeviceState } from './getDeviceState';
|
|
47
42
|
import type { getOnekeyFeatures } from './getOnekeyFeatures';
|
|
48
43
|
import type { getPassphraseState } from './getPassphraseState';
|
|
44
|
+
import type { openWalletSession } from './openWalletSession';
|
|
49
45
|
import type { checkFirmwareRelease } from './checkFirmwareRelease';
|
|
50
46
|
import type { checkBLEFirmwareRelease } from './checkBLEFirmwareRelease';
|
|
51
47
|
import type {
|
|
@@ -171,6 +167,7 @@ import type { ConnectSettings } from '../settings';
|
|
|
171
167
|
export * from './export';
|
|
172
168
|
export type { DeviceStateScope, GetDeviceStateParams } from './getDeviceState';
|
|
173
169
|
export type { GetPassphraseStateParams } from './getPassphraseState';
|
|
170
|
+
export type { OpenWalletSessionParams, OpenWalletSessionPayload } from './openWalletSession';
|
|
174
171
|
export type { ClearSessionCacheParams, ClearSessionCachePayload } from './sessionCache';
|
|
175
172
|
|
|
176
173
|
export type CoreApi = {
|
|
@@ -182,7 +179,7 @@ export type CoreApi = {
|
|
|
182
179
|
off: typeof off;
|
|
183
180
|
emit: (event: string, ...args: any[]) => void;
|
|
184
181
|
removeAllListeners: typeof removeAllListeners;
|
|
185
|
-
dispose: () => void
|
|
182
|
+
dispose: () => void | Promise<void>;
|
|
186
183
|
call: (params: any) => Promise<any>;
|
|
187
184
|
uiResponse: typeof uiResponse;
|
|
188
185
|
cancel: (connectId?: string) => void;
|
|
@@ -216,6 +213,7 @@ export type CoreApi = {
|
|
|
216
213
|
getDeviceState: typeof getDeviceState;
|
|
217
214
|
getOnekeyFeatures: typeof getOnekeyFeatures;
|
|
218
215
|
getPassphraseState: typeof getPassphraseState;
|
|
216
|
+
openWalletSession: typeof openWalletSession;
|
|
219
217
|
deviceBackup: typeof deviceBackup;
|
|
220
218
|
deviceChangePin: typeof deviceChangePin;
|
|
221
219
|
deviceFlags: typeof deviceFlags;
|
|
@@ -245,21 +243,25 @@ export type CoreApi = {
|
|
|
245
243
|
cipherKeyValue: typeof cipherKeyValue;
|
|
246
244
|
|
|
247
245
|
/**
|
|
248
|
-
*
|
|
246
|
+
* Pro2 business API
|
|
249
247
|
*/
|
|
250
|
-
protocolInfoRequest: typeof protocolInfoRequest;
|
|
251
|
-
ping: typeof ping;
|
|
252
248
|
deviceReboot: typeof deviceReboot;
|
|
253
249
|
deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus;
|
|
254
|
-
|
|
250
|
+
deviceUploadWallpaper: typeof deviceUploadWallpaper;
|
|
251
|
+
deviceInfoGet: typeof deviceInfoGet;
|
|
252
|
+
deviceStatusGet: typeof deviceStatusGet;
|
|
253
|
+
deviceSettingsGet: typeof deviceSettingsGet;
|
|
254
|
+
protocolInfoRequest: typeof protocolInfoRequest;
|
|
255
|
+
ping: typeof ping;
|
|
255
256
|
deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
|
|
256
257
|
deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
|
|
257
258
|
deviceFactoryInfoSet: typeof deviceFactoryInfoSet;
|
|
258
259
|
deviceFactoryInfoGet: typeof deviceFactoryInfoGet;
|
|
259
260
|
deviceSettingsSet: typeof deviceSettingsSet;
|
|
260
261
|
deviceSettingsPageShow: typeof deviceSettingsPageShow;
|
|
261
|
-
deviceUploadWallpaper: typeof deviceUploadWallpaper;
|
|
262
262
|
filesystemPermissionFix: typeof filesystemPermissionFix;
|
|
263
|
+
filesystemFormat: typeof filesystemFormat;
|
|
264
|
+
uploadPortfolio: typeof uploadPortfolio;
|
|
263
265
|
fileRead: typeof fileRead;
|
|
264
266
|
fileWrite: typeof fileWrite;
|
|
265
267
|
fileDelete: typeof fileDelete;
|
|
@@ -267,15 +269,6 @@ export type CoreApi = {
|
|
|
267
269
|
dirMake: typeof dirMake;
|
|
268
270
|
dirRemove: typeof dirRemove;
|
|
269
271
|
pathInfo: typeof pathInfo;
|
|
270
|
-
filesystemFileRead: typeof filesystemFileRead;
|
|
271
|
-
filesystemFileWrite: typeof filesystemFileWrite;
|
|
272
|
-
uploadPortfolio: typeof uploadPortfolio;
|
|
273
|
-
filesystemFileDelete: typeof filesystemFileDelete;
|
|
274
|
-
filesystemDirList: typeof filesystemDirList;
|
|
275
|
-
filesystemDirMake: typeof filesystemDirMake;
|
|
276
|
-
filesystemDirRemove: typeof filesystemDirRemove;
|
|
277
|
-
filesystemPathInfoQuery: typeof filesystemPathInfoQuery;
|
|
278
|
-
filesystemFormat: typeof filesystemFormat;
|
|
279
272
|
|
|
280
273
|
/**
|
|
281
274
|
* All network function
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { CommonParams, Response } from '../params';
|
|
2
|
+
|
|
3
|
+
export type OpenWalletSessionParams =
|
|
4
|
+
| {
|
|
5
|
+
mode: 'standard';
|
|
6
|
+
deviceId?: never;
|
|
7
|
+
passphraseState?: never;
|
|
8
|
+
useEmptyPassphrase?: never;
|
|
9
|
+
initSession?: never;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
mode: 'select-hidden';
|
|
13
|
+
deviceId?: never;
|
|
14
|
+
passphraseState?: never;
|
|
15
|
+
useEmptyPassphrase?: never;
|
|
16
|
+
initSession?: never;
|
|
17
|
+
}
|
|
18
|
+
| {
|
|
19
|
+
mode: 'resume-hidden';
|
|
20
|
+
deviceId: string;
|
|
21
|
+
passphraseState: string;
|
|
22
|
+
useEmptyPassphrase?: never;
|
|
23
|
+
initSession?: never;
|
|
24
|
+
}
|
|
25
|
+
| {
|
|
26
|
+
/**
|
|
27
|
+
* Compatibility form. `useEmptyPassphrase: true` opens the standard wallet;
|
|
28
|
+
* otherwise `initSession: true` starts a fresh hidden-wallet selection, a
|
|
29
|
+
* complete wallet binding resumes a hidden wallet, and no binding starts the
|
|
30
|
+
* hidden-wallet selection flow.
|
|
31
|
+
*/
|
|
32
|
+
mode?: undefined;
|
|
33
|
+
useEmptyPassphrase?: boolean;
|
|
34
|
+
initSession?: boolean;
|
|
35
|
+
deviceId?: string;
|
|
36
|
+
passphraseState?: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type OpenWalletSessionPayloadBase = {
|
|
40
|
+
protocol: 'V1' | 'V2';
|
|
41
|
+
deviceId: string;
|
|
42
|
+
resumed: boolean;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type OpenWalletSessionPayload = OpenWalletSessionPayloadBase &
|
|
46
|
+
(
|
|
47
|
+
| {
|
|
48
|
+
walletType: 'standard';
|
|
49
|
+
passphraseState: null;
|
|
50
|
+
}
|
|
51
|
+
| {
|
|
52
|
+
walletType: 'hidden';
|
|
53
|
+
passphraseState: string;
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Opens the standard, hidden, or Attach-to-PIN wallet flow through a unified
|
|
59
|
+
* Protocol V1/V2 API.
|
|
60
|
+
*/
|
|
61
|
+
export declare function openWalletSession(
|
|
62
|
+
connectId: string,
|
|
63
|
+
params: CommonParams & OpenWalletSessionParams
|
|
64
|
+
): Response<OpenWalletSessionPayload>;
|
|
@@ -3,8 +3,10 @@ import type {
|
|
|
3
3
|
DevOnboardingStatus,
|
|
4
4
|
DeviceFactoryInfo,
|
|
5
5
|
DeviceFirmwareUpdateStatus,
|
|
6
|
-
|
|
6
|
+
DeviceSettings,
|
|
7
|
+
DeviceStatus,
|
|
7
8
|
ProtocolInfo,
|
|
9
|
+
ProtocolV2DeviceInfo,
|
|
8
10
|
Success,
|
|
9
11
|
} from '@onekeyfe/hd-transport';
|
|
10
12
|
import type {
|
|
@@ -13,7 +15,7 @@ import type {
|
|
|
13
15
|
DeviceFirmwareUpdateStatusGetParams,
|
|
14
16
|
DeviceRebootParams,
|
|
15
17
|
} from '../../api/protocol-v2/helpers';
|
|
16
|
-
import type {
|
|
18
|
+
import type { DeviceInfoGetParams } from '../../api/protocol-v2/DeviceInfoGet';
|
|
17
19
|
import type { DeviceSettingsSetParams } from '../../api/protocol-v2/DeviceSettingsSet';
|
|
18
20
|
import type { DeviceSettingsPageShowParams } from '../../api/protocol-v2/DeviceSettingsPageShow';
|
|
19
21
|
import type {
|
|
@@ -21,7 +23,7 @@ import type {
|
|
|
21
23
|
DeviceUploadWallpaperResponse,
|
|
22
24
|
} from '../../api/protocol-v2/DeviceUploadWallpaper';
|
|
23
25
|
|
|
24
|
-
//
|
|
26
|
+
// Re-export implementation parameter types as the single source of truth.
|
|
25
27
|
export type {
|
|
26
28
|
DeviceFirmwareTargetInput,
|
|
27
29
|
DeviceFirmwareUpdateParams,
|
|
@@ -30,7 +32,11 @@ export type {
|
|
|
30
32
|
DeviceFactoryInfoSetParams,
|
|
31
33
|
RebootTypeInput,
|
|
32
34
|
} from '../../api/protocol-v2/helpers';
|
|
33
|
-
export type {
|
|
35
|
+
export type {
|
|
36
|
+
DeviceInfoGetParams,
|
|
37
|
+
DeviceInfoGetTargets,
|
|
38
|
+
DeviceInfoGetTypes,
|
|
39
|
+
} from '../../api/protocol-v2/DeviceInfoGet';
|
|
34
40
|
export type { DeviceSettingsSetParams } from '../../api/protocol-v2/DeviceSettingsSet';
|
|
35
41
|
export type {
|
|
36
42
|
DeviceSettingsPageShowParams,
|
|
@@ -61,7 +67,7 @@ export type DirInfo = {
|
|
|
61
67
|
child_files?: string;
|
|
62
68
|
};
|
|
63
69
|
|
|
64
|
-
// proto
|
|
70
|
+
// All FilesystemPathInfo proto fields are required; keep this type aligned.
|
|
65
71
|
export type PathInfoResult = {
|
|
66
72
|
exist: boolean;
|
|
67
73
|
size: number;
|
|
@@ -80,6 +86,25 @@ export type PathInfoResult = {
|
|
|
80
86
|
|
|
81
87
|
// ── Method signatures ─────────────────────────────────────────────────────
|
|
82
88
|
|
|
89
|
+
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
90
|
+
export declare function deviceInfoGet(
|
|
91
|
+
connectId: string,
|
|
92
|
+
params?: CommonParams & DeviceInfoGetParams
|
|
93
|
+
): Response<ProtocolV2DeviceInfo>;
|
|
94
|
+
|
|
95
|
+
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
96
|
+
export declare function deviceStatusGet(
|
|
97
|
+
connectId: string,
|
|
98
|
+
params?: CommonParams
|
|
99
|
+
): Response<DeviceStatus>;
|
|
100
|
+
|
|
101
|
+
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
102
|
+
export declare function deviceSettingsGet(
|
|
103
|
+
connectId: string,
|
|
104
|
+
params?: CommonParams
|
|
105
|
+
): Response<DeviceSettings>;
|
|
106
|
+
|
|
107
|
+
/** @deprecated Development-only raw Protocol V2 command. */
|
|
83
108
|
export declare function protocolInfoRequest(
|
|
84
109
|
connectId: string,
|
|
85
110
|
params?: CommonParams
|
|
@@ -100,11 +125,6 @@ export declare function deviceGetOnboardingStatus(
|
|
|
100
125
|
params?: CommonParams
|
|
101
126
|
): Response<DevOnboardingStatus>;
|
|
102
127
|
|
|
103
|
-
export declare function deviceSessionOpen(
|
|
104
|
-
connectId: string,
|
|
105
|
-
params: CommonParams & DeviceSessionOpenParams
|
|
106
|
-
): Response<DeviceSession>;
|
|
107
|
-
|
|
108
128
|
export declare function deviceFirmwareUpdate(
|
|
109
129
|
connectId: string,
|
|
110
130
|
params: CommonParams & DeviceFirmwareUpdateParams
|
|
@@ -125,11 +145,17 @@ export declare function deviceFactoryInfoGet(
|
|
|
125
145
|
params?: CommonParams
|
|
126
146
|
): Response<DeviceFactoryInfo>;
|
|
127
147
|
|
|
148
|
+
/**
|
|
149
|
+
* @deprecated Use the protocol-independent `deviceSettings`.
|
|
150
|
+
*/
|
|
128
151
|
export declare function deviceSettingsSet(
|
|
129
152
|
connectId: string,
|
|
130
153
|
params: CommonParams & DeviceSettingsSetParams
|
|
131
154
|
): Response<Success>;
|
|
132
155
|
|
|
156
|
+
/**
|
|
157
|
+
* @deprecated Use `deviceSettings`, `deviceChangePin`, or `deviceWipe`.
|
|
158
|
+
*/
|
|
133
159
|
export declare function deviceSettingsPageShow(
|
|
134
160
|
connectId: string,
|
|
135
161
|
params: CommonParams & DeviceSettingsPageShowParams
|
|
@@ -197,9 +223,6 @@ export declare function pathInfo(
|
|
|
197
223
|
params: { path: string; timeoutMs?: number | string }
|
|
198
224
|
): Response<PathInfoResult>;
|
|
199
225
|
|
|
200
|
-
export declare const filesystemFileRead: typeof fileRead;
|
|
201
|
-
export declare const filesystemFileWrite: typeof fileWrite;
|
|
202
|
-
|
|
203
226
|
export declare function uploadPortfolio(
|
|
204
227
|
connectId: string,
|
|
205
228
|
params: {
|
|
@@ -208,10 +231,5 @@ export declare function uploadPortfolio(
|
|
|
208
231
|
timeoutMs?: number | string;
|
|
209
232
|
}
|
|
210
233
|
): Response<FileInfo & { portfolioUpdated: true }>;
|
|
211
|
-
export declare const filesystemFileDelete: typeof fileDelete;
|
|
212
|
-
export declare const filesystemDirList: typeof dirList;
|
|
213
|
-
export declare const filesystemDirMake: typeof dirMake;
|
|
214
|
-
export declare const filesystemDirRemove: typeof dirRemove;
|
|
215
|
-
export declare const filesystemPathInfoQuery: typeof pathInfo;
|
|
216
234
|
|
|
217
235
|
export declare function filesystemFormat(connectId: string): Response<Success>;
|