@trezor/connect 9.4.2 → 9.4.3-beta.2

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 (214) hide show
  1. package/CHANGELOG.md +90 -9
  2. package/README.md +1 -1
  3. package/lib/api/applyFlags.js +1 -1
  4. package/lib/api/applySettings.js +1 -1
  5. package/lib/api/authenticateDevice.js +1 -1
  6. package/lib/api/authorizeCoinjoin.js +1 -1
  7. package/lib/api/backupDevice.js +1 -1
  8. package/lib/api/binance/api/binanceGetAddress.js +2 -1
  9. package/lib/api/binance/api/binanceGetPublicKey.js +2 -1
  10. package/lib/api/binance/api/binanceSignTransaction.js +2 -1
  11. package/lib/api/binance/binanceSignTx.js +1 -1
  12. package/lib/api/bitcoin/Fees.js +2 -2
  13. package/lib/api/bitcoin/TransactionComposer.d.ts +3 -3
  14. package/lib/api/bitcoin/TransactionComposer.js +2 -2
  15. package/lib/api/bitcoin/refTx.js +1 -1
  16. package/lib/api/blockchainDisconnect.js +1 -1
  17. package/lib/api/blockchainEvmRpcCall.d.ts +16 -0
  18. package/lib/api/blockchainEvmRpcCall.js +45 -0
  19. package/lib/api/cancelCoinjoinAuthorization.js +1 -1
  20. package/lib/api/cardano/api/cardanoGetAddress.js +2 -1
  21. package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +2 -1
  22. package/lib/api/cardano/api/cardanoGetPublicKey.js +2 -1
  23. package/lib/api/cardano/api/cardanoSignTransaction.js +2 -1
  24. package/lib/api/cardano/cardanoAddressParameters.js +1 -1
  25. package/lib/api/cardano/cardanoAuxiliaryData.js +1 -1
  26. package/lib/api/cardano/cardanoCertificate.js +1 -1
  27. package/lib/api/cardano/cardanoInputs.d.ts +8 -8
  28. package/lib/api/cardano/cardanoInputs.js +1 -1
  29. package/lib/api/cardano/cardanoOutputs.d.ts +22 -22
  30. package/lib/api/cardano/cardanoOutputs.js +1 -1
  31. package/lib/api/cardano/cardanoTokenBundle.d.ts +6 -6
  32. package/lib/api/cardano/cardanoTokenBundle.js +1 -1
  33. package/lib/api/changeLanguage.js +1 -1
  34. package/lib/api/changePin.js +1 -1
  35. package/lib/api/cipherKeyValue.js +1 -1
  36. package/lib/api/common/paramsValidator.js +1 -1
  37. package/lib/api/composeTransaction.d.ts +9 -3
  38. package/lib/api/composeTransaction.js +7 -4
  39. package/lib/api/eos/api/eosGetPublicKey.js +2 -1
  40. package/lib/api/eos/api/eosSignTransaction.js +2 -1
  41. package/lib/api/eos/eosSignTx.d.ts +3 -3
  42. package/lib/api/ethereum/api/ethereumGetAddress.js +2 -1
  43. package/lib/api/ethereum/api/ethereumGetPublicKey.js +2 -1
  44. package/lib/api/ethereum/api/ethereumSignMessage.d.ts +1 -1
  45. package/lib/api/ethereum/api/ethereumSignMessage.js +2 -1
  46. package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -1
  47. package/lib/api/ethereum/api/ethereumSignTransaction.js +13 -7
  48. package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +58 -57
  49. package/lib/api/ethereum/api/ethereumSignTypedData.js +3 -2
  50. package/lib/api/ethereum/api/ethereumVerifyMessage.js +2 -1
  51. package/lib/api/ethereum/ethereumDefinitions.d.ts +21 -21
  52. package/lib/api/ethereum/ethereumDefinitions.js +6 -5
  53. package/lib/api/firmware/getBinary.d.ts +4 -5
  54. package/lib/api/firmware/getBinary.js +12 -13
  55. package/lib/api/firmware/getBinaryForFirmwareUpgrade.d.ts +3 -3
  56. package/lib/api/firmware/getBinaryForFirmwareUpgrade.js +2 -2
  57. package/lib/api/firmware/index.d.ts +1 -1
  58. package/lib/api/firmware/index.js +2 -1
  59. package/lib/api/firmware/x509certificate.js +3 -5
  60. package/lib/api/getAccountDescriptor.js +1 -1
  61. package/lib/api/getAddress.js +1 -1
  62. package/lib/api/getCoinInfo.d.ts +3 -0
  63. package/lib/api/getCoinInfo.js +1 -1
  64. package/lib/api/getFirmwareHash.js +1 -1
  65. package/lib/api/getOwnershipId.js +1 -1
  66. package/lib/api/getOwnershipProof.js +1 -1
  67. package/lib/api/getPublicKey.js +1 -1
  68. package/lib/api/index.d.ts +2 -1
  69. package/lib/api/index.js +5 -3
  70. package/lib/api/loadDevice.d.ts +14 -0
  71. package/lib/api/loadDevice.js +44 -0
  72. package/lib/api/nem/api/nemGetAddress.js +2 -1
  73. package/lib/api/nem/api/nemSignTransaction.js +2 -1
  74. package/lib/api/pushTransaction.js +1 -1
  75. package/lib/api/rebootToBootloader.js +1 -1
  76. package/lib/api/recoveryDevice.js +1 -1
  77. package/lib/api/requestLogin.js +1 -1
  78. package/lib/api/resetDevice.js +1 -2
  79. package/lib/api/ripple/api/rippleGetAddress.js +2 -1
  80. package/lib/api/ripple/api/rippleSignTransaction.js +2 -1
  81. package/lib/api/setBrightness.js +1 -1
  82. package/lib/api/setBusy.js +1 -1
  83. package/lib/api/signMessage.js +1 -1
  84. package/lib/api/solana/api/solanaGetAddress.js +2 -1
  85. package/lib/api/solana/api/solanaGetPublicKey.js +2 -1
  86. package/lib/api/solana/api/solanaSignTransaction.js +2 -1
  87. package/lib/api/stellar/api/stellarGetAddress.js +2 -1
  88. package/lib/api/stellar/api/stellarSignTransaction.js +2 -1
  89. package/lib/api/stellar/stellarSignTx.js +1 -1
  90. package/lib/api/tezos/api/tezosGetAddress.js +2 -1
  91. package/lib/api/tezos/api/tezosGetPublicKey.js +2 -1
  92. package/lib/api/tezos/api/tezosSignTransaction.js +2 -1
  93. package/lib/api/tezos/tezosSignTx.js +1 -1
  94. package/lib/api/unlockPath.js +1 -1
  95. package/lib/api/verifyMessage.js +1 -1
  96. package/lib/backend/Blockchain.d.ts +3 -0
  97. package/lib/backend/Blockchain.js +6 -6
  98. package/lib/constants/errors.d.ts +49 -38
  99. package/lib/constants/errors.js +10 -0
  100. package/lib/constants/firmware.d.ts +2 -0
  101. package/lib/constants/firmware.js +5 -0
  102. package/lib/constants/index.d.ts +2 -0
  103. package/lib/constants/index.js +4 -1
  104. package/lib/constants/nem.d.ts +3 -3
  105. package/lib/constants/utxo.d.ts +3 -0
  106. package/lib/constants/utxo.js +5 -0
  107. package/lib/core/AbstractMethod.d.ts +13 -5
  108. package/lib/core/AbstractMethod.js +50 -24
  109. package/lib/core/index.js +41 -30
  110. package/lib/core/onCallFirmwareUpdate.d.ts +2 -2
  111. package/lib/core/onCallFirmwareUpdate.js +6 -6
  112. package/lib/data/DataManager.d.ts +0 -181
  113. package/lib/data/DataManager.js +40 -6
  114. package/lib/data/analyticsInfo.js +4 -2
  115. package/lib/data/coinInfo.d.ts +14 -0
  116. package/lib/data/config.d.ts +20 -22
  117. package/lib/data/config.js +15 -40
  118. package/lib/data/connectSettings.js +10 -4
  119. package/lib/data/deviceAuthenticityConfig.js +20 -0
  120. package/lib/data/deviceAuthenticityConfigTypes.d.ts +32 -23
  121. package/lib/data/firmwareInfo.d.ts +1 -1
  122. package/lib/data/models.d.ts +9 -0
  123. package/lib/data/models.js +9 -0
  124. package/lib/data/version.d.ts +2 -1
  125. package/lib/data/version.js +3 -2
  126. package/lib/device/Device.d.ts +144 -36
  127. package/lib/device/Device.js +270 -113
  128. package/lib/device/DeviceCommands.js +4 -4
  129. package/lib/device/DeviceList.d.ts +13 -21
  130. package/lib/device/DeviceList.js +54 -168
  131. package/lib/device/checkFirmwareRevision.js +4 -4
  132. package/lib/device/prompts.js +3 -2
  133. package/lib/device/resolveDescriptorForTaproot.d.ts +1 -1
  134. package/lib/events/call.d.ts +5 -5
  135. package/lib/events/call.js +2 -2
  136. package/lib/events/core.d.ts +4 -3
  137. package/lib/events/device.d.ts +0 -6
  138. package/lib/events/device.js +0 -6
  139. package/lib/events/transport.d.ts +1 -1
  140. package/lib/factory.d.ts +6 -6
  141. package/lib/factory.js +132 -136
  142. package/lib/impl/dynamic.d.ts +33 -0
  143. package/lib/impl/dynamic.js +75 -0
  144. package/lib/index-browser.d.ts +3 -1
  145. package/lib/index-browser.js +0 -3
  146. package/lib/index.d.ts +3 -1
  147. package/lib/index.js +1 -13
  148. package/lib/types/api/applySettings.d.ts +13 -13
  149. package/lib/types/api/authenticateDevice.d.ts +33 -24
  150. package/lib/types/api/authorizeCoinjoin.d.ts +10 -10
  151. package/lib/types/api/binance/index.d.ts +143 -143
  152. package/lib/types/api/binance/index.js +1 -1
  153. package/lib/types/api/bitcoin/index.d.ts +11 -11
  154. package/lib/types/api/bitcoin/index.js +1 -1
  155. package/lib/types/api/blockchainEvmRpcCall.d.ts +4 -0
  156. package/lib/types/api/{checkFirmwareAuthenticity.js → blockchainEvmRpcCall.js} +1 -1
  157. package/lib/types/api/cancelCoinjoinAuthorization.d.ts +1 -1
  158. package/lib/types/api/cardano/index.d.ts +507 -507
  159. package/lib/types/api/changeLanguage.d.ts +6 -6
  160. package/lib/types/api/cipherKeyValue.d.ts +8 -8
  161. package/lib/types/api/cipherKeyValue.js +1 -1
  162. package/lib/types/api/composeTransaction.d.ts +13 -7
  163. package/lib/types/api/eos/index.d.ts +525 -525
  164. package/lib/types/api/eos/index.js +1 -1
  165. package/lib/types/api/ethereum/index.d.ts +100 -100
  166. package/lib/types/api/firmwareUpdate.d.ts +5 -5
  167. package/lib/types/api/getAccountDescriptor.d.ts +4 -4
  168. package/lib/types/api/getAddress.d.ts +32 -32
  169. package/lib/types/api/getOwnershipId.d.ts +24 -24
  170. package/lib/types/api/getOwnershipProof.d.ts +28 -28
  171. package/lib/types/api/getPublicKey.d.ts +24 -24
  172. package/lib/types/api/getPublicKey.js +1 -1
  173. package/lib/types/api/index.d.ts +4 -8
  174. package/lib/types/api/init.d.ts +4 -2
  175. package/lib/types/api/loadDevice.d.ts +4 -0
  176. package/lib/types/api/loadDevice.js +3 -0
  177. package/lib/types/api/nem/index.d.ts +612 -612
  178. package/lib/types/api/nem/index.js +1 -1
  179. package/lib/types/api/nemGetAddress.d.ts +6 -6
  180. package/lib/types/api/pushTransaction.d.ts +3 -3
  181. package/lib/types/api/recoveryDevice.d.ts +9 -9
  182. package/lib/types/api/requestLogin.d.ts +25 -25
  183. package/lib/types/api/ripple/index.d.ts +21 -21
  184. package/lib/types/api/ripple/index.js +1 -1
  185. package/lib/types/api/solana/index.d.ts +23 -23
  186. package/lib/types/api/solana/index.js +1 -1
  187. package/lib/types/api/stellar/index.d.ts +582 -582
  188. package/lib/types/api/stellar/index.js +1 -1
  189. package/lib/types/api/tezos/index.d.ts +120 -120
  190. package/lib/types/api/tezos/index.js +1 -1
  191. package/lib/types/api/unlockPath.d.ts +2 -2
  192. package/lib/types/coinInfo.d.ts +231 -224
  193. package/lib/types/device.d.ts +33 -14
  194. package/lib/types/device.js +3 -1
  195. package/lib/types/fees.d.ts +19 -19
  196. package/lib/types/firmware.d.ts +1 -1
  197. package/lib/types/params.d.ts +23 -19
  198. package/lib/types/settings.d.ts +17 -10
  199. package/lib/types/utils.d.ts +1 -0
  200. package/lib/types/utils.js +3 -0
  201. package/lib/utils/addressUtils.js +2 -2
  202. package/lib/utils/assetUtils.d.ts +1 -1
  203. package/lib/utils/assetUtils.js +6 -6
  204. package/lib/utils/assets.js +1 -1
  205. package/lib/utils/assets.native.js +1 -1
  206. package/lib/utils/deviceFeaturesUtils.js +1 -1
  207. package/lib/utils/proxy-event-emitter.d.ts +21 -0
  208. package/lib/utils/proxy-event-emitter.js +65 -0
  209. package/lib/utils/uiPromiseManager.d.ts +2 -1
  210. package/lib/utils/uiPromiseManager.js +3 -3
  211. package/package.json +12 -12
  212. package/lib/api/checkFirmwareAuthenticity.d.ts +0 -11
  213. package/lib/api/checkFirmwareAuthenticity.js +0 -56
  214. package/lib/types/api/checkFirmwareAuthenticity.d.ts +0 -11
@@ -2,14 +2,14 @@ import { Static } from '@trezor/schema-utils';
2
2
  import type { Params, Response } from '../params';
3
3
  import { PROTO } from '../../constants';
4
4
  export type ChangeLanguage = Static<typeof ChangeLanguage>;
5
- export declare const ChangeLanguage: import("@sinclair/typebox").TUnion<[import("@trezor/schema-utils").TObject<{
6
- binary: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
7
- language: import("@sinclair/typebox").TString;
8
- baseUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
5
+ export declare const ChangeLanguage: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TObject<{
6
+ binary: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
7
+ language: import("@trezor/schema-utils").TString;
8
+ baseUrl: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
9
9
  }>, import("@trezor/schema-utils").TObject<{
10
10
  binary: import("@trezor/schema-utils/lib/custom-types/array-buffer").TArrayBuffer;
11
- language: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
12
- baseUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUndefined>;
11
+ language: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
12
+ baseUrl: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
13
13
  }>]>;
14
14
  export declare function changeLanguage(params: Params<ChangeLanguage>): Response<PROTO.Success>;
15
15
  //# sourceMappingURL=changeLanguage.d.ts.map
@@ -1,14 +1,14 @@
1
- import { Params, BundledParams, Response } from '../params';
2
1
  import { Static } from '@trezor/schema-utils';
2
+ import { Params, BundledParams, Response } from '../params';
3
3
  export type CipherKeyValue = Static<typeof CipherKeyValue>;
4
4
  export declare const CipherKeyValue: import("@trezor/schema-utils").TObject<{
5
- path: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>]>;
6
- key: import("@sinclair/typebox").TString;
7
- value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@trezor/schema-utils/lib/custom-types/buffer").TBuffer]>;
8
- encrypt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
9
- askOnEncrypt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
10
- askOnDecrypt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
11
- iv: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@trezor/schema-utils/lib/custom-types/buffer").TBuffer]>>;
5
+ path: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>]>;
6
+ key: import("@trezor/schema-utils").TString;
7
+ value: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils/lib/custom-types/buffer").TBuffer]>;
8
+ encrypt: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
9
+ askOnEncrypt: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
10
+ askOnDecrypt: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
11
+ iv: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils/lib/custom-types/buffer").TBuffer]>>;
12
12
  }>;
13
13
  export interface CipheredValue {
14
14
  value: string;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CipherKeyValue = void 0;
4
- const params_1 = require("../params");
5
4
  const schema_utils_1 = require("@trezor/schema-utils");
5
+ const params_1 = require("../params");
6
6
  exports.CipherKeyValue = schema_utils_1.Type.Object({
7
7
  path: params_1.DerivationPath,
8
8
  key: schema_utils_1.Type.String(),
@@ -1,5 +1,5 @@
1
1
  import type { AccountAddresses, Utxo as AccountUtxo, Address as AccountAddress } from '@trezor/blockchain-link';
2
- import type { ComposeInput as ComposeInputBase, ComposeOutput as ComposeOutputBase, ComposeResultError as ComposeResultErrorBase, ComposeResultFinal as ComposeResultFinalBase, ComposeResultNonFinal as ComposeResultNonFinalBase } from '@trezor/utxo-lib';
2
+ import type { ComposeInput as ComposeInputBase, ComposeOutput as ComposeOutputBase, ComposeResultError as ComposeResultErrorBase, ComposeResultFinal as ComposeResultFinalBase, ComposeResultNonFinal as ComposeResultNonFinalBase, TransactionInputOutputSortingStrategy } from '@trezor/utxo-lib';
3
3
  import type { PROTO } from '../../constants';
4
4
  import type { Params, Response } from '../params';
5
5
  export type ComposeOutputPayment = Omit<Extract<ComposeOutputBase, {
@@ -10,7 +10,14 @@ export type ComposeOutputPayment = Omit<Extract<ComposeOutputBase, {
10
10
  export type ComposeOutput = Exclude<ComposeOutputBase, {
11
11
  type: 'payment';
12
12
  }> | ComposeOutputPayment;
13
- export interface ComposeParams {
13
+ type SortingStrategyPropsWithBackCompatibility = {
14
+ skipPermutation?: boolean;
15
+ sortingStrategy?: undefined;
16
+ } | {
17
+ skipPermutation?: undefined;
18
+ sortingStrategy?: TransactionInputOutputSortingStrategy;
19
+ };
20
+ export type ComposeParams = {
14
21
  outputs: ComposeOutput[];
15
22
  coin: string;
16
23
  identity?: string;
@@ -20,15 +27,14 @@ export interface ComposeParams {
20
27
  sequence?: number;
21
28
  baseFee?: number;
22
29
  floorBaseFee?: boolean;
23
- skipPermutation?: boolean;
24
- }
30
+ } & SortingStrategyPropsWithBackCompatibility;
25
31
  export type SignedTransaction = {
26
32
  signatures: string[];
27
33
  serializedTx: string;
28
34
  txid?: string;
29
35
  };
30
36
  export type ComposeUtxo = AccountUtxo & Partial<ComposeInputBase>;
31
- export interface PrecomposeParams {
37
+ export type PrecomposeParams = {
32
38
  outputs: ComposeOutput[];
33
39
  coin: string;
34
40
  identity?: string;
@@ -44,8 +50,7 @@ export interface PrecomposeParams {
44
50
  baseFee?: number;
45
51
  floorBaseFee?: boolean;
46
52
  sequence?: number;
47
- skipPermutation?: boolean;
48
- }
53
+ } & SortingStrategyPropsWithBackCompatibility;
49
54
  export type ComposedInputs = AccountUtxo & ComposeInputBase;
50
55
  export type ComposeResultError = ComposeResultErrorBase | {
51
56
  type: 'error';
@@ -65,4 +70,5 @@ export type PrecomposeResultFinal = Omit<ComposeResultFinal, 'inputs' | 'outputs
65
70
  export type PrecomposedResult = PrecomposeResultError | PrecomposeResultNonFinal | PrecomposeResultFinal;
66
71
  export declare function composeTransaction(params: Params<ComposeParams>): Response<SignedTransaction>;
67
72
  export declare function composeTransaction(params: Params<PrecomposeParams>): Response<PrecomposedResult[]>;
73
+ export {};
68
74
  //# sourceMappingURL=composeTransaction.d.ts.map