@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
@@ -12,9 +12,11 @@ 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';
19
21
  export type { AuthenticateDeviceResult } from './api/authenticateDevice';
20
22
  export type { TokenInfo, TokenTransfer, InternalTransfer, FiatRates, Target as TransactionTarget, AccountBalanceHistory as BlockchainAccountBalanceHistory, } from '@trezor/blockchain-link';
@@ -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
@@ -11,6 +11,7 @@ export interface CommonParams {
11
11
  override?: boolean;
12
12
  skipFinalReload?: boolean;
13
13
  useCardanoDerivation?: boolean;
14
+ chunkify?: boolean;
14
15
  }
15
16
  export type Params<T> = CommonParams & T & {
16
17
  bundle?: undefined;
@@ -49,6 +50,7 @@ export interface GetAddress {
49
50
  path: DerivationPath;
50
51
  address?: string;
51
52
  showOnTrezor?: boolean;
53
+ chunkify?: boolean;
52
54
  }
53
55
  export interface Address {
54
56
  address: string;
@@ -59,6 +61,7 @@ export interface GetPublicKey {
59
61
  path: DerivationPath;
60
62
  showOnTrezor?: boolean;
61
63
  suppressBackupWarning?: boolean;
64
+ chunkify?: boolean;
62
65
  }
63
66
  export interface PublicKey {
64
67
  publicKey: string;
@@ -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
@@ -7,14 +7,18 @@ export type LogMessage = {
7
7
  export type LogWriter = {
8
8
  add: (message: LogMessage) => void;
9
9
  };
10
- declare class Log {
10
+ export declare class Log {
11
11
  prefix: string;
12
12
  enabled: boolean;
13
13
  css: string;
14
14
  messages: LogMessage[];
15
15
  logWriter: LogWriter | undefined;
16
16
  constructor(prefix: string, enabled: boolean, logWriter?: LogWriter);
17
- addMessage(level: string, prefix: string, ...args: any[]): void;
17
+ addMessage({ level, prefix, timestamp }: {
18
+ level: string;
19
+ prefix: string;
20
+ timestamp?: number;
21
+ }, ...args: any[]): void;
18
22
  setWriter(logWriter: any): void;
19
23
  log(...args: any[]): void;
20
24
  error(...args: any[]): void;
@@ -26,5 +30,4 @@ export declare const setLogWriter: (logWriterFactory: () => LogWriter | undefine
26
30
  export declare const enableLog: (enabled?: boolean) => void;
27
31
  export declare const enableLogByPrefix: (prefix: string, enabled: boolean) => void;
28
32
  export declare const getLog: () => LogMessage[];
29
- export {};
30
33
  //# sourceMappingURL=debug.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLog = exports.enableLogByPrefix = exports.enableLog = exports.setLogWriter = exports.initLog = void 0;
3
+ exports.getLog = exports.enableLogByPrefix = exports.enableLog = exports.setLogWriter = exports.initLog = exports.Log = void 0;
4
4
  const green = '#bada55';
5
5
  const blue = '#20abd8';
6
6
  const orange = '#f4a744';
@@ -8,6 +8,7 @@ const yellow = '#fbd948';
8
8
  const colors = {
9
9
  '@trezor/connect': `color: ${blue}; background: #000;`,
10
10
  '@trezor/connect-web': `color: ${blue}; background: #000;`,
11
+ '@trezor/connect-webextension': `color: ${blue}; background: #000;`,
11
12
  IFrame: `color: ${orange}; background: #000;`,
12
13
  Core: `color: ${orange}; background: #000;`,
13
14
  DeviceList: `color: ${green}; background: #000;`,
@@ -28,13 +29,13 @@ class Log {
28
29
  this.logWriter = logWriter;
29
30
  }
30
31
  }
31
- addMessage(level, prefix, ...args) {
32
+ addMessage({ level, prefix, timestamp }, ...args) {
32
33
  const message = {
33
34
  level,
34
35
  prefix,
35
36
  css: this.css,
36
37
  message: args,
37
- timestamp: Date.now(),
38
+ timestamp: timestamp || Date.now(),
38
39
  };
39
40
  this.messages.push(message);
40
41
  if (this.logWriter) {
@@ -53,25 +54,25 @@ class Log {
53
54
  this.logWriter = logWriter;
54
55
  }
55
56
  log(...args) {
56
- this.addMessage('log', this.prefix, ...args);
57
+ this.addMessage({ level: 'log', prefix: this.prefix }, ...args);
57
58
  if (this.enabled) {
58
59
  console.log(`%c${this.prefix}`, this.css, ...args);
59
60
  }
60
61
  }
61
62
  error(...args) {
62
- this.addMessage('error', this.prefix, ...args);
63
+ this.addMessage({ level: 'error', prefix: this.prefix }, ...args);
63
64
  if (this.enabled) {
64
65
  console.error(`%c${this.prefix}`, this.css, ...args);
65
66
  }
66
67
  }
67
68
  warn(...args) {
68
- this.addMessage('warn', this.prefix, ...args);
69
+ this.addMessage({ level: 'warn', prefix: this.prefix }, ...args);
69
70
  if (this.enabled) {
70
71
  console.warn(`%c${this.prefix}`, this.css, ...args);
71
72
  }
72
73
  }
73
74
  debug(...args) {
74
- this.addMessage('debug', this.prefix, ...args);
75
+ this.addMessage({ level: 'debug', prefix: this.prefix }, ...args);
75
76
  if (this.enabled) {
76
77
  if (this.css) {
77
78
  console.log(`%c${this.prefix}`, this.css, ...args);
@@ -82,6 +83,7 @@ class Log {
82
83
  }
83
84
  }
84
85
  }
86
+ exports.Log = Log;
85
87
  const _logs = {};
86
88
  let writer;
87
89
  const initLog = (prefix, enabled, logWriter) => {
@@ -96,6 +98,10 @@ const setLogWriter = (logWriterFactory) => {
96
98
  writer = logWriterFactory();
97
99
  if (writer) {
98
100
  _logs[key].setWriter(writer);
101
+ const { messages } = _logs[key];
102
+ messages.forEach(message => {
103
+ writer === null || writer === void 0 ? void 0 : writer.add(message);
104
+ });
99
105
  }
100
106
  });
101
107
  };
@@ -42,10 +42,10 @@ const getUnavailableCapabilities = (features, coins) => {
42
42
  const list = {};
43
43
  if (!capabilities)
44
44
  return list;
45
- const fw = [features.major_version, features.minor_version, features.patch_version];
45
+ const fw = [features.major_version, features.minor_version, features.patch_version].join('.');
46
46
  const key = features.internal_model;
47
47
  const supported = coins.filter(info => {
48
- if (!info.support || typeof info.support[key] !== 'string') {
48
+ if (!info.support || info.support[key] === false) {
49
49
  list[info.shortcut.toLowerCase()] = 'no-support';
50
50
  return false;
51
51
  }
@@ -70,6 +70,8 @@ const getUnavailableCapabilities = (features, coins) => {
70
70
  return !capabilities.includes('Capability_Cardano');
71
71
  if (info.shortcut === 'XRP' || info.shortcut === 'tXRP')
72
72
  return !capabilities.includes('Capability_Ripple');
73
+ if (info.shortcut === 'SOL' || info.shortcut === 'DSOL')
74
+ return !capabilities.includes('Capability_Solana');
73
75
  return !capabilities.includes(`Capability_${info.name}`);
74
76
  });
75
77
  unavailable.forEach(info => {
@@ -78,7 +80,8 @@ const getUnavailableCapabilities = (features, coins) => {
78
80
  supported
79
81
  .filter(info => !unavailable.includes(info))
80
82
  .forEach(info => {
81
- if (utils_1.versionUtils.isNewer(info.support[key], fw.join('.'))) {
83
+ const supportVersion = info.support[key];
84
+ if (typeof supportVersion === 'string' && utils_1.versionUtils.isNewer(supportVersion, fw)) {
82
85
  list[info.shortcut.toLowerCase()] = 'update-required';
83
86
  unavailable.push(info);
84
87
  }
@@ -88,13 +91,13 @@ const getUnavailableCapabilities = (features, coins) => {
88
91
  return;
89
92
  const min = s.min ? s.min[key] : null;
90
93
  const max = s.max ? s.max[key] : null;
91
- if (min && (min === '0' || utils_1.versionUtils.isNewer(min, fw.join('.')))) {
94
+ if (min && (min === '0' || utils_1.versionUtils.isNewer(min, fw))) {
92
95
  const value = min === '0' ? 'no-support' : 'update-required';
93
96
  s.capabilities.forEach(m => {
94
97
  list[m] = value;
95
98
  });
96
99
  }
97
- if (max && !utils_1.versionUtils.isNewerOrEqual(max, fw.join('.'))) {
100
+ if (max && !utils_1.versionUtils.isNewerOrEqual(max, fw)) {
98
101
  s.capabilities.forEach(m => {
99
102
  list[m] = 'trezor-connect-outdated';
100
103
  });
@@ -4,5 +4,7 @@ export declare const formatTime: (n: number) => string;
4
4
  export declare const btckb2satoshib: (n: string) => string;
5
5
  export declare const hasHexPrefix: (str: string) => boolean;
6
6
  export declare const stripHexPrefix: (str: string) => string;
7
+ export declare const addHexPrefix: (str: string) => string;
7
8
  export declare const messageToHex: (message: string) => string;
9
+ export declare const deepTransform: (transform: (str: string) => string) => <T>(value: T) => T;
8
10
  //# sourceMappingURL=formatUtils.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.messageToHex = exports.stripHexPrefix = exports.hasHexPrefix = exports.btckb2satoshib = exports.formatTime = exports.formatAmount = void 0;
3
+ exports.deepTransform = exports.messageToHex = exports.addHexPrefix = exports.stripHexPrefix = exports.hasHexPrefix = exports.btckb2satoshib = exports.formatTime = exports.formatAmount = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
6
6
  const formatAmount = (n, coinInfo) => `${new bignumber_js_1.default(n).div(10 ** coinInfo.decimals).toString(10)} ${coinInfo.shortcut}`;
@@ -30,6 +30,8 @@ const hasHexPrefix = (str) => str.slice(0, 2).toLowerCase() === '0x';
30
30
  exports.hasHexPrefix = hasHexPrefix;
31
31
  const stripHexPrefix = (str) => ((0, exports.hasHexPrefix)(str) ? str.slice(2) : str);
32
32
  exports.stripHexPrefix = stripHexPrefix;
33
+ const addHexPrefix = (str) => (str && !(0, exports.hasHexPrefix)(str) ? `0x${str}` : str);
34
+ exports.addHexPrefix = addHexPrefix;
33
35
  const isHexString = (value, length) => {
34
36
  if (typeof value !== 'string' || !value.match(/^(0x|0X)?[0-9A-Fa-f]*$/)) {
35
37
  return false;
@@ -54,4 +56,20 @@ const messageToHex = (message) => {
54
56
  return buffer.toString('hex');
55
57
  };
56
58
  exports.messageToHex = messageToHex;
59
+ const deepTransform = (transform) => {
60
+ const recursion = (value) => {
61
+ if (typeof value === 'string') {
62
+ return transform(value);
63
+ }
64
+ if (Array.isArray(value)) {
65
+ return value.map(recursion);
66
+ }
67
+ if (value && typeof value === 'object') {
68
+ return Object.entries(value).reduce((obj, [k, v]) => ({ ...obj, [k]: recursion(v) }), {});
69
+ }
70
+ return value;
71
+ };
72
+ return recursion;
73
+ };
74
+ exports.deepTransform = deepTransform;
57
75
  //# sourceMappingURL=formatUtils.js.map
@@ -1,6 +1,7 @@
1
1
  import BlockbookWorker from '@trezor/blockchain-link/lib/workers/blockbook';
2
2
  import RippleWorker from '@trezor/blockchain-link/lib/workers/ripple';
3
3
  import BlockfrostWorker from '@trezor/blockchain-link/lib/workers/blockfrost';
4
+ import SolanaWorker from '@trezor/blockchain-link/lib/workers/solana';
4
5
  declare const ElectrumWorker: undefined;
5
- export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker };
6
+ export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker, SolanaWorker };
6
7
  //# sourceMappingURL=workers-browser.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
3
+ exports.SolanaWorker = exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
6
6
  exports.BlockbookWorker = blockbook_1.default;
@@ -8,6 +8,8 @@ const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/wo
8
8
  exports.RippleWorker = ripple_1.default;
9
9
  const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
10
10
  exports.BlockfrostWorker = blockfrost_1.default;
11
+ const solana_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/solana"));
12
+ exports.SolanaWorker = solana_1.default;
11
13
  const ElectrumWorker = undefined;
12
14
  exports.ElectrumWorker = ElectrumWorker;
13
15
  //# sourceMappingURL=workers-browser.js.map
@@ -1,6 +1,7 @@
1
1
  import BlockbookWorker from '@trezor/blockchain-link/lib/workers/blockbook';
2
2
  import RippleWorker from '@trezor/blockchain-link/lib/workers/ripple';
3
3
  import BlockfrostWorker from '@trezor/blockchain-link/lib/workers/blockfrost';
4
+ import SolanaWorker from '@trezor/blockchain-link/lib/workers/solana';
4
5
  declare const ElectrumWorker: undefined;
5
- export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker };
6
+ export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker, SolanaWorker };
6
7
  //# sourceMappingURL=workers-react-native.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
3
+ exports.SolanaWorker = exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
6
6
  exports.BlockbookWorker = blockbook_1.default;
@@ -8,6 +8,8 @@ const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/wo
8
8
  exports.RippleWorker = ripple_1.default;
9
9
  const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
10
10
  exports.BlockfrostWorker = blockfrost_1.default;
11
+ const solana_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/solana"));
12
+ exports.SolanaWorker = solana_1.default;
11
13
  const ElectrumWorker = undefined;
12
14
  exports.ElectrumWorker = ElectrumWorker;
13
15
  //# sourceMappingURL=workers-react-native.js.map
@@ -1,6 +1,9 @@
1
- import BlockbookWorker from '@trezor/blockchain-link/lib/workers/blockbook';
2
- import RippleWorker from '@trezor/blockchain-link/lib/workers/ripple';
3
- import BlockfrostWorker from '@trezor/blockchain-link/lib/workers/blockfrost';
4
- import ElectrumWorker from '@trezor/blockchain-link/lib/workers/electrum';
5
- export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker };
1
+ import type { BaseWorker } from '@trezor/blockchain-link/lib/workers/baseWorker';
2
+ type WorkerAsyncImporter = () => Promise<BaseWorker<unknown>>;
3
+ declare const BlockbookWorker: WorkerAsyncImporter;
4
+ declare const RippleWorker: WorkerAsyncImporter;
5
+ declare const BlockfrostWorker: WorkerAsyncImporter;
6
+ declare const ElectrumWorker: WorkerAsyncImporter;
7
+ declare const SolanaWorker: WorkerAsyncImporter;
8
+ export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker, SolanaWorker };
6
9
  //# sourceMappingURL=workers.d.ts.map
@@ -1,13 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
4
- const tslib_1 = require("tslib");
5
- const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
6
- exports.BlockbookWorker = blockbook_1.default;
7
- const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/ripple"));
8
- exports.RippleWorker = ripple_1.default;
9
- const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
10
- exports.BlockfrostWorker = blockfrost_1.default;
11
- const electrum_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/electrum"));
12
- exports.ElectrumWorker = electrum_1.default;
26
+ exports.SolanaWorker = exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
27
+ const BlockbookWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/blockbook'))).then(w => w.default());
28
+ exports.BlockbookWorker = BlockbookWorker;
29
+ const RippleWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/ripple'))).then(w => w.default());
30
+ exports.RippleWorker = RippleWorker;
31
+ const BlockfrostWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/blockfrost'))).then(w => w.default());
32
+ exports.BlockfrostWorker = BlockfrostWorker;
33
+ const ElectrumWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/electrum'))).then(w => w.default());
34
+ exports.ElectrumWorker = ElectrumWorker;
35
+ const SolanaWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/solana'))).then(w => w.default());
36
+ exports.SolanaWorker = SolanaWorker;
13
37
  //# sourceMappingURL=workers.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.1.5",
3
+ "version": "9.1.7",
4
4
  "author": "Trezor <info@trezor.io>",
5
5
  "homepage": "https://github.com/trezor/trezor-suite/tree/develop/packages/connect",
6
6
  "description": "High-level javascript interface for Trezor hardware wallet.",
@@ -49,28 +49,31 @@
49
49
  "prepublish": "yarn tsx ../../scripts/prepublish.js"
50
50
  },
51
51
  "dependencies": {
52
- "@trezor/blockchain-link": "2.1.18",
53
- "@trezor/blockchain-link-types": "1.0.7",
54
- "@trezor/connect-analytics": "1.0.8",
55
- "@trezor/connect-common": "0.0.22",
56
- "@trezor/protobuf": "1.0.2",
57
- "@trezor/protocol": "1.0.2",
58
- "@trezor/transport": "1.1.17",
59
- "@trezor/utils": "9.0.14",
60
- "@trezor/utxo-lib": "1.0.12",
52
+ "@ethereumjs/common": "^4.1.0",
53
+ "@ethereumjs/tx": "^5.1.0",
54
+ "@fivebinaries/coin-selection": "2.2.1",
55
+ "@trezor/blockchain-link": "2.1.20",
56
+ "@trezor/blockchain-link-types": "1.0.9",
57
+ "@trezor/connect-analytics": "1.0.10",
58
+ "@trezor/connect-common": "0.0.24",
59
+ "@trezor/protobuf": "1.0.4",
60
+ "@trezor/protocol": "1.0.4",
61
+ "@trezor/transport": "1.1.19",
62
+ "@trezor/utils": "9.0.16",
63
+ "@trezor/utxo-lib": "2.0.2",
61
64
  "bignumber.js": "^9.1.1",
62
65
  "blakejs": "^1.2.1",
63
66
  "bs58": "^5.0.0",
64
67
  "bs58check": "^3.0.1",
65
- "cross-fetch": "^3.1.6",
68
+ "cross-fetch": "^4.0.0",
66
69
  "events": "^3.3.0"
67
70
  },
68
71
  "devDependencies": {
69
72
  "@trezor/trezor-user-env-link": "1.0.2",
70
- "@types/karma": "^6.3.4",
71
- "@types/parse-uri": "^1.0.0",
72
- "jest": "^29.5.0",
73
- "jest-environment-jsdom": "^29.5.0",
73
+ "@types/karma": "^6.3.6",
74
+ "@types/parse-uri": "^1.0.2",
75
+ "ethereum-cryptography": "^2.0.0",
76
+ "jest": "29.5.0",
74
77
  "karma": "^6.4.2",
75
78
  "karma-babel-preprocessor": "^8.0.2",
76
79
  "karma-chrome-launcher": "^3.2.0",
@@ -78,11 +81,11 @@
78
81
  "karma-jasmine-async": "^0.0.1",
79
82
  "karma-sourcemap-loader": "^0.4.0",
80
83
  "karma-webpack": "^5.0.0",
81
- "rimraf": "^5.0.1",
84
+ "rimraf": "^5.0.5",
82
85
  "ts-node": "^10.9.1",
83
- "tsx": "^3.12.7",
84
- "typescript": "4.9.5",
85
- "webpack": "^5.87.0",
86
+ "tsx": "^4.6.2",
87
+ "typescript": "5.3.2",
88
+ "webpack": "^5.89.0",
86
89
  "ws": "7.5.9"
87
90
  },
88
91
  "peerDependencies": {
@@ -1,11 +0,0 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { PROTO } from '../constants';
3
- export default class EosGetPublicKey extends AbstractMethod<'eosGetPublicKey', PROTO.EosGetPublicKey[]> {
4
- hasBundle?: boolean;
5
- confirmed?: boolean;
6
- init(): void;
7
- get info(): string;
8
- confirmation(): Promise<boolean>;
9
- run(): Promise<import("..").EosPublicKey | import("..").EosPublicKey[]>;
10
- }
11
- //# sourceMappingURL=eosGetPublicKey.d.ts.map
@@ -1,16 +0,0 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { PROTO } from '../constants';
3
- import type { EthereumNetworkInfo } from '../types';
4
- type Params = PROTO.EthereumGetPublicKey & {
5
- network?: EthereumNetworkInfo;
6
- };
7
- export default class EthereumGetPublicKey extends AbstractMethod<'ethereumGetPublicKey', Params[]> {
8
- hasBundle?: boolean;
9
- confirmed?: boolean;
10
- init(): void;
11
- get info(): string;
12
- confirmation(): Promise<boolean>;
13
- run(): Promise<import("../types/api/getPublicKey").HDNodeResponse | import("../types/api/getPublicKey").HDNodeResponse[]>;
14
- }
15
- export {};
16
- //# sourceMappingURL=ethereumGetPublicKey.d.ts.map