@trezor/connect 9.0.4 → 9.0.5

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 (110) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +1 -1
  3. package/lib/api/binanceGetAddress.d.ts +1 -1
  4. package/lib/api/binanceSignTransaction.d.ts +1 -1
  5. package/lib/api/bitcoin/Fees.d.ts +1 -1
  6. package/lib/api/bitcoin/TransactionComposer.d.ts +1 -1
  7. package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
  8. package/lib/api/blockchainDisconnect.d.ts +1 -1
  9. package/lib/api/blockchainEstimateFee.d.ts +1 -1
  10. package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -1
  11. package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
  12. package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
  13. package/lib/api/blockchainGetTransactions.d.ts +1 -1
  14. package/lib/api/blockchainSetCustomBackend.d.ts +1 -1
  15. package/lib/api/blockchainSubscribe.d.ts +1 -1
  16. package/lib/api/blockchainSubscribeFiatRates.d.ts +1 -1
  17. package/lib/api/blockchainUnsubscribe.d.ts +1 -1
  18. package/lib/api/blockchainUnsubscribeFiatRates.d.ts +1 -1
  19. package/lib/api/cardano/cardanoCertificate.d.ts +2 -2
  20. package/lib/api/cardano/cardanoInputs.d.ts +3 -3
  21. package/lib/api/cardano/cardanoOutputs.d.ts +1 -1
  22. package/lib/api/cardano/cardanoTokenBundle.d.ts +1 -1
  23. package/lib/api/cardanoGetAddress.d.ts +1 -1
  24. package/lib/api/cardanoSignTransaction.d.ts +1 -1
  25. package/lib/api/common/Discovery.d.ts +2 -2
  26. package/lib/api/common/paramsValidator.d.ts +2 -2
  27. package/lib/api/composeTransaction.d.ts +1 -1
  28. package/lib/api/eos/eosSignTx.js +1 -1
  29. package/lib/api/eosSignTransaction.d.ts +1 -1
  30. package/lib/api/ethereumGetAddress.d.ts +1 -1
  31. package/lib/api/ethereumGetPublicKey.d.ts +1 -1
  32. package/lib/api/ethereumSignTransaction.d.ts +1 -1
  33. package/lib/api/ethereumSignTypedData.d.ts +1 -1
  34. package/lib/api/firmware/uploadFirmware.d.ts +2 -2
  35. package/lib/api/firmwareUpdate.d.ts +1 -1
  36. package/lib/api/firmwareUpdate.js +1 -1
  37. package/lib/api/getAccountInfo.d.ts +1 -1
  38. package/lib/api/getAddress.d.ts +1 -1
  39. package/lib/api/getCoinInfo.d.ts +2 -2
  40. package/lib/api/getPublicKey.d.ts +1 -1
  41. package/lib/api/nemGetAddress.d.ts +1 -1
  42. package/lib/api/pushTransaction.d.ts +1 -1
  43. package/lib/api/rippleGetAddress.d.ts +1 -1
  44. package/lib/api/setBusy.js +5 -1
  45. package/lib/api/setProxy.js +3 -4
  46. package/lib/api/signTransaction.d.ts +1 -1
  47. package/lib/api/stellarGetAddress.d.ts +1 -1
  48. package/lib/api/stellarSignTransaction.d.ts +1 -1
  49. package/lib/api/tezosGetAddress.d.ts +1 -1
  50. package/lib/backend/BackendManager.d.ts +1 -1
  51. package/lib/backend/BackendManager.js +0 -4
  52. package/lib/backend/Blockchain.d.ts +3 -9
  53. package/lib/backend/Blockchain.js +2 -17
  54. package/lib/constants/network.d.ts +1 -1
  55. package/lib/core/AbstractMethod.d.ts +4 -4
  56. package/lib/core/AbstractMethod.js +7 -5
  57. package/lib/core/index.js +2 -0
  58. package/lib/data/DataManager.d.ts +1 -1
  59. package/lib/data/analyticsInfo.d.ts +6 -0
  60. package/lib/data/analyticsInfo.js +37 -0
  61. package/lib/data/version.d.ts +1 -1
  62. package/lib/data/version.js +1 -1
  63. package/lib/device/AbortController.d.ts +1 -1
  64. package/lib/device/DescriptorStream.d.ts +1 -1
  65. package/lib/device/Device.d.ts +1 -1
  66. package/lib/device/Device.js +3 -0
  67. package/lib/device/DeviceCommands.d.ts +7 -7
  68. package/lib/device/DeviceCommands.js +3 -1
  69. package/lib/device/DeviceList.d.ts +1 -1
  70. package/lib/events/blockchain.d.ts +4 -5
  71. package/lib/events/call.d.ts +10 -10
  72. package/lib/events/core.d.ts +3 -2
  73. package/lib/events/device.d.ts +3 -3
  74. package/lib/events/iframe.d.ts +2 -2
  75. package/lib/events/popup.d.ts +2 -2
  76. package/lib/events/transport.d.ts +3 -3
  77. package/lib/events/ui-promise.d.ts +2 -2
  78. package/lib/events/ui-request.d.ts +8 -6
  79. package/lib/events/ui-response.d.ts +2 -2
  80. package/lib/types/account.d.ts +2 -2
  81. package/lib/types/api/binance/index.d.ts +1 -1
  82. package/lib/types/api/bitcoin/index.d.ts +2 -2
  83. package/lib/types/api/blockchainGetTransactions.d.ts +1 -1
  84. package/lib/types/api/blockchainSetCustomBackend.d.ts +1 -1
  85. package/lib/types/api/blockchainSubscribe.d.ts +1 -1
  86. package/lib/types/api/blockchainSubscribeFiatRates.d.ts +1 -1
  87. package/lib/types/api/cardano/index.d.ts +2 -2
  88. package/lib/types/api/composeTransaction.d.ts +3 -3
  89. package/lib/types/api/eos/index.d.ts +1 -1
  90. package/lib/types/api/getAddress.d.ts +1 -1
  91. package/lib/types/api/nem/index.d.ts +9 -9
  92. package/lib/types/api/off.d.ts +2 -2
  93. package/lib/types/api/on.d.ts +2 -2
  94. package/lib/types/api/pushTransaction.d.ts +1 -1
  95. package/lib/types/api/setProxy.d.ts +1 -2
  96. package/lib/types/api/stellar/index.d.ts +2 -2
  97. package/lib/types/coinInfo.d.ts +3 -3
  98. package/lib/types/device.d.ts +13 -13
  99. package/lib/types/firmware.d.ts +3 -3
  100. package/lib/types/params.d.ts +3 -3
  101. package/lib/types/settings.d.ts +1 -2
  102. package/lib/types/utils.d.ts +2 -2
  103. package/lib/utils/accountUtils.d.ts +1 -1
  104. package/lib/utils/browserUtils.d.ts +2 -2
  105. package/lib/utils/debug.d.ts +1 -1
  106. package/lib/utils/deferred.d.ts +2 -2
  107. package/lib/utils/interactionTimeout.d.ts +1 -1
  108. package/lib/workers/RNUsbPlugin.d.ts +1 -1
  109. package/lib/workers/workers.d.ts +1 -1
  110. package/package.json +83 -80
package/CHANGELOG.md ADDED
@@ -0,0 +1,67 @@
1
+ # 9.0.5
2
+
3
+ - added: analytics in popup
4
+ - fixed: `signTransaction` with litecoin mimble wimble pegout inputs
5
+ - fixed: `composeTransaction` cases when composing tx with multiple outputs where at least one is above MAX_SAFE_INTEGER
6
+ - updated: @trezor/blockchain-link 2.6.1
7
+ - updated: @trezor/connect-common 0.0.11
8
+ - updated: @trezor/transport 1.1.6
9
+ - updated: @trezor/utils 9.0.4
10
+ - updated: @trezor/utxo-lib 1.0.2
11
+
12
+ # 9.0.4
13
+
14
+ - @trezor/blockchain-link 2.1.5
15
+ - added `setBusy` method
16
+ - added `goerli` (TGOR) coin support
17
+ - added `serialize` and `coinjoinRequest` option to `signTransaction` method
18
+ - added `preauthorized` option to `authorizeCoinJoin` method
19
+ - Cardano: added support for [CIP36 Catalyst registration format](https://cips.cardano.org/cips/cip36/) in `cardanoSignTransaction` method
20
+ - `auxiliaryData.catalystRegistrationParameters` is deprecated, use `auxiliaryData.governanceRegistrationParameters` instead
21
+
22
+ # 9.0.3
23
+
24
+ - typescript: removed `EosGetPublicKey` type, use `GetPublicKey` type instead
25
+ - fix default bip48 script types. [#6393](https://github.com/trezor/trezor-suite/pull/6393) and [#6407](https://github.com/trezor/trezor-suite/pull/6407)
26
+ - added `unlockPath` method
27
+ - added `SLIP 25` support
28
+ - fixed bitcoin extended descriptor (xpubSegwit) for taproot accounts
29
+
30
+ # 9.0.2
31
+
32
+ - improved passphrase dialog in popup window
33
+ - if popup window does not load in a predefined period of time, error screen with troubleshooting tips is shown
34
+
35
+ # 9.0.1
36
+
37
+ - @trezor/blockchain-link 2.1.4
38
+
39
+ # 9.0.0
40
+
41
+ ## Breaking changes:
42
+
43
+ - Changed codebase to typescript.
44
+ - Removed `Lisk` methods from api.
45
+ - Removed `customMethod` api method.
46
+ - Exported constants:
47
+ - `CARDANO.ADDRESS_TYPE` => `PROTO.CardanoAddressType`
48
+ - `CARDANO.CERTIFICATE_TYPE` => `PROTO.CardanoCertificateType`
49
+ - `CARDANO.POOL_RELAY_TYPE` => `PROTO.CardanoPoolRelayType`
50
+ - `CardanoCertificateType`
51
+ - `CardanoNativeScriptType` => `PROTO.CardanoNativeScriptType`
52
+ - `CardanoNativeScriptHashDisplayFormat` => `PROTO.CardanoNativeScriptHashDisplayFormat`
53
+ - `CardanoPoolRelayType` => `PROTO.CardanoPoolRelayType`
54
+ - `CardanoTxSigningMode` => `PROTO.CardanoTxSigningMode`
55
+ - `CardanoTxWitnessType` => `PROTO.CardanoTxWitnessType`
56
+ - removed unused `DEVICE.WAIT_FOR_SELECTION`
57
+ - removed unused `UI.CHANGE_ACCOUNT`
58
+ - Minimum firmware requirements bumped:
59
+ - 2.4.2 CardanoSignTransaction
60
+
61
+ ## Added:
62
+
63
+ - `getOwnershipId` method
64
+ - `getOwnershipProof` method
65
+ - `authorizeCoinJoin` method
66
+ - `getFirmwareHash` method
67
+ - [support for babbage features in cardano](https://github.com/trezor/trezor-suite/commit/efe9c78a2f74a1b7653b3fddf6cca35ba38d3ae9)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.0.4
3
+ API version 9.0.5
4
4
 
5
5
  [![Build Status](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml/badge.svg)](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
6
6
  [![NPM](https://img.shields.io/npm/v/@trezor/connect.svg)](https://www.npmjs.org/package/@trezor/connect)
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
- declare type Params = PROTO.BinanceGetAddress & {
3
+ type Params = PROTO.BinanceGetAddress & {
4
4
  address?: string;
5
5
  };
6
6
  export default class BinanceGetAddress extends AbstractMethod<'binanceGetAddress', Params[]> {
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { BinancePreparedTransaction } from '../types/api/binance';
3
- declare type Params = {
3
+ type Params = {
4
4
  path: number[];
5
5
  transaction: BinancePreparedTransaction;
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import { Blockchain } from '../../backend/BlockchainLink';
2
2
  import type { CoinInfo } from '../../types';
3
3
  import type { FeeLevel } from '../../types/account';
4
- declare type Blocks = Array<string | undefined>;
4
+ type Blocks = Array<string | undefined>;
5
5
  export declare class FeeLevels {
6
6
  coinInfo: CoinInfo;
7
7
  levels: FeeLevel[];
@@ -4,7 +4,7 @@ import { Blockchain } from '../../backend/BlockchainLink';
4
4
  import type { BitcoinNetworkInfo } from '../../types';
5
5
  import type { DiscoveryAccount, SelectFeeLevel } from '../../types/account';
6
6
  import type { PrecomposeParams } from '../../types/api/composeTransaction';
7
- declare type Options = {
7
+ type Options = {
8
8
  account: DiscoveryAccount;
9
9
  utxo: PrecomposeParams['account']['utxo'];
10
10
  outputs: ComposeOutput[];
@@ -1,7 +1,7 @@
1
1
  import { PROTO } from '../../constants';
2
2
  import type { BitcoinNetworkInfo } from '../../types';
3
3
  import type { DeviceCommands } from '../../device/DeviceCommands';
4
- declare type GetHDNode = DeviceCommands['getHDNode'];
4
+ type GetHDNode = DeviceCommands['getHDNode'];
5
5
  export declare const verifyTx: (getHDNode: GetHDNode, inputs: PROTO.TxInputType[], outputs: PROTO.TxOutputType[], serializedTx: string, coinInfo: BitcoinNetworkInfo, unlockPath?: PROTO.UnlockPath) => Promise<import("packages/utxo-lib/lib/transaction/base").TransactionBase<undefined> | import("packages/utxo-lib/lib/transaction/base").TransactionBase<import("packages/utxo-lib/lib/transaction/dash").DashSpecific> | import("packages/utxo-lib/lib/transaction/base").TransactionBase<import("packages/utxo-lib/lib/transaction/zcash").ZcashSpecific>>;
6
6
  export declare const verifyTicketTx: (getHDNode: GetHDNode, inputs: PROTO.TxInputType[], outputs: PROTO.TxOutputType[], serializedTx: string, coinInfo: BitcoinNetworkInfo) => Promise<void>;
7
7
  export {};
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  };
6
6
  export default class BlockchainDisconnect extends AbstractMethod<'blockchainDisconnect', Params> {
@@ -1,6 +1,6 @@
1
1
  import { Payload, AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  request: Payload<'blockchainEstimateFee'>['request'];
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { Payload, AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  request: Omit<Payload<'blockchainGetAccountBalanceHistory'>, 'method' | 'coin'>;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { Payload, AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  currencies: Payload<'blockchainGetCurrentFiatRates'>['currencies'];
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { Payload, AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  timestamps: Payload<'blockchainGetFiatRatesForTimestamps'>['timestamps'];
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  txs: string[];
5
5
  coinInfo: CoinInfo;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  };
6
6
  export default class BlockchainSetCustomBackend extends AbstractMethod<'blockchainSetCustomBackend', Params> {
@@ -1,6 +1,6 @@
1
1
  import { Payload, AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  accounts: Payload<'blockchainSubscribe'>['accounts'];
5
5
  coinInfo: CoinInfo;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { Payload, AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  currency: Payload<'blockchainSubscribeFiatRates'>['currency'];
5
5
  coinInfo: CoinInfo;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { Payload, AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  accounts: Payload<'blockchainUnsubscribe'>['accounts'];
5
5
  coinInfo: CoinInfo;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  };
6
6
  export default class BlockchainUnsubscribeFiatRates extends AbstractMethod<'blockchainUnsubscribeFiatRates', Params> {
@@ -1,11 +1,11 @@
1
1
  import { PROTO } from '../../constants';
2
2
  import type { CardanoCertificate } from '../../types/api/cardano';
3
- export declare type CertificateWithPoolOwnersAndRelays = {
3
+ export type CertificateWithPoolOwnersAndRelays = {
4
4
  certificate: PROTO.CardanoTxCertificate;
5
5
  poolOwners: PROTO.CardanoPoolOwner[];
6
6
  poolRelays: PROTO.CardanoPoolRelayParameters[];
7
7
  };
8
- export declare type PoolParametersWithOwnersAndRelays = {
8
+ export type PoolParametersWithOwnersAndRelays = {
9
9
  poolParameters?: PROTO.CardanoPoolParametersType;
10
10
  poolOwners: PROTO.CardanoPoolOwner[];
11
11
  poolRelays: PROTO.CardanoPoolRelayParameters[];
@@ -1,10 +1,10 @@
1
1
  import type { PROTO } from '../../constants';
2
- export declare type Path = number[];
3
- export declare type InputWithPath = {
2
+ export type Path = number[];
3
+ export type InputWithPath = {
4
4
  input: PROTO.CardanoTxInput;
5
5
  path?: Path;
6
6
  };
7
- export declare type CollateralInputWithPath = {
7
+ export type CollateralInputWithPath = {
8
8
  collateralInput: PROTO.CardanoTxCollateralInput;
9
9
  path?: Path;
10
10
  };
@@ -1,6 +1,6 @@
1
1
  import type { AssetGroupWithTokens } from './cardanoTokenBundle';
2
2
  import { PROTO } from '../../constants';
3
- export declare type OutputWithData = {
3
+ export type OutputWithData = {
4
4
  output: PROTO.CardanoTxOutput;
5
5
  tokenBundle?: AssetGroupWithTokens[];
6
6
  inlineDatum?: string;
@@ -1,6 +1,6 @@
1
1
  import type { PROTO } from '../../constants';
2
2
  import type { CardanoAssetGroup } from '../../types/api/cardano';
3
- export declare type AssetGroupWithTokens = {
3
+ export type AssetGroupWithTokens = {
4
4
  policyId: string;
5
5
  tokens: PROTO.CardanoToken[];
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
- declare type Params = PROTO.CardanoGetAddress & {
3
+ type Params = PROTO.CardanoGetAddress & {
4
4
  address?: string;
5
5
  };
6
6
  export default class CardanoGetAddress extends AbstractMethod<'cardanoGetAddress', Params[]> {
@@ -17,7 +17,7 @@ declare const CardanoSignTransactionFeatures: Readonly<{
17
17
  Babbage: string[];
18
18
  GovernanceRegistrationCIP36: string[];
19
19
  }>;
20
- export declare type CardanoSignTransactionParams = {
20
+ export type CardanoSignTransactionParams = {
21
21
  signingMode: PROTO.CardanoTxSigningMode;
22
22
  inputsWithPath: InputWithPath[];
23
23
  outputsWithData: OutputWithData[];
@@ -5,11 +5,11 @@ import { Blockchain } from '../../backend/BlockchainLink';
5
5
  import { DeviceCommands } from '../../device/DeviceCommands';
6
6
  import type { CoinInfo, DiscoveryAccountType, DiscoveryAccount } from '../../types';
7
7
  import type { GetAccountInfo } from '../../types/api/getAccountInfo';
8
- declare type DiscoveryType = {
8
+ type DiscoveryType = {
9
9
  type: DiscoveryAccountType;
10
10
  getPath: (index: number) => number[];
11
11
  };
12
- declare type DiscoveryOptions = {
12
+ type DiscoveryOptions = {
13
13
  blockchain: Blockchain;
14
14
  commands: DeviceCommands;
15
15
  limit?: number;
@@ -1,6 +1,6 @@
1
1
  import type { CoinInfo, FirmwareRange } from '../../types';
2
- declare type ParamType = 'string' | 'number' | 'array' | 'array-buffer' | 'boolean' | 'uint' | 'object';
3
- declare type Param = {
2
+ type ParamType = 'string' | 'number' | 'array' | 'array-buffer' | 'boolean' | 'uint' | 'object';
3
+ type Param = {
4
4
  name: string;
5
5
  type?: ParamType | ParamType[];
6
6
  required?: boolean;
@@ -4,7 +4,7 @@ import { TransactionComposer } from './bitcoin';
4
4
  import type { ComposeOutput, ComposeResult } from '@trezor/utxo-lib';
5
5
  import type { BitcoinNetworkInfo, DiscoveryAccount, AccountUtxo } from '../types';
6
6
  import type { SignedTransaction, PrecomposeParams, PrecomposedTransaction } from '../types/api/composeTransaction';
7
- declare type Params = {
7
+ type Params = {
8
8
  outputs: ComposeOutput[];
9
9
  coinInfo: BitcoinNetworkInfo;
10
10
  push: boolean;
@@ -99,7 +99,7 @@ const parseQuantity = (s) => {
99
99
  const parseAuth = (a) => {
100
100
  const keyToBuffer = (pk) => {
101
101
  const len = pk.indexOf('EOS') === 0 ? 3 : 7;
102
- const key = bs58.decode(pk.substring(len));
102
+ const key = Buffer.from(bs58.decode(pk.substring(len)));
103
103
  return {
104
104
  type: 0,
105
105
  key: key.slice(0, key.length - 4).toString('hex'),
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { PROTO } from '../constants';
3
- declare type Params = {
3
+ type Params = {
4
4
  path: number[];
5
5
  chain_id: string;
6
6
  header: PROTO.EosTxHeader;
@@ -1,7 +1,7 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
3
  import type { EthereumNetworkInfo } from '../types';
4
- declare type Params = PROTO.EthereumGetAddress & {
4
+ type Params = PROTO.EthereumGetAddress & {
5
5
  address?: string;
6
6
  network?: EthereumNetworkInfo;
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { PROTO } from '../constants';
3
3
  import type { EthereumNetworkInfo } from '../types';
4
- declare type Params = PROTO.EthereumGetPublicKey & {
4
+ type Params = PROTO.EthereumGetPublicKey & {
5
5
  network?: EthereumNetworkInfo;
6
6
  };
7
7
  export default class EthereumGetPublicKey extends AbstractMethod<'ethereumGetPublicKey', Params[]> {
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { EthereumTransaction, EthereumTransactionEIP1559 } from '../types/api/ethereum';
3
- declare type Params = {
3
+ type Params = {
4
4
  path: number[];
5
5
  tx: ({
6
6
  type: 'legacy';
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { EthereumSignTypedDataTypes, EthereumSignTypedData as EthereumSignTypedDataParams, EthereumSignTypedHash as EthereumSignTypedHashParams } from '../types/api/ethereum';
3
- declare type Params = (Omit<EthereumSignTypedDataParams<EthereumSignTypedDataTypes>, 'path'> | Omit<EthereumSignTypedHashParams<EthereumSignTypedDataTypes>, 'path'>) & {
3
+ type Params = (Omit<EthereumSignTypedDataParams<EthereumSignTypedDataTypes>, 'path'> | Omit<EthereumSignTypedHashParams<EthereumSignTypedDataTypes>, 'path'>) & {
4
4
  address_n: number[];
5
5
  };
6
6
  export default class EthereumSignTypedData extends AbstractMethod<'ethereumSignTypedData', Params> {
@@ -1,6 +1,6 @@
1
- import { CoreMessage } from '../../events';
1
+ import { PostMessage } from '../../events';
2
2
  import { PROTO } from '../../constants';
3
3
  import type { Device } from '../../device/Device';
4
4
  import type { TypedCall } from '../../device/DeviceCommands';
5
- export declare const uploadFirmware: (typedCall: TypedCall, postMessage: (message: CoreMessage) => void, device: Device, { payload }: PROTO.FirmwareUpload) => Promise<PROTO.Success>;
5
+ export declare const uploadFirmware: (typedCall: TypedCall, postMessage: PostMessage, device: Device, { payload }: PROTO.FirmwareUpload) => Promise<PROTO.Success>;
6
6
  //# sourceMappingURL=uploadFirmware.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
- declare type Params = {
2
+ type Params = {
3
3
  binary?: ArrayBuffer;
4
4
  version?: number[];
5
5
  btcOnly?: boolean;
@@ -73,7 +73,7 @@ class FirmwareUpdate extends AbstractMethod_1.AbstractMethod {
73
73
  }
74
74
  }
75
75
  catch (err) {
76
- throw constants_1.ERRORS.TypedError('Method_FirmwareUpdate_DownloadFailed', 'Failed to download firmware binary');
76
+ throw constants_1.ERRORS.TypedError('Method_FirmwareUpdate_DownloadFailed', `Failed to download firmware binary ${err.message}`);
77
77
  }
78
78
  const stripped = (0, firmware_1.stripFwHeaders)(binary);
79
79
  await (0, firmware_1.uploadFirmware)(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, { payload: (0, firmware_1.shouldStripFwHeaders)(device.features) ? stripped : binary });
@@ -2,7 +2,7 @@ import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { Discovery } from './common/Discovery';
3
3
  import type { CoinInfo, AccountInfo, AccountUtxo } from '../types';
4
4
  import type { GetAccountInfo as GetAccountInfoParams } from '../types/api/getAccountInfo';
5
- declare type Request = GetAccountInfoParams & {
5
+ type Request = GetAccountInfoParams & {
6
6
  address_n: number[];
7
7
  coinInfo: CoinInfo;
8
8
  };
@@ -1,7 +1,7 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
3
  import type { BitcoinNetworkInfo } from '../types';
4
- declare type Params = PROTO.GetAddress & {
4
+ type Params = PROTO.GetAddress & {
5
5
  address?: string;
6
6
  coinInfo: BitcoinNetworkInfo;
7
7
  unlockPath?: PROTO.UnlockPath;
@@ -1,11 +1,11 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  };
6
6
  export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
7
7
  init(): void;
8
- run(): Promise<import("../types").BitcoinNetworkInfo | import("../types").EthereumNetworkInfo | import("../types").MiscNetworkInfo>;
8
+ run(): Promise<CoinInfo>;
9
9
  }
10
10
  export {};
11
11
  //# sourceMappingURL=getCoinInfo.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { BitcoinNetworkInfo } from '../types';
3
3
  import type { PROTO } from '../constants';
4
- declare type Params = PROTO.GetPublicKey & {
4
+ type Params = PROTO.GetPublicKey & {
5
5
  coinInfo?: BitcoinNetworkInfo;
6
6
  unlockPath?: PROTO.UnlockPath;
7
7
  };
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
- declare type Params = PROTO.NEMGetAddress & {
3
+ type Params = PROTO.NEMGetAddress & {
4
4
  address?: string;
5
5
  };
6
6
  export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Params[]> {
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import type { CoinInfo } from '../types';
3
- declare type Params = {
3
+ type Params = {
4
4
  tx: string;
5
5
  coinInfo: CoinInfo;
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
- declare type Params = PROTO.RippleGetAddress & {
3
+ type Params = PROTO.RippleGetAddress & {
4
4
  address?: string;
5
5
  };
6
6
  export default class RippleGetAddress extends AbstractMethod<'rippleGetAddress', Params[]> {
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
+ const events_1 = require("../events");
4
5
  const paramsValidator_1 = require("./common/paramsValidator");
5
6
  class SetBusy extends AbstractMethod_1.AbstractMethod {
6
7
  init() {
7
8
  this.useDeviceState = false;
8
9
  this.requiredPermissions = ['management'];
9
- this.keepSession = true;
10
10
  const { payload } = this;
11
11
  (0, paramsValidator_1.validateParams)(payload, [{ name: 'expiry_ms', type: 'number' }]);
12
12
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, {
@@ -20,6 +20,10 @@ class SetBusy extends AbstractMethod_1.AbstractMethod {
20
20
  async run() {
21
21
  const cmd = this.device.getCommands();
22
22
  const { message } = await cmd.typedCall('SetBusy', 'Success', this.params);
23
+ if (this.keepSession && !!this.params.expiry_ms) {
24
+ this.device.features.busy = true;
25
+ this.postMessage((0, events_1.createDeviceMessage)(events_1.DEVICE.CHANGED, this.device.toMessageObject()));
26
+ }
23
27
  return message;
24
28
  }
25
29
  }
@@ -9,14 +9,13 @@ class SetProxy extends AbstractMethod_1.AbstractMethod {
9
9
  this.requiredPermissions = [];
10
10
  this.useDevice = false;
11
11
  this.useUi = false;
12
- (0, paramsValidator_1.validateParams)(this.payload, [{ name: 'useOnionLinks', type: 'boolean' }]);
12
+ (0, paramsValidator_1.validateParams)(this.payload, []);
13
13
  }
14
14
  async run() {
15
- const { proxy, useOnionLinks } = DataManager_1.DataManager.getSettings();
16
- const isChanged = proxy !== this.payload.proxy || useOnionLinks !== this.payload.useOnionLinks;
15
+ const { proxy } = DataManager_1.DataManager.getSettings();
16
+ const isChanged = proxy !== this.payload.proxy;
17
17
  if (isChanged) {
18
18
  DataManager_1.DataManager.settings.proxy = this.payload.proxy;
19
- DataManager_1.DataManager.settings.useOnionLinks = this.payload.useOnionLinks;
20
19
  await (0, BlockchainLink_1.reconnectAllBackends)();
21
20
  }
22
21
  return { message: 'Success' };
@@ -2,7 +2,7 @@ import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
3
  import type { BitcoinNetworkInfo, AccountAddresses } from '../types';
4
4
  import type { RefTransaction, TransactionOptions } from '../types/api/bitcoin';
5
- declare type Params = {
5
+ type Params = {
6
6
  inputs: PROTO.TxInputType[];
7
7
  outputs: PROTO.TxOutputType[];
8
8
  paymentRequests: PROTO.TxAckPaymentRequest[];
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
- declare type Params = PROTO.StellarGetAddress & {
3
+ type Params = PROTO.StellarGetAddress & {
4
4
  address?: string;
5
5
  };
6
6
  export default class StellarGetAddress extends AbstractMethod<'stellarGetAddress', Params[]> {
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { StellarTransaction } from '../types/api/stellar';
3
- declare type Params = {
3
+ type Params = {
4
4
  path: number[];
5
5
  networkPassphrase: string;
6
6
  transaction: StellarTransaction;
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
- declare type Params = PROTO.TezosGetAddress & {
3
+ type Params = PROTO.TezosGetAddress & {
4
4
  address?: string;
5
5
  };
6
6
  export default class TezosGetAddress extends AbstractMethod<'tezosGetAddress', Params[]> {
@@ -1,6 +1,6 @@
1
1
  import { Blockchain, BlockchainOptions } from './Blockchain';
2
2
  import type { CoinInfo, BlockchainLink } from '../types';
3
- declare type CoinShortcut = CoinInfo['shortcut'];
3
+ type CoinShortcut = CoinInfo['shortcut'];
4
4
  export declare class BackendManager {
5
5
  private readonly instances;
6
6
  private readonly custom;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BackendManager = void 0;
4
- const config_1 = require("../data/config");
5
4
  const DataManager_1 = require("../data/DataManager");
6
5
  const constants_1 = require("../constants");
7
6
  const Blockchain_1 = require("./Blockchain");
@@ -26,9 +25,6 @@ class BackendManager {
26
25
  postMessage,
27
26
  debug: DataManager_1.DataManager.getSettings('debug'),
28
27
  proxy: DataManager_1.DataManager.getSettings('proxy'),
29
- onionDomains: DataManager_1.DataManager.getSettings('useOnionLinks') && !this.custom[coinInfo.shortcut]
30
- ? config_1.config.onionDomains
31
- : undefined,
32
28
  onConnected: url => this.setPreferred(coinInfo.shortcut, url),
33
29
  onDisconnected: () => this.remove(coinInfo.shortcut),
34
30
  });
@@ -1,14 +1,11 @@
1
1
  import BlockchainLink, { ServerInfo, SubscriptionAccountInfo, BlockchainLinkParams, BlockchainLinkResponse } from '@trezor/blockchain-link';
2
+ import { PostMessage } from '../events';
2
3
  import { ERRORS } from '../constants';
3
4
  import type { CoinInfo, Proxy } from '../types';
4
- import type { CoreMessage } from '../events';
5
- export declare type BlockchainOptions = {
5
+ export type BlockchainOptions = {
6
6
  coinInfo: CoinInfo;
7
- postMessage: (message: CoreMessage) => void;
7
+ postMessage: PostMessage;
8
8
  proxy?: Proxy;
9
- onionDomains?: {
10
- [domain: string]: string;
11
- };
12
9
  debug?: boolean;
13
10
  onConnected?: (url: string) => void;
14
11
  onDisconnected?: () => void;
@@ -17,9 +14,6 @@ export declare class Blockchain {
17
14
  link: BlockchainLink;
18
15
  serverInfo?: ServerInfo;
19
16
  coinInfo: BlockchainOptions['coinInfo'];
20
- onionDomains: {
21
- [onion: string]: string;
22
- };
23
17
  postMessage: BlockchainOptions['postMessage'];
24
18
  feeForBlock: BlockchainLinkResponse<'estimateFee'>;
25
19
  feeTimestamp: number;