@onekeyfe/hd-core 0.2.39 → 0.2.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/BaseMethod.d.ts +2 -1
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/CheckBLEFirmwareRelease.d.ts.map +1 -1
- package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
- package/dist/api/CheckBridgeStatus.d.ts.map +1 -1
- package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
- package/dist/api/CheckTransportRelease.d.ts.map +1 -1
- package/dist/api/FirmwareUpdate.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/GetFeatures.d.ts.map +1 -1
- package/dist/api/GetLogs.d.ts.map +1 -1
- package/dist/api/RequestWebUsbDevice.d.ts.map +1 -1
- package/dist/api/SearchDevices.d.ts.map +1 -1
- package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
- package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceUpdateReboot.d.ts.map +1 -1
- package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +2 -0
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/data-manager/connectSettings.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +138 -85
- package/dist/types/params.d.ts +1 -0
- package/dist/types/params.d.ts.map +1 -1
- package/dist/types/settings.d.ts +1 -0
- package/dist/types/settings.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +9 -3
- package/src/api/CheckBLEFirmwareRelease.ts +2 -1
- package/src/api/CheckBootloaderRelease.ts +2 -1
- package/src/api/CheckBridgeStatus.ts +1 -0
- package/src/api/CheckFirmwareRelease.ts +1 -0
- package/src/api/CheckTransportRelease.ts +1 -0
- package/src/api/CipherKeyValue.ts +1 -1
- package/src/api/FirmwareUpdate.ts +2 -1
- package/src/api/FirmwareUpdateV2.ts +2 -1
- package/src/api/GetFeatures.ts +6 -1
- package/src/api/GetLogs.ts +1 -0
- package/src/api/GetPassphraseState.ts +1 -1
- package/src/api/RequestWebUsbDevice.ts +1 -0
- package/src/api/SearchDevices.ts +1 -0
- package/src/api/algo/AlgoGetAddress.ts +1 -1
- package/src/api/algo/AlgoSignTransaction.ts +1 -1
- package/src/api/aptos/AptosGetAddress.ts +1 -1
- package/src/api/aptos/AptosGetPublicKey.ts +1 -1
- package/src/api/aptos/AptosSignMessage.ts +1 -1
- package/src/api/aptos/AptosSignTransaction.ts +1 -1
- package/src/api/btc/BTCGetAddress.ts +1 -1
- package/src/api/btc/BTCGetPublicKey.ts +1 -1
- package/src/api/btc/BTCSignMessage.ts +1 -1
- package/src/api/btc/BTCSignTransaction.ts +1 -1
- package/src/api/btc/BTCVerifyMessage.ts +1 -1
- package/src/api/cardano/CardanoGetAddress.ts +1 -1
- package/src/api/cardano/CardanoGetPublicKey.ts +1 -1
- package/src/api/cardano/CardanoSignMessage.ts +1 -1
- package/src/api/cardano/CardanoSignTransaction.ts +1 -1
- package/src/api/conflux/ConfluxGetAddress.ts +1 -1
- package/src/api/conflux/ConfluxSignMessage.ts +1 -1
- package/src/api/conflux/ConfluxSignMessageCIP23.ts +1 -1
- package/src/api/conflux/ConfluxSignTransaction.ts +1 -1
- package/src/api/cosmos/CosmosGetAddress.ts +1 -1
- package/src/api/cosmos/CosmosGetPublicKey.ts +1 -1
- package/src/api/cosmos/CosmosSignTransaction.ts +1 -1
- package/src/api/device/DeviceFullyUploadResource.ts +2 -1
- package/src/api/device/DeviceRebootToBoardloader.ts +1 -0
- package/src/api/device/DeviceRebootToBootloader.ts +1 -0
- package/src/api/device/DeviceSupportFeatures.ts +1 -0
- package/src/api/device/DeviceUpdateBootloader.ts +2 -1
- package/src/api/device/DeviceUpdateReboot.ts +1 -0
- package/src/api/device/DeviceUploadResource.ts +1 -0
- package/src/api/evm/EVMGetAddress.ts +1 -1
- package/src/api/evm/EVMGetPublicKey.ts +1 -1
- package/src/api/evm/EVMSignMessage.ts +1 -1
- package/src/api/evm/EVMSignMessageEIP712.ts +1 -1
- package/src/api/evm/EVMSignTransaction.ts +1 -1
- package/src/api/evm/EVMSignTypedData.ts +1 -1
- package/src/api/evm/EVMVerifyMessage.ts +1 -1
- package/src/api/filecoin/FilecoinGetAddress.ts +1 -1
- package/src/api/filecoin/FilecoinSignTransaction.ts +1 -1
- package/src/api/near/NearGetAddress.ts +1 -1
- package/src/api/near/NearSignTransaction.ts +1 -1
- package/src/api/nem/NEMGetAddress.ts +1 -1
- package/src/api/nem/NEMSignTransaction.ts +1 -1
- package/src/api/polkadot/PolkadotGetAddress.ts +1 -1
- package/src/api/polkadot/PolkadotSignTransaction.ts +1 -1
- package/src/api/solana/SolGetAddress.ts +1 -1
- package/src/api/solana/SolSignTransaction.ts +1 -1
- package/src/api/starcoin/StarcoinGetAddress.ts +1 -1
- package/src/api/starcoin/StarcoinGetPublicKey.ts +1 -1
- package/src/api/starcoin/StarcoinSignMessage.ts +1 -1
- package/src/api/starcoin/StarcoinSignTransaction.ts +1 -1
- package/src/api/starcoin/StarcoinVerifyMessage.ts +1 -1
- package/src/api/stellar/StellarGetAddress.ts +1 -1
- package/src/api/stellar/StellarSignTransaction.ts +1 -1
- package/src/api/sui/SuiGetAddress.ts +1 -1
- package/src/api/sui/SuiGetPublicKey.ts +1 -1
- package/src/api/sui/SuiSignTransaction.ts +1 -1
- package/src/api/tron/TronGetAddress.ts +1 -1
- package/src/api/tron/TronSignMessage.ts +1 -1
- package/src/api/tron/TronSignTransaction.ts +1 -1
- package/src/api/xrp/XrpGetAddress.ts +1 -1
- package/src/api/xrp/XrpSignTransaction.ts +1 -1
- package/src/core/index.ts +42 -27
- package/src/data-manager/DataManager.ts +15 -1
- package/src/data-manager/connectSettings.ts +4 -0
- package/src/device/DeviceCommands.ts +3 -0
- package/src/types/params.ts +5 -0
- package/src/types/settings.ts +1 -0
package/dist/types/params.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/types/params.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IAItB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAI1B,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,eAAe,CAAC,EAAE,MAAM,CAAC;IAIzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAI7B,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/types/params.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IAItB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAI1B,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,eAAe,CAAC,EAAE,MAAM,CAAC;IAIzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAI7B,WAAW,CAAC,EAAE,OAAO,CAAC;IAKtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,oBAAY,MAAM,CAAC,CAAC,IAAI,YAAY,GAAG,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACpD;AAED,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,oBAAY,QAAQ,CAAC,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC"}
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare type ConnectSettings = {
|
|
|
15
15
|
env: 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb';
|
|
16
16
|
timestamp: number;
|
|
17
17
|
isFrame?: boolean;
|
|
18
|
+
preRelease?: boolean;
|
|
18
19
|
};
|
|
19
20
|
export declare type IVersionArray = [number, number, number];
|
|
20
21
|
export declare type ILocale = 'zh-CN' | 'en-US';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/types/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,oBAAY,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,GAAG,EAAE,MAAM,GAAG,KAAK,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc,GAAG,QAAQ,CAA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.
|
|
3
|
+
"version": "0.2.41",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@onekeyfe/hd-shared": "^0.2.
|
|
28
|
-
"@onekeyfe/hd-transport": "^0.2.
|
|
27
|
+
"@onekeyfe/hd-shared": "^0.2.41",
|
|
28
|
+
"@onekeyfe/hd-transport": "^0.2.41",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"bignumber.js": "^9.0.2",
|
|
31
31
|
"bytebuffer": "^5.0.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@types/semver": "^7.3.9",
|
|
44
44
|
"ripple-keypairs": "^1.1.4"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "9ca2163be245dda2432f1c6c44a30fb612b7e1d5"
|
|
47
47
|
}
|
package/src/api/BaseMethod.ts
CHANGED
|
@@ -55,9 +55,9 @@ export abstract class BaseMethod<Params = undefined> {
|
|
|
55
55
|
useDevice: boolean;
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* 不允许的设备模式。如果当前设备模式在该数组中,则抛出异常。
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
notAllowDeviceMode: string[];
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* 依赖的设备模式
|
|
@@ -79,6 +79,12 @@ export abstract class BaseMethod<Params = undefined> {
|
|
|
79
79
|
*/
|
|
80
80
|
useDevicePassphraseState = true;
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* skip force update check
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
skipForceUpdateCheck = false;
|
|
87
|
+
|
|
82
88
|
// @ts-expect-error: strictPropertyInitialization
|
|
83
89
|
postMessage: (message: CoreMessage) => void;
|
|
84
90
|
|
|
@@ -90,7 +96,7 @@ export abstract class BaseMethod<Params = undefined> {
|
|
|
90
96
|
this.connectId = payload.connectId || '';
|
|
91
97
|
this.deviceId = payload.deviceId || '';
|
|
92
98
|
this.useDevice = true;
|
|
93
|
-
this.
|
|
99
|
+
this.notAllowDeviceMode = [UI_REQUEST.INITIALIZE];
|
|
94
100
|
this.requireDeviceMode = [];
|
|
95
101
|
}
|
|
96
102
|
|
|
@@ -5,9 +5,10 @@ import { getBleFirmwareReleaseInfo } from './firmware/releaseHelper';
|
|
|
5
5
|
|
|
6
6
|
export default class CheckBLEFirmwareRelease extends BaseMethod {
|
|
7
7
|
init() {
|
|
8
|
-
this.
|
|
8
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
9
9
|
this.checkDeviceId = true;
|
|
10
10
|
this.useDevicePassphraseState = false;
|
|
11
|
+
this.skipForceUpdateCheck = true;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
run() {
|
|
@@ -6,9 +6,10 @@ import { DataManager } from '../data-manager';
|
|
|
6
6
|
|
|
7
7
|
export default class CheckBootloaderRelease extends BaseMethod {
|
|
8
8
|
init() {
|
|
9
|
-
this.
|
|
9
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
10
10
|
this.checkDeviceId = true;
|
|
11
11
|
this.useDevicePassphraseState = false;
|
|
12
|
+
this.skipForceUpdateCheck = true;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
async run() {
|
|
@@ -11,7 +11,7 @@ export default class CipherKeyValue extends BaseMethod<HardwareCipherKeyValue[]>
|
|
|
11
11
|
|
|
12
12
|
init() {
|
|
13
13
|
this.checkDeviceId = true;
|
|
14
|
-
this.
|
|
14
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15
15
|
|
|
16
16
|
this.hasBundle = !!this.payload?.bundle;
|
|
17
17
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -13,9 +13,10 @@ type Params = {
|
|
|
13
13
|
|
|
14
14
|
export default class FirmwareUpdate extends BaseMethod<Params> {
|
|
15
15
|
init() {
|
|
16
|
-
this.
|
|
16
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
17
17
|
this.requireDeviceMode = [UI_REQUEST.BOOTLOADER];
|
|
18
18
|
this.useDevicePassphraseState = false;
|
|
19
|
+
this.skipForceUpdateCheck = true;
|
|
19
20
|
|
|
20
21
|
const { payload } = this;
|
|
21
22
|
|
|
@@ -31,9 +31,10 @@ export default class FirmwareUpdateV2 extends BaseMethod<Params> {
|
|
|
31
31
|
checkPromise: Deferred<any> | null = null;
|
|
32
32
|
|
|
33
33
|
init() {
|
|
34
|
-
this.
|
|
34
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
35
35
|
this.requireDeviceMode = [];
|
|
36
36
|
this.useDevicePassphraseState = false;
|
|
37
|
+
this.skipForceUpdateCheck = true;
|
|
37
38
|
|
|
38
39
|
const { payload } = this;
|
|
39
40
|
|
package/src/api/GetFeatures.ts
CHANGED
|
@@ -3,8 +3,13 @@ import { BaseMethod } from './BaseMethod';
|
|
|
3
3
|
|
|
4
4
|
export default class GetFeatures extends BaseMethod {
|
|
5
5
|
init() {
|
|
6
|
-
this.
|
|
6
|
+
this.notAllowDeviceMode = [
|
|
7
|
+
...this.notAllowDeviceMode,
|
|
8
|
+
UI_REQUEST.INITIALIZE,
|
|
9
|
+
UI_REQUEST.BOOTLOADER,
|
|
10
|
+
];
|
|
7
11
|
this.useDevicePassphraseState = false;
|
|
12
|
+
this.skipForceUpdateCheck = true;
|
|
8
13
|
}
|
|
9
14
|
|
|
10
15
|
run() {
|
package/src/api/GetLogs.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { BaseMethod } from './BaseMethod';
|
|
|
5
5
|
|
|
6
6
|
export default class GetPassphraseState extends BaseMethod {
|
|
7
7
|
init() {
|
|
8
|
-
this.
|
|
8
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
9
9
|
this.useDevicePassphraseState = false;
|
|
10
10
|
}
|
|
11
11
|
|
package/src/api/SearchDevices.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class AlgoGetAddress extends BaseMethod<HardwareAlgoGetAddress[]>
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.checkDeviceId = true;
|
|
13
|
-
this.
|
|
13
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
14
14
|
|
|
15
15
|
this.hasBundle = !!this.payload?.bundle;
|
|
16
16
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -10,7 +10,7 @@ export default class AlgoSignTransaction extends BaseMethod<HardwareAlgorandSign
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.checkDeviceId = true;
|
|
13
|
-
this.
|
|
13
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
14
14
|
|
|
15
15
|
// check payload
|
|
16
16
|
validateParams(this.payload, [
|
|
@@ -15,7 +15,7 @@ export default class AptosGetAddress extends BaseMethod<HardwareAptosGetAddress[
|
|
|
15
15
|
|
|
16
16
|
init() {
|
|
17
17
|
this.checkDeviceId = true;
|
|
18
|
-
this.
|
|
18
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
19
19
|
|
|
20
20
|
this.hasBundle = !!this.payload?.bundle;
|
|
21
21
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -9,7 +9,7 @@ export default class AptosGetPublicKey extends BaseMethod<any> {
|
|
|
9
9
|
|
|
10
10
|
init() {
|
|
11
11
|
this.checkDeviceId = true;
|
|
12
|
-
this.
|
|
12
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
13
13
|
|
|
14
14
|
this.hasBundle = !!this.payload?.bundle;
|
|
15
15
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -8,7 +8,7 @@ import { AptosMessageSignature, AptosSignMessageParams } from '../../types';
|
|
|
8
8
|
export default class AptosSignMessage extends BaseMethod<HardwareAptosSignMessage> {
|
|
9
9
|
init() {
|
|
10
10
|
this.checkDeviceId = true;
|
|
11
|
-
this.
|
|
11
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
12
12
|
|
|
13
13
|
// check payload
|
|
14
14
|
validateParams(this.payload, [
|
|
@@ -8,7 +8,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
|
|
|
8
8
|
export default class AptosSignTransaction extends BaseMethod<HardwareAptosSignTx> {
|
|
9
9
|
init() {
|
|
10
10
|
this.checkDeviceId = true;
|
|
11
|
-
this.
|
|
11
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
12
12
|
|
|
13
13
|
// check payload
|
|
14
14
|
validateParams(this.payload, [
|
|
@@ -11,7 +11,7 @@ export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
|
|
|
11
11
|
|
|
12
12
|
init() {
|
|
13
13
|
this.checkDeviceId = true;
|
|
14
|
-
this.
|
|
14
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15
15
|
|
|
16
16
|
this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
|
|
17
17
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -12,7 +12,7 @@ export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
|
|
|
12
12
|
|
|
13
13
|
init() {
|
|
14
14
|
this.checkDeviceId = true;
|
|
15
|
-
this.
|
|
15
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16
16
|
|
|
17
17
|
this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
|
|
18
18
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -9,7 +9,7 @@ import { getCoinAndScriptType } from './helpers/btcParamsUtils';
|
|
|
9
9
|
export default class BTCSignMessage extends BaseMethod<SignMessage> {
|
|
10
10
|
init() {
|
|
11
11
|
this.checkDeviceId = true;
|
|
12
|
-
this.
|
|
12
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
13
13
|
|
|
14
14
|
validateParams(this.payload, [
|
|
15
15
|
{ name: 'path', required: true },
|
|
@@ -26,7 +26,7 @@ type Params = {
|
|
|
26
26
|
export default class BTCSignTransaction extends BaseMethod<Params> {
|
|
27
27
|
init() {
|
|
28
28
|
this.checkDeviceId = true;
|
|
29
|
-
this.
|
|
29
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
30
30
|
|
|
31
31
|
validateParams(this.payload, [
|
|
32
32
|
{ name: 'coin', type: 'string', required: true },
|
|
@@ -9,7 +9,7 @@ import { getCoinInfo } from './helpers/btcParamsUtils';
|
|
|
9
9
|
export default class BTCVerifyMessage extends BaseMethod<VerifyMessage> {
|
|
10
10
|
init() {
|
|
11
11
|
this.checkDeviceId = true;
|
|
12
|
-
this.
|
|
12
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
13
13
|
|
|
14
14
|
validateParams(this.payload, [
|
|
15
15
|
{ name: 'address', type: 'string', required: true },
|
|
@@ -17,7 +17,7 @@ export default class CardanoGetAddress extends BaseMethod<CardanoGetAddressParam
|
|
|
17
17
|
|
|
18
18
|
init() {
|
|
19
19
|
this.checkDeviceId = true;
|
|
20
|
-
this.
|
|
20
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
21
21
|
|
|
22
22
|
this.hasBundle = !!this.payload?.bundle;
|
|
23
23
|
this.isCheck = !!this.payload?.isCheck;
|
|
@@ -10,7 +10,7 @@ export default class CardanoGetPublicKey extends BaseMethod<CardanoPublicKeyPara
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.checkDeviceId = true;
|
|
13
|
-
this.
|
|
13
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14
14
|
|
|
15
15
|
this.hasBundle = !!this.payload?.bundle;
|
|
16
16
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -12,7 +12,7 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
|
|
|
12
12
|
|
|
13
13
|
init() {
|
|
14
14
|
this.checkDeviceId = true;
|
|
15
|
-
this.
|
|
15
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16
16
|
|
|
17
17
|
const { payload } = this;
|
|
18
18
|
validateParams(payload, [
|
|
@@ -42,7 +42,7 @@ export default class CardanoSignTransaction extends BaseMethod<any> {
|
|
|
42
42
|
|
|
43
43
|
init() {
|
|
44
44
|
this.checkDeviceId = true;
|
|
45
|
-
this.
|
|
45
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
46
46
|
|
|
47
47
|
this.hasBundle = !!this.payload?.bundle;
|
|
48
48
|
|
|
@@ -9,7 +9,7 @@ export default class ConfluxGetAddress extends BaseMethod<HardwareConfluxGetAddr
|
|
|
9
9
|
hasBundle = false;
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
|
-
this.
|
|
12
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
13
13
|
|
|
14
14
|
this.hasBundle = !!this.payload?.bundle;
|
|
15
15
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -7,7 +7,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
|
|
|
7
7
|
|
|
8
8
|
export default class ConfluxSignMessage extends BaseMethod<HardwareConfluxSignMessage> {
|
|
9
9
|
init() {
|
|
10
|
-
this.
|
|
10
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
11
11
|
|
|
12
12
|
// check payload
|
|
13
13
|
validateParams(this.payload, [
|
|
@@ -7,7 +7,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
|
|
|
7
7
|
|
|
8
8
|
export default class ConfluxSignMessageCIP23 extends BaseMethod<HardwareConfluxSignMessageCIP23> {
|
|
9
9
|
init() {
|
|
10
|
-
this.
|
|
10
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
11
11
|
|
|
12
12
|
validateParams(this.payload, [
|
|
13
13
|
{ name: 'path', required: true },
|
|
@@ -20,7 +20,7 @@ export default class ConfluxSignTransaction extends BaseMethod {
|
|
|
20
20
|
formattedTx: ConfluxTransaction | undefined;
|
|
21
21
|
|
|
22
22
|
init() {
|
|
23
|
-
this.
|
|
23
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
24
24
|
|
|
25
25
|
validateParams(this.payload, [
|
|
26
26
|
{ name: 'path', required: true },
|
|
@@ -10,7 +10,7 @@ export default class CosmosGetAddress extends BaseMethod<HardwareCosmosGetAddres
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.checkDeviceId = true;
|
|
13
|
-
this.
|
|
13
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
14
14
|
|
|
15
15
|
this.hasBundle = !!this.payload?.bundle;
|
|
16
16
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -9,7 +9,7 @@ export default class CosmosGetPublicKey extends BaseMethod<any> {
|
|
|
9
9
|
|
|
10
10
|
init() {
|
|
11
11
|
this.checkDeviceId = true;
|
|
12
|
-
this.
|
|
12
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
13
13
|
|
|
14
14
|
this.hasBundle = !!this.payload?.bundle;
|
|
15
15
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -10,7 +10,7 @@ export default class CosmosSignTransaction extends BaseMethod<HardwareCosmosSign
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.checkDeviceId = true;
|
|
13
|
-
this.
|
|
13
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
14
14
|
|
|
15
15
|
// check payload
|
|
16
16
|
validateParams(this.payload, [
|
|
@@ -14,9 +14,10 @@ export default class DeviceFullyUploadResource extends BaseMethod {
|
|
|
14
14
|
checkPromise: Deferred<any> | null = null;
|
|
15
15
|
|
|
16
16
|
init() {
|
|
17
|
-
this.
|
|
17
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
18
18
|
this.requireDeviceMode = [];
|
|
19
19
|
this.useDevicePassphraseState = false;
|
|
20
|
+
this.skipForceUpdateCheck = true;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
postTipMessage = (message: string) => {
|
|
@@ -5,6 +5,7 @@ import type { RebootToBoardloaderParams } from '../../types/api/deviceRebootToBo
|
|
|
5
5
|
export default class DeviceRebootToBoardloader extends BaseMethod<RebootToBoardloaderParams> {
|
|
6
6
|
init() {
|
|
7
7
|
this.useDevicePassphraseState = false;
|
|
8
|
+
this.skipForceUpdateCheck = true;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
getVersionRange() {
|
|
@@ -12,9 +12,10 @@ export default class DeviceUpdateBootloader extends BaseMethod {
|
|
|
12
12
|
checkPromise: Deferred<any> | null = null;
|
|
13
13
|
|
|
14
14
|
init() {
|
|
15
|
-
this.
|
|
15
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
16
16
|
this.requireDeviceMode = [];
|
|
17
17
|
this.useDevicePassphraseState = false;
|
|
18
|
+
this.skipForceUpdateCheck = true;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
postTipMessage = (message: string) => {
|
|
@@ -10,7 +10,7 @@ export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.checkDeviceId = true;
|
|
13
|
-
this.
|
|
13
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14
14
|
|
|
15
15
|
this.hasBundle = !!this.payload?.bundle;
|
|
16
16
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -13,7 +13,7 @@ export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]>
|
|
|
13
13
|
|
|
14
14
|
init() {
|
|
15
15
|
this.checkDeviceId = true;
|
|
16
|
-
this.
|
|
16
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17
17
|
|
|
18
18
|
this.hasBundle = !!this.payload?.bundle;
|
|
19
19
|
this.useBatch = !!this.payload?.useBatch;
|
|
@@ -8,7 +8,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
|
|
|
8
8
|
export default class EVMSignMessage extends BaseMethod<EthereumSignMessage> {
|
|
9
9
|
init() {
|
|
10
10
|
this.checkDeviceId = true;
|
|
11
|
-
this.
|
|
11
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
12
12
|
|
|
13
13
|
// check payload
|
|
14
14
|
validateParams(this.payload, [
|
|
@@ -8,7 +8,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
|
|
|
8
8
|
export default class EVMSignMessageEIP712 extends BaseMethod<EthereumSignMessageEIP712> {
|
|
9
9
|
init() {
|
|
10
10
|
this.checkDeviceId = true;
|
|
11
|
-
this.
|
|
11
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
12
12
|
|
|
13
13
|
validateParams(this.payload, [
|
|
14
14
|
{ name: 'path', required: true },
|
|
@@ -23,7 +23,7 @@ export default class EVMSignTransaction extends BaseMethod {
|
|
|
23
23
|
|
|
24
24
|
init() {
|
|
25
25
|
this.checkDeviceId = true;
|
|
26
|
-
this.
|
|
26
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
27
27
|
|
|
28
28
|
validateParams(this.payload, [
|
|
29
29
|
{ name: 'path', required: true },
|
|
@@ -28,7 +28,7 @@ export type EVMSignTypedDataParams = {
|
|
|
28
28
|
export default class EVMSignTypedData extends BaseMethod<EVMSignTypedDataParams> {
|
|
29
29
|
init() {
|
|
30
30
|
this.checkDeviceId = true;
|
|
31
|
-
this.
|
|
31
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
32
32
|
|
|
33
33
|
validateParams(this.payload, [
|
|
34
34
|
{ name: 'path', required: true },
|
|
@@ -7,7 +7,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
|
|
|
7
7
|
export default class EVMSignMessage extends BaseMethod<EthereumVerifyMessage> {
|
|
8
8
|
init() {
|
|
9
9
|
this.checkDeviceId = true;
|
|
10
|
-
this.
|
|
10
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
11
11
|
|
|
12
12
|
validateParams(this.payload, [
|
|
13
13
|
{ name: 'address', type: 'string', required: true },
|
|
@@ -10,7 +10,7 @@ export default class FilecoinGetAddress extends BaseMethod<HardwareFilecoinGetAd
|
|
|
10
10
|
|
|
11
11
|
init() {
|
|
12
12
|
this.checkDeviceId = true;
|
|
13
|
-
this.
|
|
13
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14
14
|
|
|
15
15
|
this.hasBundle = !!this.payload?.bundle;
|
|
16
16
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|