@trezor/connect 9.1.5 → 9.1.7

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 (186) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +1 -1
  3. package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +4 -4
  4. package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +10 -7
  5. package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
  6. package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
  7. package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +3 -2
  8. package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +8 -6
  9. package/lib/api/binance/api/index.d.ts +4 -0
  10. package/lib/api/binance/api/index.js +13 -0
  11. package/lib/api/binance/binanceSignTx.d.ts +1 -1
  12. package/lib/api/binance/binanceSignTx.js +2 -1
  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} +4 -4
  23. package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +11 -8
  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} +19 -8
  29. package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +33 -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/common/paramsValidator.js +5 -3
  35. package/lib/api/composeTransaction.d.ts +5 -5
  36. package/lib/api/composeTransaction.js +14 -19
  37. package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
  38. package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +7 -5
  39. package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +3 -2
  40. package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +8 -6
  41. package/lib/api/eos/api/index.d.ts +3 -0
  42. package/lib/api/eos/api/index.js +11 -0
  43. package/lib/api/eos/eosSignTx.d.ts +1 -1
  44. package/lib/api/eos/eosSignTx.js +2 -1
  45. package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +5 -5
  46. package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +13 -10
  47. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
  48. package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
  49. package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
  50. package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
  51. package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +12 -9
  52. package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +38 -43
  53. package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
  54. package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
  55. package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
  56. package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
  57. package/lib/api/ethereum/api/index.d.ts +7 -0
  58. package/lib/api/ethereum/api/index.js +19 -0
  59. package/lib/api/ethereum/ethereumSignTx.d.ts +4 -2
  60. package/lib/api/ethereum/ethereumSignTx.js +19 -3
  61. package/lib/api/firmware/verifyAuthenticityProof.js +1 -1
  62. package/lib/api/firmware/x509certificate.d.ts +1 -0
  63. package/lib/api/firmware/x509certificate.js +34 -2
  64. package/lib/api/getAccountDescriptor.d.ts +20 -0
  65. package/lib/api/getAccountDescriptor.js +162 -0
  66. package/lib/api/getAccountInfo.d.ts +2 -0
  67. package/lib/api/getAddress.d.ts +1 -1
  68. package/lib/api/getAddress.js +4 -1
  69. package/lib/api/index.d.ts +1 -24
  70. package/lib/api/index.js +3 -50
  71. package/lib/api/nem/api/index.d.ts +3 -0
  72. package/lib/api/nem/api/index.js +11 -0
  73. package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +4 -4
  74. package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +10 -7
  75. package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
  76. package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +7 -6
  77. package/lib/api/nem/nemSignTx.d.ts +1 -1
  78. package/lib/api/nem/nemSignTx.js +2 -1
  79. package/lib/api/ripple/api/index.d.ts +3 -0
  80. package/lib/api/ripple/api/index.js +11 -0
  81. package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +4 -4
  82. package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +10 -7
  83. package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
  84. package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +7 -5
  85. package/lib/api/signTransaction.js +2 -0
  86. package/lib/api/solana/additionalInfo.d.ts +10 -0
  87. package/lib/api/solana/additionalInfo.js +33 -0
  88. package/lib/api/solana/api/index.d.ts +4 -0
  89. package/lib/api/solana/api/index.js +13 -0
  90. package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
  91. package/lib/api/solana/api/solanaGetAddress.js +133 -0
  92. package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
  93. package/lib/api/solana/api/solanaGetPublicKey.js +83 -0
  94. package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
  95. package/lib/api/solana/api/solanaSignTransaction.js +34 -0
  96. package/lib/api/stellar/api/index.d.ts +3 -0
  97. package/lib/api/stellar/api/index.js +11 -0
  98. package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +4 -4
  99. package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +10 -7
  100. package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
  101. package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
  102. package/lib/api/tezos/api/index.d.ts +4 -0
  103. package/lib/api/tezos/api/index.js +13 -0
  104. package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +4 -4
  105. package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +10 -7
  106. package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
  107. package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +7 -5
  108. package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
  109. package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
  110. package/lib/api/tezos/tezosSignTx.d.ts +1 -1
  111. package/lib/api/tezos/tezosSignTx.js +2 -1
  112. package/lib/backend/Blockchain.js +3 -0
  113. package/lib/constants/cardano.js +2 -2
  114. package/lib/constants/nem.js +3 -3
  115. package/lib/constants/network.d.ts +3 -0
  116. package/lib/constants/network.js +13 -1
  117. package/lib/core/AbstractMethod.js +3 -0
  118. package/lib/core/index.d.ts +3 -1
  119. package/lib/core/index.js +17 -4
  120. package/lib/core/method.d.ts +2 -2
  121. package/lib/core/method.js +8 -2
  122. package/lib/core/method.native.d.ts +5 -0
  123. package/lib/core/method.native.js +34 -0
  124. package/lib/data/DataManager.d.ts +22 -0
  125. package/lib/data/config.d.ts +22 -0
  126. package/lib/data/config.js +12 -1
  127. package/lib/data/connectSettings.js +4 -0
  128. package/lib/data/defaultFeeLevels.js +9 -0
  129. package/lib/data/deviceAuthenticityConfig.js +4 -1
  130. package/lib/data/firmwareInfo.d.ts +1 -1
  131. package/lib/data/firmwareInfo.js +4 -1
  132. package/lib/data/version.d.ts +1 -1
  133. package/lib/data/version.js +1 -1
  134. package/lib/device/Device.d.ts +3 -1
  135. package/lib/device/Device.js +23 -4
  136. package/lib/device/DeviceCommands.d.ts +2 -2
  137. package/lib/device/DeviceCommands.js +19 -3
  138. package/lib/device/DeviceList.js +4 -1
  139. package/lib/events/popup.d.ts +19 -3
  140. package/lib/events/popup.js +3 -0
  141. package/lib/events/ui-request.d.ts +1 -1
  142. package/lib/factory.js +5 -0
  143. package/lib/types/api/binance/index.d.ts +1 -0
  144. package/lib/types/api/bitcoin/index.d.ts +2 -0
  145. package/lib/types/api/cardano/index.d.ts +2 -0
  146. package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
  147. package/lib/types/api/cardanoComposeTransaction.js +3 -0
  148. package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
  149. package/lib/types/api/composeTransaction.d.ts +28 -54
  150. package/lib/types/api/eos/index.d.ts +1 -0
  151. package/lib/types/api/ethereum/index.d.ts +2 -0
  152. package/lib/types/api/getAccountDescriptor.d.ts +16 -0
  153. package/lib/types/api/getAccountDescriptor.js +3 -0
  154. package/lib/types/api/index.d.ts +10 -0
  155. package/lib/types/api/nem/index.d.ts +1 -0
  156. package/lib/types/api/ripple/index.d.ts +1 -0
  157. package/lib/types/api/solana/index.d.ts +22 -0
  158. package/lib/types/api/solana/index.js +3 -0
  159. package/lib/types/api/solanaGetAddress.d.ts +4 -0
  160. package/lib/types/api/solanaGetAddress.js +3 -0
  161. package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
  162. package/lib/types/api/solanaGetPublicKey.js +3 -0
  163. package/lib/types/api/solanaSignTransaction.d.ts +4 -0
  164. package/lib/types/api/solanaSignTransaction.js +3 -0
  165. package/lib/types/api/tezos/index.d.ts +1 -0
  166. package/lib/types/coinInfo.d.ts +5 -16
  167. package/lib/types/device.d.ts +1 -1
  168. package/lib/types/device.js +1 -1
  169. package/lib/types/index.d.ts +3 -1
  170. package/lib/types/index.js +1 -0
  171. package/lib/types/params.d.ts +3 -0
  172. package/lib/types/settings.d.ts +1 -0
  173. package/lib/utils/debug.d.ts +6 -3
  174. package/lib/utils/debug.js +13 -7
  175. package/lib/utils/deviceFeaturesUtils.js +8 -5
  176. package/lib/utils/formatUtils.d.ts +2 -0
  177. package/lib/utils/formatUtils.js +19 -1
  178. package/lib/workers/workers-browser.d.ts +2 -1
  179. package/lib/workers/workers-browser.js +3 -1
  180. package/lib/workers/workers-react-native.d.ts +2 -1
  181. package/lib/workers/workers-react-native.js +3 -1
  182. package/lib/workers/workers.d.ts +8 -5
  183. package/lib/workers/workers.js +34 -10
  184. package/package.json +22 -19
  185. package/lib/api/eosGetPublicKey.d.ts +0 -11
  186. package/lib/api/ethereumGetPublicKey.d.ts +0 -16
@@ -157,7 +157,7 @@ class DeviceCommands {
157
157
  }
158
158
  return response;
159
159
  }
160
- async getAddress({ address_n, show_display, multisig, script_type }, coinInfo) {
160
+ async getAddress({ address_n, show_display, multisig, script_type, chunkify }, coinInfo) {
161
161
  if (!script_type) {
162
162
  script_type = (0, pathUtils_1.getScriptType)(address_n);
163
163
  if (script_type === 'SPENDMULTISIG' && !multisig) {
@@ -177,6 +177,7 @@ class DeviceCommands {
177
177
  show_display,
178
178
  multisig,
179
179
  script_type: script_type || 'SPENDADDRESS',
180
+ chunkify,
180
181
  });
181
182
  return {
182
183
  path: address_n,
@@ -184,11 +185,12 @@ class DeviceCommands {
184
185
  address: response.message.address,
185
186
  };
186
187
  }
187
- async ethereumGetAddress({ address_n, show_display, encoded_network, }) {
188
+ async ethereumGetAddress({ address_n, show_display, encoded_network, chunkify, }) {
188
189
  const response = await this.typedCall('EthereumGetAddress', 'EthereumAddress', {
189
190
  address_n,
190
191
  show_display,
191
192
  encoded_network,
193
+ chunkify,
192
194
  });
193
195
  return {
194
196
  path: address_n,
@@ -245,6 +247,7 @@ class DeviceCommands {
245
247
  session: this.sessionId,
246
248
  name: type,
247
249
  data: msg,
250
+ protocol: this.device.protocol,
248
251
  });
249
252
  const res = await this.callPromise.promise;
250
253
  this.callPromise = undefined;
@@ -264,7 +267,10 @@ class DeviceCommands {
264
267
  assertType(response, resType);
265
268
  }
266
269
  catch (error) {
267
- await this.transport.receive({ session: this.sessionId });
270
+ await this.transport.receive({
271
+ session: this.sessionId,
272
+ protocol: this.device.protocol,
273
+ });
268
274
  throw error;
269
275
  }
270
276
  return response;
@@ -474,6 +480,15 @@ class DeviceCommands {
474
480
  address_n,
475
481
  };
476
482
  }
483
+ if (coinInfo.shortcut === 'SOL' || coinInfo.shortcut === 'DSOL') {
484
+ const { message } = await this.typedCall('SolanaGetAddress', 'SolanaAddress', {
485
+ address_n,
486
+ });
487
+ return {
488
+ descriptor: message.address,
489
+ address_n,
490
+ };
491
+ }
477
492
  throw constants_1.ERRORS.TypedError('Runtime', 'DeviceCommands.getAccountDescriptor: unsupported coinInfo.type');
478
493
  }
479
494
  async cancel() {
@@ -502,6 +517,7 @@ class DeviceCommands {
502
517
  }
503
518
  else {
504
519
  await this.transport.send({
520
+ protocol: this.device.protocol,
505
521
  session: this.sessionId,
506
522
  name: 'Cancel',
507
523
  data: {},
@@ -60,7 +60,10 @@ class DeviceList extends typedEventEmitter_1.TypedEmitter {
60
60
  }
61
61
  }
62
62
  else if (transportType instanceof transport_1.Transport) {
63
- this.transports.unshift(transportType);
63
+ if (!transportType.getMessage()) {
64
+ transportType.updateMessages(this.messages);
65
+ }
66
+ this.transports.push(transportType);
64
67
  }
65
68
  else {
66
69
  throw constants_1.ERRORS.TypedError('Runtime', 'DeviceList.init: transports[] of unexpected type');
@@ -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,
@@ -132,7 +132,7 @@ export interface UiRequestPermission {
132
132
  export interface UiRequestConfirmation {
133
133
  type: typeof UI_REQUEST.REQUEST_CONFIRMATION;
134
134
  payload: {
135
- view: string;
135
+ view: 'no-backup' | 'export-xpub' | 'export-address' | 'export-account-info' | 'device-management';
136
136
  label?: string;
137
137
  customConfirmButton?: {
138
138
  className: string;
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',
@@ -26,5 +26,6 @@ export interface BinancePreparedTransaction extends BinanceSDKTransaction {
26
26
  export interface BinanceSignTransaction {
27
27
  path: DerivationPath;
28
28
  transaction: BinanceSDKTransaction;
29
+ chunkify?: boolean;
29
30
  }
30
31
  //# sourceMappingURL=index.d.ts.map
@@ -49,6 +49,7 @@ export interface TransactionOptions {
49
49
  amount_unit?: PROTO.AmountUnit;
50
50
  serialize?: boolean;
51
51
  coinjoin_request?: PROTO.CoinJoinRequest;
52
+ chunkify?: boolean;
52
53
  }
53
54
  export interface SignTransaction {
54
55
  inputs: ProtoWithDerivationPath<PROTO.TxInputType>[];
@@ -74,6 +75,7 @@ export interface SignTransaction {
74
75
  unlockPath?: PROTO.UnlockPath;
75
76
  serialize?: boolean;
76
77
  coinjoinRequest?: PROTO.CoinJoinRequest;
78
+ chunkify?: boolean;
77
79
  }
78
80
  export type SignedTransaction = {
79
81
  signatures: string[];
@@ -21,6 +21,7 @@ export interface CardanoGetAddress {
21
21
  address?: string;
22
22
  showOnTrezor?: boolean;
23
23
  derivationType?: PROTO.CardanoDerivationType;
24
+ chunkify?: boolean;
24
25
  }
25
26
  export interface CardanoAddress {
26
27
  addressParameters: CardanoAddressParameters;
@@ -177,6 +178,7 @@ export interface CardanoSignTransaction {
177
178
  signingMode: PROTO.CardanoTxSigningMode;
178
179
  derivationType?: PROTO.CardanoDerivationType;
179
180
  includeNetworkId?: boolean;
181
+ chunkify?: boolean;
180
182
  }
181
183
  export interface CardanoSignedTxWitness {
182
184
  type: PROTO.CardanoTxWitnessType;
@@ -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
@@ -112,5 +112,6 @@ export interface EosSDKTransaction {
112
112
  export interface EosSignTransaction {
113
113
  path: DerivationPath;
114
114
  transaction: EosSDKTransaction;
115
+ chunkify?: boolean;
115
116
  }
116
117
  //# sourceMappingURL=index.d.ts.map
@@ -35,11 +35,13 @@ export interface EthereumTransactionEIP1559 {
35
35
  export interface EthereumSignTransaction {
36
36
  path: DerivationPath;
37
37
  transaction: EthereumTransaction | EthereumTransactionEIP1559;
38
+ chunkify?: boolean;
38
39
  }
39
40
  export interface EthereumSignedTx {
40
41
  v: string;
41
42
  r: string;
42
43
  s: string;
44
+ serializedTx: string;
43
45
  }
44
46
  interface EthereumSignTypedDataTypeProperty {
45
47
  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
@@ -22,6 +22,7 @@ import { cardanoGetAddress } from './cardanoGetAddress';
22
22
  import { cardanoGetNativeScriptHash } from './cardanoGetNativeScriptHash';
23
23
  import { cardanoGetPublicKey } from './cardanoGetPublicKey';
24
24
  import { cardanoSignTransaction } from './cardanoSignTransaction';
25
+ import { cardanoComposeTransaction } from './cardanoComposeTransaction';
25
26
  import { changePin } from './changePin';
26
27
  import { cipherKeyValue } from './cipherKeyValue';
27
28
  import { composeTransaction } from './composeTransaction';
@@ -36,6 +37,7 @@ import { ethereumSignTransaction } from './ethereumSignTransaction';
36
37
  import { ethereumSignTypedData } from './ethereumSignTypedData';
37
38
  import { ethereumVerifyMessage } from './ethereumVerifyMessage';
38
39
  import { firmwareUpdate } from './firmwareUpdate';
40
+ import { getAccountDescriptor } from './getAccountDescriptor';
39
41
  import { getAccountInfo } from './getAccountInfo';
40
42
  import { getAddress } from './getAddress';
41
43
  import { getCoinInfo } from './getCoinInfo';
@@ -66,6 +68,9 @@ import { setBusy } from './setBusy';
66
68
  import { setProxy } from './setProxy';
67
69
  import { signMessage } from './signMessage';
68
70
  import { signTransaction } from './signTransaction';
71
+ import { solanaGetPublicKey } from './solanaGetPublicKey';
72
+ import { solanaGetAddress } from './solanaGetAddress';
73
+ import { solanaSignTransaction } from './solanaSignTransaction';
69
74
  import { stellarGetAddress } from './stellarGetAddress';
70
75
  import { stellarSignTransaction } from './stellarSignTransaction';
71
76
  import { tezosGetAddress } from './tezosGetAddress';
@@ -105,6 +110,7 @@ export interface TrezorConnect {
105
110
  cardanoGetNativeScriptHash: typeof cardanoGetNativeScriptHash;
106
111
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
107
112
  cardanoSignTransaction: typeof cardanoSignTransaction;
113
+ cardanoComposeTransaction: typeof cardanoComposeTransaction;
108
114
  changePin: typeof changePin;
109
115
  cipherKeyValue: typeof cipherKeyValue;
110
116
  composeTransaction: typeof composeTransaction;
@@ -120,6 +126,7 @@ export interface TrezorConnect {
120
126
  ethereumSignTypedData: typeof ethereumSignTypedData;
121
127
  ethereumVerifyMessage: typeof ethereumVerifyMessage;
122
128
  firmwareUpdate: typeof firmwareUpdate;
129
+ getAccountDescriptor: typeof getAccountDescriptor;
123
130
  getAccountInfo: typeof getAccountInfo;
124
131
  getAddress: typeof getAddress;
125
132
  getCoinInfo: typeof getCoinInfo;
@@ -149,6 +156,9 @@ export interface TrezorConnect {
149
156
  setProxy: typeof setProxy;
150
157
  signMessage: typeof signMessage;
151
158
  signTransaction: typeof signTransaction;
159
+ solanaGetPublicKey: typeof solanaGetPublicKey;
160
+ solanaGetAddress: typeof solanaGetAddress;
161
+ solanaSignTransaction: typeof solanaSignTransaction;
152
162
  stellarGetAddress: typeof stellarGetAddress;
153
163
  stellarSignTransaction: typeof stellarSignTransaction;
154
164
  tezosGetAddress: typeof tezosGetAddress;
@@ -87,5 +87,6 @@ export type NEMTransaction = NEMRegularTransaction | NEMMultisigTransaction;
87
87
  export interface NEMSignTransaction {
88
88
  path: DerivationPath;
89
89
  transaction: NEMTransaction;
90
+ chunkify?: boolean;
90
91
  }
91
92
  //# sourceMappingURL=index.d.ts.map
@@ -14,6 +14,7 @@ export interface RippleTransaction {
14
14
  export interface RippleSignTransaction {
15
15
  path: DerivationPath;
16
16
  transaction: RippleTransaction;
17
+ chunkify?: boolean;
17
18
  }
18
19
  export interface RippleSignedTx {
19
20
  serializedTx: string;
@@ -0,0 +1,22 @@
1
+ import type { PublicKey } from '../../params';
2
+ export interface SolanaPublicKey extends PublicKey {
3
+ publicKey: string;
4
+ }
5
+ export interface SolanaTxTokenAccountInfo {
6
+ baseAddress: string;
7
+ tokenProgram: string;
8
+ tokenMint: string;
9
+ tokenAccount: string;
10
+ }
11
+ export interface SolanaTxAdditionalInfo {
12
+ tokenAccountsInfos?: SolanaTxTokenAccountInfo[];
13
+ }
14
+ export interface SolanaSignTransaction {
15
+ path: string | number[];
16
+ serializedTx: string;
17
+ additionalInfo?: SolanaTxAdditionalInfo;
18
+ }
19
+ export interface SolanaSignedTransaction {
20
+ signature: string;
21
+ }
22
+ //# 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
@@ -55,5 +55,6 @@ export interface TezosSignTransaction {
55
55
  path: DerivationPath;
56
56
  branch: string;
57
57
  operation: TezosOperation;
58
+ chunkify?: boolean;
58
59
  }
59
60
  //# sourceMappingURL=index.d.ts.map
@@ -1,21 +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
- T1B1: string;
5
- T2T1: string;
6
- T2B1: string;
7
- }
8
- export interface Network {
9
- messagePrefix: string;
10
- bech32: string;
11
- bip32: {
12
- public: number;
13
- private: number;
14
- };
15
- pubKeyHash: number;
16
- scriptHash: number;
17
- wif: number;
18
- forkId?: number;
6
+ T1B1: string | false;
7
+ T2T1: string | false;
8
+ T2B1: string | false;
19
9
  }
20
10
  export interface BlockchainLink {
21
11
  type: string;
@@ -64,5 +54,4 @@ export interface MiscNetworkInfo extends Common {
64
54
  network?: typeof undefined;
65
55
  }
66
56
  export type CoinInfo = BitcoinNetworkInfo | EthereumNetworkInfo | MiscNetworkInfo;
67
- export {};
68
57
  //# sourceMappingURL=coinInfo.d.ts.map
@@ -2,7 +2,7 @@ import type { PROTO } from '../constants';
2
2
  import type { ReleaseInfo } from './firmware';
3
3
  export type DeviceStatus = 'available' | 'occupied' | 'used';
4
4
  export type DeviceMode = 'normal' | 'bootloader' | 'initialize' | 'seedless';
5
- export type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
5
+ export type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'custom' | 'none';
6
6
  export type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
7
7
  export declare enum FirmwareType {
8
8
  BitcoinOnly = "bitcoin-only",
@@ -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