@trezor/connect 9.1.12 → 9.2.1

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 (102) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +1 -1
  3. package/lib/api/binance/api/binanceSignTransaction.d.ts +1 -1
  4. package/lib/api/binance/binanceSignTx.d.ts +1 -1
  5. package/lib/api/bitcoin/Fees.d.ts +2 -2
  6. package/lib/api/bitcoin/TransactionComposer.d.ts +2 -2
  7. package/lib/api/bitcoin/refTx.js +3 -4
  8. package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
  9. package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
  10. package/lib/api/changeLanguage.d.ts +11 -0
  11. package/lib/api/changeLanguage.js +73 -0
  12. package/lib/api/common/paramsValidator.js +4 -5
  13. package/lib/api/eos/eosSignTx.d.ts +58 -58
  14. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +8 -6
  15. package/lib/api/ethereum/api/ethereumSignMessage.d.ts +2 -2
  16. package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +2 -2
  17. package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +2 -2
  18. package/lib/api/ethereum/api/ethereumSignTypedData.js +2 -2
  19. package/lib/api/ethereum/ethereumDefinitions.d.ts +2 -2
  20. package/lib/api/ethereum/ethereumSignTx.d.ts +3 -3
  21. package/lib/api/firmware/getBinary.d.ts +1 -1
  22. package/lib/api/firmware/getBinary.js +4 -5
  23. package/lib/api/firmware/modifyFirmware.js +2 -3
  24. package/lib/api/firmware/verifyAuthenticityProof.js +3 -3
  25. package/lib/api/getAccountInfo.d.ts +2 -0
  26. package/lib/api/getAccountInfo.js +3 -0
  27. package/lib/api/getCoinInfo.d.ts +22 -22
  28. package/lib/api/getFeatures.d.ts +13 -12
  29. package/lib/api/getPublicKey.d.ts +8 -6
  30. package/lib/api/index.d.ts +1 -0
  31. package/lib/api/index.js +3 -1
  32. package/lib/api/nem/nemSignTx.d.ts +13 -13
  33. package/lib/api/rebootToBootloader.d.ts +2 -1
  34. package/lib/api/rebootToBootloader.js +10 -1
  35. package/lib/api/recoveryDevice.d.ts +1 -0
  36. package/lib/api/recoveryDevice.js +3 -0
  37. package/lib/api/stellar/stellarSignTx.d.ts +1 -1
  38. package/lib/api/stellar/stellarSignTx.js +6 -0
  39. package/lib/api/tezos/tezosSignTx.d.ts +18 -18
  40. package/lib/backend/BackendManager.d.ts +4 -2
  41. package/lib/backend/BackendManager.js +55 -21
  42. package/lib/backend/Blockchain.d.ts +6 -6
  43. package/lib/backend/Blockchain.js +37 -27
  44. package/lib/constants/index.d.ts +1 -1
  45. package/lib/constants/index.js +2 -1
  46. package/lib/core/AbstractMethod.d.ts +1 -1
  47. package/lib/core/AbstractMethod.js +3 -4
  48. package/lib/core/index.js +23 -11
  49. package/lib/data/DataManager.d.ts +2 -2
  50. package/lib/data/coinInfo.d.ts +117 -117
  51. package/lib/data/coinInfo.js +6 -6
  52. package/lib/data/config.js +1 -1
  53. package/lib/data/connectSettings.js +3 -0
  54. package/lib/data/deviceAuthenticityConfig.js +4 -1
  55. package/lib/data/firmwareInfo.d.ts +1 -1
  56. package/lib/data/firmwareInfo.js +14 -12
  57. package/lib/data/version.d.ts +1 -1
  58. package/lib/data/version.js +1 -1
  59. package/lib/device/Device.d.ts +5 -4
  60. package/lib/device/Device.js +13 -11
  61. package/lib/device/DeviceCommands.d.ts +11 -7
  62. package/lib/device/DeviceCommands.js +12 -9
  63. package/lib/device/DeviceList.d.ts +1 -1
  64. package/lib/device/DeviceList.js +3 -3
  65. package/lib/device/resolveDescriptorForTaproot.d.ts +15 -0
  66. package/lib/device/resolveDescriptorForTaproot.js +26 -0
  67. package/lib/events/blockchain.d.ts +10 -2
  68. package/lib/events/blockchain.js +1 -0
  69. package/lib/events/call.d.ts +2 -2
  70. package/lib/events/core.d.ts +4 -0
  71. package/lib/events/popup.d.ts +13 -1
  72. package/lib/events/ui-promise.d.ts +1 -1
  73. package/lib/events/webextension.d.ts +1 -0
  74. package/lib/events/webextension.js +1 -0
  75. package/lib/factory.js +1 -0
  76. package/lib/index.js +2 -2
  77. package/lib/types/account.d.ts +2 -0
  78. package/lib/types/api/applySettings.d.ts +6 -6
  79. package/lib/types/api/changeLanguage.d.ts +15 -0
  80. package/lib/types/api/changeLanguage.js +17 -0
  81. package/lib/types/api/getAddress.d.ts +5 -5
  82. package/lib/types/api/getPublicKey.d.ts +1 -0
  83. package/lib/types/api/getPublicKey.js +1 -0
  84. package/lib/types/api/index.d.ts +2 -0
  85. package/lib/types/api/rebootToBootloader.d.ts +2 -2
  86. package/lib/types/api/recoveryDevice.d.ts +1 -1
  87. package/lib/types/api/stellar/index.d.ts +23 -0
  88. package/lib/types/api/stellar/index.js +13 -1
  89. package/lib/types/device.d.ts +4 -1
  90. package/lib/types/device.js +2 -2
  91. package/lib/types/firmware.d.ts +2 -0
  92. package/lib/types/index.d.ts +1 -1
  93. package/lib/types/settings.d.ts +1 -0
  94. package/lib/utils/assets-browser.d.ts +1 -1
  95. package/lib/utils/assets.d.ts +3 -1
  96. package/lib/utils/assets.js +2 -2
  97. package/lib/utils/deviceFeaturesUtils.js +4 -5
  98. package/lib/utils/firmwareUtils.js +4 -5
  99. package/lib/utils/hdnodeUtils.d.ts +3 -3
  100. package/lib/utils/pathUtils.d.ts +3 -3
  101. package/lib/utils/urlUtils.js +3 -3
  102. package/package.json +26 -28
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBinary = void 0;
4
- const tslib_1 = require("tslib");
5
- const versionUtils = tslib_1.__importStar(require("@trezor/utils/lib/versionUtils"));
4
+ const utils_1 = require("@trezor/utils");
6
5
  const assets_1 = require("../../utils/assets");
7
6
  const firmwareUtils_1 = require("../../utils/firmwareUtils");
8
7
  const firmwareInfo_1 = require("../../data/firmwareInfo");
@@ -15,15 +14,15 @@ const getBinary = ({ features, releases, baseUrl, version, btcOnly, intermediary
15
14
  }
16
15
  const infoByBootloader = (0, firmwareInfo_1.getInfo)({ features, releases });
17
16
  const releaseByFirmware = releases.find(r => version &&
18
- versionUtils.isVersionArray(version) &&
19
- versionUtils.isEqual(r.version, version));
17
+ utils_1.versionUtils.isVersionArray(version) &&
18
+ utils_1.versionUtils.isEqual(r.version, version));
20
19
  if (!infoByBootloader || !releaseByFirmware) {
21
20
  throw new Error('no firmware found for this device');
22
21
  }
23
22
  if (btcOnly && !releaseByFirmware.url_bitcoinonly) {
24
23
  throw new Error(`firmware version ${version} does not exist in btc only variant`);
25
24
  }
26
- if (!versionUtils.isEqual(releaseByFirmware.version, infoByBootloader.release.version)) {
25
+ if (!utils_1.versionUtils.isEqual(releaseByFirmware.version, infoByBootloader.release.version)) {
27
26
  throw new Error('version provided as param does not match firmware version found by features in bootloader');
28
27
  }
29
28
  const fwUrl = releaseByFirmware[btcOnly ? 'url_bitcoinonly' : 'url'];
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stripFwHeaders = exports.shouldStripFwHeaders = void 0;
4
- const tslib_1 = require("tslib");
5
- const versionUtils = tslib_1.__importStar(require("@trezor/utils/lib/versionUtils"));
4
+ const utils_1 = require("@trezor/utils");
6
5
  const shouldStripFwHeaders = (features) => {
7
6
  if (features.major_version === 2)
8
7
  return false;
9
- return versionUtils.isNewerOrEqual([features.major_version, features.minor_version, features.patch_version], [1, 8, 0]);
8
+ return utils_1.versionUtils.isNewerOrEqual([features.major_version, features.minor_version, features.patch_version], [1, 8, 0]);
10
9
  };
11
10
  exports.shouldStripFwHeaders = shouldStripFwHeaders;
12
11
  const stripFwHeaders = (fw) => {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.verifyAuthenticityProof = exports.getRandomChallenge = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const crypto = tslib_1.__importStar(require("crypto"));
6
- const bufferUtils = tslib_1.__importStar(require("@trezor/utils/lib/bufferUtils"));
6
+ const utils_1 = require("@trezor/utils");
7
7
  const x509certificate_1 = require("./x509certificate");
8
8
  const verifySignature = async (rawKey, data, signature) => {
9
9
  const signer = crypto.createVerify('sha256');
@@ -63,9 +63,9 @@ const verifyAuthenticityProof = async ({ certificates, signature, challenge, con
63
63
  const isDeviceCertValid = await verifySignature(Buffer.from(caCert.tbsCertificate.subjectPublicKeyInfo.bits.bytes), deviceCert.tbsCertificate.asn1.raw, deviceCert.signatureValue.bits.bytes);
64
64
  const challengePrefix = Buffer.from('AuthenticateDevice:');
65
65
  const prefixedChallenge = Buffer.concat([
66
- bufferUtils.getChunkSize(challengePrefix.length),
66
+ utils_1.bufferUtils.getChunkSize(challengePrefix.length),
67
67
  challengePrefix,
68
- bufferUtils.getChunkSize(challenge.length),
68
+ utils_1.bufferUtils.getChunkSize(challenge.length),
69
69
  challenge,
70
70
  ]);
71
71
  const isSignatureValid = await verifySignature(Buffer.from(deviceCert.tbsCertificate.subjectPublicKeyInfo.bits.bytes), prefixedChallenge, (0, x509certificate_1.fixSignature)(Buffer.from(signature, 'hex')));
@@ -54,6 +54,7 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
54
54
  ledger: number;
55
55
  seq: number;
56
56
  } | undefined;
57
+ stakingPools?: import("@trezor/blockchain-link-types").StakingPool[] | undefined;
57
58
  path: string;
58
59
  }>;
59
60
  discover(request: Request): Promise<{
@@ -95,6 +96,7 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
95
96
  ledger: number;
96
97
  seq: number;
97
98
  } | undefined;
99
+ stakingPools?: import("@trezor/blockchain-link-types").StakingPool[] | undefined;
98
100
  path: string;
99
101
  }>;
100
102
  dispose(): void;
@@ -171,6 +171,7 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
171
171
  const { address_n } = request;
172
172
  let { descriptor } = request;
173
173
  let legacyXpub;
174
+ let descriptorChecksum;
174
175
  if (this.disposed)
175
176
  break;
176
177
  if (address_n && typeof descriptor !== 'string') {
@@ -183,6 +184,7 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
183
184
  if (accountDescriptor) {
184
185
  descriptor = accountDescriptor.descriptor;
185
186
  legacyXpub = accountDescriptor.legacyXpub;
187
+ descriptorChecksum = accountDescriptor.descriptorChecksum;
186
188
  }
187
189
  }
188
190
  catch (error) {
@@ -233,6 +235,7 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
233
235
  descriptor,
234
236
  legacyXpub,
235
237
  utxo,
238
+ descriptorChecksum,
236
239
  };
237
240
  responses.push(account);
238
241
  sendProgress(i, account);
@@ -10,24 +10,24 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
10
10
  type: string;
11
11
  url: string[];
12
12
  } | undefined;
13
+ name: string;
14
+ slip44: number;
15
+ decimals: number;
13
16
  label: string;
14
17
  blockTime: number;
15
18
  minFee: number;
16
19
  maxFee: number;
17
- name: string;
18
20
  shortcut: string;
19
- slip44: number;
20
21
  support: {
21
22
  T1B1: string | false;
22
23
  T2T1: string | false;
23
24
  T2B1: string | false;
24
25
  connect: boolean;
25
26
  };
26
- decimals: number;
27
27
  defaultFees: {
28
28
  feeLimit?: string | undefined;
29
29
  feePerTx?: string | undefined;
30
- label: "high" | "normal" | "economy" | "low" | "custom";
30
+ label: "normal" | "high" | "economy" | "low" | "custom";
31
31
  feePerUnit: string;
32
32
  blocks: number;
33
33
  }[];
@@ -37,16 +37,6 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
37
37
  xPubMagicSegwit?: number | undefined;
38
38
  taproot?: boolean | undefined;
39
39
  type: "bitcoin";
40
- dustLimit: number;
41
- curveName: string;
42
- forceBip143: boolean;
43
- hashGenesisBlock: string;
44
- maxAddressLength: number;
45
- maxFeeSatoshiKb: number;
46
- minAddressLength: number;
47
- minFeeSatoshiKb: number;
48
- segwit: boolean;
49
- xPubMagic: number;
50
40
  network: {
51
41
  forkId?: number | undefined;
52
42
  messagePrefix: string;
@@ -59,30 +49,40 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
59
49
  scriptHash: number;
60
50
  wif: number;
61
51
  };
52
+ dustLimit: number;
53
+ curveName: string;
54
+ forceBip143: boolean;
55
+ hashGenesisBlock: string;
56
+ maxAddressLength: number;
57
+ maxFeeSatoshiKb: number;
58
+ minAddressLength: number;
59
+ minFeeSatoshiKb: number;
60
+ segwit: boolean;
61
+ xPubMagic: number;
62
62
  isBitcoin: boolean;
63
63
  }) | ({
64
64
  blockchainLink?: {
65
65
  type: string;
66
66
  url: string[];
67
67
  } | undefined;
68
+ name: string;
69
+ slip44: number;
70
+ decimals: number;
68
71
  label: string;
69
72
  blockTime: number;
70
73
  minFee: number;
71
74
  maxFee: number;
72
- name: string;
73
75
  shortcut: string;
74
- slip44: number;
75
76
  support: {
76
77
  T1B1: string | false;
77
78
  T2T1: string | false;
78
79
  T2B1: string | false;
79
80
  connect: boolean;
80
81
  };
81
- decimals: number;
82
82
  defaultFees: {
83
83
  feeLimit?: string | undefined;
84
84
  feePerTx?: string | undefined;
85
- label: "high" | "normal" | "economy" | "low" | "custom";
85
+ label: "normal" | "high" | "economy" | "low" | "custom";
86
86
  feePerUnit: string;
87
87
  blocks: number;
88
88
  }[];
@@ -95,24 +95,24 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
95
95
  type: string;
96
96
  url: string[];
97
97
  } | undefined;
98
+ name: string;
99
+ slip44: number;
100
+ decimals: number;
98
101
  label: string;
99
102
  blockTime: number;
100
103
  minFee: number;
101
104
  maxFee: number;
102
- name: string;
103
105
  shortcut: string;
104
- slip44: number;
105
106
  support: {
106
107
  T1B1: string | false;
107
108
  T2T1: string | false;
108
109
  T2B1: string | false;
109
110
  connect: boolean;
110
111
  };
111
- decimals: number;
112
112
  defaultFees: {
113
113
  feeLimit?: string | undefined;
114
114
  feePerTx?: string | undefined;
115
- label: "high" | "normal" | "economy" | "low" | "custom";
115
+ label: "normal" | "high" | "economy" | "low" | "custom";
116
116
  feePerUnit: string;
117
117
  blocks: number;
118
118
  }[];
@@ -2,23 +2,17 @@ import { AbstractMethod } from '../core/AbstractMethod';
2
2
  export default class GetFeatures extends AbstractMethod<'getFeatures'> {
3
3
  init(): void;
4
4
  run(): Promise<{
5
- hide_passphrase_from_host?: boolean | undefined;
6
5
  _passphrase_cached?: boolean | undefined;
7
6
  busy?: boolean | undefined;
8
7
  homescreen_format?: "Toif" | "Jpeg" | "ToiG" | undefined;
8
+ hide_passphrase_from_host?: boolean | undefined;
9
9
  unit_color?: number | undefined;
10
10
  unit_btconly?: boolean | undefined;
11
11
  homescreen_width?: number | undefined;
12
12
  homescreen_height?: number | undefined;
13
13
  bootloader_locked?: boolean | undefined;
14
- flags: number | null;
15
- language: string | null;
16
- label: string | null;
17
- auto_lock_delay_ms: number | null;
18
- display_rotation: number | null;
19
- passphrase_always_on_device: boolean | null;
20
- safety_checks: "Strict" | "PromptAlways" | "PromptTemporarily" | null;
21
- experimental_features: boolean | null;
14
+ language_version_matches?: boolean | undefined;
15
+ session_id: string | null;
22
16
  vendor: string;
23
17
  major_version: number;
24
18
  minor_version: number;
@@ -27,6 +21,8 @@ export default class GetFeatures extends AbstractMethod<'getFeatures'> {
27
21
  device_id: string | null;
28
22
  pin_protection: boolean | null;
29
23
  passphrase_protection: boolean | null;
24
+ language: string | null;
25
+ label: string | null;
30
26
  initialized: boolean | null;
31
27
  revision: string | null;
32
28
  bootloader_hash: string | null;
@@ -34,6 +30,7 @@ export default class GetFeatures extends AbstractMethod<'getFeatures'> {
34
30
  unlocked: boolean | null;
35
31
  firmware_present: boolean | null;
36
32
  needs_backup: boolean | null;
33
+ flags: number | null;
37
34
  model: string;
38
35
  fw_major: number | null;
39
36
  fw_minor: number | null;
@@ -42,13 +39,17 @@ export default class GetFeatures extends AbstractMethod<'getFeatures'> {
42
39
  unfinished_backup: boolean | null;
43
40
  no_backup: boolean | null;
44
41
  recovery_mode: boolean | null;
45
- capabilities: ("Capability_Bitcoin" | "Capability_Bitcoin_like" | "Capability_Binance" | "Capability_Cardano" | "Capability_Crypto" | "Capability_EOS" | "Capability_Ethereum" | "Capability_Lisk" | "Capability_Monero" | "Capability_NEM" | "Capability_Ripple" | "Capability_Stellar" | "Capability_Tezos" | "Capability_U2F" | "Capability_Shamir" | "Capability_ShamirGroups" | "Capability_PassphraseEntry" | "Capability_Solana")[];
42
+ capabilities: ("Capability_Bitcoin" | "Capability_Bitcoin_like" | "Capability_Binance" | "Capability_Cardano" | "Capability_Crypto" | "Capability_EOS" | "Capability_Ethereum" | "Capability_Lisk" | "Capability_Monero" | "Capability_NEM" | "Capability_Ripple" | "Capability_Stellar" | "Capability_Tezos" | "Capability_U2F" | "Capability_Shamir" | "Capability_ShamirGroups" | "Capability_PassphraseEntry" | "Capability_Solana" | "Capability_Translations")[];
46
43
  backup_type: "Bip39" | "Slip39_Basic" | "Slip39_Advanced" | null;
47
44
  sd_card_present: boolean | null;
48
45
  sd_protection: boolean | null;
49
46
  wipe_code_protection: boolean | null;
50
- session_id: string | null;
51
- internal_model: import("@trezor/protobuf/lib/messages-schema").DeviceModelInternal;
47
+ passphrase_always_on_device: boolean | null;
48
+ safety_checks: "Strict" | "PromptAlways" | "PromptTemporarily" | null;
49
+ auto_lock_delay_ms: number | null;
50
+ display_rotation: number | null;
51
+ experimental_features: boolean | null;
52
+ internal_model: import("@trezor/protobuf").DeviceModelInternal;
52
53
  }>;
53
54
  }
54
55
  //# sourceMappingURL=getFeatures.d.ts.map
@@ -15,24 +15,26 @@ export default class GetPublicKey extends AbstractMethod<'getPublicKey', Params[
15
15
  noBackupConfirmation(allowSuppression?: boolean): Promise<boolean>;
16
16
  run(): Promise<{
17
17
  xpubSegwit?: string | undefined;
18
+ descriptorChecksum?: string | undefined;
18
19
  path: number[];
19
- publicKey: string;
20
- serializedPath: string;
21
20
  depth: number;
22
21
  fingerprint: number;
22
+ xpub: string;
23
+ publicKey: string;
24
+ serializedPath: string;
23
25
  chainCode: string;
24
26
  childNum: number;
25
- xpub: string;
26
27
  } | {
27
28
  xpubSegwit?: string | undefined;
29
+ descriptorChecksum?: string | undefined;
28
30
  path: number[];
29
- publicKey: string;
30
- serializedPath: string;
31
31
  depth: number;
32
32
  fingerprint: number;
33
+ xpub: string;
34
+ publicKey: string;
35
+ serializedPath: string;
33
36
  chainCode: string;
34
37
  childNum: number;
35
- xpub: string;
36
38
  }[]>;
37
39
  }
38
40
  export {};
@@ -16,6 +16,7 @@ export { default as blockchainSubscribe } from './blockchainSubscribe';
16
16
  export { default as blockchainSubscribeFiatRates } from './blockchainSubscribeFiatRates';
17
17
  export { default as blockchainUnsubscribe } from './blockchainUnsubscribe';
18
18
  export { default as blockchainUnsubscribeFiatRates } from './blockchainUnsubscribeFiatRates';
19
+ export { default as changeLanguage } from './changeLanguage';
19
20
  export { default as changePin } from './changePin';
20
21
  export { default as changeWipeCode } from './changeWipeCode';
21
22
  export { default as cipherKeyValue } from './cipherKeyValue';
package/lib/api/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = exports.resetDevice = exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.getAccountDescriptor = exports.firmwareUpdate = exports.composeTransaction = exports.cipherKeyValue = exports.changeWipeCode = exports.changePin = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.backupDevice = exports.showDeviceTutorial = exports.cancelCoinjoinAuthorization = exports.authorizeCoinjoin = exports.authenticateDevice = exports.applySettings = exports.applyFlags = void 0;
6
+ exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = exports.resetDevice = exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.getAccountDescriptor = exports.firmwareUpdate = exports.composeTransaction = exports.cipherKeyValue = exports.changeWipeCode = exports.changePin = exports.changeLanguage = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.backupDevice = exports.showDeviceTutorial = exports.cancelCoinjoinAuthorization = exports.authorizeCoinjoin = exports.authenticateDevice = exports.applySettings = exports.applyFlags = void 0;
7
7
  var applyFlags_1 = require("./applyFlags");
8
8
  Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return __importDefault(applyFlags_1).default; } });
9
9
  var applySettings_1 = require("./applySettings");
@@ -40,6 +40,8 @@ var blockchainUnsubscribe_1 = require("./blockchainUnsubscribe");
40
40
  Object.defineProperty(exports, "blockchainUnsubscribe", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribe_1).default; } });
41
41
  var blockchainUnsubscribeFiatRates_1 = require("./blockchainUnsubscribeFiatRates");
42
42
  Object.defineProperty(exports, "blockchainUnsubscribeFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribeFiatRates_1).default; } });
43
+ var changeLanguage_1 = require("./changeLanguage");
44
+ Object.defineProperty(exports, "changeLanguage", { enumerable: true, get: function () { return __importDefault(changeLanguage_1).default; } });
43
45
  var changePin_1 = require("./changePin");
44
46
  Object.defineProperty(exports, "changePin", { enumerable: true, get: function () { return __importDefault(changePin_1).default; } });
45
47
  var changeWipeCode_1 = require("./changeWipeCode");
@@ -2,6 +2,14 @@ import { PROTO } from '../../constants';
2
2
  import * as $T from '../../types/api/nem';
3
3
  export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chunkify?: boolean) => {
4
4
  chunkify?: boolean | undefined;
5
+ multisig?: {
6
+ address_n?: number[] | undefined;
7
+ network?: number | undefined;
8
+ signer?: string | undefined;
9
+ timestamp: number;
10
+ fee: string | number;
11
+ deadline: number;
12
+ } | undefined;
5
13
  transfer?: {
6
14
  public_key?: string | undefined;
7
15
  payload?: string | undefined;
@@ -13,14 +21,6 @@ export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chun
13
21
  amount: string | number;
14
22
  recipient: string;
15
23
  } | undefined;
16
- multisig?: {
17
- address_n?: number[] | undefined;
18
- network?: number | undefined;
19
- signer?: string | undefined;
20
- timestamp: number;
21
- fee: string | number;
22
- deadline: number;
23
- } | undefined;
24
24
  cosigning?: boolean | undefined;
25
25
  provision_namespace?: {
26
26
  parent?: string | undefined;
@@ -32,17 +32,17 @@ export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chun
32
32
  fee: string | number;
33
33
  sink: string;
34
34
  definition: {
35
- name?: string | undefined;
36
35
  fee?: string | number | undefined;
37
- levy?: PROTO.NEMMosaicLevy | undefined;
38
- divisibility?: number | undefined;
39
- transferable?: boolean | undefined;
36
+ name?: string | undefined;
40
37
  ticker?: string | undefined;
38
+ divisibility?: number | undefined;
39
+ levy?: PROTO.NEMMosaicLevy | undefined;
41
40
  levy_address?: string | undefined;
42
41
  levy_namespace?: string | undefined;
43
42
  levy_mosaic?: string | undefined;
44
43
  supply?: number | undefined;
45
44
  mutable_supply?: boolean | undefined;
45
+ transferable?: boolean | undefined;
46
46
  networks?: number[] | undefined;
47
47
  description: string;
48
48
  namespace: string;
@@ -51,9 +51,9 @@ export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chun
51
51
  } | undefined;
52
52
  supply_change?: {
53
53
  type: PROTO.NEMSupplyChangeType;
54
- delta: number;
55
54
  namespace: string;
56
55
  mosaic: string;
56
+ delta: number;
57
57
  } | undefined;
58
58
  aggregate_modification?: {
59
59
  modifications?: {
@@ -1,5 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
- export default class RebootToBootloader extends AbstractMethod<'rebootToBootloader'> {
2
+ import { PROTO } from '../constants';
3
+ export default class RebootToBootloader extends AbstractMethod<'rebootToBootloader', PROTO.RebootToBootloader> {
3
4
  confirmed?: boolean;
4
5
  init(): void;
5
6
  get info(): string;
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
4
  const paramsValidator_1 = require("./common/paramsValidator");
5
5
  const events_1 = require("../events");
6
+ const schema_utils_1 = require("@trezor/schema-utils");
7
+ const constants_1 = require("../constants");
6
8
  class RebootToBootloader extends AbstractMethod_1.AbstractMethod {
7
9
  init() {
8
10
  this.allowDeviceMode = [events_1.UI.INITIALIZE, events_1.UI.SEEDLESS];
@@ -11,6 +13,13 @@ class RebootToBootloader extends AbstractMethod_1.AbstractMethod {
11
13
  this.requiredPermissions = ['management'];
12
14
  this.useDeviceState = false;
13
15
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
16
+ const { payload } = this;
17
+ (0, schema_utils_1.Assert)(constants_1.PROTO.RebootToBootloader, payload);
18
+ this.params = {
19
+ boot_command: payload.boot_command,
20
+ firmware_header: payload.firmware_header,
21
+ language_data_length: payload.language_data_length,
22
+ };
14
23
  }
15
24
  get info() {
16
25
  return 'Reboot to bootloader';
@@ -34,7 +43,7 @@ class RebootToBootloader extends AbstractMethod_1.AbstractMethod {
34
43
  }
35
44
  async run() {
36
45
  const cmd = this.device.getCommands();
37
- const response = await cmd.typedCall('RebootToBootloader', 'Success');
46
+ const response = await cmd.typedCall('RebootToBootloader', 'Success', this.params);
38
47
  return response.message;
39
48
  }
40
49
  }
@@ -6,5 +6,6 @@ export default class RecoveryDevice extends AbstractMethod<'recoveryDevice', PRO
6
6
  run(): Promise<{
7
7
  message: string;
8
8
  }>;
9
+ get info(): string;
9
10
  }
10
11
  //# sourceMappingURL=recoveryDevice.d.ts.map
@@ -43,6 +43,9 @@ class RecoveryDevice extends AbstractMethod_1.AbstractMethod {
43
43
  const response = await cmd.typedCall('RecoveryDevice', 'Success', this.params);
44
44
  return response.message;
45
45
  }
46
+ get info() {
47
+ return 'Recover device';
48
+ }
46
49
  }
47
50
  exports.default = RecoveryDevice;
48
51
  //# sourceMappingURL=recoveryDevice.js.map
@@ -1,7 +1,7 @@
1
1
  import type { TypedCall } from '../../device/DeviceCommands';
2
2
  import { StellarTransaction } from '../../types/api/stellar';
3
3
  export declare const stellarSignTx: (typedCall: TypedCall, address_n: number[], networkPassphrase: string, tx: StellarTransaction) => Promise<{
4
- signature: string;
5
4
  public_key: string;
5
+ signature: string;
6
6
  }>;
7
7
  //# sourceMappingURL=stellarSignTx.d.ts.map
@@ -166,6 +166,12 @@ const transformOperation = (op) => {
166
166
  source_account: op.source,
167
167
  bump_to: op.bumpTo,
168
168
  };
169
+ case 'claimClaimableBalance':
170
+ return {
171
+ type: 'StellarClaimClaimableBalanceOp',
172
+ source_account: op.source,
173
+ balance_id: op.balanceId,
174
+ };
169
175
  }
170
176
  };
171
177
  const stellarSignTx = async (typedCall, address_n, networkPassphrase, tx) => {
@@ -18,20 +18,31 @@ export declare const createTx: (address_n: number[], branch: string, operation:
18
18
  source: Uint8Array;
19
19
  amount: string | number;
20
20
  fee: string | number;
21
+ gas_limit: number;
21
22
  destination: {
22
23
  hash: Uint8Array;
23
24
  tag: number;
24
25
  };
25
26
  counter: number;
26
- gas_limit: number;
27
27
  storage_limit: number;
28
28
  } | undefined;
29
+ proposal?: {
30
+ source: string;
31
+ period: number;
32
+ proposals: string[];
33
+ } | undefined;
34
+ ballot?: {
35
+ source: string;
36
+ period: number;
37
+ proposal: string;
38
+ ballot: PROTO.TezosBallotType;
39
+ } | undefined;
29
40
  reveal?: {
30
- source: Uint8Array;
31
41
  public_key: Uint8Array;
42
+ source: Uint8Array;
32
43
  fee: string | number;
33
- counter: number;
34
44
  gas_limit: number;
45
+ counter: number;
35
46
  storage_limit: number;
36
47
  } | undefined;
37
48
  origination?: {
@@ -40,31 +51,20 @@ export declare const createTx: (address_n: number[], branch: string, operation:
40
51
  spendable?: boolean | undefined;
41
52
  delegatable?: boolean | undefined;
42
53
  source: Uint8Array;
43
- fee: string | number;
44
54
  script: string | number[];
45
- counter: number;
55
+ fee: string | number;
46
56
  gas_limit: number;
57
+ counter: number;
47
58
  storage_limit: number;
48
59
  balance: number;
49
60
  } | undefined;
50
61
  delegation?: {
51
62
  source: Uint8Array;
52
63
  fee: string | number;
53
- counter: number;
64
+ delegate: Uint8Array;
54
65
  gas_limit: number;
66
+ counter: number;
55
67
  storage_limit: number;
56
- delegate: Uint8Array;
57
- } | undefined;
58
- proposal?: {
59
- source: string;
60
- period: number;
61
- proposals: string[];
62
- } | undefined;
63
- ballot?: {
64
- source: string;
65
- period: number;
66
- proposal: string;
67
- ballot: PROTO.TezosBallotType;
68
68
  } | undefined;
69
69
  address_n: number[];
70
70
  branch: Uint8Array;
@@ -5,16 +5,18 @@ export declare class BackendManager {
5
5
  private readonly instances;
6
6
  private readonly custom;
7
7
  private readonly preferred;
8
+ private readonly reconnect;
8
9
  get(shortcut: CoinShortcut): Blockchain | null;
9
- remove(shortcut: CoinShortcut): void;
10
10
  getOrConnect(coinInfo: CoinInfo, postMessage: BlockchainOptions['postMessage']): Promise<Blockchain>;
11
11
  dispose(): void;
12
12
  reconnectAll(): Promise<Blockchain[]>;
13
13
  isSupported(coinInfo: CoinInfo): void;
14
14
  setCustom(shortcut: CoinShortcut, blockchainLink: BlockchainLink): void;
15
15
  removeCustom(shortcut: CoinShortcut): void;
16
+ private setInstance;
16
17
  private setPreferred;
17
- private removePreferred;
18
+ private onDisconnect;
19
+ private clearReconnect;
18
20
  private patchCoinInfo;
19
21
  }
20
22
  export {};