@onekeyfe/hd-core 1.0.33-alpha.5 → 1.0.33-alpha.6

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.
Files changed (129) hide show
  1. package/dist/api/BaseMethod.d.ts +1 -1
  2. package/dist/api/BaseMethod.d.ts.map +1 -1
  3. package/dist/core/index.d.ts.map +1 -1
  4. package/dist/device/Device.d.ts +6 -2
  5. package/dist/device/Device.d.ts.map +1 -1
  6. package/dist/device/DeviceCommands.d.ts +7 -5
  7. package/dist/device/DeviceCommands.d.ts.map +1 -1
  8. package/dist/events/device.d.ts +3 -0
  9. package/dist/events/device.d.ts.map +1 -1
  10. package/dist/events/ui-request.d.ts +3 -2
  11. package/dist/events/ui-request.d.ts.map +1 -1
  12. package/dist/events/ui-response.d.ts +1 -0
  13. package/dist/events/ui-response.d.ts.map +1 -1
  14. package/dist/index.d.ts +18 -8
  15. package/dist/index.js +323 -290
  16. package/dist/utils/deviceFeaturesUtils.d.ts +2 -1
  17. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  18. package/dist/utils/patch.d.ts +1 -1
  19. package/package.json +4 -4
  20. package/src/api/BaseMethod.ts +3 -2
  21. package/src/api/CheckAllFirmwareRelease.ts +1 -1
  22. package/src/api/CheckBLEFirmwareRelease.ts +3 -3
  23. package/src/api/CheckBootloaderRelease.ts +1 -1
  24. package/src/api/CheckBridgeRelease.ts +1 -1
  25. package/src/api/CheckFirmwareRelease.ts +3 -3
  26. package/src/api/CipherKeyValue.ts +1 -1
  27. package/src/api/FirmwareUpdate.ts +1 -1
  28. package/src/api/FirmwareUpdateV2.ts +1 -1
  29. package/src/api/FirmwareUpdateV3.ts +1 -1
  30. package/src/api/GetFeatures.ts +3 -3
  31. package/src/api/GetOnekeyFeatures.ts +3 -3
  32. package/src/api/GetPassphraseState.ts +1 -1
  33. package/src/api/alephium/AlephiumGetAddress.ts +1 -1
  34. package/src/api/alephium/AlephiumSignMessage.ts +1 -1
  35. package/src/api/alephium/AlephiumSignTransaction.ts +1 -1
  36. package/src/api/algo/AlgoGetAddress.ts +1 -1
  37. package/src/api/algo/AlgoSignTransaction.ts +1 -1
  38. package/src/api/allnetwork/AllNetworkGetAddress.ts +1 -1
  39. package/src/api/aptos/AptosGetAddress.ts +1 -1
  40. package/src/api/aptos/AptosGetPublicKey.ts +1 -1
  41. package/src/api/aptos/AptosSignMessage.ts +1 -1
  42. package/src/api/aptos/AptosSignTransaction.ts +1 -1
  43. package/src/api/benfen/BenfenGetAddress.ts +1 -1
  44. package/src/api/benfen/BenfenGetPublicKey.ts +1 -1
  45. package/src/api/benfen/BenfenSignMessage.ts +1 -1
  46. package/src/api/benfen/BenfenSignTransaction.ts +1 -1
  47. package/src/api/btc/BTCGetAddress.ts +1 -1
  48. package/src/api/btc/BTCGetPublicKey.ts +1 -1
  49. package/src/api/btc/BTCSignMessage.ts +1 -1
  50. package/src/api/btc/BTCSignPsbt.ts +1 -1
  51. package/src/api/btc/BTCSignTransaction.ts +1 -1
  52. package/src/api/btc/BTCVerifyMessage.ts +1 -1
  53. package/src/api/cardano/CardanoGetAddress.ts +1 -1
  54. package/src/api/cardano/CardanoGetPublicKey.ts +1 -1
  55. package/src/api/cardano/CardanoSignMessage.ts +1 -1
  56. package/src/api/cardano/CardanoSignTransaction.ts +1 -1
  57. package/src/api/conflux/ConfluxGetAddress.ts +1 -1
  58. package/src/api/conflux/ConfluxSignMessage.ts +1 -1
  59. package/src/api/conflux/ConfluxSignMessageCIP23.ts +1 -1
  60. package/src/api/conflux/ConfluxSignTransaction.ts +1 -1
  61. package/src/api/cosmos/CosmosGetAddress.ts +1 -1
  62. package/src/api/cosmos/CosmosGetPublicKey.ts +1 -1
  63. package/src/api/cosmos/CosmosSignTransaction.ts +1 -1
  64. package/src/api/device/DeviceUpdateBootloader.ts +1 -1
  65. package/src/api/dynex/DnxGetAddress.ts +1 -1
  66. package/src/api/dynex/DnxSignTransaction.ts +1 -1
  67. package/src/api/evm/EVMGetAddress.ts +1 -1
  68. package/src/api/evm/EVMGetPublicKey.ts +1 -1
  69. package/src/api/evm/EVMSignMessage.ts +1 -1
  70. package/src/api/evm/EVMSignMessageEIP712.ts +1 -1
  71. package/src/api/evm/EVMSignTransaction.ts +1 -1
  72. package/src/api/evm/EVMSignTypedData.ts +1 -1
  73. package/src/api/evm/EVMVerifyMessage.ts +1 -1
  74. package/src/api/filecoin/FilecoinGetAddress.ts +1 -1
  75. package/src/api/filecoin/FilecoinSignTransaction.ts +1 -1
  76. package/src/api/kaspa/KaspaGetAddress.ts +1 -1
  77. package/src/api/kaspa/KaspaSignTransaction.ts +1 -1
  78. package/src/api/lightning/LnurlAuth.ts +1 -1
  79. package/src/api/near/NearGetAddress.ts +1 -1
  80. package/src/api/near/NearSignTransaction.ts +1 -1
  81. package/src/api/nem/NEMGetAddress.ts +1 -1
  82. package/src/api/nem/NEMSignTransaction.ts +1 -1
  83. package/src/api/neo/NeoGetAddress.ts +1 -1
  84. package/src/api/neo/NeoSignTransaction.ts +1 -1
  85. package/src/api/nervos/NervosGetAddress.ts +1 -1
  86. package/src/api/nervos/NervosSignTransaction.ts +1 -1
  87. package/src/api/nexa/NexaGetAddress.ts +1 -1
  88. package/src/api/nostr/NostrDecryptMessage.ts +1 -1
  89. package/src/api/nostr/NostrEncryptMessage.ts +1 -1
  90. package/src/api/nostr/NostrGetPublicKey.ts +1 -1
  91. package/src/api/nostr/NostrSignEvent.ts +1 -1
  92. package/src/api/nostr/NostrSignSchnorr.ts +1 -1
  93. package/src/api/polkadot/PolkadotGetAddress.ts +1 -1
  94. package/src/api/polkadot/PolkadotSignTransaction.ts +1 -1
  95. package/src/api/scdo/ScdoGetAddress.ts +1 -1
  96. package/src/api/scdo/ScdoSignMessage.ts +1 -1
  97. package/src/api/scdo/ScdoSignTransaction.ts +1 -1
  98. package/src/api/solana/SolGetAddress.ts +1 -1
  99. package/src/api/solana/SolSignMessage.ts +1 -1
  100. package/src/api/solana/SolSignOffchainMessage.ts +1 -1
  101. package/src/api/solana/SolSignTransaction.ts +1 -1
  102. package/src/api/starcoin/StarcoinGetAddress.ts +1 -1
  103. package/src/api/starcoin/StarcoinGetPublicKey.ts +1 -1
  104. package/src/api/starcoin/StarcoinSignMessage.ts +1 -1
  105. package/src/api/starcoin/StarcoinSignTransaction.ts +1 -1
  106. package/src/api/starcoin/StarcoinVerifyMessage.ts +1 -1
  107. package/src/api/stellar/StellarGetAddress.ts +1 -1
  108. package/src/api/stellar/StellarSignTransaction.ts +1 -1
  109. package/src/api/sui/SuiGetAddress.ts +1 -1
  110. package/src/api/sui/SuiGetPublicKey.ts +1 -1
  111. package/src/api/sui/SuiSignMessage.ts +1 -1
  112. package/src/api/sui/SuiSignTransaction.ts +1 -1
  113. package/src/api/test/TestInitializeDeviceDuration.ts +3 -3
  114. package/src/api/ton/TonGetAddress.ts +1 -1
  115. package/src/api/ton/TonSignMessage.ts +1 -1
  116. package/src/api/ton/TonSignProof.ts +1 -1
  117. package/src/api/tron/TronGetAddress.ts +1 -1
  118. package/src/api/tron/TronSignMessage.ts +1 -1
  119. package/src/api/tron/TronSignTransaction.ts +1 -1
  120. package/src/api/xrp/XrpGetAddress.ts +1 -1
  121. package/src/api/xrp/XrpSignTransaction.ts +1 -1
  122. package/src/core/index.ts +11 -7
  123. package/src/data/messages/messages.json +43 -38
  124. package/src/device/Device.ts +24 -10
  125. package/src/device/DeviceCommands.ts +15 -4
  126. package/src/events/device.ts +4 -0
  127. package/src/events/ui-request.ts +3 -2
  128. package/src/events/ui-response.ts +1 -0
  129. package/src/utils/deviceFeaturesUtils.ts +55 -49
package/dist/index.js CHANGED
@@ -1191,6 +1191,118 @@ const getDeviceBoardloaderVersion = (features) => {
1191
1191
  return [0, 0, 0];
1192
1192
  };
1193
1193
 
1194
+ const HD_HARDENED = 0x80000000;
1195
+ const toHardened = (n) => (n | HD_HARDENED) >>> 0;
1196
+ const fromHardened = (n) => (n & ~HD_HARDENED) >>> 0;
1197
+ const PATH_NOT_VALID = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Not a valid path');
1198
+ const PATH_NEGATIVE_VALUES = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Path cannot contain negative values');
1199
+ const getHDPath = (path) => {
1200
+ const parts = path.toLowerCase().split('/');
1201
+ if (parts[0] !== 'm')
1202
+ throw PATH_NOT_VALID;
1203
+ return parts
1204
+ .filter((p) => p !== 'm' && p !== '')
1205
+ .map((p) => {
1206
+ let hardened = false;
1207
+ if (p.substr(p.length - 1) === "'") {
1208
+ hardened = true;
1209
+ p = p.substr(0, p.length - 1);
1210
+ }
1211
+ let n = parseInt(p);
1212
+ if (Number.isNaN(n)) {
1213
+ throw PATH_NOT_VALID;
1214
+ }
1215
+ else if (n < 0) {
1216
+ throw PATH_NEGATIVE_VALUES;
1217
+ }
1218
+ if (hardened) {
1219
+ n = toHardened(n);
1220
+ }
1221
+ return n;
1222
+ });
1223
+ };
1224
+ const isEqualBip44CoinType = (path, coinType) => isBip44Path(path) && path[1] === toHardened(coinType);
1225
+ const isBip44Path = (path) => Array.isArray(path) && path[0] === toHardened(44);
1226
+ const isMultisigPath = (path) => Array.isArray(path) && path[0] === toHardened(48);
1227
+ const isSegwitPath = (path) => Array.isArray(path) && path[0] === toHardened(49);
1228
+ const isTaprootPath = (path) => Array.isArray(path) && (path[0] === toHardened(86) || path[0] === toHardened(10025));
1229
+ const getScriptType = (path) => {
1230
+ if (!Array.isArray(path) || path.length < 1)
1231
+ return 'SPENDADDRESS';
1232
+ const p1 = fromHardened(path[0]);
1233
+ switch (p1) {
1234
+ case 48:
1235
+ return 'SPENDMULTISIG';
1236
+ case 49:
1237
+ return 'SPENDP2SHWITNESS';
1238
+ case 84:
1239
+ return 'SPENDWITNESS';
1240
+ case 86:
1241
+ case 10025:
1242
+ return 'SPENDTAPROOT';
1243
+ default:
1244
+ return 'SPENDADDRESS';
1245
+ }
1246
+ };
1247
+ const getOutputScriptType = (path) => {
1248
+ if (!Array.isArray(path) || path.length < 1)
1249
+ return 'PAYTOADDRESS';
1250
+ if (path[0] === 49) {
1251
+ return 'PAYTOP2SHWITNESS';
1252
+ }
1253
+ const p = fromHardened(path[0]);
1254
+ switch (p) {
1255
+ case 48:
1256
+ return 'PAYTOMULTISIG';
1257
+ case 49:
1258
+ return 'PAYTOP2SHWITNESS';
1259
+ case 84:
1260
+ return 'PAYTOWITNESS';
1261
+ case 86:
1262
+ case 10025:
1263
+ return 'PAYTOTAPROOT';
1264
+ default:
1265
+ return 'PAYTOADDRESS';
1266
+ }
1267
+ };
1268
+ const serializedPath = (path) => {
1269
+ const pathStr = path
1270
+ .map((p) => {
1271
+ if (p & HD_HARDENED) {
1272
+ return `${p & ~HD_HARDENED}'`;
1273
+ }
1274
+ return p;
1275
+ })
1276
+ .join('/');
1277
+ return `m/${pathStr}`;
1278
+ };
1279
+ const validatePath = (path, length = 0, base = false) => {
1280
+ let valid;
1281
+ if (typeof path === 'string') {
1282
+ valid = getHDPath(path);
1283
+ }
1284
+ else if (Array.isArray(path)) {
1285
+ valid = path.map((p) => {
1286
+ const n = parseInt(p);
1287
+ if (Number.isNaN(n)) {
1288
+ throw PATH_NOT_VALID;
1289
+ }
1290
+ else if (n < 0) {
1291
+ throw PATH_NEGATIVE_VALUES;
1292
+ }
1293
+ return n;
1294
+ });
1295
+ }
1296
+ else {
1297
+ valid = undefined;
1298
+ }
1299
+ if (!valid)
1300
+ throw PATH_NOT_VALID;
1301
+ if (length > 0 && valid.length < length)
1302
+ throw PATH_NOT_VALID;
1303
+ return base ? valid.splice(0, 3) : valid;
1304
+ };
1305
+
1194
1306
  var nested$1 = {
1195
1307
  AlephiumGetAddress: {
1196
1308
  fields: {
@@ -4217,7 +4329,8 @@ var nested$1 = {
4217
4329
  ButtonRequest_Success: 17,
4218
4330
  ButtonRequest_Warning: 18,
4219
4331
  ButtonRequest_PassphraseEntry: 19,
4220
- ButtonRequest_PinEntry: 20
4332
+ ButtonRequest_PinEntry: 20,
4333
+ ButtonRequest_AttachPin: 8000
4221
4334
  }
4222
4335
  }
4223
4336
  }
@@ -4268,6 +4381,10 @@ var nested$1 = {
4268
4381
  options: {
4269
4382
  deprecated: true
4270
4383
  }
4384
+ },
4385
+ exists_attach_pin_user: {
4386
+ type: "bool",
4387
+ id: 8000
4271
4388
  }
4272
4389
  }
4273
4390
  },
@@ -4287,6 +4404,10 @@ var nested$1 = {
4287
4404
  on_device: {
4288
4405
  type: "bool",
4289
4406
  id: 3
4407
+ },
4408
+ on_device_attach_pin: {
4409
+ type: "bool",
4410
+ id: 8000
4290
4411
  }
4291
4412
  }
4292
4413
  },
@@ -4345,38 +4466,6 @@ var nested$1 = {
4345
4466
  fields: {
4346
4467
  }
4347
4468
  },
4348
- GetPassphraseState: {
4349
- fields: {
4350
- btc_test: {
4351
- type: "string",
4352
- id: 1
4353
- },
4354
- only_main_pin: {
4355
- type: "bool",
4356
- id: 2
4357
- },
4358
- session_id: {
4359
- type: "bytes",
4360
- id: 3
4361
- }
4362
- }
4363
- },
4364
- PassphraseState: {
4365
- fields: {
4366
- btc_test: {
4367
- type: "string",
4368
- id: 1
4369
- },
4370
- session_id: {
4371
- type: "bytes",
4372
- id: 2
4373
- },
4374
- attach_to_pin_user: {
4375
- type: "bool",
4376
- id: 3
4377
- }
4378
- }
4379
- },
4380
4469
  ConfluxGetAddress: {
4381
4470
  fields: {
4382
4471
  address_n: {
@@ -7289,7 +7378,7 @@ var nested$1 = {
7289
7378
  },
7290
7379
  btc_test: {
7291
7380
  type: "string",
7292
- id: 4
7381
+ id: 8000
7293
7382
  }
7294
7383
  }
7295
7384
  },
@@ -7670,10 +7759,6 @@ var nested$1 = {
7670
7759
  onekey_se04_state: {
7671
7760
  type: "OneKeySEState",
7672
7761
  id: 624
7673
- },
7674
- attach_to_pin_user: {
7675
- type: "bool",
7676
- id: 625
7677
7762
  }
7678
7763
  },
7679
7764
  nested: {
@@ -8796,6 +8881,38 @@ var nested$1 = {
8796
8881
  }
8797
8882
  }
8798
8883
  },
8884
+ GetPassphraseState: {
8885
+ fields: {
8886
+ passphrase_state: {
8887
+ type: "string",
8888
+ id: 1
8889
+ },
8890
+ _only_main_pin: {
8891
+ type: "bool",
8892
+ id: 2
8893
+ },
8894
+ allow_create_attach_pin: {
8895
+ type: "bool",
8896
+ id: 3
8897
+ }
8898
+ }
8899
+ },
8900
+ PassphraseState: {
8901
+ fields: {
8902
+ passphrase_state: {
8903
+ type: "string",
8904
+ id: 1
8905
+ },
8906
+ session_id: {
8907
+ type: "bytes",
8908
+ id: 2
8909
+ },
8910
+ unlocked_attach_pin: {
8911
+ type: "bool",
8912
+ id: 3
8913
+ }
8914
+ }
8915
+ },
8799
8916
  MoneroTransactionSourceEntry: {
8800
8917
  fields: {
8801
8918
  outputs: {
@@ -24888,8 +25005,7 @@ const supportNewPassphrase = (features) => {
24888
25005
  const getPassphraseStateWithRefreshDeviceInfo = (device, options) => __awaiter(void 0, void 0, void 0, function* () {
24889
25006
  const { features, commands } = device;
24890
25007
  const locked = (features === null || features === void 0 ? void 0 : features.unlocked) === false;
24891
- const sessionId = device.getInternalState();
24892
- const { passphraseState, newSession } = yield getPassphraseState(features, commands, Object.assign({ sessionId }, options));
25008
+ const { passphraseState, newSession, unlockedAttachPin } = yield getPassphraseState(features, commands, Object.assign({}, options));
24893
25009
  if (newSession && passphraseState && (features === null || features === void 0 ? void 0 : features.device_id)) {
24894
25010
  console.log('=====>>>>>> run updateInternalState newSession:', newSession);
24895
25011
  device.updateInternalState(passphraseState, features.device_id, newSession);
@@ -24900,24 +25016,41 @@ const getPassphraseStateWithRefreshDeviceInfo = (device, options) => __awaiter(v
24900
25016
  if (needRefreshWithLocked || needRefreshWithPassphrase) {
24901
25017
  yield device.getFeatures();
24902
25018
  }
24903
- return { passphraseState, newSession };
25019
+ return { passphraseState, newSession, unlockedAttachPin };
24904
25020
  });
24905
25021
  const getPassphraseState = (features, commands, options) => __awaiter(void 0, void 0, void 0, function* () {
24906
25022
  if (!features)
24907
- return { passphraseState: undefined, newSession: undefined };
24908
- console.log('=====>>>>>> getPassphraseState begin: ', options === null || options === void 0 ? void 0 : options.onlyMainPin, options === null || options === void 0 ? void 0 : options.expectPassphraseState, options === null || options === void 0 ? void 0 : options.sessionId);
24909
- const { message, type } = yield commands.typedCall('GetPassphraseState', 'PassphraseState', {
24910
- session_id: options === null || options === void 0 ? void 0 : options.sessionId,
24911
- btc_test: (options === null || options === void 0 ? void 0 : options.onlyMainPin) ? undefined : options === null || options === void 0 ? void 0 : options.expectPassphraseState,
24912
- onlyMainPin: options === null || options === void 0 ? void 0 : options.onlyMainPin,
25023
+ return { passphraseState: undefined, newSession: undefined, unlockedAttachPin: undefined };
25024
+ const firmwareVersion = getDeviceFirmwareVersion(features);
25025
+ const deviceType = getDeviceType(features);
25026
+ if (deviceType === hdShared.EDeviceType.Pro && semver__default["default"].gte(firmwareVersion.join('.'), '4.13.2')) {
25027
+ console.log('=====>>>>>> getPassphraseState begin: ', options === null || options === void 0 ? void 0 : options.onlyMainPin, options === null || options === void 0 ? void 0 : options.expectPassphraseState);
25028
+ const { message, type } = yield commands.typedCall('GetPassphraseState', 'PassphraseState', {
25029
+ passphrase_state: (options === null || options === void 0 ? void 0 : options.onlyMainPin) ? undefined : options === null || options === void 0 ? void 0 : options.expectPassphraseState,
25030
+ });
25031
+ console.log('=====>>>>>> getPassphraseState end: result ', message);
25032
+ if (type === 'CallMethodError') {
25033
+ throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Get the passphrase state error');
25034
+ }
25035
+ return {
25036
+ passphraseState: message.passphrase_state,
25037
+ newSession: message.session_id,
25038
+ unlockedAttachPin: message.unlocked_attach_pin,
25039
+ };
25040
+ }
25041
+ const { message, type } = yield commands.typedCall('GetAddress', 'Address', {
25042
+ address_n: [toHardened(44), toHardened(1), toHardened(0), 0, 0],
25043
+ coin_name: 'Testnet',
25044
+ script_type: 'SPENDADDRESS',
25045
+ show_display: false,
24913
25046
  });
24914
- console.log('=====>>>>>> getPassphraseState end: result ', message);
24915
25047
  if (type === 'CallMethodError') {
24916
25048
  throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Get the passphrase state error');
24917
25049
  }
24918
25050
  return {
24919
- passphraseState: message.btc_test,
24920
- newSession: message.session_id,
25051
+ passphraseState: message.address,
25052
+ newSession: undefined,
25053
+ unlockedAttachPin: undefined,
24921
25054
  };
24922
25055
  });
24923
25056
  const supportBatchPublicKey = (features, options) => {
@@ -25204,118 +25337,6 @@ function checkBootloaderLength(data) {
25204
25337
  return bootloaderLength === data.byteLength;
25205
25338
  }
25206
25339
 
25207
- const HD_HARDENED = 0x80000000;
25208
- const toHardened = (n) => (n | HD_HARDENED) >>> 0;
25209
- const fromHardened = (n) => (n & ~HD_HARDENED) >>> 0;
25210
- const PATH_NOT_VALID = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Not a valid path');
25211
- const PATH_NEGATIVE_VALUES = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Path cannot contain negative values');
25212
- const getHDPath = (path) => {
25213
- const parts = path.toLowerCase().split('/');
25214
- if (parts[0] !== 'm')
25215
- throw PATH_NOT_VALID;
25216
- return parts
25217
- .filter((p) => p !== 'm' && p !== '')
25218
- .map((p) => {
25219
- let hardened = false;
25220
- if (p.substr(p.length - 1) === "'") {
25221
- hardened = true;
25222
- p = p.substr(0, p.length - 1);
25223
- }
25224
- let n = parseInt(p);
25225
- if (Number.isNaN(n)) {
25226
- throw PATH_NOT_VALID;
25227
- }
25228
- else if (n < 0) {
25229
- throw PATH_NEGATIVE_VALUES;
25230
- }
25231
- if (hardened) {
25232
- n = toHardened(n);
25233
- }
25234
- return n;
25235
- });
25236
- };
25237
- const isEqualBip44CoinType = (path, coinType) => isBip44Path(path) && path[1] === toHardened(coinType);
25238
- const isBip44Path = (path) => Array.isArray(path) && path[0] === toHardened(44);
25239
- const isMultisigPath = (path) => Array.isArray(path) && path[0] === toHardened(48);
25240
- const isSegwitPath = (path) => Array.isArray(path) && path[0] === toHardened(49);
25241
- const isTaprootPath = (path) => Array.isArray(path) && (path[0] === toHardened(86) || path[0] === toHardened(10025));
25242
- const getScriptType = (path) => {
25243
- if (!Array.isArray(path) || path.length < 1)
25244
- return 'SPENDADDRESS';
25245
- const p1 = fromHardened(path[0]);
25246
- switch (p1) {
25247
- case 48:
25248
- return 'SPENDMULTISIG';
25249
- case 49:
25250
- return 'SPENDP2SHWITNESS';
25251
- case 84:
25252
- return 'SPENDWITNESS';
25253
- case 86:
25254
- case 10025:
25255
- return 'SPENDTAPROOT';
25256
- default:
25257
- return 'SPENDADDRESS';
25258
- }
25259
- };
25260
- const getOutputScriptType = (path) => {
25261
- if (!Array.isArray(path) || path.length < 1)
25262
- return 'PAYTOADDRESS';
25263
- if (path[0] === 49) {
25264
- return 'PAYTOP2SHWITNESS';
25265
- }
25266
- const p = fromHardened(path[0]);
25267
- switch (p) {
25268
- case 48:
25269
- return 'PAYTOMULTISIG';
25270
- case 49:
25271
- return 'PAYTOP2SHWITNESS';
25272
- case 84:
25273
- return 'PAYTOWITNESS';
25274
- case 86:
25275
- case 10025:
25276
- return 'PAYTOTAPROOT';
25277
- default:
25278
- return 'PAYTOADDRESS';
25279
- }
25280
- };
25281
- const serializedPath = (path) => {
25282
- const pathStr = path
25283
- .map((p) => {
25284
- if (p & HD_HARDENED) {
25285
- return `${p & ~HD_HARDENED}'`;
25286
- }
25287
- return p;
25288
- })
25289
- .join('/');
25290
- return `m/${pathStr}`;
25291
- };
25292
- const validatePath = (path, length = 0, base = false) => {
25293
- let valid;
25294
- if (typeof path === 'string') {
25295
- valid = getHDPath(path);
25296
- }
25297
- else if (Array.isArray(path)) {
25298
- valid = path.map((p) => {
25299
- const n = parseInt(p);
25300
- if (Number.isNaN(n)) {
25301
- throw PATH_NOT_VALID;
25302
- }
25303
- else if (n < 0) {
25304
- throw PATH_NEGATIVE_VALUES;
25305
- }
25306
- return n;
25307
- });
25308
- }
25309
- else {
25310
- valid = undefined;
25311
- }
25312
- if (!valid)
25313
- throw PATH_NOT_VALID;
25314
- if (length > 0 && valid.length < length)
25315
- throw PATH_NOT_VALID;
25316
- return base ? valid.splice(0, 3) : valid;
25317
- };
25318
-
25319
25340
  const getT1Data = () => ({
25320
25341
  default: {
25321
25342
  name: 'default',
@@ -25675,7 +25696,7 @@ const UI_REQUEST = {
25675
25696
  BOOTLOADER: 'ui-device_bootloader_mode',
25676
25697
  NOT_IN_BOOTLOADER: 'ui-device_not_in_bootloader_mode',
25677
25698
  REQUIRE_MODE: 'ui-device_require_mode',
25678
- INITIALIZE: 'ui-device_not_initialized',
25699
+ NOT_INITIALIZE: 'ui-device_not_initialized',
25679
25700
  SEEDLESS: 'ui-device_seedless',
25680
25701
  FIRMWARE_OLD: 'ui-device_firmware_old',
25681
25702
  FIRMWARE_NOT_SUPPORTED: 'ui-device_firmware_unsupported',
@@ -26406,8 +26427,14 @@ class DeviceCommands {
26406
26427
  }, error => Promise.reject(error));
26407
26428
  }
26408
26429
  if (res.type === 'PassphraseRequest') {
26409
- return this._promptPassphrase().then(response => {
26410
- const { passphrase, passphraseOnDevice } = response;
26430
+ const existsAttachPinUser = res.message.exists_attach_pin_user;
26431
+ return this._promptPassphrase({
26432
+ existsAttachPinUser,
26433
+ }).then(response => {
26434
+ const { passphrase, passphraseOnDevice, attachPinOnDevice } = response;
26435
+ if (attachPinOnDevice && existsAttachPinUser) {
26436
+ return this._commonCall('PassphraseAck', { on_device_attach_pin: true });
26437
+ }
26411
26438
  return !passphraseOnDevice
26412
26439
  ? this._commonCall('PassphraseAck', { passphrase })
26413
26440
  : this._commonCall('PassphraseAck', { on_device: true });
@@ -26451,7 +26478,7 @@ class DeviceCommands {
26451
26478
  }
26452
26479
  });
26453
26480
  }
26454
- _promptPassphrase() {
26481
+ _promptPassphrase(options) {
26455
26482
  return new Promise((resolve, reject) => {
26456
26483
  const cancelAndReject = (_error) => cancelDeviceInPrompt(this.device, false)
26457
26484
  .then(onCancel => {
@@ -26469,7 +26496,7 @@ class DeviceCommands {
26469
26496
  });
26470
26497
  if (this.device.listenerCount(DEVICE.PASSPHRASE) > 0) {
26471
26498
  this.device.setCancelableAction(cancelAndReject);
26472
- this.device.emit(DEVICE.PASSPHRASE, this.device, (response, error) => {
26499
+ this.device.emit(DEVICE.PASSPHRASE, this.device, options, (response, error) => {
26473
26500
  this.device.clearCancelableAction();
26474
26501
  if (error) {
26475
26502
  cancelAndReject();
@@ -26719,7 +26746,7 @@ class Device extends events.exports {
26719
26746
  if (options === null || options === void 0 ? void 0 : options.deriveCardano) {
26720
26747
  payload.derive_cardano = true;
26721
26748
  }
26722
- payload.btc_test = options === null || options === void 0 ? void 0 : options.passphraseState;
26749
+ payload.passphrase_state = options === null || options === void 0 ? void 0 : options.passphraseState;
26723
26750
  console.log('=====>>>>>> initialize device begin: ', payload, {
26724
26751
  deviceId: options === null || options === void 0 ? void 0 : options.deviceId,
26725
26752
  passphraseState: options === null || options === void 0 ? void 0 : options.passphraseState,
@@ -26961,8 +26988,8 @@ class Device extends events.exports {
26961
26988
  if (this.isBootloader() && !allow.includes(UI_REQUEST.BOOTLOADER)) {
26962
26989
  return UI_REQUEST.BOOTLOADER;
26963
26990
  }
26964
- if (!this.isInitialized() && !allow.includes(UI_REQUEST.INITIALIZE)) {
26965
- return UI_REQUEST.INITIALIZE;
26991
+ if (!this.isInitialized() && !allow.includes(UI_REQUEST.NOT_INITIALIZE)) {
26992
+ return UI_REQUEST.NOT_INITIALIZE;
26966
26993
  }
26967
26994
  if (this.isSeedless() && !allow.includes(UI_REQUEST.SEEDLESS)) {
26968
26995
  return UI_REQUEST.SEEDLESS;
@@ -26990,10 +27017,14 @@ class Device extends events.exports {
26990
27017
  return __awaiter(this, void 0, void 0, function* () {
26991
27018
  if (!this.features)
26992
27019
  return false;
26993
- const { passphraseState: newPassphraseState } = yield getPassphraseStateWithRefreshDeviceInfo(this, {
27020
+ const { passphraseState: newPassphraseState, unlockedAttachPin } = yield getPassphraseStateWithRefreshDeviceInfo(this, {
26994
27021
  expectPassphraseState: passphraseState,
26995
27022
  onlyMainPin: useEmptyPassphraseState,
26996
27023
  });
27024
+ if (unlockedAttachPin && useEmptyPassphraseState) {
27025
+ this.clearInternalState();
27026
+ return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceCheckUnlockTypeError));
27027
+ }
26997
27028
  if (passphraseState && passphraseState !== newPassphraseState) {
26998
27029
  this.clearInternalState();
26999
27030
  return false;
@@ -27096,7 +27127,7 @@ class BaseMethod {
27096
27127
  this.connectId = payload.connectId || '';
27097
27128
  this.deviceId = payload.deviceId || '';
27098
27129
  this.useDevice = true;
27099
- this.notAllowDeviceMode = [UI_REQUEST.INITIALIZE];
27130
+ this.allowDeviceMode = [UI_REQUEST.NOT_INITIALIZE];
27100
27131
  this.requireDeviceMode = [];
27101
27132
  }
27102
27133
  getVersionRange() {
@@ -27162,9 +27193,9 @@ class BaseMethod {
27162
27193
 
27163
27194
  class TestInitializeDeviceDuration extends BaseMethod {
27164
27195
  init() {
27165
- this.notAllowDeviceMode = [
27166
- ...this.notAllowDeviceMode,
27167
- UI_REQUEST.INITIALIZE,
27196
+ this.allowDeviceMode = [
27197
+ ...this.allowDeviceMode,
27198
+ UI_REQUEST.NOT_INITIALIZE,
27168
27199
  UI_REQUEST.BOOTLOADER,
27169
27200
  ];
27170
27201
  this.useDevicePassphraseState = false;
@@ -27214,9 +27245,9 @@ class SearchDevices extends BaseMethod {
27214
27245
 
27215
27246
  class GetFeatures extends BaseMethod {
27216
27247
  init() {
27217
- this.notAllowDeviceMode = [
27218
- ...this.notAllowDeviceMode,
27219
- UI_REQUEST.INITIALIZE,
27248
+ this.allowDeviceMode = [
27249
+ ...this.allowDeviceMode,
27250
+ UI_REQUEST.NOT_INITIALIZE,
27220
27251
  UI_REQUEST.BOOTLOADER,
27221
27252
  ];
27222
27253
  this.useDevicePassphraseState = false;
@@ -27233,9 +27264,9 @@ class GetFeatures extends BaseMethod {
27233
27264
 
27234
27265
  class GetOnekeyFeatures extends BaseMethod {
27235
27266
  init() {
27236
- this.notAllowDeviceMode = [
27237
- ...this.notAllowDeviceMode,
27238
- UI_REQUEST.INITIALIZE,
27267
+ this.allowDeviceMode = [
27268
+ ...this.allowDeviceMode,
27269
+ UI_REQUEST.NOT_INITIALIZE,
27239
27270
  UI_REQUEST.BOOTLOADER,
27240
27271
  ];
27241
27272
  this.useDevicePassphraseState = false;
@@ -27254,7 +27285,7 @@ class GetOnekeyFeatures extends BaseMethod {
27254
27285
 
27255
27286
  class GetPassphraseState extends BaseMethod {
27256
27287
  init() {
27257
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
27288
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
27258
27289
  this.useDevicePassphraseState = false;
27259
27290
  }
27260
27291
  run() {
@@ -27308,9 +27339,9 @@ class GetLogs extends BaseMethod {
27308
27339
 
27309
27340
  class CheckFirmwareRelease extends BaseMethod {
27310
27341
  init() {
27311
- this.notAllowDeviceMode = [
27312
- ...this.notAllowDeviceMode,
27313
- UI_REQUEST.INITIALIZE,
27342
+ this.allowDeviceMode = [
27343
+ ...this.allowDeviceMode,
27344
+ UI_REQUEST.NOT_INITIALIZE,
27314
27345
  UI_REQUEST.BOOTLOADER,
27315
27346
  ];
27316
27347
  this.useDevicePassphraseState = false;
@@ -27327,9 +27358,9 @@ class CheckFirmwareRelease extends BaseMethod {
27327
27358
 
27328
27359
  class CheckBLEFirmwareRelease extends BaseMethod {
27329
27360
  init() {
27330
- this.notAllowDeviceMode = [
27331
- ...this.notAllowDeviceMode,
27332
- UI_REQUEST.INITIALIZE,
27361
+ this.allowDeviceMode = [
27362
+ ...this.allowDeviceMode,
27363
+ UI_REQUEST.NOT_INITIALIZE,
27333
27364
  UI_REQUEST.BOOTLOADER,
27334
27365
  ];
27335
27366
  this.useDevicePassphraseState = false;
@@ -27430,7 +27461,7 @@ function getBridgeReleaseInfo({ deviceType, currentFirmwareVersion, willUpdateFi
27430
27461
 
27431
27462
  class CheckBridgeRelease extends BaseMethod {
27432
27463
  init() {
27433
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
27464
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
27434
27465
  this.useDevicePassphraseState = false;
27435
27466
  this.skipForceUpdateCheck = true;
27436
27467
  }
@@ -27454,7 +27485,7 @@ class CheckBridgeRelease extends BaseMethod {
27454
27485
 
27455
27486
  class CheckBootloaderRelease extends BaseMethod {
27456
27487
  init() {
27457
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
27488
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
27458
27489
  this.useDevicePassphraseState = false;
27459
27490
  this.skipForceUpdateCheck = true;
27460
27491
  }
@@ -27472,7 +27503,7 @@ class CheckBootloaderRelease extends BaseMethod {
27472
27503
 
27473
27504
  class CheckAllFirmwareRelease extends BaseMethod {
27474
27505
  init() {
27475
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.BOOTLOADER];
27506
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
27476
27507
  this.useDevicePassphraseState = false;
27477
27508
  this.skipForceUpdateCheck = true;
27478
27509
  }
@@ -28467,7 +28498,7 @@ class DeviceUpdateBootloader extends BaseMethod {
28467
28498
  };
28468
28499
  }
28469
28500
  init() {
28470
- this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
28501
+ this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE];
28471
28502
  this.requireDeviceMode = [];
28472
28503
  this.useDevicePassphraseState = false;
28473
28504
  this.skipForceUpdateCheck = true;
@@ -28576,7 +28607,7 @@ class FirmwareUpdate extends BaseMethod {
28576
28607
  };
28577
28608
  }
28578
28609
  init() {
28579
- this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
28610
+ this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE];
28580
28611
  this.requireDeviceMode = [];
28581
28612
  this.useDevicePassphraseState = false;
28582
28613
  this.skipForceUpdateCheck = true;
@@ -28717,7 +28748,7 @@ class FirmwareUpdateV2 extends BaseMethod {
28717
28748
  };
28718
28749
  }
28719
28750
  init() {
28720
- this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
28751
+ this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE];
28721
28752
  this.requireDeviceMode = [];
28722
28753
  this.useDevicePassphraseState = false;
28723
28754
  this.skipForceUpdateCheck = true;
@@ -29254,7 +29285,7 @@ class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod {
29254
29285
  this.checkPromise = null;
29255
29286
  }
29256
29287
  init() {
29257
- this.notAllowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
29288
+ this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE];
29258
29289
  this.requireDeviceMode = [];
29259
29290
  this.useDevicePassphraseState = false;
29260
29291
  this.skipForceUpdateCheck = true;
@@ -29651,7 +29682,7 @@ class CipherKeyValue extends BaseMethod {
29651
29682
  init() {
29652
29683
  var _a;
29653
29684
  this.checkDeviceId = true;
29654
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
29685
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
29655
29686
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
29656
29687
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
29657
29688
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -29881,7 +29912,7 @@ const networkConfigMap = {
29881
29912
  class AllNetworkGetAddress extends BaseMethod {
29882
29913
  init() {
29883
29914
  this.checkDeviceId = true;
29884
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
29915
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
29885
29916
  validateParams(this.payload, [{ name: 'bundle', type: 'array' }]);
29886
29917
  this.payload.bundle.forEach((batch) => {
29887
29918
  validateParams(batch, [
@@ -30320,7 +30351,7 @@ class BTCGetAddress extends BaseMethod {
30320
30351
  }
30321
30352
  init() {
30322
30353
  this.checkDeviceId = true;
30323
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
30354
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
30324
30355
  this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
30325
30356
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
30326
30357
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -30519,7 +30550,7 @@ class BTCGetPublicKey extends BaseMethod {
30519
30550
  }
30520
30551
  init() {
30521
30552
  this.checkDeviceId = true;
30522
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
30553
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
30523
30554
  this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
30524
30555
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
30525
30556
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -30622,7 +30653,7 @@ class BTCGetPublicKey extends BaseMethod {
30622
30653
  class BTCSignMessage extends BaseMethod {
30623
30654
  init() {
30624
30655
  this.checkDeviceId = true;
30625
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
30656
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
30626
30657
  validateParams(this.payload, [
30627
30658
  { name: 'path', required: true },
30628
30659
  { name: 'messageHex', type: 'hexString', required: true },
@@ -30678,7 +30709,7 @@ class BTCSignMessage extends BaseMethod {
30678
30709
  class BTCSignPsbt extends BaseMethod {
30679
30710
  init() {
30680
30711
  this.checkDeviceId = true;
30681
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
30712
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
30682
30713
  validateParams(this.payload, [
30683
30714
  { name: 'psbt', type: 'hexString', required: true },
30684
30715
  { name: 'coin', type: 'string' },
@@ -30996,7 +31027,7 @@ var signtxLegacy = (typedCall, inputs, outputs, refTxsArray, options, coinName)
30996
31027
  class BTCSignTransaction extends BaseMethod {
30997
31028
  init() {
30998
31029
  this.checkDeviceId = true;
30999
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31030
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31000
31031
  validateParams(this.payload, [
31001
31032
  { name: 'coin', type: 'string', required: true },
31002
31033
  { name: 'inputs', type: 'array', required: true },
@@ -31090,7 +31121,7 @@ class BTCSignTransaction extends BaseMethod {
31090
31121
  class BTCVerifyMessage extends BaseMethod {
31091
31122
  init() {
31092
31123
  this.checkDeviceId = true;
31093
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31124
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31094
31125
  validateParams(this.payload, [
31095
31126
  { name: 'address', type: 'string', required: true },
31096
31127
  { name: 'messageHex', type: 'hexString', required: true },
@@ -31125,7 +31156,7 @@ class ConfluxGetAddress extends BaseMethod {
31125
31156
  }
31126
31157
  init() {
31127
31158
  var _a;
31128
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31159
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31129
31160
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
31130
31161
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
31131
31162
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -31176,7 +31207,7 @@ class ConfluxGetAddress extends BaseMethod {
31176
31207
 
31177
31208
  class ConfluxSignMessage extends BaseMethod {
31178
31209
  init() {
31179
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31210
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31180
31211
  validateParams(this.payload, [
31181
31212
  { name: 'path', required: true },
31182
31213
  { name: 'messageHex', type: 'hexString', required: true },
@@ -31205,7 +31236,7 @@ class ConfluxSignMessage extends BaseMethod {
31205
31236
 
31206
31237
  class ConfluxSignMessageCIP23 extends BaseMethod {
31207
31238
  init() {
31208
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31239
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31209
31240
  validateParams(this.payload, [
31210
31241
  { name: 'path', required: true },
31211
31242
  { name: 'domainHash', type: 'hexString', required: true },
@@ -31290,7 +31321,7 @@ class ConfluxSignTransaction extends BaseMethod {
31290
31321
  });
31291
31322
  }
31292
31323
  init() {
31293
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31324
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31294
31325
  validateParams(this.payload, [
31295
31326
  { name: 'path', required: true },
31296
31327
  { name: 'transaction', type: 'object', required: true },
@@ -31355,7 +31386,7 @@ class EvmGetAddress extends BaseMethod {
31355
31386
  init() {
31356
31387
  var _a;
31357
31388
  this.checkDeviceId = true;
31358
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31389
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31359
31390
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
31360
31391
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
31361
31392
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -31440,7 +31471,7 @@ class EVMGetPublicKey extends BaseMethod {
31440
31471
  init() {
31441
31472
  var _a, _b, _c;
31442
31473
  this.checkDeviceId = true;
31443
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31474
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31444
31475
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
31445
31476
  this.useBatch = (_c = (_b = this.payload) === null || _b === void 0 ? void 0 : _b.bundle) === null || _c === void 0 ? void 0 : _c.every((item) => item.showOnOneKey !== true);
31446
31477
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -31531,7 +31562,7 @@ function signMessageLegacyV1 ({ typedCall, params, }) {
31531
31562
  class EVMSignMessage$2 extends BaseMethod {
31532
31563
  init() {
31533
31564
  this.checkDeviceId = true;
31534
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31565
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31535
31566
  validateParams(this.payload, [
31536
31567
  { name: 'path', required: true },
31537
31568
  { name: 'messageHex', type: 'hexString', required: true },
@@ -31564,7 +31595,7 @@ class EVMSignMessage$2 extends BaseMethod {
31564
31595
  class EVMSignMessageEIP712 extends BaseMethod {
31565
31596
  init() {
31566
31597
  this.checkDeviceId = true;
31567
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31598
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31568
31599
  validateParams(this.payload, [
31569
31600
  { name: 'path', required: true },
31570
31601
  { name: 'domainHash', type: 'hexString', required: true },
@@ -31718,7 +31749,7 @@ class EVMSignTransaction extends BaseMethod {
31718
31749
  }
31719
31750
  init() {
31720
31751
  this.checkDeviceId = true;
31721
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31752
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31722
31753
  validateParams(this.payload, [
31723
31754
  { name: 'path', required: true },
31724
31755
  { name: 'transaction', type: 'object', required: true },
@@ -31962,7 +31993,7 @@ const getFieldType = (typeName, types) => {
31962
31993
  class EVMSignTypedData extends BaseMethod {
31963
31994
  init() {
31964
31995
  this.checkDeviceId = true;
31965
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
31996
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
31966
31997
  validateParams(this.payload, [
31967
31998
  { name: 'path', required: true },
31968
31999
  { name: 'metamaskV4Compat', type: 'boolean' },
@@ -32290,7 +32321,7 @@ function verifyMessage ({ typedCall, params, }) {
32290
32321
  class EVMSignMessage$1 extends BaseMethod {
32291
32322
  init() {
32292
32323
  this.checkDeviceId = true;
32293
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32324
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32294
32325
  validateParams(this.payload, [
32295
32326
  { name: 'address', type: 'string', required: true },
32296
32327
  { name: 'messageHex', type: 'hexString', required: true },
@@ -32329,7 +32360,7 @@ class StarcoinGetAddress extends BaseMethod {
32329
32360
  init() {
32330
32361
  var _a;
32331
32362
  this.checkDeviceId = true;
32332
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32363
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32333
32364
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
32334
32365
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
32335
32366
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -32377,7 +32408,7 @@ class StarcoinGetPublicKey extends BaseMethod {
32377
32408
  init() {
32378
32409
  var _a;
32379
32410
  this.checkDeviceId = true;
32380
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32411
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32381
32412
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
32382
32413
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
32383
32414
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -32415,7 +32446,7 @@ class StarcoinGetPublicKey extends BaseMethod {
32415
32446
  class StarcoinSignMessage extends BaseMethod {
32416
32447
  init() {
32417
32448
  this.checkDeviceId = true;
32418
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32449
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32419
32450
  validateParams(this.payload, [
32420
32451
  { name: 'path', required: true },
32421
32452
  { name: 'messageHex', type: 'hexString', required: true },
@@ -32438,7 +32469,7 @@ class StarcoinSignMessage extends BaseMethod {
32438
32469
  class StarcoinSignTransaction extends BaseMethod {
32439
32470
  init() {
32440
32471
  this.checkDeviceId = true;
32441
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32472
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32442
32473
  validateParams(this.payload, [
32443
32474
  { name: 'path', required: true },
32444
32475
  { name: 'rawTx', type: 'hexString', required: true },
@@ -32461,7 +32492,7 @@ class StarcoinSignTransaction extends BaseMethod {
32461
32492
  class EVMSignMessage extends BaseMethod {
32462
32493
  init() {
32463
32494
  this.checkDeviceId = true;
32464
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32495
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32465
32496
  validateParams(this.payload, [
32466
32497
  { name: 'publicKey', type: 'string', required: true },
32467
32498
  { name: 'messageHex', type: 'hexString', required: true },
@@ -32491,7 +32522,7 @@ class NEMGetAddress extends BaseMethod {
32491
32522
  init() {
32492
32523
  var _a;
32493
32524
  this.checkDeviceId = true;
32494
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32525
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32495
32526
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
32496
32527
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
32497
32528
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -32706,7 +32737,7 @@ class NEMSignTransaction extends BaseMethod {
32706
32737
  }
32707
32738
  init() {
32708
32739
  this.checkDeviceId = true;
32709
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32740
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32710
32741
  validateParams(this.payload, [
32711
32742
  { name: 'path', required: true },
32712
32743
  { name: 'transaction', type: 'object', required: true },
@@ -32731,7 +32762,7 @@ class SolGetAddress extends BaseMethod {
32731
32762
  init() {
32732
32763
  var _a;
32733
32764
  this.checkDeviceId = true;
32734
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32765
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32735
32766
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
32736
32767
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
32737
32768
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -32780,7 +32811,7 @@ class SolSignTransaction extends BaseMethod {
32780
32811
  init() {
32781
32812
  var _a;
32782
32813
  this.checkDeviceId = true;
32783
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32814
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32784
32815
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
32785
32816
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
32786
32817
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -32859,7 +32890,7 @@ class SolSignTransaction extends BaseMethod {
32859
32890
  class SolSignOffchainMessage extends BaseMethod {
32860
32891
  init() {
32861
32892
  this.checkDeviceId = true;
32862
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32893
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32863
32894
  validateParams(this.payload, [
32864
32895
  { name: 'path', required: true },
32865
32896
  { name: 'messageHex', type: 'hexString', required: true },
@@ -32901,7 +32932,7 @@ class SolSignOffchainMessage extends BaseMethod {
32901
32932
  class SolSignMessage extends BaseMethod {
32902
32933
  init() {
32903
32934
  this.checkDeviceId = true;
32904
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32935
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32905
32936
  validateParams(this.payload, [
32906
32937
  { name: 'path', required: true },
32907
32938
  { name: 'messageHex', type: 'hexString', required: true },
@@ -32948,7 +32979,7 @@ class StellarGetAddress extends BaseMethod {
32948
32979
  init() {
32949
32980
  var _a;
32950
32981
  this.checkDeviceId = true;
32951
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
32982
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
32952
32983
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
32953
32984
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
32954
32985
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -33117,7 +33148,7 @@ class StellarSignTransaction extends BaseMethod {
33117
33148
  }
33118
33149
  init() {
33119
33150
  this.checkDeviceId = true;
33120
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33151
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33121
33152
  validateParams(this.payload, [
33122
33153
  { name: 'path', required: true },
33123
33154
  { name: 'networkPassphrase', type: 'string', required: true },
@@ -33170,7 +33201,7 @@ class TronGetAddress extends BaseMethod {
33170
33201
  init() {
33171
33202
  var _a;
33172
33203
  this.checkDeviceId = true;
33173
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33204
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33174
33205
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
33175
33206
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
33176
33207
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -33221,7 +33252,7 @@ class TronGetAddress extends BaseMethod {
33221
33252
  class TronSignMessage extends BaseMethod {
33222
33253
  init() {
33223
33254
  this.checkDeviceId = true;
33224
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33255
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33225
33256
  validateParams(this.payload, [
33226
33257
  { name: 'path', required: true },
33227
33258
  { name: 'messageHex', type: 'hexString', required: true },
@@ -33349,7 +33380,7 @@ class TronSignTransaction extends BaseMethod {
33349
33380
  }
33350
33381
  init() {
33351
33382
  this.checkDeviceId = true;
33352
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33383
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33353
33384
  validateParams(this.payload, [
33354
33385
  { name: 'path', required: true },
33355
33386
  { name: 'transaction', type: 'object', required: true },
@@ -33404,7 +33435,7 @@ class NearGetAddress extends BaseMethod {
33404
33435
  init() {
33405
33436
  var _a;
33406
33437
  this.checkDeviceId = true;
33407
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33438
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33408
33439
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
33409
33440
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
33410
33441
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -33455,7 +33486,7 @@ class NearGetAddress extends BaseMethod {
33455
33486
  class NearSignTransaction extends BaseMethod {
33456
33487
  init() {
33457
33488
  this.checkDeviceId = true;
33458
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33489
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33459
33490
  validateParams(this.payload, [
33460
33491
  { name: 'path', required: true },
33461
33492
  { name: 'rawTx', type: 'hexString', required: true },
@@ -33491,7 +33522,7 @@ class AptosGetAddress extends BaseMethod {
33491
33522
  init() {
33492
33523
  var _a, _b;
33493
33524
  this.checkDeviceId = true;
33494
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33525
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33495
33526
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
33496
33527
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
33497
33528
  this.shouldConfirm =
@@ -33586,7 +33617,7 @@ class AptosGetPublicKey extends BaseMethod {
33586
33617
  init() {
33587
33618
  var _a;
33588
33619
  this.checkDeviceId = true;
33589
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33620
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33590
33621
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
33591
33622
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
33592
33623
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -33631,7 +33662,7 @@ class AptosGetPublicKey extends BaseMethod {
33631
33662
  class AptosSignTransaction extends BaseMethod {
33632
33663
  init() {
33633
33664
  this.checkDeviceId = true;
33634
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33665
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33635
33666
  validateParams(this.payload, [
33636
33667
  { name: 'path', required: true },
33637
33668
  { name: 'rawTx', type: 'hexString', required: true },
@@ -33681,7 +33712,7 @@ class AptosSignTransaction extends BaseMethod {
33681
33712
  class AptosSignMessage extends BaseMethod {
33682
33713
  init() {
33683
33714
  this.checkDeviceId = true;
33684
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33715
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33685
33716
  validateParams(this.payload, [
33686
33717
  { name: 'path', required: true },
33687
33718
  { name: 'payload', type: 'object', required: true },
@@ -33747,7 +33778,7 @@ class AlgoGetAddress extends BaseMethod {
33747
33778
  init() {
33748
33779
  var _a;
33749
33780
  this.checkDeviceId = true;
33750
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
33781
+ this.allowDeviceMode = [...this.allowDeviceMode];
33751
33782
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
33752
33783
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
33753
33784
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -33802,7 +33833,7 @@ class AlgoSignTransaction extends BaseMethod {
33802
33833
  }
33803
33834
  init() {
33804
33835
  this.checkDeviceId = true;
33805
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
33836
+ this.allowDeviceMode = [...this.allowDeviceMode];
33806
33837
  validateParams(this.payload, [
33807
33838
  { name: 'path', required: true },
33808
33839
  { name: 'rawTx', type: 'hexString', required: true },
@@ -33841,7 +33872,7 @@ class CosmosGetAddress extends BaseMethod {
33841
33872
  init() {
33842
33873
  var _a;
33843
33874
  this.checkDeviceId = true;
33844
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
33875
+ this.allowDeviceMode = [...this.allowDeviceMode];
33845
33876
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
33846
33877
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
33847
33878
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -33903,7 +33934,7 @@ class CosmosGetPublicKey extends BaseMethod {
33903
33934
  init() {
33904
33935
  var _a;
33905
33936
  this.checkDeviceId = true;
33906
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
33937
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
33907
33938
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
33908
33939
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
33909
33940
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -33964,7 +33995,7 @@ class CosmosSignTransaction extends BaseMethod {
33964
33995
  }
33965
33996
  init() {
33966
33997
  this.checkDeviceId = true;
33967
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
33998
+ this.allowDeviceMode = [...this.allowDeviceMode];
33968
33999
  validateParams(this.payload, [
33969
34000
  { name: 'path', required: true },
33970
34001
  { name: 'rawTx', type: 'hexString', required: true },
@@ -34007,7 +34038,7 @@ class XrpGetAddress$1 extends BaseMethod {
34007
34038
  init() {
34008
34039
  var _a;
34009
34040
  this.checkDeviceId = true;
34010
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34041
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34011
34042
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
34012
34043
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
34013
34044
  this.shouldConfirm = this.hasBundle
@@ -34088,7 +34119,7 @@ class XrpGetAddress extends BaseMethod {
34088
34119
  }
34089
34120
  init() {
34090
34121
  this.checkDeviceId = true;
34091
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34122
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34092
34123
  const { payload } = this;
34093
34124
  validateParams(payload, [
34094
34125
  { name: 'path', required: true },
@@ -34168,7 +34199,7 @@ class SuiGetAddress extends BaseMethod {
34168
34199
  init() {
34169
34200
  var _a, _b;
34170
34201
  this.checkDeviceId = true;
34171
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34202
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34172
34203
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
34173
34204
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
34174
34205
  this.shouldConfirm =
@@ -34260,7 +34291,7 @@ class SuiGetPublicKey extends BaseMethod {
34260
34291
  init() {
34261
34292
  var _a;
34262
34293
  this.checkDeviceId = true;
34263
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34294
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34264
34295
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
34265
34296
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
34266
34297
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -34308,7 +34339,7 @@ class SuiGetPublicKey extends BaseMethod {
34308
34339
  class SuiSignMessage extends BaseMethod {
34309
34340
  init() {
34310
34341
  this.checkDeviceId = true;
34311
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34342
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34312
34343
  validateParams(this.payload, [
34313
34344
  { name: 'path', required: true },
34314
34345
  { name: 'messageHex', type: 'hexString', required: true },
@@ -34361,7 +34392,7 @@ class SuiSignTransaction extends BaseMethod {
34361
34392
  }
34362
34393
  init() {
34363
34394
  this.checkDeviceId = true;
34364
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34395
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34365
34396
  validateParams(this.payload, [
34366
34397
  { name: 'path', required: true },
34367
34398
  { name: 'rawTx', type: 'hexString', required: true },
@@ -34504,7 +34535,7 @@ class CardanoGetAddress extends BaseMethod {
34504
34535
  init() {
34505
34536
  var _a, _b, _c;
34506
34537
  this.checkDeviceId = true;
34507
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34538
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34508
34539
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
34509
34540
  this.isCheck = this.hasBundle
34510
34541
  ? !!((_b = this.payload) === null || _b === void 0 ? void 0 : _b.bundle.every((i) => !!i.isCheck))
@@ -34604,7 +34635,7 @@ class CardanoGetPublicKey extends BaseMethod {
34604
34635
  init() {
34605
34636
  var _a;
34606
34637
  this.checkDeviceId = true;
34607
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
34638
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
34608
34639
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
34609
34640
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
34610
34641
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -35159,7 +35190,7 @@ class CardanoSignTransaction extends BaseMethod {
35159
35190
  init() {
35160
35191
  var _a;
35161
35192
  this.checkDeviceId = true;
35162
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
35193
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
35163
35194
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
35164
35195
  const { payload } = this;
35165
35196
  if (payload.auxiliaryData && payload.auxiliaryData.governanceRegistrationParameters) {
@@ -35394,7 +35425,7 @@ class CardanoSignTransaction extends BaseMethod {
35394
35425
  class CardanoSignMessage extends BaseMethod {
35395
35426
  init() {
35396
35427
  this.checkDeviceId = true;
35397
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
35428
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
35398
35429
  const { payload } = this;
35399
35430
  validateParams(payload, [
35400
35431
  { name: 'path', type: 'string', required: true },
@@ -35435,7 +35466,7 @@ class FilecoinGetAddress extends BaseMethod {
35435
35466
  init() {
35436
35467
  var _a;
35437
35468
  this.checkDeviceId = true;
35438
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
35469
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
35439
35470
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
35440
35471
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
35441
35472
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -35495,7 +35526,7 @@ class FilecoinSignTransaction extends BaseMethod {
35495
35526
  }
35496
35527
  init() {
35497
35528
  this.checkDeviceId = true;
35498
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
35529
+ this.allowDeviceMode = [...this.allowDeviceMode];
35499
35530
  validateParams(this.payload, [
35500
35531
  { name: 'path', required: true },
35501
35532
  { name: 'rawTx', type: 'hexString', required: true },
@@ -35588,7 +35619,7 @@ class PolkadotGetAddress extends BaseMethod {
35588
35619
  init() {
35589
35620
  var _a;
35590
35621
  this.checkDeviceId = true;
35591
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
35622
+ this.allowDeviceMode = [...this.allowDeviceMode];
35592
35623
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
35593
35624
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
35594
35625
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -35650,7 +35681,7 @@ class PolkadotSignTransaction extends BaseMethod {
35650
35681
  }
35651
35682
  init() {
35652
35683
  this.checkDeviceId = true;
35653
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
35684
+ this.allowDeviceMode = [...this.allowDeviceMode];
35654
35685
  validateParams(this.payload, [
35655
35686
  { name: 'path', required: true },
35656
35687
  { name: 'network', required: true },
@@ -35687,7 +35718,7 @@ class KaspaGetAddress extends BaseMethod {
35687
35718
  init() {
35688
35719
  var _a;
35689
35720
  this.checkDeviceId = true;
35690
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
35721
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
35691
35722
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
35692
35723
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
35693
35724
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -36070,7 +36101,7 @@ class KaspaSignTransaction extends BaseMethod {
36070
36101
  init() {
36071
36102
  var _a, _b, _c, _d, _e;
36072
36103
  this.checkDeviceId = true;
36073
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36104
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36074
36105
  const payload = this.payload;
36075
36106
  validateParams(payload, [
36076
36107
  { name: 'version', type: 'number' },
@@ -36181,7 +36212,7 @@ class NexaGetAddress extends BaseMethod {
36181
36212
  init() {
36182
36213
  var _a;
36183
36214
  this.checkDeviceId = true;
36184
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36215
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36185
36216
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
36186
36217
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
36187
36218
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -36315,7 +36346,7 @@ class NostrGetPublicKey extends BaseMethod {
36315
36346
  }
36316
36347
  init() {
36317
36348
  this.checkDeviceId = true;
36318
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36349
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36319
36350
  this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
36320
36351
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
36321
36352
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -36393,7 +36424,7 @@ class NostrSignEvent extends BaseMethod {
36393
36424
  }
36394
36425
  init() {
36395
36426
  this.checkDeviceId = true;
36396
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36427
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36397
36428
  const { payload } = this;
36398
36429
  if (!validateEvent(payload.event)) {
36399
36430
  throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, `Can't serialize event with wrong or missing properties`);
@@ -36442,7 +36473,7 @@ class NostrEncryptMessage extends BaseMethod {
36442
36473
  init() {
36443
36474
  var _a;
36444
36475
  this.checkDeviceId = true;
36445
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36476
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36446
36477
  const { payload } = this;
36447
36478
  validateParams(payload, [
36448
36479
  { name: 'path', required: true },
@@ -36489,7 +36520,7 @@ class NostrDecryptMessage extends BaseMethod {
36489
36520
  init() {
36490
36521
  var _a;
36491
36522
  this.checkDeviceId = true;
36492
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36523
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36493
36524
  const { payload } = this;
36494
36525
  validateParams(payload, [
36495
36526
  { name: 'path', required: true },
@@ -36535,7 +36566,7 @@ class NostrSignSchnorr extends BaseMethod {
36535
36566
  }
36536
36567
  init() {
36537
36568
  this.checkDeviceId = true;
36538
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36569
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36539
36570
  const { payload } = this;
36540
36571
  validateParams(payload, [
36541
36572
  { name: 'path', required: true },
@@ -36576,7 +36607,7 @@ class LnurlAuth1 extends BaseMethod {
36576
36607
  }
36577
36608
  init() {
36578
36609
  this.checkDeviceId = true;
36579
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36610
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36580
36611
  const { payload } = this;
36581
36612
  validateParams(payload, [
36582
36613
  { name: 'domain', type: 'string', required: true },
@@ -36614,7 +36645,7 @@ class NervosGetAddress extends BaseMethod {
36614
36645
  init() {
36615
36646
  var _a;
36616
36647
  this.checkDeviceId = true;
36617
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36648
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36618
36649
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
36619
36650
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
36620
36651
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -36698,7 +36729,7 @@ class NervosSignTransaction extends BaseMethod {
36698
36729
  }
36699
36730
  init() {
36700
36731
  this.checkDeviceId = true;
36701
- this.notAllowDeviceMode = [...this.notAllowDeviceMode];
36732
+ this.allowDeviceMode = [...this.allowDeviceMode];
36702
36733
  validateParams(this.payload, [
36703
36734
  { name: 'path', required: true },
36704
36735
  { name: 'rawTx', type: 'hexString', required: true },
@@ -36750,7 +36781,7 @@ class DnxGetAddress extends BaseMethod {
36750
36781
  init() {
36751
36782
  var _a;
36752
36783
  this.checkDeviceId = true;
36753
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36784
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36754
36785
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
36755
36786
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
36756
36787
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -36805,7 +36836,7 @@ class DnxSignTransaction extends BaseMethod {
36805
36836
  }
36806
36837
  init() {
36807
36838
  this.checkDeviceId = true;
36808
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36839
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36809
36840
  const { payload } = this;
36810
36841
  const addressN = validatePath(payload.path, 3);
36811
36842
  validateParams(payload, [
@@ -36899,7 +36930,7 @@ class TonGetAddress extends BaseMethod {
36899
36930
  var _a;
36900
36931
  this.strictCheckDeviceSupport = true;
36901
36932
  this.checkDeviceId = true;
36902
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
36933
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36903
36934
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
36904
36935
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
36905
36936
  this.shouldConfirm = this.hasBundle
@@ -36986,7 +37017,7 @@ class TonSignMessage extends BaseMethod {
36986
37017
  init() {
36987
37018
  this.strictCheckDeviceSupport = true;
36988
37019
  this.checkDeviceId = true;
36989
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37020
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
36990
37021
  validateParams(this.payload, [
36991
37022
  { name: 'path', required: true },
36992
37023
  { name: 'destination', type: 'string' },
@@ -37130,7 +37161,7 @@ class TonSignProof extends BaseMethod {
37130
37161
  init() {
37131
37162
  this.strictCheckDeviceSupport = true;
37132
37163
  this.checkDeviceId = true;
37133
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37164
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37134
37165
  validateParams(this.payload, [
37135
37166
  { name: 'path', required: true },
37136
37167
  { name: 'appdomain', type: 'string' },
@@ -37182,7 +37213,7 @@ class ScdoGetAddress extends BaseMethod {
37182
37213
  init() {
37183
37214
  var _a;
37184
37215
  this.checkDeviceId = true;
37185
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37216
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37186
37217
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
37187
37218
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
37188
37219
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -37250,7 +37281,7 @@ class ScdoSignTransaction extends BaseMethod {
37250
37281
  }
37251
37282
  init() {
37252
37283
  this.checkDeviceId = true;
37253
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37284
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37254
37285
  validateParams(this.payload, [
37255
37286
  { name: 'path', required: true },
37256
37287
  { name: 'nonce', required: true },
@@ -37303,7 +37334,7 @@ class ScdoSignTransaction extends BaseMethod {
37303
37334
  class ScdoSignMessage extends BaseMethod {
37304
37335
  init() {
37305
37336
  this.checkDeviceId = true;
37306
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37337
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37307
37338
  validateParams(this.payload, [
37308
37339
  { name: 'path', required: true },
37309
37340
  { name: 'messageHex', type: 'hexString', required: true },
@@ -37338,7 +37369,7 @@ class AlephiumGetAddress extends BaseMethod {
37338
37369
  init() {
37339
37370
  var _a;
37340
37371
  this.checkDeviceId = true;
37341
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37372
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37342
37373
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
37343
37374
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
37344
37375
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -37425,7 +37456,7 @@ class AlephiumSignTransaction extends BaseMethod {
37425
37456
  }
37426
37457
  init() {
37427
37458
  this.checkDeviceId = true;
37428
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37459
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37429
37460
  validateParams(this.payload, [
37430
37461
  { name: 'path', required: true },
37431
37462
  { name: 'rawTx', required: true, type: 'hexString' },
@@ -37466,7 +37497,7 @@ class AlephiumSignTransaction extends BaseMethod {
37466
37497
  class AlephiumSignMessage extends BaseMethod {
37467
37498
  init() {
37468
37499
  this.checkDeviceId = true;
37469
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37500
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37470
37501
  validateParams(this.payload, [
37471
37502
  { name: 'path', required: true },
37472
37503
  { name: 'messageHex', type: 'hexString', required: true },
@@ -37533,7 +37564,7 @@ class BenfenGetAddress extends BaseMethod {
37533
37564
  init() {
37534
37565
  var _a, _b;
37535
37566
  this.checkDeviceId = true;
37536
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37567
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37537
37568
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
37538
37569
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
37539
37570
  this.shouldConfirm =
@@ -37624,7 +37655,7 @@ class BenfenGetPublicKey extends BaseMethod {
37624
37655
  init() {
37625
37656
  var _a;
37626
37657
  this.checkDeviceId = true;
37627
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37658
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37628
37659
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
37629
37660
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
37630
37661
  validateParams(payload, [{ name: 'bundle', type: 'array' }]);
@@ -37671,7 +37702,7 @@ class BenfenGetPublicKey extends BaseMethod {
37671
37702
  class BenfenSignMessage extends BaseMethod {
37672
37703
  init() {
37673
37704
  this.checkDeviceId = true;
37674
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37705
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37675
37706
  validateParams(this.payload, [
37676
37707
  { name: 'path', required: true },
37677
37708
  { name: 'messageHex', type: 'hexString', required: true },
@@ -37724,7 +37755,7 @@ class BenfenSignTransaction extends BaseMethod {
37724
37755
  }
37725
37756
  init() {
37726
37757
  this.checkDeviceId = true;
37727
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37758
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37728
37759
  validateParams(this.payload, [
37729
37760
  { name: 'path', required: true },
37730
37761
  { name: 'rawTx', type: 'hexString', required: true },
@@ -37772,7 +37803,7 @@ class NeoGetAddress extends BaseMethod {
37772
37803
  init() {
37773
37804
  var _a;
37774
37805
  this.checkDeviceId = true;
37775
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37806
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37776
37807
  this.strictCheckDeviceSupport = true;
37777
37808
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
37778
37809
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -37831,7 +37862,7 @@ class NeoGetAddress extends BaseMethod {
37831
37862
  class NeoSignTransaction extends BaseMethod {
37832
37863
  init() {
37833
37864
  this.checkDeviceId = true;
37834
- this.notAllowDeviceMode = [...this.notAllowDeviceMode, UI_REQUEST.INITIALIZE];
37865
+ this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
37835
37866
  this.strictCheckDeviceSupport = true;
37836
37867
  validateParams(this.payload, [
37837
37868
  { name: 'path', required: true },
@@ -38382,7 +38413,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
38382
38413
  throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotSupportMethod);
38383
38414
  }
38384
38415
  }
38385
- const unexpectedMode = device.hasUnexpectedMode(method.notAllowDeviceMode, method.requireDeviceMode);
38416
+ const unexpectedMode = device.hasUnexpectedMode(method.allowDeviceMode, method.requireDeviceMode);
38386
38417
  if (unexpectedMode) {
38387
38418
  if (unexpectedMode === UI_REQUEST.NOT_IN_BOOTLOADER) {
38388
38419
  return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RequiredButInBootloaderMode));
@@ -38787,11 +38818,11 @@ const onDevicePinHandler = (...[device, type, callback]) => __awaiter(void 0, vo
38787
38818
  });
38788
38819
  const onDeviceButtonHandler = (...[device, request]) => {
38789
38820
  postMessage(createDeviceMessage(DEVICE.BUTTON, Object.assign(Object.assign({}, request), { device: device.toMessageObject() })));
38790
- if (request.code === 'ButtonRequest_PinEntry') {
38791
- Log.log('request Confirm Input PIN');
38821
+ if (request.code === 'ButtonRequest_PinEntry' || request.code === 'ButtonRequest_AttachPin') {
38822
+ Log.log('request Confirm Input PIN or Attach PIN');
38792
38823
  postMessage(createUiMessage(UI_REQUEST.REQUEST_PIN, {
38793
38824
  device: device.toMessageObject(),
38794
- type: 'ButtonRequest_PinEntry',
38825
+ type: request.code,
38795
38826
  }));
38796
38827
  }
38797
38828
  else {
@@ -38802,22 +38833,24 @@ const onDeviceButtonHandler = (...[device, request]) => {
38802
38833
  const onDeviceFeaturesHandler = (...[_, features]) => {
38803
38834
  postMessage(createDeviceMessage(DEVICE.FEATURES, Object.assign({}, features)));
38804
38835
  };
38805
- const onDevicePassphraseHandler = (...[device, callback]) => __awaiter(void 0, void 0, void 0, function* () {
38836
+ const onDevicePassphraseHandler = (...[device, requestPayload, callback]) => __awaiter(void 0, void 0, void 0, function* () {
38806
38837
  Log.debug('onDevicePassphraseHandler');
38807
38838
  const uiPromise = createUiPromise(UI_RESPONSE.RECEIVE_PASSPHRASE, device);
38808
38839
  postMessage(createUiMessage(UI_REQUEST.REQUEST_PASSPHRASE, {
38809
38840
  device: device.toMessageObject(),
38810
38841
  passphraseState: device.passphraseState,
38842
+ existsAttachPinUser: requestPayload.existsAttachPinUser,
38811
38843
  }));
38812
38844
  const uiResp = yield uiPromise.promise;
38813
- const { value, passphraseOnDevice, save } = uiResp.payload;
38845
+ const { value, passphraseOnDevice, save, attachPinOnDevice } = uiResp.payload;
38814
38846
  callback({
38815
38847
  passphrase: value.normalize('NFKD'),
38816
38848
  passphraseOnDevice,
38849
+ attachPinOnDevice,
38817
38850
  cache: save,
38818
38851
  });
38819
38852
  });
38820
- const onEmptyPassphraseHandler = (...[_, callback]) => {
38853
+ const onEmptyPassphraseHandler = (...[_, , callback]) => {
38821
38854
  Log.debug('onEmptyPassphraseHandler');
38822
38855
  callback({ passphrase: '' });
38823
38856
  };