@trezor/connect 9.6.4 → 9.6.5-beta.2

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 (73) hide show
  1. package/CHANGELOG.md +20 -9
  2. package/README.md +1 -1
  3. package/lib/api/authenticateDevice.d.ts +5 -1
  4. package/lib/api/authenticateDevice.js +31 -12
  5. package/lib/api/firmware/getBinary.d.ts +3 -3
  6. package/lib/api/firmware/getBinary.js +2 -2
  7. package/lib/api/firmware/uploadFirmware.js +5 -0
  8. package/lib/api/monero/api/index.d.ts +5 -0
  9. package/lib/api/monero/api/index.js +13 -0
  10. package/lib/api/monero/api/moneroGetAddress.d.ts +27 -0
  11. package/lib/api/monero/api/moneroGetAddress.js +96 -0
  12. package/lib/api/monero/api/moneroGetWatchKey.d.ts +13 -0
  13. package/lib/api/monero/api/moneroGetWatchKey.js +43 -0
  14. package/lib/api/monero/api/moneroKeyImageSync.d.ts +16 -0
  15. package/lib/api/monero/api/moneroKeyImageSync.js +127 -0
  16. package/lib/api/monero/api/moneroSignTransaction.d.ts +16 -0
  17. package/lib/api/monero/api/moneroSignTransaction.js +197 -0
  18. package/lib/constants/errors.d.ts +1 -0
  19. package/lib/constants/errors.js +1 -0
  20. package/lib/constants/network.d.ts +1 -1
  21. package/lib/constants/network.js +1 -0
  22. package/lib/core/method.native.js +1 -0
  23. package/lib/core/onCallFirmwareUpdate.d.ts +1 -0
  24. package/lib/core/onCallFirmwareUpdate.js +12 -10
  25. package/lib/data/config.js +23 -0
  26. package/lib/data/connectSettings.js +1 -1
  27. package/lib/data/version.d.ts +1 -1
  28. package/lib/data/version.js +1 -1
  29. package/lib/device/Device.js +8 -1
  30. package/lib/device/DeviceCurrentSession.d.ts +78 -0
  31. package/lib/device/thp/pairing.js +1 -1
  32. package/lib/device/workflow/checkFirmwareHash.js +1 -1
  33. package/lib/events/transport.d.ts +0 -2
  34. package/lib/events/transport.js +0 -2
  35. package/lib/events/ui-request.d.ts +2 -2
  36. package/lib/factory.js +17 -0
  37. package/lib/impl/core-in-module.js +8 -2
  38. package/lib/tsconfig.lib.tsbuildinfo +1 -1
  39. package/lib/types/api/authenticateDevice.d.ts +19 -19
  40. package/lib/types/api/authenticateDevice.js +3 -4
  41. package/lib/types/api/discoverAccounts.d.ts +8 -0
  42. package/lib/types/api/discoverAccounts.js +2 -0
  43. package/lib/types/api/index.d.ts +8 -0
  44. package/lib/types/api/monero/index.d.ts +275 -0
  45. package/lib/types/api/monero/index.js +170 -0
  46. package/lib/types/api/moneroGetAddress.d.ts +5 -0
  47. package/lib/types/api/moneroGetAddress.js +3 -0
  48. package/lib/types/api/moneroGetWatchKey.d.ts +4 -0
  49. package/lib/types/api/moneroGetWatchKey.js +3 -0
  50. package/lib/types/api/moneroKeyImageSync.d.ts +4 -0
  51. package/lib/types/api/moneroKeyImageSync.js +3 -0
  52. package/lib/types/api/moneroSignTransaction.d.ts +4 -0
  53. package/lib/types/api/moneroSignTransaction.js +3 -0
  54. package/lib/types/firmware.d.ts +1 -1
  55. package/lib/types/index.d.ts +1 -0
  56. package/lib/types/index.js +1 -0
  57. package/lib/types/settings.d.ts +2 -2
  58. package/lib/utils/uiPromiseManager.js +5 -0
  59. package/package.json +14 -13
  60. package/lib/api/firmware/verifyAuthenticityProof.d.ts +0 -15
  61. package/lib/api/firmware/verifyAuthenticityProof.js +0 -133
  62. package/lib/api/firmware/x509certificate.d.ts +0 -88
  63. package/lib/api/firmware/x509certificate.js +0 -302
  64. package/lib/data/deviceAuthenticityBlacklist.d.ts +0 -3
  65. package/lib/data/deviceAuthenticityBlacklist.js +0 -11
  66. package/lib/data/deviceAuthenticityBlacklistConfig.d.ts +0 -11
  67. package/lib/data/deviceAuthenticityBlacklistConfig.js +0 -15
  68. package/lib/data/deviceAuthenticityConfig.d.ts +0 -3
  69. package/lib/data/deviceAuthenticityConfig.js +0 -47
  70. package/lib/data/deviceAuthenticityConfigTypes.d.ts +0 -39
  71. package/lib/data/deviceAuthenticityConfigTypes.js +0 -26
  72. package/lib/data/transportInfo.d.ts +0 -13
  73. package/lib/data/transportInfo.js +0 -54
@@ -1,302 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseCertificate = exports.parseName = exports.fixSignature = void 0;
4
- const derToAsn1 = (byteArray) => {
5
- let position = 0;
6
- function getTag() {
7
- let tag = byteArray[0] & 0x1f;
8
- position += 1;
9
- if (tag === 0x1f) {
10
- tag = 0;
11
- while (byteArray[position] >= 0x80) {
12
- tag = tag * 128 + byteArray[position] - 0x80;
13
- position += 1;
14
- }
15
- tag = tag * 128 + byteArray[position] - 0x80;
16
- position += 1;
17
- }
18
- return tag;
19
- }
20
- function getLength() {
21
- let length = 0;
22
- if (byteArray[position] < 0x80) {
23
- length = byteArray[position];
24
- position += 1;
25
- }
26
- else {
27
- const numberOfDigits = byteArray[position] & 0x7f;
28
- position += 1;
29
- length = 0;
30
- for (let i = 0; i < numberOfDigits; i++) {
31
- length = length * 256 + byteArray[position];
32
- position += 1;
33
- }
34
- }
35
- return length;
36
- }
37
- const cls = (byteArray[0] & 0xc0) / 64;
38
- const structured = (byteArray[0] & 0x20) === 0x20;
39
- const tag = getTag();
40
- if (byteArray[position] === 0x80) {
41
- throw new Error('Unsupported length encoding');
42
- }
43
- const length = getLength();
44
- const byteLength = position + length;
45
- const contents = byteArray.subarray(position, byteLength);
46
- const raw = byteArray.subarray(0, byteLength);
47
- return {
48
- cls,
49
- tag,
50
- structured,
51
- byteLength,
52
- contents,
53
- raw,
54
- };
55
- };
56
- const derToAsn1List = (byteArray) => {
57
- const result = [];
58
- let nextPosition = 0;
59
- while (nextPosition < byteArray.length) {
60
- const nextPiece = derToAsn1(byteArray.subarray(nextPosition));
61
- result.push(nextPiece);
62
- nextPosition += nextPiece.byteLength;
63
- }
64
- return result;
65
- };
66
- const derBitStringValue = (byteArray) => ({
67
- unusedBits: byteArray[0],
68
- bytes: byteArray.subarray(1),
69
- });
70
- const fixSignature = (byteArray) => {
71
- const asn1 = derToAsn1(byteArray);
72
- if (asn1.cls !== 0 || asn1.tag !== 16 || !asn1.structured) {
73
- throw new Error('Bad signature. Not a SEQUENCE.');
74
- }
75
- const items = derToAsn1List(asn1.contents);
76
- let newLength = 0;
77
- const fixedItems = items.map(chunk => {
78
- const index = chunk.contents.findIndex(value => value > 0x00);
79
- const data = chunk.contents.subarray(index);
80
- const offset = data[0] >= 0x80 ? 1 : 0;
81
- const chunkLength = data.length + offset;
82
- const newChunk = new Uint8Array(chunkLength + 2);
83
- newChunk.set([chunk.raw[0], chunkLength]);
84
- if (offset > 0) {
85
- newChunk.set([0], 2);
86
- }
87
- newChunk.set(data, 2 + offset);
88
- newLength += newChunk.length;
89
- return newChunk;
90
- });
91
- const signature = new Uint8Array(newLength + 2);
92
- signature.set([byteArray[0], newLength]);
93
- let signatureOffset = 2;
94
- fixedItems.forEach(item => {
95
- signature.set(item, signatureOffset);
96
- signatureOffset += item.length;
97
- });
98
- return signature;
99
- };
100
- exports.fixSignature = fixSignature;
101
- const parseSignatureValue = (asn1) => {
102
- if (asn1.cls !== 0 || asn1.tag !== 3 || asn1.structured) {
103
- throw new Error('Bad signature value. Not a BIT STRING.');
104
- }
105
- const { unusedBits, bytes } = derBitStringValue(asn1.contents);
106
- return {
107
- asn1,
108
- bits: { unusedBits, bytes: (0, exports.fixSignature)(bytes) },
109
- };
110
- };
111
- const derObjectIdentifierValue = (byteArray) => {
112
- let oid = `${Math.floor(byteArray[0] / 40)}.${byteArray[0] % 40}`;
113
- let position = 1;
114
- while (position < byteArray.length) {
115
- let nextInteger = 0;
116
- while (byteArray[position] >= 0x80) {
117
- nextInteger = nextInteger * 0x80 + (byteArray[position] & 0x7f);
118
- position += 1;
119
- }
120
- nextInteger = nextInteger * 0x80 + byteArray[position];
121
- position += 1;
122
- oid += `.${nextInteger}`;
123
- }
124
- return oid;
125
- };
126
- const parseAlgorithmIdentifier = (asn1) => {
127
- if (asn1.cls !== 0 || asn1.tag !== 16 || !asn1.structured) {
128
- throw new Error('Bad algorithm identifier. Not a SEQUENCE.');
129
- }
130
- const pieces = derToAsn1List(asn1.contents);
131
- if (pieces.length > 2) {
132
- throw new Error('Bad algorithm identifier. Contains too many child objects.');
133
- }
134
- const encodedAlgorithm = pieces[0];
135
- if (encodedAlgorithm.cls !== 0 || encodedAlgorithm.tag !== 6 || encodedAlgorithm.structured) {
136
- throw new Error('Bad algorithm identifier. Does not begin with an OBJECT IDENTIFIER.');
137
- }
138
- const algorithm = derObjectIdentifierValue(encodedAlgorithm.contents);
139
- return {
140
- asn1,
141
- algorithm,
142
- parameters: pieces.length === 2 ? { asn1: pieces[1] } : null,
143
- };
144
- };
145
- const parseName = (asn1) => derToAsn1List(asn1.contents).map(item => {
146
- const attrSet = derToAsn1(item.contents);
147
- return parseAlgorithmIdentifier(attrSet);
148
- });
149
- exports.parseName = parseName;
150
- const parseSubjectPublicKeyInfo = (asn1) => {
151
- if (asn1.cls !== 0 || asn1.tag !== 16 || !asn1.structured) {
152
- throw new Error('Bad SPKI. Not a SEQUENCE.');
153
- }
154
- const pieces = derToAsn1List(asn1.contents);
155
- if (pieces.length !== 2) {
156
- throw new Error('Bad SubjectPublicKeyInfo. Wrong number of child objects.');
157
- }
158
- return {
159
- asn1,
160
- algorithm: parseAlgorithmIdentifier(pieces[0]),
161
- bits: derBitStringValue(pieces[1].contents),
162
- };
163
- };
164
- const parseUtcTime = (time) => {
165
- let offset = 4;
166
- let yearOffset = 0;
167
- if (time.tag === 23) {
168
- offset = 2;
169
- yearOffset = 2000;
170
- }
171
- const utc = Buffer.from(time.contents).toString();
172
- const year = yearOffset + Number(utc.substring(0, offset));
173
- const month = Number(utc.substring(offset, offset + 2)) - 1;
174
- const day = Number(utc.substring(offset + 2, offset + 4));
175
- const hour = Number(utc.substring(offset + 4, offset + 6));
176
- const minute = Number(utc.substring(offset + 6, offset + 8));
177
- const date = new Date();
178
- date.setUTCFullYear(year, month, day);
179
- date.setUTCHours(hour, minute, 0);
180
- return date;
181
- };
182
- const parseValidity = (asn1) => {
183
- const [from, to] = derToAsn1List(asn1.contents);
184
- return {
185
- from: parseUtcTime(from),
186
- to: parseUtcTime(to),
187
- };
188
- };
189
- const parseExtensions = (data) => {
190
- const asn1 = derToAsn1(data.contents);
191
- if (asn1.cls !== 0 || asn1.tag !== 16 || !asn1.structured) {
192
- throw new Error("This can't be a Extension. Wrong data type.");
193
- }
194
- const readBoolean = (value) => {
195
- if (!value)
196
- return false;
197
- if (value.cls !== 0 || value.tag !== 1 || value.contents.length !== 1 || value.structured) {
198
- throw new Error("This can't be a boolean. Wrong data type.");
199
- }
200
- if (![0x00, 0xff].includes(value.contents[0])) {
201
- throw new Error('Invalid boolean value.');
202
- }
203
- return value.contents[0] === 0xff;
204
- };
205
- const readBitString = (uint8Array) => {
206
- const buffer = Buffer.from(uint8Array);
207
- const tag = buffer.readUInt8(0);
208
- if (tag !== 3) {
209
- throw new Error("This can't be a bit string. Wrong data type.");
210
- }
211
- const length = buffer.readUInt8(1);
212
- const unusedBits = buffer.readUInt8(2);
213
- const bitStringBytes = buffer.subarray(3, 3 + length - 1);
214
- const bitString = bitStringBytes.reduce((str, byte) => str + byte.toString(2).padStart(8, '0'), '');
215
- return bitString.slice(0, bitString.length - unusedBits);
216
- };
217
- const readInteger = (value) => {
218
- if (!value)
219
- return undefined;
220
- if (value.cls !== 0 || value.tag !== 2 || value.contents.length !== 1 || value.structured) {
221
- throw new Error("This can't be a integer. Wrong data type.");
222
- }
223
- return Buffer.from(value.contents).readInt8();
224
- };
225
- const extensions = [];
226
- derToAsn1List(asn1.contents).forEach(item => {
227
- const [id, ...pieces] = derToAsn1List(item.contents);
228
- if (id.cls !== 0 || id.tag !== 6 || id.structured) {
229
- throw new Error('Bad extension. Does not begin with an OBJECT IDENTIFIER.');
230
- }
231
- const algorithm = derObjectIdentifierValue(id.contents);
232
- const critical = pieces.length > 1 ? readBoolean(pieces[0]) : false;
233
- const extnValue = pieces.length > 1 ? pieces[1] : pieces[0];
234
- if (extnValue.cls !== 0 || extnValue.tag !== 4 || extnValue.structured) {
235
- throw new Error("This can't be a octet string. Wrong data type.");
236
- }
237
- if (algorithm === '2.5.29.15') {
238
- extensions.push({
239
- key: 'keyUsage',
240
- critical,
241
- keyCertSign: readBitString(extnValue.contents)[5],
242
- });
243
- }
244
- else if (algorithm === '2.5.29.19') {
245
- const fields = derToAsn1List(derToAsn1(extnValue.contents).contents);
246
- const ca = fields.length > 0 && fields[0].tag === 1 ? fields[0] : undefined;
247
- const len = fields.length > 0 && fields[0].tag === 2 ? fields[0] : fields[1];
248
- extensions.push({
249
- key: 'basicConstraints',
250
- critical,
251
- cA: readBoolean(ca),
252
- pathLenConstraint: readInteger(len),
253
- });
254
- }
255
- else {
256
- extensions.push({
257
- key: algorithm,
258
- critical,
259
- ...item,
260
- });
261
- }
262
- });
263
- return extensions;
264
- };
265
- const parseTBSCertificate = (asn1) => {
266
- if (asn1.cls !== 0 || asn1.tag !== 16 || !asn1.structured) {
267
- throw new Error("This can't be a TBSCertificate. Wrong data type.");
268
- }
269
- const pieces = derToAsn1List(asn1.contents);
270
- if (pieces.length < 7) {
271
- throw new Error('Bad TBS Certificate. There are fewer than the seven required children.');
272
- }
273
- return {
274
- asn1,
275
- version: pieces[0],
276
- serialNumber: pieces[1],
277
- signature: parseAlgorithmIdentifier(pieces[2]),
278
- issuer: pieces[3],
279
- validity: parseValidity(pieces[4]),
280
- subject: (0, exports.parseName)(pieces[5]),
281
- subjectPublicKeyInfo: parseSubjectPublicKeyInfo(pieces[6]),
282
- extensions: parseExtensions(pieces[7]),
283
- };
284
- };
285
- const parseCertificate = (byteArray) => {
286
- const asn1 = derToAsn1(byteArray);
287
- if (asn1.cls !== 0 || asn1.tag !== 16 || !asn1.structured) {
288
- throw new Error("This can't be an X.509 certificate. Wrong data type.");
289
- }
290
- const pieces = derToAsn1List(asn1.contents);
291
- if (pieces.length !== 3) {
292
- throw new Error('Certificate contains more than the three specified children.');
293
- }
294
- return {
295
- asn1,
296
- tbsCertificate: parseTBSCertificate(pieces[0]),
297
- signatureAlgorithm: parseAlgorithmIdentifier(pieces[1]),
298
- signatureValue: parseSignatureValue(pieces[2]),
299
- };
300
- };
301
- exports.parseCertificate = parseCertificate;
302
- //# sourceMappingURL=x509certificate.js.map
@@ -1,3 +0,0 @@
1
- import { DeviceAuthenticityBlacklistConfig } from './deviceAuthenticityBlacklistConfig';
2
- export declare const deviceAuthenticityBlacklist: DeviceAuthenticityBlacklistConfig;
3
- //# sourceMappingURL=deviceAuthenticityBlacklist.d.ts.map
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deviceAuthenticityBlacklist = void 0;
4
- exports.deviceAuthenticityBlacklist = {
5
- version: 1,
6
- blacklistedCaPubKeys: [],
7
- debug: {
8
- blacklistedCaPubKeys: [],
9
- },
10
- };
11
- //# sourceMappingURL=deviceAuthenticityBlacklist.js.map
@@ -1,11 +0,0 @@
1
- import { Static } from '@trezor/schema-utils';
2
- export type DeviceAuthenticityBlacklistConfig = Static<typeof DeviceAuthenticityBlacklistConfig>;
3
- export declare const DeviceAuthenticityBlacklistConfig: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
4
- blacklistedCaPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
5
- }>, import("@trezor/schema-utils").TObject<{
6
- version: import("@trezor/schema-utils").TNumber;
7
- debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
8
- blacklistedCaPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
9
- }>>;
10
- }>]>;
11
- //# sourceMappingURL=deviceAuthenticityBlacklistConfig.d.ts.map
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceAuthenticityBlacklistConfig = void 0;
4
- const schema_utils_1 = require("@trezor/schema-utils");
5
- const CertPubKeysBlacklist = schema_utils_1.Type.Object({
6
- blacklistedCaPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
7
- });
8
- exports.DeviceAuthenticityBlacklistConfig = schema_utils_1.Type.Intersect([
9
- CertPubKeysBlacklist,
10
- schema_utils_1.Type.Object({
11
- version: schema_utils_1.Type.Number(),
12
- debug: schema_utils_1.Type.Optional(CertPubKeysBlacklist),
13
- }),
14
- ]);
15
- //# sourceMappingURL=deviceAuthenticityBlacklistConfig.js.map
@@ -1,3 +0,0 @@
1
- import { DeviceAuthenticityConfig } from './deviceAuthenticityConfigTypes';
2
- export declare const deviceAuthenticityConfig: DeviceAuthenticityConfig;
3
- //# sourceMappingURL=deviceAuthenticityConfig.d.ts.map
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deviceAuthenticityConfig = void 0;
4
- exports.deviceAuthenticityConfig = {
5
- version: 2,
6
- T2B1: {
7
- rootPubKeys: [
8
- '04ca97480ac0d7b1e6efafe518cd433cec2bf8ab9822d76eafd34363b55d63e60380bff20acc75cde03cffcb50ab6f8ce70c878e37ebc58ff7cca0a83b16b15fa5',
9
- ],
10
- debug: {
11
- rootPubKeys: [
12
- '047f77368dea2d4d61e989f474a56723c3212dacf8a808d8795595ef38441427c4389bc454f02089d7f08b873005e4c28d432468997871c0bf286fd3861e21e96a',
13
- ],
14
- },
15
- },
16
- T3B1: {
17
- rootPubKeys: [
18
- '045b5c3fdd01f3602092834209b86df0ca86a9faf25cac35c73bf6237d66eb21eafcec3706f1ccd5eb4cc7f2fa1751213eccb1c78389afba89a5788ff31ee46a5d',
19
- ],
20
- debug: {
21
- rootPubKeys: [
22
- '047f77368dea2d4d61e989f474a56723c3212dacf8a808d8795595ef38441427c4389bc454f02089d7f08b873005e4c28d432468997871c0bf286fd3861e21e96a',
23
- ],
24
- },
25
- },
26
- T3T1: {
27
- rootPubKeys: [
28
- '041854b27fb1d9f65abb66828e78c9dc0ca301e66081ab0c6a4d104f9df1cd0ad5a7c75f77a8c092f55cf825d2abaf734f934c9394d5e75f75a5a06a5ee9be93ae',
29
- ],
30
- debug: {
31
- rootPubKeys: [
32
- '04e48b69cd7962068d3cca3bcc6b1747ef496c1e28b5529e34ad7295215ea161dbe8fb08ae0479568f9d2cb07630cb3e52f4af0692102da5873559e45e9fa72959',
33
- ],
34
- },
35
- },
36
- T3W1: {
37
- rootPubKeys: [
38
- '040dde0d3e0d4da593fac6fd02a461d0e7eef238aca55c7c50b4e9ec37f3873303b6429ef1c9b78b4411a7dcbbc5dde5225979c1c2da3b073e82b1ed3f5f9825bb',
39
- ],
40
- debug: {
41
- rootPubKeys: [
42
- '04521192e173a9da4e3023f747d836563725372681eba3079c56ff11b2fc137ab189eb4155f371127651b5594f8c332fc1e9c0f3b80d4212822668b63189706578',
43
- ],
44
- },
45
- },
46
- };
47
- //# sourceMappingURL=deviceAuthenticityConfig.js.map
@@ -1,39 +0,0 @@
1
- import { Static } from '@trezor/schema-utils';
2
- export type DeviceAuthenticityConfig = Static<typeof DeviceAuthenticityConfig>;
3
- export declare const DeviceAuthenticityConfig: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
4
- T2B1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
5
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
6
- }>, import("@trezor/schema-utils").TObject<{
7
- debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
8
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
9
- }>>;
10
- }>]>;
11
- T3B1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
12
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
13
- }>, import("@trezor/schema-utils").TObject<{
14
- debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
15
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
16
- }>>;
17
- }>]>;
18
- T3T1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
19
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
20
- }>, import("@trezor/schema-utils").TObject<{
21
- debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
22
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
23
- }>>;
24
- }>]>;
25
- T3W1: import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
26
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
27
- }>, import("@trezor/schema-utils").TObject<{
28
- debug: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
29
- rootPubKeys: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TString>;
30
- }>>;
31
- }>]>;
32
- }>, import("@trezor/schema-utils").TObject<{
33
- T1B1: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
34
- T2T1: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
35
- UNKNOWN: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
36
- }>]>, import("@trezor/schema-utils").TObject<{
37
- version: import("@trezor/schema-utils").TNumber;
38
- }>]>;
39
- //# sourceMappingURL=deviceAuthenticityConfigTypes.d.ts.map
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeviceAuthenticityConfig = void 0;
4
- const protobuf_1 = require("@trezor/protobuf");
5
- const schema_utils_1 = require("@trezor/schema-utils");
6
- const CertPubKeys = schema_utils_1.Type.Object({
7
- rootPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
8
- });
9
- const ModelsWithKeys = schema_utils_1.Type.Exclude(schema_utils_1.Type.KeyOfEnum(protobuf_1.MessagesSchema.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T1B1'), schema_utils_1.Type.Literal('T2T1'), schema_utils_1.Type.Literal('UNKNOWN')]));
10
- const ModelsWithoutKeys = schema_utils_1.Type.Extract(schema_utils_1.Type.KeyOfEnum(protobuf_1.MessagesSchema.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T1B1'), schema_utils_1.Type.Literal('T2T1'), schema_utils_1.Type.Literal('UNKNOWN')]));
11
- const ModelPubKeys = schema_utils_1.Type.Intersect([
12
- schema_utils_1.Type.Record(ModelsWithKeys, schema_utils_1.Type.Intersect([
13
- CertPubKeys,
14
- schema_utils_1.Type.Object({
15
- debug: schema_utils_1.Type.Optional(CertPubKeys),
16
- }),
17
- ])),
18
- schema_utils_1.Type.Partial(schema_utils_1.Type.Record(ModelsWithoutKeys, schema_utils_1.Type.Undefined())),
19
- ]);
20
- exports.DeviceAuthenticityConfig = schema_utils_1.Type.Intersect([
21
- ModelPubKeys,
22
- schema_utils_1.Type.Object({
23
- version: schema_utils_1.Type.Number(),
24
- }),
25
- ]);
26
- //# sourceMappingURL=deviceAuthenticityConfigTypes.js.map
@@ -1,13 +0,0 @@
1
- export interface BridgeInfo {
2
- version: number[];
3
- packages: {
4
- name: string;
5
- platform: string[];
6
- url: string;
7
- signature?: string;
8
- preferred?: boolean;
9
- }[];
10
- changelog: string;
11
- }
12
- export declare const suggestBridgeInstaller: (platform?: string) => BridgeInfo;
13
- //# sourceMappingURL=transportInfo.d.ts.map
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.suggestBridgeInstaller = void 0;
4
- const info = {
5
- version: [2, 0, 27],
6
- packages: [
7
- {
8
- name: 'Linux 64-bit (deb)',
9
- platform: ['deb64'],
10
- url: 'bridge/2.0.27/trezor-bridge_2.0.27_amd64.deb',
11
- },
12
- {
13
- name: 'Linux 64-bit (rpm)',
14
- platform: ['rpm64'],
15
- url: 'bridge/2.0.27/trezor-bridge-2.0.27-1.x86_64.rpm',
16
- },
17
- {
18
- name: 'Linux 32-bit (deb)',
19
- platform: ['deb32'],
20
- url: 'bridge/2.0.27/trezor-bridge_2.0.27_i386.deb',
21
- },
22
- {
23
- name: 'Linux 32-bit (rpm)',
24
- platform: ['rpm32'],
25
- url: 'bridge/2.0.27/trezor-bridge-2.0.27-1.i386.rpm',
26
- },
27
- {
28
- name: 'macOS',
29
- platform: ['mac'],
30
- signature: 'bridge/2.0.27/trezor-bridge-2.0.27.pkg.asc',
31
- url: 'bridge/2.0.27/trezor-bridge-2.0.27.pkg',
32
- },
33
- {
34
- name: 'Windows',
35
- platform: ['win32', 'win64'],
36
- signature: 'bridge/2.0.27/trezor-bridge-2.0.27-win32-install.exe.asc',
37
- url: 'bridge/2.0.27/trezor-bridge-2.0.27-win32-install.exe',
38
- },
39
- ],
40
- changelog: '',
41
- };
42
- const getBridgeInfo = () => info;
43
- const suggestBridgeInstaller = (platform) => {
44
- const info2 = getBridgeInfo();
45
- if (platform) {
46
- info2.packages = info2.packages.map(p => ({
47
- ...p,
48
- preferred: p.platform.indexOf(platform) >= 0,
49
- }));
50
- }
51
- return info2;
52
- };
53
- exports.suggestBridgeInstaller = suggestBridgeInstaller;
54
- //# sourceMappingURL=transportInfo.js.map