@trezor/connect 9.1.4 → 9.1.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 (184) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +1 -1
  3. package/lib/api/authenticateDevice.d.ts +7 -0
  4. package/lib/api/authenticateDevice.js +51 -0
  5. package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +3 -3
  6. package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +6 -6
  7. package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
  8. package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
  9. package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +2 -2
  10. package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +5 -5
  11. package/lib/api/binance/api/index.d.ts +4 -0
  12. package/lib/api/binance/api/index.js +13 -0
  13. package/lib/api/bitcoin/TransactionComposer.d.ts +4 -4
  14. package/lib/api/bitcoin/TransactionComposer.js +4 -18
  15. package/lib/api/bitcoin/inputs.d.ts +2 -2
  16. package/lib/api/bitcoin/inputs.js +4 -5
  17. package/lib/api/bitcoin/outputs.d.ts +4 -4
  18. package/lib/api/bitcoin/outputs.js +14 -23
  19. package/lib/api/blockchainEstimateFee.d.ts +2 -2
  20. package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
  21. package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
  22. package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +3 -3
  23. package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +7 -7
  24. package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
  25. package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
  26. package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
  27. package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
  28. package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +18 -8
  29. package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +30 -13
  30. package/lib/api/cardano/api/index.d.ts +6 -0
  31. package/lib/api/cardano/api/index.js +17 -0
  32. package/lib/api/cardano/cardanoUtils.d.ts +6 -0
  33. package/lib/api/cardano/cardanoUtils.js +64 -1
  34. package/lib/api/checkFirmwareAuthenticity.js +7 -5
  35. package/lib/api/common/paramsValidator.js +45 -51
  36. package/lib/api/composeTransaction.d.ts +5 -5
  37. package/lib/api/composeTransaction.js +14 -19
  38. package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
  39. package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +5 -5
  40. package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +2 -2
  41. package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +5 -5
  42. package/lib/api/eos/api/index.d.ts +3 -0
  43. package/lib/api/eos/api/index.js +11 -0
  44. package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +4 -4
  45. package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +9 -9
  46. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
  47. package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
  48. package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
  49. package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
  50. package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +11 -9
  51. package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +36 -43
  52. package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
  53. package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
  54. package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
  55. package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
  56. package/lib/api/ethereum/api/index.d.ts +7 -0
  57. package/lib/api/ethereum/api/index.js +19 -0
  58. package/lib/api/ethereum/ethereumDefinitions.js +3 -2
  59. package/lib/api/ethereum/ethereumSignTx.d.ts +2 -0
  60. package/lib/api/ethereum/ethereumSignTx.js +15 -1
  61. package/lib/api/firmware/getBinary.js +1 -1
  62. package/lib/api/firmware/verifyAuthenticityProof.d.ts +14 -0
  63. package/lib/api/firmware/verifyAuthenticityProof.js +103 -0
  64. package/lib/api/firmware/x509certificate.d.ts +74 -0
  65. package/lib/api/firmware/x509certificate.js +235 -0
  66. package/lib/api/firmwareUpdate.js +2 -1
  67. package/lib/api/getAccountDescriptor.d.ts +20 -0
  68. package/lib/api/getAccountDescriptor.js +162 -0
  69. package/lib/api/getAccountInfo.d.ts +2 -0
  70. package/lib/api/getAccountInfo.js +1 -5
  71. package/lib/api/getFirmwareHash.js +1 -4
  72. package/lib/api/index.d.ts +2 -24
  73. package/lib/api/index.js +5 -50
  74. package/lib/api/nem/api/index.d.ts +3 -0
  75. package/lib/api/nem/api/index.js +11 -0
  76. package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +3 -3
  77. package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +6 -6
  78. package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
  79. package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +5 -5
  80. package/lib/api/rebootToBootloader.js +1 -4
  81. package/lib/api/ripple/api/index.d.ts +3 -0
  82. package/lib/api/ripple/api/index.js +11 -0
  83. package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +3 -3
  84. package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +6 -6
  85. package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
  86. package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +4 -4
  87. package/lib/api/solana/api/index.d.ts +4 -0
  88. package/lib/api/solana/api/index.js +13 -0
  89. package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
  90. package/lib/api/solana/api/solanaGetAddress.js +131 -0
  91. package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
  92. package/lib/api/solana/api/solanaGetPublicKey.js +84 -0
  93. package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
  94. package/lib/api/solana/api/solanaSignTransaction.js +33 -0
  95. package/lib/api/stellar/api/index.d.ts +3 -0
  96. package/lib/api/stellar/api/index.js +11 -0
  97. package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +3 -3
  98. package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +6 -6
  99. package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
  100. package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
  101. package/lib/api/tezos/api/index.d.ts +4 -0
  102. package/lib/api/tezos/api/index.js +13 -0
  103. package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +3 -3
  104. package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +6 -6
  105. package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
  106. package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +5 -5
  107. package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
  108. package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
  109. package/lib/backend/Blockchain.js +2 -0
  110. package/lib/constants/cardano.js +2 -2
  111. package/lib/constants/nem.js +3 -3
  112. package/lib/constants/network.d.ts +3 -0
  113. package/lib/constants/network.js +13 -1
  114. package/lib/core/AbstractMethod.d.ts +1 -0
  115. package/lib/core/AbstractMethod.js +11 -10
  116. package/lib/core/index.d.ts +5 -2
  117. package/lib/core/index.js +28 -7
  118. package/lib/core/method.d.ts +2 -2
  119. package/lib/core/method.js +8 -2
  120. package/lib/core/method.native.d.ts +5 -0
  121. package/lib/core/method.native.js +34 -0
  122. package/lib/data/DataManager.d.ts +64 -7
  123. package/lib/data/DataManager.js +4 -2
  124. package/lib/data/config.d.ts +63 -6
  125. package/lib/data/config.js +39 -23
  126. package/lib/data/connectSettings.js +7 -0
  127. package/lib/data/defaultFeeLevels.js +8 -0
  128. package/lib/data/deviceAuthenticityConfig.d.ts +15 -0
  129. package/lib/data/deviceAuthenticityConfig.js +26 -0
  130. package/lib/data/firmwareInfo.d.ts +3 -2
  131. package/lib/data/firmwareInfo.js +17 -8
  132. package/lib/data/models.d.ts +4 -1
  133. package/lib/data/models.js +6 -3
  134. package/lib/data/version.d.ts +1 -1
  135. package/lib/data/version.js +1 -1
  136. package/lib/device/Device.d.ts +2 -2
  137. package/lib/device/Device.js +22 -13
  138. package/lib/device/DeviceCommands.js +9 -0
  139. package/lib/device/DeviceList.d.ts +1 -0
  140. package/lib/device/DeviceList.js +8 -4
  141. package/lib/events/iframe.d.ts +7 -1
  142. package/lib/events/iframe.js +1 -0
  143. package/lib/events/popup.d.ts +19 -3
  144. package/lib/events/popup.js +3 -0
  145. package/lib/factory.js +6 -0
  146. package/lib/types/api/authenticateDevice.d.ts +21 -0
  147. package/lib/types/api/authenticateDevice.js +3 -0
  148. package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
  149. package/lib/types/api/cardanoComposeTransaction.js +3 -0
  150. package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
  151. package/lib/types/api/composeTransaction.d.ts +28 -54
  152. package/lib/types/api/ethereum/index.d.ts +1 -0
  153. package/lib/types/api/getAccountDescriptor.d.ts +16 -0
  154. package/lib/types/api/getAccountDescriptor.js +3 -0
  155. package/lib/types/api/index.d.ts +12 -0
  156. package/lib/types/api/solana/index.d.ts +12 -0
  157. package/lib/types/api/solana/index.js +3 -0
  158. package/lib/types/api/solanaGetAddress.d.ts +4 -0
  159. package/lib/types/api/solanaGetAddress.js +3 -0
  160. package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
  161. package/lib/types/api/solanaGetPublicKey.js +3 -0
  162. package/lib/types/api/solanaSignTransaction.d.ts +4 -0
  163. package/lib/types/api/solanaSignTransaction.js +3 -0
  164. package/lib/types/coinInfo.d.ts +5 -15
  165. package/lib/types/device.js +1 -1
  166. package/lib/types/firmware.d.ts +6 -2
  167. package/lib/types/index.d.ts +4 -1
  168. package/lib/types/index.js +1 -0
  169. package/lib/types/settings.d.ts +1 -0
  170. package/lib/utils/assetUtils.js +6 -4
  171. package/lib/utils/debug.d.ts +10 -5
  172. package/lib/utils/debug.js +55 -17
  173. package/lib/utils/deviceFeaturesUtils.js +5 -3
  174. package/lib/utils/formatUtils.d.ts +2 -0
  175. package/lib/utils/formatUtils.js +19 -1
  176. package/lib/workers/workers-browser.d.ts +2 -1
  177. package/lib/workers/workers-browser.js +3 -1
  178. package/lib/workers/workers-react-native.d.ts +2 -1
  179. package/lib/workers/workers-react-native.js +3 -1
  180. package/lib/workers/workers.d.ts +8 -5
  181. package/lib/workers/workers.js +34 -10
  182. package/package.json +25 -18
  183. package/lib/api/eosGetPublicKey.d.ts +0 -11
  184. package/lib/api/ethereumGetPublicKey.d.ts +0 -16
@@ -8,6 +8,7 @@ exports.IFRAME = {
8
8
  INIT: 'iframe-init',
9
9
  ERROR: 'iframe-error',
10
10
  CALL: 'iframe-call',
11
+ LOG: 'iframe-log',
11
12
  };
12
13
  const createIFrameMessage = (type, payload) => ({
13
14
  event: ui_request_1.UI_EVENT,
@@ -5,6 +5,7 @@ import type { MessageFactoryFn } from '../types/utils';
5
5
  export declare const POPUP: {
6
6
  readonly BOOTSTRAP: "popup-bootstrap";
7
7
  readonly LOADED: "popup-loaded";
8
+ readonly CORE_LOADED: "popup-core-loaded";
8
9
  readonly INIT: "popup-init";
9
10
  readonly ERROR: "popup-error";
10
11
  readonly EXTENSION_USB_PERMISSIONS: "open-usb-permissions";
@@ -13,6 +14,8 @@ export declare const POPUP: {
13
14
  readonly CANCEL_POPUP_REQUEST: "ui-cancel-popup-request";
14
15
  readonly CLOSE_WINDOW: "window.close";
15
16
  readonly ANALYTICS_RESPONSE: "popup-analytics-response";
17
+ readonly CONTENT_SCRIPT_LOADED: "popup-content-script-loaded";
18
+ readonly METHOD_INFO: "popup-method-info";
16
19
  };
17
20
  export interface PopupInit {
18
21
  type: typeof POPUP.INIT;
@@ -20,13 +23,13 @@ export interface PopupInit {
20
23
  settings: ConnectSettings;
21
24
  useBroadcastChannel: boolean;
22
25
  systemInfo: SystemInfo;
26
+ useCore?: boolean;
23
27
  };
24
28
  }
25
29
  export interface PopupHandshake {
26
30
  type: typeof POPUP.HANDSHAKE;
27
31
  payload: {
28
32
  settings: ConnectSettings;
29
- method?: string;
30
33
  transport?: TransportInfo;
31
34
  };
32
35
  }
@@ -48,10 +51,23 @@ export interface PopupAnalyticsResponse {
48
51
  enabled: boolean;
49
52
  };
50
53
  }
54
+ export interface PopupMethodInfo {
55
+ type: typeof POPUP.METHOD_INFO;
56
+ payload: {
57
+ info: string;
58
+ method: string;
59
+ };
60
+ }
61
+ export interface PopupContentScriptLoaded {
62
+ type: typeof POPUP.CONTENT_SCRIPT_LOADED;
63
+ payload: {
64
+ id: string;
65
+ };
66
+ }
51
67
  export type PopupEvent = {
52
- type: typeof POPUP.LOADED | typeof POPUP.CANCEL_POPUP_REQUEST;
68
+ type: typeof POPUP.LOADED | typeof POPUP.CORE_LOADED | typeof POPUP.CANCEL_POPUP_REQUEST;
53
69
  payload?: typeof undefined;
54
- } | PopupInit | PopupHandshake | PopupError | PopupClosedMessage | PopupAnalyticsResponse;
70
+ } | PopupInit | PopupHandshake | PopupError | PopupClosedMessage | PopupAnalyticsResponse | PopupContentScriptLoaded | PopupMethodInfo;
55
71
  export type PopupEventMessage = PopupEvent & {
56
72
  event: typeof UI_EVENT;
57
73
  };
@@ -5,6 +5,7 @@ const ui_request_1 = require("./ui-request");
5
5
  exports.POPUP = {
6
6
  BOOTSTRAP: 'popup-bootstrap',
7
7
  LOADED: 'popup-loaded',
8
+ CORE_LOADED: 'popup-core-loaded',
8
9
  INIT: 'popup-init',
9
10
  ERROR: 'popup-error',
10
11
  EXTENSION_USB_PERMISSIONS: 'open-usb-permissions',
@@ -13,6 +14,8 @@ exports.POPUP = {
13
14
  CANCEL_POPUP_REQUEST: 'ui-cancel-popup-request',
14
15
  CLOSE_WINDOW: 'window.close',
15
16
  ANALYTICS_RESPONSE: 'popup-analytics-response',
17
+ CONTENT_SCRIPT_LOADED: 'popup-content-script-loaded',
18
+ METHOD_INFO: 'popup-method-info',
16
19
  };
17
20
  const createPopupMessage = (type, payload) => ({
18
21
  event: ui_request_1.UI_EVENT,
package/lib/factory.js CHANGED
@@ -42,6 +42,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
42
42
  cardanoGetNativeScriptHash: params => call({ ...params, method: 'cardanoGetNativeScriptHash' }),
43
43
  cardanoGetPublicKey: params => call({ ...params, method: 'cardanoGetPublicKey' }),
44
44
  cardanoSignTransaction: params => call({ ...params, method: 'cardanoSignTransaction' }),
45
+ cardanoComposeTransaction: params => call({ ...params, method: 'cardanoComposeTransaction' }),
45
46
  cipherKeyValue: params => call({ ...params, method: 'cipherKeyValue' }),
46
47
  composeTransaction: params => call({ ...params, method: 'composeTransaction' }),
47
48
  ethereumGetAddress: params => call({
@@ -54,6 +55,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
54
55
  ethereumSignTransaction: params => call({ ...params, method: 'ethereumSignTransaction' }),
55
56
  ethereumSignTypedData: params => call({ ...params, method: 'ethereumSignTypedData' }),
56
57
  ethereumVerifyMessage: params => call({ ...params, method: 'ethereumVerifyMessage' }),
58
+ getAccountDescriptor: params => call({ ...params, method: 'getAccountDescriptor' }),
57
59
  getAccountInfo: params => call({ ...params, method: 'getAccountInfo' }),
58
60
  getAddress: params => call({
59
61
  ...params,
@@ -81,6 +83,9 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
81
83
  rippleSignTransaction: params => call({ ...params, method: 'rippleSignTransaction' }),
82
84
  signMessage: params => call({ ...params, method: 'signMessage' }),
83
85
  signTransaction: params => call({ ...params, method: 'signTransaction' }),
86
+ solanaGetPublicKey: params => call({ ...params, method: 'solanaGetPublicKey' }),
87
+ solanaGetAddress: params => call({ ...params, method: 'solanaGetAddress' }),
88
+ solanaSignTransaction: params => call({ ...params, method: 'solanaSignTransaction' }),
84
89
  stellarGetAddress: params => call({
85
90
  ...params,
86
91
  method: 'stellarGetAddress',
@@ -110,6 +115,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
110
115
  checkFirmwareAuthenticity: params => call({ ...params, method: 'checkFirmwareAuthenticity' }),
111
116
  applyFlags: params => call({ ...params, method: 'applyFlags' }),
112
117
  applySettings: params => call({ ...params, method: 'applySettings' }),
118
+ authenticateDevice: params => call({ ...params, method: 'authenticateDevice' }),
113
119
  authorizeCoinjoin: params => call({ ...params, method: 'authorizeCoinjoin' }),
114
120
  cancelCoinjoinAuthorization: params => call({ ...params, method: 'cancelCoinjoinAuthorization' }),
115
121
  showDeviceTutorial: params => call({ ...params, method: 'showDeviceTutorial' }),
@@ -0,0 +1,21 @@
1
+ import type { DeviceAuthenticityConfig } from '../../data/deviceAuthenticityConfig';
2
+ import type { Params, Response } from '../params';
3
+ export interface AuthenticateDeviceParams {
4
+ config?: DeviceAuthenticityConfig;
5
+ allowDebugKeys?: boolean;
6
+ }
7
+ export type AuthenticateDeviceResult = {
8
+ valid: true;
9
+ caPubKey: string;
10
+ debugKey?: boolean;
11
+ configExpired?: typeof undefined;
12
+ error?: typeof undefined;
13
+ } | {
14
+ valid: false;
15
+ caPubKey: string;
16
+ debugKey?: boolean;
17
+ configExpired?: boolean;
18
+ error: 'ROOT_PUBKEY_NOT_FOUND' | 'CA_PUBKEY_NOT_FOUND' | 'INVALID_DEVICE_MODEL' | 'INVALID_DEVICE_CERTIFICATE' | 'INVALID_DEVICE_SIGNATURE';
19
+ };
20
+ export declare function authenticateDevice(params: Params<AuthenticateDeviceParams>): Response<AuthenticateDeviceResult>;
21
+ //# sourceMappingURL=authenticateDevice.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=authenticateDevice.js.map
@@ -0,0 +1,44 @@
1
+ import type { types, trezorUtils } from '@fivebinaries/coin-selection';
2
+ import type { AccountAddresses, AccountUtxo } from '../../exports';
3
+ import type { Params, Response } from '../params';
4
+ import type { CardanoCertificate, CardanoInput, CardanoOutput } from './cardano';
5
+ import type { PrecomposeResultFinal, PrecomposeResultNonFinal, PrecomposeResultError } from './composeTransaction';
6
+ export type PrecomposedTransactionFinalCardano = Omit<PrecomposeResultFinal, 'inputs' | 'outputs' | 'outputsPermutation'> & {
7
+ deposit?: string;
8
+ ttl?: number;
9
+ inputs: CardanoInput[];
10
+ outputs: CardanoOutput[];
11
+ unsignedTx: {
12
+ body: string;
13
+ hash: string;
14
+ };
15
+ };
16
+ export type PrecomposedTransactionNonFinalCardano = Omit<PrecomposeResultNonFinal, 'inputs'> & {
17
+ deposit?: string;
18
+ };
19
+ export type PrecomposedTransactionErrorCardano = PrecomposeResultError | {
20
+ type: 'error';
21
+ error: 'UTXO_BALANCE_INSUFFICIENT' | 'UTXO_VALUE_TOO_SMALL';
22
+ };
23
+ export type PrecomposedTransactionCardano = PrecomposedTransactionFinalCardano | PrecomposedTransactionNonFinalCardano | PrecomposedTransactionErrorCardano;
24
+ export type CardanoComposeTransactionParams = {
25
+ account: {
26
+ descriptor: string;
27
+ addresses: AccountAddresses;
28
+ utxo: AccountUtxo[];
29
+ };
30
+ feeLevels?: {
31
+ feePerUnit?: string;
32
+ }[];
33
+ outputs?: types.UserOutput[];
34
+ certificates?: CardanoCertificate[];
35
+ withdrawals?: types.Withdrawal[];
36
+ changeAddress: {
37
+ address: string;
38
+ path: string;
39
+ };
40
+ addressParameters: Parameters<(typeof trezorUtils)['transformToTrezorOutputs']>[1];
41
+ testnet?: boolean;
42
+ };
43
+ export declare function cardanoComposeTransaction(params: Params<CardanoComposeTransactionParams>): Response<PrecomposedTransactionCardano[]>;
44
+ //# sourceMappingURL=cardanoComposeTransaction.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cardanoComposeTransaction.js.map
@@ -1,4 +1,13 @@
1
1
  import type { Params, Response } from '../params';
2
2
  import type { CardanoSignTransaction, CardanoSignedTxData } from './cardano';
3
3
  export declare function cardanoSignTransaction(params: Params<CardanoSignTransaction>): Response<CardanoSignedTxData>;
4
+ export declare function cardanoSignTransaction(params: Params<CardanoSignTransaction & {
5
+ unsignedTx: {
6
+ body: string;
7
+ hash: string;
8
+ };
9
+ testnet: boolean;
10
+ }>): Response<CardanoSignedTxData & {
11
+ serializedTx: string;
12
+ }>;
4
13
  //# sourceMappingURL=cardanoSignTransaction.d.ts.map
@@ -1,34 +1,15 @@
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';
1
3
  import type { PROTO } from '../../constants';
2
- import type { AccountAddresses, Utxo as AccountUtxo } from '@trezor/blockchain-link';
3
4
  import type { Params, Response } from '../params';
4
- export interface RegularOutput {
5
- type?: 'external';
6
- address: string;
7
- amount: string;
8
- script_type?: 'PAYTOADDRESS';
9
- }
10
- export interface InternalOutput {
11
- type?: 'internal';
12
- address_n: number[];
13
- amount: string;
14
- script_type?: string;
15
- }
16
- export interface SendMaxOutput {
17
- type: 'send-max';
18
- address: string;
19
- }
20
- export interface OpReturnOutput {
21
- type: 'opreturn';
22
- dataHex: string;
23
- }
24
- export interface NoAddressOutput {
25
- type: 'noaddress';
26
- amount: string;
27
- }
28
- export interface NoAddressSendMaxOutput {
29
- type: 'send-max-noaddress';
30
- }
31
- export type ComposeOutput = RegularOutput | InternalOutput | SendMaxOutput | OpReturnOutput | NoAddressOutput | NoAddressSendMaxOutput;
5
+ export type ComposeOutputPayment = Omit<Extract<ComposeOutputBase, {
6
+ type: 'payment';
7
+ }>, 'type'> & {
8
+ type?: 'payment';
9
+ };
10
+ export type ComposeOutput = Exclude<ComposeOutputBase, {
11
+ type: 'payment';
12
+ }> | ComposeOutputPayment;
32
13
  export interface ComposeParams {
33
14
  outputs: ComposeOutput[];
34
15
  coin: string;
@@ -45,15 +26,14 @@ export type SignedTransaction = {
45
26
  serializedTx: string;
46
27
  txid?: string;
47
28
  };
29
+ export type ComposeUtxo = AccountUtxo & Partial<ComposeInputBase>;
48
30
  export interface PrecomposeParams {
49
31
  outputs: ComposeOutput[];
50
32
  coin: string;
51
33
  account: {
52
34
  path: string;
53
35
  addresses: AccountAddresses;
54
- utxo: (AccountUtxo & {
55
- required?: boolean;
56
- })[];
36
+ utxo: ComposeUtxo[];
57
37
  };
58
38
  feeLevels: {
59
39
  feePerUnit: string;
@@ -64,29 +44,23 @@ export interface PrecomposeParams {
64
44
  sequence?: number;
65
45
  skipPermutation?: boolean;
66
46
  }
67
- export type PrecomposedTransaction = {
47
+ export type ComposedInputs = AccountUtxo & ComposeInputBase;
48
+ export type ComposeResultError = ComposeResultErrorBase | {
68
49
  type: 'error';
69
- error: string;
70
- } | {
71
- type: 'nonfinal';
72
- max?: string;
73
- totalSpent: string;
74
- fee: string;
75
- feePerByte: string;
76
- bytes: number;
77
- } | {
78
- type: 'final';
79
- max?: string;
80
- totalSpent: string;
81
- fee: string;
82
- feePerByte: string;
83
- bytes: number;
84
- transaction: {
85
- inputs: PROTO.TxInputType[];
86
- outputs: PROTO.TxOutputType[];
87
- outputsPermutation: number[];
88
- };
50
+ error: 'ADDRESSES-NOT-SET';
51
+ };
52
+ export type ComposeResultFinal = ComposeResultFinalBase<ComposedInputs, ComposeOutputBase, AccountAddress>;
53
+ export type ComposeResultNonFinal = ComposeResultNonFinalBase<ComposedInputs>;
54
+ export type ComposeResult = ComposeResultError | ComposeResultNonFinal | ComposeResultFinal;
55
+ export type PrecomposeResultError = ComposeResultError;
56
+ export type PrecomposeResultNonFinal = Omit<ComposeResultNonFinal, 'inputs'> & {
57
+ inputs: PROTO.TxInputType[];
58
+ };
59
+ export type PrecomposeResultFinal = Omit<ComposeResultFinal, 'inputs' | 'outputs'> & {
60
+ inputs: PROTO.TxInputType[];
61
+ outputs: PROTO.TxOutputType[];
89
62
  };
63
+ export type PrecomposedResult = PrecomposeResultError | PrecomposeResultNonFinal | PrecomposeResultFinal;
90
64
  export declare function composeTransaction(params: Params<ComposeParams>): Response<SignedTransaction>;
91
- export declare function composeTransaction(params: Params<PrecomposeParams>): Response<PrecomposedTransaction[]>;
65
+ export declare function composeTransaction(params: Params<PrecomposeParams>): Response<PrecomposedResult[]>;
92
66
  //# sourceMappingURL=composeTransaction.d.ts.map
@@ -40,6 +40,7 @@ export interface EthereumSignedTx {
40
40
  v: string;
41
41
  r: string;
42
42
  s: string;
43
+ serializedTx: string;
43
44
  }
44
45
  interface EthereumSignTypedDataTypeProperty {
45
46
  name: string;
@@ -0,0 +1,16 @@
1
+ import type { PROTO } from '../../constants';
2
+ import type { Params, BundledParams, Response, DerivationPath } from '../params';
3
+ export interface GetAccountDescriptorParams {
4
+ path: DerivationPath;
5
+ coin: string;
6
+ derivationType?: PROTO.CardanoDerivationType;
7
+ suppressBackupWarning?: boolean;
8
+ }
9
+ export interface GetAccountDescriptorResponse {
10
+ descriptor: string;
11
+ path: string;
12
+ legacyXpub?: string;
13
+ }
14
+ export declare function getAccountDescriptor(params: Params<GetAccountDescriptorParams>): Response<GetAccountDescriptorResponse>;
15
+ export declare function getAccountDescriptor(params: BundledParams<GetAccountDescriptorParams>): Response<(GetAccountDescriptorResponse | null)[]>;
16
+ //# sourceMappingURL=getAccountDescriptor.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=getAccountDescriptor.js.map
@@ -1,5 +1,6 @@
1
1
  import { applyFlags } from './applyFlags';
2
2
  import { applySettings } from './applySettings';
3
+ import { authenticateDevice } from './authenticateDevice';
3
4
  import { authorizeCoinjoin } from './authorizeCoinjoin';
4
5
  import { backupDevice } from './backupDevice';
5
6
  import { binanceGetAddress } from './binanceGetAddress';
@@ -21,6 +22,7 @@ import { cardanoGetAddress } from './cardanoGetAddress';
21
22
  import { cardanoGetNativeScriptHash } from './cardanoGetNativeScriptHash';
22
23
  import { cardanoGetPublicKey } from './cardanoGetPublicKey';
23
24
  import { cardanoSignTransaction } from './cardanoSignTransaction';
25
+ import { cardanoComposeTransaction } from './cardanoComposeTransaction';
24
26
  import { changePin } from './changePin';
25
27
  import { cipherKeyValue } from './cipherKeyValue';
26
28
  import { composeTransaction } from './composeTransaction';
@@ -35,6 +37,7 @@ import { ethereumSignTransaction } from './ethereumSignTransaction';
35
37
  import { ethereumSignTypedData } from './ethereumSignTypedData';
36
38
  import { ethereumVerifyMessage } from './ethereumVerifyMessage';
37
39
  import { firmwareUpdate } from './firmwareUpdate';
40
+ import { getAccountDescriptor } from './getAccountDescriptor';
38
41
  import { getAccountInfo } from './getAccountInfo';
39
42
  import { getAddress } from './getAddress';
40
43
  import { getCoinInfo } from './getCoinInfo';
@@ -65,6 +68,9 @@ import { setBusy } from './setBusy';
65
68
  import { setProxy } from './setProxy';
66
69
  import { signMessage } from './signMessage';
67
70
  import { signTransaction } from './signTransaction';
71
+ import { solanaGetPublicKey } from './solanaGetPublicKey';
72
+ import { solanaGetAddress } from './solanaGetAddress';
73
+ import { solanaSignTransaction } from './solanaSignTransaction';
68
74
  import { stellarGetAddress } from './stellarGetAddress';
69
75
  import { stellarSignTransaction } from './stellarSignTransaction';
70
76
  import { tezosGetAddress } from './tezosGetAddress';
@@ -80,6 +86,7 @@ import { showDeviceTutorial } from './showDeviceTutorial';
80
86
  export interface TrezorConnect {
81
87
  applyFlags: typeof applyFlags;
82
88
  applySettings: typeof applySettings;
89
+ authenticateDevice: typeof authenticateDevice;
83
90
  authorizeCoinjoin: typeof authorizeCoinjoin;
84
91
  cancelCoinjoinAuthorization: typeof cancelCoinjoinAuthorization;
85
92
  showDeviceTutorial: typeof showDeviceTutorial;
@@ -103,6 +110,7 @@ export interface TrezorConnect {
103
110
  cardanoGetNativeScriptHash: typeof cardanoGetNativeScriptHash;
104
111
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
105
112
  cardanoSignTransaction: typeof cardanoSignTransaction;
113
+ cardanoComposeTransaction: typeof cardanoComposeTransaction;
106
114
  changePin: typeof changePin;
107
115
  cipherKeyValue: typeof cipherKeyValue;
108
116
  composeTransaction: typeof composeTransaction;
@@ -118,6 +126,7 @@ export interface TrezorConnect {
118
126
  ethereumSignTypedData: typeof ethereumSignTypedData;
119
127
  ethereumVerifyMessage: typeof ethereumVerifyMessage;
120
128
  firmwareUpdate: typeof firmwareUpdate;
129
+ getAccountDescriptor: typeof getAccountDescriptor;
121
130
  getAccountInfo: typeof getAccountInfo;
122
131
  getAddress: typeof getAddress;
123
132
  getCoinInfo: typeof getCoinInfo;
@@ -147,6 +156,9 @@ export interface TrezorConnect {
147
156
  setProxy: typeof setProxy;
148
157
  signMessage: typeof signMessage;
149
158
  signTransaction: typeof signTransaction;
159
+ solanaGetPublicKey: typeof solanaGetPublicKey;
160
+ solanaGetAddress: typeof solanaGetAddress;
161
+ solanaSignTransaction: typeof solanaSignTransaction;
150
162
  stellarGetAddress: typeof stellarGetAddress;
151
163
  stellarSignTransaction: typeof stellarSignTransaction;
152
164
  tezosGetAddress: typeof tezosGetAddress;
@@ -0,0 +1,12 @@
1
+ import type { PublicKey } from '../../params';
2
+ export interface SolanaPublicKey extends PublicKey {
3
+ publicKey: string;
4
+ }
5
+ export interface SolanaSignTransaction {
6
+ path: string | number[];
7
+ serializedTx: string;
8
+ }
9
+ export interface SolanaSignedTransaction {
10
+ signature: string;
11
+ }
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import type { Address, GetAddress, Params, BundledParams, Response } from '../params';
2
+ export declare function solanaGetAddress(params: Params<GetAddress>): Response<Address>;
3
+ export declare function solanaGetAddress(params: BundledParams<GetAddress>): Response<Address[]>;
4
+ //# sourceMappingURL=solanaGetAddress.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=solanaGetAddress.js.map
@@ -0,0 +1,5 @@
1
+ import type { GetPublicKey, Params, BundledParams, Response } from '../params';
2
+ import type { SolanaPublicKey } from './solana';
3
+ export declare function solanaGetPublicKey(params: Params<GetPublicKey>): Response<SolanaPublicKey>;
4
+ export declare function solanaGetPublicKey(params: BundledParams<GetPublicKey>): Response<SolanaPublicKey[]>;
5
+ //# sourceMappingURL=solanaGetPublicKey.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=solanaGetPublicKey.js.map
@@ -0,0 +1,4 @@
1
+ import type { Params, Response } from '../params';
2
+ import type { SolanaSignTransaction, SolanaSignedTransaction } from './solana';
3
+ export declare function solanaSignTransaction(params: Params<SolanaSignTransaction>): Response<SolanaSignedTransaction>;
4
+ //# sourceMappingURL=solanaSignTransaction.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=solanaSignTransaction.js.map
@@ -1,20 +1,11 @@
1
+ import { Network } from '@trezor/utxo-lib';
1
2
  import { FeeLevel } from './fees';
3
+ export type { Network } from '@trezor/utxo-lib';
2
4
  export interface CoinSupport {
3
5
  connect: boolean;
4
- trezor1: string;
5
- trezor2: string;
6
- }
7
- export interface Network {
8
- messagePrefix: string;
9
- bech32: string;
10
- bip32: {
11
- public: number;
12
- private: number;
13
- };
14
- pubKeyHash: number;
15
- scriptHash: number;
16
- wif: number;
17
- forkId?: number;
6
+ T1B1: string;
7
+ T2T1: string;
8
+ T2B1: string;
18
9
  }
19
10
  export interface BlockchainLink {
20
11
  type: string;
@@ -63,5 +54,4 @@ export interface MiscNetworkInfo extends Common {
63
54
  network?: typeof undefined;
64
55
  }
65
56
  export type CoinInfo = BitcoinNetworkInfo | EthereumNetworkInfo | MiscNetworkInfo;
66
- export {};
67
57
  //# sourceMappingURL=coinInfo.d.ts.map
@@ -5,7 +5,7 @@ var FirmwareType;
5
5
  (function (FirmwareType) {
6
6
  FirmwareType["BitcoinOnly"] = "bitcoin-only";
7
7
  FirmwareType["Regular"] = "regular";
8
- })(FirmwareType = exports.FirmwareType || (exports.FirmwareType = {}));
8
+ })(FirmwareType || (exports.FirmwareType = FirmwareType = {}));
9
9
  var messages_1 = require("@trezor/protobuf/lib/messages");
10
10
  Object.defineProperty(exports, "DeviceModelInternal", { enumerable: true, get: function () { return messages_1.DeviceModelInternal; } });
11
11
  //# sourceMappingURL=device.js.map
@@ -1,9 +1,13 @@
1
1
  export interface FirmwareRange {
2
- '1': {
2
+ T1B1: {
3
3
  min: string;
4
4
  max: string;
5
5
  };
6
- '2': {
6
+ T2T1: {
7
+ min: string;
8
+ max: string;
9
+ };
10
+ T2B1: {
7
11
  min: string;
8
12
  max: string;
9
13
  };
@@ -12,9 +12,12 @@ export * from './api/bitcoin';
12
12
  export * from './api/eos';
13
13
  export * from './api/ripple';
14
14
  export * from './api/ethereum';
15
+ export * from './api/solana';
15
16
  export * from './api/stellar';
16
17
  export * from './api/tezos';
17
- export type { ComposeOutput, PrecomposedTransaction } from './api/composeTransaction';
18
+ export type { ComposeOutput, PrecomposeResultError, PrecomposeResultNonFinal, PrecomposeResultFinal, PrecomposedResult, } from './api/composeTransaction';
19
+ export type { PrecomposedTransactionCardano, PrecomposedTransactionErrorCardano, PrecomposedTransactionFinalCardano, PrecomposedTransactionNonFinalCardano, } from './api/cardanoComposeTransaction';
18
20
  export type { RecoveryDevice } from './api/recoveryDevice';
21
+ export type { AuthenticateDeviceResult } from './api/authenticateDevice';
19
22
  export type { TokenInfo, TokenTransfer, InternalTransfer, FiatRates, Target as TransactionTarget, AccountBalanceHistory as BlockchainAccountBalanceHistory, } from '@trezor/blockchain-link';
20
23
  //# sourceMappingURL=index.d.ts.map
@@ -15,6 +15,7 @@ tslib_1.__exportStar(require("./api/bitcoin"), exports);
15
15
  tslib_1.__exportStar(require("./api/eos"), exports);
16
16
  tslib_1.__exportStar(require("./api/ripple"), exports);
17
17
  tslib_1.__exportStar(require("./api/ethereum"), exports);
18
+ tslib_1.__exportStar(require("./api/solana"), exports);
18
19
  tslib_1.__exportStar(require("./api/stellar"), exports);
19
20
  tslib_1.__exportStar(require("./api/tezos"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -31,5 +31,6 @@ export interface ConnectSettings {
31
31
  env: 'node' | 'web' | 'webextension' | 'electron' | 'react-native';
32
32
  timestamp: number;
33
33
  proxy?: Proxy;
34
+ sharedLogger?: boolean;
34
35
  }
35
36
  //# sourceMappingURL=settings.d.ts.map
@@ -10,10 +10,12 @@ const getAssetByUrl = (url) => {
10
10
  return require('@trezor/connect-common/files/coins-eth.json');
11
11
  case './data/bridge/releases.json':
12
12
  return require('@trezor/connect-common/files/bridge/releases.json');
13
- case './data/firmware/1/releases.json':
14
- return require('@trezor/connect-common/files/firmware/1/releases.json');
15
- case './data/firmware/2/releases.json':
16
- return require('@trezor/connect-common/files/firmware/2/releases.json');
13
+ case './data/firmware/t1b1/releases.json':
14
+ return require('@trezor/connect-common/files/firmware/t1b1/releases.json');
15
+ case './data/firmware/t2t1/releases.json':
16
+ return require('@trezor/connect-common/files/firmware/t2t1/releases.json');
17
+ case './data/firmware/t2b1/releases.json':
18
+ return require('@trezor/connect-common/files/firmware/t2b1/releases.json');
17
19
  case './data/messages/messages.json':
18
20
  return require('@trezor/protobuf/messages.json');
19
21
  default:
@@ -1,24 +1,29 @@
1
- type LogMessage = {
1
+ export type LogMessage = {
2
2
  level: string;
3
3
  prefix: string;
4
4
  message: any[];
5
5
  timestamp: number;
6
6
  };
7
- declare class Log {
7
+ export type LogWriter = {
8
+ add: (message: LogMessage) => void;
9
+ };
10
+ export declare class Log {
8
11
  prefix: string;
9
12
  enabled: boolean;
10
13
  css: string;
11
14
  messages: LogMessage[];
12
- constructor(prefix: string, enabled: boolean);
15
+ logWriter: LogWriter | undefined;
16
+ constructor(prefix: string, enabled: boolean, logWriter?: LogWriter);
13
17
  addMessage(level: string, prefix: string, ...args: any[]): void;
18
+ setWriter(logWriter: any): void;
14
19
  log(...args: any[]): void;
15
20
  error(...args: any[]): void;
16
21
  warn(...args: any[]): void;
17
22
  debug(...args: any[]): void;
18
23
  }
19
- export declare const initLog: (prefix: string, enabled?: boolean) => Log;
24
+ export declare const initLog: (prefix: string, enabled?: boolean, logWriter?: LogWriter) => Log;
25
+ export declare const setLogWriter: (logWriterFactory: () => LogWriter | undefined) => void;
20
26
  export declare const enableLog: (enabled?: boolean) => void;
21
27
  export declare const enableLogByPrefix: (prefix: string, enabled: boolean) => void;
22
28
  export declare const getLog: () => LogMessage[];
23
- export {};
24
29
  //# sourceMappingURL=debug.d.ts.map