@onekeyfe/hd-core 0.2.40 → 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/index.d.ts +3 -0
- package/dist/index.js +125 -78
- 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 +41 -26
- package/src/data-manager/DataManager.ts +15 -1
- package/src/data-manager/connectSettings.ts +4 -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);
|
|
@@ -12557,6 +12573,7 @@ class BaseMethod {
|
|
|
12557
12573
|
this.shouldEnsureConnected = true;
|
|
12558
12574
|
this.checkDeviceId = false;
|
|
12559
12575
|
this.useDevicePassphraseState = true;
|
|
12576
|
+
this.skipForceUpdateCheck = false;
|
|
12560
12577
|
const { payload } = message;
|
|
12561
12578
|
this.name = payload.method;
|
|
12562
12579
|
this.payload = payload;
|
|
@@ -12564,7 +12581,7 @@ class BaseMethod {
|
|
|
12564
12581
|
this.connectId = payload.connectId || '';
|
|
12565
12582
|
this.deviceId = payload.deviceId || '';
|
|
12566
12583
|
this.useDevice = true;
|
|
12567
|
-
this.
|
|
12584
|
+
this.notAllowDeviceMode = [UI_REQUEST.INITIALIZE];
|
|
12568
12585
|
this.requireDeviceMode = [];
|
|
12569
12586
|
}
|
|
12570
12587
|
getVersionRange() {
|
|
@@ -12619,6 +12636,7 @@ class SearchDevices extends BaseMethod {
|
|
|
12619
12636
|
init() {
|
|
12620
12637
|
this.useDevice = false;
|
|
12621
12638
|
this.useDevicePassphraseState = false;
|
|
12639
|
+
this.skipForceUpdateCheck = true;
|
|
12622
12640
|
}
|
|
12623
12641
|
run() {
|
|
12624
12642
|
var _a, _b;
|
|
@@ -12641,8 +12659,13 @@ class SearchDevices extends BaseMethod {
|
|
|
12641
12659
|
|
|
12642
12660
|
class GetFeatures extends BaseMethod {
|
|
12643
12661
|
init() {
|
|
12644
|
-
this.
|
|
12662
|
+
this.notAllowDeviceMode = [
|
|
12663
|
+
...this.notAllowDeviceMode,
|
|
12664
|
+
UI_REQUEST.INITIALIZE,
|
|
12665
|
+
UI_REQUEST.BOOTLOADER,
|
|
12666
|
+
];
|
|
12645
12667
|
this.useDevicePassphraseState = false;
|
|
12668
|
+
this.skipForceUpdateCheck = true;
|
|
12646
12669
|
}
|
|
12647
12670
|
run() {
|
|
12648
12671
|
return Promise.resolve(this.device.features);
|
|
@@ -12651,7 +12674,7 @@ class GetFeatures extends BaseMethod {
|
|
|
12651
12674
|
|
|
12652
12675
|
class GetPassphraseState extends BaseMethod {
|
|
12653
12676
|
init() {
|
|
12654
|
-
this.
|
|
12677
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
12655
12678
|
this.useDevicePassphraseState = false;
|
|
12656
12679
|
}
|
|
12657
12680
|
run() {
|
|
@@ -12682,6 +12705,7 @@ class CheckBridgeStatus$1 extends BaseMethod {
|
|
|
12682
12705
|
init() {
|
|
12683
12706
|
this.useDevice = false;
|
|
12684
12707
|
this.useDevicePassphraseState = false;
|
|
12708
|
+
this.skipForceUpdateCheck = true;
|
|
12685
12709
|
}
|
|
12686
12710
|
run() {
|
|
12687
12711
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12694,6 +12718,7 @@ class CheckBridgeStatus$1 extends BaseMethod {
|
|
|
12694
12718
|
class CheckFirmwareRelease extends BaseMethod {
|
|
12695
12719
|
init() {
|
|
12696
12720
|
this.useDevicePassphraseState = false;
|
|
12721
|
+
this.skipForceUpdateCheck = true;
|
|
12697
12722
|
}
|
|
12698
12723
|
run() {
|
|
12699
12724
|
if (this.device.features) {
|
|
@@ -12706,9 +12731,10 @@ class CheckFirmwareRelease extends BaseMethod {
|
|
|
12706
12731
|
|
|
12707
12732
|
class CheckBLEFirmwareRelease extends BaseMethod {
|
|
12708
12733
|
init() {
|
|
12709
|
-
this.
|
|
12734
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
12710
12735
|
this.checkDeviceId = true;
|
|
12711
12736
|
this.useDevicePassphraseState = false;
|
|
12737
|
+
this.skipForceUpdateCheck = true;
|
|
12712
12738
|
}
|
|
12713
12739
|
run() {
|
|
12714
12740
|
if (this.device.features) {
|
|
@@ -12723,6 +12749,7 @@ class CheckTransportRelease extends BaseMethod {
|
|
|
12723
12749
|
init() {
|
|
12724
12750
|
this.useDevice = false;
|
|
12725
12751
|
this.useDevicePassphraseState = false;
|
|
12752
|
+
this.skipForceUpdateCheck = true;
|
|
12726
12753
|
}
|
|
12727
12754
|
run() {
|
|
12728
12755
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12738,6 +12765,7 @@ class CheckBridgeStatus extends BaseMethod {
|
|
|
12738
12765
|
init() {
|
|
12739
12766
|
this.useDevice = false;
|
|
12740
12767
|
this.useDevicePassphraseState = false;
|
|
12768
|
+
this.skipForceUpdateCheck = true;
|
|
12741
12769
|
}
|
|
12742
12770
|
run() {
|
|
12743
12771
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12765,9 +12793,10 @@ class CheckBridgeStatus extends BaseMethod {
|
|
|
12765
12793
|
|
|
12766
12794
|
class CheckBootloaderRelease extends BaseMethod {
|
|
12767
12795
|
init() {
|
|
12768
|
-
this.
|
|
12796
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
12769
12797
|
this.checkDeviceId = true;
|
|
12770
12798
|
this.useDevicePassphraseState = false;
|
|
12799
|
+
this.skipForceUpdateCheck = true;
|
|
12771
12800
|
}
|
|
12772
12801
|
run() {
|
|
12773
12802
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12957,6 +12986,7 @@ class DeviceFlags extends BaseMethod {
|
|
|
12957
12986
|
class DeviceRebootToBootloader extends BaseMethod {
|
|
12958
12987
|
init() {
|
|
12959
12988
|
this.useDevicePassphraseState = false;
|
|
12989
|
+
this.skipForceUpdateCheck = true;
|
|
12960
12990
|
}
|
|
12961
12991
|
getVersionRange() {
|
|
12962
12992
|
return {
|
|
@@ -12979,6 +13009,7 @@ class DeviceRebootToBootloader extends BaseMethod {
|
|
|
12979
13009
|
class DeviceRebootToBoardloader extends BaseMethod {
|
|
12980
13010
|
init() {
|
|
12981
13011
|
this.useDevicePassphraseState = false;
|
|
13012
|
+
this.skipForceUpdateCheck = true;
|
|
12982
13013
|
}
|
|
12983
13014
|
getVersionRange() {
|
|
12984
13015
|
return {
|
|
@@ -13117,6 +13148,7 @@ class DeviceSettings extends BaseMethod {
|
|
|
13117
13148
|
class DeviceUpdateReboot extends BaseMethod {
|
|
13118
13149
|
init() {
|
|
13119
13150
|
this.useDevicePassphraseState = false;
|
|
13151
|
+
this.skipForceUpdateCheck = true;
|
|
13120
13152
|
}
|
|
13121
13153
|
run() {
|
|
13122
13154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -13192,6 +13224,7 @@ class DeviceUploadResource extends BaseMethod {
|
|
|
13192
13224
|
}
|
|
13193
13225
|
init() {
|
|
13194
13226
|
this.useDevicePassphraseState = false;
|
|
13227
|
+
this.skipForceUpdateCheck = true;
|
|
13195
13228
|
validateParams(this.payload, [
|
|
13196
13229
|
{ name: 'suffix', type: 'string', required: true },
|
|
13197
13230
|
{ name: 'dataHex', type: 'string', required: true },
|
|
@@ -13232,6 +13265,7 @@ class DeviceUploadResource extends BaseMethod {
|
|
|
13232
13265
|
class DeviceSupportFeatures extends BaseMethod {
|
|
13233
13266
|
init() {
|
|
13234
13267
|
this.useDevicePassphraseState = false;
|
|
13268
|
+
this.skipForceUpdateCheck = true;
|
|
13235
13269
|
}
|
|
13236
13270
|
run() {
|
|
13237
13271
|
if (!this.device.features)
|
|
@@ -13468,9 +13502,10 @@ class DeviceFullyUploadResource extends BaseMethod {
|
|
|
13468
13502
|
};
|
|
13469
13503
|
}
|
|
13470
13504
|
init() {
|
|
13471
|
-
this.
|
|
13505
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13472
13506
|
this.requireDeviceMode = [];
|
|
13473
13507
|
this.useDevicePassphraseState = false;
|
|
13508
|
+
this.skipForceUpdateCheck = true;
|
|
13474
13509
|
}
|
|
13475
13510
|
isSupportResourceUpdate(features, updateType) {
|
|
13476
13511
|
if (updateType !== 'firmware')
|
|
@@ -13516,9 +13551,10 @@ class DeviceUpdateBootloader extends BaseMethod {
|
|
|
13516
13551
|
};
|
|
13517
13552
|
}
|
|
13518
13553
|
init() {
|
|
13519
|
-
this.
|
|
13554
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13520
13555
|
this.requireDeviceMode = [];
|
|
13521
13556
|
this.useDevicePassphraseState = false;
|
|
13557
|
+
this.skipForceUpdateCheck = true;
|
|
13522
13558
|
}
|
|
13523
13559
|
run() {
|
|
13524
13560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -13549,9 +13585,10 @@ class DeviceUpdateBootloader extends BaseMethod {
|
|
|
13549
13585
|
|
|
13550
13586
|
class FirmwareUpdate extends BaseMethod {
|
|
13551
13587
|
init() {
|
|
13552
|
-
this.
|
|
13588
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13553
13589
|
this.requireDeviceMode = [UI_REQUEST.BOOTLOADER];
|
|
13554
13590
|
this.useDevicePassphraseState = false;
|
|
13591
|
+
this.skipForceUpdateCheck = true;
|
|
13555
13592
|
const { payload } = this;
|
|
13556
13593
|
validateParams(payload, [
|
|
13557
13594
|
{ name: 'version', type: 'array' },
|
|
@@ -13612,9 +13649,10 @@ class FirmwareUpdateV2 extends BaseMethod {
|
|
|
13612
13649
|
};
|
|
13613
13650
|
}
|
|
13614
13651
|
init() {
|
|
13615
|
-
this.
|
|
13652
|
+
this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13616
13653
|
this.requireDeviceMode = [];
|
|
13617
13654
|
this.useDevicePassphraseState = false;
|
|
13655
|
+
this.skipForceUpdateCheck = true;
|
|
13618
13656
|
const { payload } = this;
|
|
13619
13657
|
validateParams(payload, [
|
|
13620
13658
|
{ name: 'version', type: 'array' },
|
|
@@ -13789,6 +13827,7 @@ class RequestWebUsbDevice extends BaseMethod {
|
|
|
13789
13827
|
init() {
|
|
13790
13828
|
this.useDevice = false;
|
|
13791
13829
|
this.useDevicePassphraseState = false;
|
|
13830
|
+
this.skipForceUpdateCheck = true;
|
|
13792
13831
|
}
|
|
13793
13832
|
run() {
|
|
13794
13833
|
var _a, _b;
|
|
@@ -13823,7 +13862,7 @@ class CipherKeyValue extends BaseMethod {
|
|
|
13823
13862
|
init() {
|
|
13824
13863
|
var _a;
|
|
13825
13864
|
this.checkDeviceId = true;
|
|
13826
|
-
this.
|
|
13865
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
13827
13866
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
13828
13867
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
13829
13868
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14117,7 +14156,7 @@ class BTCGetAddress extends BaseMethod {
|
|
|
14117
14156
|
}
|
|
14118
14157
|
init() {
|
|
14119
14158
|
this.checkDeviceId = true;
|
|
14120
|
-
this.
|
|
14159
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14121
14160
|
this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
|
|
14122
14161
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14123
14162
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14171,7 +14210,7 @@ class BTCGetPublicKey extends BaseMethod {
|
|
|
14171
14210
|
}
|
|
14172
14211
|
init() {
|
|
14173
14212
|
this.checkDeviceId = true;
|
|
14174
|
-
this.
|
|
14213
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14175
14214
|
this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
|
|
14176
14215
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14177
14216
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14230,7 +14269,7 @@ class BTCGetPublicKey extends BaseMethod {
|
|
|
14230
14269
|
class BTCSignMessage extends BaseMethod {
|
|
14231
14270
|
init() {
|
|
14232
14271
|
this.checkDeviceId = true;
|
|
14233
|
-
this.
|
|
14272
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14234
14273
|
validateParams(this.payload, [
|
|
14235
14274
|
{ name: 'path', required: true },
|
|
14236
14275
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14529,7 +14568,7 @@ var signtxLegacy = (typedCall, inputs, outputs, refTxsArray, options, coinName)
|
|
|
14529
14568
|
class BTCSignTransaction extends BaseMethod {
|
|
14530
14569
|
init() {
|
|
14531
14570
|
this.checkDeviceId = true;
|
|
14532
|
-
this.
|
|
14571
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14533
14572
|
validateParams(this.payload, [
|
|
14534
14573
|
{ name: 'coin', type: 'string', required: true },
|
|
14535
14574
|
{ name: 'inputs', type: 'array', required: true },
|
|
@@ -14620,7 +14659,7 @@ class BTCSignTransaction extends BaseMethod {
|
|
|
14620
14659
|
class BTCVerifyMessage extends BaseMethod {
|
|
14621
14660
|
init() {
|
|
14622
14661
|
this.checkDeviceId = true;
|
|
14623
|
-
this.
|
|
14662
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14624
14663
|
validateParams(this.payload, [
|
|
14625
14664
|
{ name: 'address', type: 'string', required: true },
|
|
14626
14665
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14652,7 +14691,7 @@ class ConfluxGetAddress extends BaseMethod {
|
|
|
14652
14691
|
}
|
|
14653
14692
|
init() {
|
|
14654
14693
|
var _a;
|
|
14655
|
-
this.
|
|
14694
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14656
14695
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
14657
14696
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14658
14697
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14695,7 +14734,7 @@ class ConfluxGetAddress extends BaseMethod {
|
|
|
14695
14734
|
|
|
14696
14735
|
class ConfluxSignMessage extends BaseMethod {
|
|
14697
14736
|
init() {
|
|
14698
|
-
this.
|
|
14737
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14699
14738
|
validateParams(this.payload, [
|
|
14700
14739
|
{ name: 'path', required: true },
|
|
14701
14740
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14724,7 +14763,7 @@ class ConfluxSignMessage extends BaseMethod {
|
|
|
14724
14763
|
|
|
14725
14764
|
class ConfluxSignMessageCIP23 extends BaseMethod {
|
|
14726
14765
|
init() {
|
|
14727
|
-
this.
|
|
14766
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14728
14767
|
validateParams(this.payload, [
|
|
14729
14768
|
{ name: 'path', required: true },
|
|
14730
14769
|
{ name: 'domainHash', type: 'hexString', required: true },
|
|
@@ -14809,7 +14848,7 @@ class ConfluxSignTransaction extends BaseMethod {
|
|
|
14809
14848
|
});
|
|
14810
14849
|
}
|
|
14811
14850
|
init() {
|
|
14812
|
-
this.
|
|
14851
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14813
14852
|
validateParams(this.payload, [
|
|
14814
14853
|
{ name: 'path', required: true },
|
|
14815
14854
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -14858,7 +14897,7 @@ class EvmGetAddress extends BaseMethod {
|
|
|
14858
14897
|
init() {
|
|
14859
14898
|
var _a;
|
|
14860
14899
|
this.checkDeviceId = true;
|
|
14861
|
-
this.
|
|
14900
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14862
14901
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
14863
14902
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
14864
14903
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -14905,7 +14944,7 @@ class EVMGetPublicKey extends BaseMethod {
|
|
|
14905
14944
|
init() {
|
|
14906
14945
|
var _a, _b;
|
|
14907
14946
|
this.checkDeviceId = true;
|
|
14908
|
-
this.
|
|
14947
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14909
14948
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
14910
14949
|
this.useBatch = !!((_b = this.payload) === null || _b === void 0 ? void 0 : _b.useBatch);
|
|
14911
14950
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -14955,7 +14994,7 @@ class EVMGetPublicKey extends BaseMethod {
|
|
|
14955
14994
|
class EVMSignMessage$2 extends BaseMethod {
|
|
14956
14995
|
init() {
|
|
14957
14996
|
this.checkDeviceId = true;
|
|
14958
|
-
this.
|
|
14997
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14959
14998
|
validateParams(this.payload, [
|
|
14960
14999
|
{ name: 'path', required: true },
|
|
14961
15000
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -14980,7 +15019,7 @@ class EVMSignMessage$2 extends BaseMethod {
|
|
|
14980
15019
|
class EVMSignMessageEIP712 extends BaseMethod {
|
|
14981
15020
|
init() {
|
|
14982
15021
|
this.checkDeviceId = true;
|
|
14983
|
-
this.
|
|
15022
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
14984
15023
|
validateParams(this.payload, [
|
|
14985
15024
|
{ name: 'path', required: true },
|
|
14986
15025
|
{ name: 'domainHash', type: 'hexString', required: true },
|
|
@@ -15085,7 +15124,7 @@ class EVMSignTransaction extends BaseMethod {
|
|
|
15085
15124
|
}
|
|
15086
15125
|
init() {
|
|
15087
15126
|
this.checkDeviceId = true;
|
|
15088
|
-
this.
|
|
15127
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15089
15128
|
validateParams(this.payload, [
|
|
15090
15129
|
{ name: 'path', required: true },
|
|
15091
15130
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -15252,7 +15291,7 @@ const getFieldType = (typeName, types) => {
|
|
|
15252
15291
|
class EVMSignTypedData extends BaseMethod {
|
|
15253
15292
|
init() {
|
|
15254
15293
|
this.checkDeviceId = true;
|
|
15255
|
-
this.
|
|
15294
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15256
15295
|
validateParams(this.payload, [
|
|
15257
15296
|
{ name: 'path', required: true },
|
|
15258
15297
|
{ name: 'metamaskV4Compat', type: 'boolean' },
|
|
@@ -15419,7 +15458,7 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
15419
15458
|
class EVMSignMessage$1 extends BaseMethod {
|
|
15420
15459
|
init() {
|
|
15421
15460
|
this.checkDeviceId = true;
|
|
15422
|
-
this.
|
|
15461
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15423
15462
|
validateParams(this.payload, [
|
|
15424
15463
|
{ name: 'address', type: 'string', required: true },
|
|
15425
15464
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -15450,7 +15489,7 @@ class StarcoinGetAddress extends BaseMethod {
|
|
|
15450
15489
|
init() {
|
|
15451
15490
|
var _a;
|
|
15452
15491
|
this.checkDeviceId = true;
|
|
15453
|
-
this.
|
|
15492
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15454
15493
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15455
15494
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15456
15495
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15490,7 +15529,7 @@ class StarcoinGetPublicKey extends BaseMethod {
|
|
|
15490
15529
|
init() {
|
|
15491
15530
|
var _a;
|
|
15492
15531
|
this.checkDeviceId = true;
|
|
15493
|
-
this.
|
|
15532
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15494
15533
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15495
15534
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15496
15535
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15525,7 +15564,7 @@ class StarcoinGetPublicKey extends BaseMethod {
|
|
|
15525
15564
|
class StarcoinSignMessage extends BaseMethod {
|
|
15526
15565
|
init() {
|
|
15527
15566
|
this.checkDeviceId = true;
|
|
15528
|
-
this.
|
|
15567
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15529
15568
|
validateParams(this.payload, [
|
|
15530
15569
|
{ name: 'path', required: true },
|
|
15531
15570
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -15548,7 +15587,7 @@ class StarcoinSignMessage extends BaseMethod {
|
|
|
15548
15587
|
class StarcoinSignTransaction extends BaseMethod {
|
|
15549
15588
|
init() {
|
|
15550
15589
|
this.checkDeviceId = true;
|
|
15551
|
-
this.
|
|
15590
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15552
15591
|
validateParams(this.payload, [
|
|
15553
15592
|
{ name: 'path', required: true },
|
|
15554
15593
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -15571,7 +15610,7 @@ class StarcoinSignTransaction extends BaseMethod {
|
|
|
15571
15610
|
class EVMSignMessage extends BaseMethod {
|
|
15572
15611
|
init() {
|
|
15573
15612
|
this.checkDeviceId = true;
|
|
15574
|
-
this.
|
|
15613
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15575
15614
|
validateParams(this.payload, [
|
|
15576
15615
|
{ name: 'publicKey', type: 'string', required: true },
|
|
15577
15616
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -15601,7 +15640,7 @@ class NEMGetAddress extends BaseMethod {
|
|
|
15601
15640
|
init() {
|
|
15602
15641
|
var _a;
|
|
15603
15642
|
this.checkDeviceId = true;
|
|
15604
|
-
this.
|
|
15643
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15605
15644
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15606
15645
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15607
15646
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15808,7 +15847,7 @@ class NEMSignTransaction extends BaseMethod {
|
|
|
15808
15847
|
}
|
|
15809
15848
|
init() {
|
|
15810
15849
|
this.checkDeviceId = true;
|
|
15811
|
-
this.
|
|
15850
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15812
15851
|
validateParams(this.payload, [
|
|
15813
15852
|
{ name: 'path', required: true },
|
|
15814
15853
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -15833,7 +15872,7 @@ class SolGetAddress extends BaseMethod {
|
|
|
15833
15872
|
init() {
|
|
15834
15873
|
var _a;
|
|
15835
15874
|
this.checkDeviceId = true;
|
|
15836
|
-
this.
|
|
15875
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15837
15876
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15838
15877
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15839
15878
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15877,7 +15916,7 @@ class SolSignTransaction extends BaseMethod {
|
|
|
15877
15916
|
init() {
|
|
15878
15917
|
var _a;
|
|
15879
15918
|
this.checkDeviceId = true;
|
|
15880
|
-
this.
|
|
15919
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15881
15920
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15882
15921
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15883
15922
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -15929,7 +15968,7 @@ class StellarGetAddress extends BaseMethod {
|
|
|
15929
15968
|
init() {
|
|
15930
15969
|
var _a;
|
|
15931
15970
|
this.checkDeviceId = true;
|
|
15932
|
-
this.
|
|
15971
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15933
15972
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
15934
15973
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
15935
15974
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16093,7 +16132,7 @@ class StellarSignTransaction extends BaseMethod {
|
|
|
16093
16132
|
}
|
|
16094
16133
|
init() {
|
|
16095
16134
|
this.checkDeviceId = true;
|
|
16096
|
-
this.
|
|
16135
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16097
16136
|
validateParams(this.payload, [
|
|
16098
16137
|
{ name: 'path', required: true },
|
|
16099
16138
|
{ name: 'networkPassphrase', type: 'string', required: true },
|
|
@@ -16146,7 +16185,7 @@ class TronGetAddress extends BaseMethod {
|
|
|
16146
16185
|
init() {
|
|
16147
16186
|
var _a;
|
|
16148
16187
|
this.checkDeviceId = true;
|
|
16149
|
-
this.
|
|
16188
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16150
16189
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16151
16190
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16152
16191
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16192,7 +16231,7 @@ class TronGetAddress extends BaseMethod {
|
|
|
16192
16231
|
class TronSignMessage extends BaseMethod {
|
|
16193
16232
|
init() {
|
|
16194
16233
|
this.checkDeviceId = true;
|
|
16195
|
-
this.
|
|
16234
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16196
16235
|
validateParams(this.payload, [
|
|
16197
16236
|
{ name: 'path', required: true },
|
|
16198
16237
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
@@ -16256,7 +16295,7 @@ class TronSignTransaction extends BaseMethod {
|
|
|
16256
16295
|
}
|
|
16257
16296
|
init() {
|
|
16258
16297
|
this.checkDeviceId = true;
|
|
16259
|
-
this.
|
|
16298
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16260
16299
|
validateParams(this.payload, [
|
|
16261
16300
|
{ name: 'path', required: true },
|
|
16262
16301
|
{ name: 'transaction', type: 'object', required: true },
|
|
@@ -16295,7 +16334,7 @@ class NearGetAddress extends BaseMethod {
|
|
|
16295
16334
|
init() {
|
|
16296
16335
|
var _a;
|
|
16297
16336
|
this.checkDeviceId = true;
|
|
16298
|
-
this.
|
|
16337
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16299
16338
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16300
16339
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16301
16340
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16341,7 +16380,7 @@ class NearGetAddress extends BaseMethod {
|
|
|
16341
16380
|
class NearSignTransaction extends BaseMethod {
|
|
16342
16381
|
init() {
|
|
16343
16382
|
this.checkDeviceId = true;
|
|
16344
|
-
this.
|
|
16383
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16345
16384
|
validateParams(this.payload, [
|
|
16346
16385
|
{ name: 'path', required: true },
|
|
16347
16386
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16376,7 +16415,7 @@ class AptosGetAddress extends BaseMethod {
|
|
|
16376
16415
|
init() {
|
|
16377
16416
|
var _a;
|
|
16378
16417
|
this.checkDeviceId = true;
|
|
16379
|
-
this.
|
|
16418
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16380
16419
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16381
16420
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16382
16421
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16446,7 +16485,7 @@ class AptosGetPublicKey extends BaseMethod {
|
|
|
16446
16485
|
init() {
|
|
16447
16486
|
var _a;
|
|
16448
16487
|
this.checkDeviceId = true;
|
|
16449
|
-
this.
|
|
16488
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16450
16489
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16451
16490
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16452
16491
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16490,7 +16529,7 @@ class AptosGetPublicKey extends BaseMethod {
|
|
|
16490
16529
|
class AptosSignTransaction extends BaseMethod {
|
|
16491
16530
|
init() {
|
|
16492
16531
|
this.checkDeviceId = true;
|
|
16493
|
-
this.
|
|
16532
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16494
16533
|
validateParams(this.payload, [
|
|
16495
16534
|
{ name: 'path', required: true },
|
|
16496
16535
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16520,7 +16559,7 @@ class AptosSignTransaction extends BaseMethod {
|
|
|
16520
16559
|
class AptosSignMessage extends BaseMethod {
|
|
16521
16560
|
init() {
|
|
16522
16561
|
this.checkDeviceId = true;
|
|
16523
|
-
this.
|
|
16562
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16524
16563
|
validateParams(this.payload, [
|
|
16525
16564
|
{ name: 'path', required: true },
|
|
16526
16565
|
{ name: 'payload', type: 'object', required: true },
|
|
@@ -16586,7 +16625,7 @@ class AlgoGetAddress extends BaseMethod {
|
|
|
16586
16625
|
init() {
|
|
16587
16626
|
var _a;
|
|
16588
16627
|
this.checkDeviceId = true;
|
|
16589
|
-
this.
|
|
16628
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16590
16629
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16591
16630
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16592
16631
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16636,7 +16675,7 @@ class AlgoSignTransaction extends BaseMethod {
|
|
|
16636
16675
|
}
|
|
16637
16676
|
init() {
|
|
16638
16677
|
this.checkDeviceId = true;
|
|
16639
|
-
this.
|
|
16678
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16640
16679
|
validateParams(this.payload, [
|
|
16641
16680
|
{ name: 'path', required: true },
|
|
16642
16681
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16675,7 +16714,7 @@ class CosmosGetAddress extends BaseMethod {
|
|
|
16675
16714
|
init() {
|
|
16676
16715
|
var _a;
|
|
16677
16716
|
this.checkDeviceId = true;
|
|
16678
|
-
this.
|
|
16717
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16679
16718
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16680
16719
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16681
16720
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16732,7 +16771,7 @@ class CosmosGetPublicKey extends BaseMethod {
|
|
|
16732
16771
|
init() {
|
|
16733
16772
|
var _a;
|
|
16734
16773
|
this.checkDeviceId = true;
|
|
16735
|
-
this.
|
|
16774
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16736
16775
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16737
16776
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16738
16777
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16792,7 +16831,7 @@ class CosmosSignTransaction extends BaseMethod {
|
|
|
16792
16831
|
}
|
|
16793
16832
|
init() {
|
|
16794
16833
|
this.checkDeviceId = true;
|
|
16795
|
-
this.
|
|
16834
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
16796
16835
|
validateParams(this.payload, [
|
|
16797
16836
|
{ name: 'path', required: true },
|
|
16798
16837
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -16834,7 +16873,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16834
16873
|
init() {
|
|
16835
16874
|
var _a;
|
|
16836
16875
|
this.checkDeviceId = true;
|
|
16837
|
-
this.
|
|
16876
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16838
16877
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16839
16878
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16840
16879
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -16902,7 +16941,7 @@ class XrpGetAddress extends BaseMethod {
|
|
|
16902
16941
|
}
|
|
16903
16942
|
init() {
|
|
16904
16943
|
this.checkDeviceId = true;
|
|
16905
|
-
this.
|
|
16944
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16906
16945
|
const { payload } = this;
|
|
16907
16946
|
validateParams(payload, [
|
|
16908
16947
|
{ name: 'path', required: true },
|
|
@@ -16961,7 +17000,7 @@ class SuiGetAddress extends BaseMethod {
|
|
|
16961
17000
|
init() {
|
|
16962
17001
|
var _a;
|
|
16963
17002
|
this.checkDeviceId = true;
|
|
16964
|
-
this.
|
|
17003
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
16965
17004
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
16966
17005
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16967
17006
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -17034,7 +17073,7 @@ class SuiGetPublicKey extends BaseMethod {
|
|
|
17034
17073
|
init() {
|
|
17035
17074
|
var _a;
|
|
17036
17075
|
this.checkDeviceId = true;
|
|
17037
|
-
this.
|
|
17076
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17038
17077
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17039
17078
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
17040
17079
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -17081,7 +17120,7 @@ class SuiGetPublicKey extends BaseMethod {
|
|
|
17081
17120
|
class SuiSignTransaction extends BaseMethod {
|
|
17082
17121
|
init() {
|
|
17083
17122
|
this.checkDeviceId = true;
|
|
17084
|
-
this.
|
|
17123
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17085
17124
|
validateParams(this.payload, [
|
|
17086
17125
|
{ name: 'path', required: true },
|
|
17087
17126
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -17196,7 +17235,7 @@ class CardanoGetAddress extends BaseMethod {
|
|
|
17196
17235
|
init() {
|
|
17197
17236
|
var _a, _b;
|
|
17198
17237
|
this.checkDeviceId = true;
|
|
17199
|
-
this.
|
|
17238
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17200
17239
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17201
17240
|
this.isCheck = !!((_b = this.payload) === null || _b === void 0 ? void 0 : _b.isCheck);
|
|
17202
17241
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
@@ -17286,7 +17325,7 @@ class CardanoGetPublicKey extends BaseMethod {
|
|
|
17286
17325
|
init() {
|
|
17287
17326
|
var _a;
|
|
17288
17327
|
this.checkDeviceId = true;
|
|
17289
|
-
this.
|
|
17328
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17290
17329
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17291
17330
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
17292
17331
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -17736,7 +17775,7 @@ class CardanoSignTransaction extends BaseMethod {
|
|
|
17736
17775
|
init() {
|
|
17737
17776
|
var _a;
|
|
17738
17777
|
this.checkDeviceId = true;
|
|
17739
|
-
this.
|
|
17778
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17740
17779
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17741
17780
|
const { payload } = this;
|
|
17742
17781
|
validateParams(payload, [
|
|
@@ -17958,7 +17997,7 @@ class CardanoSignTransaction extends BaseMethod {
|
|
|
17958
17997
|
class CardanoSignMessage extends BaseMethod {
|
|
17959
17998
|
init() {
|
|
17960
17999
|
this.checkDeviceId = true;
|
|
17961
|
-
this.
|
|
18000
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17962
18001
|
const { payload } = this;
|
|
17963
18002
|
validateParams(payload, [
|
|
17964
18003
|
{ name: 'path', type: 'string', required: true },
|
|
@@ -18002,7 +18041,7 @@ class FilecoinGetAddress extends BaseMethod {
|
|
|
18002
18041
|
init() {
|
|
18003
18042
|
var _a;
|
|
18004
18043
|
this.checkDeviceId = true;
|
|
18005
|
-
this.
|
|
18044
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
18006
18045
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
18007
18046
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
18008
18047
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -18057,7 +18096,7 @@ class FilecoinSignTransaction extends BaseMethod {
|
|
|
18057
18096
|
}
|
|
18058
18097
|
init() {
|
|
18059
18098
|
this.checkDeviceId = true;
|
|
18060
|
-
this.
|
|
18099
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
18061
18100
|
validateParams(this.payload, [
|
|
18062
18101
|
{ name: 'path', required: true },
|
|
18063
18102
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
@@ -18101,7 +18140,7 @@ class PolkadotGetAddress extends BaseMethod {
|
|
|
18101
18140
|
init() {
|
|
18102
18141
|
var _a;
|
|
18103
18142
|
this.checkDeviceId = true;
|
|
18104
|
-
this.
|
|
18143
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
18105
18144
|
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
18106
18145
|
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
18107
18146
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
@@ -18160,7 +18199,7 @@ class PolkadotSignTransaction extends BaseMethod {
|
|
|
18160
18199
|
}
|
|
18161
18200
|
init() {
|
|
18162
18201
|
this.checkDeviceId = true;
|
|
18163
|
-
this.
|
|
18202
|
+
this.notAllowDeviceMode = [...this.notAllowDeviceMode];
|
|
18164
18203
|
validateParams(this.payload, [
|
|
18165
18204
|
{ name: 'path', required: true },
|
|
18166
18205
|
{ name: 'network', required: true },
|
|
@@ -18480,22 +18519,30 @@ const callAPI = (message) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
18480
18519
|
const versionRangeType = method.getVersionRange()[deviceType];
|
|
18481
18520
|
const versionRangeModel = method.getVersionRange()[deviceModel];
|
|
18482
18521
|
const versionRange = versionRangeType !== null && versionRangeType !== void 0 ? versionRangeType : versionRangeModel;
|
|
18483
|
-
if (
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
}
|
|
18490
|
-
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 });
|
|
18491
18529
|
}
|
|
18492
|
-
if (versionRange
|
|
18493
|
-
|
|
18494
|
-
semver__default["default"].
|
|
18495
|
-
|
|
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
|
+
}
|
|
18496
18543
|
}
|
|
18497
18544
|
}
|
|
18498
|
-
const unexpectedMode = device.hasUnexpectedMode(method.
|
|
18545
|
+
const unexpectedMode = device.hasUnexpectedMode(method.notAllowDeviceMode, method.requireDeviceMode);
|
|
18499
18546
|
if (unexpectedMode) {
|
|
18500
18547
|
if (unexpectedMode === UI_REQUEST$1.NOT_IN_BOOTLOADER) {
|
|
18501
18548
|
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceUnexpectedBootloaderMode));
|