@trezor/connect 9.5.2 → 9.5.3-beta.1

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,16 +1,29 @@
1
1
  | Package | Stable | Canary |
2
2
  | :------------------------------: | :----: | :----------: |
3
- | npm @trezor/connect | 9.5.2 | - |
4
- | npm @trezor/connect-web | 9.5.2 | - |
5
- | npm @trezor/connect-webextension | 9.5.2 | - |
3
+ | npm @trezor/connect | 9.5.2 | 9.5.3-beta.1 |
4
+ | npm @trezor/connect-web | 9.5.2 | 9.5.3-beta.1 |
5
+ | npm @trezor/connect-webextension | 9.5.2 | 9.5.3-beta.1 |
6
6
  | npm @trezor/connect-mobile | - | 0.0.1-beta.1 |
7
7
 
8
- | Deployment | Stable | Canary |
9
- | :----------------: | :----: | :----: |
10
- | connect.trezor.io/ | 9.5.2 | - |
8
+ | Deployment | Stable | Canary |
9
+ | :----------------: | :----: | :----------: |
10
+ | connect.trezor.io/ | 9.5.2 | 9.5.3-beta.1 |
11
11
 
12
12
  Use the persistent link [connect.trezor.io/9](https://connect.trezor.io/9/) to access the latest stable version of Connect Explorer.
13
13
 
14
+ # 9.5.3-beta.1
15
+
16
+ ## Fixes
17
+
18
+ - fix(connect-popup): clear timeout on failure to prevent changing of error screen after 90 seconds (08fe031)
19
+ - fix(connect-popup): add missing margin after components update (0e5ea26)
20
+
21
+ ## Chores
22
+
23
+ - chore(connect): in decode eth definitions move common proto messages related logic outside of foreach (5da7ec8)
24
+ - fix(connect-popup): use local path to core (1f9e248, 241115c)
25
+ - chore(connect-popup): refactor old templates (dfef1db)
26
+
14
27
  # 9.5.2
15
28
 
16
29
  ## Feature
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.5.2
3
+ API version 9.5.3-beta.1
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)
@@ -12,18 +12,18 @@ export type CardanoSignTransactionParams = {
12
12
  signingMode: PROTO.CardanoTxSigningMode;
13
13
  inputsWithPath: InputWithPath[];
14
14
  outputsWithData: OutputWithData[];
15
- fee: PROTO.UintType;
16
- ttl?: PROTO.UintType;
15
+ fee: PROTO.CardanoSignTxInit['fee'];
16
+ ttl?: PROTO.CardanoSignTxInit['ttl'];
17
17
  certificatesWithPoolOwnersAndRelays: CertificateWithPoolOwnersAndRelays[];
18
18
  withdrawals: PROTO.CardanoTxWithdrawal[];
19
19
  mint: AssetGroupWithTokens[];
20
20
  auxiliaryData?: PROTO.CardanoTxAuxiliaryData;
21
- validityIntervalStart?: PROTO.UintType;
21
+ validityIntervalStart?: PROTO.CardanoSignTxInit['validity_interval_start'];
22
22
  scriptDataHash?: string;
23
23
  collateralInputsWithPath: CollateralInputWithPath[];
24
24
  requiredSigners: PROTO.CardanoTxRequiredSigner[];
25
25
  collateralReturnWithData?: OutputWithData;
26
- totalCollateral?: PROTO.UintType;
26
+ totalCollateral?: PROTO.CardanoSignTxInit['total_collateral'];
27
27
  referenceInputs: PROTO.CardanoTxReferenceInput[];
28
28
  protocolMagic: number;
29
29
  networkId: number;
@@ -22,7 +22,9 @@ class CipherKeyValue extends AbstractMethod_1.AbstractMethod {
22
22
  this.params = payload.bundle.map(batch => ({
23
23
  address_n: (0, pathUtils_1.validatePath)(batch.path),
24
24
  key: batch.key,
25
- value: batch.value instanceof Buffer ? batch.value.toString('hex') : batch.value,
25
+ value: batch.value instanceof Buffer
26
+ ? batch.value.toString('hex')
27
+ : batch.value,
26
28
  encrypt: batch.encrypt,
27
29
  ask_on_encrypt: batch.askOnEncrypt,
28
30
  ask_on_decrypt: batch.askOnDecrypt,
@@ -67,14 +67,14 @@ const decodeEthereumDefinition = (encodedDefinition) => {
67
67
  network: undefined,
68
68
  token: undefined,
69
69
  };
70
+ const messages = DataManager_1.DataManager.getProtobufMessages();
71
+ const proto = (0, protobuf_1.parseConfigure)(messages);
70
72
  ['encoded_token', 'encoded_network'].forEach(key => {
71
73
  const encodedPayload = encodedDefinition[key];
72
74
  if (!encodedPayload) {
73
75
  return;
74
76
  }
75
77
  const { definitionType, protobufPayload } = protocol_1.trzd.decode(encodedPayload);
76
- const messages = DataManager_1.DataManager.getProtobufMessages();
77
- const proto = (0, protobuf_1.parseConfigure)(messages);
78
78
  const { message: decodedDefinition } = (0, protobuf_1.decodeMessage)(proto, definitionType === 0 ? 'EthereumNetworkInfo' : 'EthereumTokenInfo', protobufPayload);
79
79
  if (key === 'encoded_network') {
80
80
  (0, schema_utils_1.Assert)(exports.EthereumNetworkDefinitionDecoded, decodedDefinition);
@@ -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 | Buffer>;
7
+ export declare const getBinary: ({ baseUrl, btcOnly, release }: GetBinaryProps) => Promise<ArrayBuffer | Buffer<ArrayBufferLike>>;
8
8
  export declare const getBinaryOptional: (props: GetBinaryProps) => Promise<ArrayBuffer | null>;
9
9
  export {};
10
10
  //# sourceMappingURL=getBinary.d.ts.map
@@ -7,6 +7,6 @@ interface GetBinaryForFirmwareUpgradeProps extends GetInfoProps {
7
7
  version?: VersionArray;
8
8
  intermediaryVersion?: IntermediaryVersion;
9
9
  }
10
- export declare const getBinaryForFirmwareUpgrade: ({ releases, baseUrl, version, btcOnly, intermediaryVersion, features, }: GetBinaryForFirmwareUpgradeProps) => Promise<ArrayBuffer | Buffer>;
10
+ export declare const getBinaryForFirmwareUpgrade: ({ releases, baseUrl, version, btcOnly, intermediaryVersion, features, }: GetBinaryForFirmwareUpgradeProps) => Promise<ArrayBuffer | Buffer<ArrayBufferLike>>;
11
11
  export {};
12
12
  //# sourceMappingURL=getBinaryForFirmwareUpgrade.d.ts.map
@@ -7,7 +7,7 @@ interface AuthenticityProofData extends PROTO.AuthenticityProof {
7
7
  allowDebugKeys?: boolean;
8
8
  deviceModel: keyof typeof PROTO.DeviceModelInternal;
9
9
  }
10
- export declare const getRandomChallenge: () => Buffer;
10
+ export declare const getRandomChallenge: () => Buffer<ArrayBufferLike>;
11
11
  export declare const verifyAuthenticityProof: ({ certificates, signature, challenge, config, allowDebugKeys, deviceModel, }: AuthenticityProofData) => Promise<AuthenticateDeviceResult>;
12
12
  export {};
13
13
  //# sourceMappingURL=verifyAuthenticityProof.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { PROTO } from '../../constants';
2
- export declare const generateEntropy: (len: number) => Buffer;
2
+ export declare const generateEntropy: (len: number) => Buffer<ArrayBuffer>;
3
3
  type VerifyEntropyOptions = {
4
4
  type?: PROTO.Enum_BackupType;
5
5
  strength?: number;
@@ -20,7 +20,7 @@ type Extension = {
20
20
  key: Oid;
21
21
  critical?: boolean;
22
22
  });
23
- export declare const fixSignature: (byteArray: Uint8Array) => Uint8Array;
23
+ export declare const fixSignature: (byteArray: Uint8Array) => Uint8Array<ArrayBuffer>;
24
24
  export declare const parseName: (asn1: Asn1) => {
25
25
  asn1: Asn1;
26
26
  algorithm: `${number}.${number}.${number}.${number}`;
@@ -64,7 +64,7 @@ export declare const parseCertificate: (byteArray: Uint8Array) => {
64
64
  };
65
65
  bits: {
66
66
  unusedBits: number;
67
- bytes: Uint8Array;
67
+ bytes: Uint8Array<ArrayBufferLike>;
68
68
  };
69
69
  };
70
70
  extensions: Extension[];
@@ -80,7 +80,7 @@ export declare const parseCertificate: (byteArray: Uint8Array) => {
80
80
  asn1: Asn1;
81
81
  bits: {
82
82
  unusedBits: number;
83
- bytes: Uint8Array;
83
+ bytes: Uint8Array<ArrayBuffer>;
84
84
  };
85
85
  };
86
86
  };
@@ -57,7 +57,6 @@ class GetAccountDescriptor extends AbstractMethod_1.AbstractMethod {
57
57
  Object.keys(keys).forEach((k, _i, _a) => {
58
58
  const details = keys[k];
59
59
  details.values.forEach(acc => {
60
- str.push('<span>');
61
60
  str.push(k);
62
61
  str.push(' ');
63
62
  if (typeof acc === 'string') {
@@ -66,7 +65,6 @@ class GetAccountDescriptor extends AbstractMethod_1.AbstractMethod {
66
65
  else {
67
66
  str.push((0, accountUtils_1.getAccountLabel)(acc, details.coinInfo));
68
67
  }
69
- str.push('</span>');
70
68
  });
71
69
  });
72
70
  return {
@@ -102,7 +102,6 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
102
102
  Object.keys(keys).forEach((k, _i, _a) => {
103
103
  const details = keys[k];
104
104
  details.values.forEach(acc => {
105
- str.push('<span>');
106
105
  str.push(k);
107
106
  str.push(' ');
108
107
  if (typeof acc === 'string') {
@@ -111,7 +110,6 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
111
110
  else {
112
111
  str.push((0, accountUtils_1.getAccountLabel)(acc, details.coinInfo));
113
112
  }
114
- str.push('</span>');
115
113
  });
116
114
  });
117
115
  return {
@@ -81,8 +81,8 @@ class ResetDevice extends AbstractMethod_1.AbstractMethod {
81
81
  if (this.params.entropy_check && this.device.unavailableCapabilities['entropyCheck']) {
82
82
  this.params.entropy_check = false;
83
83
  }
84
+ let entropyData = await this.getEntropyData('ResetDevice');
84
85
  try {
85
- let entropyData = await this.getEntropyData('ResetDevice');
86
86
  if (this.params.entropy_check) {
87
87
  const tries = (0, utils_1.getRandomInt)(1, 5);
88
88
  for (let i = 0; i < tries; i++) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
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
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.fetchAccountOwnerAndTokenInfoForAddress = exports.buildTokenTransferTransaction = exports.getMinimumRequiredTokenAccountsForTransfer = exports.buildCreateAssociatedTokenAccountInstruction = exports.getAssociatedTokenAccountAddress = exports.buildTokenTransferInstruction = exports.buildTransferTransaction = exports.dummyPriorityFeesForFeeEstimation = exports.getLamportsFromSol = void 0;
27
37
  exports.createTransactionShim = createTransactionShim;
@@ -8,18 +8,18 @@ export declare const createTx: (address_n: number[], branch: string, operation:
8
8
  transfer?: {
9
9
  amount: string | number;
10
10
  destination: {
11
- hash: Uint8Array;
11
+ hash: Uint8Array<ArrayBufferLike>;
12
12
  tag: number;
13
13
  };
14
14
  } | undefined;
15
- set_delegate?: Uint8Array | undefined;
15
+ set_delegate?: Uint8Array<ArrayBufferLike> | undefined;
16
16
  cancel_delegate?: boolean | undefined;
17
17
  } | undefined;
18
- source: Uint8Array;
18
+ source: Uint8Array<ArrayBufferLike>;
19
19
  amount: string | number;
20
20
  fee: string | number;
21
21
  destination: {
22
- hash: Uint8Array;
22
+ hash: Uint8Array<ArrayBufferLike>;
23
23
  tag: number;
24
24
  };
25
25
  counter: number;
@@ -27,19 +27,19 @@ export declare const createTx: (address_n: number[], branch: string, operation:
27
27
  storage_limit: number;
28
28
  } | undefined;
29
29
  reveal?: {
30
- source: Uint8Array;
31
- public_key: Uint8Array;
30
+ source: Uint8Array<ArrayBufferLike>;
31
+ public_key: Uint8Array<ArrayBufferLike>;
32
32
  fee: string | number;
33
33
  counter: number;
34
34
  gas_limit: number;
35
35
  storage_limit: number;
36
36
  } | undefined;
37
37
  origination?: {
38
- delegate?: Uint8Array | undefined;
38
+ delegate?: Uint8Array<ArrayBufferLike> | undefined;
39
39
  manager_pubkey?: string | undefined;
40
40
  spendable?: boolean | undefined;
41
41
  delegatable?: boolean | undefined;
42
- source: Uint8Array;
42
+ source: Uint8Array<ArrayBufferLike>;
43
43
  fee: string | number;
44
44
  script: string | number[];
45
45
  balance: number;
@@ -48,12 +48,12 @@ export declare const createTx: (address_n: number[], branch: string, operation:
48
48
  storage_limit: number;
49
49
  } | undefined;
50
50
  delegation?: {
51
- source: Uint8Array;
51
+ source: Uint8Array<ArrayBufferLike>;
52
52
  fee: string | number;
53
53
  counter: number;
54
54
  gas_limit: number;
55
55
  storage_limit: number;
56
- delegate: Uint8Array;
56
+ delegate: Uint8Array<ArrayBufferLike>;
57
57
  } | undefined;
58
58
  proposal?: {
59
59
  source: string;
@@ -67,6 +67,6 @@ export declare const createTx: (address_n: number[], branch: string, operation:
67
67
  ballot: PROTO.TezosBallotType;
68
68
  } | undefined;
69
69
  address_n: number[];
70
- branch: Uint8Array;
70
+ branch: Uint8Array<ArrayBufferLike>;
71
71
  };
72
72
  //# sourceMappingURL=tezosSignTx.d.ts.map
@@ -74,7 +74,6 @@ const parseConnectSettings = (input = {}) => {
74
74
  settings.iframeSrc = `${src}iframe.html`;
75
75
  settings.popupSrc = `${src}popup.html`;
76
76
  settings.webusbSrc = `${src}webusb.html`;
77
- settings.deeplinkUrl = `${src}deeplink/${version_1.DEEPLINK_VERSION}/`;
78
77
  if (typeof input.transportReconnect === 'boolean') {
79
78
  settings.transportReconnect = input.transportReconnect;
80
79
  }
@@ -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 | Buffer>;
5
+ }) => Promise<ArrayBuffer | Buffer<ArrayBufferLike>>;
6
6
  //# sourceMappingURL=getLanguage.d.ts.map
@@ -12,20 +12,20 @@ const info = {
12
12
  name: 'DEB package',
13
13
  platform: ['deb32', 'deb64'],
14
14
  url: '/udev/trezor-udev_2_all.deb',
15
+ preferred: true,
15
16
  },
16
17
  ],
17
18
  };
18
19
  const suggestUdevInstaller = (platform) => {
19
- const info2 = info;
20
- if (!info2.packages.find(p => p.preferred)) {
21
- if (platform) {
22
- info2.packages = info2.packages.map(p => ({
23
- ...p,
24
- preferred: p.platform.indexOf(platform) >= 0,
25
- }));
26
- }
20
+ if (platform !== undefined) {
21
+ return {
22
+ packages: info.packages.map(it => ({
23
+ ...it,
24
+ preferred: it.platform.indexOf(platform) >= 0,
25
+ })),
26
+ };
27
27
  }
28
- return info2;
28
+ return info;
29
29
  };
30
30
  exports.suggestUdevInstaller = suggestUdevInstaller;
31
31
  //# sourceMappingURL=udevInfo.js.map
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "9.5.2";
1
+ export declare const VERSION = "9.5.3-beta.1";
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.5.2';
4
+ exports.VERSION = '9.5.3-beta.1';
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