@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/index.js
CHANGED
|
@@ -10835,6 +10835,9 @@ const parseConnectSettings = (input = {}) => {
|
|
|
10835
10835
|
if (input.timestamp) {
|
|
10836
10836
|
settings.timestamp = input.timestamp;
|
|
10837
10837
|
}
|
|
10838
|
+
if (input.preRelease) {
|
|
10839
|
+
settings.preRelease = input.preRelease;
|
|
10840
|
+
}
|
|
10838
10841
|
return settings;
|
|
10839
10842
|
};
|
|
10840
10843
|
|
|
@@ -11289,7 +11292,10 @@ class DataManager {
|
|
|
11289
11292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11290
11293
|
this.settings = settings;
|
|
11291
11294
|
try {
|
|
11292
|
-
const
|
|
11295
|
+
const url = settings.preRelease
|
|
11296
|
+
? 'https://data.onekey.so/pre-config.json'
|
|
11297
|
+
: 'https://data.onekey.so/config.json';
|
|
11298
|
+
const { data } = yield axios__default["default"].get(`${url}?noCache=${getTimeStamp()}`, {
|
|
11293
11299
|
timeout: 7000,
|
|
11294
11300
|
});
|
|
11295
11301
|
this.deviceMap = {
|
|
@@ -11306,6 +11312,15 @@ class DataManager {
|
|
|
11306
11312
|
}
|
|
11307
11313
|
});
|
|
11308
11314
|
}
|
|
11315
|
+
static checkAndReloadData() {
|
|
11316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11317
|
+
if (getTimeStamp() - this.lastCheckTimestamp > 1000 * 60 * 60 * 3) {
|
|
11318
|
+
yield this.load(this.settings).then(() => {
|
|
11319
|
+
this.lastCheckTimestamp = getTimeStamp();
|
|
11320
|
+
});
|
|
11321
|
+
}
|
|
11322
|
+
});
|
|
11323
|
+
}
|
|
11309
11324
|
static getProtobufMessages() {
|
|
11310
11325
|
return this.messages.default;
|
|
11311
11326
|
}
|
|
@@ -11341,6 +11356,7 @@ DataManager.assets = null;
|
|
|
11341
11356
|
DataManager.messages = {
|
|
11342
11357
|
default: MessagesJSON,
|
|
11343
11358
|
};
|
|
11359
|
+
DataManager.lastCheckTimestamp = 0;
|
|
11344
11360
|
DataManager.getFirmwareStatus = (features) => {
|
|
11345
11361
|
var _b, _c;
|
|
11346
11362
|
const deviceType = getDeviceType(features);
|
|
@@ -11886,7 +11902,7 @@ class DeviceCommands {
|
|
|
11886
11902
|
});
|
|
11887
11903
|
}
|
|
11888
11904
|
call(type, msg = {}) {
|
|
11889
|
-
var _a, _b;
|
|
11905
|
+
var _a, _b, _c, _d, _e;
|
|
11890
11906
|
return __awaiter(this, void 0, void 0, function* () {
|
|
11891
11907
|
Log$6.debug('[DeviceCommands] [call] Sending', type);
|
|
11892
11908
|
try {
|
|
@@ -11901,6 +11917,9 @@ class DeviceCommands {
|
|
|
11901
11917
|
if (((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) === 'device disconnected during action') {
|
|
11902
11918
|
return { type: 'BridgeNetworkError', message: {} };
|
|
11903
11919
|
}
|
|
11920
|
+
if (((_e = (_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error) === null || _e === void 0 ? void 0 : _e.indexOf('Request failed with status code')) !== -1) {
|
|
11921
|
+
return { type: 'CallMethodError', message: {} };
|
|
11922
|
+
}
|
|
11904
11923
|
throw error;
|
|
11905
11924
|
}
|
|
11906
11925
|
});
|
|
@@ -12554,6 +12573,7 @@ class BaseMethod {
|
|
|
12554
12573
|
this.shouldEnsureConnected = true;
|
|
12555
12574
|
this.checkDeviceId = false;
|
|
12556
12575
|
this.useDevicePassphraseState = true;
|
|
12576
|
+
this.skipForceUpdateCheck = false;
|
|
12557
12577
|
const { payload } = message;
|
|
12558
12578
|
this.name = payload.method;
|
|
12559
12579
|
this.payload = payload;
|
|
@@ -12561,7 +12581,7 @@ class BaseMethod {
|
|
|
12561
12581
|
this.connectId = payload.connectId || '';
|
|
12562
12582
|
this.deviceId = payload.deviceId || '';
|
|
12563
12583
|
this.useDevice = true;
|
|
12564
|
-
this.
|
|
12584
|
+
this.notAllowDeviceMode = [UI_REQUEST.INITIALIZE];
|
|
12565
12585
|
this.requireDeviceMode = [];
|
|
12566
12586
|
}
|
|
12567
12587
|
getVersionRange() {
|
|
@@ -12616,6 +12636,7 @@ class SearchDevices extends BaseMethod {
|
|
|
12616
12636
|
init() {
|
|
12617
12637
|
this.useDevice = false;
|
|
12618
12638
|
this.useDevicePassphraseState = false;
|
|
12639
|
+
this.skipForceUpdateCheck = true;
|
|
12619
12640
|
}
|
|
12620
12641
|
run() {
|
|
12621
12642
|
var _a, _b;
|
|
@@ -12638,8 +12659,13 @@ class SearchDevices extends BaseMethod {
|
|
|
12638
12659
|
|
|
12639
12660
|
class GetFeatures extends BaseMethod {
|
|
12640
12661
|
init() {
|
|
12641
|
-
this.
|
|
12662
|
+
this.notAllowDeviceMode = [
|
|
12663
|
+
...this.notAllowDeviceMode,
|
|
12664
|
+
UI_REQUEST.INITIALIZE,
|
|
12665
|
+
UI_REQUEST.BOOTLOADER,
|
|
12666
|
+
];
|
|
12642
12667
|
this.useDevicePassphraseState = false;
|
|
12668
|
+
this.skipForceUpdateCheck = true;
|
|
12643
12669
|
}
|
|
12644
12670
|
run() {
|
|
12645
12671
|
return Promise.resolve(this.device.features);
|
|
@@ -12648,7 +12674,7 @@ class GetFeatures extends BaseMethod {
|
|
|
12648
12674
|
|
|
12649
12675
|
class GetPassphraseState extends BaseMethod {
|
|
12650
12676
|
init() {
|
|
12651
|
-
this.
|
|
12677
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
12652
12678
|
this.useDevicePassphraseState = false;
|
|
12653
12679
|
}
|
|
12654
12680
|
run() {
|
|
@@ -12679,6 +12705,7 @@ class CheckBridgeStatus$1 extends BaseMethod {
|
|
|
12679
12705
|
init() {
|
|
12680
12706
|
this.useDevice = false;
|
|
12681
12707
|
this.useDevicePassphraseState = false;
|
|
12708
|
+
this.skipForceUpdateCheck = true;
|
|
12682
12709
|
}
|
|
12683
12710
|
run() {
|
|
12684
12711
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12691,6 +12718,7 @@ class CheckBridgeStatus$1 extends BaseMethod {
|
|
|
12691
12718
|
class CheckFirmwareRelease extends BaseMethod {
|
|
12692
12719
|
init() {
|
|
12693
12720
|
this.useDevicePassphraseState = false;
|
|
12721
|
+
this.skipForceUpdateCheck = true;
|
|
12694
12722
|
}
|
|
12695
12723
|
run() {
|
|
12696
12724
|
if (this.device.features) {
|
|
@@ -12703,9 +12731,10 @@ class CheckFirmwareRelease extends BaseMethod {
|
|
|
12703
12731
|
|
|
12704
12732
|
class CheckBLEFirmwareRelease extends BaseMethod {
|
|
12705
12733
|
init() {
|
|
12706
|
-
this.
|
|
12734
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
12707
12735
|
this.checkDeviceId = true;
|
|
12708
12736
|
this.useDevicePassphraseState = false;
|
|
12737
|
+
this.skipForceUpdateCheck = true;
|
|
12709
12738
|
}
|
|
12710
12739
|
run() {
|
|
12711
12740
|
if (this.device.features) {
|
|
@@ -12720,6 +12749,7 @@ class CheckTransportRelease extends BaseMethod {
|
|
|
12720
12749
|
init() {
|
|
12721
12750
|
this.useDevice = false;
|
|
12722
12751
|
this.useDevicePassphraseState = false;
|
|
12752
|
+
this.skipForceUpdateCheck = true;
|
|
12723
12753
|
}
|
|
12724
12754
|
run() {
|
|
12725
12755
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12735,6 +12765,7 @@ class CheckBridgeStatus extends BaseMethod {
|
|
|
12735
12765
|
init() {
|
|
12736
12766
|
this.useDevice = false;
|
|
12737
12767
|
this.useDevicePassphraseState = false;
|
|
12768
|
+
this.skipForceUpdateCheck = true;
|
|
12738
12769
|
}
|
|
12739
12770
|
run() {
|
|
12740
12771
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12762,9 +12793,10 @@ class CheckBridgeStatus extends BaseMethod {
|
|
|
12762
12793
|
|
|
12763
12794
|
class CheckBootloaderRelease extends BaseMethod {
|
|
12764
12795
|
init() {
|
|
12765
|
-
this.
|
|
12796
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
12766
12797
|
this.checkDeviceId = true;
|
|
12767
12798
|
this.useDevicePassphraseState = false;
|
|
12799
|
+
this.skipForceUpdateCheck = true;
|
|
12768
12800
|
}
|
|
12769
12801
|
run() {
|
|
12770
12802
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12954,6 +12986,7 @@ class DeviceFlags extends BaseMethod {
|
|
|
12954
12986
|
class DeviceRebootToBootloader extends BaseMethod {
|
|
12955
12987
|
init() {
|
|
12956
12988
|
this.useDevicePassphraseState = false;
|
|
12989
|
+
this.skipForceUpdateCheck = true;
|
|
12957
12990
|
}
|
|
12958
12991
|
getVersionRange() {
|
|
12959
12992
|
return {
|
|
@@ -12976,6 +13009,7 @@ class DeviceRebootToBootloader extends BaseMethod {
|
|
|
12976
13009
|
class DeviceRebootToBoardloader extends BaseMethod {
|
|
12977
13010
|
init() {
|
|
12978
13011
|
this.useDevicePassphraseState = false;
|
|
13012
|
+
this.skipForceUpdateCheck = true;
|
|
12979
13013
|
}
|
|
12980
13014
|
getVersionRange() {
|
|
12981
13015
|
return {
|
|
@@ -13114,6 +13148,7 @@ class DeviceSettings extends BaseMethod {
|
|
|
13114
13148
|
class DeviceUpdateReboot extends BaseMethod {
|
|
13115
13149
|
init() {
|
|
13116
13150
|
this.useDevicePassphraseState = false;
|
|
13151
|
+
this.skipForceUpdateCheck = true;
|
|
13117
13152
|
}
|
|
13118
13153
|
run() {
|
|
13119
13154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -13189,6 +13224,7 @@ class DeviceUploadResource extends BaseMethod {
|
|
|
13189
13224
|
}
|
|
13190
13225
|
init() {
|
|
13191
13226
|
this.useDevicePassphraseState = false;
|
|
13227
|
+
this.skipForceUpdateCheck = true;
|
|
13192
13228
|
validateParams(this.payload, [
|
|
13193
13229
|
{ name: 'suffix', type: 'string', required: true },
|
|
13194
13230
|
{ name: 'dataHex', type: 'string', required: true },
|
|
@@ -13229,6 +13265,7 @@ class DeviceUploadResource extends BaseMethod {
|
|
|
13229
13265
|
class DeviceSupportFeatures extends BaseMethod {
|
|
13230
13266
|
init() {
|
|
13231
13267
|
this.useDevicePassphraseState = false;
|
|
13268
|
+
this.skipForceUpdateCheck = true;
|
|
13232
13269
|
}
|
|
13233
13270
|
run() {
|
|
13234
13271
|
if (!this.device.features)
|
|
@@ -13465,9 +13502,10 @@ class DeviceFullyUploadResource extends BaseMethod {
|
|
|
13465
13502
|
};
|
|
13466
13503
|
}
|
|
13467
13504
|
init() {
|
|
13468
|
-
this.
|
|
13505
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13469
13506
|
this.requireDeviceMode = [];
|
|
13470
13507
|
this.useDevicePassphraseState = false;
|
|
13508
|
+
this.skipForceUpdateCheck = true;
|
|
13471
13509
|
}
|
|
13472
13510
|
isSupportResourceUpdate(features, updateType) {
|
|
13473
13511
|
if (updateType !== 'firmware')
|
|
@@ -13513,9 +13551,10 @@ class DeviceUpdateBootloader extends BaseMethod {
|
|
|
13513
13551
|
};
|
|
13514
13552
|
}
|
|
13515
13553
|
init() {
|
|
13516
|
-
this.
|
|
13554
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13517
13555
|
this.requireDeviceMode = [];
|
|
13518
13556
|
this.useDevicePassphraseState = false;
|
|
13557
|
+
this.skipForceUpdateCheck = true;
|
|
13519
13558
|
}
|
|
13520
13559
|
run() {
|
|
13521
13560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -13546,9 +13585,10 @@ class DeviceUpdateBootloader extends BaseMethod {
|
|
|
13546
13585
|
|
|
13547
13586
|
class FirmwareUpdate extends BaseMethod {
|
|
13548
13587
|
init() {
|
|
13549
|
-
this.
|
|
13588
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13550
13589
|
this.requireDeviceMode = [UI_REQUEST.BOOTLOADER];
|
|
13551
13590
|
this.useDevicePassphraseState = false;
|
|
13591
|
+
this.skipForceUpdateCheck = true;
|
|
13552
13592
|
const { payload } = this;
|
|
13553
13593
|
validateParams(payload, [
|
|
13554
13594
|
{ name: 'version', type: 'array' },
|
|
@@ -13609,9 +13649,10 @@ class FirmwareUpdateV2 extends BaseMethod {
|
|
|
13609
13649
|
};
|
|
13610
13650
|
}
|
|
13611
13651
|
init() {
|
|
13612
|
-
this.
|
|
13652
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13613
13653
|
this.requireDeviceMode = [];
|
|
13614
13654
|
this.useDevicePassphraseState = false;
|
|
13655
|
+
this.skipForceUpdateCheck = true;
|
|
13615
13656
|
const { payload } = this;
|
|
13616
13657
|
validateParams(payload, [
|
|
13617
13658
|
{ name: 'version', type: 'array' },
|
|
@@ -13786,6 +13827,7 @@ class RequestWebUsbDevice extends BaseMethod {
|
|
|
13786
13827
|
init() {
|
|
13787
13828
|
this.useDevice = false;
|
|
13788
13829
|
this.useDevicePassphraseState = false;
|
|
13830
|
+
this.skipForceUpdateCheck = true;
|
|
13789
13831
|
}
|
|
13790
13832
|
run() {
|
|
13791
13833
|
var _a, _b;
|
|
@@ -13820,7 +13862,7 @@ class CipherKeyValue extends BaseMethod {
|
|
|
13820
13862
|
init() {
|
|
13821
13863
|
var _a;
|
|
13822
13864
|
this.checkDeviceId = true;
|
|
13823
|
-
this.
|
|
13865
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
13824
13866
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
13825
13867
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
13826
13868
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14114,7 +14156,7 @@ class BTCGetAddress extends BaseMethod {
|
|
|
14114
14156
|
}
|
|
14115
14157
|
init() {
|
|
14116
14158
|
this.checkDeviceId = true;
|
|
14117
|
-
this.
|
|
14159
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14118
14160
|
this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
|
|
14119
14161
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14120
14162
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14168,7 +14210,7 @@ class BTCGetPublicKey extends BaseMethod {
|
|
|
14168
14210
|
}
|
|
14169
14211
|
init() {
|
|
14170
14212
|
this.checkDeviceId = true;
|
|
14171
|
-
this.
|
|
14213
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14172
14214
|
this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
|
|
14173
14215
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14174
14216
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14227,7 +14269,7 @@ class BTCGetPublicKey extends BaseMethod {
|
|
|
14227
14269
|
class BTCSignMessage extends BaseMethod {
|
|
14228
14270
|
init() {
|
|
14229
14271
|
this.checkDeviceId = true;
|
|
14230
|
-
this.
|
|
14272
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14231
14273
|
validateParams(this.payload, [
|
|
14232
14274
|
{ name: 'path', required: true },
|
|
14233
14275
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14526,7 +14568,7 @@ var signtxLegacy = (typedCall, inputs, outputs, refTxsArray, options, coinName)
|
|
|
14526
14568
|
class BTCSignTransaction extends BaseMethod {
|
|
14527
14569
|
init() {
|
|
14528
14570
|
this.checkDeviceId = true;
|
|
14529
|
-
this.
|
|
14571
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14530
14572
|
validateParams(this.payload, [
|
|
14531
14573
|
{ name: 'coin', type: 'string', required: true },
|
|
14532
14574
|
{ name: 'inputs', type: 'array', required: true },
|
|
@@ -14617,7 +14659,7 @@ class BTCSignTransaction extends BaseMethod {
|
|
|
14617
14659
|
class BTCVerifyMessage extends BaseMethod {
|
|
14618
14660
|
init() {
|
|
14619
14661
|
this.checkDeviceId = true;
|
|
14620
|
-
this.
|
|
14662
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14621
14663
|
validateParams(this.payload, [
|
|
14622
14664
|
{ name: 'address', type: 'string', required: true },
|
|
14623
14665
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14649,7 +14691,7 @@ class ConfluxGetAddress extends BaseMethod {
|
|
|
14649
14691
|
}
|
|
14650
14692
|
init() {
|
|
14651
14693
|
var _a;
|
|
14652
|
-
this.
|
|
14694
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14653
14695
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
14654
14696
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14655
14697
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14692,7 +14734,7 @@ class ConfluxGetAddress extends BaseMethod {
|
|
|
14692
14734
|
|
|
14693
14735
|
class ConfluxSignMessage extends BaseMethod {
|
|
14694
14736
|
init() {
|
|
14695
|
-
this.
|
|
14737
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14696
14738
|
validateParams(this.payload, [
|
|
14697
14739
|
{ name: 'path', required: true },
|
|
14698
14740
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14721,7 +14763,7 @@ class ConfluxSignMessage extends BaseMethod {
|
|
|
14721
14763
|
|
|
14722
14764
|
class ConfluxSignMessageCIP23 extends BaseMethod {
|
|
14723
14765
|
init() {
|
|
14724
|
-
this.
|
|
14766
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14725
14767
|
validateParams(this.payload, [
|
|
14726
14768
|
{ name: 'path', required: true },
|
|
14727
14769
|
{ name: 'domainHash', type: 'hexString', required: true },
|
|
@@ -14806,7 +14848,7 @@ class ConfluxSignTransaction extends BaseMethod {
|
|
|
14806
14848
|
});
|
|
14807
14849
|
}
|
|
14808
14850
|
init() {
|
|
14809
|
-
this.
|
|
14851
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14810
14852
|
validateParams(this.payload, [
|
|
14811
14853
|
{ name: 'path', required: true },
|
|
14812
14854
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -14855,7 +14897,7 @@ class EvmGetAddress extends BaseMethod {
|
|
|
14855
14897
|
init() {
|
|
14856
14898
|
var _a;
|
|
14857
14899
|
this.checkDeviceId = true;
|
|
14858
|
-
this.
|
|
14900
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14859
14901
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
14860
14902
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14861
14903
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14902,7 +14944,7 @@ class EVMGetPublicKey extends BaseMethod {
|
|
|
14902
14944
|
init() {
|
|
14903
14945
|
var _a, _b;
|
|
14904
14946
|
this.checkDeviceId = true;
|
|
14905
|
-
this.
|
|
14947
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14906
14948
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
14907
14949
|
this.useBatch = !!((_b = this.payload) === null || _b === void 0 ? void 0 : _b.useBatch);
|
|
14908
14950
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -14952,7 +14994,7 @@ class EVMGetPublicKey extends BaseMethod {
|
|
|
14952
14994
|
class EVMSignMessage$2 extends BaseMethod {
|
|
14953
14995
|
init() {
|
|
14954
14996
|
this.checkDeviceId = true;
|
|
14955
|
-
this.
|
|
14997
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14956
14998
|
validateParams(this.payload, [
|
|
14957
14999
|
{ name: 'path', required: true },
|
|
14958
15000
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14977,7 +15019,7 @@ class EVMSignMessage$2 extends BaseMethod {
|
|
|
14977
15019
|
class EVMSignMessageEIP712 extends BaseMethod {
|
|
14978
15020
|
init() {
|
|
14979
15021
|
this.checkDeviceId = true;
|
|
14980
|
-
this.
|
|
15022
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14981
15023
|
validateParams(this.payload, [
|
|
14982
15024
|
{ name: 'path', required: true },
|
|
14983
15025
|
{ name: 'domainHash', type: 'hexString', required: true },
|
|
@@ -15082,7 +15124,7 @@ class EVMSignTransaction extends BaseMethod {
|
|
|
15082
15124
|
}
|
|
15083
15125
|
init() {
|
|
15084
15126
|
this.checkDeviceId = true;
|
|
15085
|
-
this.
|
|
15127
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15086
15128
|
validateParams(this.payload, [
|
|
15087
15129
|
{ name: 'path', required: true },
|
|
15088
15130
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -15249,7 +15291,7 @@ const getFieldType = (typeName, types) => {
|
|
|
15249
15291
|
class EVMSignTypedData extends BaseMethod {
|
|
15250
15292
|
init() {
|
|
15251
15293
|
this.checkDeviceId = true;
|
|
15252
|
-
this.
|
|
15294
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15253
15295
|
validateParams(this.payload, [
|
|
15254
15296
|
{ name: 'path', required: true },
|
|
15255
15297
|
{ name: 'metamaskV4Compat', type: 'boolean' },
|
|
@@ -15416,7 +15458,7 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
15416
15458
|
class EVMSignMessage$1 extends BaseMethod {
|
|
15417
15459
|
init() {
|
|
15418
15460
|
this.checkDeviceId = true;
|
|
15419
|
-
this.
|
|
15461
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15420
15462
|
validateParams(this.payload, [
|
|
15421
15463
|
{ name: 'address', type: 'string', required: true },
|
|
15422
15464
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -15447,7 +15489,7 @@ class StarcoinGetAddress extends BaseMethod {
|
|
|
15447
15489
|
init() {
|
|
15448
15490
|
var _a;
|
|
15449
15491
|
this.checkDeviceId = true;
|
|
15450
|
-
this.
|
|
15492
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15451
15493
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15452
15494
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15453
15495
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15487,7 +15529,7 @@ class StarcoinGetPublicKey extends BaseMethod {
|
|
|
15487
15529
|
init() {
|
|
15488
15530
|
var _a;
|
|
15489
15531
|
this.checkDeviceId = true;
|
|
15490
|
-
this.
|
|
15532
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15491
15533
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15492
15534
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15493
15535
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15522,7 +15564,7 @@ class StarcoinGetPublicKey extends BaseMethod {
|
|
|
15522
15564
|
class StarcoinSignMessage extends BaseMethod {
|
|
15523
15565
|
init() {
|
|
15524
15566
|
this.checkDeviceId = true;
|
|
15525
|
-
this.
|
|
15567
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15526
15568
|
validateParams(this.payload, [
|
|
15527
15569
|
{ name: 'path', required: true },
|
|
15528
15570
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -15545,7 +15587,7 @@ class StarcoinSignMessage extends BaseMethod {
|
|
|
15545
15587
|
class StarcoinSignTransaction extends BaseMethod {
|
|
15546
15588
|
init() {
|
|
15547
15589
|
this.checkDeviceId = true;
|
|
15548
|
-
this.
|
|
15590
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15549
15591
|
validateParams(this.payload, [
|
|
15550
15592
|
{ name: 'path', required: true },
|
|
15551
15593
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -15568,7 +15610,7 @@ class StarcoinSignTransaction extends BaseMethod {
|
|
|
15568
15610
|
class EVMSignMessage extends BaseMethod {
|
|
15569
15611
|
init() {
|
|
15570
15612
|
this.checkDeviceId = true;
|
|
15571
|
-
this.
|
|
15613
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15572
15614
|
validateParams(this.payload, [
|
|
15573
15615
|
{ name: 'publicKey', type: 'string', required: true },
|
|
15574
15616
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -15598,7 +15640,7 @@ class NEMGetAddress extends BaseMethod {
|
|
|
15598
15640
|
init() {
|
|
15599
15641
|
var _a;
|
|
15600
15642
|
this.checkDeviceId = true;
|
|
15601
|
-
this.
|
|
15643
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15602
15644
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15603
15645
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15604
15646
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15805,7 +15847,7 @@ class NEMSignTransaction extends BaseMethod {
|
|
|
15805
15847
|
}
|
|
15806
15848
|
init() {
|
|
15807
15849
|
this.checkDeviceId = true;
|
|
15808
|
-
this.
|
|
15850
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15809
15851
|
validateParams(this.payload, [
|
|
15810
15852
|
{ name: 'path', required: true },
|
|
15811
15853
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -15830,7 +15872,7 @@ class SolGetAddress extends BaseMethod {
|
|
|
15830
15872
|
init() {
|
|
15831
15873
|
var _a;
|
|
15832
15874
|
this.checkDeviceId = true;
|
|
15833
|
-
this.
|
|
15875
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15834
15876
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15835
15877
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15836
15878
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15874,7 +15916,7 @@ class SolSignTransaction extends BaseMethod {
|
|
|
15874
15916
|
init() {
|
|
15875
15917
|
var _a;
|
|
15876
15918
|
this.checkDeviceId = true;
|
|
15877
|
-
this.
|
|
15919
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15878
15920
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15879
15921
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15880
15922
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15926,7 +15968,7 @@ class StellarGetAddress extends BaseMethod {
|
|
|
15926
15968
|
init() {
|
|
15927
15969
|
var _a;
|
|
15928
15970
|
this.checkDeviceId = true;
|
|
15929
|
-
this.
|
|
15971
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15930
15972
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15931
15973
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15932
15974
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16090,7 +16132,7 @@ class StellarSignTransaction extends BaseMethod {
|
|
|
16090
16132
|
}
|
|
16091
16133
|
init() {
|
|
16092
16134
|
this.checkDeviceId = true;
|
|
16093
|
-
this.
|
|
16135
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16094
16136
|
validateParams(this.payload, [
|
|
16095
16137
|
{ name: 'path', required: true },
|
|
16096
16138
|
{ name: 'networkPassphrase', type: 'string', required: true },
|
|
@@ -16143,7 +16185,7 @@ class TronGetAddress extends BaseMethod {
|
|
|
16143
16185
|
init() {
|
|
16144
16186
|
var _a;
|
|
16145
16187
|
this.checkDeviceId = true;
|
|
16146
|
-
this.
|
|
16188
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16147
16189
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16148
16190
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16149
16191
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16189,7 +16231,7 @@ class TronGetAddress extends BaseMethod {
|
|
|
16189
16231
|
class TronSignMessage extends BaseMethod {
|
|
16190
16232
|
init() {
|
|
16191
16233
|
this.checkDeviceId = true;
|
|
16192
|
-
this.
|
|
16234
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16193
16235
|
validateParams(this.payload, [
|
|
16194
16236
|
{ name: 'path', required: true },
|
|
16195
16237
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -16253,7 +16295,7 @@ class TronSignTransaction extends BaseMethod {
|
|
|
16253
16295
|
}
|
|
16254
16296
|
init() {
|
|
16255
16297
|
this.checkDeviceId = true;
|
|
16256
|
-
this.
|
|
16298
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16257
16299
|
validateParams(this.payload, [
|
|
16258
16300
|
{ name: 'path', required: true },
|
|
16259
16301
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -16292,7 +16334,7 @@ class NearGetAddress extends BaseMethod {
|
|
|
16292
16334
|
init() {
|
|
16293
16335
|
var _a;
|
|
16294
16336
|
this.checkDeviceId = true;
|
|
16295
|
-
this.
|
|
16337
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16296
16338
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16297
16339
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16298
16340
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16338,7 +16380,7 @@ class NearGetAddress extends BaseMethod {
|
|
|
16338
16380
|
class NearSignTransaction extends BaseMethod {
|
|
16339
16381
|
init() {
|
|
16340
16382
|
this.checkDeviceId = true;
|
|
16341
|
-
this.
|
|
16383
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16342
16384
|
validateParams(this.payload, [
|
|
16343
16385
|
{ name: 'path', required: true },
|
|
16344
16386
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16373,7 +16415,7 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16373
16415
|
init() {
|
|
16374
16416
|
var _a;
|
|
16375
16417
|
this.checkDeviceId = true;
|
|
16376
|
-
this.
|
|
16418
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16377
16419
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16378
16420
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16379
16421
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16443,7 +16485,7 @@ class AptosGetPublicKey extends BaseMethod {
|
|
|
16443
16485
|
init() {
|
|
16444
16486
|
var _a;
|
|
16445
16487
|
this.checkDeviceId = true;
|
|
16446
|
-
this.
|
|
16488
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16447
16489
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16448
16490
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16449
16491
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16487,7 +16529,7 @@ class AptosGetPublicKey extends BaseMethod {
|
|
|
16487
16529
|
class AptosSignTransaction extends BaseMethod {
|
|
16488
16530
|
init() {
|
|
16489
16531
|
this.checkDeviceId = true;
|
|
16490
|
-
this.
|
|
16532
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16491
16533
|
validateParams(this.payload, [
|
|
16492
16534
|
{ name: 'path', required: true },
|
|
16493
16535
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16517,7 +16559,7 @@ class AptosSignTransaction extends BaseMethod {
|
|
|
16517
16559
|
class AptosSignMessage extends BaseMethod {
|
|
16518
16560
|
init() {
|
|
16519
16561
|
this.checkDeviceId = true;
|
|
16520
|
-
this.
|
|
16562
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16521
16563
|
validateParams(this.payload, [
|
|
16522
16564
|
{ name: 'path', required: true },
|
|
16523
16565
|
{ name: 'payload', type: 'object', required: true },
|
|
@@ -16583,7 +16625,7 @@ class AlgoGetAddress extends BaseMethod {
|
|
|
16583
16625
|
init() {
|
|
16584
16626
|
var _a;
|
|
16585
16627
|
this.checkDeviceId = true;
|
|
16586
|
-
this.
|
|
16628
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16587
16629
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16588
16630
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16589
16631
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16633,7 +16675,7 @@ class AlgoSignTransaction extends BaseMethod {
|
|
|
16633
16675
|
}
|
|
16634
16676
|
init() {
|
|
16635
16677
|
this.checkDeviceId = true;
|
|
16636
|
-
this.
|
|
16678
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16637
16679
|
validateParams(this.payload, [
|
|
16638
16680
|
{ name: 'path', required: true },
|
|
16639
16681
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16672,7 +16714,7 @@ class CosmosGetAddress extends BaseMethod {
|
|
|
16672
16714
|
init() {
|
|
16673
16715
|
var _a;
|
|
16674
16716
|
this.checkDeviceId = true;
|
|
16675
|
-
this.
|
|
16717
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16676
16718
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16677
16719
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16678
16720
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16729,7 +16771,7 @@ class CosmosGetPublicKey extends BaseMethod {
|
|
|
16729
16771
|
init() {
|
|
16730
16772
|
var _a;
|
|
16731
16773
|
this.checkDeviceId = true;
|
|
16732
|
-
this.
|
|
16774
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16733
16775
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16734
16776
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16735
16777
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16789,7 +16831,7 @@ class CosmosSignTransaction extends BaseMethod {
|
|
|
16789
16831
|
}
|
|
16790
16832
|
init() {
|
|
16791
16833
|
this.checkDeviceId = true;
|
|
16792
|
-
this.
|
|
16834
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16793
16835
|
validateParams(this.payload, [
|
|
16794
16836
|
{ name: 'path', required: true },
|
|
16795
16837
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16831,7 +16873,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16831
16873
|
init() {
|
|
16832
16874
|
var _a;
|
|
16833
16875
|
this.checkDeviceId = true;
|
|
16834
|
-
this.
|
|
16876
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16835
16877
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16836
16878
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16837
16879
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16899,7 +16941,7 @@ class XrpGetAddress extends BaseMethod {
|
|
|
16899
16941
|
}
|
|
16900
16942
|
init() {
|
|
16901
16943
|
this.checkDeviceId = true;
|
|
16902
|
-
this.
|
|
16944
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16903
16945
|
const { payload } = this;
|
|
16904
16946
|
validateParams(payload, [
|
|
16905
16947
|
{ name: 'path', required: true },
|
|
@@ -16958,7 +17000,7 @@ class SuiGetAddress extends BaseMethod {
|
|
|
16958
17000
|
init() {
|
|
16959
17001
|
var _a;
|
|
16960
17002
|
this.checkDeviceId = true;
|
|
16961
|
-
this.
|
|
17003
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16962
17004
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16963
17005
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16964
17006
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -17031,7 +17073,7 @@ class SuiGetPublicKey extends BaseMethod {
|
|
|
17031
17073
|
init() {
|
|
17032
17074
|
var _a;
|
|
17033
17075
|
this.checkDeviceId = true;
|
|
17034
|
-
this.
|
|
17076
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17035
17077
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17036
17078
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
17037
17079
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -17078,7 +17120,7 @@ class SuiGetPublicKey extends BaseMethod {
|
|
|
17078
17120
|
class SuiSignTransaction extends BaseMethod {
|
|
17079
17121
|
init() {
|
|
17080
17122
|
this.checkDeviceId = true;
|
|
17081
|
-
this.
|
|
17123
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17082
17124
|
validateParams(this.payload, [
|
|
17083
17125
|
{ name: 'path', required: true },
|
|
17084
17126
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -17193,7 +17235,7 @@ class CardanoGetAddress extends BaseMethod {
|
|
|
17193
17235
|
init() {
|
|
17194
17236
|
var _a, _b;
|
|
17195
17237
|
this.checkDeviceId = true;
|
|
17196
|
-
this.
|
|
17238
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17197
17239
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17198
17240
|
this.isCheck = !!((_b = this.payload) === null || _b === void 0 ? void 0 : _b.isCheck);
|
|
17199
17241
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -17283,7 +17325,7 @@ class CardanoGetPublicKey extends BaseMethod {
|
|
|
17283
17325
|
init() {
|
|
17284
17326
|
var _a;
|
|
17285
17327
|
this.checkDeviceId = true;
|
|
17286
|
-
this.
|
|
17328
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17287
17329
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17288
17330
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
17289
17331
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -17733,7 +17775,7 @@ class CardanoSignTransaction extends BaseMethod {
|
|
|
17733
17775
|
init() {
|
|
17734
17776
|
var _a;
|
|
17735
17777
|
this.checkDeviceId = true;
|
|
17736
|
-
this.
|
|
17778
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17737
17779
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17738
17780
|
const { payload } = this;
|
|
17739
17781
|
validateParams(payload, [
|
|
@@ -17955,7 +17997,7 @@ class CardanoSignTransaction extends BaseMethod {
|
|
|
17955
17997
|
class CardanoSignMessage extends BaseMethod {
|
|
17956
17998
|
init() {
|
|
17957
17999
|
this.checkDeviceId = true;
|
|
17958
|
-
this.
|
|
18000
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17959
18001
|
const { payload } = this;
|
|
17960
18002
|
validateParams(payload, [
|
|
17961
18003
|
{ name: 'path', type: 'string', required: true },
|
|
@@ -17999,7 +18041,7 @@ class FilecoinGetAddress extends BaseMethod {
|
|
|
17999
18041
|
init() {
|
|
18000
18042
|
var _a;
|
|
18001
18043
|
this.checkDeviceId = true;
|
|
18002
|
-
this.
|
|
18044
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
18003
18045
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
18004
18046
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
18005
18047
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -18054,7 +18096,7 @@ class FilecoinSignTransaction extends BaseMethod {
|
|
|
18054
18096
|
}
|
|
18055
18097
|
init() {
|
|
18056
18098
|
this.checkDeviceId = true;
|
|
18057
|
-
this.
|
|
18099
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
18058
18100
|
validateParams(this.payload, [
|
|
18059
18101
|
{ name: 'path', required: true },
|
|
18060
18102
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -18098,7 +18140,7 @@ class PolkadotGetAddress extends BaseMethod {
|
|
|
18098
18140
|
init() {
|
|
18099
18141
|
var _a;
|
|
18100
18142
|
this.checkDeviceId = true;
|
|
18101
|
-
this.
|
|
18143
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
18102
18144
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
18103
18145
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
18104
18146
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -18157,7 +18199,7 @@ class PolkadotSignTransaction extends BaseMethod {
|
|
|
18157
18199
|
}
|
|
18158
18200
|
init() {
|
|
18159
18201
|
this.checkDeviceId = true;
|
|
18160
|
-
this.
|
|
18202
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
18161
18203
|
validateParams(this.payload, [
|
|
18162
18204
|
{ name: 'path', required: true },
|
|
18163
18205
|
{ name: 'network', required: true },
|
|
@@ -18393,12 +18435,15 @@ class DeviceConnector {
|
|
|
18393
18435
|
}
|
|
18394
18436
|
|
|
18395
18437
|
const Log = getLogger(exports.LoggerNames.Core);
|
|
18396
|
-
const parseInitOptions = (method) =>
|
|
18397
|
-
|
|
18398
|
-
|
|
18399
|
-
|
|
18400
|
-
|
|
18401
|
-
|
|
18438
|
+
const parseInitOptions = (method) => {
|
|
18439
|
+
var _a;
|
|
18440
|
+
return ({
|
|
18441
|
+
initSession: method === null || method === void 0 ? void 0 : method.payload.initSession,
|
|
18442
|
+
passphraseState: method === null || method === void 0 ? void 0 : method.payload.passphraseState,
|
|
18443
|
+
deviceId: method === null || method === void 0 ? void 0 : method.payload.deviceId,
|
|
18444
|
+
deriveCardano: (method === null || method === void 0 ? void 0 : method.name.startsWith('cardano')) || ((_a = method === null || method === void 0 ? void 0 : method.payload) === null || _a === void 0 ? void 0 : _a.deriveCardano),
|
|
18445
|
+
});
|
|
18446
|
+
};
|
|
18402
18447
|
let _core;
|
|
18403
18448
|
let _deviceList;
|
|
18404
18449
|
let _connector;
|
|
@@ -18474,22 +18519,30 @@ const callAPI = (message) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
18474
18519
|
const versionRangeType = method.getVersionRange()[deviceType];
|
|
18475
18520
|
const versionRangeModel = method.getVersionRange()[deviceModel];
|
|
18476
18521
|
const versionRange = versionRangeType !== null && versionRangeType !== void 0 ? versionRangeType : versionRangeModel;
|
|
18477
|
-
if (
|
|
18478
|
-
|
|
18479
|
-
|
|
18480
|
-
|
|
18481
|
-
|
|
18482
|
-
|
|
18483
|
-
}
|
|
18484
|
-
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodNeedUpgradeFirmware, `Device firmware version is too low, please update to ${versionRange.min}`, { current: currentVersion, require: versionRange.min }));
|
|
18522
|
+
if (device.features) {
|
|
18523
|
+
yield DataManager.checkAndReloadData();
|
|
18524
|
+
const newVersionStatus = DataManager.getFirmwareStatus(device.features);
|
|
18525
|
+
const bleVersionStatus = DataManager.getBLEFirmwareStatus(device.features);
|
|
18526
|
+
if ((newVersionStatus === 'required' || bleVersionStatus === 'required') &&
|
|
18527
|
+
method.skipForceUpdateCheck === false) {
|
|
18528
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.NewFirmwareForceUpdate, 'Device firmware version is too low, please update to the latest version', { connectId: method.connectId, deviceId: method.deviceId });
|
|
18485
18529
|
}
|
|
18486
|
-
if (versionRange
|
|
18487
|
-
|
|
18488
|
-
semver__default["default"].
|
|
18489
|
-
|
|
18530
|
+
if (versionRange) {
|
|
18531
|
+
const currentVersion = getDeviceFirmwareVersion(device.features).join('.');
|
|
18532
|
+
if (semver__default["default"].valid(versionRange.min) && semver__default["default"].lt(currentVersion, versionRange.min)) {
|
|
18533
|
+
if (newVersionStatus === 'none' || newVersionStatus === 'valid') {
|
|
18534
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.NewFirmwareUnRelease);
|
|
18535
|
+
}
|
|
18536
|
+
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodNeedUpgradeFirmware, `Device firmware version is too low, please update to ${versionRange.min}`, { current: currentVersion, require: versionRange.min }));
|
|
18537
|
+
}
|
|
18538
|
+
if (versionRange.max &&
|
|
18539
|
+
semver__default["default"].valid(versionRange.max) &&
|
|
18540
|
+
semver__default["default"].gte(currentVersion, versionRange.max)) {
|
|
18541
|
+
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodDeprecated, `Device firmware version is too high, this method has been deprecated in ${versionRange.max}`, { current: currentVersion, deprecated: versionRange.max }));
|
|
18542
|
+
}
|
|
18490
18543
|
}
|
|
18491
18544
|
}
|
|
18492
|
-
const unexpectedMode = device.hasUnexpectedMode(method.
|
|
18545
|
+
const unexpectedMode = device.hasUnexpectedMode(method.notAllowDeviceMode, method.requireDeviceMode);
|
|
18493
18546
|
if (unexpectedMode) {
|
|
18494
18547
|
if (unexpectedMode === UI_REQUEST$1.NOT_IN_BOOTLOADER) {
|
|
18495
18548
|
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceUnexpectedBootloaderMode));
|