diff --git a/.gitmodules b/.gitmodules index 2ea236d7b..a39af1f9e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "submodules/firmware"] - path = submodules/firmware - url = https://github.com/OneKeyHQ/firmware.git +[submodule "submodules/onekey-protocol"] + path = submodules/onekey-protocol + url = git@github.com:OneKeyHQ/onekey-protocol.git diff --git a/packages/connect-examples/electron-example/package.json b/packages/connect-examples/electron-example/package.json index 6e1c55f49..db93e93de 100644 --- a/packages/connect-examples/electron-example/package.json +++ b/packages/connect-examples/electron-example/package.json @@ -2,7 +2,7 @@ "name": "hardware-example", "productName": "HardwareExample", "executableName": "onekey-hardware-example", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "author": "OneKey", "description": "End-to-end encrypted workspaces for teams", "main": "dist/index.js", diff --git a/packages/connect-examples/expo-example/package.json b/packages/connect-examples/expo-example/package.json index e3376f3ec..175a3aa67 100644 --- a/packages/connect-examples/expo-example/package.json +++ b/packages/connect-examples/expo-example/package.json @@ -1,6 +1,6 @@ { "name": "expo-example", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "scripts": { "start": "CONNECT_SRC=https://localhost:8087/ yarn expo start --dev-client", "android": "yarn expo run:android", @@ -19,10 +19,10 @@ "@noble/ed25519": "^2.1.0", "@noble/hashes": "^1.3.3", "@noble/secp256k1": "^1.7.1", - "@onekeyfe/hd-ble-sdk": "^1.0.26-alpha.3", - "@onekeyfe/hd-common-connect-sdk": "^1.0.26-alpha.3", - "@onekeyfe/hd-core": "^1.0.26-alpha.3", - "@onekeyfe/hd-web-sdk": "^1.0.26-alpha.3", + "@onekeyfe/hd-ble-sdk": "^1.1.0-alpha.0", + "@onekeyfe/hd-common-connect-sdk": "^1.1.0-alpha.0", + "@onekeyfe/hd-core": "^1.1.0-alpha.0", + "@onekeyfe/hd-web-sdk": "^1.1.0-alpha.0", "@onekeyfe/react-native-ble-utils": "^0.1.3", "@polkadot/util-crypto": "13.1.1", "@react-native-async-storage/async-storage": "1.21.0", diff --git a/packages/connect-examples/expo-example/src/components/BaseTestRunner/Context/TestRunnerProvider.tsx b/packages/connect-examples/expo-example/src/components/BaseTestRunner/Context/TestRunnerProvider.tsx index 0f7f7ba80..aab8e6eb5 100644 --- a/packages/connect-examples/expo-example/src/components/BaseTestRunner/Context/TestRunnerProvider.tsx +++ b/packages/connect-examples/expo-example/src/components/BaseTestRunner/Context/TestRunnerProvider.tsx @@ -1,6 +1,6 @@ import { createContext, useMemo, useState } from 'react'; -import type { Features, OnekeyFeatures } from '@onekeyfe/hd-transport'; +import type { Features } from '@onekeyfe/hd-transport'; import type { TestCaseDataWithKey } from '../types'; export const TestRunnerContext = createContext<{ @@ -13,8 +13,8 @@ export const TestRunnerContext = createContext<{ runningDeviceFeatures?: Features; setRunningDeviceFeatures?: React.Dispatch>; - runningOneKeyDeviceFeatures?: OnekeyFeatures; - setRunningOneKeyDeviceFeatures?: React.Dispatch>; + runningOneKeyDeviceFeatures?: any; + setRunningOneKeyDeviceFeatures?: React.Dispatch>; timestampBeginTest?: number; setTimestampBeginTest?: React.Dispatch>; @@ -37,7 +37,7 @@ export function TestRunnerProvider({ children }: { children: React.ReactNode }) const [runnerTestCaseTitle, setRunnerTestCaseTitle] = useState(); const [runnerDone, setRunnerDone] = useState(); const [runningDeviceFeatures, setRunningDeviceFeatures] = useState(); - const [runningOneKeyDeviceFeatures, setRunningOneKeyDeviceFeatures] = useState(); + const [runningOneKeyDeviceFeatures, setRunningOneKeyDeviceFeatures] = useState(); const [timestampBeginTest, setTimestampBeginTest] = useState(); const [timestampEndTest, setTimestampEndTest] = useState(); diff --git a/packages/connect-examples/expo-example/src/components/BaseTestRunner/useRunnerTest.ts b/packages/connect-examples/expo-example/src/components/BaseTestRunner/useRunnerTest.ts index bf296e3e0..c0c37d175 100644 --- a/packages/connect-examples/expo-example/src/components/BaseTestRunner/useRunnerTest.ts +++ b/packages/connect-examples/expo-example/src/components/BaseTestRunner/useRunnerTest.ts @@ -153,7 +153,6 @@ export function useRunnerTest(config: RunnerConfig) { try { const onekeyFeatures = await SDK.getOnekeyFeatures(connectId); - // @ts-expect-error setRunningOneKeyDeviceFeatures?.(onekeyFeatures.payload); } catch (error) { // ignore diff --git a/packages/connect-examples/expo-example/src/constants/connect.ts b/packages/connect-examples/expo-example/src/constants/connect.ts index 0bcd5c399..c51f39302 100644 --- a/packages/connect-examples/expo-example/src/constants/connect.ts +++ b/packages/connect-examples/expo-example/src/constants/connect.ts @@ -1,4 +1,5 @@ -import packageJson from '../../package.json'; +// import packageJson from '../../package.json'; -export const CONNECT_SRC = - process.env.CONNECT_SRC || `https://jssdk.onekey.so/${packageJson.version}/`; +// export const CONNECT_SRC = +// process.env.CONNECT_SRC || `https://jssdk.onekey.so/${packageJson.version}/`; +export const CONNECT_SRC = process.env.CONNECT_SRC || `https://jssdk.onekeytest.com/`; diff --git a/packages/connect-examples/expo-example/src/utils/deviceUtils.ts b/packages/connect-examples/expo-example/src/utils/deviceUtils.ts index 2a8179e82..540e59c6b 100644 --- a/packages/connect-examples/expo-example/src/utils/deviceUtils.ts +++ b/packages/connect-examples/expo-example/src/utils/deviceUtils.ts @@ -1,29 +1,34 @@ import { - getDeviceBootloaderVersion, - getDeviceFirmwareVersion, - getDeviceType, - getDeviceUUID, -} from '@onekeyfe/hd-core'; -import type { Features, OnekeyFeatures } from '@onekeyfe/hd-transport'; + getHardwareInfoFromFeatures, + getFirmwareInfoFromFeatures, + getSeInfoFromFeatures, + EDeviceType, +} from '@onekeyfe/hd-shared'; +import type { Features } from '@onekeyfe/hd-transport'; export const getReleaseUrl = ({ features }: { features?: Features }) => { - const deviceType = getDeviceType(features)?.toUpperCase() || 'UNKNOWN'; - // const { firmwareUrl, bleVersion } = getDeviceBasicInfo(features, onekeyFeatures); + if (!features) + return { + onekey_boot_url: '', + onekey_firmware_url: '', + onekey_ble_url: '', + }; + const { firmwareVersion, bootloaderVersion, bleVersion } = getFirmwareInfoFromFeatures(features); + const { deviceType } = getHardwareInfoFromFeatures(features); // classic 类型(包括classci 1s, mini, classic),不需要更新bootloader - const firmwareVersion = getDeviceFirmwareVersion(features).join('.'); - const bootloaderVersion = `${getDeviceBootloaderVersion(features)?.join('.')}`; switch (deviceType) { - case 'CLASSIC1S': + case EDeviceType.Classic1s: + case EDeviceType.ClassicPure: return { onekey_boot_url: '', onekey_firmware_url: firmwareVersion ? `https://github.com/OneKeyHQ/firmware-classic1s/releases/tag/v${firmwareVersion}` : '', - onekey_ble_url: features?.ble_ver - ? `https://github.com/OneKeyHQ/bluetooth-firmware-classic/releases/tag/v${features?.ble_ver}` + onekey_ble_url: bleVersion + ? `https://github.com/OneKeyHQ/bluetooth-firmware-classic/releases/tag/v${bleVersion}` : '', }; - case 'PRO': + case EDeviceType.Pro: return { onekey_boot_url: bootloaderVersion ? `https://github.com/OneKeyHQ/firmware-pro/releases/tag/bootloader-v${bootloaderVersion}` @@ -31,8 +36,8 @@ export const getReleaseUrl = ({ features }: { features?: Features }) => { onekey_firmware_url: firmwareVersion ? `https://github.com/OneKeyHQ/firmware-pro/releases/tag/v${firmwareVersion}` : '', - onekey_ble_url: features?.ble_ver - ? `https://github.com/OneKeyHQ/bluetooth-firmware-pro/releases/tag/v${features?.ble_ver}` + onekey_ble_url: bleVersion + ? `https://github.com/OneKeyHQ/bluetooth-firmware-pro/releases/tag/v${bleVersion}` : '', }; default: @@ -44,27 +49,31 @@ export const getReleaseUrl = ({ features }: { features?: Features }) => { } }; -export function getDeviceBasicInfo( - features: Features | undefined, - onekeyFeatures: OnekeyFeatures | undefined -) { - const deviceType = getDeviceType(features)?.toUpperCase() || 'UNKNOWN'; - const serialNumber = features && getDeviceUUID(features); - - const bleBuildId = onekeyFeatures?.onekey_ble_build_id || features?.onekey_ble_build_id; - const bleVersion = `${features?.ble_ver}-${bleBuildId}`; - - const bootloaderBuildId = onekeyFeatures?.onekey_boot_build_id || features?.onekey_boot_build_id; - const bootloaderVersion = - features && `${getDeviceBootloaderVersion(features)?.join('.')}-${bootloaderBuildId}`; - - const boardloaderVersion = - features && `${features?.onekey_board_version}-${onekeyFeatures?.onekey_board_build_id}`; - - const firmwareBuildId = - onekeyFeatures?.onekey_firmware_build_id || features?.onekey_firmware_build_id; - const firmwareVersion = - features && `${getDeviceFirmwareVersion(features)?.join('.')}-${firmwareBuildId}`; +export function getDeviceBasicInfo(features: Features | undefined) { + if (!features) + return { + deviceType: '', + serialNumber: '', + bleVersion: '', + bootloaderVersion: '', + boardloaderVersion: '', + firmwareVersion: '', + boardloaderBuildId: '', + bootloaderBuildId: '', + firmwareBuildId: '', + bleBuildId: '', + }; + const { + bootloaderVersion, + boardloaderVersion, + firmwareVersion, + firmwareBuildId, + bootloaderBuildId, + boardloaderBuildId, + bleVersion, + bleBuildId, + } = getFirmwareInfoFromFeatures(features); + const { deviceType, serialNumber } = getHardwareInfoFromFeatures(features); const { onekey_firmware_url: firmwareUrl, @@ -81,16 +90,22 @@ export function getDeviceBasicInfo( bootloaderVersion, boardloaderVersion, firmwareVersion, + bootloaderBuildId, + boardloaderBuildId, + firmwareBuildId, + bleBuildId, bootUrl, firmwareUrl, bleUrl, }; } -export function getDeviceInfo( - features: Features | undefined, - onekeyFeatures: OnekeyFeatures | undefined -) { +export function getDeviceInfo(features: Features | undefined, onekeyFeatures: any | undefined) { + if (!features) throw new Error('features is undefined'); + const _features = { + ...features, + ...onekeyFeatures, + }; const { deviceType, serialNumber, @@ -98,32 +113,21 @@ export function getDeviceInfo( bootloaderVersion, boardloaderVersion, firmwareVersion, - } = getDeviceBasicInfo(features, onekeyFeatures); - - const firmwareHash = onekeyFeatures?.onekey_firmware_hash || features?.onekey_firmware_hash; - - const bootloaderHash = - onekeyFeatures?.onekey_boot_hash || features?.onekey_boot_hash || features?.bootloader_hash; - - const se01BuildId = onekeyFeatures?.onekey_se01_build_id || features?.onekey_se01_build_id; - const se01Version = `${features?.onekey_se01_version || features?.se_ver}-${se01BuildId}`; - const se01Hash = onekeyFeatures?.onekey_se01_hash; - - const se02BuildId = onekeyFeatures?.onekey_se02_build_id; - const se02Version = `${features?.onekey_se02_version}-${se02BuildId}`; - const se02Hash = onekeyFeatures?.onekey_se02_hash; - - const se03BuildId = onekeyFeatures?.onekey_se03_build_id; - const se03Version = `${features?.onekey_se03_version}-${se03BuildId}`; - const se03Hash = onekeyFeatures?.onekey_se03_hash; - - const se04BuildId = onekeyFeatures?.onekey_se04_build_id; - const se04Version = `${features?.onekey_se04_version}-${se04BuildId}`; - const se04Hash = onekeyFeatures?.onekey_se04_hash; + } = getDeviceBasicInfo(_features); - const boardloaderHash = onekeyFeatures?.onekey_board_hash || features?.onekey_board_hash; + const { firmwareHash, bootloaderHash, boardloaderHash, bleHash } = + getFirmwareInfoFromFeatures(_features); - const bleHash = onekeyFeatures?.onekey_ble_hash || features?.onekey_ble_hash; + const { + se01Version, + se01Hash, + se02Version, + se02Hash, + se03Version, + se03Hash, + se04Version, + se04Hash, + } = getSeInfoFromFeatures(_features); return { deviceType, @@ -146,3 +150,80 @@ export function getDeviceInfo( bleHash, }; } + +export function getFeaturesBetweenProtocol(features: Features | undefined) { + if (!features) return {}; + + const hardwareInfo = getHardwareInfoFromFeatures(features); + const firmwareInfo = getFirmwareInfoFromFeatures(features); + const seInfo = getSeInfoFromFeatures(features); + + return { + ...features, + + // Firmware info + onekey_firmware_version: firmwareInfo.firmwareVersion, + onekey_firmware_hash: firmwareInfo.firmwareHash, + onekey_firmware_build_id: firmwareInfo.firmwareBuildId, + + onekey_boot_version: firmwareInfo.bootloaderVersion, + onekey_boot_build_id: firmwareInfo.bootloaderBuildId, + onekey_boot_hash: firmwareInfo.bootloaderHash, + onekey_board_version: firmwareInfo.boardloaderVersion, + onekey_board_build_id: firmwareInfo.boardloaderBuildId, + onekey_board_hash: firmwareInfo.boardloaderHash, + onekey_ble_version: firmwareInfo.bleVersion, + onekey_ble_name: firmwareInfo.bleName, + onekey_ble_build_id: firmwareInfo.bleBuildId, + onekey_ble_hash: firmwareInfo.bleHash, + bleMac: firmwareInfo.bleMac, + + // SE info + onekey_se_type: seInfo.seType, + onekey_se01_type: seInfo.se01Type, + onekey_se02_type: seInfo.se02Type, + onekey_se03_type: seInfo.se03Type, + onekey_se04_type: seInfo.se04Type, + onekey_se01_version: seInfo.se01Version, + onekey_se02_version: seInfo.se02Version, + onekey_se03_version: seInfo.se03Version, + onekey_se04_version: seInfo.se04Version, + onekey_se01_hash: seInfo.se01Hash, + onekey_se02_hash: seInfo.se02Hash, + onekey_se03_hash: seInfo.se03Hash, + onekey_se04_hash: seInfo.se04Hash, + onekey_se01_boot_version: seInfo.se01BootVersion, + onekey_se02_boot_version: seInfo.se02BootVersion, + onekey_se03_boot_version: seInfo.se03BootVersion, + onekey_se04_boot_version: seInfo.se04BootVersion, + onekey_se01_boot_hash: seInfo.se01BootHash, + onekey_se02_boot_hash: seInfo.se02BootHash, + onekey_se03_boot_hash: seInfo.se03BootHash, + onekey_se04_boot_hash: seInfo.se04BootHash, + onekey_se01_boot_build_id: seInfo.se01BootBuildId, + onekey_se02_boot_build_id: seInfo.se02BootBuildId, + onekey_se03_boot_build_id: seInfo.se03BootBuildId, + onekey_se04_boot_build_id: seInfo.se04BootBuildId, + onekey_se01_build_id: seInfo.se01BuildId, + onekey_se02_build_id: seInfo.se02BuildId, + onekey_se03_build_id: seInfo.se03BuildId, + onekey_se04_build_id: seInfo.se04BuildId, + onekey_se01_state: seInfo.se01State, + onekey_se02_state: seInfo.se02State, + onekey_se03_state: seInfo.se03State, + onekey_se04_state: seInfo.se04State, + + // Hardware info + device_id: hardwareInfo.serialNumber, + label: hardwareInfo.label, + onekey_device_type: hardwareInfo.deviceType, + hardwareVersion: hardwareInfo.hardwareVersion, + hardwareVersionRawAdc: hardwareInfo.hardwareVersionRawAdc, + onekey_serial: hardwareInfo.serialNumber, + onekey_serial_no: hardwareInfo.serialNumber, + serial_no: hardwareInfo.serialNumber, + init_state: hardwareInfo.init_state, + language: hardwareInfo.language, + passphrase_protection: hardwareInfo.passphrase_protection, + }; +} diff --git a/packages/connect-examples/expo-example/src/views/FirmwareScreen/DeviceField.tsx b/packages/connect-examples/expo-example/src/views/FirmwareScreen/DeviceField.tsx index 59f671c70..13d506528 100644 --- a/packages/connect-examples/expo-example/src/views/FirmwareScreen/DeviceField.tsx +++ b/packages/connect-examples/expo-example/src/views/FirmwareScreen/DeviceField.tsx @@ -1,7 +1,8 @@ +import { Features } from '@onekeyfe/hd-core'; import { memo } from 'react'; import { Stack, Text, XStack } from 'tamagui'; import { useDeviceFieldContext } from './DeviceFieldContext'; -import { getReleaseUrl } from '../../utils/deviceUtils'; +import { getFeaturesBetweenProtocol, getReleaseUrl } from '../../utils/deviceUtils'; import { useMedia } from '../../provider/MediaProvider'; interface DeviceFieldProps { @@ -10,15 +11,23 @@ interface DeviceFieldProps { } function isNil(value: string | undefined | null): value is string { - return value == null || value.trim() === '' || value.trim() === 'unknown'; + return ( + value === undefined || + value == null || + (value.trim && (value.trim() === '' || value.trim() === 'unknown')) + ); } function DeviceFieldView({ field, value }: DeviceFieldProps) { const { features, onekeyFeatures } = useDeviceFieldContext(); const media = useMedia(); const fieldValue = - (onekeyFeatures as Record)?.[field] ?? - (features as Record)?.[field] ?? + ( + getFeaturesBetweenProtocol({ + ...features, + ...onekeyFeatures, + } as Features) as Record + )?.[field] ?? ( getReleaseUrl({ features, @@ -38,7 +47,7 @@ function DeviceFieldView({ field, value }: DeviceFieldProps) { {`${field}: `} - {fieldValue?.startsWith('http') ? ( + {fieldValue && fieldValue.startsWith && fieldValue?.startsWith('http') ? ( - {fieldValue} + {fieldValue ?? ''} ) : ( onekeyFeatures?.[field] ?? features?.[field] ?? ''; + const getFieldValue = (field: keyof Features) => features?.[field] ?? ''; const exportInfo = () => { const markdown = []; @@ -68,7 +93,7 @@ export function ExportDeviceInfo() { bootloaderVersion, boardloaderVersion, firmwareVersion, - } = getDeviceBasicInfo(features, onekeyFeatures); + } = getDeviceBasicInfo(features); const bootloaderMode = intl.formatMessage({ id: @@ -106,7 +131,7 @@ export function ExportDeviceInfo() { // markdown.push(`| --- | --- |`); deviceInfoKeys.forEach(keys => { keys.forEach(key => { - const value = getFieldValue(key); + const value = getFieldValue(key as keyof Features); markdown.push(`${key}: ${value}`); }); markdown.push(``); @@ -119,7 +144,7 @@ export function ExportDeviceInfo() { // markdown.push(`| --- | --- |`); deviceSEInfoKeys.forEach(keys => { keys.forEach(key => { - const value = getFieldValue(key); + const value = getFieldValue(key as keyof Features); markdown.push(`${key}: ${value}`); }); markdown.push(``); diff --git a/packages/connect-examples/expo-example/src/views/FirmwareScreen/index.tsx b/packages/connect-examples/expo-example/src/views/FirmwareScreen/index.tsx index ae5b70c87..251efef70 100644 --- a/packages/connect-examples/expo-example/src/views/FirmwareScreen/index.tsx +++ b/packages/connect-examples/expo-example/src/views/FirmwareScreen/index.tsx @@ -399,15 +399,23 @@ function FirmwareUpdate({ const [showUpdateDialog, setShowUpdateDialog] = useState(false); + const _features = { + ...(features || {}), + ...(onekeyFeatures || {}), + }; const { deviceType, serialNumber, bleVersion, bootloaderVersion, boardloaderVersion, + boardloaderBuildId, + bootloaderBuildId, + firmwareBuildId, + bleBuildId, firmwareVersion, - } = getDeviceBasicInfo(features, onekeyFeatures); - const deviceTypeLowerCase = deviceType.toLowerCase(); + } = getDeviceBasicInfo(_features as Features); + const deviceTypeLowerCase = deviceType?.toLowerCase() || ''; const loadOnekeyFeatures = useCallback(() => { if (!sdk) return; @@ -670,19 +678,19 @@ function FirmwareUpdate({ /> TODO: description", "author": "OneKey", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", @@ -25,8 +25,8 @@ "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues" }, "dependencies": { - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport": "^1.0.26-alpha.3", + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport": "^1.1.0-alpha.0", "axios": "^0.27.2", "bignumber.js": "^9.0.2", "bytebuffer": "^5.0.1", diff --git a/packages/core/src/api/FirmwareUpdateV2.ts b/packages/core/src/api/FirmwareUpdateV2.ts index ac4b49151..dadb3c739 100644 --- a/packages/core/src/api/FirmwareUpdateV2.ts +++ b/packages/core/src/api/FirmwareUpdateV2.ts @@ -3,31 +3,27 @@ import { Deferred, EDeviceType, ERRORS, - HardwareError, HardwareErrorCode, } from '@onekeyfe/hd-shared'; import semver from 'semver'; import { UI_REQUEST } from '../constants/ui-request'; -import { BaseMethod } from './BaseMethod'; import { validateParams } from './helpers/paramsValidator'; import { DevicePool } from '../device/DevicePool'; import { getBinary, getInfo, getSysResourceBinary } from './firmware/getBinary'; import { updateResources, uploadFirmware } from './firmware/uploadFirmware'; import { getDeviceType, - getDeviceUUID, wait, getLogger, LoggerNames, getDeviceFirmwareVersion, + getDeviceBootloaderVersion, } from '../utils'; import { createUiMessage, FirmwareUpdateTipMessage } from '../events/ui-request'; -import { DeviceModelToTypes } from '../types'; import { DataManager } from '../data-manager'; import type { KnownDevice, Features } from '../types'; -import type { Device } from '../device/Device'; -import { DEVICE } from '../events'; +import { FirmwareUpdateBaseMethod } from './firmware/FirmwareUpdateBaseMethod'; type Params = { binary?: ArrayBuffer; @@ -39,7 +35,7 @@ type Params = { const Log = getLogger(LoggerNames.Method); -export default class FirmwareUpdateV2 extends BaseMethod { +export default class FirmwareUpdateV2 extends FirmwareUpdateBaseMethod { checkPromise: Deferred | null = null; init() { @@ -96,24 +92,6 @@ export default class FirmwareUpdateV2 extends BaseMethod { ); }; - private async _promptDeviceInBootloaderForWebDevice({ device }: { device: Device }) { - return new Promise((resolve, reject) => { - if (this.device.listenerCount(DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE) > 0) { - this.device.emit( - DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE, - this.device, - (err, deviceId) => { - if (err) { - reject(err); - } else { - resolve(deviceId); - } - } - ); - } - }); - } - checkDeviceToBootloader(connectId: string | undefined) { this.checkPromise = createDeferred(); const env = DataManager.getSettings('env'); @@ -147,9 +125,7 @@ export default class FirmwareUpdateV2 extends BaseMethod { try { this.postTipMessage(FirmwareUpdateTipMessage.SelectDeviceInBootloaderForWebDevice); - const confirmed = await this._promptDeviceInBootloaderForWebDevice({ - device: this.device, - }); + const confirmed = await this._promptDeviceInBootloaderForWebDevice(); if (confirmed) { await this._checkDeviceInBootloaderMode(connectId, intervalTimer, timeoutTimer); } @@ -195,36 +171,14 @@ export default class FirmwareUpdateV2 extends BaseMethod { }, 30000); } - private async _checkDeviceInBootloaderMode( - connectId: string | undefined, - intervalTimer?: ReturnType, - timeoutTimer?: ReturnType - ) { - const deviceDiff = await this.device.deviceConnector?.enumerate(); - const devicesDescriptor = deviceDiff?.descriptors ?? []; - const { deviceList } = await DevicePool.getDevices(devicesDescriptor, connectId); - - if (deviceList.length === 1 && deviceList[0]?.features?.bootloader_mode) { - // should update current device from cache - // because device was reboot and had some new requests - this.device.updateFromCache(deviceList[0]); - this.device.commands.disposed = false; - - if (intervalTimer) clearInterval(intervalTimer); - if (timeoutTimer) clearTimeout(timeoutTimer); - this.checkPromise?.resolve(true); - return true; - } - return false; - } - isEnteredManuallyBoot(features: Features) { const deviceType = getDeviceType(features); const isMini = deviceType === EDeviceType.Mini; + const bootloaderVersion = getDeviceBootloaderVersion(features).join('.'); const isBoot183ClassicUpBle = this.params.updateType === 'firmware' && deviceType === EDeviceType.Classic && - features.bootloader_version === '1.8.3'; + bootloaderVersion === '1.8.3'; return isMini || isBoot183ClassicUpBle; } @@ -268,13 +222,11 @@ export default class FirmwareUpdateV2 extends BaseMethod { async run() { const { device, params } = this; - const { features, commands } = device; - const deviceType = getDeviceType(features); + const { features } = device; this.checkVersionForCopyTouchResource(features); if (!features?.bootloader_mode && features) { - const uuid = getDeviceUUID(features); // should go to bootloader mode manually if (this.isEnteredManuallyBoot(features)) { return Promise.reject(ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateManuallyEnterBoot)); @@ -302,45 +254,7 @@ export default class FirmwareUpdateV2 extends BaseMethod { } } - // check if the device commands has been disposed - this.device?.commands?.checkDisposed(); - - // auto go to bootloader mode - try { - this.postTipMessage('AutoRebootToBootloader'); - const bootRes = await commands.typedCall('DeviceBackToBoot', 'Success'); - // @ts-expect-error - if (bootRes.type === 'CallMethodError') { - throw ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure); - } - this.postTipMessage('GoToBootloaderSuccess'); - this.checkDeviceToBootloader(this.payload.connectId); - - // force clean classic device cache so that the device can initialize again - if (DeviceModelToTypes.model_classic.includes(deviceType)) { - DevicePool.clearDeviceCache(uuid); - } - delete DevicePool.devicesCache['']; - await this.checkPromise?.promise; - this.checkPromise = null; - - // check if the device commands has been disposed - this.device?.commands?.checkDisposed(); - - /** - * Touch 1 with bootloader v2.5.0 issue: BLE chip need more time for looking up name, here change the delay time to 3000ms after rebooting. - */ - const isTouch = DeviceModelToTypes.model_touch.includes(deviceType); - await wait(isTouch ? 3000 : 1500); - } catch (e) { - if (e instanceof HardwareError) { - return Promise.reject(e); - } - console.log('auto go to bootloader mode failed: ', e); - return Promise.reject( - ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure) - ); - } + await this.enterBootloaderMode(); } let binary; diff --git a/packages/core/src/api/FirmwareUpdateV3.ts b/packages/core/src/api/FirmwareUpdateV3.ts index 4a2d18e52..60f298a8d 100644 --- a/packages/core/src/api/FirmwareUpdateV3.ts +++ b/packages/core/src/api/FirmwareUpdateV3.ts @@ -280,7 +280,7 @@ export default class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod { setTimeout(() => { reject(ERRORS.TypedError(HardwareErrorCode.DeviceInitializeFailed)); diff --git a/packages/core/src/api/GetOnekeyFeatures.ts b/packages/core/src/api/GetOnekeyFeatures.ts index 089f3e1dd..9293ce413 100644 --- a/packages/core/src/api/GetOnekeyFeatures.ts +++ b/packages/core/src/api/GetOnekeyFeatures.ts @@ -1,7 +1,8 @@ -import semver from 'semver'; +import { Features, MessageKey } from '@onekeyfe/hd-transport'; import { UI_REQUEST } from '../constants/ui-request'; -import { fixVersion } from '../utils/deviceFeaturesUtils'; +import { getSupportMessageVersion } from '../utils/deviceFeaturesUtils'; import { BaseMethod } from './BaseMethod'; +import { cherryPickFeaturesParams } from '../device/utils'; export default class GetOnekeyFeatures extends BaseMethod { init() { @@ -15,9 +16,19 @@ export default class GetOnekeyFeatures extends BaseMethod { } async run() { - const { message } = await this.device.commands.typedCall('OnekeyGetFeatures', 'OnekeyFeatures'); - if (!!message.onekey_firmware_version && !semver.valid(message.onekey_firmware_version)) { - message.onekey_firmware_version = fixVersion(message.onekey_firmware_version); + const { messageVersion } = getSupportMessageVersion(this.device.features); + let message: Features; + if (messageVersion === 'latest') { + const v2Res = await this.device.commands.typedCall('GetFeatures', 'Features', { + ok_dev_info_req: cherryPickFeaturesParams({ factory: true, normal: true }), + }); + message = v2Res.message; + } else { + const v1Res = (await this.device.commands.typedCall( + 'OnekeyGetFeatures' as MessageKey, + 'OnekeyFeatures' as MessageKey + )) as any; + message = v1Res.message; } return Promise.resolve(message); } diff --git a/packages/core/src/api/device/DeviceRebootToBoardloader.ts b/packages/core/src/api/device/DeviceRebootToBoardloader.ts index 670da31dd..1a6d7f9dd 100644 --- a/packages/core/src/api/device/DeviceRebootToBoardloader.ts +++ b/packages/core/src/api/device/DeviceRebootToBoardloader.ts @@ -1,8 +1,9 @@ -import { BaseMethod } from '../BaseMethod'; +import { OneKeyRebootType } from '@onekeyfe/hd-transport'; import type { RebootToBoardloaderParams } from '../../types/api/deviceRebootToBoardloader'; +import { FirmwareUpdateBaseMethod } from '../firmware/FirmwareUpdateBaseMethod'; // Reboot BoardLoader -export default class DeviceRebootToBoardloader extends BaseMethod { +export default class DeviceRebootToBoardloader extends FirmwareUpdateBaseMethod { init() { this.useDevicePassphraseState = false; this.skipForceUpdateCheck = true; @@ -20,10 +21,7 @@ export default class DeviceRebootToBoardloader extends BaseMethod { +export default class DeviceRebootToBootloader extends FirmwareUpdateBaseMethod { init() { this.useDevicePassphraseState = false; this.skipForceUpdateCheck = true; @@ -20,7 +20,7 @@ export default class DeviceRebootToBootloader extends BaseMethod { +export default class DeviceUpdateReboot extends FirmwareUpdateBaseMethod { init() { this.useDevicePassphraseState = false; this.skipForceUpdateCheck = true; + this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER]; } async run() { - const res = await this.device.commands.typedCall('DeviceBackToBoot', 'Success'); + const res = await this.reboot(OneKeyRebootType.BootLoader); return Promise.resolve(res.message); } diff --git a/packages/core/src/api/firmware/FirmwareUpdateBaseMethod.ts b/packages/core/src/api/firmware/FirmwareUpdateBaseMethod.ts index b13af42b3..b71cbb3a6 100644 --- a/packages/core/src/api/firmware/FirmwareUpdateBaseMethod.ts +++ b/packages/core/src/api/firmware/FirmwareUpdateBaseMethod.ts @@ -6,6 +6,7 @@ import { HardwareError, HardwareErrorCode, } from '@onekeyfe/hd-shared'; +import { OneKeyRebootType } from '@onekeyfe/hd-transport'; import type { KnownDevice } from '../../types'; import { @@ -23,6 +24,7 @@ import { DataManager } from '../../data-manager'; import { BaseMethod } from '../BaseMethod'; import { DEVICE } from '../../events'; import { PROTO } from '../../constants'; +import { getSupportMessageVersion } from '../../utils/deviceFeaturesUtils'; const Log = getLogger(LoggerNames.Method); const SESSION_ERROR = 'session not found'; @@ -82,7 +84,7 @@ export class FirmwareUpdateBaseMethod extends BaseMethod { ); }; - private async _promptDeviceInBootloaderForWebDevice() { + async _promptDeviceInBootloaderForWebDevice() { return new Promise((resolve, reject) => { if (this.device.listenerCount(DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE) > 0) { this.device.emit( @@ -179,7 +181,7 @@ export class FirmwareUpdateBaseMethod extends BaseMethod { }, 30000); } - private async _checkDeviceInBootloaderMode( + async _checkDeviceInBootloaderMode( connectId: string | undefined, intervalTimer?: ReturnType, timeoutTimer?: ReturnType @@ -202,18 +204,66 @@ export class FirmwareUpdateBaseMethod extends BaseMethod { return false; } - async enterBootloaderMode() { + async reboot(rebootType: OneKeyRebootType) { const typedCall = this.device.getCommands().typedCall.bind(this.device.getCommands()); + const { messageVersion } = getSupportMessageVersion(this.device.features); + // TODO: fix it + if (messageVersion === 'latest') { + try { + return await typedCall('OneKeyReboot', 'Success', { + reboot_type: rebootType, + }); + } catch (e) { + Log.error('FirmwareUpdateBaseMethod [reboot] OneKeyReboot failed: ', e); + return { + type: 'Success', + message: 'reboot success', + }; + } + } + + switch (rebootType) { + case OneKeyRebootType.BootLoader: + return typedCall('DeviceBackToBoot', 'Success', { + reboot_type: OneKeyRebootType.BootLoader, + }); + // On Touch devices, messsage code 904 is RebootToBoardloader + // so BininOutMessageSE message code 904 is used here + case OneKeyRebootType.Boardloader: + return typedCall('BixinOutMessageSE', 'Success'); + case OneKeyRebootType.Normal: { + try { + return await typedCall('OneKeyReboot', 'Success', { + reboot_type: OneKeyRebootType.Normal, + }); + } catch (e) { + Log.error('FirmwareUpdateBaseMethod [reboot] OneKeyReboot failed: ', e); + return { + type: 'Success', + message: 'reboot success', + }; + } + } + default: + throw new Error('Invalid reboot type'); + } + } + + async enterBootloaderMode() { if (this.device.features && !this.device.features.bootloader_mode) { const uuid = getDeviceUUID(this.device.features); const deviceType = getDeviceType(this.device.features); // auto go to bootloader mode try { this.postTipMessage(FirmwareUpdateTipMessage.AutoRebootToBootloader); - const bootRes = await typedCall('DeviceBackToBoot', 'Success'); - // @ts-expect-error - if (bootRes.type === 'CallMethodError') { - throw ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure); + try { + // TODO: fix it + const bootRes = await this.reboot(OneKeyRebootType.BootLoader); + if (bootRes.type === 'CallMethodError') { + throw ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure); + } + } catch (e) { + Log.error('FirmwareUpdateBaseMethod [enterBootloaderMode] OneKeyReboot failed: ', e); } this.postTipMessage(FirmwareUpdateTipMessage.GoToBootloaderSuccess); this.checkDeviceToBootloader(this.payload.connectId); @@ -225,6 +275,9 @@ export class FirmwareUpdateBaseMethod extends BaseMethod { delete DevicePool.devicesCache['']; await this.checkPromise?.promise; this.checkPromise = null; + + // check if the device commands has been disposed + this.device?.commands?.checkDisposed(); /** * Touch 1 with bootloader v2.5.0 issue: BLE chip need more time for looking up name, here change the delay time to 3000ms after rebooting. */ diff --git a/packages/core/src/api/firmware/bootloaderHelper.ts b/packages/core/src/api/firmware/bootloaderHelper.ts index 832134f8e..f862f75fe 100644 --- a/packages/core/src/api/firmware/bootloaderHelper.ts +++ b/packages/core/src/api/firmware/bootloaderHelper.ts @@ -1,7 +1,7 @@ import semver from 'semver'; import { EDeviceType } from '@onekeyfe/hd-shared'; import { Features, IVersionArray } from '../../types'; -import { getDeviceType } from '../../utils'; +import { getDeviceBoardloaderVersion, getDeviceType } from '../../utils'; export function shouldUpdateBootloaderForClassicAndMini({ currentVersion, @@ -36,9 +36,10 @@ export function shouldUpdateBootloaderForClassicAndMini({ export function isEnteredManuallyBoot(features: Features, updateType: string) { const deviceType = getDeviceType(features); const isMini = deviceType === EDeviceType.Mini; + const bootloaderVersion = getDeviceBoardloaderVersion(features); const isBoot183ClassicUpBle = updateType === 'firmware' && deviceType === EDeviceType.Classic && - features.bootloader_version === '1.8.3'; + bootloaderVersion.join('.') === '1.8.3'; return isMini || isBoot183ClassicUpBle; } diff --git a/packages/core/src/api/firmware/uploadFirmware.ts b/packages/core/src/api/firmware/uploadFirmware.ts index b2b3b8cda..7e733854a 100644 --- a/packages/core/src/api/firmware/uploadFirmware.ts +++ b/packages/core/src/api/firmware/uploadFirmware.ts @@ -24,6 +24,7 @@ import { DeviceModelToTypes, KnownDevice } from '../../types'; import { bytesToHex } from '../helpers/hexUtils'; import { DataManager } from '../../data-manager'; import { DevicePool } from '../../device/DevicePool'; +import { cherryPickFeaturesParams } from '../../device/utils'; const NEW_BOOT_UPRATE_FIRMWARE_VERSION = '2.4.5'; const SESSION_ERROR = 'session not found'; @@ -241,7 +242,7 @@ const newTouchUpdateProcess = async ( await device.deviceConnector?.acquire(device.originalDescriptor.id, null, true); const typedCall = device.getCommands().typedCall.bind(device.getCommands()); await Promise.race([ - typedCall('Initialize', 'Features', {}), + typedCall('StartSession', 'Features', {}), new Promise((_, reject) => { setTimeout(() => { reject(ERRORS.TypedError(HardwareErrorCode.DeviceInitializeFailed)); diff --git a/packages/core/src/api/test/TestInitializeDeviceDuration.ts b/packages/core/src/api/test/TestInitializeDeviceDuration.ts index 391515a05..6d81317a1 100644 --- a/packages/core/src/api/test/TestInitializeDeviceDuration.ts +++ b/packages/core/src/api/test/TestInitializeDeviceDuration.ts @@ -1,4 +1,5 @@ import { UI_REQUEST } from '../../constants/ui-request'; +import { getSupportMessageVersion } from '../../utils/deviceFeaturesUtils'; import { BaseMethod } from '../BaseMethod'; export default class TestInitializeDeviceDuration extends BaseMethod { @@ -14,7 +15,7 @@ export default class TestInitializeDeviceDuration extends BaseMethod { async run() { const beginTime = Date.now(); - await this.device.commands.typedCall('Initialize', 'Features'); + await this.device.commands.typedCall('StartSession', 'Features', {}); const endTime = Date.now(); const duration = endTime - beginTime; return Promise.resolve(duration); diff --git a/packages/core/src/data-manager/DataManager.ts b/packages/core/src/data-manager/DataManager.ts index e91918459..1c0388c67 100644 --- a/packages/core/src/data-manager/DataManager.ts +++ b/packages/core/src/data-manager/DataManager.ts @@ -3,6 +3,7 @@ import semver from 'semver'; import { EDeviceType } from '@onekeyfe/hd-shared'; import MessagesJSON from '../data/messages/messages.json'; import MessagesLegacyV1JSON from '../data/messages/messages_legacy_v1.json'; +import MessagesLegacyV2JSON from '../data/messages/messages_legacy_v2.json'; import { getTimeStamp, getDeviceBLEFirmwareVersion, @@ -27,7 +28,7 @@ import { findLatestRelease, getReleaseChangelog, getReleaseStatus } from '../uti export type IFirmwareField = 'firmware' | 'firmware-v2' | 'firmware-v6'; -export type MessageVersion = 'latest' | 'v1'; +export type MessageVersion = 'latest' | 'v1' | 'v2'; export default class DataManager { static deviceMap: DeviceTypeMap = { @@ -64,6 +65,7 @@ export default class DataManager { static messages: { [version in MessageVersion]: JSON } = { latest: MessagesJSON as unknown as JSON, v1: MessagesLegacyV1JSON as unknown as JSON, + v2: MessagesLegacyV2JSON as unknown as JSON, }; static lastCheckTimestamp = 0; diff --git a/packages/core/src/data-manager/MessagesConfig.ts b/packages/core/src/data-manager/MessagesConfig.ts index e1eff3d20..2e9477bef 100644 --- a/packages/core/src/data-manager/MessagesConfig.ts +++ b/packages/core/src/data-manager/MessagesConfig.ts @@ -10,11 +10,11 @@ type DeviceVersionConfig = { export const PROTOBUF_MESSAGE_CONFIG: DeviceVersionConfig = { model_mini: [ - { minVersion: '3.3.0', messageVersion: 'latest' }, + { minVersion: '3.3.0', messageVersion: 'v2' }, { minVersion: '0.0.0', messageVersion: 'v1' }, ], model_touch: [ - { minVersion: '4.5.0', messageVersion: 'latest' }, + { minVersion: '4.5.0', messageVersion: 'v2' }, { minVersion: '0.0.0', messageVersion: 'v1' }, ], }; diff --git a/packages/core/src/data-manager/TransportManager.ts b/packages/core/src/data-manager/TransportManager.ts index a1970b4c4..d78f544cf 100644 --- a/packages/core/src/data-manager/TransportManager.ts +++ b/packages/core/src/data-manager/TransportManager.ts @@ -59,7 +59,9 @@ export default class TransportManager { } else { await this.transport.init(HttpLogger); } - Log.debug('Configuring transports'); + Log.debug('Configuring transports', this.messageVersion); + this.currentMessages = this.defaultMessages; + this.messageVersion = 'latest'; await this.transport.configure(JSON.stringify(this.defaultMessages)); Log.debug('Configuring transports done'); } catch (error) { @@ -74,6 +76,7 @@ export default class TransportManager { Log.debug(`Begin reconfiguring transports`); const { messageVersion, messages } = getSupportMessageVersion(features); + console.error('caikaisheng reconfigure', messageVersion); if (this.currentMessages === messages || !messages) { return; } diff --git a/packages/core/src/data/messages/messages.json b/packages/core/src/data/messages/messages.json index 9d98f690c..743caa9c3 100644 --- a/packages/core/src/data/messages/messages.json +++ b/packages/core/src/data/messages/messages.json @@ -341,6 +341,38 @@ } } }, + "BenchmarkListNames": { + "fields": {} + }, + "BenchmarkNames": { + "fields": { + "names": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "BenchmarkRun": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "BenchmarkResult": { + "fields": { + "value": { + "type": "string", + "id": 1 + }, + "unit": { + "type": "string", + "id": 3 + } + } + }, "BenfenGetAddress": { "fields": { "address_n": { @@ -528,10 +560,12 @@ } }, "msg_count": { + "rule": "required", "type": "uint32", "id": 2 }, "account_number": { + "rule": "required", "type": "sint64", "id": 3 }, @@ -544,10 +578,12 @@ "id": 5 }, "sequence": { + "rule": "required", "type": "sint64", "id": 6 }, "source": { + "rule": "required", "type": "sint64", "id": 7 } @@ -573,6 +609,7 @@ "BinanceInputOutput": { "fields": { "address": { + "rule": "required", "type": "string", "id": 1 }, @@ -586,10 +623,12 @@ "BinanceCoin": { "fields": { "amount": { + "rule": "required", "type": "sint64", "id": 1 }, "denom": { + "rule": "required", "type": "string", "id": 2 } @@ -604,14 +643,17 @@ "id": 1 }, "ordertype": { + "rule": "required", "type": "BinanceOrderType", "id": 2 }, "price": { + "rule": "required", "type": "sint64", "id": 3 }, "quantity": { + "rule": "required", "type": "sint64", "id": 4 }, @@ -620,6 +662,7 @@ "id": 5 }, "side": { + "rule": "required", "type": "BinanceOrderSide", "id": 6 }, @@ -628,6 +671,7 @@ "id": 7 }, "timeinforce": { + "rule": "required", "type": "BinanceTimeInForce", "id": 8 } @@ -827,6 +871,10 @@ "root_fingerprint": { "type": "uint32", "id": 3 + }, + "descriptor": { + "type": "string", + "id": 4 } } }, @@ -874,6 +922,10 @@ "rule": "required", "type": "string", "id": 1 + }, + "mac": { + "type": "bytes", + "id": 2 } } }, @@ -1067,6 +1119,48 @@ "options": { "default": false } + }, + "serialize": { + "type": "bool", + "id": 13, + "options": { + "default": true + } + }, + "coinjoin_request": { + "type": "CoinJoinRequest", + "id": 14 + } + }, + "nested": { + "CoinJoinRequest": { + "fields": { + "fee_rate": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "no_fee_threshold": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "min_registrable_amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "mask_public_key": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 5 + } + } } } }, @@ -1094,7 +1188,8 @@ "TXFINISHED": 3, "TXEXTRADATA": 4, "TXORIGINPUT": 5, - "TXORIGOUTPUT": 6 + "TXORIGOUTPUT": 6, + "TXPAYMENTREQ": 7 } }, "TxRequestDetailsType": { @@ -1289,6 +1384,13 @@ "script_pubkey": { "type": "bytes", "id": 19 + }, + "coinjoin_flags": { + "type": "uint32", + "id": 20, + "options": { + "default": 0 + } } } }, @@ -1351,6 +1453,13 @@ "orig_index": { "type": "uint32", "id": 11 + }, + "payment_req_index": { + "type": "uint32", + "id": 12, + "options": { + "(experimental_field)": true + } } } } @@ -1436,8 +1545,20 @@ "script_pubkey": { "type": "bytes", "id": 19 + }, + "coinjoin_flags": { + "type": "uint32", + "id": 20, + "options": { + "default": 0 + } } - } + }, + "reserved": [ + [10, 10], + [11, 11], + [12, 12] + ] }, "TxOutput": { "fields": { @@ -1480,8 +1601,20 @@ "orig_index": { "type": "uint32", "id": 11 + }, + "payment_req_index": { + "type": "uint32", + "id": 12, + "options": { + "(experimental_field)": true + } } - } + }, + "reserved": [ + [7, 7], + [8, 8], + [9, 9] + ] }, "PrevTx": { "fields": { @@ -1528,7 +1661,14 @@ "type": "uint32", "id": 14 } - } + }, + "reserved": [ + [2, 2], + [3, 3], + [5, 5], + [8, 8], + [11, 11] + ] }, "PrevInput": { "fields": { @@ -1556,7 +1696,23 @@ "type": "uint32", "id": 9 } - } + }, + "reserved": [ + [1, 1], + [6, 6], + [7, 7], + [8, 8], + [10, 10], + [11, 11], + [12, 12], + [13, 13], + [14, 14], + [15, 15], + [16, 16], + [17, 17], + [18, 18], + [19, 19] + ] }, "PrevOutput": { "fields": { @@ -1576,6 +1732,101 @@ } } }, + "TxAckPaymentRequest": { + "options": { + "(experimental_message)": true + }, + "fields": { + "nonce": { + "type": "bytes", + "id": 1 + }, + "recipient_name": { + "rule": "required", + "type": "string", + "id": 2 + }, + "memos": { + "rule": "repeated", + "type": "PaymentRequestMemo", + "id": 3 + }, + "amount": { + "type": "uint64", + "id": 4 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 5 + } + }, + "nested": { + "PaymentRequestMemo": { + "fields": { + "text_memo": { + "type": "TextMemo", + "id": 1 + }, + "refund_memo": { + "type": "RefundMemo", + "id": 2 + }, + "coin_purchase_memo": { + "type": "CoinPurchaseMemo", + "id": 3 + } + } + }, + "TextMemo": { + "fields": { + "text": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "RefundMemo": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "mac": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "CoinPurchaseMemo": { + "fields": { + "coin_type": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "amount": { + "rule": "required", + "type": "string", + "id": 2 + }, + "address": { + "rule": "required", + "type": "string", + "id": 3 + }, + "mac": { + "rule": "required", + "type": "bytes", + "id": 4 + } + } + } + } + }, "TxAckInput": { "options": { "(wire_type)": 22 @@ -1767,52 +2018,52 @@ } }, "AuthorizeCoinJoin": { - "options": { - "(unstable)": true - }, "fields": { "coordinator": { "rule": "required", "type": "string", "id": 1 }, - "max_total_fee": { + "max_rounds": { "rule": "required", "type": "uint64", "id": 2 }, - "fee_per_anonymity": { + "max_coordinator_fee_rate": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "max_fee_per_kvbyte": { + "rule": "required", "type": "uint32", - "id": 3, - "options": { - "default": 0 - } + "id": 4 }, "address_n": { "rule": "repeated", "type": "uint32", - "id": 4, + "id": 5, "options": { "packed": false } }, "coin_name": { "type": "string", - "id": 5, + "id": 6, "options": { "default": "Bitcoin" } }, "script_type": { "type": "InputScriptType", - "id": 6, + "id": 7, "options": { "default": "SPENDADDRESS" } }, "amount_unit": { "type": "AmountUnit", - "id": 11, + "id": 8, "options": { "default": "BITCOIN" } @@ -1902,44 +2153,223 @@ } } }, - "FirmwareErase": { - "fields": { - "length": { - "type": "uint32", - "id": 1 - } - } + "BixinPinInputOnDevice": { + "fields": {} }, - "FirmwareRequest": { + "ApplySettingsBixin": { "fields": { - "offset": { - "type": "uint32", - "id": 1 + "use_ble": { + "type": "bool", + "id": 100 }, - "length": { + "use_se": { + "type": "bool", + "id": 101 + }, + "is_bixinapp": { + "type": "bool", + "id": 102 + }, + "fastpay_pin": { + "type": "bool", + "id": 103 + }, + "fastpay_confirm": { + "type": "bool", + "id": 104 + }, + "fastpay_money_limit": { + "type": "uint64", + "id": 105 + }, + "fastpay_times": { "type": "uint32", - "id": 2 + "id": 106 } } }, - "FirmwareUpload": { + "BixinSeedOperate": { "fields": { - "payload": { + "type": { "rule": "required", - "type": "bytes", + "type": "SeedRequestType", "id": 1 }, - "hash": { + "seed_importData": { "type": "bytes", "id": 2 } - } - }, - "SelfTest": { - "fields": { - "payload": { - "type": "bytes", - "id": 1 + }, + "nested": { + "SeedRequestType": { + "values": { + "SeedRequestType_Gen": 0, + "SeedRequestType_EncExport": 1, + "SeedRequestType_EncImport": 2 + } + } + } + }, + "BixinMessageSE": { + "fields": { + "inputmessage": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinOutMessageSE": { + "fields": { + "outmessage": { + "type": "bytes", + "id": 1 + } + } + }, + "BixinReboot": { + "fields": {} + }, + "DeviceBackToBoot": { + "fields": {} + }, + "BixinBackupRequest": { + "fields": {} + }, + "BixinBackupAck": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinRestoreRequest": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + }, + "label": { + "type": "string", + "id": 3 + }, + "passphrase_protection": { + "type": "bool", + "id": 4 + } + } + }, + "BixinRestoreAck": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinVerifyDeviceRequest": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinVerifyDeviceAck": { + "fields": { + "cert": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "BixinWhiteListRequest": { + "fields": { + "type": { + "rule": "required", + "type": "WL_OperationType", + "id": 1 + }, + "addr_in": { + "type": "string", + "id": 2 + } + }, + "nested": { + "WL_OperationType": { + "values": { + "WL_OperationType_Add": 0, + "WL_OperationType_Delete": 1, + "WL_OperationType_Inquire": 2 + } + } + } + }, + "BixinWhiteListAck": { + "fields": { + "address": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "BixinLoadDevice": { + "fields": { + "mnemonics": { + "rule": "required", + "type": "string", + "id": 1 + }, + "language": { + "type": "string", + "id": 5, + "options": { + "default": "en-US" + } + }, + "label": { + "type": "string", + "id": 6 + }, + "skip_checksum": { + "type": "bool", + "id": 7 + } + } + }, + "BixinBackupDevice": { + "fields": {} + }, + "BixinBackupDeviceAck": { + "fields": { + "mnemonics": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "FirmwareErase": { + "fields": { + "length": { + "type": "uint32", + "id": 1 } } }, @@ -1951,18 +2381,35 @@ } } }, - "RebootType": { - "values": { - "Normal": 0, - "Boardloader": 1, - "BootLoader": 2 + "FirmwareRequest": { + "fields": { + "offset": { + "type": "uint32", + "id": 1 + }, + "length": { + "type": "uint32", + "id": 2 + } } }, - "Reboot": { + "FirmwareUpload": { "fields": { - "reboot_type": { + "payload": { "rule": "required", - "type": "RebootType", + "type": "bytes", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + } + } + }, + "SelfTest": { + "fields": { + "payload": { + "type": "bytes", "id": 1 } } @@ -2054,10 +2501,10 @@ "CardanoTxAuxiliaryDataSupplementType": { "values": { "NONE": 0, - "CVOTE_REGISTRATION_SIGNATURE": 1 + "GOVERNANCE_REGISTRATION_SIGNATURE": 1 } }, - "CardanoCVoteRegistrationFormat": { + "CardanoGovernanceRegistrationFormat": { "values": { "CIP15": 0, "CIP36": 1 @@ -2705,9 +3152,9 @@ } } }, - "CardanoCVoteRegistrationDelegation": { + "CardanoGovernanceRegistrationDelegation": { "fields": { - "vote_public_key": { + "voting_public_key": { "rule": "required", "type": "bytes", "id": 1 @@ -2719,9 +3166,9 @@ } } }, - "CardanoCVoteRegistrationParametersType": { + "CardanoGovernanceRegistrationParametersType": { "fields": { - "vote_public_key": { + "voting_public_key": { "type": "bytes", "id": 1 }, @@ -2734,6 +3181,7 @@ } }, "payment_address_parameters": { + "rule": "required", "type": "CardanoAddressParametersType", "id": 3 }, @@ -2743,7 +3191,7 @@ "id": 4 }, "format": { - "type": "CardanoCVoteRegistrationFormat", + "type": "CardanoGovernanceRegistrationFormat", "id": 5, "options": { "default": "CIP15" @@ -2751,7 +3199,7 @@ }, "delegations": { "rule": "repeated", - "type": "CardanoCVoteRegistrationDelegation", + "type": "CardanoGovernanceRegistrationDelegation", "id": 6 }, "voting_purpose": { @@ -2766,8 +3214,8 @@ }, "CardanoTxAuxiliaryData": { "fields": { - "cvote_registration_parameters": { - "type": "CardanoCVoteRegistrationParametersType", + "governance_registration_parameters": { + "type": "CardanoGovernanceRegistrationParametersType", "id": 1 }, "hash": { @@ -2843,7 +3291,7 @@ "type": "bytes", "id": 2 }, - "cvote_registration_signature": { + "governance_signature": { "type": "bytes", "id": 3 } @@ -2983,6 +3431,7 @@ "Failure_PinMismatch": 12, "Failure_WipeCodeMismatch": 13, "Failure_InvalidSession": 14, + "Failure_BatteryLow": 30, "Failure_FirmwareError": 99 } } @@ -2997,8 +3446,13 @@ "pages": { "type": "uint32", "id": 2 + }, + "name": { + "type": "string", + "id": 4 } }, + "reserved": [[3, 3]], "nested": { "ButtonRequestType": { "values": { @@ -3143,9 +3597,6 @@ } } }, - "BixinPinInputOnDevice": { - "fields": {} - }, "ConfluxGetAddress": { "fields": { "address_n": { @@ -3185,44 +3636,68 @@ } }, "nonce": { + "rule": "required", "type": "bytes", "id": 2 }, "gas_price": { + "rule": "required", "type": "bytes", "id": 3 }, "gas_limit": { + "rule": "required", "type": "bytes", "id": 4 }, "to": { "type": "string", - "id": 5 + "id": 5, + "options": { + "default": "" + } }, "value": { "type": "bytes", - "id": 6 + "id": 6, + "options": { + "default": "" + } }, "epoch_height": { "type": "bytes", - "id": 7 + "id": 7, + "options": { + "default": "" + } }, "storage_limit": { "type": "bytes", - "id": 8 + "id": 8, + "options": { + "default": "" + } }, "data_initial_chunk": { "type": "bytes", - "id": 9 + "id": 9, + "options": { + "default": "" + } }, "data_length": { "type": "uint32", - "id": 10 + "id": 10, + "options": { + "default": 0 + } }, "chain_id": { "type": "uint32", - "id": 11 + "id": 11, + "options": { + "default": 1029 + } } } }, @@ -3522,17 +3997,22 @@ }, "data": { "type": "bytes", - "id": 2 + "id": 2, + "options": { + "deprecated": true + } } } }, "CosiCommitment": { "fields": { "commitment": { + "rule": "required", "type": "bytes", "id": 1 }, "pubkey": { + "rule": "required", "type": "bytes", "id": 2 } @@ -3549,14 +4029,17 @@ } }, "data": { + "rule": "required", "type": "bytes", "id": 2 }, "global_commitment": { + "rule": "required", "type": "bytes", "id": 3 }, "global_pubkey": { + "rule": "required", "type": "bytes", "id": 4 } @@ -3628,8 +4111,8 @@ }, "DebugLinkDecision": { "fields": { - "yes_no": { - "type": "bool", + "button": { + "type": "DebugButton", "id": 1 }, "swipe": { @@ -3650,11 +4133,18 @@ }, "wait": { "type": "bool", - "id": 6 + "id": 6, + "options": { + "deprecated": true + } }, "hold_ms": { "type": "uint32", "id": 7 + }, + "physical_button": { + "type": "DebugPhysicalButton", + "id": 8 } }, "nested": { @@ -3665,12 +4155,26 @@ "LEFT": 2, "RIGHT": 3 } + }, + "DebugButton": { + "values": { + "NO": 0, + "YES": 1, + "INFO": 2 + } + }, + "DebugPhysicalButton": { + "values": { + "LEFT_BTN": 0, + "MIDDLE_BTN": 1, + "RIGHT_BTN": 2 + } } } }, "DebugLinkLayout": { "fields": { - "lines": { + "tokens": { "rule": "repeated", "type": "string", "id": 1 @@ -3690,6 +4194,13 @@ "target_directory": { "type": "string", "id": 1 + }, + "refresh_index": { + "type": "uint32", + "id": 2, + "options": { + "default": 0 + } } } }, @@ -3697,15 +4208,33 @@ "fields": { "wait_word_list": { "type": "bool", - "id": 1 + "id": 1, + "options": { + "deprecated": true + } }, "wait_word_pos": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "deprecated": true + } }, "wait_layout": { - "type": "bool", - "id": 3 + "type": "DebugWaitType", + "id": 3, + "options": { + "default": "IMMEDIATE" + } + } + }, + "nested": { + "DebugWaitType": { + "values": { + "IMMEDIATE": 0, + "NEXT_LAYOUT": 1, + "CURRENT_LAYOUT": 2 + } } } }, @@ -3759,7 +4288,7 @@ "type": "BackupType", "id": 12 }, - "layout_lines": { + "tokens": { "rule": "repeated", "type": "string", "id": 13 @@ -3845,6 +4374,15 @@ } } }, + "DebugLinkResetDebugEvents": { + "options": { + "deprecated": true + }, + "fields": {} + }, + "DebugLinkOptigaSetSecMax": { + "fields": {} + }, "DnxGetAddress": { "fields": { "address_n": { @@ -4231,14 +4769,17 @@ } }, "chain_id": { + "rule": "required", "type": "bytes", "id": 2 }, "header": { + "rule": "required", "type": "EosTxHeader", "id": 3 }, "num_actions": { + "rule": "required", "type": "uint32", "id": 4 } @@ -4291,6 +4832,7 @@ "EosTxActionAck": { "fields": { "common": { + "rule": "required", "type": "EosActionCommon", "id": 1 }, @@ -4355,10 +4897,12 @@ "EosAsset": { "fields": { "amount": { + "rule": "required", "type": "sint64", "id": 1 }, "symbol": { + "rule": "required", "type": "uint64", "id": 2 } @@ -4367,10 +4911,12 @@ "EosPermissionLevel": { "fields": { "actor": { + "rule": "required", "type": "uint64", "id": 1 }, "permission": { + "rule": "required", "type": "uint64", "id": 2 } @@ -4405,10 +4951,12 @@ "EosAuthorizationAccount": { "fields": { "account": { + "rule": "required", "type": "EosPermissionLevel", "id": 1 }, "weight": { + "rule": "required", "type": "uint32", "id": 2 } @@ -4417,10 +4965,12 @@ "EosAuthorizationWait": { "fields": { "wait_sec": { + "rule": "required", "type": "uint32", "id": 1 }, "weight": { + "rule": "required", "type": "uint32", "id": 2 } @@ -4429,6 +4979,7 @@ "EosAuthorization": { "fields": { "threshold": { + "rule": "required", "type": "uint32", "id": 1 }, @@ -4452,10 +5003,12 @@ "EosActionCommon": { "fields": { "account": { + "rule": "required", "type": "uint64", "id": 1 }, "name": { + "rule": "required", "type": "uint64", "id": 2 }, @@ -4469,18 +5022,22 @@ "EosActionTransfer": { "fields": { "sender": { + "rule": "required", "type": "uint64", "id": 1 }, "receiver": { + "rule": "required", "type": "uint64", "id": 2 }, "quantity": { + "rule": "required", "type": "EosAsset", "id": 3 }, "memo": { + "rule": "required", "type": "string", "id": 4 } @@ -4489,22 +5046,27 @@ "EosActionDelegate": { "fields": { "sender": { + "rule": "required", "type": "uint64", "id": 1 }, "receiver": { + "rule": "required", "type": "uint64", "id": 2 }, "net_quantity": { + "rule": "required", "type": "EosAsset", "id": 3 }, "cpu_quantity": { + "rule": "required", "type": "EosAsset", "id": 4 }, "transfer": { + "rule": "required", "type": "bool", "id": 5 } @@ -4513,18 +5075,22 @@ "EosActionUndelegate": { "fields": { "sender": { + "rule": "required", "type": "uint64", "id": 1 }, "receiver": { + "rule": "required", "type": "uint64", "id": 2 }, "net_quantity": { + "rule": "required", "type": "EosAsset", "id": 3 }, "cpu_quantity": { + "rule": "required", "type": "EosAsset", "id": 4 } @@ -4533,6 +5099,7 @@ "EosActionRefund": { "fields": { "owner": { + "rule": "required", "type": "uint64", "id": 1 } @@ -4541,14 +5108,17 @@ "EosActionBuyRam": { "fields": { "payer": { + "rule": "required", "type": "uint64", "id": 1 }, "receiver": { + "rule": "required", "type": "uint64", "id": 2 }, "quantity": { + "rule": "required", "type": "EosAsset", "id": 3 } @@ -4557,14 +5127,17 @@ "EosActionBuyRamBytes": { "fields": { "payer": { + "rule": "required", "type": "uint64", "id": 1 }, "receiver": { + "rule": "required", "type": "uint64", "id": 2 }, "bytes": { + "rule": "required", "type": "uint32", "id": 3 } @@ -4573,10 +5146,12 @@ "EosActionSellRam": { "fields": { "account": { + "rule": "required", "type": "uint64", "id": 1 }, "bytes": { + "rule": "required", "type": "uint64", "id": 2 } @@ -4585,10 +5160,12 @@ "EosActionVoteProducer": { "fields": { "voter": { + "rule": "required", "type": "uint64", "id": 1 }, "proxy": { + "rule": "required", "type": "uint64", "id": 2 }, @@ -4605,18 +5182,22 @@ "EosActionUpdateAuth": { "fields": { "account": { + "rule": "required", "type": "uint64", "id": 1 }, "permission": { + "rule": "required", "type": "uint64", "id": 2 }, "parent": { + "rule": "required", "type": "uint64", "id": 3 }, "auth": { + "rule": "required", "type": "EosAuthorization", "id": 4 } @@ -4625,10 +5206,12 @@ "EosActionDeleteAuth": { "fields": { "account": { + "rule": "required", "type": "uint64", "id": 1 }, "permission": { + "rule": "required", "type": "uint64", "id": 2 } @@ -4637,18 +5220,22 @@ "EosActionLinkAuth": { "fields": { "account": { + "rule": "required", "type": "uint64", "id": 1 }, "code": { + "rule": "required", "type": "uint64", "id": 2 }, "type": { + "rule": "required", "type": "uint64", "id": 3 }, "requirement": { + "rule": "required", "type": "uint64", "id": 4 } @@ -4657,14 +5244,17 @@ "EosActionUnlinkAuth": { "fields": { "account": { + "rule": "required", "type": "uint64", "id": 1 }, "code": { + "rule": "required", "type": "uint64", "id": 2 }, "type": { + "rule": "required", "type": "uint64", "id": 3 } @@ -4673,18 +5263,22 @@ "EosActionNewAccount": { "fields": { "creator": { + "rule": "required", "type": "uint64", "id": 1 }, "name": { + "rule": "required", "type": "uint64", "id": 2 }, "owner": { + "rule": "required", "type": "EosAuthorization", "id": 3 }, "active": { + "rule": "required", "type": "EosAuthorization", "id": 4 } @@ -4698,6 +5292,7 @@ "id": 1 }, "data_chunk": { + "rule": "required", "type": "bytes", "id": 2 } @@ -4821,78 +5416,6 @@ } } }, - "EthereumGnosisSafeTxOperation": { - "values": { - "CALL": 0, - "DELEGATE_CALL": 1 - } - }, - "EthereumGnosisSafeTxRequest": { - "fields": {} - }, - "EthereumGnosisSafeTxAck": { - "fields": { - "to": { - "rule": "required", - "type": "string", - "id": 1 - }, - "value": { - "rule": "required", - "type": "bytes", - "id": 2 - }, - "data": { - "type": "bytes", - "id": 3 - }, - "operation": { - "rule": "required", - "type": "EthereumGnosisSafeTxOperation", - "id": 4 - }, - "safeTxGas": { - "rule": "required", - "type": "bytes", - "id": 5 - }, - "baseGas": { - "rule": "required", - "type": "bytes", - "id": 6 - }, - "gasPrice": { - "rule": "required", - "type": "bytes", - "id": 7 - }, - "gasToken": { - "rule": "required", - "type": "string", - "id": 8 - }, - "refundReceiver": { - "rule": "required", - "type": "string", - "id": 9 - }, - "nonce": { - "rule": "required", - "type": "bytes", - "id": 10 - }, - "chain_id": { - "rule": "required", - "type": "uint64", - "id": 11 - }, - "verifyingContract": { - "rule": "required", - "type": "string", - "id": 12 - } - } - }, "EthereumTypedDataStructRequestOneKey": { "fields": { "name": { @@ -6011,7 +6534,10 @@ "values": { "Bip39": 0, "Slip39_Basic": 1, - "Slip39_Advanced": 2 + "Slip39_Advanced": 2, + "Slip39_Single_Extendable": 3, + "Slip39_Basic_Extendable": 4, + "Slip39_Advanced_Extendable": 5 } }, "SafetyCheckLevel": { @@ -6021,51 +6547,27 @@ "PromptTemporarily": 2 } }, - "Initialize": { - "fields": { - "session_id": { - "type": "bytes", - "id": 1 - }, - "_skip_passphrase": { - "type": "bool", - "id": 2, - "options": { - "deprecated": true - } - }, - "derive_cardano": { - "type": "bool", - "id": 3 - } - } - }, - "GetFeatures": { - "fields": {} - }, - "OnekeyGetFeatures": { - "fields": {} - }, - "OneKeyDeviceType": { + "DisplayRotation": { "values": { - "CLASSIC": 0, - "CLASSIC1S": 1, - "MINI": 2, - "TOUCH": 3, - "PRO": 5, - "PURE": 6 + "North": 0, + "East": 90, + "South": 180, + "West": 270 } }, - "OneKeySeType": { + "HomescreenFormat": { "values": { - "THD89": 0, - "SE608A": 1 + "Toif": 1, + "Jpeg": 2, + "ToiG": 3 } }, - "OneKeySEState": { - "values": { - "BOOT": 0, - "APP": 1 + "GetFeatures": { + "fields": { + "ok_dev_info_req": { + "type": "OneKeyInfoReq", + "id": 9999 + } } }, "Features": { @@ -6075,17 +6577,14 @@ "id": 1 }, "major_version": { - "rule": "required", "type": "uint32", "id": 2 }, "minor_version": { - "rule": "required", "type": "uint32", "id": 3 }, "patch_version": { - "rule": "required", "type": "uint32", "id": 4 }, @@ -6144,8 +6643,8 @@ "type": "bool", "id": 18 }, - "needs_backup": { - "type": "bool", + "backup_availability": { + "type": "BackupAvailability", "id": 19 }, "flags": { @@ -6180,8 +6679,8 @@ "type": "bool", "id": 28 }, - "recovery_mode": { - "type": "bool", + "recovery_status": { + "type": "RecoveryStatus", "id": 29 }, "capabilities": { @@ -6225,7 +6724,7 @@ "id": 38 }, "display_rotation": { - "type": "uint32", + "type": "DisplayRotation", "id": 39 }, "experimental_features": { @@ -6236,198 +6735,103 @@ "type": "bool", "id": 41 }, - "offset": { - "type": "uint32", - "id": 500 - }, - "ble_name": { - "type": "string", - "id": 501 - }, - "ble_ver": { - "type": "string", - "id": 502 - }, - "ble_enable": { - "type": "bool", - "id": 503 + "homescreen_format": { + "type": "HomescreenFormat", + "id": 42 }, - "se_enable": { + "hide_passphrase_from_host": { "type": "bool", - "id": 504 + "id": 43 }, - "se_ver": { + "internal_model": { "type": "string", - "id": 506 + "id": 44 }, - "backup_only": { - "type": "bool", - "id": 507 + "unit_color": { + "type": "uint32", + "id": 45 }, - "onekey_version": { - "type": "string", - "id": 508 + "unit_btconly": { + "type": "bool", + "id": 46 }, - "onekey_serial": { - "type": "string", - "id": 509 + "homescreen_width": { + "type": "uint32", + "id": 47 }, - "bootloader_version": { - "type": "string", - "id": 510 + "homescreen_height": { + "type": "uint32", + "id": 48 }, - "serial_no": { - "type": "string", - "id": 511 + "bootloader_locked": { + "type": "bool", + "id": 49 }, - "spi_flash": { - "type": "string", - "id": 512 + "language_version_matches": { + "type": "bool", + "id": 50, + "options": { + "default": true + } }, - "initstates": { + "unit_packaging": { "type": "uint32", - "id": 513 - }, - "NFT_voucher": { - "type": "bytes", - "id": 514 + "id": 51 }, - "cpu_info": { - "type": "string", - "id": 515 + "haptic_feedback": { + "type": "bool", + "id": 52 }, - "pre_firmware": { - "type": "string", - "id": 516 + "recovery_type": { + "type": "RecoveryType", + "id": 53 }, - "coin_switch": { + "optiga_sec": { "type": "uint32", - "id": 517 - }, - "build_id": { - "type": "bytes", - "id": 518 + "id": 54 }, - "boardloader_version": { - "type": "string", - "id": 519 + "ok_dev_info_resp": { + "type": "OneKeyInfoResp", + "id": 9999 }, - "battery_level": { - "type": "uint32", - "id": 520 + "ok_factory_status": { + "type": "OneKeyFactoryStatus", + "id": 6666 }, "onekey_device_type": { "type": "OneKeyDeviceType", "id": 600 }, - "onekey_se_type": { - "type": "OneKeySeType", - "id": 601 - }, - "onekey_board_version": { + "onekey_serial_no": { "type": "string", - "id": 602 - }, - "onekey_board_hash": { - "type": "bytes", - "id": 603 + "id": 612 }, - "onekey_boot_version": { - "type": "string", - "id": 604 - }, - "onekey_boot_hash": { - "type": "bytes", - "id": 605 - }, - "onekey_se01_version": { - "type": "string", - "id": 606 - }, - "onekey_se01_hash": { - "type": "bytes", - "id": 607 - }, - "onekey_se01_build_id": { - "type": "string", - "id": 608 - }, - "onekey_firmware_version": { + "onekey_firmware_version": { "type": "string", "id": 609 - }, - "onekey_firmware_hash": { - "type": "bytes", - "id": 610 - }, - "onekey_firmware_build_id": { - "type": "string", - "id": 611 - }, - "onekey_serial_no": { - "type": "string", - "id": 612 - }, - "onekey_boot_build_id": { - "type": "string", - "id": 613 - }, - "onekey_ble_name": { - "type": "string", - "id": 614 - }, - "onekey_ble_version": { - "type": "string", - "id": 615 - }, - "onekey_ble_build_id": { - "type": "string", - "id": 616 - }, - "onekey_ble_hash": { - "type": "bytes", - "id": 617 - }, - "onekey_se02_version": { - "type": "string", - "id": 618 - }, - "onekey_se03_version": { - "type": "string", - "id": 619 - }, - "onekey_se04_version": { - "type": "string", - "id": 620 - }, - "onekey_se01_state": { - "type": "OneKeySEState", - "id": 621 - }, - "onekey_se02_state": { - "type": "OneKeySEState", - "id": 622 - }, - "onekey_se03_state": { - "type": "OneKeySEState", - "id": 623 - }, - "onekey_se04_state": { - "type": "OneKeySEState", - "id": 624 } }, "nested": { + "BackupAvailability": { + "values": { + "NotAvailable": 0, + "Required": 1, + "Available": 2 + } + }, + "RecoveryStatus": { + "values": { + "Nothing": 0, + "Recovery": 1, + "Backup": 2 + } + }, "Capability": { - "options": { - "(has_bitcoin_only_values)": true - }, "values": { "Capability_Bitcoin": 1, "Capability_Bitcoin_like": 2, "Capability_Binance": 3, "Capability_Cardano": 4, - "Capability_Crypto": 5, "Capability_EOS": 6, "Capability_Ethereum": 7, "Capability_Lisk": 8, @@ -6439,194 +6843,46 @@ "Capability_U2F": 14, "Capability_Shamir": 15, "Capability_ShamirGroups": 16, - "Capability_PassphraseEntry": 17 + "Capability_PassphraseEntry": 17, + "Capability_Solana": 18 } } } }, - "OnekeyFeatures": { + "LockDevice": { + "fields": {} + }, + "SetBusy": { "fields": { - "onekey_device_type": { - "type": "OneKeyDeviceType", + "expiry_ms": { + "type": "uint32", "id": 1 - }, - "onekey_board_version": { - "type": "string", - "id": 2 - }, - "onekey_boot_version": { - "type": "string", - "id": 3 - }, - "onekey_firmware_version": { - "type": "string", - "id": 4 - }, - "onekey_board_hash": { - "type": "bytes", - "id": 5 - }, - "onekey_boot_hash": { - "type": "bytes", - "id": 6 - }, - "onekey_firmware_hash": { - "type": "bytes", - "id": 7 - }, - "onekey_board_build_id": { - "type": "string", - "id": 8 - }, - "onekey_boot_build_id": { - "type": "string", - "id": 9 - }, - "onekey_firmware_build_id": { - "type": "string", - "id": 10 - }, - "onekey_serial_no": { - "type": "string", - "id": 11 - }, - "onekey_ble_name": { - "type": "string", - "id": 12 - }, - "onekey_ble_version": { - "type": "string", - "id": 13 - }, - "onekey_ble_build_id": { - "type": "string", - "id": 14 - }, - "onekey_ble_hash": { - "type": "bytes", - "id": 15 - }, - "onekey_se_type": { - "type": "OneKeySeType", - "id": 16 - }, - "onekey_se01_state": { - "type": "OneKeySEState", - "id": 17 - }, - "onekey_se02_state": { - "type": "OneKeySEState", - "id": 18 - }, - "onekey_se03_state": { - "type": "OneKeySEState", - "id": 19 - }, - "onekey_se04_state": { - "type": "OneKeySEState", - "id": 20 - }, - "onekey_se01_version": { - "type": "string", - "id": 21 - }, - "onekey_se02_version": { - "type": "string", - "id": 22 - }, - "onekey_se03_version": { - "type": "string", - "id": 23 - }, - "onekey_se04_version": { - "type": "string", - "id": 24 - }, - "onekey_se01_hash": { - "type": "bytes", - "id": 25 - }, - "onekey_se02_hash": { - "type": "bytes", - "id": 26 - }, - "onekey_se03_hash": { - "type": "bytes", - "id": 27 - }, - "onekey_se04_hash": { - "type": "bytes", - "id": 28 - }, - "onekey_se01_build_id": { - "type": "string", - "id": 29 - }, - "onekey_se02_build_id": { - "type": "string", - "id": 30 - }, - "onekey_se03_build_id": { - "type": "string", - "id": 31 - }, - "onekey_se04_build_id": { - "type": "string", - "id": 32 - }, - "onekey_se01_boot_version": { - "type": "string", - "id": 33 - }, - "onekey_se02_boot_version": { - "type": "string", - "id": 34 - }, - "onekey_se03_boot_version": { - "type": "string", - "id": 35 - }, - "onekey_se04_boot_version": { - "type": "string", - "id": 36 - }, - "onekey_se01_boot_hash": { - "type": "bytes", - "id": 37 - }, - "onekey_se02_boot_hash": { - "type": "bytes", - "id": 38 - }, - "onekey_se03_boot_hash": { - "type": "bytes", - "id": 39 - }, - "onekey_se04_boot_hash": { + } + } + }, + "StartSession": { + "fields": { + "session_id": { "type": "bytes", - "id": 40 - }, - "onekey_se01_boot_build_id": { - "type": "string", - "id": 41 + "id": 1 }, - "onekey_se02_boot_build_id": { - "type": "string", - "id": 42 + "_skip_passphrase": { + "type": "bool", + "id": 2, + "options": { + "deprecated": true + } }, - "onekey_se03_boot_build_id": { - "type": "string", - "id": 43 + "derive_cardano": { + "type": "bool", + "id": 3 }, - "onekey_se04_boot_build_id": { - "type": "string", - "id": 44 + "ok_dev_info_req": { + "type": "OneKeyInfoReq", + "id": 9999 } } }, - "LockDevice": { - "fields": {} - }, "EndSession": { "fields": {} }, @@ -6634,7 +6890,10 @@ "fields": { "language": { "type": "string", - "id": 1 + "id": 1, + "options": { + "deprecated": true + } }, "label": { "type": "string", @@ -6660,7 +6919,7 @@ "id": 6 }, "display_rotation": { - "type": "uint32", + "type": "DisplayRotation", "id": 7 }, "passphrase_always_on_device": { @@ -6675,42 +6934,49 @@ "type": "bool", "id": 10 }, - "use_ble": { - "type": "bool", - "id": 100 - }, - "use_se": { - "type": "bool", - "id": 101 - }, - "is_bixinapp": { + "hide_passphrase_from_host": { "type": "bool", - "id": 102 + "id": 11 }, - "fastpay_pin": { + "haptic_feedback": { "type": "bool", - "id": 103 + "id": 13 + } + } + }, + "ChangeLanguage": { + "fields": { + "data_length": { + "rule": "required", + "type": "uint32", + "id": 1 }, - "fastpay_confirm": { + "show_display": { "type": "bool", - "id": 104 - }, - "fastpay_money_limit": { - "type": "uint64", - "id": 105 + "id": 2 + } + } + }, + "TranslationDataRequest": { + "fields": { + "data_length": { + "rule": "required", + "type": "uint32", + "id": 1 }, - "fastpay_times": { + "data_offset": { + "rule": "required", "type": "uint32", - "id": 106 + "id": 2 } - }, - "nested": { - "ExportType": { - "values": { - "SeedEncExportType_NO": 0, - "SeedEncExportType_YES": 1, - "MnemonicPlainExportType_YES": 2 - } + } + }, + "TranslationDataAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 } } }, @@ -6793,6 +7059,46 @@ } } }, + "GetFirmwareHash": { + "fields": { + "challenge": { + "type": "bytes", + "id": 1 + } + } + }, + "FirmwareHash": { + "fields": { + "hash": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "AuthenticateDevice": { + "fields": { + "challenge": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "AuthenticityProof": { + "fields": { + "certificates": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, "WipeDevice": { "fields": {} }, @@ -6815,7 +7121,7 @@ "type": "string", "id": 5, "options": { - "default": "en-US" + "deprecated": true } }, "label": { @@ -6865,7 +7171,7 @@ "type": "string", "id": 5, "options": { - "default": "en-US" + "deprecated": true } }, "label": { @@ -6893,9 +7199,35 @@ } } }, - "BackupDevice": { - "fields": {} - }, + "BackupDevice": { + "fields": { + "group_threshold": { + "type": "uint32", + "id": 1 + }, + "groups": { + "rule": "repeated", + "type": "Slip39Group", + "id": 2 + } + }, + "nested": { + "Slip39Group": { + "fields": { + "member_threshold": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "member_count": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + } + } + }, "EntropyRequest": { "fields": {} }, @@ -6924,7 +7256,10 @@ }, "language": { "type": "string", - "id": 4 + "id": 4, + "options": { + "deprecated": true + } }, "label": { "type": "string", @@ -6934,28 +7269,39 @@ "type": "bool", "id": 6 }, - "type": { - "type": "RecoveryDeviceType", + "input_method": { + "type": "RecoveryDeviceInputMethod", "id": 8 }, "u2f_counter": { "type": "uint32", "id": 9 }, - "dry_run": { - "type": "bool", - "id": 10 + "type": { + "type": "RecoveryType", + "id": 10, + "options": { + "default": "NormalRecovery" + } } }, + "reserved": [[7, 7]], "nested": { - "RecoveryDeviceType": { + "RecoveryDeviceInputMethod": { "values": { - "RecoveryDeviceType_ScrambledWords": 0, - "RecoveryDeviceType_Matrix": 1 + "ScrambledWords": 0, + "Matrix": 1 } } } }, + "RecoveryType": { + "values": { + "NormalRecovery": 0, + "DryRun": 1, + "UnlockRepeatedBackup": 2 + } + }, "WordRequest": { "fields": { "type": { @@ -7013,176 +7359,88 @@ "CancelAuthorization": { "fields": {} }, - "BixinSeedOperate": { + "RebootToBootloader": { "fields": { - "type": { - "rule": "required", - "type": "SeedRequestType", - "id": 1 + "boot_command": { + "type": "BootCommand", + "id": 1, + "options": { + "default": "STOP_AND_WAIT" + } }, - "seed_importData": { + "firmware_header": { "type": "bytes", "id": 2 + }, + "language_data_length": { + "type": "uint32", + "id": 3, + "options": { + "default": 0 + } } }, "nested": { - "SeedRequestType": { + "BootCommand": { "values": { - "SeedRequestType_Gen": 0, - "SeedRequestType_EncExport": 1, - "SeedRequestType_EncImport": 2 + "STOP_AND_WAIT": 0, + "INSTALL_UPGRADE": 1 } } } }, - "BixinMessageSE": { - "fields": { - "inputmessage": { - "rule": "required", - "type": "bytes", - "id": 1 - } - } - }, - "BixinOutMessageSE": { - "fields": { - "outmessage": { - "type": "bytes", - "id": 1 - } - } - }, - "DeviceBackToBoot": { - "fields": {} - }, - "BixinBackupRequest": { + "GetNonce": { + "options": { + "(experimental_message)": true + }, "fields": {} }, - "BixinBackupAck": { - "fields": { - "data": { - "rule": "required", - "type": "bytes", - "id": 1 - } - } - }, - "BixinRestoreRequest": { - "fields": { - "data": { - "rule": "required", - "type": "bytes", - "id": 1 - }, - "language": { - "type": "string", - "id": 2 - }, - "label": { - "type": "string", - "id": 3 - }, - "passphrase_protection": { - "type": "bool", - "id": 4 - } - } - }, - "BixinRestoreAck": { - "fields": { - "data": { - "rule": "required", - "type": "bytes", - "id": 1 - } - } - }, - "BixinVerifyDeviceRequest": { + "Nonce": { + "options": { + "(experimental_message)": true + }, "fields": { - "data": { + "nonce": { "rule": "required", "type": "bytes", "id": 1 } } }, - "BixinVerifyDeviceAck": { + "UnlockPath": { "fields": { - "cert": { - "rule": "required", - "type": "bytes", - "id": 1 + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } }, - "signature": { - "rule": "required", + "mac": { "type": "bytes", "id": 2 } } }, - "BixinWhiteListRequest": { - "fields": { - "type": { - "rule": "required", - "type": "WL_OperationType", - "id": 1 - }, - "addr_in": { - "type": "string", - "id": 2 - } - }, - "nested": { - "WL_OperationType": { - "values": { - "WL_OperationType_Add": 0, - "WL_OperationType_Delete": 1, - "WL_OperationType_Inquire": 2 - } - } - } - }, - "BixinWhiteListAck": { + "UnlockedPathRequest": { "fields": { - "address": { - "rule": "repeated", - "type": "string", + "mac": { + "type": "bytes", "id": 1 } } }, - "BixinLoadDevice": { - "fields": { - "mnemonics": { - "rule": "required", - "type": "string", - "id": 1 - }, - "language": { - "type": "string", - "id": 5, - "options": { - "default": "en-US" - } - }, - "label": { - "type": "string", - "id": 6 - }, - "skip_checksum": { - "type": "bool", - "id": 7 - } - } + "ShowDeviceTutorial": { + "fields": {} }, - "BixinBackupDevice": { + "UnlockBootloader": { "fields": {} }, - "BixinBackupDeviceAck": { + "SetBrightness": { "fields": { - "mnemonics": { - "rule": "required", - "type": "string", + "value": { + "type": "uint32", "id": 1 } } @@ -7234,6 +7492,15 @@ } } }, + "WriteSEPrivateKey": { + "fields": { + "private_key": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, "ReadSEPublicKey": { "fields": {} }, @@ -7470,12 +7737,6 @@ } } }, - "RebootToBootloader": { - "fields": {} - }, - "RebootToBoardloader": { - "fields": {} - }, "ListResDir": { "fields": { "path": { @@ -7511,12 +7772,14 @@ } }, "DeviceEraseSector": { - "fields": { - "sector": { - "rule": "required", - "type": "uint32", - "id": 1 - } + "fields": {} + }, + "MoneroNetworkType": { + "values": { + "MAINNET": 0, + "TESTNET": 1, + "STAGENET": 2, + "FAKECHAIN": 3 } }, "MoneroTransactionSourceEntry": { @@ -7580,10 +7843,12 @@ "MoneroRctKeyPublic": { "fields": { "dest": { + "rule": "required", "type": "bytes", "id": 1 }, "commitment": { + "rule": "required", "type": "bytes", "id": 2 } @@ -7703,8 +7968,11 @@ "id": 2 }, "network_type": { - "type": "uint32", - "id": 3 + "type": "MoneroNetworkType", + "id": 3, + "options": { + "default": "MAINNET" + } }, "account": { "type": "uint32", @@ -7739,8 +8007,11 @@ } }, "network_type": { - "type": "uint32", - "id": 2 + "type": "MoneroNetworkType", + "id": 2, + "options": { + "default": "MAINNET" + } } } }, @@ -7771,8 +8042,11 @@ } }, "network_type": { - "type": "uint32", - "id": 3 + "type": "MoneroNetworkType", + "id": 3, + "options": { + "default": "MAINNET" + } }, "tsx_data": { "type": "MoneroTransactionData", @@ -8129,10 +8403,12 @@ "MoneroKeyImageExportInitRequest": { "fields": { "num": { + "rule": "required", "type": "uint64", "id": 1 }, "hash": { + "rule": "required", "type": "bytes", "id": 2 }, @@ -8145,8 +8421,11 @@ } }, "network_type": { - "type": "uint32", - "id": 4 + "type": "MoneroNetworkType", + "id": 4, + "options": { + "default": "MAINNET" + } }, "subs": { "rule": "repeated", @@ -8158,6 +8437,7 @@ "MoneroSubAddressIndicesList": { "fields": { "account": { + "rule": "required", "type": "uint32", "id": 1 }, @@ -8188,10 +8468,12 @@ "MoneroTransferDetails": { "fields": { "out_key": { + "rule": "required", "type": "bytes", "id": 1 }, "tx_pub_key": { + "rule": "required", "type": "bytes", "id": 2 }, @@ -8201,6 +8483,7 @@ "id": 3 }, "internal_output_index": { + "rule": "required", "type": "uint64", "id": 4 }, @@ -8261,22 +8544,29 @@ } }, "network_type": { - "type": "uint32", - "id": 2 + "type": "MoneroNetworkType", + "id": 2, + "options": { + "default": "MAINNET" + } }, "salt1": { + "rule": "required", "type": "bytes", "id": 3 }, "salt2": { + "rule": "required", "type": "bytes", "id": 4 }, "tx_enc_keys": { + "rule": "required", "type": "bytes", "id": 5 }, "tx_prefix_hash": { + "rule": "required", "type": "bytes", "id": 6 }, @@ -8317,8 +8607,11 @@ } }, "network_type": { - "type": "uint32", - "id": 2 + "type": "MoneroNetworkType", + "id": 2, + "options": { + "default": "MAINNET" + } } } }, @@ -8328,22 +8621,27 @@ "MoneroLiveRefreshStepRequest": { "fields": { "out_key": { + "rule": "required", "type": "bytes", "id": 1 }, "recv_deriv": { + "rule": "required", "type": "bytes", "id": 2 }, "real_out_idx": { + "rule": "required", "type": "uint64", "id": 3 }, "sub_addr_major": { + "rule": "required", "type": "uint32", "id": 4 }, "sub_addr_minor": { + "rule": "required", "type": "uint32", "id": 5 } @@ -8493,7 +8791,10 @@ }, "network": { "type": "uint32", - "id": 2 + "id": 2, + "options": { + "default": 104 + } }, "show_display": { "type": "bool", @@ -8513,6 +8814,7 @@ "NEMSignTx": { "fields": { "transaction": { + "rule": "required", "type": "NEMTransactionCommon", "id": 1 }, @@ -8562,17 +8864,23 @@ }, "network": { "type": "uint32", - "id": 2 + "id": 2, + "options": { + "default": 104 + } }, "timestamp": { + "rule": "required", "type": "uint32", "id": 3 }, "fee": { + "rule": "required", "type": "uint64", "id": 4 }, "deadline": { + "rule": "required", "type": "uint32", "id": 5 }, @@ -8585,16 +8893,21 @@ "NEMTransfer": { "fields": { "recipient": { + "rule": "required", "type": "string", "id": 1 }, "amount": { + "rule": "required", "type": "uint64", "id": 2 }, "payload": { "type": "bytes", - "id": 3 + "id": 3, + "options": { + "default": "" + } }, "public_key": { "type": "bytes", @@ -8610,14 +8923,17 @@ "NEMMosaic": { "fields": { "namespace": { + "rule": "required", "type": "string", "id": 1 }, "mosaic": { + "rule": "required", "type": "string", "id": 2 }, "quantity": { + "rule": "required", "type": "uint64", "id": 3 } @@ -8628,6 +8944,7 @@ "NEMProvisionNamespace": { "fields": { "namespace": { + "rule": "required", "type": "string", "id": 1 }, @@ -8636,10 +8953,12 @@ "id": 2 }, "sink": { + "rule": "required", "type": "string", "id": 3 }, "fee": { + "rule": "required", "type": "uint64", "id": 4 } @@ -8648,14 +8967,17 @@ "NEMMosaicCreation": { "fields": { "definition": { + "rule": "required", "type": "NEMMosaicDefinition", "id": 1 }, "sink": { + "rule": "required", "type": "string", "id": 2 }, "fee": { + "rule": "required", "type": "uint64", "id": 3 } @@ -8672,10 +8994,12 @@ "id": 2 }, "namespace": { + "rule": "required", "type": "string", "id": 3 }, "mosaic": { + "rule": "required", "type": "string", "id": 4 }, @@ -8716,6 +9040,7 @@ "id": 13 }, "description": { + "rule": "required", "type": "string", "id": 14 }, @@ -8742,18 +9067,22 @@ "NEMMosaicSupplyChange": { "fields": { "namespace": { + "rule": "required", "type": "string", "id": 1 }, "mosaic": { + "rule": "required", "type": "string", "id": 2 }, "type": { + "rule": "required", "type": "NEMSupplyChangeType", "id": 3 }, "delta": { + "rule": "required", "type": "uint64", "id": 4 } @@ -8783,10 +9112,12 @@ "NEMCosignatoryModification": { "fields": { "type": { + "rule": "required", "type": "NEMModificationType", "id": 1 }, "public_key": { + "rule": "required", "type": "bytes", "id": 2 } @@ -8805,10 +9136,12 @@ "NEMImportanceTransfer": { "fields": { "mode": { + "rule": "required", "type": "NEMImportanceTransferMode", "id": 1 }, "public_key": { + "rule": "required", "type": "bytes", "id": 2 } @@ -9224,73 +9557,353 @@ } } }, - "NostrEncryptMessage": { + "NostrEncryptMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "pubkey": { + "rule": "required", + "type": "string", + "id": 2 + }, + "msg": { + "rule": "required", + "type": "string", + "id": 3 + }, + "show_display": { + "type": "bool", + "id": 4 + } + } + }, + "NostrEncryptedMessage": { + "fields": { + "msg": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "NostrDecryptMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "pubkey": { + "rule": "required", + "type": "string", + "id": 2 + }, + "msg": { + "rule": "required", + "type": "string", + "id": 3 + }, + "show_display": { + "type": "bool", + "id": 4 + } + } + }, + "NostrDecryptedMessage": { + "fields": { + "msg": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "OneKeyRebootType": { + "values": { + "Normal": 0, + "Boardloader": 1, + "BootLoader": 2 + } + }, + "OneKeyReboot": { + "fields": { + "reboot_type": { + "rule": "required", + "type": "OneKeyRebootType", + "id": 1 + } + } + }, + "OneKeyFactoryStatus": { + "fields": { + "device_sn_set": { + "type": "bool", + "id": 10 + }, + "se_cert_set": { + "type": "bool", + "id": 11 + } + } + }, + "OneKeyStatus": { + "fields": { + "language": { + "type": "string", + "id": 100 + }, + "bt_enable": { + "type": "bool", + "id": 101 + }, + "init_states": { + "type": "bool", + "id": 102 + }, + "backup_required": { + "type": "bool", + "id": 200 + }, + "passphrase_protection": { + "type": "bool", + "id": 201 + }, + "lable": { + "type": "string", + "id": 300 + } + } + }, + "OneKeyDeviceType": { + "values": { + "CLASSIC1": 0, + "CLASSIC1S": 1, + "MINI": 2, + "TOUCH": 3, + "PRO": 5, + "CLASSIC1S_PURE": 6 + } + }, + "OneKeySeType": { + "values": { + "THD89": 0, + "SE608A": 1 + } + }, + "OneKeySEState": { + "values": { + "BOOT": 0, + "APP_FACTORY": 51, + "APP": 85 + } + }, + "OneKeyFwImgInfo": { + "fields": { + "version": { + "type": "string", + "id": 10 + }, + "build_id": { + "type": "string", + "id": 20 + }, + "hash": { + "type": "bytes", + "id": 30 + } + } + }, + "OneKeyHardwareInfo": { + "fields": { + "device_type": { + "type": "OneKeyDeviceType", + "id": 10 + }, + "serial_no": { + "type": "string", + "id": 11 + }, + "hardware_version": { + "type": "string", + "id": 100 + }, + "hardware_version_raw_adc": { + "type": "uint32", + "id": 101 + } + } + }, + "OneKeyMainMcuInfo": { + "fields": { + "board": { + "type": "OneKeyFwImgInfo", + "id": 10 + }, + "boot": { + "type": "OneKeyFwImgInfo", + "id": 20 + }, + "app": { + "type": "OneKeyFwImgInfo", + "id": 30 + } + } + }, + "OneKeyBluetoothInfo": { + "fields": { + "boot": { + "type": "OneKeyFwImgInfo", + "id": 20 + }, + "app": { + "type": "OneKeyFwImgInfo", + "id": 30 + }, + "adv_name": { + "type": "string", + "id": 100 + }, + "mac": { + "type": "bytes", + "id": 110 + } + } + }, + "OneKeySEInfo": { + "fields": { + "boot": { + "type": "OneKeyFwImgInfo", + "id": 20 + }, + "app": { + "type": "OneKeyFwImgInfo", + "id": 30 + }, + "type": { + "type": "OneKeySeType", + "id": 100 + }, + "state": { + "type": "OneKeySEState", + "id": 110 + } + } + }, + "OneKeyInfoTargets": { + "fields": { + "hw": { + "type": "bool", + "id": 100 + }, + "fw": { + "type": "bool", + "id": 200 + }, + "bt": { + "type": "bool", + "id": 300 + }, + "se1": { + "type": "bool", + "id": 400 + }, + "se2": { + "type": "bool", + "id": 410 + }, + "se3": { + "type": "bool", + "id": 420 + }, + "se4": { + "type": "bool", + "id": 430 + }, + "status": { + "type": "bool", + "id": 10000 + } + } + }, + "OneKeyInfoTypes": { "fields": { - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 1, - "options": { - "packed": false - } + "version": { + "type": "bool", + "id": 10 }, - "pubkey": { - "rule": "required", - "type": "string", - "id": 2 + "build_id": { + "type": "bool", + "id": 20 }, - "msg": { - "rule": "required", - "type": "string", - "id": 3 + "hash": { + "type": "bool", + "id": 30 }, - "show_display": { + "specific": { "type": "bool", - "id": 4 + "id": 40 } } }, - "NostrEncryptedMessage": { + "OneKeyInfoReq": { "fields": { - "msg": { - "rule": "required", - "type": "string", + "targets": { + "type": "OneKeyInfoTargets", "id": 1 - } - } - }, - "NostrDecryptMessage": { - "fields": { - "address_n": { - "rule": "repeated", - "type": "uint32", - "id": 1, - "options": { - "packed": false - } }, - "pubkey": { - "rule": "required", - "type": "string", + "types": { + "type": "OneKeyInfoTypes", "id": 2 - }, - "msg": { - "rule": "required", - "type": "string", - "id": 3 - }, - "show_display": { - "type": "bool", - "id": 4 } } }, - "NostrDecryptedMessage": { + "OneKeyInfoResp": { "fields": { - "msg": { + "protocol_version": { "rule": "required", - "type": "string", + "type": "float", "id": 1 + }, + "hw": { + "type": "OneKeyHardwareInfo", + "id": 100 + }, + "fw": { + "type": "OneKeyMainMcuInfo", + "id": 200 + }, + "bt": { + "type": "OneKeyBluetoothInfo", + "id": 300 + }, + "se1": { + "type": "OneKeySEInfo", + "id": 400 + }, + "se2": { + "type": "OneKeySEInfo", + "id": 410 + }, + "se3": { + "type": "OneKeySEInfo", + "id": 420 + }, + "se4": { + "type": "OneKeySEInfo", + "id": 430 + }, + "status": { + "type": "OneKeyStatus", + "id": 10000 } } }, @@ -9399,14 +10012,19 @@ } }, "fee": { + "rule": "required", "type": "uint64", "id": 2 }, "flags": { "type": "uint32", - "id": 3 + "id": 3, + "options": { + "default": 0 + } }, "sequence": { + "rule": "required", "type": "uint32", "id": 4 }, @@ -9415,6 +10033,7 @@ "id": 5 }, "payment": { + "rule": "required", "type": "RipplePayment", "id": 6 } @@ -9515,6 +10134,7 @@ "id": 6 }, "timestamp": { + "rule": "required", "type": "bytes", "id": 7 }, @@ -9589,6 +10209,17 @@ } } }, + "SolanaOffChainMessageVersion": { + "values": { + "MESSAGE_VERSION_0": 0 + } + }, + "SolanaOffChainMessageFormat": { + "values": { + "V0_RESTRICTED_ASCII": 0, + "V0_LIMITED_UTF8": 1 + } + }, "SolanaGetAddress": { "fields": { "address_n": { @@ -9608,6 +10239,7 @@ "SolanaAddress": { "fields": { "address": { + "rule": "required", "type": "string", "id": 1 } @@ -9633,22 +10265,12 @@ "SolanaSignedTx": { "fields": { "signature": { + "rule": "required", "type": "bytes", "id": 1 } } }, - "SolanaOffChainMessageVersion": { - "values": { - "MESSAGE_VERSION_0": 0 - } - }, - "SolanaOffChainMessageFormat": { - "values": { - "V0_RESTRICTED_ASCII": 0, - "V0_LIMITED_UTF8": 1 - } - }, "SolanaSignOffChainMessage": { "fields": { "address_n": { @@ -9774,6 +10396,7 @@ } }, "raw_tx": { + "rule": "required", "type": "bytes", "id": 2 } @@ -10341,6 +10964,19 @@ } } }, + "StellarClaimClaimableBalanceOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "balance_id": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, "StellarSignedTx": { "fields": { "public_key": { @@ -10690,10 +11326,12 @@ "TezosManagerTransfer": { "fields": { "destination": { + "rule": "required", "type": "TezosContractID", "id": 1 }, "amount": { + "rule": "required", "type": "uint64", "id": 2 } @@ -10795,10 +11433,12 @@ "TezosProposalOp": { "fields": { "source": { + "rule": "required", "type": "bytes", "id": 1 }, "period": { + "rule": "required", "type": "uint64", "id": 2 }, @@ -10812,18 +11452,22 @@ "TezosBallotOp": { "fields": { "source": { + "rule": "required", "type": "bytes", "id": 1 }, "period": { + "rule": "required", "type": "uint64", "id": 2 }, "proposal": { + "rule": "required", "type": "bytes", "id": 3 }, "ballot": { + "rule": "required", "type": "TezosBallotType", "id": 4 } @@ -10859,6 +11503,47 @@ } } }, + "ThpCredentialMetadata": { + "options": { + "(internal_only)": true + }, + "fields": { + "host_name": { + "type": "string", + "id": 1 + } + } + }, + "ThpPairingCredential": { + "options": { + "(internal_only)": true + }, + "fields": { + "cred_metadata": { + "type": "ThpCredentialMetadata", + "id": 1 + }, + "mac": { + "type": "bytes", + "id": 2 + } + } + }, + "ThpAuthenticatedCredentialData": { + "options": { + "(internal_only)": true + }, + "fields": { + "host_static_pubkey": { + "type": "bytes", + "id": 1 + }, + "cred_metadata": { + "type": "ThpCredentialMetadata", + "id": 2 + } + } + }, "TonWalletVersion": { "values": { "V4R2": 3 @@ -11058,27 +11743,6 @@ "jetton_amount_bytes": { "type": "bytes", "id": 21 - }, - "init_data_initial_chunk": { - "type": "bytes", - "id": 22 - }, - "init_data_length": { - "type": "uint32", - "id": 23 - }, - "signing_message_repr": { - "type": "bytes", - "id": 24 - } - } - }, - "TonTxAck": { - "fields": { - "init_data_chunk": { - "rule": "required", - "type": "bytes", - "id": 1 } } }, @@ -11091,10 +11755,6 @@ "signning_message": { "type": "bytes", "id": 2 - }, - "init_data_length": { - "type": "uint32", - "id": 3 } } }, @@ -11242,22 +11902,10 @@ "type": "TronTransferContract", "id": 2 }, - "provider": { - "type": "bytes", - "id": 3 - }, "vote_witness_contract": { "type": "TronVoteWitnessContract", "id": 4 }, - "contract_name": { - "type": "bytes", - "id": 5 - }, - "permission_id": { - "type": "uint32", - "id": 6 - }, "freeze_balance_contract": { "type": "TronFreezeBalanceContract", "id": 11 @@ -11297,6 +11945,18 @@ "cancel_all_unfreeze_v2_contract": { "type": "TronCancelAllUnfreezeV2Contract", "id": 59 + }, + "provider": { + "type": "bytes", + "id": 3 + }, + "contract_name": { + "type": "bytes", + "id": 5 + }, + "permission_id": { + "type": "uint32", + "id": 6 } }, "nested": { @@ -11446,6 +12106,9 @@ } } }, + "TronCancelAllUnfreezeV2Contract": { + "fields": {} + }, "TronVoteWitnessContract": { "fields": { "votes": { @@ -11474,9 +12137,6 @@ } } } - }, - "TronCancelAllUnfreezeV2Contract": { - "fields": {} } } } @@ -11608,88 +12268,12 @@ } } }, - "wire_in": { - "type": "bool", - "id": 50002, - "extend": "google.protobuf.EnumValueOptions" - }, - "wire_out": { - "type": "bool", - "id": 50003, - "extend": "google.protobuf.EnumValueOptions" - }, - "wire_debug_in": { - "type": "bool", - "id": 50004, - "extend": "google.protobuf.EnumValueOptions" - }, - "wire_debug_out": { - "type": "bool", - "id": 50005, - "extend": "google.protobuf.EnumValueOptions" - }, - "wire_tiny": { - "type": "bool", - "id": 50006, - "extend": "google.protobuf.EnumValueOptions" - }, - "wire_bootloader": { - "type": "bool", - "id": 50007, - "extend": "google.protobuf.EnumValueOptions" - }, - "wire_no_fsm": { - "type": "bool", - "id": 50008, - "extend": "google.protobuf.EnumValueOptions" - }, - "facotry": { - "type": "bool", - "id": 50501, - "extend": "google.protobuf.EnumValueOptions" - }, - "bitcoin_only": { - "type": "bool", - "id": 60000, - "extend": "google.protobuf.EnumValueOptions" - }, - "has_bitcoin_only_values": { - "type": "bool", - "id": 51001, - "extend": "google.protobuf.EnumOptions" - }, - "unstable": { - "type": "bool", - "id": 52001, - "extend": "google.protobuf.MessageOptions" - }, - "wire_type": { - "type": "uint32", - "id": 52002, - "extend": "google.protobuf.MessageOptions" - }, - "experimental": { - "type": "bool", - "id": 53001, - "extend": "google.protobuf.FieldOptions" - }, - "include_in_bitcoin_only": { - "type": "bool", - "id": 60000, - "extend": "google.protobuf.FileOptions" - }, - "CommandFlags": { - "values": { - "Default": 0, - "Factory_Only": 1 - } - }, "MessageType": { "options": { - "(has_bitcoin_only_values)": true + "allow_alias": true }, "values": { - "MessageType_Initialize": 0, + "MessageType_StartSession": 0, "MessageType_Ping": 1, "MessageType_Success": 2, "MessageType_Failure": 3, @@ -11699,6 +12283,7 @@ "MessageType_Entropy": 10, "MessageType_LoadDevice": 13, "MessageType_ResetDevice": 14, + "MessageType_SetBusy": 16, "MessageType_Features": 17, "MessageType_PinMatrixRequest": 18, "MessageType_PinMatrixAck": 19, @@ -11708,6 +12293,8 @@ "MessageType_ButtonRequest": 26, "MessageType_ButtonAck": 27, "MessageType_ApplyFlags": 28, + "MessageType_GetNonce": 31, + "MessageType_Nonce": 33, "MessageType_BackupDevice": 34, "MessageType_EntropyRequest": 35, "MessageType_EntropyAck": 36, @@ -11723,18 +12310,28 @@ "MessageType_DoPreauthorized": 84, "MessageType_PreauthorizedRequest": 85, "MessageType_CancelAuthorization": 86, - "MessageType_RebootToBootloader": 87, + "MessageType_GetFirmwareHash": 88, + "MessageType_FirmwareHash": 89, + "MessageType_UnlockPath": 93, + "MessageType_UnlockedPathRequest": 94, + "MessageType_ShowDeviceTutorial": 95, + "MessageType_UnlockBootloader": 96, + "MessageType_AuthenticateDevice": 97, + "MessageType_AuthenticityProof": 98, + "MessageType_ChangeLanguage": 990, + "MessageType_TranslationDataRequest": 991, + "MessageType_TranslationDataAck": 992, + "MessageType_SetBrightness": 993, "MessageType_SetU2FCounter": 63, "MessageType_GetNextU2FCounter": 80, "MessageType_NextU2FCounter": 81, "MessageType_Deprecated_PassphraseStateRequest": 77, "MessageType_Deprecated_PassphraseStateAck": 78, "MessageType_FirmwareErase": 6, - "MessageType_FirmwareErase_ex": 16, "MessageType_FirmwareUpload": 7, "MessageType_FirmwareRequest": 8, + "MessageType_FirmwareErase_ex": 16, "MessageType_SelfTest": 32, - "MessageType_Reboot": 30000, "MessageType_FirmwareUpdateEmmc": 30001, "MessageType_GetPublicKey": 11, "MessageType_PublicKey": 12, @@ -11743,6 +12340,7 @@ "MessageType_TxAck": 22, "MessageType_GetAddress": 29, "MessageType_Address": 30, + "MessageType_TxAckPaymentRequest": 37, "MessageType_SignMessage": 38, "MessageType_VerifyMessage": 39, "MessageType_MessageSignature": 40, @@ -11779,6 +12377,8 @@ "MessageType_DebugLinkRecordScreen": 9003, "MessageType_DebugLinkEraseSdCard": 9005, "MessageType_DebugLinkWatchLayout": 9006, + "MessageType_DebugLinkResetDebugEvents": 9007, + "MessageType_DebugLinkOptigaSetSecMax": 9008, "MessageType_EmmcFixPermission": 30100, "MessageType_EmmcPath": 30101, "MessageType_EmmcPathInfo": 30102, @@ -11826,8 +12426,7 @@ "MessageType_EthereumTypedDataValueAckOneKey": 20115, "MessageType_EthereumTypedDataSignatureOneKey": 20116, "MessageType_EthereumSignTypedHashOneKey": 20117, - "MessageType_EthereumGnosisSafeTxAck": 20118, - "MessageType_EthereumGnosisSafeTxRequest": 20119, + "MessageType_EthereumSignMessageEIP712": 10200, "MessageType_NEMGetAddress": 67, "MessageType_NEMAddress": 68, "MessageType_NEMSignTx": 69, @@ -11857,6 +12456,7 @@ "MessageType_StellarBumpSequenceOp": 221, "MessageType_StellarManageBuyOfferOp": 222, "MessageType_StellarPathPaymentStrictSendOp": 223, + "MessageType_StellarClaimClaimableBalanceOp": 225, "MessageType_StellarSignedTx": 230, "MessageType_CardanoGetPublicKey": 305, "MessageType_CardanoPublicKey": 306, @@ -11947,13 +12547,6 @@ "MessageType_BinanceOrderMsg": 707, "MessageType_BinanceCancelMsg": 708, "MessageType_BinanceSignedTx": 709, - "MessageType_SolanaGetAddress": 10100, - "MessageType_SolanaAddress": 10101, - "MessageType_SolanaSignTx": 10102, - "MessageType_SolanaSignedTx": 10103, - "MessageType_SolanaSignOffChainMessage": 10104, - "MessageType_SolanaMessageSignature": 10105, - "MessageType_SolanaSignUnsafeMessage": 10106, "MessageType_StarcoinGetAddress": 10300, "MessageType_StarcoinAddress": 10301, "MessageType_StarcoinGetPublicKey": 10302, @@ -11963,18 +12556,9 @@ "MessageType_StarcoinSignMessage": 10306, "MessageType_StarcoinMessageSignature": 10307, "MessageType_StarcoinVerifyMessage": 10308, - "MessageType_AptosGetAddress": 10600, - "MessageType_AptosAddress": 10601, - "MessageType_AptosSignTx": 10602, - "MessageType_AptosSignedTx": 10603, - "MessageType_AptosSignMessage": 10604, - "MessageType_AptosMessageSignature": 10605, - "MessageType_WebAuthnListResidentCredentials": 800, - "MessageType_WebAuthnCredentials": 801, - "MessageType_WebAuthnAddResidentCredential": 802, - "MessageType_WebAuthnRemoveResidentCredential": 803, "MessageType_BixinSeedOperate": 901, "MessageType_BixinMessageSE": 902, + "MessageType_BixinReboot": 903, "MessageType_BixinOutMessageSE": 904, "MessageType_BixinBackupRequest": 905, "MessageType_BixinBackupAck": 906, @@ -11988,7 +12572,7 @@ "MessageType_BixinBackupDevice": 914, "MessageType_BixinBackupDeviceAck": 915, "MessageType_BixinPinInputOnDevice": 10000, - "MessageType_EthereumSignMessageEIP712": 10200, + "MessageType_Deprecated_EthereumSignMessageEIP712": 10200, "MessageType_GetPublicKeyMultiple": 10210, "MessageType_PublicKeyMultiple": 10211, "MessageType_ConfluxGetAddress": 10112, @@ -12009,6 +12593,23 @@ "MessageType_NearAddress": 10702, "MessageType_NearSignTx": 10703, "MessageType_NearSignedTx": 10704, + "MessageType_AptosGetAddress": 10600, + "MessageType_AptosAddress": 10601, + "MessageType_AptosSignTx": 10602, + "MessageType_AptosSignedTx": 10603, + "MessageType_AptosSignMessage": 10604, + "MessageType_AptosMessageSignature": 10605, + "MessageType_WebAuthnListResidentCredentials": 800, + "MessageType_WebAuthnCredentials": 801, + "MessageType_WebAuthnAddResidentCredential": 802, + "MessageType_WebAuthnRemoveResidentCredential": 803, + "MessageType_SolanaGetAddress": 10100, + "MessageType_SolanaAddress": 10101, + "MessageType_SolanaSignTx": 10102, + "MessageType_SolanaSignedTx": 10103, + "MessageType_SolanaSignOffChainMessage": 10104, + "MessageType_SolanaMessageSignature": 10105, + "MessageType_SolanaSignUnsafeMessage": 10106, "MessageType_CosmosGetAddress": 10800, "MessageType_CosmosAddress": 10801, "MessageType_CosmosSignTx": 10802, @@ -12076,7 +12677,6 @@ "MessageType_TonSignedMessage": 11904, "MessageType_TonSignProof": 11905, "MessageType_TonSignedProof": 11906, - "MessageType_TonTxAck": 11907, "MessageType_ScdoGetAddress": 12001, "MessageType_ScdoAddress": 12002, "MessageType_ScdoSignTx": 12003, @@ -12106,7 +12706,11 @@ "MessageType_NeoAddress": 12302, "MessageType_NeoSignTx": 12303, "MessageType_NeoSignedTx": 12304, - "MessageType_DeviceBackToBoot": 903, + "MessageType_BenchmarkListNames": 9100, + "MessageType_BenchmarkNames": 9101, + "MessageType_BenchmarkRun": 9102, + "MessageType_BenchmarkResult": 9103, + "MessageType_OneKeyReboot": 30000, "MessageType_DeviceInfoSettings": 10001, "MessageType_GetDeviceInfo": 10002, "MessageType_DeviceInfo": 10003, @@ -12129,9 +12733,18 @@ "MessageType_ResourceUpdate": 10022, "MessageType_ListResDir": 10023, "MessageType_FileInfoList": 10024, - "MessageType_OnekeyGetFeatures": 10025, - "MessageType_OnekeyFeatures": 10026 - } + "MessageType_DeviceEraseSector": 10026, + "MessageType_WriteSEPrivateKey": 10027 + }, + "reserved": [ + [90, 92], + [114, 122], + [219, 219], + [224, 224], + [300, 304], + [309, 312], + [1000, 1099] + ] }, "google": { "nested": { diff --git a/packages/core/src/data/messages/messages_legacy_v1.json b/packages/core/src/data/messages/messages_legacy_v1.json index 6dda3ad27..b6e85598b 100644 --- a/packages/core/src/data/messages/messages_legacy_v1.json +++ b/packages/core/src/data/messages/messages_legacy_v1.json @@ -4828,7 +4828,7 @@ "PromptTemporarily": 2 } }, - "Initialize": { + "StartSession": { "fields": { "session_id": { "type": "bytes", @@ -9232,7 +9232,7 @@ "(has_bitcoin_only_values)": true }, "values": { - "MessageType_Initialize": 0, + "MessageType_StartSession": 0, "MessageType_Ping": 1, "MessageType_Success": 2, "MessageType_Failure": 3, diff --git a/packages/core/src/data/messages/messages_legacy_v2.json b/packages/core/src/data/messages/messages_legacy_v2.json new file mode 100644 index 000000000..b4bf028df --- /dev/null +++ b/packages/core/src/data/messages/messages_legacy_v2.json @@ -0,0 +1,12786 @@ +{ + "nested": { + "AlephiumGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "include_public_key": { + "type": "bool", + "id": 3 + }, + "target_group": { + "type": "uint32", + "id": 4 + } + } + }, + "AlephiumAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + }, + "derived_path": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "packed": false + } + } + } + }, + "AlephiumSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "data_initial_chunk": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "data_length": { + "type": "uint32", + "id": 3 + } + } + }, + "AlephiumSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "AlephiumTxRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + }, + "signature": { + "type": "bytes", + "id": 3 + } + } + }, + "AlephiumTxAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "AlephiumBytecodeRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + }, + "signature": { + "type": "bytes", + "id": 3 + } + } + }, + "AlephiumBytecodeAck": { + "fields": { + "bytecode_data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "AlephiumSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "type": "bytes", + "id": 2 + }, + "message_type": { + "type": "bytes", + "id": 3 + } + } + }, + "AlephiumMessageSignature": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + }, + "address": { + "type": "string", + "id": 2 + } + } + }, + "AlgorandGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 3 + } + } + }, + "AlgorandAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "AlgorandSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "AlgorandSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "AptosGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "AptosAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "AptosSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "AptosSignedTx": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "AptosSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "payload": { + "rule": "required", + "type": "AptosMessagePayload", + "id": 2 + } + }, + "nested": { + "AptosMessagePayload": { + "fields": { + "address": { + "type": "string", + "id": 2 + }, + "chain_id": { + "type": "string", + "id": 3 + }, + "application": { + "type": "string", + "id": 4 + }, + "nonce": { + "rule": "required", + "type": "string", + "id": 5 + }, + "message": { + "rule": "required", + "type": "string", + "id": 6 + } + } + } + } + }, + "AptosMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "BenfenGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "BenfenAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "BenfenSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "data_initial_chunk": { + "type": "bytes", + "id": 3, + "options": { + "default": "" + } + }, + "coin_type": { + "type": "bytes", + "id": 4 + }, + "data_length": { + "type": "uint32", + "id": 5 + } + } + }, + "BenfenSignedTx": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "BenfenTxRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + }, + "signature": { + "type": "bytes", + "id": 3 + } + } + }, + "BenfenTxAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BenfenSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "BenfenMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "BinanceGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "BinanceAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "BinanceGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "BinancePublicKey": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BinanceSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "msg_count": { + "type": "uint32", + "id": 2 + }, + "account_number": { + "type": "sint64", + "id": 3 + }, + "chain_id": { + "type": "string", + "id": 4 + }, + "memo": { + "type": "string", + "id": 5 + }, + "sequence": { + "type": "sint64", + "id": 6 + }, + "source": { + "type": "sint64", + "id": 7 + } + } + }, + "BinanceTxRequest": { + "fields": {} + }, + "BinanceTransferMsg": { + "fields": { + "inputs": { + "rule": "repeated", + "type": "BinanceInputOutput", + "id": 1 + }, + "outputs": { + "rule": "repeated", + "type": "BinanceInputOutput", + "id": 2 + } + }, + "nested": { + "BinanceInputOutput": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "coins": { + "rule": "repeated", + "type": "BinanceCoin", + "id": 2 + } + } + }, + "BinanceCoin": { + "fields": { + "amount": { + "type": "sint64", + "id": 1 + }, + "denom": { + "type": "string", + "id": 2 + } + } + } + } + }, + "BinanceOrderMsg": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "ordertype": { + "type": "BinanceOrderType", + "id": 2 + }, + "price": { + "type": "sint64", + "id": 3 + }, + "quantity": { + "type": "sint64", + "id": 4 + }, + "sender": { + "type": "string", + "id": 5 + }, + "side": { + "type": "BinanceOrderSide", + "id": 6 + }, + "symbol": { + "type": "string", + "id": 7 + }, + "timeinforce": { + "type": "BinanceTimeInForce", + "id": 8 + } + }, + "nested": { + "BinanceOrderType": { + "values": { + "OT_UNKNOWN": 0, + "MARKET": 1, + "LIMIT": 2, + "OT_RESERVED": 3 + } + }, + "BinanceOrderSide": { + "values": { + "SIDE_UNKNOWN": 0, + "BUY": 1, + "SELL": 2 + } + }, + "BinanceTimeInForce": { + "values": { + "TIF_UNKNOWN": 0, + "GTE": 1, + "TIF_RESERVED": 2, + "IOC": 3 + } + } + } + }, + "BinanceCancelMsg": { + "fields": { + "refid": { + "type": "string", + "id": 1 + }, + "sender": { + "type": "string", + "id": 2 + }, + "symbol": { + "type": "string", + "id": 3 + } + } + }, + "BinanceSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "InputScriptType": { + "values": { + "SPENDADDRESS": 0, + "SPENDMULTISIG": 1, + "EXTERNAL": 2, + "SPENDWITNESS": 3, + "SPENDP2SHWITNESS": 4, + "SPENDTAPROOT": 5 + } + }, + "OutputScriptType": { + "values": { + "PAYTOADDRESS": 0, + "PAYTOSCRIPTHASH": 1, + "PAYTOMULTISIG": 2, + "PAYTOOPRETURN": 3, + "PAYTOWITNESS": 4, + "PAYTOP2SHWITNESS": 5, + "PAYTOTAPROOT": 6 + } + }, + "DecredStakingSpendType": { + "values": { + "SSGen": 0, + "SSRTX": 1 + } + }, + "AmountUnit": { + "values": { + "BITCOIN": 0, + "MILLIBITCOIN": 1, + "MICROBITCOIN": 2, + "SATOSHI": 3 + } + }, + "MultisigRedeemScriptType": { + "fields": { + "pubkeys": { + "rule": "repeated", + "type": "HDNodePathType", + "id": 1 + }, + "signatures": { + "rule": "repeated", + "type": "bytes", + "id": 2 + }, + "m": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "nodes": { + "rule": "repeated", + "type": "HDNodeType", + "id": 4 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 5, + "options": { + "packed": false + } + } + }, + "nested": { + "HDNodePathType": { + "fields": { + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + } + } + } + } + }, + "GetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "ecdsa_curve_name": { + "type": "string", + "id": 2 + }, + "show_display": { + "type": "bool", + "id": 3 + }, + "coin_name": { + "type": "string", + "id": 4, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 5, + "options": { + "default": "SPENDADDRESS" + } + }, + "ignore_xpub_magic": { + "type": "bool", + "id": 6 + } + } + }, + "PublicKey": { + "fields": { + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 1 + }, + "xpub": { + "rule": "required", + "type": "string", + "id": 2 + }, + "root_fingerprint": { + "type": "uint32", + "id": 3 + } + } + }, + "GetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 2, + "options": { + "default": "Bitcoin" + } + }, + "show_display": { + "type": "bool", + "id": 3 + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 4 + }, + "script_type": { + "type": "InputScriptType", + "id": 5, + "options": { + "default": "SPENDADDRESS" + } + }, + "ignore_xpub_magic": { + "type": "bool", + "id": 6 + } + } + }, + "Address": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "GetOwnershipId": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 2, + "options": { + "default": "Bitcoin" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 3 + }, + "script_type": { + "type": "InputScriptType", + "id": 4, + "options": { + "default": "SPENDADDRESS" + } + } + } + }, + "OwnershipId": { + "fields": { + "ownership_id": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "SignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "coin_name": { + "type": "string", + "id": 3, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 4, + "options": { + "default": "SPENDADDRESS" + } + }, + "no_script_type": { + "type": "bool", + "id": 5 + }, + "is_bip322_simple": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + } + } + }, + "MessageSignature": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "VerifyMessage": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "coin_name": { + "type": "string", + "id": 4, + "options": { + "default": "Bitcoin" + } + } + } + }, + "SignTx": { + "fields": { + "outputs_count": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "inputs_count": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "coin_name": { + "type": "string", + "id": 3, + "options": { + "default": "Bitcoin" + } + }, + "version": { + "type": "uint32", + "id": 4, + "options": { + "default": 1 + } + }, + "lock_time": { + "type": "uint32", + "id": 5, + "options": { + "default": 0 + } + }, + "expiry": { + "type": "uint32", + "id": 6 + }, + "overwintered": { + "type": "bool", + "id": 7, + "options": { + "deprecated": true + } + }, + "version_group_id": { + "type": "uint32", + "id": 8 + }, + "timestamp": { + "type": "uint32", + "id": 9 + }, + "branch_id": { + "type": "uint32", + "id": 10 + }, + "amount_unit": { + "type": "AmountUnit", + "id": 11, + "options": { + "default": "BITCOIN" + } + }, + "decred_staking_ticket": { + "type": "bool", + "id": 12, + "options": { + "default": false + } + } + } + }, + "TxRequest": { + "fields": { + "request_type": { + "type": "RequestType", + "id": 1 + }, + "details": { + "type": "TxRequestDetailsType", + "id": 2 + }, + "serialized": { + "type": "TxRequestSerializedType", + "id": 3 + } + }, + "nested": { + "RequestType": { + "values": { + "TXINPUT": 0, + "TXOUTPUT": 1, + "TXMETA": 2, + "TXFINISHED": 3, + "TXEXTRADATA": 4, + "TXORIGINPUT": 5, + "TXORIGOUTPUT": 6 + } + }, + "TxRequestDetailsType": { + "fields": { + "request_index": { + "type": "uint32", + "id": 1 + }, + "tx_hash": { + "type": "bytes", + "id": 2 + }, + "extra_data_len": { + "type": "uint32", + "id": 3 + }, + "extra_data_offset": { + "type": "uint32", + "id": 4 + } + } + }, + "TxRequestSerializedType": { + "fields": { + "signature_index": { + "type": "uint32", + "id": 1 + }, + "signature": { + "type": "bytes", + "id": 2 + }, + "serialized_tx": { + "type": "bytes", + "id": 3 + } + } + } + } + }, + "TxAck": { + "options": { + "deprecated": true + }, + "fields": { + "tx": { + "type": "TransactionType", + "id": 1 + } + }, + "nested": { + "TransactionType": { + "fields": { + "version": { + "type": "uint32", + "id": 1 + }, + "inputs": { + "rule": "repeated", + "type": "TxInputType", + "id": 2 + }, + "bin_outputs": { + "rule": "repeated", + "type": "TxOutputBinType", + "id": 3 + }, + "lock_time": { + "type": "uint32", + "id": 4 + }, + "outputs": { + "rule": "repeated", + "type": "TxOutputType", + "id": 5 + }, + "inputs_cnt": { + "type": "uint32", + "id": 6 + }, + "outputs_cnt": { + "type": "uint32", + "id": 7 + }, + "extra_data": { + "type": "bytes", + "id": 8 + }, + "extra_data_len": { + "type": "uint32", + "id": 9 + }, + "expiry": { + "type": "uint32", + "id": 10 + }, + "overwintered": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "version_group_id": { + "type": "uint32", + "id": 12 + }, + "timestamp": { + "type": "uint32", + "id": 13 + }, + "branch_id": { + "type": "uint32", + "id": 14 + } + }, + "nested": { + "TxInputType": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "script_sig": { + "type": "bytes", + "id": 4 + }, + "sequence": { + "type": "uint32", + "id": 5, + "options": { + "default": 4294967295 + } + }, + "script_type": { + "type": "InputScriptType", + "id": 6, + "options": { + "default": "SPENDADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 7 + }, + "amount": { + "type": "uint64", + "id": 8 + }, + "decred_tree": { + "type": "uint32", + "id": 9 + }, + "witness": { + "type": "bytes", + "id": 13 + }, + "ownership_proof": { + "type": "bytes", + "id": 14 + }, + "commitment_data": { + "type": "bytes", + "id": 15 + }, + "orig_hash": { + "type": "bytes", + "id": 16 + }, + "orig_index": { + "type": "uint32", + "id": 17 + }, + "decred_staking_spend": { + "type": "DecredStakingSpendType", + "id": 18 + }, + "script_pubkey": { + "type": "bytes", + "id": 19 + } + } + }, + "TxOutputBinType": { + "fields": { + "amount": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "script_pubkey": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "decred_script_version": { + "type": "uint32", + "id": 3 + } + } + }, + "TxOutputType": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "script_type": { + "type": "OutputScriptType", + "id": 4, + "options": { + "default": "PAYTOADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 5 + }, + "op_return_data": { + "type": "bytes", + "id": 6 + }, + "orig_hash": { + "type": "bytes", + "id": 10 + }, + "orig_index": { + "type": "uint32", + "id": 11 + } + } + } + } + } + } + }, + "TxInput": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "script_sig": { + "type": "bytes", + "id": 4 + }, + "sequence": { + "type": "uint32", + "id": 5, + "options": { + "default": 4294967295 + } + }, + "script_type": { + "type": "InputScriptType", + "id": 6, + "options": { + "default": "SPENDADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 7 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 8 + }, + "decred_tree": { + "type": "uint32", + "id": 9 + }, + "witness": { + "type": "bytes", + "id": 13 + }, + "ownership_proof": { + "type": "bytes", + "id": 14 + }, + "commitment_data": { + "type": "bytes", + "id": 15 + }, + "orig_hash": { + "type": "bytes", + "id": 16 + }, + "orig_index": { + "type": "uint32", + "id": 17 + }, + "decred_staking_spend": { + "type": "DecredStakingSpendType", + "id": 18 + }, + "script_pubkey": { + "type": "bytes", + "id": 19 + } + } + }, + "TxOutput": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "script_type": { + "type": "OutputScriptType", + "id": 4, + "options": { + "default": "PAYTOADDRESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 5 + }, + "op_return_data": { + "type": "bytes", + "id": 6 + }, + "orig_hash": { + "type": "bytes", + "id": 10 + }, + "orig_index": { + "type": "uint32", + "id": 11 + } + } + }, + "PrevTx": { + "fields": { + "version": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "lock_time": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "inputs_count": { + "rule": "required", + "type": "uint32", + "id": 6 + }, + "outputs_count": { + "rule": "required", + "type": "uint32", + "id": 7 + }, + "extra_data_len": { + "type": "uint32", + "id": 9, + "options": { + "default": 0 + } + }, + "expiry": { + "type": "uint32", + "id": 10 + }, + "version_group_id": { + "type": "uint32", + "id": 12 + }, + "timestamp": { + "type": "uint32", + "id": 13 + }, + "branch_id": { + "type": "uint32", + "id": 14 + } + } + }, + "PrevInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "script_sig": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "sequence": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "decred_tree": { + "type": "uint32", + "id": 9 + } + } + }, + "PrevOutput": { + "fields": { + "amount": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "script_pubkey": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "decred_script_version": { + "type": "uint32", + "id": 3 + } + } + }, + "TxAckInput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckInputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckInputWrapper": { + "fields": { + "input": { + "rule": "required", + "type": "TxInput", + "id": 2 + } + } + } + } + }, + "TxAckOutput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckOutputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckOutputWrapper": { + "fields": { + "output": { + "rule": "required", + "type": "TxOutput", + "id": 5 + } + } + } + } + }, + "TxAckPrevMeta": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "PrevTx", + "id": 1 + } + } + }, + "TxAckPrevInput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckPrevInputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckPrevInputWrapper": { + "fields": { + "input": { + "rule": "required", + "type": "PrevInput", + "id": 2 + } + } + } + } + }, + "TxAckPrevOutput": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckPrevOutputWrapper", + "id": 1 + } + }, + "nested": { + "TxAckPrevOutputWrapper": { + "fields": { + "output": { + "rule": "required", + "type": "PrevOutput", + "id": 3 + } + } + } + } + }, + "TxAckPrevExtraData": { + "options": { + "(wire_type)": 22 + }, + "fields": { + "tx": { + "rule": "required", + "type": "TxAckPrevExtraDataWrapper", + "id": 1 + } + }, + "nested": { + "TxAckPrevExtraDataWrapper": { + "fields": { + "extra_data_chunk": { + "rule": "required", + "type": "bytes", + "id": 8 + } + } + } + } + }, + "GetOwnershipProof": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 2, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 3, + "options": { + "default": "SPENDWITNESS" + } + }, + "multisig": { + "type": "MultisigRedeemScriptType", + "id": 4 + }, + "user_confirmation": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "ownership_ids": { + "rule": "repeated", + "type": "bytes", + "id": 6 + }, + "commitment_data": { + "type": "bytes", + "id": 7, + "options": { + "default": "" + } + } + } + }, + "OwnershipProof": { + "fields": { + "ownership_proof": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "AuthorizeCoinJoin": { + "options": { + "(unstable)": true + }, + "fields": { + "coordinator": { + "rule": "required", + "type": "string", + "id": 1 + }, + "max_total_fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "fee_per_anonymity": { + "type": "uint32", + "id": 3, + "options": { + "default": 0 + } + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 4, + "options": { + "packed": false + } + }, + "coin_name": { + "type": "string", + "id": 5, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 6, + "options": { + "default": "SPENDADDRESS" + } + }, + "amount_unit": { + "type": "AmountUnit", + "id": 11, + "options": { + "default": "BITCOIN" + } + } + } + }, + "GetPublicKeyMultiple": { + "fields": { + "addresses": { + "rule": "repeated", + "type": "BIP32Address", + "id": 1 + }, + "ecdsa_curve_name": { + "type": "string", + "id": 2 + }, + "show_display": { + "type": "bool", + "id": 3 + }, + "coin_name": { + "type": "string", + "id": 4, + "options": { + "default": "Bitcoin" + } + }, + "script_type": { + "type": "InputScriptType", + "id": 5, + "options": { + "default": "SPENDADDRESS" + } + }, + "ignore_xpub_magic": { + "type": "bool", + "id": 6 + } + }, + "nested": { + "BIP32Address": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + } + } + }, + "PublicKeyMultiple": { + "fields": { + "xpubs": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "SignPsbt": { + "fields": { + "psbt": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "coin_name": { + "type": "string", + "id": 2, + "options": { + "default": "Bitcoin" + } + } + } + }, + "SignedPsbt": { + "fields": { + "psbt": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "FirmwareErase": { + "fields": { + "length": { + "type": "uint32", + "id": 1 + } + } + }, + "FirmwareRequest": { + "fields": { + "offset": { + "type": "uint32", + "id": 1 + }, + "length": { + "type": "uint32", + "id": 2 + } + } + }, + "FirmwareUpload": { + "fields": { + "payload": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + } + } + }, + "SelfTest": { + "fields": { + "payload": { + "type": "bytes", + "id": 1 + } + } + }, + "FirmwareErase_ex": { + "fields": { + "length": { + "type": "uint32", + "id": 1 + } + } + }, + "RebootType": { + "values": { + "Normal": 0, + "Boardloader": 1, + "BootLoader": 2 + } + }, + "Reboot": { + "fields": { + "reboot_type": { + "rule": "required", + "type": "RebootType", + "id": 1 + } + } + }, + "FirmwareUpdateEmmc": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + }, + "reboot_on_success": { + "type": "bool", + "id": 2 + } + } + }, + "CardanoDerivationType": { + "values": { + "LEDGER": 0, + "ICARUS": 1, + "ICARUS_TREZOR": 2 + } + }, + "CardanoAddressType": { + "values": { + "BASE": 0, + "BASE_SCRIPT_KEY": 1, + "BASE_KEY_SCRIPT": 2, + "BASE_SCRIPT_SCRIPT": 3, + "POINTER": 4, + "POINTER_SCRIPT": 5, + "ENTERPRISE": 6, + "ENTERPRISE_SCRIPT": 7, + "BYRON": 8, + "REWARD": 14, + "REWARD_SCRIPT": 15 + } + }, + "CardanoNativeScriptType": { + "values": { + "PUB_KEY": 0, + "ALL": 1, + "ANY": 2, + "N_OF_K": 3, + "INVALID_BEFORE": 4, + "INVALID_HEREAFTER": 5 + } + }, + "CardanoNativeScriptHashDisplayFormat": { + "values": { + "HIDE": 0, + "BECH32": 1, + "POLICY_ID": 2 + } + }, + "CardanoTxOutputSerializationFormat": { + "values": { + "ARRAY_LEGACY": 0, + "MAP_BABBAGE": 1 + } + }, + "CardanoCertificateType": { + "values": { + "STAKE_REGISTRATION": 0, + "STAKE_DEREGISTRATION": 1, + "STAKE_DELEGATION": 2, + "STAKE_POOL_REGISTRATION": 3, + "STAKE_REGISTRATION_CONWAY": 7, + "STAKE_DEREGISTRATION_CONWAY": 8, + "VOTE_DELEGATION": 9 + } + }, + "CardanoDRepType": { + "values": { + "KEY_HASH": 0, + "SCRIPT_HASH": 1, + "ABSTAIN": 2, + "NO_CONFIDENCE": 3 + } + }, + "CardanoPoolRelayType": { + "values": { + "SINGLE_HOST_IP": 0, + "SINGLE_HOST_NAME": 1, + "MULTIPLE_HOST_NAME": 2 + } + }, + "CardanoTxAuxiliaryDataSupplementType": { + "values": { + "NONE": 0, + "CVOTE_REGISTRATION_SIGNATURE": 1 + } + }, + "CardanoCVoteRegistrationFormat": { + "values": { + "CIP15": 0, + "CIP36": 1 + } + }, + "CardanoTxSigningMode": { + "values": { + "ORDINARY_TRANSACTION": 0, + "POOL_REGISTRATION_AS_OWNER": 1, + "MULTISIG_TRANSACTION": 2, + "PLUTUS_TRANSACTION": 3 + } + }, + "CardanoTxWitnessType": { + "values": { + "BYRON_WITNESS": 0, + "SHELLEY_WITNESS": 1 + } + }, + "CardanoBlockchainPointerType": { + "fields": { + "block_index": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "tx_index": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "certificate_index": { + "rule": "required", + "type": "uint32", + "id": 3 + } + } + }, + "CardanoNativeScript": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoNativeScriptType", + "id": 1 + }, + "scripts": { + "rule": "repeated", + "type": "CardanoNativeScript", + "id": 2 + }, + "key_hash": { + "type": "bytes", + "id": 3 + }, + "key_path": { + "rule": "repeated", + "type": "uint32", + "id": 4, + "options": { + "packed": false + } + }, + "required_signatures_count": { + "type": "uint32", + "id": 5 + }, + "invalid_before": { + "type": "uint64", + "id": 6 + }, + "invalid_hereafter": { + "type": "uint64", + "id": 7 + } + } + }, + "CardanoGetNativeScriptHash": { + "fields": { + "script": { + "rule": "required", + "type": "CardanoNativeScript", + "id": 1 + }, + "display_format": { + "rule": "required", + "type": "CardanoNativeScriptHashDisplayFormat", + "id": 2 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 3 + } + } + }, + "CardanoNativeScriptHash": { + "fields": { + "script_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoAddressParametersType": { + "fields": { + "address_type": { + "rule": "required", + "type": "CardanoAddressType", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "address_n_staking": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "packed": false + } + }, + "staking_key_hash": { + "type": "bytes", + "id": 4 + }, + "certificate_pointer": { + "type": "CardanoBlockchainPointerType", + "id": 5 + }, + "script_payment_hash": { + "type": "bytes", + "id": 6 + }, + "script_staking_hash": { + "type": "bytes", + "id": 7 + } + } + }, + "CardanoGetAddress": { + "fields": { + "show_display": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "protocol_magic": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "network_id": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "address_parameters": { + "rule": "required", + "type": "CardanoAddressParametersType", + "id": 5 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 6 + }, + "chunkify": { + "type": "bool", + "id": 7 + } + } + }, + "CardanoAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "CardanoGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 3 + } + } + }, + "CardanoPublicKey": { + "fields": { + "xpub": { + "rule": "required", + "type": "string", + "id": 1 + }, + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 2 + } + } + }, + "CardanoSignTxInit": { + "fields": { + "signing_mode": { + "rule": "required", + "type": "CardanoTxSigningMode", + "id": 1 + }, + "protocol_magic": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "network_id": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "inputs_count": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "outputs_count": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "ttl": { + "type": "uint64", + "id": 7 + }, + "certificates_count": { + "rule": "required", + "type": "uint32", + "id": 8 + }, + "withdrawals_count": { + "rule": "required", + "type": "uint32", + "id": 9 + }, + "has_auxiliary_data": { + "rule": "required", + "type": "bool", + "id": 10 + }, + "validity_interval_start": { + "type": "uint64", + "id": 11 + }, + "witness_requests_count": { + "rule": "required", + "type": "uint32", + "id": 12 + }, + "minting_asset_groups_count": { + "rule": "required", + "type": "uint32", + "id": 13 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 14 + }, + "include_network_id": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "script_data_hash": { + "type": "bytes", + "id": 16 + }, + "collateral_inputs_count": { + "rule": "required", + "type": "uint32", + "id": 17 + }, + "required_signers_count": { + "rule": "required", + "type": "uint32", + "id": 18 + }, + "has_collateral_return": { + "type": "bool", + "id": 19, + "options": { + "default": false + } + }, + "total_collateral": { + "type": "uint64", + "id": 20 + }, + "reference_inputs_count": { + "type": "uint32", + "id": 21, + "options": { + "default": 0 + } + }, + "chunkify": { + "type": "bool", + "id": 22 + }, + "tag_cbor_sets": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + } + } + }, + "CardanoTxInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoTxOutput": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "address_parameters": { + "type": "CardanoAddressParametersType", + "id": 2 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "asset_groups_count": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "datum_hash": { + "type": "bytes", + "id": 5 + }, + "format": { + "type": "CardanoTxOutputSerializationFormat", + "id": 6, + "options": { + "default": "ARRAY_LEGACY" + } + }, + "inline_datum_size": { + "type": "uint32", + "id": 7, + "options": { + "default": 0 + } + }, + "reference_script_size": { + "type": "uint32", + "id": 8, + "options": { + "default": 0 + } + } + } + }, + "CardanoAssetGroup": { + "fields": { + "policy_id": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "tokens_count": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoToken": { + "fields": { + "asset_name_bytes": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "amount": { + "type": "uint64", + "id": 2 + }, + "mint_amount": { + "type": "sint64", + "id": 3 + } + } + }, + "CardanoTxInlineDatumChunk": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoTxReferenceScriptChunk": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoPoolOwner": { + "fields": { + "staking_key_path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "staking_key_hash": { + "type": "bytes", + "id": 2 + } + } + }, + "CardanoPoolRelayParameters": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoPoolRelayType", + "id": 1 + }, + "ipv4_address": { + "type": "bytes", + "id": 2 + }, + "ipv6_address": { + "type": "bytes", + "id": 3 + }, + "host_name": { + "type": "string", + "id": 4 + }, + "port": { + "type": "uint32", + "id": 5 + } + } + }, + "CardanoPoolMetadataType": { + "fields": { + "url": { + "rule": "required", + "type": "string", + "id": 1 + }, + "hash": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "CardanoPoolParametersType": { + "fields": { + "pool_id": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "vrf_key_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "pledge": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "cost": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "margin_numerator": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "margin_denominator": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "reward_account": { + "rule": "required", + "type": "string", + "id": 7 + }, + "metadata": { + "type": "CardanoPoolMetadataType", + "id": 10 + }, + "owners_count": { + "rule": "required", + "type": "uint32", + "id": 11 + }, + "relays_count": { + "rule": "required", + "type": "uint32", + "id": 12 + } + } + }, + "CardanoDRep": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoDRepType", + "id": 1 + }, + "key_hash": { + "type": "bytes", + "id": 2 + }, + "script_hash": { + "type": "bytes", + "id": 3 + } + } + }, + "CardanoTxCertificate": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoCertificateType", + "id": 1 + }, + "path": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "pool": { + "type": "bytes", + "id": 3 + }, + "pool_parameters": { + "type": "CardanoPoolParametersType", + "id": 4 + }, + "script_hash": { + "type": "bytes", + "id": 5 + }, + "key_hash": { + "type": "bytes", + "id": 6 + }, + "deposit": { + "type": "uint64", + "id": 7 + }, + "drep": { + "type": "CardanoDRep", + "id": 8 + } + } + }, + "CardanoTxWithdrawal": { + "fields": { + "path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "script_hash": { + "type": "bytes", + "id": 3 + }, + "key_hash": { + "type": "bytes", + "id": 4 + } + } + }, + "CardanoCVoteRegistrationDelegation": { + "fields": { + "vote_public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "weight": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoCVoteRegistrationParametersType": { + "fields": { + "vote_public_key": { + "type": "bytes", + "id": 1 + }, + "staking_path": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "payment_address_parameters": { + "type": "CardanoAddressParametersType", + "id": 3 + }, + "nonce": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "format": { + "type": "CardanoCVoteRegistrationFormat", + "id": 5, + "options": { + "default": "CIP15" + } + }, + "delegations": { + "rule": "repeated", + "type": "CardanoCVoteRegistrationDelegation", + "id": 6 + }, + "voting_purpose": { + "type": "uint64", + "id": 7 + }, + "payment_address": { + "type": "string", + "id": 8 + } + } + }, + "CardanoTxAuxiliaryData": { + "fields": { + "cvote_registration_parameters": { + "type": "CardanoCVoteRegistrationParametersType", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + } + } + }, + "CardanoTxMint": { + "fields": { + "asset_groups_count": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "CardanoTxCollateralInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoTxRequiredSigner": { + "fields": { + "key_hash": { + "type": "bytes", + "id": 1 + }, + "key_path": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + } + } + }, + "CardanoTxReferenceInput": { + "fields": { + "prev_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "CardanoTxItemAck": { + "fields": {} + }, + "CardanoTxAuxiliaryDataSupplement": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoTxAuxiliaryDataSupplementType", + "id": 1 + }, + "auxiliary_data_hash": { + "type": "bytes", + "id": 2 + }, + "cvote_registration_signature": { + "type": "bytes", + "id": 3 + } + } + }, + "CardanoTxWitnessRequest": { + "fields": { + "path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + }, + "CardanoTxWitnessResponse": { + "fields": { + "type": { + "rule": "required", + "type": "CardanoTxWitnessType", + "id": 1 + }, + "pub_key": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "chain_code": { + "type": "bytes", + "id": 4 + } + } + }, + "CardanoTxHostAck": { + "fields": {} + }, + "CardanoTxBodyHash": { + "fields": { + "tx_hash": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CardanoSignTxFinished": { + "fields": {} + }, + "CardanoSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "derivation_type": { + "rule": "required", + "type": "CardanoDerivationType", + "id": 3 + }, + "network_id": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "address_type": { + "type": "CardanoAddressType", + "id": 5 + } + } + }, + "CardanoMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "Success": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "default": "" + } + } + } + }, + "Failure": { + "fields": { + "code": { + "type": "FailureType", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + } + }, + "nested": { + "FailureType": { + "values": { + "Failure_UnexpectedMessage": 1, + "Failure_ButtonExpected": 2, + "Failure_DataError": 3, + "Failure_ActionCancelled": 4, + "Failure_PinExpected": 5, + "Failure_PinCancelled": 6, + "Failure_PinInvalid": 7, + "Failure_InvalidSignature": 8, + "Failure_ProcessError": 9, + "Failure_NotEnoughFunds": 10, + "Failure_NotInitialized": 11, + "Failure_PinMismatch": 12, + "Failure_WipeCodeMismatch": 13, + "Failure_InvalidSession": 14, + "Failure_FirmwareError": 99 + } + } + } + }, + "ButtonRequest": { + "fields": { + "code": { + "type": "ButtonRequestType", + "id": 1 + }, + "pages": { + "type": "uint32", + "id": 2 + } + }, + "nested": { + "ButtonRequestType": { + "values": { + "ButtonRequest_Other": 1, + "ButtonRequest_FeeOverThreshold": 2, + "ButtonRequest_ConfirmOutput": 3, + "ButtonRequest_ResetDevice": 4, + "ButtonRequest_ConfirmWord": 5, + "ButtonRequest_WipeDevice": 6, + "ButtonRequest_ProtectCall": 7, + "ButtonRequest_SignTx": 8, + "ButtonRequest_FirmwareCheck": 9, + "ButtonRequest_Address": 10, + "ButtonRequest_PublicKey": 11, + "ButtonRequest_MnemonicWordCount": 12, + "ButtonRequest_MnemonicInput": 13, + "_Deprecated_ButtonRequest_PassphraseType": 14, + "ButtonRequest_UnknownDerivationPath": 15, + "ButtonRequest_RecoveryHomepage": 16, + "ButtonRequest_Success": 17, + "ButtonRequest_Warning": 18, + "ButtonRequest_PassphraseEntry": 19, + "ButtonRequest_PinEntry": 20 + } + } + } + }, + "ButtonAck": { + "fields": {} + }, + "PinMatrixRequest": { + "fields": { + "type": { + "type": "PinMatrixRequestType", + "id": 1 + } + }, + "nested": { + "PinMatrixRequestType": { + "values": { + "PinMatrixRequestType_Current": 1, + "PinMatrixRequestType_NewFirst": 2, + "PinMatrixRequestType_NewSecond": 3, + "PinMatrixRequestType_WipeCodeFirst": 4, + "PinMatrixRequestType_WipeCodeSecond": 5, + "PinMatrixRequestType_BackupFirst": 6, + "PinMatrixRequestType_BackupSecond": 7 + } + } + } + }, + "PinMatrixAck": { + "fields": { + "pin": { + "rule": "required", + "type": "string", + "id": 1 + }, + "new_pin": { + "type": "string", + "id": 2 + } + } + }, + "PassphraseRequest": { + "fields": { + "_on_device": { + "type": "bool", + "id": 1, + "options": { + "deprecated": true + } + } + } + }, + "PassphraseAck": { + "fields": { + "passphrase": { + "type": "string", + "id": 1 + }, + "_state": { + "type": "bytes", + "id": 2, + "options": { + "deprecated": true + } + }, + "on_device": { + "type": "bool", + "id": 3 + } + } + }, + "Deprecated_PassphraseStateRequest": { + "options": { + "deprecated": true + }, + "fields": { + "state": { + "type": "bytes", + "id": 1 + } + } + }, + "Deprecated_PassphraseStateAck": { + "options": { + "deprecated": true + }, + "fields": {} + }, + "HDNodeType": { + "fields": { + "depth": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "fingerprint": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "child_num": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "chain_code": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "private_key": { + "type": "bytes", + "id": 5 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 6 + } + } + }, + "BixinPinInputOnDevice": { + "fields": {} + }, + "ConfluxGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "chain_id": { + "type": "uint32", + "id": 3 + } + } + }, + "ConfluxAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "ConfluxSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "type": "bytes", + "id": 2 + }, + "gas_price": { + "type": "bytes", + "id": 3 + }, + "gas_limit": { + "type": "bytes", + "id": 4 + }, + "to": { + "type": "string", + "id": 5 + }, + "value": { + "type": "bytes", + "id": 6 + }, + "epoch_height": { + "type": "bytes", + "id": 7 + }, + "storage_limit": { + "type": "bytes", + "id": 8 + }, + "data_initial_chunk": { + "type": "bytes", + "id": 9 + }, + "data_length": { + "type": "uint32", + "id": 10 + }, + "chain_id": { + "type": "uint32", + "id": 11 + } + } + }, + "ConfluxTxRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "signature_v": { + "type": "uint32", + "id": 2 + }, + "signature_r": { + "type": "bytes", + "id": 3 + }, + "signature_s": { + "type": "bytes", + "id": 4 + } + } + }, + "ConfluxTxAck": { + "fields": { + "data_chunk": { + "type": "bytes", + "id": 1 + } + } + }, + "ConfluxSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "type": "bytes", + "id": 2 + } + } + }, + "ConfluxMessageSignature": { + "fields": { + "signature": { + "type": "bytes", + "id": 2 + }, + "address": { + "type": "string", + "id": 3 + } + } + }, + "ConfluxSignMessageCIP23": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "domain_hash": { + "type": "bytes", + "id": 2 + }, + "message_hash": { + "type": "bytes", + "id": 3 + } + } + }, + "CosmosGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "hrp": { + "type": "string", + "id": 2 + }, + "show_display": { + "type": "bool", + "id": 3 + } + } + }, + "CosmosAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "CosmosSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "CosmosSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "CipherKeyValue": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "key": { + "rule": "required", + "type": "string", + "id": 2 + }, + "value": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "encrypt": { + "type": "bool", + "id": 4 + }, + "ask_on_encrypt": { + "type": "bool", + "id": 5 + }, + "ask_on_decrypt": { + "type": "bool", + "id": 6 + }, + "iv": { + "type": "bytes", + "id": 7 + } + } + }, + "CipheredKeyValue": { + "fields": { + "value": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "IdentityType": { + "fields": { + "proto": { + "type": "string", + "id": 1 + }, + "user": { + "type": "string", + "id": 2 + }, + "host": { + "type": "string", + "id": 3 + }, + "port": { + "type": "string", + "id": 4 + }, + "path": { + "type": "string", + "id": 5 + }, + "index": { + "type": "uint32", + "id": 6, + "options": { + "default": 0 + } + } + } + }, + "SignIdentity": { + "fields": { + "identity": { + "rule": "required", + "type": "IdentityType", + "id": 1 + }, + "challenge_hidden": { + "type": "bytes", + "id": 2, + "options": { + "default": "" + } + }, + "challenge_visual": { + "type": "string", + "id": 3, + "options": { + "default": "" + } + }, + "ecdsa_curve_name": { + "type": "string", + "id": 4 + } + } + }, + "SignedIdentity": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 3 + } + } + }, + "GetECDHSessionKey": { + "fields": { + "identity": { + "rule": "required", + "type": "IdentityType", + "id": 1 + }, + "peer_public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "ecdsa_curve_name": { + "type": "string", + "id": 3 + } + } + }, + "ECDHSessionKey": { + "fields": { + "session_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + } + } + }, + "CosiCommit": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "data": { + "type": "bytes", + "id": 2 + } + } + }, + "CosiCommitment": { + "fields": { + "commitment": { + "type": "bytes", + "id": 1 + }, + "pubkey": { + "type": "bytes", + "id": 2 + } + } + }, + "CosiSign": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "data": { + "type": "bytes", + "id": 2 + }, + "global_commitment": { + "type": "bytes", + "id": 3 + }, + "global_pubkey": { + "type": "bytes", + "id": 4 + } + } + }, + "CosiSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BatchGetPublickeys": { + "fields": { + "ecdsa_curve_name": { + "type": "string", + "id": 1, + "options": { + "default": "ed25519" + } + }, + "paths": { + "rule": "repeated", + "type": "Path", + "id": 2 + } + }, + "nested": { + "Path": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + } + } + }, + "EcdsaPublicKeys": { + "fields": { + "public_keys": { + "rule": "repeated", + "type": "bytes", + "id": 1 + } + } + }, + "DebugLinkDecision": { + "fields": { + "yes_no": { + "type": "bool", + "id": 1 + }, + "swipe": { + "type": "DebugSwipeDirection", + "id": 2 + }, + "input": { + "type": "string", + "id": 3 + }, + "x": { + "type": "uint32", + "id": 4 + }, + "y": { + "type": "uint32", + "id": 5 + }, + "wait": { + "type": "bool", + "id": 6 + }, + "hold_ms": { + "type": "uint32", + "id": 7 + } + }, + "nested": { + "DebugSwipeDirection": { + "values": { + "UP": 0, + "DOWN": 1, + "LEFT": 2, + "RIGHT": 3 + } + } + } + }, + "DebugLinkLayout": { + "fields": { + "lines": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DebugLinkReseedRandom": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "DebugLinkRecordScreen": { + "fields": { + "target_directory": { + "type": "string", + "id": 1 + } + } + }, + "DebugLinkGetState": { + "fields": { + "wait_word_list": { + "type": "bool", + "id": 1 + }, + "wait_word_pos": { + "type": "bool", + "id": 2 + }, + "wait_layout": { + "type": "bool", + "id": 3 + } + } + }, + "DebugLinkState": { + "fields": { + "layout": { + "type": "bytes", + "id": 1 + }, + "pin": { + "type": "string", + "id": 2 + }, + "matrix": { + "type": "string", + "id": 3 + }, + "mnemonic_secret": { + "type": "bytes", + "id": 4 + }, + "node": { + "type": "HDNodeType", + "id": 5 + }, + "passphrase_protection": { + "type": "bool", + "id": 6 + }, + "reset_word": { + "type": "string", + "id": 7 + }, + "reset_entropy": { + "type": "bytes", + "id": 8 + }, + "recovery_fake_word": { + "type": "string", + "id": 9 + }, + "recovery_word_pos": { + "type": "uint32", + "id": 10 + }, + "reset_word_pos": { + "type": "uint32", + "id": 11 + }, + "mnemonic_type": { + "type": "BackupType", + "id": 12 + }, + "layout_lines": { + "rule": "repeated", + "type": "string", + "id": 13 + } + } + }, + "DebugLinkStop": { + "fields": {} + }, + "DebugLinkLog": { + "fields": { + "level": { + "type": "uint32", + "id": 1 + }, + "bucket": { + "type": "string", + "id": 2 + }, + "text": { + "type": "string", + "id": 3 + } + } + }, + "DebugLinkMemoryRead": { + "fields": { + "address": { + "type": "uint32", + "id": 1 + }, + "length": { + "type": "uint32", + "id": 2 + } + } + }, + "DebugLinkMemory": { + "fields": { + "memory": { + "type": "bytes", + "id": 1 + } + } + }, + "DebugLinkMemoryWrite": { + "fields": { + "address": { + "type": "uint32", + "id": 1 + }, + "memory": { + "type": "bytes", + "id": 2 + }, + "flash": { + "type": "bool", + "id": 3 + } + } + }, + "DebugLinkFlashErase": { + "fields": { + "sector": { + "type": "uint32", + "id": 1 + } + } + }, + "DebugLinkEraseSdCard": { + "fields": { + "format": { + "type": "bool", + "id": 1 + } + } + }, + "DebugLinkWatchLayout": { + "fields": { + "watch": { + "type": "bool", + "id": 1 + } + } + }, + "DnxGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "DnxAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "DnxSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "inputs_count": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "to_address": { + "rule": "required", + "type": "string", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "payment_id": { + "type": "bytes", + "id": 6 + } + } + }, + "DnxInputRequest": { + "fields": { + "request_index": { + "type": "uint32", + "id": 1 + }, + "tx_key": { + "type": "DnxTxKey", + "id": 2 + }, + "computed_key_image": { + "type": "DnxComputedKeyImage", + "id": 3 + } + }, + "nested": { + "DnxTxKey": { + "fields": { + "ephemeral_tx_sec_key": { + "type": "bytes", + "id": 1 + }, + "ephemeral_tx_pub_key": { + "type": "bytes", + "id": 2 + } + } + }, + "DnxComputedKeyImage": { + "fields": { + "key_image": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "DnxInputAck": { + "fields": { + "prev_index": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "global_index": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "tx_pubkey": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "prev_out_pubkey": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 5 + } + } + }, + "DnxRTSigsRequest": { + "fields": {} + }, + "DnxSignedTx": { + "fields": { + "signatures": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "output_keys": { + "rule": "repeated", + "type": "bytes", + "id": 2 + } + } + }, + "EmmcFixPermission": { + "fields": {} + }, + "EmmcPath": { + "fields": { + "exist": { + "rule": "required", + "type": "bool", + "id": 1 + }, + "size": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "year": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "month": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "day": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "hour": { + "rule": "required", + "type": "uint32", + "id": 6 + }, + "minute": { + "rule": "required", + "type": "uint32", + "id": 7 + }, + "second": { + "rule": "required", + "type": "uint32", + "id": 8 + }, + "readonly": { + "rule": "required", + "type": "bool", + "id": 9 + }, + "hidden": { + "rule": "required", + "type": "bool", + "id": 10 + }, + "system": { + "rule": "required", + "type": "bool", + "id": 11 + }, + "archive": { + "rule": "required", + "type": "bool", + "id": 12 + }, + "directory": { + "rule": "required", + "type": "bool", + "id": 13 + } + } + }, + "EmmcPathInfo": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EmmcFile": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + }, + "offset": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "len": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "data": { + "type": "bytes", + "id": 4 + }, + "data_hash": { + "type": "uint32", + "id": 5 + }, + "processed_byte": { + "type": "uint32", + "id": 6 + } + } + }, + "EmmcFileRead": { + "fields": { + "file": { + "rule": "required", + "type": "EmmcFile", + "id": 1 + }, + "ui_percentage": { + "type": "uint32", + "id": 2 + } + } + }, + "EmmcFileWrite": { + "fields": { + "file": { + "rule": "required", + "type": "EmmcFile", + "id": 1 + }, + "overwrite": { + "rule": "required", + "type": "bool", + "id": 2 + }, + "append": { + "rule": "required", + "type": "bool", + "id": 3 + }, + "ui_percentage": { + "type": "uint32", + "id": 4 + } + } + }, + "EmmcFileDelete": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EmmcDir": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + }, + "child_dirs": { + "type": "string", + "id": 2 + }, + "child_files": { + "type": "string", + "id": 3 + } + } + }, + "EmmcDirList": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EmmcDirMake": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EmmcDirRemove": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EosGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "EosPublicKey": { + "fields": { + "wif_public_key": { + "rule": "required", + "type": "string", + "id": 1 + }, + "raw_public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "EosSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "chain_id": { + "type": "bytes", + "id": 2 + }, + "header": { + "type": "EosTxHeader", + "id": 3 + }, + "num_actions": { + "type": "uint32", + "id": 4 + } + }, + "nested": { + "EosTxHeader": { + "fields": { + "expiration": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "ref_block_num": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "ref_block_prefix": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "max_net_usage_words": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "max_cpu_usage_ms": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "delay_sec": { + "rule": "required", + "type": "uint32", + "id": 6 + } + } + } + } + }, + "EosTxActionRequest": { + "fields": { + "data_size": { + "type": "uint32", + "id": 1 + } + } + }, + "EosTxActionAck": { + "fields": { + "common": { + "type": "EosActionCommon", + "id": 1 + }, + "transfer": { + "type": "EosActionTransfer", + "id": 2 + }, + "delegate": { + "type": "EosActionDelegate", + "id": 3 + }, + "undelegate": { + "type": "EosActionUndelegate", + "id": 4 + }, + "refund": { + "type": "EosActionRefund", + "id": 5 + }, + "buy_ram": { + "type": "EosActionBuyRam", + "id": 6 + }, + "buy_ram_bytes": { + "type": "EosActionBuyRamBytes", + "id": 7 + }, + "sell_ram": { + "type": "EosActionSellRam", + "id": 8 + }, + "vote_producer": { + "type": "EosActionVoteProducer", + "id": 9 + }, + "update_auth": { + "type": "EosActionUpdateAuth", + "id": 10 + }, + "delete_auth": { + "type": "EosActionDeleteAuth", + "id": 11 + }, + "link_auth": { + "type": "EosActionLinkAuth", + "id": 12 + }, + "unlink_auth": { + "type": "EosActionUnlinkAuth", + "id": 13 + }, + "new_account": { + "type": "EosActionNewAccount", + "id": 14 + }, + "unknown": { + "type": "EosActionUnknown", + "id": 15 + } + }, + "nested": { + "EosAsset": { + "fields": { + "amount": { + "type": "sint64", + "id": 1 + }, + "symbol": { + "type": "uint64", + "id": 2 + } + } + }, + "EosPermissionLevel": { + "fields": { + "actor": { + "type": "uint64", + "id": 1 + }, + "permission": { + "type": "uint64", + "id": 2 + } + } + }, + "EosAuthorizationKey": { + "fields": { + "type": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "key": { + "type": "bytes", + "id": 2 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "packed": false + } + }, + "weight": { + "rule": "required", + "type": "uint32", + "id": 4 + } + } + }, + "EosAuthorizationAccount": { + "fields": { + "account": { + "type": "EosPermissionLevel", + "id": 1 + }, + "weight": { + "type": "uint32", + "id": 2 + } + } + }, + "EosAuthorizationWait": { + "fields": { + "wait_sec": { + "type": "uint32", + "id": 1 + }, + "weight": { + "type": "uint32", + "id": 2 + } + } + }, + "EosAuthorization": { + "fields": { + "threshold": { + "type": "uint32", + "id": 1 + }, + "keys": { + "rule": "repeated", + "type": "EosAuthorizationKey", + "id": 2 + }, + "accounts": { + "rule": "repeated", + "type": "EosAuthorizationAccount", + "id": 3 + }, + "waits": { + "rule": "repeated", + "type": "EosAuthorizationWait", + "id": 4 + } + } + }, + "EosActionCommon": { + "fields": { + "account": { + "type": "uint64", + "id": 1 + }, + "name": { + "type": "uint64", + "id": 2 + }, + "authorization": { + "rule": "repeated", + "type": "EosPermissionLevel", + "id": 3 + } + } + }, + "EosActionTransfer": { + "fields": { + "sender": { + "type": "uint64", + "id": 1 + }, + "receiver": { + "type": "uint64", + "id": 2 + }, + "quantity": { + "type": "EosAsset", + "id": 3 + }, + "memo": { + "type": "string", + "id": 4 + } + } + }, + "EosActionDelegate": { + "fields": { + "sender": { + "type": "uint64", + "id": 1 + }, + "receiver": { + "type": "uint64", + "id": 2 + }, + "net_quantity": { + "type": "EosAsset", + "id": 3 + }, + "cpu_quantity": { + "type": "EosAsset", + "id": 4 + }, + "transfer": { + "type": "bool", + "id": 5 + } + } + }, + "EosActionUndelegate": { + "fields": { + "sender": { + "type": "uint64", + "id": 1 + }, + "receiver": { + "type": "uint64", + "id": 2 + }, + "net_quantity": { + "type": "EosAsset", + "id": 3 + }, + "cpu_quantity": { + "type": "EosAsset", + "id": 4 + } + } + }, + "EosActionRefund": { + "fields": { + "owner": { + "type": "uint64", + "id": 1 + } + } + }, + "EosActionBuyRam": { + "fields": { + "payer": { + "type": "uint64", + "id": 1 + }, + "receiver": { + "type": "uint64", + "id": 2 + }, + "quantity": { + "type": "EosAsset", + "id": 3 + } + } + }, + "EosActionBuyRamBytes": { + "fields": { + "payer": { + "type": "uint64", + "id": 1 + }, + "receiver": { + "type": "uint64", + "id": 2 + }, + "bytes": { + "type": "uint32", + "id": 3 + } + } + }, + "EosActionSellRam": { + "fields": { + "account": { + "type": "uint64", + "id": 1 + }, + "bytes": { + "type": "uint64", + "id": 2 + } + } + }, + "EosActionVoteProducer": { + "fields": { + "voter": { + "type": "uint64", + "id": 1 + }, + "proxy": { + "type": "uint64", + "id": 2 + }, + "producers": { + "rule": "repeated", + "type": "uint64", + "id": 3, + "options": { + "packed": false + } + } + } + }, + "EosActionUpdateAuth": { + "fields": { + "account": { + "type": "uint64", + "id": 1 + }, + "permission": { + "type": "uint64", + "id": 2 + }, + "parent": { + "type": "uint64", + "id": 3 + }, + "auth": { + "type": "EosAuthorization", + "id": 4 + } + } + }, + "EosActionDeleteAuth": { + "fields": { + "account": { + "type": "uint64", + "id": 1 + }, + "permission": { + "type": "uint64", + "id": 2 + } + } + }, + "EosActionLinkAuth": { + "fields": { + "account": { + "type": "uint64", + "id": 1 + }, + "code": { + "type": "uint64", + "id": 2 + }, + "type": { + "type": "uint64", + "id": 3 + }, + "requirement": { + "type": "uint64", + "id": 4 + } + } + }, + "EosActionUnlinkAuth": { + "fields": { + "account": { + "type": "uint64", + "id": 1 + }, + "code": { + "type": "uint64", + "id": 2 + }, + "type": { + "type": "uint64", + "id": 3 + } + } + }, + "EosActionNewAccount": { + "fields": { + "creator": { + "type": "uint64", + "id": 1 + }, + "name": { + "type": "uint64", + "id": 2 + }, + "owner": { + "type": "EosAuthorization", + "id": 3 + }, + "active": { + "type": "EosAuthorization", + "id": 4 + } + } + }, + "EosActionUnknown": { + "fields": { + "data_size": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "data_chunk": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "EosSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EthereumDefinitionType": { + "values": { + "NETWORK": 0, + "TOKEN": 1 + } + }, + "EthereumNetworkInfo": { + "fields": { + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "symbol": { + "rule": "required", + "type": "string", + "id": 2 + }, + "slip44": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "name": { + "rule": "required", + "type": "string", + "id": 4 + }, + "icon": { + "type": "string", + "id": 101 + }, + "primary_color": { + "type": "uint64", + "id": 102 + } + } + }, + "EthereumTokenInfo": { + "fields": { + "address": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "symbol": { + "rule": "required", + "type": "string", + "id": 3 + }, + "decimals": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "name": { + "rule": "required", + "type": "string", + "id": 5 + } + } + }, + "EthereumDefinitions": { + "fields": { + "encoded_network": { + "type": "bytes", + "id": 1 + }, + "encoded_token": { + "type": "bytes", + "id": 2 + } + } + }, + "EthereumSignTypedDataOneKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "primary_type": { + "rule": "required", + "type": "string", + "id": 2 + }, + "metamask_v4_compat": { + "type": "bool", + "id": 3, + "options": { + "default": true + } + }, + "chain_id": { + "type": "uint64", + "id": 4 + } + } + }, + "EthereumGnosisSafeTxOperation": { + "values": { + "CALL": 0, + "DELEGATE_CALL": 1 + } + }, + "EthereumGnosisSafeTxRequest": { + "fields": {} + }, + "EthereumGnosisSafeTxAck": { + "fields": { + "to": { + "rule": "required", + "type": "string", + "id": 1 + }, + "value": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "data": { + "type": "bytes", + "id": 3 + }, + "operation": { + "rule": "required", + "type": "EthereumGnosisSafeTxOperation", + "id": 4 + }, + "safeTxGas": { + "rule": "required", + "type": "bytes", + "id": 5 + }, + "baseGas": { + "rule": "required", + "type": "bytes", + "id": 6 + }, + "gasPrice": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "gasToken": { + "rule": "required", + "type": "string", + "id": 8 + }, + "refundReceiver": { + "rule": "required", + "type": "string", + "id": 9 + }, + "nonce": { + "rule": "required", + "type": "bytes", + "id": 10 + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 11 + }, + "verifyingContract": { + "rule": "required", + "type": "string", + "id": 12 + } + } + }, + "EthereumTypedDataStructRequestOneKey": { + "fields": { + "name": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EthereumTypedDataStructAckOneKey": { + "fields": { + "members": { + "rule": "repeated", + "type": "EthereumStructMemberOneKey", + "id": 1 + } + }, + "nested": { + "EthereumStructMemberOneKey": { + "fields": { + "type": { + "rule": "required", + "type": "EthereumFieldTypeOneKey", + "id": 1 + }, + "name": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "EthereumFieldTypeOneKey": { + "fields": { + "data_type": { + "rule": "required", + "type": "EthereumDataTypeOneKey", + "id": 1 + }, + "size": { + "type": "uint32", + "id": 2 + }, + "entry_type": { + "type": "EthereumFieldTypeOneKey", + "id": 3 + }, + "struct_name": { + "type": "string", + "id": 4 + } + } + }, + "EthereumDataTypeOneKey": { + "values": { + "UINT": 1, + "INT": 2, + "BYTES": 3, + "STRING": 4, + "BOOL": 5, + "ADDRESS": 6, + "ARRAY": 7, + "STRUCT": 8 + } + } + } + }, + "EthereumTypedDataValueRequestOneKey": { + "fields": { + "member_path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + }, + "EthereumTypedDataValueAckOneKey": { + "fields": { + "value": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "EthereumSignTypedData": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "primary_type": { + "rule": "required", + "type": "string", + "id": 2 + }, + "metamask_v4_compat": { + "type": "bool", + "id": 3, + "options": { + "default": true + } + }, + "definitions": { + "type": "EthereumDefinitions", + "id": 4 + } + } + }, + "EthereumTypedDataStructRequest": { + "fields": { + "name": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "EthereumTypedDataStructAck": { + "fields": { + "members": { + "rule": "repeated", + "type": "EthereumStructMember", + "id": 1 + } + }, + "nested": { + "EthereumStructMember": { + "fields": { + "type": { + "rule": "required", + "type": "EthereumFieldType", + "id": 1 + }, + "name": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "EthereumFieldType": { + "fields": { + "data_type": { + "rule": "required", + "type": "EthereumDataType", + "id": 1 + }, + "size": { + "type": "uint32", + "id": 2 + }, + "entry_type": { + "type": "EthereumFieldType", + "id": 3 + }, + "struct_name": { + "type": "string", + "id": 4 + } + } + }, + "EthereumDataType": { + "values": { + "UINT": 1, + "INT": 2, + "BYTES": 3, + "STRING": 4, + "BOOL": 5, + "ADDRESS": 6, + "ARRAY": 7, + "STRUCT": 8 + } + } + } + }, + "EthereumTypedDataValueRequest": { + "fields": { + "member_path": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + }, + "EthereumTypedDataValueAck": { + "fields": { + "value": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "EthereumGetPublicKeyOneKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "chain_id": { + "type": "uint64", + "id": 3 + } + } + }, + "EthereumPublicKeyOneKey": { + "fields": { + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 1 + }, + "xpub": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "EthereumGetAddressOneKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "chain_id": { + "type": "uint64", + "id": 3 + } + } + }, + "EthereumAddressOneKey": { + "fields": { + "_old_address": { + "type": "bytes", + "id": 1, + "options": { + "deprecated": true + } + }, + "address": { + "type": "string", + "id": 2 + } + } + }, + "EthereumSignTxOneKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "type": "bytes", + "id": 2, + "options": { + "default": "" + } + }, + "gas_price": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "to": { + "type": "string", + "id": 11, + "options": { + "default": "" + } + }, + "value": { + "type": "bytes", + "id": 6, + "options": { + "default": "" + } + }, + "data_initial_chunk": { + "type": "bytes", + "id": 7, + "options": { + "default": "" + } + }, + "data_length": { + "type": "uint32", + "id": 8, + "options": { + "default": 0 + } + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 9 + }, + "tx_type": { + "type": "uint32", + "id": 10 + } + } + }, + "EthereumSignTxEIP1559OneKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "max_gas_fee": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "max_priority_fee": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "gas_limit": { + "rule": "required", + "type": "bytes", + "id": 5 + }, + "to": { + "type": "string", + "id": 6, + "options": { + "default": "" + } + }, + "value": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "data_initial_chunk": { + "type": "bytes", + "id": 8, + "options": { + "default": "" + } + }, + "data_length": { + "rule": "required", + "type": "uint32", + "id": 9 + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 10 + }, + "access_list": { + "rule": "repeated", + "type": "EthereumAccessListOneKey", + "id": 11 + } + }, + "nested": { + "EthereumAccessListOneKey": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "storage_keys": { + "rule": "repeated", + "type": "bytes", + "id": 2 + } + } + } + } + }, + "EthereumTxRequestOneKey": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "signature_v": { + "type": "uint32", + "id": 2 + }, + "signature_r": { + "type": "bytes", + "id": 3 + }, + "signature_s": { + "type": "bytes", + "id": 4 + } + } + }, + "EthereumTxAckOneKey": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "EthereumSignMessageOneKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "chain_id": { + "type": "uint64", + "id": 3 + } + } + }, + "EthereumMessageSignatureOneKey": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "address": { + "rule": "required", + "type": "string", + "id": 3 + } + } + }, + "EthereumVerifyMessageOneKey": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "address": { + "rule": "required", + "type": "string", + "id": 4 + }, + "chain_id": { + "type": "uint64", + "id": 5 + } + } + }, + "EthereumSignTypedHashOneKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "domain_separator_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message_hash": { + "type": "bytes", + "id": 3 + }, + "chain_id": { + "type": "uint64", + "id": 4 + } + } + }, + "EthereumTypedDataSignatureOneKey": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "EthereumSignMessageEIP712": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "domain_hash": { + "type": "bytes", + "id": 2 + }, + "message_hash": { + "type": "bytes", + "id": 3 + } + } + }, + "EthereumGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "EthereumPublicKey": { + "fields": { + "node": { + "rule": "required", + "type": "HDNodeType", + "id": 1 + }, + "xpub": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "EthereumGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "encoded_network": { + "type": "bytes", + "id": 3 + } + } + }, + "EthereumAddress": { + "fields": { + "_old_address": { + "type": "bytes", + "id": 1, + "options": { + "deprecated": true + } + }, + "address": { + "type": "string", + "id": 2 + } + } + }, + "EthereumSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "type": "bytes", + "id": 2, + "options": { + "default": "" + } + }, + "gas_price": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "to": { + "type": "string", + "id": 11, + "options": { + "default": "" + } + }, + "value": { + "type": "bytes", + "id": 6, + "options": { + "default": "" + } + }, + "data_initial_chunk": { + "type": "bytes", + "id": 7, + "options": { + "default": "" + } + }, + "data_length": { + "type": "uint32", + "id": 8, + "options": { + "default": 0 + } + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 9 + }, + "tx_type": { + "type": "uint32", + "id": 10 + }, + "definitions": { + "type": "EthereumDefinitions", + "id": 12 + } + } + }, + "EthereumSignTxEIP1559": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "max_gas_fee": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "max_priority_fee": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "gas_limit": { + "rule": "required", + "type": "bytes", + "id": 5 + }, + "to": { + "type": "string", + "id": 6, + "options": { + "default": "" + } + }, + "value": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "data_initial_chunk": { + "type": "bytes", + "id": 8, + "options": { + "default": "" + } + }, + "data_length": { + "rule": "required", + "type": "uint32", + "id": 9 + }, + "chain_id": { + "rule": "required", + "type": "uint64", + "id": 10 + }, + "access_list": { + "rule": "repeated", + "type": "EthereumAccessList", + "id": 11 + }, + "definitions": { + "type": "EthereumDefinitions", + "id": 12 + } + }, + "nested": { + "EthereumAccessList": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "storage_keys": { + "rule": "repeated", + "type": "bytes", + "id": 2 + } + } + } + } + }, + "EthereumTxRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "signature_v": { + "type": "uint32", + "id": 2 + }, + "signature_r": { + "type": "bytes", + "id": 3 + }, + "signature_s": { + "type": "bytes", + "id": 4 + } + } + }, + "EthereumTxAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "EthereumSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "encoded_network": { + "type": "bytes", + "id": 3 + } + } + }, + "EthereumMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "address": { + "rule": "required", + "type": "string", + "id": 3 + } + } + }, + "EthereumVerifyMessage": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "address": { + "rule": "required", + "type": "string", + "id": 4 + } + } + }, + "EthereumSignTypedHash": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "domain_separator_hash": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message_hash": { + "type": "bytes", + "id": 3 + }, + "encoded_network": { + "type": "bytes", + "id": 4 + } + } + }, + "EthereumTypedDataSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "FilecoinGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "testnet": { + "type": "bool", + "id": 3 + } + } + }, + "FilecoinAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "FilecoinSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "testnet": { + "type": "bool", + "id": 3 + } + } + }, + "FilecoinSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "KaspaGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "prefix": { + "type": "string", + "id": 3, + "options": { + "default": "kaspa" + } + }, + "scheme": { + "type": "string", + "id": 4, + "options": { + "default": "schnorr" + } + } + } + }, + "KaspaAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "KaspaSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "scheme": { + "type": "string", + "id": 3, + "options": { + "default": "schnorr" + } + }, + "prefix": { + "type": "string", + "id": 4, + "options": { + "default": "kaspa" + } + }, + "input_count": { + "type": "uint32", + "id": 5, + "options": { + "default": 1 + } + } + } + }, + "KaspaTxInputRequest": { + "fields": { + "request_index": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "signature": { + "type": "bytes", + "id": 2 + } + } + }, + "KaspaTxInputAck": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_message": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "KaspaSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "LnurlAuth": { + "fields": { + "domain": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "data": { + "rule": "required", + "type": "bytes", + "id": 3 + } + } + }, + "LnurlAuthResp": { + "fields": { + "publickey": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + }, + "signature": { + "type": "bytes", + "id": 3 + } + } + }, + "BackupType": { + "values": { + "Bip39": 0, + "Slip39_Basic": 1, + "Slip39_Advanced": 2 + } + }, + "SafetyCheckLevel": { + "values": { + "Strict": 0, + "PromptAlways": 1, + "PromptTemporarily": 2 + } + }, + "StartSession": { + "fields": { + "session_id": { + "type": "bytes", + "id": 1 + }, + "_skip_passphrase": { + "type": "bool", + "id": 2, + "options": { + "deprecated": true + } + }, + "derive_cardano": { + "type": "bool", + "id": 3 + } + } + }, + "GetFeatures": { + "fields": {} + }, + "OnekeyGetFeatures": { + "fields": {} + }, + "OneKeyDeviceType": { + "values": { + "CLASSIC": 0, + "CLASSIC1S": 1, + "MINI": 2, + "TOUCH": 3, + "PRO": 5, + "PURE": 6 + } + }, + "OneKeySeType": { + "values": { + "THD89": 0, + "SE608A": 1 + } + }, + "OneKeySEState": { + "values": { + "BOOT": 0, + "APP": 1 + } + }, + "Features": { + "fields": { + "vendor": { + "type": "string", + "id": 1 + }, + "major_version": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "minor_version": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "patch_version": { + "rule": "required", + "type": "uint32", + "id": 4 + }, + "bootloader_mode": { + "type": "bool", + "id": 5 + }, + "device_id": { + "type": "string", + "id": 6 + }, + "pin_protection": { + "type": "bool", + "id": 7 + }, + "passphrase_protection": { + "type": "bool", + "id": 8 + }, + "language": { + "type": "string", + "id": 9 + }, + "label": { + "type": "string", + "id": 10 + }, + "initialized": { + "type": "bool", + "id": 12 + }, + "revision": { + "type": "bytes", + "id": 13 + }, + "bootloader_hash": { + "type": "bytes", + "id": 14 + }, + "imported": { + "type": "bool", + "id": 15 + }, + "unlocked": { + "type": "bool", + "id": 16 + }, + "_passphrase_cached": { + "type": "bool", + "id": 17, + "options": { + "deprecated": true + } + }, + "firmware_present": { + "type": "bool", + "id": 18 + }, + "needs_backup": { + "type": "bool", + "id": 19 + }, + "flags": { + "type": "uint32", + "id": 20 + }, + "model": { + "type": "string", + "id": 21 + }, + "fw_major": { + "type": "uint32", + "id": 22 + }, + "fw_minor": { + "type": "uint32", + "id": 23 + }, + "fw_patch": { + "type": "uint32", + "id": 24 + }, + "fw_vendor": { + "type": "string", + "id": 25 + }, + "unfinished_backup": { + "type": "bool", + "id": 27 + }, + "no_backup": { + "type": "bool", + "id": 28 + }, + "recovery_mode": { + "type": "bool", + "id": 29 + }, + "capabilities": { + "rule": "repeated", + "type": "Capability", + "id": 30, + "options": { + "packed": false + } + }, + "backup_type": { + "type": "BackupType", + "id": 31 + }, + "sd_card_present": { + "type": "bool", + "id": 32 + }, + "sd_protection": { + "type": "bool", + "id": 33 + }, + "wipe_code_protection": { + "type": "bool", + "id": 34 + }, + "session_id": { + "type": "bytes", + "id": 35 + }, + "passphrase_always_on_device": { + "type": "bool", + "id": 36 + }, + "safety_checks": { + "type": "SafetyCheckLevel", + "id": 37 + }, + "auto_lock_delay_ms": { + "type": "uint32", + "id": 38 + }, + "display_rotation": { + "type": "uint32", + "id": 39 + }, + "experimental_features": { + "type": "bool", + "id": 40 + }, + "busy": { + "type": "bool", + "id": 41 + }, + "offset": { + "type": "uint32", + "id": 500 + }, + "ble_name": { + "type": "string", + "id": 501 + }, + "ble_ver": { + "type": "string", + "id": 502 + }, + "ble_enable": { + "type": "bool", + "id": 503 + }, + "se_enable": { + "type": "bool", + "id": 504 + }, + "se_ver": { + "type": "string", + "id": 506 + }, + "backup_only": { + "type": "bool", + "id": 507 + }, + "onekey_version": { + "type": "string", + "id": 508 + }, + "onekey_serial": { + "type": "string", + "id": 509 + }, + "bootloader_version": { + "type": "string", + "id": 510 + }, + "serial_no": { + "type": "string", + "id": 511 + }, + "spi_flash": { + "type": "string", + "id": 512 + }, + "initstates": { + "type": "uint32", + "id": 513 + }, + "NFT_voucher": { + "type": "bytes", + "id": 514 + }, + "cpu_info": { + "type": "string", + "id": 515 + }, + "pre_firmware": { + "type": "string", + "id": 516 + }, + "coin_switch": { + "type": "uint32", + "id": 517 + }, + "build_id": { + "type": "bytes", + "id": 518 + }, + "boardloader_version": { + "type": "string", + "id": 519 + }, + "battery_level": { + "type": "uint32", + "id": 520 + }, + "onekey_device_type": { + "type": "OneKeyDeviceType", + "id": 600 + }, + "onekey_se_type": { + "type": "OneKeySeType", + "id": 601 + }, + "onekey_board_version": { + "type": "string", + "id": 602 + }, + "onekey_board_hash": { + "type": "bytes", + "id": 603 + }, + "onekey_boot_version": { + "type": "string", + "id": 604 + }, + "onekey_boot_hash": { + "type": "bytes", + "id": 605 + }, + "onekey_se01_version": { + "type": "string", + "id": 606 + }, + "onekey_se01_hash": { + "type": "bytes", + "id": 607 + }, + "onekey_se01_build_id": { + "type": "string", + "id": 608 + }, + "onekey_firmware_version": { + "type": "string", + "id": 609 + }, + "onekey_firmware_hash": { + "type": "bytes", + "id": 610 + }, + "onekey_firmware_build_id": { + "type": "string", + "id": 611 + }, + "onekey_serial_no": { + "type": "string", + "id": 612 + }, + "onekey_boot_build_id": { + "type": "string", + "id": 613 + }, + "onekey_ble_name": { + "type": "string", + "id": 614 + }, + "onekey_ble_version": { + "type": "string", + "id": 615 + }, + "onekey_ble_build_id": { + "type": "string", + "id": 616 + }, + "onekey_ble_hash": { + "type": "bytes", + "id": 617 + }, + "onekey_se02_version": { + "type": "string", + "id": 618 + }, + "onekey_se03_version": { + "type": "string", + "id": 619 + }, + "onekey_se04_version": { + "type": "string", + "id": 620 + }, + "onekey_se01_state": { + "type": "OneKeySEState", + "id": 621 + }, + "onekey_se02_state": { + "type": "OneKeySEState", + "id": 622 + }, + "onekey_se03_state": { + "type": "OneKeySEState", + "id": 623 + }, + "onekey_se04_state": { + "type": "OneKeySEState", + "id": 624 + } + }, + "nested": { + "Capability": { + "options": { + "(has_bitcoin_only_values)": true + }, + "values": { + "Capability_Bitcoin": 1, + "Capability_Bitcoin_like": 2, + "Capability_Binance": 3, + "Capability_Cardano": 4, + "Capability_Crypto": 5, + "Capability_EOS": 6, + "Capability_Ethereum": 7, + "Capability_Lisk": 8, + "Capability_Monero": 9, + "Capability_NEM": 10, + "Capability_Ripple": 11, + "Capability_Stellar": 12, + "Capability_Tezos": 13, + "Capability_U2F": 14, + "Capability_Shamir": 15, + "Capability_ShamirGroups": 16, + "Capability_PassphraseEntry": 17 + } + } + } + }, + "OnekeyFeatures": { + "fields": { + "onekey_device_type": { + "type": "OneKeyDeviceType", + "id": 1 + }, + "onekey_board_version": { + "type": "string", + "id": 2 + }, + "onekey_boot_version": { + "type": "string", + "id": 3 + }, + "onekey_firmware_version": { + "type": "string", + "id": 4 + }, + "onekey_board_hash": { + "type": "bytes", + "id": 5 + }, + "onekey_boot_hash": { + "type": "bytes", + "id": 6 + }, + "onekey_firmware_hash": { + "type": "bytes", + "id": 7 + }, + "onekey_board_build_id": { + "type": "string", + "id": 8 + }, + "onekey_boot_build_id": { + "type": "string", + "id": 9 + }, + "onekey_firmware_build_id": { + "type": "string", + "id": 10 + }, + "onekey_serial_no": { + "type": "string", + "id": 11 + }, + "onekey_ble_name": { + "type": "string", + "id": 12 + }, + "onekey_ble_version": { + "type": "string", + "id": 13 + }, + "onekey_ble_build_id": { + "type": "string", + "id": 14 + }, + "onekey_ble_hash": { + "type": "bytes", + "id": 15 + }, + "onekey_se_type": { + "type": "OneKeySeType", + "id": 16 + }, + "onekey_se01_state": { + "type": "OneKeySEState", + "id": 17 + }, + "onekey_se02_state": { + "type": "OneKeySEState", + "id": 18 + }, + "onekey_se03_state": { + "type": "OneKeySEState", + "id": 19 + }, + "onekey_se04_state": { + "type": "OneKeySEState", + "id": 20 + }, + "onekey_se01_version": { + "type": "string", + "id": 21 + }, + "onekey_se02_version": { + "type": "string", + "id": 22 + }, + "onekey_se03_version": { + "type": "string", + "id": 23 + }, + "onekey_se04_version": { + "type": "string", + "id": 24 + }, + "onekey_se01_hash": { + "type": "bytes", + "id": 25 + }, + "onekey_se02_hash": { + "type": "bytes", + "id": 26 + }, + "onekey_se03_hash": { + "type": "bytes", + "id": 27 + }, + "onekey_se04_hash": { + "type": "bytes", + "id": 28 + }, + "onekey_se01_build_id": { + "type": "string", + "id": 29 + }, + "onekey_se02_build_id": { + "type": "string", + "id": 30 + }, + "onekey_se03_build_id": { + "type": "string", + "id": 31 + }, + "onekey_se04_build_id": { + "type": "string", + "id": 32 + }, + "onekey_se01_boot_version": { + "type": "string", + "id": 33 + }, + "onekey_se02_boot_version": { + "type": "string", + "id": 34 + }, + "onekey_se03_boot_version": { + "type": "string", + "id": 35 + }, + "onekey_se04_boot_version": { + "type": "string", + "id": 36 + }, + "onekey_se01_boot_hash": { + "type": "bytes", + "id": 37 + }, + "onekey_se02_boot_hash": { + "type": "bytes", + "id": 38 + }, + "onekey_se03_boot_hash": { + "type": "bytes", + "id": 39 + }, + "onekey_se04_boot_hash": { + "type": "bytes", + "id": 40 + }, + "onekey_se01_boot_build_id": { + "type": "string", + "id": 41 + }, + "onekey_se02_boot_build_id": { + "type": "string", + "id": 42 + }, + "onekey_se03_boot_build_id": { + "type": "string", + "id": 43 + }, + "onekey_se04_boot_build_id": { + "type": "string", + "id": 44 + } + } + }, + "LockDevice": { + "fields": {} + }, + "EndSession": { + "fields": {} + }, + "ApplySettings": { + "fields": { + "language": { + "type": "string", + "id": 1 + }, + "label": { + "type": "string", + "id": 2 + }, + "use_passphrase": { + "type": "bool", + "id": 3 + }, + "homescreen": { + "type": "bytes", + "id": 4 + }, + "_passphrase_source": { + "type": "uint32", + "id": 5, + "options": { + "deprecated": true + } + }, + "auto_lock_delay_ms": { + "type": "uint32", + "id": 6 + }, + "display_rotation": { + "type": "uint32", + "id": 7 + }, + "passphrase_always_on_device": { + "type": "bool", + "id": 8 + }, + "safety_checks": { + "type": "SafetyCheckLevel", + "id": 9 + }, + "experimental_features": { + "type": "bool", + "id": 10 + }, + "use_ble": { + "type": "bool", + "id": 100 + }, + "use_se": { + "type": "bool", + "id": 101 + }, + "is_bixinapp": { + "type": "bool", + "id": 102 + }, + "fastpay_pin": { + "type": "bool", + "id": 103 + }, + "fastpay_confirm": { + "type": "bool", + "id": 104 + }, + "fastpay_money_limit": { + "type": "uint64", + "id": 105 + }, + "fastpay_times": { + "type": "uint32", + "id": 106 + } + }, + "nested": { + "ExportType": { + "values": { + "SeedEncExportType_NO": 0, + "SeedEncExportType_YES": 1, + "MnemonicPlainExportType_YES": 2 + } + } + } + }, + "ApplyFlags": { + "fields": { + "flags": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "ChangePin": { + "fields": { + "remove": { + "type": "bool", + "id": 1 + } + } + }, + "ChangeWipeCode": { + "fields": { + "remove": { + "type": "bool", + "id": 1 + } + } + }, + "SdProtect": { + "fields": { + "operation": { + "rule": "required", + "type": "SdProtectOperationType", + "id": 1 + } + }, + "nested": { + "SdProtectOperationType": { + "values": { + "DISABLE": 0, + "ENABLE": 1, + "REFRESH": 2 + } + } + } + }, + "Ping": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "default": "" + } + }, + "button_protection": { + "type": "bool", + "id": 2 + } + } + }, + "Cancel": { + "fields": {} + }, + "GetEntropy": { + "fields": { + "size": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "Entropy": { + "fields": { + "entropy": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "WipeDevice": { + "fields": {} + }, + "LoadDevice": { + "fields": { + "mnemonics": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "pin": { + "type": "string", + "id": 3 + }, + "passphrase_protection": { + "type": "bool", + "id": 4 + }, + "language": { + "type": "string", + "id": 5, + "options": { + "default": "en-US" + } + }, + "label": { + "type": "string", + "id": 6 + }, + "skip_checksum": { + "type": "bool", + "id": 7 + }, + "u2f_counter": { + "type": "uint32", + "id": 8 + }, + "needs_backup": { + "type": "bool", + "id": 9 + }, + "no_backup": { + "type": "bool", + "id": 10 + } + } + }, + "ResetDevice": { + "fields": { + "display_random": { + "type": "bool", + "id": 1 + }, + "strength": { + "type": "uint32", + "id": 2, + "options": { + "default": 256 + } + }, + "passphrase_protection": { + "type": "bool", + "id": 3 + }, + "pin_protection": { + "type": "bool", + "id": 4 + }, + "language": { + "type": "string", + "id": 5, + "options": { + "default": "en-US" + } + }, + "label": { + "type": "string", + "id": 6 + }, + "u2f_counter": { + "type": "uint32", + "id": 7 + }, + "skip_backup": { + "type": "bool", + "id": 8 + }, + "no_backup": { + "type": "bool", + "id": 9 + }, + "backup_type": { + "type": "BackupType", + "id": 10, + "options": { + "default": "Bip39" + } + } + } + }, + "BackupDevice": { + "fields": {} + }, + "EntropyRequest": { + "fields": {} + }, + "EntropyAck": { + "fields": { + "entropy": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "RecoveryDevice": { + "fields": { + "word_count": { + "type": "uint32", + "id": 1 + }, + "passphrase_protection": { + "type": "bool", + "id": 2 + }, + "pin_protection": { + "type": "bool", + "id": 3 + }, + "language": { + "type": "string", + "id": 4 + }, + "label": { + "type": "string", + "id": 5 + }, + "enforce_wordlist": { + "type": "bool", + "id": 6 + }, + "type": { + "type": "RecoveryDeviceType", + "id": 8 + }, + "u2f_counter": { + "type": "uint32", + "id": 9 + }, + "dry_run": { + "type": "bool", + "id": 10 + } + }, + "nested": { + "RecoveryDeviceType": { + "values": { + "RecoveryDeviceType_ScrambledWords": 0, + "RecoveryDeviceType_Matrix": 1 + } + } + } + }, + "WordRequest": { + "fields": { + "type": { + "rule": "required", + "type": "WordRequestType", + "id": 1 + } + }, + "nested": { + "WordRequestType": { + "values": { + "WordRequestType_Plain": 0, + "WordRequestType_Matrix9": 1, + "WordRequestType_Matrix6": 2 + } + } + } + }, + "WordAck": { + "fields": { + "word": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "SetU2FCounter": { + "fields": { + "u2f_counter": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "GetNextU2FCounter": { + "fields": {} + }, + "NextU2FCounter": { + "fields": { + "u2f_counter": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "DoPreauthorized": { + "fields": {} + }, + "PreauthorizedRequest": { + "fields": {} + }, + "CancelAuthorization": { + "fields": {} + }, + "BixinSeedOperate": { + "fields": { + "type": { + "rule": "required", + "type": "SeedRequestType", + "id": 1 + }, + "seed_importData": { + "type": "bytes", + "id": 2 + } + }, + "nested": { + "SeedRequestType": { + "values": { + "SeedRequestType_Gen": 0, + "SeedRequestType_EncExport": 1, + "SeedRequestType_EncImport": 2 + } + } + } + }, + "BixinMessageSE": { + "fields": { + "inputmessage": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinOutMessageSE": { + "fields": { + "outmessage": { + "type": "bytes", + "id": 1 + } + } + }, + "DeviceBackToBoot": { + "fields": {} + }, + "BixinBackupRequest": { + "fields": {} + }, + "BixinBackupAck": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinRestoreRequest": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "language": { + "type": "string", + "id": 2 + }, + "label": { + "type": "string", + "id": 3 + }, + "passphrase_protection": { + "type": "bool", + "id": 4 + } + } + }, + "BixinRestoreAck": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinVerifyDeviceRequest": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "BixinVerifyDeviceAck": { + "fields": { + "cert": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "BixinWhiteListRequest": { + "fields": { + "type": { + "rule": "required", + "type": "WL_OperationType", + "id": 1 + }, + "addr_in": { + "type": "string", + "id": 2 + } + }, + "nested": { + "WL_OperationType": { + "values": { + "WL_OperationType_Add": 0, + "WL_OperationType_Delete": 1, + "WL_OperationType_Inquire": 2 + } + } + } + }, + "BixinWhiteListAck": { + "fields": { + "address": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "BixinLoadDevice": { + "fields": { + "mnemonics": { + "rule": "required", + "type": "string", + "id": 1 + }, + "language": { + "type": "string", + "id": 5, + "options": { + "default": "en-US" + } + }, + "label": { + "type": "string", + "id": 6 + }, + "skip_checksum": { + "type": "bool", + "id": 7 + } + } + }, + "BixinBackupDevice": { + "fields": {} + }, + "BixinBackupDeviceAck": { + "fields": { + "mnemonics": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "DeviceInfoSettings": { + "fields": { + "serial_no": { + "type": "string", + "id": 1 + }, + "cpu_info": { + "type": "string", + "id": 2 + }, + "pre_firmware": { + "type": "string", + "id": 3 + } + } + }, + "GetDeviceInfo": { + "fields": {} + }, + "DeviceInfo": { + "fields": { + "serial_no": { + "type": "string", + "id": 1 + }, + "spiFlash_info": { + "type": "string", + "id": 2 + }, + "SE_info": { + "type": "string", + "id": 3 + }, + "NFT_voucher": { + "type": "bytes", + "id": 4 + }, + "cpu_info": { + "type": "string", + "id": 5 + }, + "pre_firmware": { + "type": "string", + "id": 6 + } + } + }, + "ReadSEPublicKey": { + "fields": {} + }, + "SEPublicKey": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "WriteSEPublicCert": { + "fields": { + "public_cert": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "ReadSEPublicCert": { + "fields": {} + }, + "SEPublicCert": { + "fields": { + "public_cert": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "SpiFlashWrite": { + "fields": { + "address": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "data": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "SpiFlashRead": { + "fields": { + "address": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "len": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "SpiFlashData": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "SESignMessage": { + "fields": { + "message": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "SEMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "ResourceUpload": { + "fields": { + "extension": { + "rule": "required", + "type": "string", + "id": 1 + }, + "data_length": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "res_type": { + "rule": "required", + "type": "ResourceType", + "id": 3 + }, + "nft_meta_data": { + "type": "bytes", + "id": 4 + }, + "zoom_data_length": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "file_name_no_ext": { + "type": "string", + "id": 6 + } + }, + "nested": { + "ResourceType": { + "values": { + "WallPaper": 0, + "Nft": 1 + } + } + } + }, + "ZoomRequest": { + "fields": { + "offset": { + "type": "uint32", + "id": 1 + }, + "data_length": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "ResourceRequest": { + "fields": { + "offset": { + "type": "uint32", + "id": 1 + }, + "data_length": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + }, + "ResourceAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + } + } + }, + "ResourceUpdate": { + "fields": { + "file_name": { + "rule": "required", + "type": "string", + "id": 1 + }, + "data_length": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "initial_data_chunk": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "hash": { + "type": "bytes", + "id": 4 + } + } + }, + "NFTWriteInfo": { + "fields": { + "index": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "width": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "height": { + "rule": "required", + "type": "uint32", + "id": 3 + }, + "name_zh": { + "type": "string", + "id": 4 + }, + "name_en": { + "type": "string", + "id": 5 + } + } + }, + "NFTWriteData": { + "fields": { + "index": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "data": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "offset": { + "rule": "required", + "type": "uint32", + "id": 3 + } + } + }, + "RebootToBootloader": { + "fields": {} + }, + "RebootToBoardloader": { + "fields": {} + }, + "ListResDir": { + "fields": { + "path": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "FileInfoList": { + "fields": { + "files": { + "rule": "repeated", + "type": "FileInfo", + "id": 1 + } + }, + "nested": { + "FileInfo": { + "fields": { + "name": { + "rule": "required", + "type": "string", + "id": 1 + }, + "size": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + } + } + }, + "DeviceEraseSector": { + "fields": { + "sector": { + "rule": "required", + "type": "uint32", + "id": 1 + } + } + }, + "MoneroTransactionSourceEntry": { + "fields": { + "outputs": { + "rule": "repeated", + "type": "MoneroOutputEntry", + "id": 1 + }, + "real_output": { + "type": "uint64", + "id": 2 + }, + "real_out_tx_key": { + "type": "bytes", + "id": 3 + }, + "real_out_additional_tx_keys": { + "rule": "repeated", + "type": "bytes", + "id": 4 + }, + "real_output_in_tx_index": { + "type": "uint64", + "id": 5 + }, + "amount": { + "type": "uint64", + "id": 6 + }, + "rct": { + "type": "bool", + "id": 7 + }, + "mask": { + "type": "bytes", + "id": 8 + }, + "multisig_kLRki": { + "type": "MoneroMultisigKLRki", + "id": 9 + }, + "subaddr_minor": { + "type": "uint32", + "id": 10 + } + }, + "nested": { + "MoneroOutputEntry": { + "fields": { + "idx": { + "type": "uint64", + "id": 1 + }, + "key": { + "type": "MoneroRctKeyPublic", + "id": 2 + } + }, + "nested": { + "MoneroRctKeyPublic": { + "fields": { + "dest": { + "type": "bytes", + "id": 1 + }, + "commitment": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "MoneroMultisigKLRki": { + "fields": { + "K": { + "type": "bytes", + "id": 1 + }, + "L": { + "type": "bytes", + "id": 2 + }, + "R": { + "type": "bytes", + "id": 3 + }, + "ki": { + "type": "bytes", + "id": 4 + } + } + } + } + }, + "MoneroTransactionDestinationEntry": { + "fields": { + "amount": { + "type": "uint64", + "id": 1 + }, + "addr": { + "type": "MoneroAccountPublicAddress", + "id": 2 + }, + "is_subaddress": { + "type": "bool", + "id": 3 + }, + "original": { + "type": "bytes", + "id": 4 + }, + "is_integrated": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "MoneroAccountPublicAddress": { + "fields": { + "spend_public_key": { + "type": "bytes", + "id": 1 + }, + "view_public_key": { + "type": "bytes", + "id": 2 + } + } + } + } + }, + "MoneroTransactionRsigData": { + "fields": { + "rsig_type": { + "type": "uint32", + "id": 1 + }, + "offload_type": { + "type": "uint32", + "id": 2 + }, + "grouping": { + "rule": "repeated", + "type": "uint64", + "id": 3, + "options": { + "packed": false + } + }, + "mask": { + "type": "bytes", + "id": 4 + }, + "rsig": { + "type": "bytes", + "id": 5 + }, + "rsig_parts": { + "rule": "repeated", + "type": "bytes", + "id": 6 + }, + "bp_version": { + "type": "uint32", + "id": 7 + } + } + }, + "MoneroGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "network_type": { + "type": "uint32", + "id": 3 + }, + "account": { + "type": "uint32", + "id": 4 + }, + "minor": { + "type": "uint32", + "id": 5 + }, + "payment_id": { + "type": "bytes", + "id": 6 + } + } + }, + "MoneroAddress": { + "fields": { + "address": { + "type": "bytes", + "id": 1 + } + } + }, + "MoneroGetWatchKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network_type": { + "type": "uint32", + "id": 2 + } + } + }, + "MoneroWatchKey": { + "fields": { + "watch_key": { + "type": "bytes", + "id": 1 + }, + "address": { + "type": "bytes", + "id": 2 + } + } + }, + "MoneroTransactionInitRequest": { + "fields": { + "version": { + "type": "uint32", + "id": 1 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "network_type": { + "type": "uint32", + "id": 3 + }, + "tsx_data": { + "type": "MoneroTransactionData", + "id": 4 + } + }, + "nested": { + "MoneroTransactionData": { + "fields": { + "version": { + "type": "uint32", + "id": 1 + }, + "payment_id": { + "type": "bytes", + "id": 2 + }, + "unlock_time": { + "type": "uint64", + "id": 3 + }, + "outputs": { + "rule": "repeated", + "type": "MoneroTransactionDestinationEntry", + "id": 4 + }, + "change_dts": { + "type": "MoneroTransactionDestinationEntry", + "id": 5 + }, + "num_inputs": { + "type": "uint32", + "id": 6 + }, + "mixin": { + "type": "uint32", + "id": 7 + }, + "fee": { + "type": "uint64", + "id": 8 + }, + "account": { + "type": "uint32", + "id": 9 + }, + "minor_indices": { + "rule": "repeated", + "type": "uint32", + "id": 10, + "options": { + "packed": false + } + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 11 + }, + "integrated_indices": { + "rule": "repeated", + "type": "uint32", + "id": 12, + "options": { + "packed": false + } + }, + "client_version": { + "type": "uint32", + "id": 13 + }, + "hard_fork": { + "type": "uint32", + "id": 14 + }, + "monero_version": { + "type": "bytes", + "id": 15 + } + } + } + } + }, + "MoneroTransactionInitAck": { + "fields": { + "hmacs": { + "rule": "repeated", + "type": "bytes", + "id": 1 + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 2 + } + } + }, + "MoneroTransactionSetInputRequest": { + "fields": { + "src_entr": { + "type": "MoneroTransactionSourceEntry", + "id": 1 + } + } + }, + "MoneroTransactionSetInputAck": { + "fields": { + "vini": { + "type": "bytes", + "id": 1 + }, + "vini_hmac": { + "type": "bytes", + "id": 2 + }, + "pseudo_out": { + "type": "bytes", + "id": 3 + }, + "pseudo_out_hmac": { + "type": "bytes", + "id": 4 + }, + "pseudo_out_alpha": { + "type": "bytes", + "id": 5 + }, + "spend_key": { + "type": "bytes", + "id": 6 + } + } + }, + "MoneroTransactionInputsPermutationRequest": { + "fields": { + "perm": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + } + } + }, + "MoneroTransactionInputsPermutationAck": { + "fields": {} + }, + "MoneroTransactionInputViniRequest": { + "fields": { + "src_entr": { + "type": "MoneroTransactionSourceEntry", + "id": 1 + }, + "vini": { + "type": "bytes", + "id": 2 + }, + "vini_hmac": { + "type": "bytes", + "id": 3 + }, + "pseudo_out": { + "type": "bytes", + "id": 4 + }, + "pseudo_out_hmac": { + "type": "bytes", + "id": 5 + }, + "orig_idx": { + "type": "uint32", + "id": 6 + } + } + }, + "MoneroTransactionInputViniAck": { + "fields": {} + }, + "MoneroTransactionAllInputsSetRequest": { + "fields": {} + }, + "MoneroTransactionAllInputsSetAck": { + "fields": { + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 1 + } + } + }, + "MoneroTransactionSetOutputRequest": { + "fields": { + "dst_entr": { + "type": "MoneroTransactionDestinationEntry", + "id": 1 + }, + "dst_entr_hmac": { + "type": "bytes", + "id": 2 + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 3 + }, + "is_offloaded_bp": { + "type": "bool", + "id": 4 + } + } + }, + "MoneroTransactionSetOutputAck": { + "fields": { + "tx_out": { + "type": "bytes", + "id": 1 + }, + "vouti_hmac": { + "type": "bytes", + "id": 2 + }, + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 3 + }, + "out_pk": { + "type": "bytes", + "id": 4 + }, + "ecdh_info": { + "type": "bytes", + "id": 5 + } + } + }, + "MoneroTransactionAllOutSetRequest": { + "fields": { + "rsig_data": { + "type": "MoneroTransactionRsigData", + "id": 1 + } + } + }, + "MoneroTransactionAllOutSetAck": { + "fields": { + "extra": { + "type": "bytes", + "id": 1 + }, + "tx_prefix_hash": { + "type": "bytes", + "id": 2 + }, + "rv": { + "type": "MoneroRingCtSig", + "id": 4 + }, + "full_message_hash": { + "type": "bytes", + "id": 5 + } + }, + "nested": { + "MoneroRingCtSig": { + "fields": { + "txn_fee": { + "type": "uint64", + "id": 1 + }, + "message": { + "type": "bytes", + "id": 2 + }, + "rv_type": { + "type": "uint32", + "id": 3 + } + } + } + } + }, + "MoneroTransactionSignInputRequest": { + "fields": { + "src_entr": { + "type": "MoneroTransactionSourceEntry", + "id": 1 + }, + "vini": { + "type": "bytes", + "id": 2 + }, + "vini_hmac": { + "type": "bytes", + "id": 3 + }, + "pseudo_out": { + "type": "bytes", + "id": 4 + }, + "pseudo_out_hmac": { + "type": "bytes", + "id": 5 + }, + "pseudo_out_alpha": { + "type": "bytes", + "id": 6 + }, + "spend_key": { + "type": "bytes", + "id": 7 + }, + "orig_idx": { + "type": "uint32", + "id": 8 + } + } + }, + "MoneroTransactionSignInputAck": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + }, + "pseudo_out": { + "type": "bytes", + "id": 2 + } + } + }, + "MoneroTransactionFinalRequest": { + "fields": {} + }, + "MoneroTransactionFinalAck": { + "fields": { + "cout_key": { + "type": "bytes", + "id": 1 + }, + "salt": { + "type": "bytes", + "id": 2 + }, + "rand_mult": { + "type": "bytes", + "id": 3 + }, + "tx_enc_keys": { + "type": "bytes", + "id": 4 + }, + "opening_key": { + "type": "bytes", + "id": 5 + } + } + }, + "MoneroKeyImageExportInitRequest": { + "fields": { + "num": { + "type": "uint64", + "id": 1 + }, + "hash": { + "type": "bytes", + "id": 2 + }, + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 3, + "options": { + "packed": false + } + }, + "network_type": { + "type": "uint32", + "id": 4 + }, + "subs": { + "rule": "repeated", + "type": "MoneroSubAddressIndicesList", + "id": 5 + } + }, + "nested": { + "MoneroSubAddressIndicesList": { + "fields": { + "account": { + "type": "uint32", + "id": 1 + }, + "minor_indices": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + } + } + } + } + }, + "MoneroKeyImageExportInitAck": { + "fields": {} + }, + "MoneroKeyImageSyncStepRequest": { + "fields": { + "tdis": { + "rule": "repeated", + "type": "MoneroTransferDetails", + "id": 1 + } + }, + "nested": { + "MoneroTransferDetails": { + "fields": { + "out_key": { + "type": "bytes", + "id": 1 + }, + "tx_pub_key": { + "type": "bytes", + "id": 2 + }, + "additional_tx_pub_keys": { + "rule": "repeated", + "type": "bytes", + "id": 3 + }, + "internal_output_index": { + "type": "uint64", + "id": 4 + }, + "sub_addr_major": { + "type": "uint32", + "id": 5 + }, + "sub_addr_minor": { + "type": "uint32", + "id": 6 + } + } + } + } + }, + "MoneroKeyImageSyncStepAck": { + "fields": { + "kis": { + "rule": "repeated", + "type": "MoneroExportedKeyImage", + "id": 1 + } + }, + "nested": { + "MoneroExportedKeyImage": { + "fields": { + "iv": { + "type": "bytes", + "id": 1 + }, + "blob": { + "type": "bytes", + "id": 3 + } + } + } + } + }, + "MoneroKeyImageSyncFinalRequest": { + "fields": {} + }, + "MoneroKeyImageSyncFinalAck": { + "fields": { + "enc_key": { + "type": "bytes", + "id": 1 + } + } + }, + "MoneroGetTxKeyRequest": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network_type": { + "type": "uint32", + "id": 2 + }, + "salt1": { + "type": "bytes", + "id": 3 + }, + "salt2": { + "type": "bytes", + "id": 4 + }, + "tx_enc_keys": { + "type": "bytes", + "id": 5 + }, + "tx_prefix_hash": { + "type": "bytes", + "id": 6 + }, + "reason": { + "type": "uint32", + "id": 7 + }, + "view_public_key": { + "type": "bytes", + "id": 8 + } + } + }, + "MoneroGetTxKeyAck": { + "fields": { + "salt": { + "type": "bytes", + "id": 1 + }, + "tx_keys": { + "type": "bytes", + "id": 2 + }, + "tx_derivations": { + "type": "bytes", + "id": 3 + } + } + }, + "MoneroLiveRefreshStartRequest": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network_type": { + "type": "uint32", + "id": 2 + } + } + }, + "MoneroLiveRefreshStartAck": { + "fields": {} + }, + "MoneroLiveRefreshStepRequest": { + "fields": { + "out_key": { + "type": "bytes", + "id": 1 + }, + "recv_deriv": { + "type": "bytes", + "id": 2 + }, + "real_out_idx": { + "type": "uint64", + "id": 3 + }, + "sub_addr_major": { + "type": "uint32", + "id": 4 + }, + "sub_addr_minor": { + "type": "uint32", + "id": 5 + } + } + }, + "MoneroLiveRefreshStepAck": { + "fields": { + "salt": { + "type": "bytes", + "id": 1 + }, + "key_image": { + "type": "bytes", + "id": 2 + } + } + }, + "MoneroLiveRefreshFinalRequest": { + "fields": {} + }, + "MoneroLiveRefreshFinalAck": { + "fields": {} + }, + "DebugMoneroDiagRequest": { + "fields": { + "ins": { + "type": "uint64", + "id": 1 + }, + "p1": { + "type": "uint64", + "id": 2 + }, + "p2": { + "type": "uint64", + "id": 3 + }, + "pd": { + "rule": "repeated", + "type": "uint64", + "id": 4, + "options": { + "packed": false + } + }, + "data1": { + "type": "bytes", + "id": 5 + }, + "data2": { + "type": "bytes", + "id": 6 + } + } + }, + "DebugMoneroDiagAck": { + "fields": { + "ins": { + "type": "uint64", + "id": 1 + }, + "p1": { + "type": "uint64", + "id": 2 + }, + "p2": { + "type": "uint64", + "id": 3 + }, + "pd": { + "rule": "repeated", + "type": "uint64", + "id": 4, + "options": { + "packed": false + } + }, + "data1": { + "type": "bytes", + "id": 5 + }, + "data2": { + "type": "bytes", + "id": 6 + } + } + }, + "NearGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "NearAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "NearSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "NearSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "NEMGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network": { + "type": "uint32", + "id": 2 + }, + "show_display": { + "type": "bool", + "id": 3 + } + } + }, + "NEMAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "NEMSignTx": { + "fields": { + "transaction": { + "type": "NEMTransactionCommon", + "id": 1 + }, + "multisig": { + "type": "NEMTransactionCommon", + "id": 2 + }, + "transfer": { + "type": "NEMTransfer", + "id": 3 + }, + "cosigning": { + "type": "bool", + "id": 4 + }, + "provision_namespace": { + "type": "NEMProvisionNamespace", + "id": 5 + }, + "mosaic_creation": { + "type": "NEMMosaicCreation", + "id": 6 + }, + "supply_change": { + "type": "NEMMosaicSupplyChange", + "id": 7 + }, + "aggregate_modification": { + "type": "NEMAggregateModification", + "id": 8 + }, + "importance_transfer": { + "type": "NEMImportanceTransfer", + "id": 9 + } + }, + "nested": { + "NEMTransactionCommon": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network": { + "type": "uint32", + "id": 2 + }, + "timestamp": { + "type": "uint32", + "id": 3 + }, + "fee": { + "type": "uint64", + "id": 4 + }, + "deadline": { + "type": "uint32", + "id": 5 + }, + "signer": { + "type": "bytes", + "id": 6 + } + } + }, + "NEMTransfer": { + "fields": { + "recipient": { + "type": "string", + "id": 1 + }, + "amount": { + "type": "uint64", + "id": 2 + }, + "payload": { + "type": "bytes", + "id": 3 + }, + "public_key": { + "type": "bytes", + "id": 4 + }, + "mosaics": { + "rule": "repeated", + "type": "NEMMosaic", + "id": 5 + } + }, + "nested": { + "NEMMosaic": { + "fields": { + "namespace": { + "type": "string", + "id": 1 + }, + "mosaic": { + "type": "string", + "id": 2 + }, + "quantity": { + "type": "uint64", + "id": 3 + } + } + } + } + }, + "NEMProvisionNamespace": { + "fields": { + "namespace": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "sink": { + "type": "string", + "id": 3 + }, + "fee": { + "type": "uint64", + "id": 4 + } + } + }, + "NEMMosaicCreation": { + "fields": { + "definition": { + "type": "NEMMosaicDefinition", + "id": 1 + }, + "sink": { + "type": "string", + "id": 2 + }, + "fee": { + "type": "uint64", + "id": 3 + } + }, + "nested": { + "NEMMosaicDefinition": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ticker": { + "type": "string", + "id": 2 + }, + "namespace": { + "type": "string", + "id": 3 + }, + "mosaic": { + "type": "string", + "id": 4 + }, + "divisibility": { + "type": "uint32", + "id": 5 + }, + "levy": { + "type": "NEMMosaicLevy", + "id": 6 + }, + "fee": { + "type": "uint64", + "id": 7 + }, + "levy_address": { + "type": "string", + "id": 8 + }, + "levy_namespace": { + "type": "string", + "id": 9 + }, + "levy_mosaic": { + "type": "string", + "id": 10 + }, + "supply": { + "type": "uint64", + "id": 11 + }, + "mutable_supply": { + "type": "bool", + "id": 12 + }, + "transferable": { + "type": "bool", + "id": 13 + }, + "description": { + "type": "string", + "id": 14 + }, + "networks": { + "rule": "repeated", + "type": "uint32", + "id": 15, + "options": { + "packed": false + } + } + }, + "nested": { + "NEMMosaicLevy": { + "values": { + "MosaicLevy_Absolute": 1, + "MosaicLevy_Percentile": 2 + } + } + } + } + } + }, + "NEMMosaicSupplyChange": { + "fields": { + "namespace": { + "type": "string", + "id": 1 + }, + "mosaic": { + "type": "string", + "id": 2 + }, + "type": { + "type": "NEMSupplyChangeType", + "id": 3 + }, + "delta": { + "type": "uint64", + "id": 4 + } + }, + "nested": { + "NEMSupplyChangeType": { + "values": { + "SupplyChange_Increase": 1, + "SupplyChange_Decrease": 2 + } + } + } + }, + "NEMAggregateModification": { + "fields": { + "modifications": { + "rule": "repeated", + "type": "NEMCosignatoryModification", + "id": 1 + }, + "relative_change": { + "type": "sint32", + "id": 2 + } + }, + "nested": { + "NEMCosignatoryModification": { + "fields": { + "type": { + "type": "NEMModificationType", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + } + }, + "nested": { + "NEMModificationType": { + "values": { + "CosignatoryModification_Add": 1, + "CosignatoryModification_Delete": 2 + } + } + } + } + } + }, + "NEMImportanceTransfer": { + "fields": { + "mode": { + "type": "NEMImportanceTransferMode", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + } + }, + "nested": { + "NEMImportanceTransferMode": { + "values": { + "ImportanceTransfer_Activate": 1, + "ImportanceTransfer_Deactivate": 2 + } + } + } + } + } + }, + "NEMSignedTx": { + "fields": { + "data": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "NEMDecryptMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network": { + "type": "uint32", + "id": 2 + }, + "public_key": { + "type": "bytes", + "id": 3 + }, + "payload": { + "type": "bytes", + "id": 4 + } + } + }, + "NEMDecryptedMessage": { + "fields": { + "payload": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "NeoGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "NeoAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + } + } + }, + "NeoSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "network_magic": { + "type": "uint32", + "id": 3, + "options": { + "default": 860833102 + } + } + } + }, + "NeoSignedTx": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "NervosGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "network": { + "rule": "required", + "type": "string", + "id": 2 + }, + "show_display": { + "type": "bool", + "id": 3 + } + } + }, + "NervosAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "NervosSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "data_initial_chunk": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "witness_buffer": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "network": { + "rule": "required", + "type": "string", + "id": 4 + }, + "data_length": { + "type": "uint32", + "id": 5 + } + } + }, + "NervosSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "NervosTxRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + }, + "signature": { + "type": "bytes", + "id": 3 + } + } + }, + "NervosTxAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "NexaGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "prefix": { + "type": "string", + "id": 3, + "options": { + "default": "nexa" + } + } + } + }, + "NexaAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "NexaSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "prefix": { + "type": "string", + "id": 3, + "options": { + "default": "nexa" + } + }, + "input_count": { + "type": "uint32", + "id": 4, + "options": { + "default": 1 + } + } + } + }, + "NexaTxInputRequest": { + "fields": { + "request_index": { + "rule": "required", + "type": "uint32", + "id": 1 + }, + "signature": { + "type": "bytes", + "id": 2 + } + } + }, + "NexaTxInputAck": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_message": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "NexaSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "NostrGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "NostrPublicKey": { + "fields": { + "publickey": { + "type": "string", + "id": 1 + }, + "npub": { + "type": "string", + "id": 2 + } + } + }, + "NostrSignEvent": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "event": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "NostrSignedEvent": { + "fields": { + "event": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "NostrSignSchnorr": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "hash": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "NostrSignedSchnorr": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "NostrEncryptMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "pubkey": { + "rule": "required", + "type": "string", + "id": 2 + }, + "msg": { + "rule": "required", + "type": "string", + "id": 3 + }, + "show_display": { + "type": "bool", + "id": 4 + } + } + }, + "NostrEncryptedMessage": { + "fields": { + "msg": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "NostrDecryptMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "pubkey": { + "rule": "required", + "type": "string", + "id": 2 + }, + "msg": { + "rule": "required", + "type": "string", + "id": 3 + }, + "show_display": { + "type": "bool", + "id": 4 + } + } + }, + "NostrDecryptedMessage": { + "fields": { + "msg": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "PolkadotGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "prefix": { + "rule": "required", + "type": "uint32", + "id": 2 + }, + "network": { + "rule": "required", + "type": "string", + "id": 3 + }, + "show_display": { + "type": "bool", + "id": 4 + } + } + }, + "PolkadotAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + }, + "public_key": { + "type": "string", + "id": 2 + } + } + }, + "PolkadotSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "network": { + "rule": "required", + "type": "string", + "id": 3 + } + } + }, + "PolkadotSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "RippleGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "RippleAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "RippleSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "fee": { + "type": "uint64", + "id": 2 + }, + "flags": { + "type": "uint32", + "id": 3 + }, + "sequence": { + "type": "uint32", + "id": 4 + }, + "last_ledger_sequence": { + "type": "uint32", + "id": 5 + }, + "payment": { + "type": "RipplePayment", + "id": 6 + } + }, + "nested": { + "RipplePayment": { + "fields": { + "amount": { + "rule": "required", + "type": "uint64", + "id": 1 + }, + "destination": { + "rule": "required", + "type": "string", + "id": 2 + }, + "destination_tag": { + "type": "uint32", + "id": 3 + } + } + } + } + }, + "RippleSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "serialized_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "ScdoGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "ScdoAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "ScdoSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "nonce": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "gas_price": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "bytes", + "id": 4 + }, + "to": { + "rule": "required", + "type": "string", + "id": 5 + }, + "value": { + "rule": "required", + "type": "bytes", + "id": 6 + }, + "timestamp": { + "type": "bytes", + "id": 7 + }, + "data_initial_chunk": { + "type": "bytes", + "id": 8, + "options": { + "default": "" + } + }, + "data_length": { + "type": "uint32", + "id": 9, + "options": { + "default": 0 + } + }, + "tx_type": { + "type": "uint32", + "id": 10, + "options": { + "default": 0 + } + } + } + }, + "ScdoSignedTx": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "signature": { + "type": "bytes", + "id": 2 + } + } + }, + "ScdoTxAck": { + "fields": { + "data_chunk": { + "type": "bytes", + "id": 1 + } + } + }, + "ScdoSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "type": "bytes", + "id": 2 + } + } + }, + "ScdoSignedMessage": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + }, + "address": { + "type": "string", + "id": 2 + } + } + }, + "SolanaGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "SolanaAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "SolanaSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "SolanaSignedTx": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + } + } + }, + "SolanaOffChainMessageVersion": { + "values": { + "MESSAGE_VERSION_0": 0 + } + }, + "SolanaOffChainMessageFormat": { + "values": { + "V0_RESTRICTED_ASCII": 0, + "V0_LIMITED_UTF8": 1 + } + }, + "SolanaSignOffChainMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "message_version": { + "type": "SolanaOffChainMessageVersion", + "id": 3, + "options": { + "default": "MESSAGE_VERSION_0" + } + }, + "message_format": { + "type": "SolanaOffChainMessageFormat", + "id": 4, + "options": { + "default": "V0_RESTRICTED_ASCII" + } + }, + "application_domain": { + "type": "bytes", + "id": 5 + } + } + }, + "SolanaSignUnsafeMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "SolanaMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + } + } + }, + "StarcoinGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "StarcoinAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "StarcoinGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "StarcoinPublicKey": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "StarcoinSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "type": "bytes", + "id": 2 + } + } + }, + "StarcoinSignedTx": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "StarcoinSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "type": "bytes", + "id": 2 + } + } + }, + "StarcoinMessageSignature": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "StarcoinVerifyMessage": { + "fields": { + "public_key": { + "type": "bytes", + "id": 1 + }, + "signature": { + "type": "bytes", + "id": 2 + }, + "message": { + "type": "bytes", + "id": 3 + } + } + }, + "StellarAssetType": { + "values": { + "NATIVE": 0, + "ALPHANUM4": 1, + "ALPHANUM12": 2 + } + }, + "StellarAsset": { + "fields": { + "type": { + "rule": "required", + "type": "StellarAssetType", + "id": 1 + }, + "code": { + "type": "string", + "id": 2 + }, + "issuer": { + "type": "string", + "id": 3 + } + } + }, + "StellarGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "StellarAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "StellarSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 2, + "options": { + "packed": false + } + }, + "network_passphrase": { + "rule": "required", + "type": "string", + "id": 3 + }, + "source_account": { + "rule": "required", + "type": "string", + "id": 4 + }, + "fee": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "sequence_number": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "timebounds_start": { + "rule": "required", + "type": "uint32", + "id": 8 + }, + "timebounds_end": { + "rule": "required", + "type": "uint32", + "id": 9 + }, + "memo_type": { + "rule": "required", + "type": "StellarMemoType", + "id": 10 + }, + "memo_text": { + "type": "string", + "id": 11 + }, + "memo_id": { + "type": "uint64", + "id": 12 + }, + "memo_hash": { + "type": "bytes", + "id": 13 + }, + "num_operations": { + "rule": "required", + "type": "uint32", + "id": 14 + } + }, + "nested": { + "StellarMemoType": { + "values": { + "NONE": 0, + "TEXT": 1, + "ID": 2, + "HASH": 3, + "RETURN": 4 + } + } + } + }, + "StellarTxOpRequest": { + "fields": {} + }, + "StellarPaymentOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 2 + }, + "asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + } + } + }, + "StellarCreateAccountOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "new_account": { + "rule": "required", + "type": "string", + "id": 2 + }, + "starting_balance": { + "rule": "required", + "type": "sint64", + "id": 3 + } + } + }, + "StellarPathPaymentStrictReceiveOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "send_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "send_max": { + "rule": "required", + "type": "sint64", + "id": 3 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 4 + }, + "destination_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 5 + }, + "destination_amount": { + "rule": "required", + "type": "sint64", + "id": 6 + }, + "paths": { + "rule": "repeated", + "type": "StellarAsset", + "id": 7 + } + } + }, + "StellarPathPaymentStrictSendOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "send_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "send_amount": { + "rule": "required", + "type": "sint64", + "id": 3 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 4 + }, + "destination_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 5 + }, + "destination_min": { + "rule": "required", + "type": "sint64", + "id": 6 + }, + "paths": { + "rule": "repeated", + "type": "StellarAsset", + "id": 7 + } + } + }, + "StellarManageSellOfferOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "selling_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "buying_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + }, + "price_n": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "price_d": { + "rule": "required", + "type": "uint32", + "id": 6 + }, + "offer_id": { + "rule": "required", + "type": "uint64", + "id": 7 + } + } + }, + "StellarManageBuyOfferOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "selling_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "buying_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + }, + "price_n": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "price_d": { + "rule": "required", + "type": "uint32", + "id": 6 + }, + "offer_id": { + "rule": "required", + "type": "uint64", + "id": 7 + } + } + }, + "StellarCreatePassiveSellOfferOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "selling_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "buying_asset": { + "rule": "required", + "type": "StellarAsset", + "id": 3 + }, + "amount": { + "rule": "required", + "type": "sint64", + "id": 4 + }, + "price_n": { + "rule": "required", + "type": "uint32", + "id": 5 + }, + "price_d": { + "rule": "required", + "type": "uint32", + "id": 6 + } + } + }, + "StellarSetOptionsOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "inflation_destination_account": { + "type": "string", + "id": 2 + }, + "clear_flags": { + "type": "uint32", + "id": 3 + }, + "set_flags": { + "type": "uint32", + "id": 4 + }, + "master_weight": { + "type": "uint32", + "id": 5 + }, + "low_threshold": { + "type": "uint32", + "id": 6 + }, + "medium_threshold": { + "type": "uint32", + "id": 7 + }, + "high_threshold": { + "type": "uint32", + "id": 8 + }, + "home_domain": { + "type": "string", + "id": 9 + }, + "signer_type": { + "type": "StellarSignerType", + "id": 10 + }, + "signer_key": { + "type": "bytes", + "id": 11 + }, + "signer_weight": { + "type": "uint32", + "id": 12 + } + }, + "nested": { + "StellarSignerType": { + "values": { + "ACCOUNT": 0, + "PRE_AUTH": 1, + "HASH": 2 + } + } + } + }, + "StellarChangeTrustOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "asset": { + "rule": "required", + "type": "StellarAsset", + "id": 2 + }, + "limit": { + "rule": "required", + "type": "uint64", + "id": 3 + } + } + }, + "StellarAllowTrustOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "trusted_account": { + "rule": "required", + "type": "string", + "id": 2 + }, + "asset_type": { + "rule": "required", + "type": "StellarAssetType", + "id": 3 + }, + "asset_code": { + "type": "string", + "id": 4 + }, + "is_authorized": { + "rule": "required", + "type": "bool", + "id": 5 + } + } + }, + "StellarAccountMergeOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "destination_account": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "StellarManageDataOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "key": { + "rule": "required", + "type": "string", + "id": 2 + }, + "value": { + "type": "bytes", + "id": 3 + } + } + }, + "StellarBumpSequenceOp": { + "fields": { + "source_account": { + "type": "string", + "id": 1 + }, + "bump_to": { + "rule": "required", + "type": "uint64", + "id": 2 + } + } + }, + "StellarSignedTx": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "SuiGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "SuiAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "SuiSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "raw_tx": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "data_initial_chunk": { + "type": "bytes", + "id": 3, + "options": { + "default": "" + } + }, + "data_length": { + "type": "uint32", + "id": 4 + } + } + }, + "SuiSignedTx": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "SuiTxRequest": { + "fields": { + "data_length": { + "type": "uint32", + "id": 1 + }, + "public_key": { + "type": "bytes", + "id": 2 + }, + "signature": { + "type": "bytes", + "id": 3 + } + } + }, + "SuiTxAck": { + "fields": { + "data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "SuiSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "SuiMessageSignature": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "TezosGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "TezosAddress": { + "fields": { + "address": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "TezosGetPublicKey": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "TezosPublicKey": { + "fields": { + "public_key": { + "rule": "required", + "type": "string", + "id": 1 + } + } + }, + "TezosSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "branch": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "reveal": { + "type": "TezosRevealOp", + "id": 3 + }, + "transaction": { + "type": "TezosTransactionOp", + "id": 4 + }, + "origination": { + "type": "TezosOriginationOp", + "id": 5 + }, + "delegation": { + "type": "TezosDelegationOp", + "id": 6 + }, + "proposal": { + "type": "TezosProposalOp", + "id": 7 + }, + "ballot": { + "type": "TezosBallotOp", + "id": 8 + } + }, + "nested": { + "TezosContractID": { + "fields": { + "tag": { + "rule": "required", + "type": "TezosContractType", + "id": 1 + }, + "hash": { + "rule": "required", + "type": "bytes", + "id": 2 + } + }, + "nested": { + "TezosContractType": { + "values": { + "Implicit": 0, + "Originated": 1 + } + } + } + }, + "TezosRevealOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "public_key": { + "rule": "required", + "type": "bytes", + "id": 6 + } + } + }, + "TezosTransactionOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 9 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "amount": { + "rule": "required", + "type": "uint64", + "id": 6 + }, + "destination": { + "rule": "required", + "type": "TezosContractID", + "id": 7 + }, + "parameters": { + "type": "bytes", + "id": 8 + }, + "parameters_manager": { + "type": "TezosParametersManager", + "id": 10 + } + }, + "nested": { + "TezosParametersManager": { + "fields": { + "set_delegate": { + "type": "bytes", + "id": 1 + }, + "cancel_delegate": { + "type": "bool", + "id": 2 + }, + "transfer": { + "type": "TezosManagerTransfer", + "id": 3 + } + }, + "nested": { + "TezosManagerTransfer": { + "fields": { + "destination": { + "type": "TezosContractID", + "id": 1 + }, + "amount": { + "type": "uint64", + "id": 2 + } + } + } + } + } + } + }, + "TezosOriginationOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 12 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "manager_pubkey": { + "type": "bytes", + "id": 6 + }, + "balance": { + "rule": "required", + "type": "uint64", + "id": 7 + }, + "spendable": { + "type": "bool", + "id": 8 + }, + "delegatable": { + "type": "bool", + "id": 9 + }, + "delegate": { + "type": "bytes", + "id": 10 + }, + "script": { + "rule": "required", + "type": "bytes", + "id": 11 + } + } + }, + "TezosDelegationOp": { + "fields": { + "source": { + "rule": "required", + "type": "bytes", + "id": 7 + }, + "fee": { + "rule": "required", + "type": "uint64", + "id": 2 + }, + "counter": { + "rule": "required", + "type": "uint64", + "id": 3 + }, + "gas_limit": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "storage_limit": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "delegate": { + "rule": "required", + "type": "bytes", + "id": 6 + } + } + }, + "TezosProposalOp": { + "fields": { + "source": { + "type": "bytes", + "id": 1 + }, + "period": { + "type": "uint64", + "id": 2 + }, + "proposals": { + "rule": "repeated", + "type": "bytes", + "id": 4 + } + } + }, + "TezosBallotOp": { + "fields": { + "source": { + "type": "bytes", + "id": 1 + }, + "period": { + "type": "uint64", + "id": 2 + }, + "proposal": { + "type": "bytes", + "id": 3 + }, + "ballot": { + "type": "TezosBallotType", + "id": 4 + } + }, + "nested": { + "TezosBallotType": { + "values": { + "Yay": 0, + "Nay": 1, + "Pass": 2 + } + } + } + } + } + }, + "TezosSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "string", + "id": 1 + }, + "sig_op_contents": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "operation_hash": { + "rule": "required", + "type": "string", + "id": 3 + } + } + }, + "TonWalletVersion": { + "values": { + "V4R2": 3 + } + }, + "TonWorkChain": { + "values": { + "BASECHAIN": 0, + "MASTERCHAIN": 1 + } + }, + "TonGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + }, + "wallet_version": { + "type": "TonWalletVersion", + "id": 3, + "options": { + "default": "V4R2" + } + }, + "is_bounceable": { + "type": "bool", + "id": 4, + "options": { + "default": false + } + }, + "is_testnet_only": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "workchain": { + "type": "TonWorkChain", + "id": 6, + "options": { + "default": "BASECHAIN" + } + }, + "wallet_id": { + "type": "uint32", + "id": 7, + "options": { + "default": 698983191 + } + } + } + }, + "TonAddress": { + "fields": { + "public_key": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "address": { + "rule": "required", + "type": "string", + "id": 2 + } + } + }, + "TonSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "destination": { + "rule": "required", + "type": "string", + "id": 2 + }, + "jetton_master_address": { + "type": "string", + "id": 3 + }, + "jetton_wallet_address": { + "type": "string", + "id": 4 + }, + "ton_amount": { + "rule": "required", + "type": "uint64", + "id": 5 + }, + "jetton_amount": { + "type": "uint64", + "id": 6 + }, + "fwd_fee": { + "type": "uint64", + "id": 7, + "options": { + "default": 0 + } + }, + "comment": { + "type": "string", + "id": 8 + }, + "is_raw_data": { + "type": "bool", + "id": 9, + "options": { + "default": false + } + }, + "mode": { + "type": "uint32", + "id": 10, + "options": { + "default": 3 + } + }, + "seqno": { + "rule": "required", + "type": "uint32", + "id": 11 + }, + "expire_at": { + "rule": "required", + "type": "uint64", + "id": 12 + }, + "wallet_version": { + "type": "TonWalletVersion", + "id": 13, + "options": { + "default": "V4R2" + } + }, + "wallet_id": { + "type": "uint32", + "id": 14, + "options": { + "default": 698983191 + } + }, + "workchain": { + "type": "TonWorkChain", + "id": 15, + "options": { + "default": "BASECHAIN" + } + }, + "is_bounceable": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "is_testnet_only": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "ext_destination": { + "rule": "repeated", + "type": "string", + "id": 18 + }, + "ext_ton_amount": { + "rule": "repeated", + "type": "uint64", + "id": 19, + "options": { + "packed": false + } + }, + "ext_payload": { + "rule": "repeated", + "type": "string", + "id": 20 + }, + "jetton_amount_bytes": { + "type": "bytes", + "id": 21 + }, + "init_data_initial_chunk": { + "type": "bytes", + "id": 22 + }, + "init_data_length": { + "type": "uint32", + "id": 23 + }, + "signing_message_repr": { + "type": "bytes", + "id": 24 + } + } + }, + "TonTxAck": { + "fields": { + "init_data_chunk": { + "rule": "required", + "type": "bytes", + "id": 1 + } + } + }, + "TonSignedMessage": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + }, + "signning_message": { + "type": "bytes", + "id": 2 + }, + "init_data_length": { + "type": "uint32", + "id": 3 + } + } + }, + "TonSignProof": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "appdomain": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "comment": { + "type": "bytes", + "id": 3 + }, + "expire_at": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "wallet_version": { + "type": "TonWalletVersion", + "id": 5, + "options": { + "default": "V4R2" + } + }, + "wallet_id": { + "type": "uint32", + "id": 6, + "options": { + "default": 698983191 + } + }, + "workchain": { + "type": "TonWorkChain", + "id": 7, + "options": { + "default": "BASECHAIN" + } + }, + "is_bounceable": { + "type": "bool", + "id": 8, + "options": { + "default": false + } + }, + "is_testnet_only": { + "type": "bool", + "id": 9, + "options": { + "default": false + } + } + } + }, + "TonSignedProof": { + "fields": { + "signature": { + "type": "bytes", + "id": 1 + } + } + }, + "TronGetAddress": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "show_display": { + "type": "bool", + "id": 2 + } + } + }, + "TronAddress": { + "fields": { + "address": { + "type": "string", + "id": 1 + } + } + }, + "TronSignTx": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "ref_block_bytes": { + "rule": "required", + "type": "bytes", + "id": 2 + }, + "ref_block_hash": { + "rule": "required", + "type": "bytes", + "id": 3 + }, + "expiration": { + "rule": "required", + "type": "uint64", + "id": 4 + }, + "data": { + "type": "bytes", + "id": 5 + }, + "contract": { + "rule": "required", + "type": "TronContract", + "id": 6 + }, + "timestamp": { + "rule": "required", + "type": "uint64", + "id": 7 + }, + "fee_limit": { + "type": "uint64", + "id": 8 + } + }, + "nested": { + "TronContract": { + "fields": { + "transfer_contract": { + "type": "TronTransferContract", + "id": 2 + }, + "provider": { + "type": "bytes", + "id": 3 + }, + "vote_witness_contract": { + "type": "TronVoteWitnessContract", + "id": 4 + }, + "contract_name": { + "type": "bytes", + "id": 5 + }, + "permission_id": { + "type": "uint32", + "id": 6 + }, + "freeze_balance_contract": { + "type": "TronFreezeBalanceContract", + "id": 11 + }, + "unfreeze_balance_contract": { + "type": "TronUnfreezeBalanceContract", + "id": 12 + }, + "withdraw_balance_contract": { + "type": "TronWithdrawBalanceContract", + "id": 13 + }, + "trigger_smart_contract": { + "type": "TronTriggerSmartContract", + "id": 31 + }, + "freeze_balance_v2_contract": { + "type": "TronFreezeBalanceV2Contract", + "id": 54 + }, + "unfreeze_balance_v2_contract": { + "type": "TronUnfreezeBalanceV2Contract", + "id": 55 + }, + "withdraw_expire_unfreeze_contract": { + "type": "TronWithdrawExpireUnfreezeContract", + "id": 56 + }, + "delegate_resource_contract": { + "type": "TronDelegateResourceContract", + "id": 57 + }, + "undelegate_resource_contract": { + "type": "TronUnDelegateResourceContract", + "id": 58 + }, + "cancel_all_unfreeze_v2_contract": { + "type": "TronCancelAllUnfreezeV2Contract", + "id": 59 + } + }, + "nested": { + "TronTransferContract": { + "fields": { + "to_address": { + "type": "string", + "id": 2 + }, + "amount": { + "type": "uint64", + "id": 3 + } + } + }, + "TronTriggerSmartContract": { + "fields": { + "contract_address": { + "type": "string", + "id": 2 + }, + "call_value": { + "type": "uint64", + "id": 3 + }, + "data": { + "type": "bytes", + "id": 4 + }, + "call_token_value": { + "type": "uint64", + "id": 5 + }, + "asset_id": { + "type": "uint64", + "id": 6 + } + } + }, + "TronResourceCode": { + "values": { + "BANDWIDTH": 0, + "ENERGY": 1, + "TRON_POWER": 2 + } + }, + "TronFreezeBalanceContract": { + "fields": { + "frozen_balance": { + "type": "uint64", + "id": 1 + }, + "frozen_duration": { + "type": "uint64", + "id": 2 + }, + "resource": { + "type": "TronResourceCode", + "id": 3 + }, + "receiver_address": { + "type": "string", + "id": 4 + } + } + }, + "TronUnfreezeBalanceContract": { + "fields": { + "resource": { + "type": "TronResourceCode", + "id": 1 + }, + "receiver_address": { + "type": "string", + "id": 2 + } + } + }, + "TronWithdrawBalanceContract": { + "fields": { + "owner_address": { + "type": "bytes", + "id": 1 + } + } + }, + "TronFreezeBalanceV2Contract": { + "fields": { + "frozen_balance": { + "type": "uint64", + "id": 2 + }, + "resource": { + "type": "TronResourceCode", + "id": 3 + } + } + }, + "TronUnfreezeBalanceV2Contract": { + "fields": { + "unfreeze_balance": { + "type": "uint64", + "id": 2 + }, + "resource": { + "type": "TronResourceCode", + "id": 3 + } + } + }, + "TronWithdrawExpireUnfreezeContract": { + "fields": {} + }, + "TronDelegateResourceContract": { + "fields": { + "resource": { + "type": "TronResourceCode", + "id": 2 + }, + "balance": { + "type": "uint64", + "id": 3 + }, + "receiver_address": { + "type": "string", + "id": 4 + }, + "lock": { + "type": "bool", + "id": 5 + } + } + }, + "TronUnDelegateResourceContract": { + "fields": { + "resource": { + "type": "TronResourceCode", + "id": 2 + }, + "balance": { + "type": "uint64", + "id": 3 + }, + "receiver_address": { + "type": "string", + "id": 4 + } + } + }, + "TronVoteWitnessContract": { + "fields": { + "votes": { + "rule": "repeated", + "type": "Vote", + "id": 2 + }, + "support": { + "type": "bool", + "id": 3 + } + }, + "nested": { + "Vote": { + "fields": { + "vote_address": { + "rule": "required", + "type": "string", + "id": 1 + }, + "vote_count": { + "rule": "required", + "type": "uint32", + "id": 2 + } + } + } + } + }, + "TronCancelAllUnfreezeV2Contract": { + "fields": {} + } + } + } + } + }, + "TronSignedTx": { + "fields": { + "signature": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "serialized_tx": { + "type": "bytes", + "id": 2 + } + } + }, + "TronSignMessage": { + "fields": { + "address_n": { + "rule": "repeated", + "type": "uint32", + "id": 1, + "options": { + "packed": false + } + }, + "message": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "TronMessageSignature": { + "fields": { + "address": { + "rule": "required", + "type": "bytes", + "id": 1 + }, + "signature": { + "rule": "required", + "type": "bytes", + "id": 2 + } + } + }, + "WebAuthnListResidentCredentials": { + "fields": {} + }, + "WebAuthnAddResidentCredential": { + "fields": { + "credential_id": { + "type": "bytes", + "id": 1 + } + } + }, + "WebAuthnRemoveResidentCredential": { + "fields": { + "index": { + "type": "uint32", + "id": 1 + } + } + }, + "WebAuthnCredentials": { + "fields": { + "credentials": { + "rule": "repeated", + "type": "WebAuthnCredential", + "id": 1 + } + }, + "nested": { + "WebAuthnCredential": { + "fields": { + "index": { + "type": "uint32", + "id": 1 + }, + "id": { + "type": "bytes", + "id": 2 + }, + "rp_id": { + "type": "string", + "id": 3 + }, + "rp_name": { + "type": "string", + "id": 4 + }, + "user_id": { + "type": "bytes", + "id": 5 + }, + "user_name": { + "type": "string", + "id": 6 + }, + "user_display_name": { + "type": "string", + "id": 7 + }, + "creation_time": { + "type": "uint32", + "id": 8 + }, + "hmac_secret": { + "type": "bool", + "id": 9 + }, + "use_sign_count": { + "type": "bool", + "id": 10 + }, + "algorithm": { + "type": "sint32", + "id": 11 + }, + "curve": { + "type": "sint32", + "id": 12 + } + } + } + } + }, + "wire_in": { + "type": "bool", + "id": 50002, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_out": { + "type": "bool", + "id": 50003, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_debug_in": { + "type": "bool", + "id": 50004, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_debug_out": { + "type": "bool", + "id": 50005, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_tiny": { + "type": "bool", + "id": 50006, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_bootloader": { + "type": "bool", + "id": 50007, + "extend": "google.protobuf.EnumValueOptions" + }, + "wire_no_fsm": { + "type": "bool", + "id": 50008, + "extend": "google.protobuf.EnumValueOptions" + }, + "facotry": { + "type": "bool", + "id": 50501, + "extend": "google.protobuf.EnumValueOptions" + }, + "bitcoin_only": { + "type": "bool", + "id": 60000, + "extend": "google.protobuf.EnumValueOptions" + }, + "has_bitcoin_only_values": { + "type": "bool", + "id": 51001, + "extend": "google.protobuf.EnumOptions" + }, + "unstable": { + "type": "bool", + "id": 52001, + "extend": "google.protobuf.MessageOptions" + }, + "wire_type": { + "type": "uint32", + "id": 52002, + "extend": "google.protobuf.MessageOptions" + }, + "experimental": { + "type": "bool", + "id": 53001, + "extend": "google.protobuf.FieldOptions" + }, + "include_in_bitcoin_only": { + "type": "bool", + "id": 60000, + "extend": "google.protobuf.FileOptions" + }, + "CommandFlags": { + "values": { + "Default": 0, + "Factory_Only": 1 + } + }, + "MessageType": { + "options": { + "(has_bitcoin_only_values)": true + }, + "values": { + "MessageType_StartSession": 0, + "MessageType_Ping": 1, + "MessageType_Success": 2, + "MessageType_Failure": 3, + "MessageType_ChangePin": 4, + "MessageType_WipeDevice": 5, + "MessageType_GetEntropy": 9, + "MessageType_Entropy": 10, + "MessageType_LoadDevice": 13, + "MessageType_ResetDevice": 14, + "MessageType_Features": 17, + "MessageType_PinMatrixRequest": 18, + "MessageType_PinMatrixAck": 19, + "MessageType_Cancel": 20, + "MessageType_LockDevice": 24, + "MessageType_ApplySettings": 25, + "MessageType_ButtonRequest": 26, + "MessageType_ButtonAck": 27, + "MessageType_ApplyFlags": 28, + "MessageType_BackupDevice": 34, + "MessageType_EntropyRequest": 35, + "MessageType_EntropyAck": 36, + "MessageType_PassphraseRequest": 41, + "MessageType_PassphraseAck": 42, + "MessageType_RecoveryDevice": 45, + "MessageType_WordRequest": 46, + "MessageType_WordAck": 47, + "MessageType_GetFeatures": 55, + "MessageType_SdProtect": 79, + "MessageType_ChangeWipeCode": 82, + "MessageType_EndSession": 83, + "MessageType_DoPreauthorized": 84, + "MessageType_PreauthorizedRequest": 85, + "MessageType_CancelAuthorization": 86, + "MessageType_RebootToBootloader": 87, + "MessageType_SetU2FCounter": 63, + "MessageType_GetNextU2FCounter": 80, + "MessageType_NextU2FCounter": 81, + "MessageType_Deprecated_PassphraseStateRequest": 77, + "MessageType_Deprecated_PassphraseStateAck": 78, + "MessageType_FirmwareErase": 6, + "MessageType_FirmwareErase_ex": 16, + "MessageType_FirmwareUpload": 7, + "MessageType_FirmwareRequest": 8, + "MessageType_SelfTest": 32, + "MessageType_Reboot": 30000, + "MessageType_FirmwareUpdateEmmc": 30001, + "MessageType_GetPublicKey": 11, + "MessageType_PublicKey": 12, + "MessageType_SignTx": 15, + "MessageType_TxRequest": 21, + "MessageType_TxAck": 22, + "MessageType_GetAddress": 29, + "MessageType_Address": 30, + "MessageType_SignMessage": 38, + "MessageType_VerifyMessage": 39, + "MessageType_MessageSignature": 40, + "MessageType_GetOwnershipId": 43, + "MessageType_OwnershipId": 44, + "MessageType_GetOwnershipProof": 49, + "MessageType_OwnershipProof": 50, + "MessageType_AuthorizeCoinJoin": 51, + "MessageType_SignPsbt": 10052, + "MessageType_SignedPsbt": 10053, + "MessageType_CipherKeyValue": 23, + "MessageType_CipheredKeyValue": 48, + "MessageType_SignIdentity": 53, + "MessageType_SignedIdentity": 54, + "MessageType_GetECDHSessionKey": 61, + "MessageType_ECDHSessionKey": 62, + "MessageType_CosiCommit": 71, + "MessageType_CosiCommitment": 72, + "MessageType_CosiSign": 73, + "MessageType_CosiSignature": 74, + "MessageType_BatchGetPublickeys": 10016, + "MessageType_EcdsaPublicKeys": 10017, + "MessageType_DebugLinkDecision": 100, + "MessageType_DebugLinkGetState": 101, + "MessageType_DebugLinkState": 102, + "MessageType_DebugLinkStop": 103, + "MessageType_DebugLinkLog": 104, + "MessageType_DebugLinkMemoryRead": 110, + "MessageType_DebugLinkMemory": 111, + "MessageType_DebugLinkMemoryWrite": 112, + "MessageType_DebugLinkFlashErase": 113, + "MessageType_DebugLinkLayout": 9001, + "MessageType_DebugLinkReseedRandom": 9002, + "MessageType_DebugLinkRecordScreen": 9003, + "MessageType_DebugLinkEraseSdCard": 9005, + "MessageType_DebugLinkWatchLayout": 9006, + "MessageType_EmmcFixPermission": 30100, + "MessageType_EmmcPath": 30101, + "MessageType_EmmcPathInfo": 30102, + "MessageType_EmmcFile": 30103, + "MessageType_EmmcFileRead": 30104, + "MessageType_EmmcFileWrite": 30105, + "MessageType_EmmcFileDelete": 30106, + "MessageType_EmmcDir": 30107, + "MessageType_EmmcDirList": 30108, + "MessageType_EmmcDirMake": 30109, + "MessageType_EmmcDirRemove": 30110, + "MessageType_EthereumGetPublicKey": 450, + "MessageType_EthereumPublicKey": 451, + "MessageType_EthereumGetAddress": 56, + "MessageType_EthereumAddress": 57, + "MessageType_EthereumSignTx": 58, + "MessageType_EthereumSignTxEIP1559": 452, + "MessageType_EthereumTxRequest": 59, + "MessageType_EthereumTxAck": 60, + "MessageType_EthereumSignMessage": 64, + "MessageType_EthereumVerifyMessage": 65, + "MessageType_EthereumMessageSignature": 66, + "MessageType_EthereumSignTypedData": 464, + "MessageType_EthereumTypedDataStructRequest": 465, + "MessageType_EthereumTypedDataStructAck": 466, + "MessageType_EthereumTypedDataValueRequest": 467, + "MessageType_EthereumTypedDataValueAck": 468, + "MessageType_EthereumTypedDataSignature": 469, + "MessageType_EthereumSignTypedHash": 470, + "MessageType_EthereumGetPublicKeyOneKey": 20100, + "MessageType_EthereumPublicKeyOneKey": 20101, + "MessageType_EthereumGetAddressOneKey": 20102, + "MessageType_EthereumAddressOneKey": 20103, + "MessageType_EthereumSignTxOneKey": 20104, + "MessageType_EthereumSignTxEIP1559OneKey": 20105, + "MessageType_EthereumTxRequestOneKey": 20106, + "MessageType_EthereumTxAckOneKey": 20107, + "MessageType_EthereumSignMessageOneKey": 20108, + "MessageType_EthereumVerifyMessageOneKey": 20109, + "MessageType_EthereumMessageSignatureOneKey": 20110, + "MessageType_EthereumSignTypedDataOneKey": 20111, + "MessageType_EthereumTypedDataStructRequestOneKey": 20112, + "MessageType_EthereumTypedDataStructAckOneKey": 20113, + "MessageType_EthereumTypedDataValueRequestOneKey": 20114, + "MessageType_EthereumTypedDataValueAckOneKey": 20115, + "MessageType_EthereumTypedDataSignatureOneKey": 20116, + "MessageType_EthereumSignTypedHashOneKey": 20117, + "MessageType_EthereumGnosisSafeTxAck": 20118, + "MessageType_EthereumGnosisSafeTxRequest": 20119, + "MessageType_NEMGetAddress": 67, + "MessageType_NEMAddress": 68, + "MessageType_NEMSignTx": 69, + "MessageType_NEMSignedTx": 70, + "MessageType_NEMDecryptMessage": 75, + "MessageType_NEMDecryptedMessage": 76, + "MessageType_TezosGetAddress": 150, + "MessageType_TezosAddress": 151, + "MessageType_TezosSignTx": 152, + "MessageType_TezosSignedTx": 153, + "MessageType_TezosGetPublicKey": 154, + "MessageType_TezosPublicKey": 155, + "MessageType_StellarSignTx": 202, + "MessageType_StellarTxOpRequest": 203, + "MessageType_StellarGetAddress": 207, + "MessageType_StellarAddress": 208, + "MessageType_StellarCreateAccountOp": 210, + "MessageType_StellarPaymentOp": 211, + "MessageType_StellarPathPaymentStrictReceiveOp": 212, + "MessageType_StellarManageSellOfferOp": 213, + "MessageType_StellarCreatePassiveSellOfferOp": 214, + "MessageType_StellarSetOptionsOp": 215, + "MessageType_StellarChangeTrustOp": 216, + "MessageType_StellarAllowTrustOp": 217, + "MessageType_StellarAccountMergeOp": 218, + "MessageType_StellarManageDataOp": 220, + "MessageType_StellarBumpSequenceOp": 221, + "MessageType_StellarManageBuyOfferOp": 222, + "MessageType_StellarPathPaymentStrictSendOp": 223, + "MessageType_StellarSignedTx": 230, + "MessageType_CardanoGetPublicKey": 305, + "MessageType_CardanoPublicKey": 306, + "MessageType_CardanoGetAddress": 307, + "MessageType_CardanoAddress": 308, + "MessageType_CardanoTxItemAck": 313, + "MessageType_CardanoTxAuxiliaryDataSupplement": 314, + "MessageType_CardanoTxWitnessRequest": 315, + "MessageType_CardanoTxWitnessResponse": 316, + "MessageType_CardanoTxHostAck": 317, + "MessageType_CardanoTxBodyHash": 318, + "MessageType_CardanoSignTxFinished": 319, + "MessageType_CardanoSignTxInit": 320, + "MessageType_CardanoTxInput": 321, + "MessageType_CardanoTxOutput": 322, + "MessageType_CardanoAssetGroup": 323, + "MessageType_CardanoToken": 324, + "MessageType_CardanoTxCertificate": 325, + "MessageType_CardanoTxWithdrawal": 326, + "MessageType_CardanoTxAuxiliaryData": 327, + "MessageType_CardanoPoolOwner": 328, + "MessageType_CardanoPoolRelayParameters": 329, + "MessageType_CardanoGetNativeScriptHash": 330, + "MessageType_CardanoNativeScriptHash": 331, + "MessageType_CardanoTxMint": 332, + "MessageType_CardanoTxCollateralInput": 333, + "MessageType_CardanoTxRequiredSigner": 334, + "MessageType_CardanoTxInlineDatumChunk": 335, + "MessageType_CardanoTxReferenceScriptChunk": 336, + "MessageType_CardanoTxReferenceInput": 337, + "MessageType_CardanoSignMessage": 350, + "MessageType_CardanoMessageSignature": 351, + "MessageType_RippleGetAddress": 400, + "MessageType_RippleAddress": 401, + "MessageType_RippleSignTx": 402, + "MessageType_RippleSignedTx": 403, + "MessageType_MoneroTransactionInitRequest": 501, + "MessageType_MoneroTransactionInitAck": 502, + "MessageType_MoneroTransactionSetInputRequest": 503, + "MessageType_MoneroTransactionSetInputAck": 504, + "MessageType_MoneroTransactionInputsPermutationRequest": 505, + "MessageType_MoneroTransactionInputsPermutationAck": 506, + "MessageType_MoneroTransactionInputViniRequest": 507, + "MessageType_MoneroTransactionInputViniAck": 508, + "MessageType_MoneroTransactionAllInputsSetRequest": 509, + "MessageType_MoneroTransactionAllInputsSetAck": 510, + "MessageType_MoneroTransactionSetOutputRequest": 511, + "MessageType_MoneroTransactionSetOutputAck": 512, + "MessageType_MoneroTransactionAllOutSetRequest": 513, + "MessageType_MoneroTransactionAllOutSetAck": 514, + "MessageType_MoneroTransactionSignInputRequest": 515, + "MessageType_MoneroTransactionSignInputAck": 516, + "MessageType_MoneroTransactionFinalRequest": 517, + "MessageType_MoneroTransactionFinalAck": 518, + "MessageType_MoneroKeyImageExportInitRequest": 530, + "MessageType_MoneroKeyImageExportInitAck": 531, + "MessageType_MoneroKeyImageSyncStepRequest": 532, + "MessageType_MoneroKeyImageSyncStepAck": 533, + "MessageType_MoneroKeyImageSyncFinalRequest": 534, + "MessageType_MoneroKeyImageSyncFinalAck": 535, + "MessageType_MoneroGetAddress": 540, + "MessageType_MoneroAddress": 541, + "MessageType_MoneroGetWatchKey": 542, + "MessageType_MoneroWatchKey": 543, + "MessageType_DebugMoneroDiagRequest": 546, + "MessageType_DebugMoneroDiagAck": 547, + "MessageType_MoneroGetTxKeyRequest": 550, + "MessageType_MoneroGetTxKeyAck": 551, + "MessageType_MoneroLiveRefreshStartRequest": 552, + "MessageType_MoneroLiveRefreshStartAck": 553, + "MessageType_MoneroLiveRefreshStepRequest": 554, + "MessageType_MoneroLiveRefreshStepAck": 555, + "MessageType_MoneroLiveRefreshFinalRequest": 556, + "MessageType_MoneroLiveRefreshFinalAck": 557, + "MessageType_EosGetPublicKey": 600, + "MessageType_EosPublicKey": 601, + "MessageType_EosSignTx": 602, + "MessageType_EosTxActionRequest": 603, + "MessageType_EosTxActionAck": 604, + "MessageType_EosSignedTx": 605, + "MessageType_BinanceGetAddress": 700, + "MessageType_BinanceAddress": 701, + "MessageType_BinanceGetPublicKey": 702, + "MessageType_BinancePublicKey": 703, + "MessageType_BinanceSignTx": 704, + "MessageType_BinanceTxRequest": 705, + "MessageType_BinanceTransferMsg": 706, + "MessageType_BinanceOrderMsg": 707, + "MessageType_BinanceCancelMsg": 708, + "MessageType_BinanceSignedTx": 709, + "MessageType_SolanaGetAddress": 10100, + "MessageType_SolanaAddress": 10101, + "MessageType_SolanaSignTx": 10102, + "MessageType_SolanaSignedTx": 10103, + "MessageType_SolanaSignOffChainMessage": 10104, + "MessageType_SolanaMessageSignature": 10105, + "MessageType_SolanaSignUnsafeMessage": 10106, + "MessageType_StarcoinGetAddress": 10300, + "MessageType_StarcoinAddress": 10301, + "MessageType_StarcoinGetPublicKey": 10302, + "MessageType_StarcoinPublicKey": 10303, + "MessageType_StarcoinSignTx": 10304, + "MessageType_StarcoinSignedTx": 10305, + "MessageType_StarcoinSignMessage": 10306, + "MessageType_StarcoinMessageSignature": 10307, + "MessageType_StarcoinVerifyMessage": 10308, + "MessageType_AptosGetAddress": 10600, + "MessageType_AptosAddress": 10601, + "MessageType_AptosSignTx": 10602, + "MessageType_AptosSignedTx": 10603, + "MessageType_AptosSignMessage": 10604, + "MessageType_AptosMessageSignature": 10605, + "MessageType_WebAuthnListResidentCredentials": 800, + "MessageType_WebAuthnCredentials": 801, + "MessageType_WebAuthnAddResidentCredential": 802, + "MessageType_WebAuthnRemoveResidentCredential": 803, + "MessageType_BixinSeedOperate": 901, + "MessageType_BixinMessageSE": 902, + "MessageType_BixinOutMessageSE": 904, + "MessageType_BixinBackupRequest": 905, + "MessageType_BixinBackupAck": 906, + "MessageType_BixinRestoreRequest": 907, + "MessageType_BixinRestoreAck": 908, + "MessageType_BixinVerifyDeviceRequest": 909, + "MessageType_BixinVerifyDeviceAck": 910, + "MessageType_BixinWhiteListRequest": 911, + "MessageType_BixinWhiteListAck": 912, + "MessageType_BixinLoadDevice": 913, + "MessageType_BixinBackupDevice": 914, + "MessageType_BixinBackupDeviceAck": 915, + "MessageType_BixinPinInputOnDevice": 10000, + "MessageType_EthereumSignMessageEIP712": 10200, + "MessageType_GetPublicKeyMultiple": 10210, + "MessageType_PublicKeyMultiple": 10211, + "MessageType_ConfluxGetAddress": 10112, + "MessageType_ConfluxAddress": 10113, + "MessageType_ConfluxSignTx": 10114, + "MessageType_ConfluxTxRequest": 10115, + "MessageType_ConfluxTxAck": 10116, + "MessageType_ConfluxSignMessage": 10117, + "MessageType_ConfluxSignMessageCIP23": 10118, + "MessageType_ConfluxMessageSignature": 10119, + "MessageType_TronGetAddress": 10501, + "MessageType_TronAddress": 10502, + "MessageType_TronSignTx": 10503, + "MessageType_TronSignedTx": 10504, + "MessageType_TronSignMessage": 10505, + "MessageType_TronMessageSignature": 10506, + "MessageType_NearGetAddress": 10701, + "MessageType_NearAddress": 10702, + "MessageType_NearSignTx": 10703, + "MessageType_NearSignedTx": 10704, + "MessageType_CosmosGetAddress": 10800, + "MessageType_CosmosAddress": 10801, + "MessageType_CosmosSignTx": 10802, + "MessageType_CosmosSignedTx": 10803, + "MessageType_AlgorandGetAddress": 10900, + "MessageType_AlgorandAddress": 10901, + "MessageType_AlgorandSignTx": 10902, + "MessageType_AlgorandSignedTx": 10903, + "MessageType_PolkadotGetAddress": 11000, + "MessageType_PolkadotAddress": 11001, + "MessageType_PolkadotSignTx": 11002, + "MessageType_PolkadotSignedTx": 11003, + "MessageType_SuiGetAddress": 11100, + "MessageType_SuiAddress": 11101, + "MessageType_SuiSignTx": 11102, + "MessageType_SuiSignedTx": 11103, + "MessageType_SuiSignMessage": 11104, + "MessageType_SuiMessageSignature": 11105, + "MessageType_SuiTxRequest": 11106, + "MessageType_SuiTxAck": 11107, + "MessageType_FilecoinGetAddress": 11200, + "MessageType_FilecoinAddress": 11201, + "MessageType_FilecoinSignTx": 11202, + "MessageType_FilecoinSignedTx": 11203, + "MessageType_KaspaGetAddress": 11300, + "MessageType_KaspaAddress": 11301, + "MessageType_KaspaSignTx": 11302, + "MessageType_KaspaSignedTx": 11303, + "MessageType_KaspaTxInputRequest": 11304, + "MessageType_KaspaTxInputAck": 11305, + "MessageType_NexaGetAddress": 11400, + "MessageType_NexaAddress": 11401, + "MessageType_NexaSignTx": 11402, + "MessageType_NexaSignedTx": 11403, + "MessageType_NexaTxInputRequest": 11404, + "MessageType_NexaTxInputAck": 11405, + "MessageType_NostrGetPublicKey": 11500, + "MessageType_NostrPublicKey": 11501, + "MessageType_NostrSignEvent": 11502, + "MessageType_NostrSignedEvent": 11503, + "MessageType_NostrEncryptMessage": 11504, + "MessageType_NostrEncryptedMessage": 11505, + "MessageType_NostrDecryptMessage": 11506, + "MessageType_NostrDecryptedMessage": 11507, + "MessageType_NostrSignSchnorr": 11508, + "MessageType_NostrSignedSchnorr": 11509, + "MessageType_LnurlAuth": 11600, + "MessageType_LnurlAuthResp": 11601, + "MessageType_NervosGetAddress": 11701, + "MessageType_NervosAddress": 11702, + "MessageType_NervosSignTx": 11703, + "MessageType_NervosSignedTx": 11704, + "MessageType_NervosTxRequest": 11705, + "MessageType_NervosTxAck": 11706, + "MessageType_DnxGetAddress": 11800, + "MessageType_DnxAddress": 11801, + "MessageType_DnxSignTx": 11802, + "MessageType_DnxInputRequest": 11803, + "MessageType_DnxInputAck": 11804, + "MessageType_DnxRTSigsRequest": 11805, + "MessageType_DnxSignedTx": 11806, + "MessageType_TonGetAddress": 11901, + "MessageType_TonAddress": 11902, + "MessageType_TonSignMessage": 11903, + "MessageType_TonSignedMessage": 11904, + "MessageType_TonSignProof": 11905, + "MessageType_TonSignedProof": 11906, + "MessageType_TonTxAck": 11907, + "MessageType_ScdoGetAddress": 12001, + "MessageType_ScdoAddress": 12002, + "MessageType_ScdoSignTx": 12003, + "MessageType_ScdoSignedTx": 12004, + "MessageType_ScdoTxAck": 12005, + "MessageType_ScdoSignMessage": 12006, + "MessageType_ScdoSignedMessage": 12007, + "MessageType_AlephiumGetAddress": 12101, + "MessageType_AlephiumAddress": 12102, + "MessageType_AlephiumSignTx": 12103, + "MessageType_AlephiumSignedTx": 12104, + "MessageType_AlephiumTxRequest": 12105, + "MessageType_AlephiumTxAck": 12106, + "MessageType_AlephiumBytecodeRequest": 12107, + "MessageType_AlephiumBytecodeAck": 12108, + "MessageType_AlephiumSignMessage": 12109, + "MessageType_AlephiumMessageSignature": 12110, + "MessageType_BenfenGetAddress": 12201, + "MessageType_BenfenAddress": 12202, + "MessageType_BenfenSignTx": 12203, + "MessageType_BenfenSignedTx": 12204, + "MessageType_BenfenSignMessage": 12205, + "MessageType_BenfenMessageSignature": 12206, + "MessageType_BenfenTxRequest": 12207, + "MessageType_BenfenTxAck": 12208, + "MessageType_NeoGetAddress": 12301, + "MessageType_NeoAddress": 12302, + "MessageType_NeoSignTx": 12303, + "MessageType_NeoSignedTx": 12304, + "MessageType_DeviceBackToBoot": 903, + "MessageType_DeviceInfoSettings": 10001, + "MessageType_GetDeviceInfo": 10002, + "MessageType_DeviceInfo": 10003, + "MessageType_ReadSEPublicKey": 10004, + "MessageType_SEPublicKey": 10005, + "MessageType_WriteSEPublicCert": 10006, + "MessageType_ReadSEPublicCert": 10007, + "MessageType_SEPublicCert": 10008, + "MessageType_SpiFlashWrite": 10009, + "MessageType_SpiFlashRead": 10010, + "MessageType_SpiFlashData": 10011, + "MessageType_SESignMessage": 10012, + "MessageType_SEMessageSignature": 10013, + "MessageType_NFTWriteInfo": 10014, + "MessageType_NFTWriteData": 10015, + "MessageType_ResourceUpload": 10018, + "MessageType_ZoomRequest": 10019, + "MessageType_ResourceRequest": 10020, + "MessageType_ResourceAck": 10021, + "MessageType_ResourceUpdate": 10022, + "MessageType_ListResDir": 10023, + "MessageType_FileInfoList": 10024, + "MessageType_OnekeyGetFeatures": 10025, + "MessageType_OnekeyFeatures": 10026 + } + }, + "google": { + "nested": { + "protobuf": { + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "public_dependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weak_dependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "message_type": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enum_type": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "source_code_info": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nested_type": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enum_type": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extension_range": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneof_decl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reserved_range": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reserved_name": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "type_name": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "default_value": { + "type": "string", + "id": 7 + }, + "oneof_index": { + "type": "int32", + "id": 9 + }, + "json_name": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "input_type": { + "type": "string", + "id": 2 + }, + "output_type": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "client_streaming": { + "type": "bool", + "id": 5 + }, + "server_streaming": { + "type": "bool", + "id": 6 + } + } + }, + "FileOptions": { + "fields": { + "java_package": { + "type": "string", + "id": 1 + }, + "java_outer_classname": { + "type": "string", + "id": 8 + }, + "java_multiple_files": { + "type": "bool", + "id": 10 + }, + "java_generate_equals_and_hash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "java_string_check_utf8": { + "type": "bool", + "id": 27 + }, + "optimize_for": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "go_package": { + "type": "string", + "id": 11 + }, + "cc_generic_services": { + "type": "bool", + "id": 16 + }, + "java_generic_services": { + "type": "bool", + "id": 17 + }, + "py_generic_services": { + "type": "bool", + "id": 18 + }, + "deprecated": { + "type": "bool", + "id": 23 + }, + "cc_enable_arenas": { + "type": "bool", + "id": 31 + }, + "objc_class_prefix": { + "type": "string", + "id": 36 + }, + "csharp_namespace": { + "type": "string", + "id": 37 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]], + "reserved": [[38, 38]], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "message_set_wire_format": { + "type": "bool", + "id": 1 + }, + "no_standard_descriptor_accessor": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "map_entry": { + "type": "bool", + "id": 7 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]], + "reserved": [[8, 8]] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "weak": { + "type": "bool", + "id": 10 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]], + "reserved": [[4, 4]], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "EnumOptions": { + "fields": { + "allow_alias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33 + }, + "uninterpreted_option": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [[1000, 536870911]] + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifier_value": { + "type": "string", + "id": 3 + }, + "positive_int_value": { + "type": "uint64", + "id": 4 + }, + "negative_int_value": { + "type": "int64", + "id": 5 + }, + "double_value": { + "type": "double", + "id": 6 + }, + "string_value": { + "type": "bytes", + "id": 7 + }, + "aggregate_value": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "name_part": { + "rule": "required", + "type": "string", + "id": 1 + }, + "is_extension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leading_comments": { + "type": "string", + "id": 3 + }, + "trailing_comments": { + "type": "string", + "id": 4 + }, + "leading_detached_comments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "source_file": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + } + } + } + } + } + } +} diff --git a/packages/core/src/device/Device.ts b/packages/core/src/device/Device.ts index 0fdbbb7a1..05963d8b2 100644 --- a/packages/core/src/device/Device.ts +++ b/packages/core/src/device/Device.ts @@ -21,6 +21,7 @@ import { import { fixFeaturesFirmwareVersion, getPassphraseStateWithRefreshDeviceInfo, + getSupportMessageVersion, } from '../utils/deviceFeaturesUtils'; import type DeviceConnector from './DeviceConnector'; @@ -37,6 +38,7 @@ import { DEVICE, DeviceButtonRequestPayload, DeviceFeaturesPayload, UI_REQUEST } import { PROTO } from '../constants'; import { DataManager } from '../data-manager'; import TransportManager from '../data-manager/TransportManager'; +import { cherryPickFeaturesParams } from './utils'; export type InitOptions = { initSession?: boolean; @@ -49,6 +51,11 @@ export type RunOptions = { keepSession?: boolean; } & InitOptions; +export interface IFeaturesType { + factory?: boolean; + normal?: boolean; +} + const parseRunOptions = (options?: RunOptions): RunOptions => { if (!options) options = {}; return options; @@ -362,6 +369,7 @@ export class Device extends EventEmitter { async initialize(options?: InitOptions) { Log.debug('initialize param:', options); + console.error('======> StartSession', options); this.passphraseState = options?.passphraseState; @@ -382,9 +390,14 @@ export class Device extends EventEmitter { Log.debug('initialize payload:', payload); try { + const { messageVersion } = getSupportMessageVersion(this.features); + console.error('caikaisheng messageVersion', messageVersion); // @ts-expect-error const { message } = await Promise.race([ - this.commands.typedCall('Initialize', 'Features', payload), + this.commands.typedCall('StartSession', 'Features', { + ...payload, + ok_dev_info_req: cherryPickFeaturesParams({ factory: true }), + }), new Promise((_, reject) => { setTimeout(() => { reject(ERRORS.TypedError(HardwareErrorCode.DeviceInitializeFailed)); @@ -392,6 +405,7 @@ export class Device extends EventEmitter { }, 25 * 1000); }), ]); + console.error('caikaisheng message', message); this._updateFeatures(message, options?.initSession); await TransportManager.reconfigure(this.features); @@ -402,11 +416,13 @@ export class Device extends EventEmitter { } async getFeatures() { - const { message } = await this.commands.typedCall('GetFeatures', 'Features', {}); + const { message } = await this.commands.typedCall('GetFeatures', 'Features', { + ok_dev_info_req: cherryPickFeaturesParams({ factory: true, normal: true }), + }); this._updateFeatures(message); } - _updateFeatures(feat: Features, initSession?: boolean) { + _updateFeatures(feat: any, initSession?: boolean) { // GetFeatures doesn't return 'session_id' if (this.features && this.features.session_id && !feat.session_id) { feat.session_id = this.features.session_id; @@ -415,6 +431,7 @@ export class Device extends EventEmitter { this.setInternalState(feat.session_id, initSession); } feat.unlocked = feat.unlocked ?? true; + feat.initialized = feat?.ok_dev_info_resp?.status?.init_states ?? feat?.initialized; feat = fixFeaturesFirmwareVersion(feat); diff --git a/packages/core/src/device/utils.ts b/packages/core/src/device/utils.ts new file mode 100644 index 000000000..c967dd82b --- /dev/null +++ b/packages/core/src/device/utils.ts @@ -0,0 +1,25 @@ +import { OneKeyInfoTargets, OneKeyInfoTypes } from '@onekeyfe/hd-transport'; +import { IFeaturesType } from './Device'; + +export const cherryPickFeaturesParams = (featuresType: IFeaturesType) => { + const { factory } = featuresType; + const targets: OneKeyInfoTargets = { + status: true, + hw: true, + fw: true, + bt: true, + }; + const types: OneKeyInfoTypes = { + version: true, + specific: true, + }; + if (factory) { + targets.se1 = true; + targets.se2 = true; + targets.se3 = true; + targets.se4 = true; + types.build_id = true; + types.hash = true; + } + return { targets, types }; +}; diff --git a/packages/core/src/types/api/cardano.ts b/packages/core/src/types/api/cardano.ts index 8aa5a0527..176f95baf 100644 --- a/packages/core/src/types/api/cardano.ts +++ b/packages/core/src/types/api/cardano.ts @@ -155,7 +155,7 @@ export interface CardanoCVoteRegistrationParameters { stakingPath: string | number[]; paymentAddressParameters: CardanoAddressParameters; nonce: string; - format?: PROTO.CardanoCVoteRegistrationFormat; + format?: PROTO.CardanoGovernanceRegistrationFormat; delegations?: CardanoCVoteRegistrationDelegation[]; votingPurpose?: number; paymentAddress?: string; diff --git a/packages/core/src/types/api/deviceRebootToBoardloader.ts b/packages/core/src/types/api/deviceRebootToBoardloader.ts index 95bbaa15c..52da54064 100644 --- a/packages/core/src/types/api/deviceRebootToBoardloader.ts +++ b/packages/core/src/types/api/deviceRebootToBoardloader.ts @@ -1,6 +1,6 @@ -import { Success, RebootToBoardloader } from '@onekeyfe/hd-transport'; +import { Success } from '@onekeyfe/hd-transport'; import type { Response } from '../params'; -export type RebootToBoardloaderParams = RebootToBoardloader; +export type RebootToBoardloaderParams = object; export declare function deviceRebootToBoardloader(connectId: string): Response; diff --git a/packages/core/src/types/api/deviceRecovery.ts b/packages/core/src/types/api/deviceRecovery.ts index 1ee83821c..0efbedc41 100644 --- a/packages/core/src/types/api/deviceRecovery.ts +++ b/packages/core/src/types/api/deviceRecovery.ts @@ -1,4 +1,4 @@ -import { RecoveryDeviceType, Success } from '@onekeyfe/hd-transport'; +import { RecoveryType, Success } from '@onekeyfe/hd-transport'; import type { CommonParams, Response } from '../params'; export type DeviceRecoveryParams = { @@ -8,7 +8,7 @@ export type DeviceRecoveryParams = { language?: string; label?: string; enforceWordlist?: boolean; - type?: RecoveryDeviceType; + type?: RecoveryType; u2fCounter?: number; dryRun?: boolean; }; diff --git a/packages/core/src/types/device.ts b/packages/core/src/types/device.ts index 78a0737f1..12c18bfd8 100644 --- a/packages/core/src/types/device.ts +++ b/packages/core/src/types/device.ts @@ -78,7 +78,8 @@ export type Device = KnownDevice; export type Features = PROTO.Features; -export type OnekeyFeatures = PROTO.OnekeyFeatures; +// TODO: 打补丁 +export type OnekeyFeatures = PROTO.Features; export type IDeviceType = | EDeviceType.Unknown diff --git a/packages/core/src/utils/deviceFeaturesUtils.ts b/packages/core/src/utils/deviceFeaturesUtils.ts index bcd76293d..abea529b8 100644 --- a/packages/core/src/utils/deviceFeaturesUtils.ts +++ b/packages/core/src/utils/deviceFeaturesUtils.ts @@ -20,9 +20,18 @@ export const getSupportMessageVersion = ( messageVersion: 'latest', }; + if (features?.ok_dev_info_resp?.protocol_version) { + return { + messages: DataManager.messages.latest, + messageVersion: 'latest', + }; + } + const currentDeviceVersion = getDeviceFirmwareVersion(features).join('.'); const deviceType = getDeviceType(features); + console.error('caikaisheng currentDeviceVersion', currentDeviceVersion); + console.error('caikaisheng deviceType', deviceType); const deviceVersionConfigs = PROTOBUF_MESSAGE_CONFIG[deviceType] || (DeviceTypeToModels[deviceType] && @@ -238,7 +247,8 @@ export const getFirmwareUpdateFieldArray = ( return ['firmware']; }; -export function fixVersion(version: string) { +export function fixVersion(version: string | undefined) { + if (!version) return '0.0.0'; let parts = version.split('.'); while (parts.length < 3) { @@ -254,12 +264,17 @@ export const fixFeaturesFirmwareVersion = (features: Features): Features => { // fix Touch、Pro device when bootloader version is lower than 2.5.2, the features returned do not have firmware_version error const tempFeatures = { ...features }; - if (tempFeatures.onekey_firmware_version && !semver.valid(tempFeatures.onekey_firmware_version)) { - tempFeatures.onekey_firmware_version = fixVersion(tempFeatures.onekey_firmware_version); + if ( + (tempFeatures as any).onekey_firmware_version && + !semver.valid((tempFeatures as any).onekey_firmware_version) + ) { + (tempFeatures as any).onekey_firmware_version = fixVersion( + (tempFeatures as any).onekey_firmware_version + ); } - if (tempFeatures.onekey_version && !semver.valid(tempFeatures.onekey_version)) { - tempFeatures.onekey_version = fixVersion(tempFeatures.onekey_version); + if ((tempFeatures as any).onekey_version && !semver.valid((tempFeatures as any).onekey_version)) { + (tempFeatures as any).onekey_version = fixVersion((tempFeatures as any).onekey_version); } return tempFeatures; diff --git a/packages/core/src/utils/deviceInfoUtils.ts b/packages/core/src/utils/deviceInfoUtils.ts index 4eb1936ee..69e031cdf 100644 --- a/packages/core/src/utils/deviceInfoUtils.ts +++ b/packages/core/src/utils/deviceInfoUtils.ts @@ -1,5 +1,9 @@ import { isEmpty } from 'lodash'; -import { EDeviceType } from '@onekeyfe/hd-shared'; +import { + getFirmwareInfoFromFeatures, + getHardwareInfoFromFeatures, + EDeviceType, +} from '@onekeyfe/hd-shared'; import { DeviceModelToTypes } from '../types'; import type { Features, IDeviceModel, IDeviceType, IVersionRange } from '../types'; @@ -12,19 +16,21 @@ export const getDeviceType = (features?: Features): IDeviceType => { return EDeviceType.Unknown; } + const { deviceType } = getHardwareInfoFromFeatures(features); + // classic1s 3.5.0 pro 4.6.0 - switch (features.onekey_device_type) { - case 'CLASSIC': + switch (deviceType) { + case EDeviceType.Classic: return EDeviceType.Classic; - case 'CLASSIC1S': + case EDeviceType.Classic1s: return EDeviceType.Classic1s; - case 'MINI': + case EDeviceType.Mini: return EDeviceType.Mini; - case 'TOUCH': + case EDeviceType.Touch: return EDeviceType.Touch; - case 'PRO': + case EDeviceType.Pro: return EDeviceType.Pro; - case 'PURE': + case EDeviceType.ClassicPure: return EDeviceType.ClassicPure; default: // future And old device onekey_device_type is empty @@ -80,17 +86,17 @@ export const getDeviceTypeByBleName = (name?: string): IDeviceType => { * Get Connected Device ble name by features * @returns */ -export const getDeviceBleName = (features?: Features): string | null => { - if (features == null) return null; - return features.onekey_ble_name || features.ble_name || null; +export const getDeviceBleName = (features: Features): string => { + const { bleName } = getFirmwareInfoFromFeatures(features); + return bleName; }; /** * Get Connected Device UUID by features */ export const getDeviceUUID = (features: Features) => { - const serialNo = features.onekey_serial_no || features.onekey_serial || features.serial_no; - return serialNo ?? ''; + const { serialNumber } = getHardwareInfoFromFeatures(features); + return serialNumber; }; /** diff --git a/packages/core/src/utils/deviceVersionUtils.ts b/packages/core/src/utils/deviceVersionUtils.ts index 9d61a4c67..a795e4968 100644 --- a/packages/core/src/utils/deviceVersionUtils.ts +++ b/packages/core/src/utils/deviceVersionUtils.ts @@ -1,4 +1,5 @@ import semver from 'semver'; +import { getFirmwareInfoFromFeatures } from '@onekeyfe/hd-shared'; import type { Features, IVersionArray } from '../types'; /** @@ -7,12 +8,9 @@ import type { Features, IVersionArray } from '../types'; export const getDeviceFirmwareVersion = (features: Features | undefined): IVersionArray => { if (!features) return [0, 0, 0]; - if (semver.valid(features.onekey_firmware_version)) { - return features.onekey_firmware_version?.split('.') as unknown as IVersionArray; - } - - if (semver.valid(features.onekey_version)) { - return features.onekey_version?.split('.') as unknown as IVersionArray; + const { firmwareVersion } = getFirmwareInfoFromFeatures(features); + if (semver.valid(firmwareVersion)) { + return firmwareVersion?.split('.') as unknown as IVersionArray; } return [0, 0, 0]; @@ -22,20 +20,17 @@ export const getDeviceFirmwareVersion = (features: Features | undefined): IVersi * Get Connected Device bluetooth firmware version by features */ export const getDeviceBLEFirmwareVersion = (features: Features): IVersionArray => { - const bleVer = features?.onekey_ble_version || features?.ble_ver; + const { bleVersion } = getFirmwareInfoFromFeatures(features); - if (!bleVer) { + if (!bleVersion) { return [0, 0, 0]; } - if (!semver.valid(bleVer)) { + if (!semver.valid(bleVersion)) { return [0, 0, 0]; } - if (bleVer) { - return bleVer.split('.').map(Number) as IVersionArray; - } - return [0, 0, 0]; + return bleVersion.split('.') as unknown as IVersionArray; }; /** @@ -43,26 +38,11 @@ export const getDeviceBLEFirmwareVersion = (features: Features): IVersionArray = */ export const getDeviceBootloaderVersion = (features: Features | undefined): IVersionArray => { if (!features) return [0, 0, 0]; - - // classic1s 3.5.0 pro 4.6.0 - if (semver.valid(features.onekey_boot_version)) { - return features.onekey_boot_version?.split('.') as unknown as IVersionArray; + const { bootloaderVersion } = getFirmwareInfoFromFeatures(features); + if (semver.valid(bootloaderVersion)) { + return bootloaderVersion?.split('.') as unknown as IVersionArray; } - // low version hardware - if (!features.bootloader_version) { - if (features.bootloader_mode) { - return [ - features?.major_version ?? 0, - features?.minor_version ?? 0, - features?.patch_version ?? 0, - ]; - } - return [0, 0, 0]; - } - if (semver.valid(features.bootloader_version)) { - return features.bootloader_version?.split('.') as unknown as IVersionArray; - } return [0, 0, 0]; }; @@ -70,9 +50,9 @@ export const getDeviceBootloaderVersion = (features: Features | undefined): IVer * Get Connected Device boardloader version by features */ export const getDeviceBoardloaderVersion = (features: Features): IVersionArray => { - if (semver.valid(features?.onekey_board_version)) { - return features?.onekey_board_version?.split('.') as unknown as IVersionArray; + const { boardloaderVersion } = getFirmwareInfoFromFeatures(features); + if (semver.valid(boardloaderVersion)) { + return boardloaderVersion?.split('.') as unknown as IVersionArray; } - return [0, 0, 0]; }; diff --git a/packages/core/src/utils/findDefectiveBatchDevice.ts b/packages/core/src/utils/findDefectiveBatchDevice.ts index 49b42336a..8b81dfc91 100644 --- a/packages/core/src/utils/findDefectiveBatchDevice.ts +++ b/packages/core/src/utils/findDefectiveBatchDevice.ts @@ -1,10 +1,15 @@ import type { Features } from '../types'; +import { + getHardwareInfoFromFeatures, + getSeInfoFromFeatures, +} from '@onekeyfe/hd-shared/src/onekeyInfoUtils'; export const findDefectiveBatchDevice = (features: Features) => { if (!features) return; - const { onekey_serial: onekeySerial, se_ver: seVer } = features; + const { serialNumber: onekeySerial } = getHardwareInfoFromFeatures(features); + const { se01Version } = getSeInfoFromFeatures(features); if (!onekeySerial) return; const versionNum = +onekeySerial.slice(5); if (Number.isNaN(versionNum)) return; - return versionNum >= 21032200001 && versionNum <= 21032201500 && seVer === '1.1.0.2'; + return versionNum >= 21032200001 && versionNum <= 21032201500 && se01Version === '1.1.0.2'; }; diff --git a/packages/hd-ble-sdk/package.json b/packages/hd-ble-sdk/package.json index e8d1a1b87..feb0466eb 100644 --- a/packages/hd-ble-sdk/package.json +++ b/packages/hd-ble-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-ble-sdk", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "author": "OneKey", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", "license": "ISC", @@ -20,8 +20,8 @@ "lint:fix": "eslint . --fix" }, "dependencies": { - "@onekeyfe/hd-core": "^1.0.26-alpha.3", - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport-react-native": "^1.0.26-alpha.3" + "@onekeyfe/hd-core": "^1.1.0-alpha.0", + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport-react-native": "^1.1.0-alpha.0" } } diff --git a/packages/hd-common-connect-sdk/package.json b/packages/hd-common-connect-sdk/package.json index 490e6da8f..7035f4bcf 100644 --- a/packages/hd-common-connect-sdk/package.json +++ b/packages/hd-common-connect-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-common-connect-sdk", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "author": "OneKey", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", "license": "ISC", @@ -20,10 +20,10 @@ "lint:fix": "eslint . --fix" }, "dependencies": { - "@onekeyfe/hd-core": "^1.0.26-alpha.3", - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport-http": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport-lowlevel": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport-webusb": "^1.0.26-alpha.3" + "@onekeyfe/hd-core": "^1.1.0-alpha.0", + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport-http": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport-lowlevel": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport-webusb": "^1.1.0-alpha.0" } } diff --git a/packages/hd-transport-http/package.json b/packages/hd-transport-http/package.json index 2b20cd5f4..42b98b8ce 100644 --- a/packages/hd-transport-http/package.json +++ b/packages/hd-transport-http/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-transport-http", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "description": "hardware http transport", "author": "OneKey", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", @@ -24,8 +24,8 @@ "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues" }, "dependencies": { - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport": "^1.0.26-alpha.3", + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport": "^1.1.0-alpha.0", "axios": "^0.27.2" } } diff --git a/packages/hd-transport-http/src/index.ts b/packages/hd-transport-http/src/index.ts index 758e054e8..d8036236f 100644 --- a/packages/hd-transport-http/src/index.ts +++ b/packages/hd-transport-http/src/index.ts @@ -57,6 +57,7 @@ export default class HttpTransport { } configure(signedData: any) { + this.Log.debug('http-transport configure'); const messages = parseConfigure(signedData); this.configured = true; this._messages = messages; @@ -118,7 +119,7 @@ export default class HttpTransport { const resData = await this._post({ url: `/call/${session}`, body: outData, - timeout: name === 'Initialize' ? 10000 : undefined, + timeout: name === 'StartSession' ? 10000 : undefined, }); if (typeof resData !== 'string') { throw ERRORS.TypedError(HardwareErrorCode.NetworkError, 'Returning data is not string.'); diff --git a/packages/hd-transport-lowlevel/package.json b/packages/hd-transport-lowlevel/package.json index 4a77cae50..0f1ad8689 100644 --- a/packages/hd-transport-lowlevel/package.json +++ b/packages/hd-transport-lowlevel/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-transport-lowlevel", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", "license": "MIT", "main": "dist/index.js", @@ -19,7 +19,7 @@ "lint:fix": "eslint . --fix" }, "dependencies": { - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport": "^1.0.26-alpha.3" + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport": "^1.1.0-alpha.0" } } diff --git a/packages/hd-transport-react-native/package.json b/packages/hd-transport-react-native/package.json index 6c68c4600..61a08b5cb 100644 --- a/packages/hd-transport-react-native/package.json +++ b/packages/hd-transport-react-native/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-transport-react-native", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", "license": "MIT", "main": "dist/index.js", @@ -19,8 +19,8 @@ "lint:fix": "eslint . --fix" }, "dependencies": { - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport": "^1.0.26-alpha.3", + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport": "^1.1.0-alpha.0", "@onekeyfe/react-native-ble-utils": "^0.1.4", "react-native-ble-plx": "3.5.0" } diff --git a/packages/hd-transport-webusb/package.json b/packages/hd-transport-webusb/package.json index 93dbffdf2..e5d28d38a 100644 --- a/packages/hd-transport-webusb/package.json +++ b/packages/hd-transport-webusb/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-transport-webusb", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "author": "OneKey", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", "license": "MIT", @@ -20,8 +20,8 @@ "lint:fix": "eslint . --fix" }, "dependencies": { - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport": "^1.0.26-alpha.3" + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport": "^1.1.0-alpha.0" }, "devDependencies": { "@types/w3c-web-usb": "^1.0.6", diff --git a/packages/hd-transport/__tests__/encode-decode.test.js b/packages/hd-transport/__tests__/encode-decode.test.js index 1c20d44c2..87587a1fa 100644 --- a/packages/hd-transport/__tests__/encode-decode.test.js +++ b/packages/hd-transport/__tests__/encode-decode.test.js @@ -91,9 +91,9 @@ const MultisigRedeemScriptType = { const fixtures = [ { - name: 'Initialize', + name: 'StartSession', message: { - Initialize: { + StartSession: { fields: { session_id: { type: 'bytes', diff --git a/packages/hd-transport/__tests__/messages.test.js b/packages/hd-transport/__tests__/messages.test.js index 0d65c68b8..df4e7078e 100644 --- a/packages/hd-transport/__tests__/messages.test.js +++ b/packages/hd-transport/__tests__/messages.test.js @@ -7,7 +7,7 @@ const { const json = { nested: { - Initialize: { + StartSession: { fields: { session_id: { type: 'bytes', @@ -51,7 +51,7 @@ const json = { }, MessageType: { values: { - MessageType_Initialize: 0, + MessageType_StartSession: 0, }, }, }, @@ -60,7 +60,7 @@ const json = { describe('messages', () => { test('createMessageFromName (common case)', () => { const messages = parseConfigure(json); - const name = 'Initialize'; + const name = 'StartSession'; expect(() => createMessageFromName(messages, name)).not.toThrow(); }); diff --git a/packages/hd-transport/package.json b/packages/hd-transport/package.json index 82b1e8461..82f95fb4e 100644 --- a/packages/hd-transport/package.json +++ b/packages/hd-transport/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-transport", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "description": "> TODO: description", "author": "OneKey", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", diff --git a/packages/hd-transport/scripts/protobuf-build.sh b/packages/hd-transport/scripts/protobuf-build.sh index 853f91d2d..3e57f4c86 100755 --- a/packages/hd-transport/scripts/protobuf-build.sh +++ b/packages/hd-transport/scripts/protobuf-build.sh @@ -6,7 +6,8 @@ echo $# PARENT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) -SRC="../../submodules/firmware/common/protob" +# Updated to use onekey-protocol instead of firmware +SRC="../../submodules/onekey-protocol/protob" DIST="." LANG="typescript" @@ -29,24 +30,46 @@ if [[ "$LANG" != "typescript" && "$LANG" != "flow" ]]; exit 1 fi +# Check if messages.json already exists in onekey-protocol +ONEKEY_PROTOCOL_PATH="../../submodules/onekey-protocol" +MESSAGES_JSON_PATH="$ONEKEY_PROTOCOL_PATH/messages.json" -# BUILD combined messages.proto file from protobuf files -# this code was copied from ./submodules/firmware/protob Makekile -# clear protobuf syntax and remove unknown values to be able to work with proto2js -echo 'syntax = "proto2";' > $DIST/messages.proto -echo 'import "google/protobuf/descriptor.proto";' >> $DIST/messages.proto -echo "Build proto file from $SRC" -grep -hv -e '^import ' -e '^syntax' -e '^package' -e 'option java_' $SRC/messages*.proto \ -| sed 's/ hw\.trezor\.messages\.common\./ /' \ -| sed 's/ common\./ /' \ -| sed 's/ ethereum_definitions\./ /' \ -| sed 's/ management\./ /' \ -| sed 's/^option /\/\/ option /' \ -| grep -v ' reserved '>> $DIST/messages.proto - -# BUILD messages.json from message.proto -npx pbjs -t json -p $DIST -o $DIST/messages.json --keep-case messages.proto -rm $DIST/messages.proto +if [ -f "$MESSAGES_JSON_PATH" ]; then + echo "Using existing messages.json from onekey-protocol submodule" + cp "$MESSAGES_JSON_PATH" "$DIST/messages.json" +else + echo "No existing messages.json found in onekey-protocol, generating from .proto files" + + # BUILD combined messages.proto file from protobuf files + # this code was copied from ./submodules/onekey-protocol/protob Makekile + # clear protobuf syntax and remove unknown values to be able to work with proto2js + echo 'syntax = "proto2";' > $DIST/messages.proto + echo 'import "google/protobuf/descriptor.proto";' >> $DIST/messages.proto + echo "Build proto file from $SRC" + # First pass - save to temp file for inspection + grep -hv -e '^import ' -e '^syntax' -e '^package' -e 'option java_' $SRC/messages*.proto \ + | sed 's/ hw\.onekey\.messages\.onekey\./ /' \ + | sed 's/ hw\.onekey\.messages\.common\./ /' \ + | sed 's/ common\./ /' \ + | sed 's/ ethereum_definitions\./ /' \ + | sed 's/ management\./ /' \ + | sed 's/ onekey\./ /' \ + | sed 's/^option /\/\/ option /' \ + | grep -v ' reserved '>> $DIST/messages.proto + + echo "Converting proto to JSON..." + # Convert proto to JSON with type conversion: + # --force-number: converts float/double to number + # --force-long: converts int64/uint64 to number + # Other types are automatically converted: + # - string -> string + # - bytes -> Uint8Array + # - bool -> boolean + # - int32/uint32 -> number + # npx pbjs -t json --force-number --force-long -p $DIST -o $DIST/messages.json --keep-case messages.proto + npx pbjs -t json -p $DIST -o $DIST/messages.json --keep-case messages.proto + rm $DIST/messages.proto +fi echo "generating type definitions for: $LANG" @@ -56,3 +79,4 @@ node ./protobuf-types.js $LANG yarn prettier --write messages.json yarn prettier --write **/messages.ts +echo "Build process completed." diff --git a/packages/hd-transport/scripts/protobuf-types.js b/packages/hd-transport/scripts/protobuf-types.js index 640d307e3..c88871f4c 100644 --- a/packages/hd-transport/scripts/protobuf-types.js +++ b/packages/hd-transport/scripts/protobuf-types.js @@ -21,6 +21,7 @@ const FIELD_TYPES = { sint64: 'number', bool: 'boolean', bytes: 'string', + float: 'number', // 'bytes': 'Uint8Array | number[] | Buffer | string', // protobuf will handle conversion }; diff --git a/packages/hd-transport/src/serialization/protobuf/decode.ts b/packages/hd-transport/src/serialization/protobuf/decode.ts index ba21ea468..37d2fd5d4 100644 --- a/packages/hd-transport/src/serialization/protobuf/decode.ts +++ b/packages/hd-transport/src/serialization/protobuf/decode.ts @@ -45,9 +45,9 @@ function messageToJSON(Message: Message>, fields: Type[' res[key] = value.map((v: any) => transform(field, v)); } // [compatibility]: keep array enums as array of numbers. - else if ('valuesById' in field.resolvedType!) { + else if (field.resolvedType && 'valuesById' in field.resolvedType) { res[key] = value; - } else if ('fields' in field.resolvedType!) { + } else if (field.resolvedType && 'fields' in field.resolvedType) { res[key] = value.map((v: any) => messageToJSON(v, (field.resolvedType as Type).fields)); } else { throw new Error(`case not handled for repeated key: ${key}`); @@ -56,12 +56,15 @@ function messageToJSON(Message: Message>, fields: Type[' res[key] = transform(field, value); } // enum type - else if ('valuesById' in field.resolvedType!) { + else if (field.resolvedType && 'valuesById' in field.resolvedType) { res[key] = field.resolvedType.valuesById[value]; } // message type - else if (field.resolvedType!.fields) { - res[key] = messageToJSON(value, field.resolvedType!.fields); + else if (field.resolvedType && 'fields' in field.resolvedType) { + res[key] = messageToJSON(value, field.resolvedType.fields); + } else if (field.resolvedType === null) { + // TODO: for lastest message protocol,multi layer organization. key words: "ok_dev_info_resp" + res[key] = null; } else { throw new Error(`case not handled: ${key}`); } diff --git a/packages/hd-transport/src/types/messages.ts b/packages/hd-transport/src/types/messages.ts index 154772542..e94e4bed9 100644 --- a/packages/hd-transport/src/types/messages.ts +++ b/packages/hd-transport/src/types/messages.ts @@ -139,6 +139,25 @@ export type AptosMessageSignature = { address: string; }; +// BenchmarkListNames +export type BenchmarkListNames = {}; + +// BenchmarkNames +export type BenchmarkNames = { + names: string[]; +}; + +// BenchmarkRun +export type BenchmarkRun = { + name?: string; +}; + +// BenchmarkResult +export type BenchmarkResult = { + value?: string; + unit?: string; +}; + // BenfenGetAddress export type BenfenGetAddress = { address_n: number[]; @@ -214,24 +233,24 @@ export type BinancePublicKey = { // BinanceSignTx export type BinanceSignTx = { address_n: number[]; - msg_count?: number; - account_number?: number; + msg_count: number; + account_number: number; chain_id?: string; memo?: string; - sequence?: number; - source?: number; + sequence: number; + source: number; }; // BinanceTxRequest export type BinanceTxRequest = {}; export type BinanceCoin = { - amount?: UintType; - denom?: string; + amount: UintType; + denom: string; }; export type BinanceInputOutput = { - address?: string; + address: string; coins: BinanceCoin[]; }; @@ -264,13 +283,13 @@ export enum BinanceTimeInForce { // BinanceOrderMsg export type BinanceOrderMsg = { id?: string; - ordertype?: BinanceOrderType; - price?: number; - quantity?: number; + ordertype: BinanceOrderType; + price: number; + quantity: number; sender?: string; - side?: BinanceOrderSide; + side: BinanceOrderSide; symbol?: string; - timeinforce?: BinanceTimeInForce; + timeinforce: BinanceTimeInForce; }; // BinanceCancelMsg @@ -358,6 +377,7 @@ export type PublicKey = { node: HDNodeType; xpub: string; root_fingerprint?: number; + descriptor?: string; }; // GetAddress @@ -373,6 +393,7 @@ export type GetAddress = { // Address export type Address = { address: string; + mac?: string; }; // GetOwnershipId @@ -412,6 +433,14 @@ export type VerifyMessage = { coin_name?: string; }; +export type CoinJoinRequest = { + fee_rate: number; + no_fee_threshold: number; + min_registrable_amount: number; + mask_public_key: string; + signature: string; +}; + // SignTx export type SignTx = { outputs_count: number; @@ -426,6 +455,8 @@ export type SignTx = { branch_id?: number; amount_unit?: AmountUnit; decred_staking_ticket?: boolean; + serialize?: boolean; + coinjoin_request?: CoinJoinRequest; }; export enum Enum_RequestType { @@ -436,6 +467,7 @@ export enum Enum_RequestType { TXEXTRADATA = 4, TXORIGINPUT = 5, TXORIGOUTPUT = 6, + TXPAYMENTREQ = 7, } export type RequestType = keyof typeof Enum_RequestType; @@ -574,6 +606,37 @@ export type PrevOutput = { decred_script_version?: number; }; +export type TextMemo = { + text: string; +}; + +export type RefundMemo = { + address: string; + mac: string; +}; + +export type CoinPurchaseMemo = { + coin_type: number; + amount: UintType; + address: string; + mac: string; +}; + +export type PaymentRequestMemo = { + text_memo?: TextMemo; + refund_memo?: RefundMemo; + coin_purchase_memo?: CoinPurchaseMemo; +}; + +// TxAckPaymentRequest +export type TxAckPaymentRequest = { + nonce?: string; + recipient_name: string; + memos?: PaymentRequestMemo[]; + amount?: UintType; + signature: string; +}; + // TxAck // TxAck replacement @@ -682,8 +745,9 @@ export type OwnershipProof = { // AuthorizeCoinJoin export type AuthorizeCoinJoin = { coordinator: string; - max_total_fee: number; - fee_per_anonymity?: number; + max_rounds: number; + max_coordinator_fee_rate: number; + max_fee_per_kvbyte: number; address_n: number[]; coin_name?: string; script_type?: InputScriptType; @@ -720,11 +784,123 @@ export type SignedPsbt = { psbt: string; }; +// BixinPinInputOnDevice +export type BixinPinInputOnDevice = {}; + +// ApplySettingsBixin +export type ApplySettingsBixin = { + use_ble?: boolean; + use_se?: boolean; + is_bixinapp?: boolean; + fastpay_pin?: boolean; + fastpay_confirm?: boolean; + fastpay_money_limit?: number; + fastpay_times?: number; +}; + +export enum SeedRequestType { + SeedRequestType_Gen = 0, + SeedRequestType_EncExport = 1, + SeedRequestType_EncImport = 2, +} + +// BixinSeedOperate +export type BixinSeedOperate = { + type: SeedRequestType; + seed_importData?: string; +}; + +// BixinMessageSE +export type BixinMessageSE = { + inputmessage: string; +}; + +// BixinOutMessageSE +export type BixinOutMessageSE = { + outmessage?: string; +}; + +// BixinReboot +export type BixinReboot = {}; + +// DeviceBackToBoot +export type DeviceBackToBoot = {}; + +// BixinBackupRequest +export type BixinBackupRequest = {}; + +// BixinBackupAck +export type BixinBackupAck = { + data: string; +}; + +// BixinRestoreRequest +export type BixinRestoreRequest = { + data: string; + language?: string; + label?: string; + passphrase_protection?: boolean; +}; + +// BixinRestoreAck +export type BixinRestoreAck = { + data: string; +}; + +// BixinVerifyDeviceRequest +export type BixinVerifyDeviceRequest = { + data: string; +}; + +// BixinVerifyDeviceAck +export type BixinVerifyDeviceAck = { + cert: string; + signature: string; +}; + +export enum WL_OperationType { + WL_OperationType_Add = 0, + WL_OperationType_Delete = 1, + WL_OperationType_Inquire = 2, +} + +// BixinWhiteListRequest +export type BixinWhiteListRequest = { + type: WL_OperationType; + addr_in?: string; +}; + +// BixinWhiteListAck +export type BixinWhiteListAck = { + address: string[]; +}; + +// BixinLoadDevice +export type BixinLoadDevice = { + mnemonics: string; + language?: string; + label?: string; + skip_checksum?: boolean; +}; + +// BixinBackupDevice +export type BixinBackupDevice = {}; + +// BixinBackupDeviceAck +export type BixinBackupDeviceAck = { + mnemonics: string; +}; + // FirmwareErase export type FirmwareErase = { length?: number; }; +// FirmwareErase_ex +export type FirmwareErase_ex = { + length?: number; +}; + // FirmwareRequest export type FirmwareRequest = { offset?: number; @@ -742,22 +918,6 @@ export type SelfTest = { payload?: string; }; -// FirmwareErase_ex -export type FirmwareErase_ex = { - length?: number; -}; - -export enum RebootType { - Normal = 0, - Boardloader = 1, - BootLoader = 2, -} - -// Reboot -export type Reboot = { - reboot_type: RebootType; -}; - // FirmwareUpdateEmmc export type FirmwareUpdateEmmc = { path: string; @@ -829,10 +989,10 @@ export enum CardanoPoolRelayType { export enum CardanoTxAuxiliaryDataSupplementType { NONE = 0, - CVOTE_REGISTRATION_SIGNATURE = 1, + GOVERNANCE_REGISTRATION_SIGNATURE = 1, } -export enum CardanoCVoteRegistrationFormat { +export enum CardanoGovernanceRegistrationFormat { CIP15 = 0, CIP36 = 1, } @@ -1048,27 +1208,27 @@ export type CardanoTxWithdrawal = { key_hash?: string; }; -// CardanoCVoteRegistrationDelegation -export type CardanoCVoteRegistrationDelegation = { - vote_public_key: string; +// CardanoGovernanceRegistrationDelegation +export type CardanoGovernanceRegistrationDelegation = { + voting_public_key: string; weight: number; }; -// CardanoCVoteRegistrationParametersType -export type CardanoCVoteRegistrationParametersType = { - vote_public_key?: string; +// CardanoGovernanceRegistrationParametersType +export type CardanoGovernanceRegistrationParametersType = { + voting_public_key?: string; staking_path: number[]; - payment_address_parameters?: CardanoAddressParametersType; + payment_address_parameters: CardanoAddressParametersType; nonce: number; - format?: CardanoCVoteRegistrationFormat; - delegations: CardanoCVoteRegistrationDelegation[]; + format?: CardanoGovernanceRegistrationFormat; + delegations: CardanoGovernanceRegistrationDelegation[]; voting_purpose?: number; payment_address?: string; }; // CardanoTxAuxiliaryData export type CardanoTxAuxiliaryData = { - cvote_registration_parameters?: CardanoCVoteRegistrationParametersType; + governance_registration_parameters?: CardanoGovernanceRegistrationParametersType; hash?: string; }; @@ -1102,7 +1262,7 @@ export type CardanoTxItemAck = {}; export type CardanoTxAuxiliaryDataSupplement = { type: CardanoTxAuxiliaryDataSupplementType; auxiliary_data_hash?: string; - cvote_registration_signature?: string; + governance_signature?: string; }; // CardanoTxWitnessRequest @@ -1164,6 +1324,7 @@ export enum FailureType { Failure_PinMismatch = 12, Failure_WipeCodeMismatch = 13, Failure_InvalidSession = 14, + Failure_BatteryLow = 30, Failure_FirmwareError = 99, } @@ -1201,6 +1362,7 @@ export type ButtonRequestType = keyof typeof Enum_ButtonRequestType; export type ButtonRequest = { code?: ButtonRequestType; pages?: number; + name?: string; }; // ButtonAck @@ -1248,9 +1410,6 @@ export type Deprecated_PassphraseStateRequest = { // Deprecated_PassphraseStateAck export type Deprecated_PassphraseStateAck = {}; -// BixinPinInputOnDevice -export type BixinPinInputOnDevice = {}; - // ConfluxGetAddress export type ConfluxGetAddress = { address_n: number[]; @@ -1266,9 +1425,9 @@ export type ConfluxAddress = { // ConfluxSignTx export type ConfluxSignTx = { address_n: number[]; - nonce?: string; - gas_price?: string; - gas_limit?: string; + nonce: string; + gas_price: string; + gas_limit: string; to?: string; value?: string; epoch_height?: string; @@ -1405,6 +1564,30 @@ export type EcdsaPublicKeys = { root_fingerprint?: number; }; +export enum DebugButton { + NO = 0, + YES = 1, + INFO = 2, +} + +export enum DebugPhysicalButton { + LEFT_BTN = 0, + MIDDLE_BTN = 1, + RIGHT_BTN = 2, +} + +export enum DebugWaitType { + IMMEDIATE = 0, + NEXT_LAYOUT = 1, + CURRENT_LAYOUT = 2, +} + +// DebugLinkResetDebugEvents +export type DebugLinkResetDebugEvents = {}; + +// DebugLinkOptigaSetSecMax +export type DebugLinkOptigaSetSecMax = {}; + // DnxGetAddress export type DnxGetAddress = { address_n: number[]; @@ -1560,9 +1743,9 @@ export type EosTxHeader = { // EosSignTx export type EosSignTx = { address_n: number[]; - chain_id?: string; - header?: EosTxHeader; - num_actions?: number; + chain_id: string; + header: EosTxHeader; + num_actions: number; }; // EosTxActionRequest @@ -1571,13 +1754,13 @@ export type EosTxActionRequest = { }; export type EosAsset = { - amount?: UintType; - symbol?: string; + amount: UintType; + symbol: string; }; export type EosPermissionLevel = { - actor?: string; - permission?: string; + actor: string; + permission: string; }; export type EosAuthorizationKey = { @@ -1588,117 +1771,117 @@ export type EosAuthorizationKey = { }; export type EosAuthorizationAccount = { - account?: EosPermissionLevel; - weight?: number; + account: EosPermissionLevel; + weight: number; }; export type EosAuthorizationWait = { - wait_sec?: number; - weight?: number; + wait_sec: number; + weight: number; }; export type EosAuthorization = { - threshold?: number; + threshold: number; keys: EosAuthorizationKey[]; accounts: EosAuthorizationAccount[]; waits: EosAuthorizationWait[]; }; export type EosActionCommon = { - account?: string; - name?: string; + account: string; + name: string; authorization: EosPermissionLevel[]; }; export type EosActionTransfer = { - sender?: string; - receiver?: string; - quantity?: EosAsset; - memo?: string; + sender: string; + receiver: string; + quantity: EosAsset; + memo: string; }; export type EosActionDelegate = { - sender?: string; - receiver?: string; - net_quantity?: EosAsset; - cpu_quantity?: EosAsset; - transfer?: boolean; + sender: string; + receiver: string; + net_quantity: EosAsset; + cpu_quantity: EosAsset; + transfer: boolean; }; export type EosActionUndelegate = { - sender?: string; - receiver?: string; - net_quantity?: EosAsset; - cpu_quantity?: EosAsset; + sender: string; + receiver: string; + net_quantity: EosAsset; + cpu_quantity: EosAsset; }; export type EosActionRefund = { - owner?: string; + owner: string; }; export type EosActionBuyRam = { - payer?: string; - receiver?: string; - quantity?: EosAsset; + payer: string; + receiver: string; + quantity: EosAsset; }; export type EosActionBuyRamBytes = { - payer?: string; - receiver?: string; - bytes?: number; + payer: string; + receiver: string; + bytes: number; }; export type EosActionSellRam = { - account?: string; - bytes?: number; + account: string; + bytes: number; }; export type EosActionVoteProducer = { - voter?: string; - proxy?: string; + voter: string; + proxy: string; producers: string[]; }; export type EosActionUpdateAuth = { - account?: string; - permission?: string; - parent?: string; - auth?: EosAuthorization; + account: string; + permission: string; + parent: string; + auth: EosAuthorization; }; export type EosActionDeleteAuth = { - account?: string; - permission?: string; + account: string; + permission: string; }; export type EosActionLinkAuth = { - account?: string; - code?: string; - type?: string; - requirement?: string; + account: string; + code: string; + type: string; + requirement: string; }; export type EosActionUnlinkAuth = { - account?: string; - code?: string; - type?: string; + account: string; + code: string; + type: string; }; export type EosActionNewAccount = { - creator?: string; - name?: string; - owner?: EosAuthorization; - active?: EosAuthorization; + creator: string; + name: string; + owner: EosAuthorization; + active: EosAuthorization; }; export type EosActionUnknown = { data_size: number; - data_chunk?: string; + data_chunk: string; }; // EosTxActionAck export type EosTxActionAck = { - common?: EosActionCommon; + common: EosActionCommon; transfer?: EosActionTransfer; delegate?: EosActionDelegate; undelegate?: EosActionUndelegate; @@ -1758,30 +1941,6 @@ export type EthereumSignTypedDataOneKey = { chain_id?: number; }; -export enum EthereumGnosisSafeTxOperation { - CALL = 0, - DELEGATE_CALL = 1, -} - -// EthereumGnosisSafeTxRequest -export type EthereumGnosisSafeTxRequest = {}; - -// EthereumGnosisSafeTxAck -export type EthereumGnosisSafeTxAck = { - to: string; - value: string; - data?: string; - operation: EthereumGnosisSafeTxOperation; - safeTxGas: string; - baseGas: string; - gasPrice: string; - gasToken: string; - refundReceiver: string; - nonce: string; - chain_id: number; - verifyingContract: string; -}; - // EthereumTypedDataStructRequestOneKey export type EthereumTypedDataStructRequestOneKey = { name: string; @@ -2179,6 +2338,9 @@ export enum Enum_BackupType { Bip39 = 0, Slip39_Basic = 1, Slip39_Advanced = 2, + Slip39_Single_Extendable = 3, + Slip39_Basic_Extendable = 4, + Slip39_Advanced_Extendable = 5, } export type BackupType = keyof typeof Enum_BackupType; @@ -2189,36 +2351,34 @@ export enum Enum_SafetyCheckLevel { } export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel; -// Initialize -export type Initialize = { - session_id?: string; - _skip_passphrase?: boolean; - derive_cardano?: boolean; -}; - -// GetFeatures -export type GetFeatures = {}; - -// OnekeyGetFeatures -export type OnekeyGetFeatures = {}; +export enum DisplayRotation { + North = 0, + East = 90, + South = 180, + West = 270, +} -export enum OneKeyDeviceType { - CLASSIC = 0, - CLASSIC1S = 1, - MINI = 2, - TOUCH = 3, - PRO = 5, - PURE = 6, +export enum HomescreenFormat { + Toif = 1, + Jpeg = 2, + ToiG = 3, } -export enum OneKeySeType { - THD89 = 0, - SE608A = 1, +// GetFeatures +export type GetFeatures = { + ok_dev_info_req?: OneKeyInfoReq; +}; + +export enum BackupAvailability { + NotAvailable = 0, + Required = 1, + Available = 2, } -export enum OneKeySEState { - BOOT = 0, - APP = 1, +export enum RecoveryStatus { + Nothing = 0, + Recovery = 1, + Backup = 2, } export enum Enum_Capability { @@ -2226,7 +2386,6 @@ export enum Enum_Capability { Capability_Bitcoin_like = 2, Capability_Binance = 3, Capability_Cardano = 4, - Capability_Crypto = 5, Capability_EOS = 6, Capability_Ethereum = 7, Capability_Lisk = 8, @@ -2239,6 +2398,7 @@ export enum Enum_Capability { Capability_Shamir = 15, Capability_ShamirGroups = 16, Capability_PassphraseEntry = 17, + Capability_Solana = 18, } export type Capability = keyof typeof Enum_Capability; @@ -2261,7 +2421,7 @@ export type Features = { unlocked: boolean | null; _passphrase_cached?: boolean; firmware_present: boolean | null; - needs_backup: boolean | null; + backup_availability?: BackupAvailability; flags: number | null; model: string; fw_major: number | null; @@ -2270,7 +2430,7 @@ export type Features = { fw_vendor: string | null; unfinished_backup: boolean | null; no_backup: boolean | null; - recovery_mode: boolean | null; + recovery_status?: RecoveryStatus; capabilities: Capability[]; backup_type: BackupType | null; sd_card_present: boolean | null; @@ -2283,113 +2443,44 @@ export type Features = { display_rotation: number | null; experimental_features: boolean | null; busy?: boolean; - offset?: number; - ble_name?: string; - ble_ver?: string; - ble_enable?: boolean; - se_enable?: boolean; - se_ver?: string; - backup_only?: boolean; - onekey_version?: string; - onekey_serial?: string; - bootloader_version?: string; - serial_no?: string; - spi_flash?: string; - initstates?: number; - NFT_voucher?: string; - cpu_info?: string; - pre_firmware?: string; - coin_switch?: number; - build_id?: string; - boardloader_version?: string; - battery_level?: number; + homescreen_format?: HomescreenFormat; + hide_passphrase_from_host?: boolean; + internal_model?: string; + unit_color?: number; + unit_btconly?: boolean; + homescreen_width?: number; + homescreen_height?: number; + bootloader_locked?: boolean; + language_version_matches?: boolean; + unit_packaging?: number; + haptic_feedback?: boolean; + recovery_type?: RecoveryType; + optiga_sec?: number; + ok_dev_info_resp?: OneKeyInfoResp; + ok_factory_status?: OneKeyFactoryStatus; onekey_device_type?: string | null; - onekey_se_type?: string | null; - onekey_board_version?: string; - onekey_board_hash?: string; - onekey_boot_version?: string; - onekey_boot_hash?: string; - onekey_se01_version?: string; - onekey_se01_hash?: string; - onekey_se01_build_id?: string; - onekey_firmware_version?: string; - onekey_firmware_hash?: string; - onekey_firmware_build_id?: string; onekey_serial_no?: string; - onekey_boot_build_id?: string; - onekey_ble_name?: string; - onekey_ble_version?: string; - onekey_ble_build_id?: string; - onekey_ble_hash?: string; - onekey_se02_version?: string; - onekey_se03_version?: string; - onekey_se04_version?: string; - onekey_se01_state?: string | null; - onekey_se02_state?: string | null; - onekey_se03_state?: string | null; - onekey_se04_state?: string | null; -}; - -// OnekeyFeatures -export type OnekeyFeatures = { - onekey_device_type?: OneKeyDeviceType; - onekey_board_version?: string; - onekey_boot_version?: string; - onekey_firmware_version?: string; - onekey_board_hash?: string; - onekey_boot_hash?: string; - onekey_firmware_hash?: string; - onekey_board_build_id?: string; - onekey_boot_build_id?: string; - onekey_firmware_build_id?: string; - onekey_serial_no?: string; - onekey_ble_name?: string; - onekey_ble_version?: string; - onekey_ble_build_id?: string; - onekey_ble_hash?: string; - onekey_se_type?: OneKeySeType; - onekey_se01_state?: OneKeySEState; - onekey_se02_state?: OneKeySEState; - onekey_se03_state?: OneKeySEState; - onekey_se04_state?: OneKeySEState; - onekey_se01_version?: string; - onekey_se02_version?: string; - onekey_se03_version?: string; - onekey_se04_version?: string; - onekey_se01_hash?: string; - onekey_se02_hash?: string; - onekey_se03_hash?: string; - onekey_se04_hash?: string; - onekey_se01_build_id?: string; - onekey_se02_build_id?: string; - onekey_se03_build_id?: string; - onekey_se04_build_id?: string; - onekey_se01_boot_version?: string; - onekey_se02_boot_version?: string; - onekey_se03_boot_version?: string; - onekey_se04_boot_version?: string; - onekey_se01_boot_hash?: string; - onekey_se02_boot_hash?: string; - onekey_se03_boot_hash?: string; - onekey_se04_boot_hash?: string; - onekey_se01_boot_build_id?: string; - onekey_se02_boot_build_id?: string; - onekey_se03_boot_build_id?: string; - onekey_se04_boot_build_id?: string; }; // LockDevice export type LockDevice = {}; +// SetBusy +export type SetBusy = { + expiry_ms?: number; +}; + +// StartSession +export type StartSession = { + session_id?: string; + _skip_passphrase?: boolean; + derive_cardano?: boolean; + ok_dev_info_req?: OneKeyInfoReq; +}; + // EndSession export type EndSession = {}; -export enum ExportType { - SeedEncExportType_NO = 0, - SeedEncExportType_YES = 1, - MnemonicPlainExportType_YES = 2, -} - // ApplySettings export type ApplySettings = { language?: string; @@ -2398,17 +2489,29 @@ export type ApplySettings = { homescreen?: string; _passphrase_source?: number; auto_lock_delay_ms?: number; - display_rotation?: number; + display_rotation?: DisplayRotation; passphrase_always_on_device?: boolean; safety_checks?: SafetyCheckLevel; experimental_features?: boolean; - use_ble?: boolean; - use_se?: boolean; - is_bixinapp?: boolean; - fastpay_pin?: boolean; - fastpay_confirm?: boolean; - fastpay_money_limit?: number; - fastpay_times?: number; + hide_passphrase_from_host?: boolean; + haptic_feedback?: boolean; +}; + +// ChangeLanguage +export type ChangeLanguage = { + data_length: number; + show_display?: boolean; +}; + +// TranslationDataRequest +export type TranslationDataRequest = { + data_length: number; + data_offset: number; +}; + +// TranslationDataAck +export type TranslationDataAck = { + data_chunk: string; }; // ApplyFlags @@ -2456,6 +2559,27 @@ export type Entropy = { entropy: string; }; +// GetFirmwareHash +export type GetFirmwareHash = { + challenge?: string; +}; + +// FirmwareHash +export type FirmwareHash = { + hash: string; +}; + +// AuthenticateDevice +export type AuthenticateDevice = { + challenge: string; +}; + +// AuthenticityProof +export type AuthenticityProof = { + certificates: string[]; + signature: string; +}; + // WipeDevice export type WipeDevice = {}; @@ -2473,8 +2597,16 @@ export type ResetDevice = { backup_type?: string | number; }; +export type Slip39Group = { + member_threshold: number; + member_count: number; +}; + // BackupDevice -export type BackupDevice = {}; +export type BackupDevice = { + group_threshold?: number; + groups: Slip39Group[]; +}; // EntropyRequest export type EntropyRequest = {}; @@ -2484,9 +2616,9 @@ export type EntropyAck = { entropy: string; }; -export enum RecoveryDeviceType { - RecoveryDeviceType_ScrambledWords = 0, - RecoveryDeviceType_Matrix = 1, +export enum RecoveryDeviceInputMethod { + ScrambledWords = 0, + Matrix = 1, } // RecoveryDevice @@ -2497,11 +2629,17 @@ export type RecoveryDevice = { language?: string; label?: string; enforce_wordlist?: boolean; - type?: RecoveryDeviceType; + input_method?: RecoveryDeviceInputMethod; u2f_counter?: number; - dry_run?: boolean; + type?: RecoveryType; }; +export enum RecoveryType { + NormalRecovery = 0, + DryRun = 1, + UnlockRepeatedBackup = 2, +} + export enum Enum_WordRequestType { WordRequestType_Plain = 0, WordRequestType_Matrix9 = 1, @@ -2541,94 +2679,46 @@ export type PreauthorizedRequest = {}; // CancelAuthorization export type CancelAuthorization = {}; -export enum SeedRequestType { - SeedRequestType_Gen = 0, - SeedRequestType_EncExport = 1, - SeedRequestType_EncImport = 2, +export enum BootCommand { + STOP_AND_WAIT = 0, + INSTALL_UPGRADE = 1, } -// BixinSeedOperate -export type BixinSeedOperate = { - type: SeedRequestType; - seed_importData?: string; -}; - -// BixinMessageSE -export type BixinMessageSE = { - inputmessage: string; -}; - -// BixinOutMessageSE -export type BixinOutMessageSE = { - outmessage?: string; -}; - -// DeviceBackToBoot -export type DeviceBackToBoot = {}; - -// BixinBackupRequest -export type BixinBackupRequest = {}; - -// BixinBackupAck -export type BixinBackupAck = { - data: string; -}; - -// BixinRestoreRequest -export type BixinRestoreRequest = { - data: string; - language?: string; - label?: string; - passphrase_protection?: boolean; -}; - -// BixinRestoreAck -export type BixinRestoreAck = { - data: string; +// RebootToBootloader +export type RebootToBootloader = { + boot_command?: BootCommand; + firmware_header?: string; + language_data_length?: number; }; -// BixinVerifyDeviceRequest -export type BixinVerifyDeviceRequest = { - data: string; -}; +// GetNonce +export type GetNonce = {}; -// BixinVerifyDeviceAck -export type BixinVerifyDeviceAck = { - cert: string; - signature: string; +// Nonce +export type Nonce = { + nonce: string; }; -export enum WL_OperationType { - WL_OperationType_Add = 0, - WL_OperationType_Delete = 1, - WL_OperationType_Inquire = 2, -} - -// BixinWhiteListRequest -export type BixinWhiteListRequest = { - type: WL_OperationType; - addr_in?: string; +// UnlockPath +export type UnlockPath = { + address_n: number[]; + mac?: string; }; -// BixinWhiteListAck -export type BixinWhiteListAck = { - address: string[]; +// UnlockedPathRequest +export type UnlockedPathRequest = { + mac?: string; }; -// BixinLoadDevice -export type BixinLoadDevice = { - mnemonics: string; - language?: string; - label?: string; - skip_checksum?: boolean; -}; +// ShowDeviceTutorial +export type ShowDeviceTutorial = {}; -// BixinBackupDevice -export type BixinBackupDevice = {}; +// UnlockBootloader +export type UnlockBootloader = {}; -// BixinBackupDeviceAck -export type BixinBackupDeviceAck = { - mnemonics: string; +// SetBrightness +export type SetBrightness = { + value?: number; }; // DeviceInfoSettings @@ -2651,6 +2741,11 @@ export type DeviceInfo = { pre_firmware?: string; }; +// WriteSEPrivateKey +export type WriteSEPrivateKey = { + private_key: string; +}; + // ReadSEPublicKey export type ReadSEPublicKey = {}; @@ -2756,12 +2851,6 @@ export type NFTWriteData = { offset: number; }; -// RebootToBootloader -export type RebootToBootloader = {}; - -// RebootToBoardloader -export type RebootToBoardloader = {}; - // ListResDir export type ListResDir = { path: string; @@ -2778,13 +2867,18 @@ export type FileInfoList = { }; // DeviceEraseSector -export type DeviceEraseSector = { - sector: number; -}; +export type DeviceEraseSector = {}; + +export enum MoneroNetworkType { + MAINNET = 0, + TESTNET = 1, + STAGENET = 2, + FAKECHAIN = 3, +} export type MoneroRctKeyPublic = { - dest?: string; - commitment?: string; + dest: string; + commitment: string; }; export type MoneroOutputEntry = { @@ -2842,7 +2936,7 @@ export type MoneroTransactionRsigData = { export type MoneroGetAddress = { address_n: number[]; show_display?: boolean; - network_type?: number; + network_type?: MoneroNetworkType; account?: number; minor?: number; payment_id?: string; @@ -2856,7 +2950,7 @@ export type MoneroAddress = { // MoneroGetWatchKey export type MoneroGetWatchKey = { address_n: number[]; - network_type?: number; + network_type?: MoneroNetworkType; }; // MoneroWatchKey @@ -2887,7 +2981,7 @@ export type MoneroTransactionData = { export type MoneroTransactionInitRequest = { version?: number; address_n: number[]; - network_type?: number; + network_type?: MoneroNetworkType; tsx_data?: MoneroTransactionData; }; @@ -3008,16 +3102,16 @@ export type MoneroTransactionFinalAck = { }; export type MoneroSubAddressIndicesList = { - account?: number; + account: number; minor_indices: number[]; }; // MoneroKeyImageExportInitRequest export type MoneroKeyImageExportInitRequest = { - num?: number; - hash?: string; + num: number; + hash: string; address_n: number[]; - network_type?: number; + network_type?: MoneroNetworkType; subs: MoneroSubAddressIndicesList[]; }; @@ -3025,10 +3119,10 @@ export type MoneroKeyImageExportInitRequest = { export type MoneroKeyImageExportInitAck = {}; export type MoneroTransferDetails = { - out_key?: string; - tx_pub_key?: string; + out_key: string; + tx_pub_key: string; additional_tx_pub_keys: string[]; - internal_output_index?: number; + internal_output_index: number; sub_addr_major?: number; sub_addr_minor?: number; }; @@ -3059,11 +3153,11 @@ export type MoneroKeyImageSyncFinalAck = { // MoneroGetTxKeyRequest export type MoneroGetTxKeyRequest = { address_n: number[]; - network_type?: number; - salt1?: string; - salt2?: string; - tx_enc_keys?: string; - tx_prefix_hash?: string; + network_type?: MoneroNetworkType; + salt1: string; + salt2: string; + tx_enc_keys: string; + tx_prefix_hash: string; reason?: number; view_public_key?: string; }; @@ -3078,7 +3172,7 @@ export type MoneroGetTxKeyAck = { // MoneroLiveRefreshStartRequest export type MoneroLiveRefreshStartRequest = { address_n: number[]; - network_type?: number; + network_type?: MoneroNetworkType; }; // MoneroLiveRefreshStartAck @@ -3086,11 +3180,11 @@ export type MoneroLiveRefreshStartAck = {}; // MoneroLiveRefreshStepRequest export type MoneroLiveRefreshStepRequest = { - out_key?: string; - recv_deriv?: string; - real_out_idx?: number; - sub_addr_major?: number; - sub_addr_minor?: number; + out_key: string; + recv_deriv: string; + real_out_idx: number; + sub_addr_major: number; + sub_addr_minor: number; }; // MoneroLiveRefreshStepAck @@ -3142,31 +3236,31 @@ export type NEMAddress = { export type NEMTransactionCommon = { address_n?: number[]; network?: number; - timestamp?: number; - fee?: UintType; - deadline?: number; + timestamp: number; + fee: UintType; + deadline: number; signer?: string; }; export type NEMMosaic = { - namespace?: string; - mosaic?: string; - quantity?: number; + namespace: string; + mosaic: string; + quantity: number; }; export type NEMTransfer = { - recipient?: string; - amount?: UintType; + recipient: string; + amount: UintType; payload?: string; public_key?: string; mosaics?: NEMMosaic[]; }; export type NEMProvisionNamespace = { - namespace?: string; + namespace: string; parent?: string; - sink?: string; - fee?: UintType; + sink: string; + fee: UintType; }; export enum NEMMosaicLevy { @@ -3177,8 +3271,8 @@ export enum NEMMosaicLevy { export type NEMMosaicDefinition = { name?: string; ticker?: string; - namespace?: string; - mosaic?: string; + namespace: string; + mosaic: string; divisibility?: number; levy?: NEMMosaicLevy; fee?: UintType; @@ -3188,14 +3282,14 @@ export type NEMMosaicDefinition = { supply?: number; mutable_supply?: boolean; transferable?: boolean; - description?: string; + description: string; networks?: number[]; }; export type NEMMosaicCreation = { - definition?: NEMMosaicDefinition; - sink?: string; - fee?: UintType; + definition: NEMMosaicDefinition; + sink: string; + fee: UintType; }; export enum NEMSupplyChangeType { @@ -3204,10 +3298,10 @@ export enum NEMSupplyChangeType { } export type NEMMosaicSupplyChange = { - namespace?: string; - mosaic?: string; - type?: NEMSupplyChangeType; - delta?: number; + namespace: string; + mosaic: string; + type: NEMSupplyChangeType; + delta: number; }; export enum NEMModificationType { @@ -3216,8 +3310,8 @@ export enum NEMModificationType { } export type NEMCosignatoryModification = { - type?: NEMModificationType; - public_key?: string; + type: NEMModificationType; + public_key: string; }; export type NEMAggregateModification = { @@ -3231,13 +3325,13 @@ export enum NEMImportanceTransferMode { } export type NEMImportanceTransfer = { - mode?: NEMImportanceTransferMode; - public_key?: string; + mode: NEMImportanceTransferMode; + public_key: string; }; // NEMSignTx export type NEMSignTx = { - transaction?: NEMTransactionCommon; + transaction: NEMTransactionCommon; multisig?: NEMTransactionCommon; transfer?: NEMTransfer; cosigning?: boolean; @@ -3429,6 +3523,130 @@ export type NostrDecryptedMessage = { msg: string; }; +export enum OneKeyRebootType { + Normal = 0, + Boardloader = 1, + BootLoader = 2, +} + +// OneKeyReboot +export type OneKeyReboot = { + reboot_type: OneKeyRebootType; +}; + +// OneKeyFactoryStatus +export type OneKeyFactoryStatus = { + device_sn_set?: boolean; + se_cert_set?: boolean; +}; + +// OneKeyStatus +export type OneKeyStatus = { + language?: string; + bt_enable?: boolean; + init_states?: boolean; + backup_required?: boolean; + passphrase_protection?: boolean; + lable?: string; +}; + +export enum OneKeyDeviceType { + CLASSIC1 = 0, + CLASSIC1S = 1, + MINI = 2, + TOUCH = 3, + PRO = 5, + CLASSIC1S_PURE = 6, +} + +export enum OneKeySeType { + THD89 = 0, + SE608A = 1, +} + +export enum OneKeySEState { + BOOT = 0, + APP_FACTORY = 51, + APP = 85, +} + +// OneKeyFwImgInfo +export type OneKeyFwImgInfo = { + version?: string; + build_id?: string; + hash?: string; +}; + +// OneKeyHardwareInfo +export type OneKeyHardwareInfo = { + device_type?: OneKeyDeviceType; + serial_no?: string; + hardware_version?: string; + hardware_version_raw_adc?: number; +}; + +// OneKeyMainMcuInfo +export type OneKeyMainMcuInfo = { + board?: OneKeyFwImgInfo; + boot?: OneKeyFwImgInfo; + app?: OneKeyFwImgInfo; +}; + +// OneKeyBluetoothInfo +export type OneKeyBluetoothInfo = { + boot?: OneKeyFwImgInfo; + app?: OneKeyFwImgInfo; + adv_name?: string; + mac?: string; +}; + +// OneKeySEInfo +export type OneKeySEInfo = { + boot?: OneKeyFwImgInfo; + app?: OneKeyFwImgInfo; + type?: OneKeySeType; + state?: OneKeySEState; +}; + +// OneKeyInfoTargets +export type OneKeyInfoTargets = { + hw?: boolean; + fw?: boolean; + bt?: boolean; + se1?: boolean; + se2?: boolean; + se3?: boolean; + se4?: boolean; + status?: boolean; +}; + +// OneKeyInfoTypes +export type OneKeyInfoTypes = { + version?: boolean; + build_id?: boolean; + hash?: boolean; + specific?: boolean; +}; + +// OneKeyInfoReq +export type OneKeyInfoReq = { + targets?: OneKeyInfoTargets; + types?: OneKeyInfoTypes; +}; + +// OneKeyInfoResp +export type OneKeyInfoResp = { + protocol_version: number; + hw?: OneKeyHardwareInfo; + fw?: OneKeyMainMcuInfo; + bt?: OneKeyBluetoothInfo; + se1?: OneKeySEInfo; + se2?: OneKeySEInfo; + se3?: OneKeySEInfo; + se4?: OneKeySEInfo; + status?: OneKeyStatus; +}; + // PolkadotGetAddress export type PolkadotGetAddress = { address_n: number[]; @@ -3475,11 +3693,11 @@ export type RipplePayment = { // RippleSignTx export type RippleSignTx = { address_n: number[]; - fee?: UintType; + fee: UintType; flags?: number; - sequence?: number; + sequence: number; last_ledger_sequence?: number; - payment?: RipplePayment; + payment: RipplePayment; }; // RippleSignedTx @@ -3507,7 +3725,7 @@ export type ScdoSignTx = { gas_limit: string; to: string; value: string; - timestamp?: string; + timestamp: string; data_initial_chunk?: string; data_length?: number; tx_type?: number; @@ -3536,6 +3754,15 @@ export type ScdoSignedMessage = { address?: string; }; +export enum SolanaOffChainMessageVersion { + MESSAGE_VERSION_0 = 0, +} + +export enum SolanaOffChainMessageFormat { + V0_RESTRICTED_ASCII = 0, + V0_LIMITED_UTF8 = 1, +} + // SolanaGetAddress export type SolanaGetAddress = { address_n: number[]; @@ -3544,7 +3771,7 @@ export type SolanaGetAddress = { // SolanaAddress export type SolanaAddress = { - address?: string; + address: string; }; // SolanaSignTx @@ -3555,18 +3782,9 @@ export type SolanaSignTx = { // SolanaSignedTx export type SolanaSignedTx = { - signature?: string; + signature: string; }; -export enum SolanaOffChainMessageVersion { - MESSAGE_VERSION_0 = 0, -} - -export enum SolanaOffChainMessageFormat { - V0_RESTRICTED_ASCII = 0, - V0_LIMITED_UTF8 = 1, -} - // SolanaSignOffChainMessage export type SolanaSignOffChainMessage = { address_n: number[]; @@ -3613,7 +3831,7 @@ export type StarcoinPublicKey = { // StarcoinSignTx export type StarcoinSignTx = { address_n: number[]; - raw_tx?: string; + raw_tx: string; }; // StarcoinSignedTx @@ -3818,6 +4036,12 @@ export type StellarBumpSequenceOp = { bump_to: UintType; }; +// StellarClaimClaimableBalanceOp +export type StellarClaimClaimableBalanceOp = { + source_account?: string; + balance_id: string; +}; + // StellarSignedTx export type StellarSignedTx = { public_key: string; @@ -3915,8 +4139,8 @@ export type TezosRevealOp = { }; export type TezosManagerTransfer = { - destination?: TezosContractID; - amount?: UintType; + destination: TezosContractID; + amount: UintType; }; export type TezosParametersManager = { @@ -3961,8 +4185,8 @@ export type TezosDelegationOp = { }; export type TezosProposalOp = { - source?: string; - period?: number; + source: string; + period: number; proposals: string[]; }; @@ -3973,10 +4197,10 @@ export enum TezosBallotType { } export type TezosBallotOp = { - source?: string; - period?: number; - proposal?: string; - ballot?: TezosBallotType; + source: string; + period: number; + proposal: string; + ballot: TezosBallotType; }; // TezosSignTx @@ -3998,6 +4222,23 @@ export type TezosSignedTx = { operation_hash: string; }; +// ThpCredentialMetadata +export type ThpCredentialMetadata = { + host_name?: string; +}; + +// ThpPairingCredential +export type ThpPairingCredential = { + cred_metadata?: ThpCredentialMetadata; + mac?: string; +}; + +// ThpAuthenticatedCredentialData +export type ThpAuthenticatedCredentialData = { + host_static_pubkey?: string; + cred_metadata?: ThpCredentialMetadata; +}; + export enum TonWalletVersion { V4R2 = 3, } @@ -4047,21 +4288,12 @@ export type TonSignMessage = { ext_ton_amount: UintType[]; ext_payload: string[]; jetton_amount_bytes?: string; - init_data_initial_chunk?: string; - init_data_length?: number; - signing_message_repr?: string; -}; - -// TonTxAck -export type TonTxAck = { - init_data_chunk: string; }; // TonSignedMessage export type TonSignedMessage = { signature?: string; signning_message?: string; - init_data_length?: number; }; // TonSignProof @@ -4153,6 +4385,8 @@ export type TronUnDelegateResourceContract = { receiver_address?: string; }; +export type TronCancelAllUnfreezeV2Contract = {}; + export type Vote = { vote_address: string; vote_count: number; @@ -4163,14 +4397,9 @@ export type TronVoteWitnessContract = { support?: boolean; }; -export type TronCancelAllUnfreezeV2Contract = {}; - export type TronContract = { transfer_contract?: TronTransferContract; - provider?: string; vote_witness_contract?: TronVoteWitnessContract; - contract_name?: string; - permission_id?: number; freeze_balance_contract?: TronFreezeBalanceContract; unfreeze_balance_contract?: TronUnfreezeBalanceContract; withdraw_balance_contract?: TronWithdrawBalanceContract; @@ -4181,6 +4410,9 @@ export type TronContract = { delegate_resource_contract?: TronDelegateResourceContract; undelegate_resource_contract?: TronUnDelegateResourceContract; cancel_all_unfreeze_v2_contract?: TronCancelAllUnfreezeV2Contract; + provider?: string; + contract_name?: string; + permission_id?: number; }; // TronSignTx @@ -4213,14 +4445,6 @@ export type TronMessageSignature = { signature: string; }; -// facotry -export type facotry = {}; - -export enum CommandFlags { - Default = 0, - Factory_Only = 1, -} - // custom connect definitions export type MessageType = { AlephiumGetAddress: AlephiumGetAddress; @@ -4244,6 +4468,10 @@ export type MessageType = { AptosMessagePayload: AptosMessagePayload; AptosSignMessage: AptosSignMessage; AptosMessageSignature: AptosMessageSignature; + BenchmarkListNames: BenchmarkListNames; + BenchmarkNames: BenchmarkNames; + BenchmarkRun: BenchmarkRun; + BenchmarkResult: BenchmarkResult; BenfenGetAddress: BenfenGetAddress; BenfenAddress: BenfenAddress; BenfenSignTx: BenfenSignTx; @@ -4276,6 +4504,7 @@ export type MessageType = { SignMessage: SignMessage; MessageSignature: MessageSignature; VerifyMessage: VerifyMessage; + CoinJoinRequest: CoinJoinRequest; SignTx: SignTx; TxRequestDetailsType: TxRequestDetailsType; TxRequestSerializedType: TxRequestSerializedType; @@ -4286,6 +4515,11 @@ export type MessageType = { PrevTx: PrevTx; PrevInput: PrevInput; PrevOutput: PrevOutput; + TextMemo: TextMemo; + RefundMemo: RefundMemo; + CoinPurchaseMemo: CoinPurchaseMemo; + PaymentRequestMemo: PaymentRequestMemo; + TxAckPaymentRequest: TxAckPaymentRequest; TxAck: TxAck; TxAckInputWrapper: TxAckInputWrapper; TxAckInput: TxAckInput; @@ -4306,12 +4540,29 @@ export type MessageType = { PublicKeyMultiple: PublicKeyMultiple; SignPsbt: SignPsbt; SignedPsbt: SignedPsbt; + BixinPinInputOnDevice: BixinPinInputOnDevice; + ApplySettingsBixin: ApplySettingsBixin; + BixinSeedOperate: BixinSeedOperate; + BixinMessageSE: BixinMessageSE; + BixinOutMessageSE: BixinOutMessageSE; + BixinReboot: BixinReboot; + DeviceBackToBoot: DeviceBackToBoot; + BixinBackupRequest: BixinBackupRequest; + BixinBackupAck: BixinBackupAck; + BixinRestoreRequest: BixinRestoreRequest; + BixinRestoreAck: BixinRestoreAck; + BixinVerifyDeviceRequest: BixinVerifyDeviceRequest; + BixinVerifyDeviceAck: BixinVerifyDeviceAck; + BixinWhiteListRequest: BixinWhiteListRequest; + BixinWhiteListAck: BixinWhiteListAck; + BixinLoadDevice: BixinLoadDevice; + BixinBackupDevice: BixinBackupDevice; + BixinBackupDeviceAck: BixinBackupDeviceAck; FirmwareErase: FirmwareErase; + FirmwareErase_ex: FirmwareErase_ex; FirmwareRequest: FirmwareRequest; FirmwareUpload: FirmwareUpload; SelfTest: SelfTest; - FirmwareErase_ex: FirmwareErase_ex; - Reboot: Reboot; FirmwareUpdateEmmc: FirmwareUpdateEmmc; CardanoBlockchainPointerType: CardanoBlockchainPointerType; CardanoNativeScript: CardanoNativeScript; @@ -4336,8 +4587,8 @@ export type MessageType = { CardanoDRep: CardanoDRep; CardanoTxCertificate: CardanoTxCertificate; CardanoTxWithdrawal: CardanoTxWithdrawal; - CardanoCVoteRegistrationDelegation: CardanoCVoteRegistrationDelegation; - CardanoCVoteRegistrationParametersType: CardanoCVoteRegistrationParametersType; + CardanoGovernanceRegistrationDelegation: CardanoGovernanceRegistrationDelegation; + CardanoGovernanceRegistrationParametersType: CardanoGovernanceRegistrationParametersType; CardanoTxAuxiliaryData: CardanoTxAuxiliaryData; CardanoTxMint: CardanoTxMint; CardanoTxCollateralInput: CardanoTxCollateralInput; @@ -4362,7 +4613,6 @@ export type MessageType = { PassphraseAck: PassphraseAck; Deprecated_PassphraseStateRequest: Deprecated_PassphraseStateRequest; Deprecated_PassphraseStateAck: Deprecated_PassphraseStateAck; - BixinPinInputOnDevice: BixinPinInputOnDevice; ConfluxGetAddress: ConfluxGetAddress; ConfluxAddress: ConfluxAddress; ConfluxSignTx: ConfluxSignTx; @@ -4385,6 +4635,8 @@ export type MessageType = { Path: Path; BatchGetPublickeys: BatchGetPublickeys; EcdsaPublicKeys: EcdsaPublicKeys; + DebugLinkResetDebugEvents: DebugLinkResetDebugEvents; + DebugLinkOptigaSetSecMax: DebugLinkOptigaSetSecMax; DnxGetAddress: DnxGetAddress; DnxAddress: DnxAddress; DnxSignTx: DnxSignTx; @@ -4437,8 +4689,6 @@ export type MessageType = { EthereumTokenInfo: EthereumTokenInfo; EthereumDefinitions: EthereumDefinitions; EthereumSignTypedDataOneKey: EthereumSignTypedDataOneKey; - EthereumGnosisSafeTxRequest: EthereumGnosisSafeTxRequest; - EthereumGnosisSafeTxAck: EthereumGnosisSafeTxAck; EthereumTypedDataStructRequestOneKey: EthereumTypedDataStructRequestOneKey; EthereumStructMemberOneKey: EthereumStructMemberOneKey; EthereumFieldTypeOneKey: EthereumFieldTypeOneKey; @@ -4493,14 +4743,16 @@ export type MessageType = { KaspaSignedTx: KaspaSignedTx; LnurlAuth: LnurlAuth; LnurlAuthResp: LnurlAuthResp; - Initialize: Initialize; GetFeatures: GetFeatures; - OnekeyGetFeatures: OnekeyGetFeatures; Features: Features; - OnekeyFeatures: OnekeyFeatures; LockDevice: LockDevice; + SetBusy: SetBusy; + StartSession: StartSession; EndSession: EndSession; ApplySettings: ApplySettings; + ChangeLanguage: ChangeLanguage; + TranslationDataRequest: TranslationDataRequest; + TranslationDataAck: TranslationDataAck; ApplyFlags: ApplyFlags; ChangePin: ChangePin; ChangeWipeCode: ChangeWipeCode; @@ -4509,8 +4761,13 @@ export type MessageType = { Cancel: Cancel; GetEntropy: GetEntropy; Entropy: Entropy; + GetFirmwareHash: GetFirmwareHash; + FirmwareHash: FirmwareHash; + AuthenticateDevice: AuthenticateDevice; + AuthenticityProof: AuthenticityProof; WipeDevice: WipeDevice; ResetDevice: ResetDevice; + Slip39Group: Slip39Group; BackupDevice: BackupDevice; EntropyRequest: EntropyRequest; EntropyAck: EntropyAck; @@ -4523,24 +4780,18 @@ export type MessageType = { DoPreauthorized: DoPreauthorized; PreauthorizedRequest: PreauthorizedRequest; CancelAuthorization: CancelAuthorization; - BixinSeedOperate: BixinSeedOperate; - BixinMessageSE: BixinMessageSE; - BixinOutMessageSE: BixinOutMessageSE; - DeviceBackToBoot: DeviceBackToBoot; - BixinBackupRequest: BixinBackupRequest; - BixinBackupAck: BixinBackupAck; - BixinRestoreRequest: BixinRestoreRequest; - BixinRestoreAck: BixinRestoreAck; - BixinVerifyDeviceRequest: BixinVerifyDeviceRequest; - BixinVerifyDeviceAck: BixinVerifyDeviceAck; - BixinWhiteListRequest: BixinWhiteListRequest; - BixinWhiteListAck: BixinWhiteListAck; - BixinLoadDevice: BixinLoadDevice; - BixinBackupDevice: BixinBackupDevice; - BixinBackupDeviceAck: BixinBackupDeviceAck; + RebootToBootloader: RebootToBootloader; + GetNonce: GetNonce; + Nonce: Nonce; + UnlockPath: UnlockPath; + UnlockedPathRequest: UnlockedPathRequest; + ShowDeviceTutorial: ShowDeviceTutorial; + UnlockBootloader: UnlockBootloader; + SetBrightness: SetBrightness; DeviceInfoSettings: DeviceInfoSettings; GetDeviceInfo: GetDeviceInfo; DeviceInfo: DeviceInfo; + WriteSEPrivateKey: WriteSEPrivateKey; ReadSEPublicKey: ReadSEPublicKey; SEPublicKey: SEPublicKey; WriteSEPublicCert: WriteSEPublicCert; @@ -4558,8 +4809,6 @@ export type MessageType = { ResourceUpdate: ResourceUpdate; NFTWriteInfo: NFTWriteInfo; NFTWriteData: NFTWriteData; - RebootToBootloader: RebootToBootloader; - RebootToBoardloader: RebootToBoardloader; ListResDir: ListResDir; FileInfo: FileInfo; FileInfoList: FileInfoList; @@ -4658,6 +4907,18 @@ export type MessageType = { NostrEncryptedMessage: NostrEncryptedMessage; NostrDecryptMessage: NostrDecryptMessage; NostrDecryptedMessage: NostrDecryptedMessage; + OneKeyReboot: OneKeyReboot; + OneKeyFactoryStatus: OneKeyFactoryStatus; + OneKeyStatus: OneKeyStatus; + OneKeyFwImgInfo: OneKeyFwImgInfo; + OneKeyHardwareInfo: OneKeyHardwareInfo; + OneKeyMainMcuInfo: OneKeyMainMcuInfo; + OneKeyBluetoothInfo: OneKeyBluetoothInfo; + OneKeySEInfo: OneKeySEInfo; + OneKeyInfoTargets: OneKeyInfoTargets; + OneKeyInfoTypes: OneKeyInfoTypes; + OneKeyInfoReq: OneKeyInfoReq; + OneKeyInfoResp: OneKeyInfoResp; PolkadotGetAddress: PolkadotGetAddress; PolkadotAddress: PolkadotAddress; PolkadotSignTx: PolkadotSignTx; @@ -4708,6 +4969,7 @@ export type MessageType = { StellarAccountMergeOp: StellarAccountMergeOp; StellarManageDataOp: StellarManageDataOp; StellarBumpSequenceOp: StellarBumpSequenceOp; + StellarClaimClaimableBalanceOp: StellarClaimClaimableBalanceOp; StellarSignedTx: StellarSignedTx; SuiGetAddress: SuiGetAddress; SuiAddress: SuiAddress; @@ -4732,10 +4994,12 @@ export type MessageType = { TezosBallotOp: TezosBallotOp; TezosSignTx: TezosSignTx; TezosSignedTx: TezosSignedTx; + ThpCredentialMetadata: ThpCredentialMetadata; + ThpPairingCredential: ThpPairingCredential; + ThpAuthenticatedCredentialData: ThpAuthenticatedCredentialData; TonGetAddress: TonGetAddress; TonAddress: TonAddress; TonSignMessage: TonSignMessage; - TonTxAck: TonTxAck; TonSignedMessage: TonSignedMessage; TonSignProof: TonSignProof; TonSignedProof: TonSignedProof; @@ -4751,15 +5015,14 @@ export type MessageType = { TronWithdrawExpireUnfreezeContract: TronWithdrawExpireUnfreezeContract; TronDelegateResourceContract: TronDelegateResourceContract; TronUnDelegateResourceContract: TronUnDelegateResourceContract; + TronCancelAllUnfreezeV2Contract: TronCancelAllUnfreezeV2Contract; Vote: Vote; TronVoteWitnessContract: TronVoteWitnessContract; - TronCancelAllUnfreezeV2Contract: TronCancelAllUnfreezeV2Contract; TronContract: TronContract; TronSignTx: TronSignTx; TronSignedTx: TronSignedTx; TronSignMessage: TronSignMessage; TronMessageSignature: TronMessageSignature; - facotry: facotry; }; export type MessageKey = keyof MessageType; diff --git a/packages/hd-web-sdk/package.json b/packages/hd-web-sdk/package.json index cb17d4189..8c4bebc3e 100644 --- a/packages/hd-web-sdk/package.json +++ b/packages/hd-web-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-web-sdk", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "author": "OneKey", "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", "license": "ISC", @@ -21,10 +21,10 @@ }, "dependencies": { "@onekeyfe/cross-inpage-provider-core": "^0.0.17", - "@onekeyfe/hd-core": "^1.0.26-alpha.3", - "@onekeyfe/hd-shared": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport-http": "^1.0.26-alpha.3", - "@onekeyfe/hd-transport-webusb": "^1.0.26-alpha.3" + "@onekeyfe/hd-core": "^1.1.0-alpha.0", + "@onekeyfe/hd-shared": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport-http": "^1.1.0-alpha.0", + "@onekeyfe/hd-transport-webusb": "^1.1.0-alpha.0" }, "devDependencies": { "@babel/plugin-proposal-optional-chaining": "^7.17.12", diff --git a/packages/shared/package.json b/packages/shared/package.json index 6ef48c298..46474b5d8 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/hd-shared", - "version": "1.0.26-alpha.3", + "version": "1.1.0-alpha.0", "description": "Hardware SDK's shared tool library", "keywords": [ "Hardware-SDK", @@ -24,5 +24,8 @@ "build": "rimraf dist && rollup -c ../../build/rollup.config.js", "lint": "eslint .", "lint:fix": "eslint . --fix" + }, + "dependencies": { + "@onekeyfe/hd-transport": "^1.1.0-alpha.0" } } diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 5492439e4..a2b5ec822 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -3,4 +3,5 @@ export * from './deferred'; export * from './HardwareError'; export * from './timerUtils'; export * from './deviceType'; +export * from './onekeyInfoUtils'; export * as ERRORS from './HardwareError'; diff --git a/packages/shared/src/onekeyInfoUtils.ts b/packages/shared/src/onekeyInfoUtils.ts new file mode 100644 index 000000000..7322629ba --- /dev/null +++ b/packages/shared/src/onekeyInfoUtils.ts @@ -0,0 +1,195 @@ +import semver from 'semver'; +import { OneKeySeType } from '@onekeyfe/hd-transport'; +import type { Features } from '@onekeyfe/hd-transport'; +import { EDeviceType } from './deviceType'; + +export interface IHardwareInfo { + deviceType: EDeviceType; + hardwareVersion: string; + hardwareVersionRawAdc: string; + serialNumber: string; + label: string; + init_state: string; + language: string; + passphrase_protection: boolean; +} + +export interface IFirmwareInfo { + firmwareBuildId: string; + firmwareHash: string; + firmwareVersion: string; + + bootloaderBuildId: string; + bootloaderHash: string; + bootloaderVersion: string; + + boardloaderVersion: string; + boardloaderBuildId: string; + boardloaderHash: string; + + bleName: string; + bleBuildId: string; + bleHash: string; + bleVersion: string; + bleMac: string; +} + +export interface ISeInfo { + se01BuildId: string; + se01Version: string; + se01Hash: string; + se01State: string; + se01BootVersion: string; + se01BootHash: string; + se01BootBuildId: string; + se02BuildId: string; + se02Version: string; + se02Hash: string; + se02State: string; + se02BootVersion: string; + se02BootHash: string; + se02BootBuildId: string; + se03BuildId: string; + se03Version: string; + se03Hash: string; + se03State: string; + se03BootVersion: string; + se03BootHash: string; + se03BootBuildId: string; + se04BuildId: string; + se04Version: string; + se04Hash: string; + se04State: string; + se04BootVersion: string; + se04BootHash: string; + se04BootBuildId: string; + seType: OneKeySeType; + se01Type: OneKeySeType; + se02Type: OneKeySeType; + se03Type: OneKeySeType; + se04Type: OneKeySeType; +} + +export const getFirmwareInfoFromFeatures = (features: Features | undefined): IFirmwareInfo => { + const { ok_dev_info_resp: newInfo } = features || {}; + const oldFeatures = features as any; + + // Helper function to get bootloader version from old format + const getOldBootloaderVersion = () => { + // classic1s 3.5.0 pro 4.6.0 + if (semver.valid(oldFeatures?.onekey_boot_version)) { + return oldFeatures?.onekey_boot_version.split('.'); + } + + if (!oldFeatures?.bootloader_version) { + if (oldFeatures?.bootloader_mode) { + return [ + oldFeatures?.major_version ?? 0, + oldFeatures?.minor_version ?? 0, + oldFeatures?.patch_version ?? 0, + ]; + } + return [0, 0, 0]; + } + + if (semver.valid(oldFeatures?.bootloader_version)) { + return oldFeatures?.bootloader_version?.split('.'); + } + + return [0, 0, 0]; + }; + + return { + // Firmware + firmwareBuildId: newInfo?.fw?.app?.build_id || oldFeatures?.onekey_firmware_build_id, + firmwareHash: newInfo?.fw?.app?.hash || oldFeatures?.onekey_firmware_hash, + firmwareVersion: + newInfo?.fw?.app?.version || + oldFeatures?.onekey_firmware_version || + oldFeatures?.onekey_version, + + // Bootloader + bootloaderBuildId: newInfo?.fw?.boot?.build_id || oldFeatures?.onekey_boot_build_id, + bootloaderHash: newInfo?.fw?.boot?.hash || oldFeatures?.onekey_boot_hash, + bootloaderVersion: newInfo?.fw?.boot?.version || getOldBootloaderVersion().join('.'), + + // Boardloader + boardloaderBuildId: newInfo?.fw?.board?.build_id || oldFeatures?.onekey_board_build_id, + boardloaderHash: newInfo?.fw?.board?.hash || oldFeatures?.onekey_board_hash, + boardloaderVersion: newInfo?.fw?.board?.version || oldFeatures?.onekey_board_version, + + // BLE + bleName: newInfo?.bt?.adv_name || oldFeatures?.onekey_ble_name, + bleBuildId: newInfo?.bt?.app?.build_id || oldFeatures?.onekey_ble_build_id, + bleHash: newInfo?.bt?.app?.hash || oldFeatures?.onekey_ble_hash, + bleVersion: + newInfo?.bt?.app?.version || oldFeatures?.onekey_ble_version || oldFeatures?.ble_ver, + bleMac: newInfo?.bt?.mac || '', + }; +}; + +export const getHardwareInfoFromFeatures = (features: Features | undefined): IHardwareInfo => { + const { ok_dev_info_resp: newInfo } = features || {}; + const oldFeatures = features as any; + + return { + deviceType: ( + newInfo?.hw?.device_type || + oldFeatures?.onekey_device_type || + EDeviceType.Unknown + ).toLowerCase(), + hardwareVersion: newInfo?.hw?.hardware_version || '', + hardwareVersionRawAdc: + newInfo?.hw?.hardware_version_raw_adc || oldFeatures?.onekey_version_raw_adc, + serialNumber: + newInfo?.hw?.serial_no || + oldFeatures?.onekey_serial_no || + oldFeatures?.onekey_serial || + oldFeatures?.serial_no, + label: newInfo?.status?.lable || oldFeatures?.label, + init_state: newInfo?.status?.init_states || oldFeatures?.init_state, + language: newInfo?.status?.language || oldFeatures?.language, + passphrase_protection: + newInfo?.status?.passphrase_protection || oldFeatures?.passphrase_protection || false, + }; +}; + +export const getSeInfoFromFeatures = (features: Features | undefined): ISeInfo => { + const { ok_dev_info_resp: newInfo } = features || {}; + const oldFeatures = features as any; + + const getSingleSeInfo = (seNum: number) => { + const seInfo = { + 1: newInfo?.se1, + 2: newInfo?.se2, + 3: newInfo?.se3, + 4: newInfo?.se4, + }[seNum]; + + const prefix = `se0${seNum}`; + const oldPrefix = `onekey_se0${seNum}`; + + return { + [`${prefix}BuildId`]: seInfo?.app?.build_id || oldFeatures?.[`${oldPrefix}_build_id`], + [`${prefix}Version`]: seInfo?.app?.version || oldFeatures?.[`${oldPrefix}_version`], + [`${prefix}Hash`]: seInfo?.app?.hash || oldFeatures?.[`${oldPrefix}_hash`], + [`${prefix}State`]: seInfo?.state || oldFeatures?.[`${oldPrefix}_state`], + [`${prefix}BootVersion`]: seInfo?.boot?.version || oldFeatures?.[`${oldPrefix}_boot_version`], + [`${prefix}BootHash`]: seInfo?.boot?.hash || oldFeatures?.[`${oldPrefix}_boot_hash`], + [`${prefix}BootBuildId`]: + seInfo?.boot?.build_id || oldFeatures?.[`${oldPrefix}_boot_build_id`], + [`${prefix}Type`]: seInfo?.type, + }; + }; + + // 合并所有SE信息 + const result = { + ...getSingleSeInfo(1), + ...getSingleSeInfo(2), + ...getSingleSeInfo(3), + ...getSingleSeInfo(4), + seType: newInfo?.se1?.type || oldFeatures?.onekey_se_type, + }; + + return result as ISeInfo; +}; diff --git a/submodules/firmware b/submodules/firmware deleted file mode 160000 index 6b261a2e5..000000000 --- a/submodules/firmware +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6b261a2e5b2bcf1cac29fd236a778bb925d86520 diff --git a/submodules/onekey-protocol b/submodules/onekey-protocol new file mode 160000 index 000000000..8f7a537fc --- /dev/null +++ b/submodules/onekey-protocol @@ -0,0 +1 @@ +Subproject commit 8f7a537fc0950866d43da08d4fca76f4635ccdd3