@trezor/connect 9.4.6 → 9.4.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.
package/CHANGELOG.md CHANGED
@@ -1,15 +1,31 @@
1
1
  | Package | Stable | Canary |
2
2
  | :------------------------------: | :----: | :----: |
3
- | npm @trezor/connect | 9.4.6 | - |
4
- | npm @trezor/connect-web | 9.4.6 | - |
5
- | npm @trezor/connect-webextension | 9.4.6 | - |
3
+ | npm @trezor/connect | 9.4.7 | - |
4
+ | npm @trezor/connect-web | 9.4.7 | - |
5
+ | npm @trezor/connect-webextension | 9.4.7 | - |
6
6
 
7
7
  | Deployment | Stable | Canary |
8
8
  | :----------------: | :----: | :----: |
9
- | connect.trezor.io/ | 9.4.6 | - |
9
+ | connect.trezor.io/ | 9.4.7 | - |
10
10
 
11
11
  Use the persistent link [connect.trezor.io/9](https://connect.trezor.io/9/) to access the latest stable version of Connect Explorer.
12
12
 
13
+ # 9.4.7
14
+
15
+ This release mainly fixes a serialization bug in Ethereum EIP-1559 transactions that was causing signing issues in some cases, presumably since v9.4.3.
16
+
17
+ The serialization handling has been refactored with improved type checking to ensure the correct output.
18
+
19
+ ## Fixes
20
+
21
+ - test(connect): improve serializeEthereumTx unit test (386dc36)
22
+ - feat(connect): improve serializeEthereumTx (12fad78)
23
+ - feat(connect): typed deepHexPrefix transform (1edbbc0)
24
+ - fix(connect): eip1559 correct maxFeePerGas (4f5d6f3)
25
+ - fix(connect): better mobile fetch errors (ad061ad)
26
+ - feat(tests): allow for running e2e tests with emulator from URL or from specific firmware branch (6d157a0)
27
+ - fix(connect-explorer): bundle adding problem (58e00b4)
28
+
13
29
  # 9.4.6
14
30
 
15
31
  This release brings improvements and optimizations in Solana `getAccountInfo`. It moves security checks outside `getFeatures` that fixes some of the issues with device loading and communication in general.
@@ -915,7 +931,7 @@ This package is now out of beta.
915
931
 
916
932
  # 9.1.1
917
933
 
918
- - feat(connect-popup): added device model_internal in features
934
+ - feat(connect-popup): added device internal_model in features
919
935
  - feat(connect): add cancelCoinjoinAuthorization method
920
936
  - feat(connect): added nodeusb transport. TrezorConnect is now capable of communicating with Trezor devices without using TrezorBridge (in node.js environment).
921
937
  - feat(connect-popup): when a call to TrezorConnect returns `success: false` popup remains opened and displays error page instead.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.4.6
3
+ API version 9.4.7
4
4
 
5
5
  [![Build Status](https://github.com/trezor/trezor-suite/actions/workflows/test-connect.yml/badge.svg)](https://github.com/trezor/trezor-suite/actions/workflows/test-connect.yml)
6
6
  [![NPM](https://img.shields.io/npm/v/@trezor/connect.svg)](https://www.npmjs.org/package/@trezor/connect)
@@ -20,9 +20,9 @@ export default class EthereumSignTransaction extends AbstractMethod<'ethereumSig
20
20
  get info(): string;
21
21
  run(): Promise<{
22
22
  serializedTx: string;
23
- v: string;
24
- r: string;
25
- s: string;
23
+ v: `0x${string}`;
24
+ r: `0x${string}`;
25
+ s: `0x${string}`;
26
26
  }>;
27
27
  }
28
28
  export {};
@@ -65,15 +65,7 @@ class EthereumSignTransaction extends AbstractMethod_1.AbstractMethod {
65
65
  const signature = isLegacy
66
66
  ? await helper.ethereumSignTx(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.gasPrice, tx.nonce, tx.chainId, chunkify, tx.data, tx.txType, definitions)
67
67
  : await helper.ethereumSignTxEIP1559(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.params.path, tx.to, tx.value, tx.gasLimit, tx.maxFeePerGas, tx.maxPriorityFeePerGas, tx.nonce, tx.chainId, chunkify, tx.data, tx.accessList, definitions);
68
- const txData = {
69
- ...tx,
70
- ...signature,
71
- type: isLegacy ? 0 : 2,
72
- gasPrice: isLegacy ? tx.gasPrice : null,
73
- maxFeePerGas: isLegacy ? tx.maxFeePerGas : tx.maxPriorityFeePerGas,
74
- maxPriorityFeePerGas: !isLegacy ? tx.maxPriorityFeePerGas : undefined,
75
- };
76
- const serializedTx = helper.serializeEthereumTx(txData, tx.chainId);
68
+ const serializedTx = helper.serializeEthereumTx(tx, signature, isLegacy);
77
69
  return { ...signature, serializedTx };
78
70
  }
79
71
  }
@@ -1,16 +1,21 @@
1
- import { FeeMarketEIP1559TxData, LegacyTxData } from '@ethereumjs/tx';
1
+ import { Common } from '@ethereumjs/common';
2
2
  import { MessagesSchema } from '@trezor/protobuf';
3
3
  import type { TypedCall } from '../../device/DeviceCommands';
4
- import type { EthereumAccessList } from '../../types/api/ethereum';
5
- export declare const serializeEthereumTx: (txData: LegacyTxData | FeeMarketEIP1559TxData, chainId: number) => string;
4
+ import type { EthereumAccessList, EthereumTransaction, EthereumTransactionEIP1559 } from '../../types/api/ethereum';
5
+ export declare const getCommonForChain: (chainId: number) => Common;
6
+ export declare const serializeEthereumTx: (tx: EthereumTransactionEIP1559 | EthereumTransaction, signature: {
7
+ v: `0x${string}`;
8
+ r: `0x${string}`;
9
+ s: `0x${string}`;
10
+ }, isLegacy: boolean) => string;
6
11
  export declare const ethereumSignTx: (typedCall: TypedCall, address_n: number[], to: string, value: string, gas_limit: string, gas_price: string, nonce: string, chain_id: number, chunkify: boolean, data?: string, tx_type?: number, definitions?: MessagesSchema.EthereumDefinitions) => Promise<{
7
- v: string;
8
- r: string;
9
- s: string;
12
+ v: `0x${string}`;
13
+ r: `0x${string}`;
14
+ s: `0x${string}`;
10
15
  }>;
11
16
  export declare const ethereumSignTxEIP1559: (typedCall: TypedCall, address_n: number[], to: string, value: string, gas_limit: string, max_gas_fee: string, max_priority_fee: string, nonce: string, chain_id: number, chunkify: boolean, data?: string, access_list?: EthereumAccessList[], definitions?: MessagesSchema.EthereumDefinitions) => Promise<{
12
- v: string;
13
- r: string;
14
- s: string;
17
+ v: `0x${string}`;
18
+ r: `0x${string}`;
19
+ s: `0x${string}`;
15
20
  }>;
16
21
  //# sourceMappingURL=ethereumSignTx.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ethereumSignTxEIP1559 = exports.ethereumSignTx = exports.serializeEthereumTx = void 0;
3
+ exports.ethereumSignTxEIP1559 = exports.ethereumSignTx = exports.serializeEthereumTx = exports.getCommonForChain = void 0;
4
4
  const common_1 = require("@ethereumjs/common");
5
5
  const tx_1 = require("@ethereumjs/tx");
6
6
  const constants_1 = require("../../constants");
@@ -35,13 +35,35 @@ const processTxRequest = async (typedCall, request, data, chain_id) => {
35
35
  return processTxRequest(typedCall, response.message, rest, chain_id);
36
36
  };
37
37
  const deepHexPrefix = (0, formatUtils_1.deepTransform)(formatUtils_1.addHexPrefix);
38
- const serializeEthereumTx = (txData, chainId) => {
39
- const txOptions = chainId === 61
40
- ? {
41
- common: common_1.Common.custom({ name: 'ethereum-classic', networkId: 1, chainId: 61 }, { baseChain: common_1.Chain.Mainnet, hardfork: common_1.Hardfork.Petersburg }),
42
- }
43
- : { chain: chainId };
44
- const ethTx = tx_1.TransactionFactory.fromTxData(deepHexPrefix(txData), txOptions);
38
+ const getCommonForChain = (chainId) => {
39
+ if (common_1.Common.isSupportedChainId(BigInt(chainId)))
40
+ return new common_1.Common({ chain: chainId });
41
+ if (chainId === 61)
42
+ return common_1.Common.custom({ name: 'ethereum-classic', networkId: 1, chainId: 61 }, { baseChain: common_1.Chain.Mainnet, hardfork: common_1.Hardfork.Petersburg });
43
+ return common_1.Common.custom({ chainId });
44
+ };
45
+ exports.getCommonForChain = getCommonForChain;
46
+ const serializeEthereumTx = (tx, signature, isLegacy) => {
47
+ const txData = deepHexPrefix({
48
+ ...tx,
49
+ ...signature,
50
+ type: isLegacy ? 0 : 2,
51
+ ...(isLegacy
52
+ ? {
53
+ gasPrice: tx.gasPrice,
54
+ maxFeePerGas: undefined,
55
+ maxPriorityFeePerGas: undefined,
56
+ }
57
+ : {
58
+ gasPrice: undefined,
59
+ maxFeePerGas: tx.maxFeePerGas,
60
+ maxPriorityFeePerGas: tx.maxPriorityFeePerGas,
61
+ }),
62
+ });
63
+ const txOptions = {
64
+ common: (0, exports.getCommonForChain)(tx.chainId),
65
+ };
66
+ const ethTx = tx_1.TransactionFactory.fromTxData(txData, txOptions);
45
67
  return `0x${Buffer.from(ethTx.serialize()).toString('hex')}`;
46
68
  };
47
69
  exports.serializeEthereumTx = serializeEthereumTx;
@@ -4,7 +4,7 @@ interface GetBinaryProps {
4
4
  btcOnly?: boolean;
5
5
  release: FirmwareRelease;
6
6
  }
7
- export declare const getBinary: ({ baseUrl, btcOnly, release }: GetBinaryProps) => Promise<ArrayBuffer>;
7
+ export declare const getBinary: ({ baseUrl, btcOnly, release }: GetBinaryProps) => Promise<ArrayBuffer | Buffer>;
8
8
  export declare const getBinaryOptional: (props: GetBinaryProps) => Promise<ArrayBuffer | null>;
9
9
  export {};
10
10
  //# sourceMappingURL=getBinary.d.ts.map
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBinaryOptional = exports.getBinary = void 0;
4
4
  const assets_1 = require("../../utils/assets");
5
+ const ALL_SLASHES_AT_THE_END_REGEX = /\/+$/;
5
6
  const getBinary = ({ baseUrl, btcOnly, release }) => {
6
7
  const fwUrl = release[btcOnly ? 'url_bitcoinonly' : 'url'];
7
- const url = `${baseUrl}/${fwUrl}`;
8
+ const sanitizedBaseUrl = baseUrl.replace(ALL_SLASHES_AT_THE_END_REGEX, '');
9
+ const url = `${sanitizedBaseUrl}/${fwUrl}`;
8
10
  return (0, assets_1.httpRequest)(url, 'binary');
9
11
  };
10
12
  exports.getBinary = getBinary;
@@ -6,6 +6,6 @@ interface GetBinaryForFirmwareUpgradeProps extends GetInfoProps {
6
6
  version?: VersionArray;
7
7
  intermediaryVersion?: IntermediaryVersion;
8
8
  }
9
- export declare const getBinaryForFirmwareUpgrade: ({ releases, baseUrl, version, btcOnly, intermediaryVersion, features, }: GetBinaryForFirmwareUpgradeProps) => Promise<ArrayBuffer>;
9
+ export declare const getBinaryForFirmwareUpgrade: ({ releases, baseUrl, version, btcOnly, intermediaryVersion, features, }: GetBinaryForFirmwareUpgradeProps) => Promise<ArrayBuffer | Buffer>;
10
10
  export {};
11
11
  //# sourceMappingURL=getBinaryForFirmwareUpgrade.d.ts.map
@@ -75,8 +75,8 @@ const SOLANA_FEE_INFO = {
75
75
  blocks: -1,
76
76
  },
77
77
  ],
78
- minFee: -1,
79
- maxFee: -1,
78
+ minFee: 5000,
79
+ maxFee: 1000000000,
80
80
  dustLimit: -1,
81
81
  };
82
82
  const MISC_FEE_LEVELS = {
@@ -5,7 +5,10 @@ const assets_1 = require("../utils/assets");
5
5
  const firmwareUtils_1 = require("../utils/firmwareUtils");
6
6
  const downloadReleasesMetadata = async ({ internal_model, }) => {
7
7
  const url = `https://data.trezor.io/firmware/${internal_model.toLowerCase()}/releases.json`;
8
- const response = await (0, assets_1.httpRequest)(url, 'json', { signal: AbortSignal.timeout(10000) }, true);
8
+ const response = await (0, assets_1.httpRequest)(url, 'json', {
9
+ signal: AbortSignal.timeout(10000),
10
+ skipLocalForceDownload: true,
11
+ });
9
12
  if ((0, firmwareUtils_1.isValidReleases)(response)) {
10
13
  return response;
11
14
  }
@@ -2,5 +2,5 @@ export declare const getLanguage: ({ language, version, internal_model, }: {
2
2
  language: string;
3
3
  version: number[];
4
4
  internal_model: string;
5
- }) => Promise<ArrayBuffer>;
5
+ }) => Promise<ArrayBuffer | Buffer>;
6
6
  //# sourceMappingURL=getLanguage.d.ts.map
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "9.4.6";
1
+ export declare const VERSION = "9.4.7";
2
2
  export declare const DEFAULT_DOMAIN: string;
3
3
  export declare const CONTENT_SCRIPT_VERSION = 1;
4
4
  export declare const DEEPLINK_VERSION = 1;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEEPLINK_VERSION = exports.CONTENT_SCRIPT_VERSION = exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
4
- exports.VERSION = '9.4.6';
4
+ exports.VERSION = '9.4.7';
5
5
  const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
6
6
  const isBeta = exports.VERSION.includes('beta');
7
7
  exports.DEFAULT_DOMAIN = isBeta
@@ -140,7 +140,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
140
140
  clearCancelableAction(): void;
141
141
  interruptionFromUser(error: Error): Promise<void>;
142
142
  usedElsewhere(): void;
143
- _runInner<X>(fn: (() => Promise<X>) | undefined, options: RunOptions): Promise<void>;
143
+ private _runInner;
144
144
  getCommands(): DeviceCommands;
145
145
  setInstance(instance?: number): void;
146
146
  getInstance(): number;
@@ -185,7 +185,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
185
185
  isT1(): boolean;
186
186
  hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
187
187
  dispose(): Promise<import("@trezor/transport/lib/types").Success<null> | import("@trezor/transport/lib/types").ErrorGeneric<"session not found" | "Network request failed" | "Wrong result type." | "device disconnected during action" | "unexpected error" | "Aborted by timeout" | "Aborted by signal" | "This transport can not be used in this environment" | "device not found" | "Unable to open device" | "wrong previous session"> | undefined>;
188
- getMode(): "normal" | "bootloader" | "initialize" | "seedless";
188
+ private getMode;
189
189
  toMessageObject(): DeviceTyped;
190
190
  }
191
191
  export {};
@@ -1,5 +1,5 @@
1
1
  import EventEmitter from 'events';
2
- import { UiResponseEvent, CallMethodPayload, CoreRequestMessage } from '../events';
2
+ import { UiResponseEvent, CoreEventMessage, CallMethodPayload, CoreRequestMessage } from '../events';
3
3
  import type { ConnectSettings, ConnectSettingsPublic, DeviceIdentity, Manifest } from '../types';
4
4
  import { ConnectFactoryDependencies } from '../factory';
5
5
  export declare class CoreInModule implements ConnectFactoryDependencies<ConnectSettingsPublic> {
@@ -9,7 +9,8 @@ export declare class CoreInModule implements ConnectFactoryDependencies<ConnectS
9
9
  private _log;
10
10
  private _messagePromises;
11
11
  private readonly boundOnCoreEvent;
12
- constructor();
12
+ private onCoreHook?;
13
+ constructor(onCoreHook?: (message: CoreEventMessage) => CoreEventMessage);
13
14
  private initCoreManager;
14
15
  manifest(data: Manifest): void;
15
16
  dispose(): Promise<undefined>;
@@ -10,7 +10,7 @@ const factory_1 = require("../factory");
10
10
  const debug_1 = require("../utils/debug");
11
11
  const connectSettings_1 = require("../data/connectSettings");
12
12
  class CoreInModule {
13
- constructor() {
13
+ constructor(onCoreHook) {
14
14
  this.eventEmitter = new events_1.default();
15
15
  this.boundOnCoreEvent = this.onCoreEvent.bind(this);
16
16
  this.initSettings = (settings = {}) => {
@@ -30,6 +30,7 @@ class CoreInModule {
30
30
  this._settings = (0, connectSettings_1.parseConnectSettings)();
31
31
  this._log = (0, debug_1.initLog)('@trezor/connect-web');
32
32
  this._messagePromises = (0, utils_1.createDeferredManager)({ initialId: 1 });
33
+ this.onCoreHook = onCoreHook;
33
34
  }
34
35
  async initCoreManager() {
35
36
  const { connectSrc } = this._settings;
@@ -80,7 +81,10 @@ class CoreInModule {
80
81
  }
81
82
  onCoreEvent(rawMessage) {
82
83
  var _a;
83
- const message = (0, utils_1.cloneObject)(rawMessage);
84
+ let message = (0, utils_1.cloneObject)(rawMessage);
85
+ if (this.onCoreHook) {
86
+ message = this.onCoreHook(message);
87
+ }
84
88
  const { event, type, payload } = message;
85
89
  if (type === events_2.UI.REQUEST_UI_WINDOW) {
86
90
  (_a = this._coreManager.get()) === null || _a === void 0 ? void 0 : _a.handleMessage({ type: events_2.POPUP.HANDSHAKE });
@@ -1,2 +1,3 @@
1
- export declare const httpRequest: (url: string, type?: "text" | "binary" | "json", options?: RequestInit) => Promise<any>;
1
+ import { HttpRequestType, HttpRequestReturnType, HttpRequestOptions } from './assetsTypes';
2
+ export declare const httpRequest: <T extends HttpRequestType>(url: string, type?: T, options?: HttpRequestOptions) => Promise<HttpRequestReturnType<T>>;
2
3
  //# sourceMappingURL=assets-browser.d.ts.map
@@ -1,4 +1,3 @@
1
- export declare function httpRequest(url: string, type: 'text', options?: RequestInit, skipLocalForceDownload?: boolean): Promise<string>;
2
- export declare function httpRequest(url: string, type: 'binary', options?: RequestInit, skipLocalForceDownload?: boolean): Promise<ArrayBuffer>;
3
- export declare function httpRequest(url: string, type: 'json', options?: RequestInit, skipLocalForceDownload?: boolean): Promise<Record<string, any>>;
1
+ import { HttpRequestOptions, HttpRequestReturnType, HttpRequestType } from './assetsTypes';
2
+ export declare function httpRequest<T extends HttpRequestType>(url: string, type: T, options?: HttpRequestOptions): Promise<HttpRequestReturnType<T>>;
4
3
  //# sourceMappingURL=assets.d.ts.map
@@ -9,10 +9,12 @@ const assetUtils_1 = require("./assetUtils");
9
9
  if (global && typeof global.fetch !== 'function') {
10
10
  global.fetch = cross_fetch_1.default;
11
11
  }
12
- function httpRequest(url, type, options, skipLocalForceDownload) {
13
- const asset = skipLocalForceDownload ? null : (0, assetUtils_1.tryLocalAssetRequire)(url);
12
+ function httpRequest(url, type, options) {
13
+ const asset = (options === null || options === void 0 ? void 0 : options.skipLocalForceDownload) ? null : (0, assetUtils_1.tryLocalAssetRequire)(url);
14
14
  if (!asset) {
15
- return /^https?/.test(url) ? (0, assets_browser_1.httpRequest)(url, type, options) : fs_1.promises.readFile(url);
15
+ return /^https?/.test(url)
16
+ ? (0, assets_browser_1.httpRequest)(url, type, options)
17
+ : fs_1.promises.readFile(url);
16
18
  }
17
19
  return asset;
18
20
  }
@@ -1,2 +1,3 @@
1
- export declare const httpRequest: (url: string, _type: string) => any;
1
+ import { HttpRequestType, HttpRequestReturnType, HttpRequestOptions } from './assetsTypes';
2
+ export declare function httpRequest<T extends HttpRequestType>(url: string, type: T, options?: HttpRequestOptions): Promise<HttpRequestReturnType<T>>;
2
3
  //# sourceMappingURL=assets.native.d.ts.map
@@ -1,7 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.httpRequest = void 0;
4
- const assetUtils_1 = require("./assetUtils");
5
- const httpRequest = (url, _type) => (0, assetUtils_1.tryLocalAssetRequire)(url);
6
3
  exports.httpRequest = httpRequest;
4
+ const assetUtils_1 = require("./assetUtils");
5
+ function httpRequest(url, type, options) {
6
+ const asset = (options === null || options === void 0 ? void 0 : options.skipLocalForceDownload) ? null : (0, assetUtils_1.tryLocalAssetRequire)(url);
7
+ if (!asset) {
8
+ return fetch(url, {
9
+ ...options,
10
+ })
11
+ .then(response => {
12
+ if (!response.ok) {
13
+ console.error('HTTP request failed', response);
14
+ throw new Error(`HTTP request failed with status ${response.status} ${response.statusText}`);
15
+ }
16
+ if (type === 'binary') {
17
+ return response.arrayBuffer();
18
+ }
19
+ if (type === 'json') {
20
+ return response.json();
21
+ }
22
+ return response.text();
23
+ })
24
+ .catch(error => {
25
+ console.error('HTTP request failed', error);
26
+ throw error;
27
+ });
28
+ }
29
+ return asset;
30
+ }
7
31
  //# sourceMappingURL=assets.native.js.map
@@ -0,0 +1,6 @@
1
+ export type HttpRequestType = 'text' | 'binary' | 'json';
2
+ export type HttpRequestReturnType<T extends HttpRequestType> = T extends 'text' ? string : T extends 'binary' ? ArrayBuffer | Buffer : T extends 'json' ? Record<string, any> : never;
3
+ export interface HttpRequestOptions extends RequestInit {
4
+ skipLocalForceDownload?: boolean;
5
+ }
6
+ //# sourceMappingURL=assetsTypes.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=assetsTypes.js.map
@@ -4,7 +4,11 @@ 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
+ export declare const addHexPrefix: (str: string) => `0x${string}`;
8
8
  export declare const messageToHex: (message: string) => string;
9
- export declare const deepTransform: (transform: (str: string) => string) => <T>(value: T) => T;
9
+ export declare const deepTransform: <V>(transform: (str: string) => V) => <T>(value: T) => DeepTransformed<T, V>;
10
+ type DeepTransformed<T, V> = T extends string ? V : T extends (infer U)[] ? DeepTransformed<U, V>[] : T extends object ? {
11
+ [K in keyof T]: DeepTransformed<T[K], V>;
12
+ } : T;
13
+ export {};
10
14
  //# sourceMappingURL=formatUtils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.4.6",
3
+ "version": "9.4.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.",
@@ -72,16 +72,16 @@
72
72
  "@ethereumjs/common": "^4.4.0",
73
73
  "@ethereumjs/tx": "^5.4.0",
74
74
  "@fivebinaries/coin-selection": "2.2.1",
75
- "@trezor/blockchain-link": "2.3.5",
76
- "@trezor/blockchain-link-types": "1.2.4",
75
+ "@trezor/blockchain-link": "2.3.6",
76
+ "@trezor/blockchain-link-types": "1.2.5",
77
77
  "@trezor/connect-analytics": "1.2.4",
78
- "@trezor/connect-common": "0.2.6",
78
+ "@trezor/connect-common": "0.2.7",
79
79
  "@trezor/protobuf": "1.2.6",
80
80
  "@trezor/protocol": "1.2.2",
81
81
  "@trezor/schema-utils": "1.2.3",
82
- "@trezor/transport": "1.3.6",
83
- "@trezor/utils": "9.2.5",
84
- "@trezor/utxo-lib": "2.2.5",
82
+ "@trezor/transport": "1.3.7",
83
+ "@trezor/utils": "9.2.6",
84
+ "@trezor/utxo-lib": "2.2.6",
85
85
  "blakejs": "^1.2.1",
86
86
  "bs58": "^6.0.0",
87
87
  "bs58check": "^4.0.0",