@trezor/connect 9.1.3 → 9.1.5
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 +36 -0
- package/README.md +3 -1
- package/lib/api/authenticateDevice.d.ts +7 -0
- package/lib/api/authenticateDevice.js +51 -0
- package/lib/api/bitcoin/TransactionComposer.js +1 -9
- package/lib/api/bitcoin/inputs.d.ts +2 -2
- package/lib/api/bitcoin/outputs.d.ts +2 -2
- package/lib/api/cardanoGetPublicKey.d.ts +6 -2
- package/lib/api/cardanoGetPublicKey.js +7 -1
- package/lib/api/checkFirmwareAuthenticity.js +9 -8
- package/lib/api/common/paramsValidator.js +46 -52
- package/lib/api/eos/eosSignTx.js +1 -1
- package/lib/api/ethereum/ethereumDefinitions.js +3 -2
- package/lib/api/firmware/getBinary.js +1 -1
- package/lib/api/firmware/verifyAuthenticityProof.d.ts +14 -0
- package/lib/api/firmware/verifyAuthenticityProof.js +103 -0
- package/lib/api/firmware/x509certificate.d.ts +73 -0
- package/lib/api/firmware/x509certificate.js +203 -0
- package/lib/api/firmwareUpdate.js +4 -4
- package/lib/api/getAccountInfo.d.ts +1 -1
- package/lib/api/getAccountInfo.js +6 -6
- package/lib/api/getFirmwareHash.js +1 -4
- package/lib/api/getPublicKey.d.ts +2 -1
- package/lib/api/getPublicKey.js +7 -1
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +4 -2
- package/lib/api/rebootToBootloader.js +1 -4
- package/lib/api/signTransaction.js +1 -1
- package/lib/core/AbstractMethod.d.ts +5 -4
- package/lib/core/AbstractMethod.js +13 -11
- package/lib/core/index.d.ts +3 -2
- package/lib/core/index.js +23 -12
- package/lib/core/method.d.ts +1 -1
- package/lib/data/DataManager.d.ts +53 -7
- package/lib/data/DataManager.js +4 -2
- package/lib/data/coinInfo.d.ts +5 -5
- package/lib/data/coinInfo.js +1 -1
- package/lib/data/config.d.ts +52 -6
- package/lib/data/config.js +39 -28
- package/lib/data/connectSettings.js +3 -0
- package/lib/data/deviceAuthenticityConfig.d.ts +15 -0
- package/lib/data/deviceAuthenticityConfig.js +26 -0
- package/lib/data/firmwareInfo.d.ts +3 -2
- package/lib/data/firmwareInfo.js +19 -11
- package/lib/data/models.d.ts +21 -0
- package/lib/data/models.js +24 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +5 -3
- package/lib/device/Device.js +37 -22
- package/lib/device/DeviceCommands.js +4 -4
- package/lib/device/DeviceList.d.ts +2 -1
- package/lib/device/DeviceList.js +10 -3
- package/lib/events/iframe.d.ts +7 -1
- package/lib/events/iframe.js +1 -0
- package/lib/events/ui-promise.d.ts +10 -2
- package/lib/factory.js +1 -0
- package/lib/types/api/authenticateDevice.d.ts +21 -0
- package/lib/types/api/authenticateDevice.js +3 -0
- package/lib/types/api/authorizeCoinjoin.d.ts +2 -2
- package/lib/types/api/binance/index.d.ts +2 -1
- package/lib/types/api/bitcoin/index.d.ts +6 -5
- package/lib/types/api/cardano/index.d.ts +12 -12
- package/lib/types/api/cipherKeyValue.d.ts +2 -2
- package/lib/types/api/eos/index.d.ts +3 -2
- package/lib/types/api/ethereum/index.d.ts +5 -4
- package/lib/types/api/getAccountInfo.d.ts +1 -0
- package/lib/types/api/getOwnershipId.d.ts +2 -2
- package/lib/types/api/getOwnershipProof.d.ts +2 -2
- package/lib/types/api/index.d.ts +2 -0
- package/lib/types/api/nem/index.d.ts +2 -1
- package/lib/types/api/ripple/index.d.ts +2 -1
- package/lib/types/api/stellar/index.d.ts +2 -1
- package/lib/types/api/tezos/index.d.ts +3 -2
- package/lib/types/api/unlockPath.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +3 -2
- package/lib/types/device.d.ts +6 -0
- package/lib/types/firmware.d.ts +8 -4
- package/lib/types/index.d.ts +1 -0
- package/lib/types/params.d.ts +14 -2
- package/lib/utils/assetUtils.js +6 -4
- package/lib/utils/debug.d.ts +9 -3
- package/lib/utils/debug.js +50 -17
- package/lib/utils/deviceFeaturesUtils.js +7 -7
- package/lib/utils/pathUtils.d.ts +3 -3
- package/package.json +14 -13
- package/lib/utils/deferred.d.ts +0 -18
- package/lib/utils/deferred.js +0 -66
- package/lib/utils/versionUtils.d.ts +0 -8
- package/lib/utils/versionUtils.js +0 -75
package/lib/core/method.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import * as Methods from '../api';
|
|
|
2
2
|
import type { IFrameCallMessage } from '../events';
|
|
3
3
|
export declare const getMethod: (message: IFrameCallMessage & {
|
|
4
4
|
id?: number;
|
|
5
|
-
}) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinjoin | Methods.cancelCoinjoinAuthorization | Methods.showDeviceTutorial | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getFirmwareHash | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setBusy | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.unlockPath | Methods.verifyMessage | Methods.wipeDevice | Methods.checkFirmwareAuthenticity;
|
|
5
|
+
}) => Methods.applyFlags | Methods.applySettings | Methods.authenticateDevice | Methods.authorizeCoinjoin | Methods.cancelCoinjoinAuthorization | Methods.showDeviceTutorial | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getFirmwareHash | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setBusy | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.unlockPath | Methods.verifyMessage | Methods.wipeDevice | Methods.checkFirmwareAuthenticity;
|
|
6
6
|
//# sourceMappingURL=method.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ConnectSettings } from '../types';
|
|
2
2
|
type AssetCollection = {
|
|
3
3
|
[key: string]: JSON;
|
|
4
4
|
};
|
|
@@ -60,27 +60,43 @@ export declare class DataManager {
|
|
|
60
60
|
supportedFirmware: ({
|
|
61
61
|
coin: string[];
|
|
62
62
|
methods: string[];
|
|
63
|
-
min:
|
|
63
|
+
min: {
|
|
64
|
+
T1B1: string;
|
|
65
|
+
T2T1: string;
|
|
66
|
+
T2B1?: undefined;
|
|
67
|
+
};
|
|
64
68
|
max: undefined;
|
|
65
69
|
comment: string[];
|
|
66
70
|
capabilities?: undefined;
|
|
67
71
|
} | {
|
|
68
72
|
coin: string[];
|
|
69
|
-
min:
|
|
73
|
+
min: {
|
|
74
|
+
T1B1: string;
|
|
75
|
+
T2T1: string;
|
|
76
|
+
T2B1?: undefined;
|
|
77
|
+
};
|
|
70
78
|
comment: string[];
|
|
71
79
|
methods?: undefined;
|
|
72
80
|
max?: undefined;
|
|
73
81
|
capabilities?: undefined;
|
|
74
82
|
} | {
|
|
75
83
|
methods: string[];
|
|
76
|
-
min:
|
|
84
|
+
min: {
|
|
85
|
+
T1B1: string;
|
|
86
|
+
T2T1: string;
|
|
87
|
+
T2B1?: undefined;
|
|
88
|
+
};
|
|
77
89
|
comment: string[];
|
|
78
90
|
coin?: undefined;
|
|
79
91
|
max?: undefined;
|
|
80
92
|
capabilities?: undefined;
|
|
81
93
|
} | {
|
|
82
94
|
capabilities: string[];
|
|
83
|
-
min:
|
|
95
|
+
min: {
|
|
96
|
+
T1B1: string;
|
|
97
|
+
T2T1: string;
|
|
98
|
+
T2B1?: undefined;
|
|
99
|
+
};
|
|
84
100
|
comment: string[];
|
|
85
101
|
coin?: undefined;
|
|
86
102
|
methods?: undefined;
|
|
@@ -88,17 +104,47 @@ export declare class DataManager {
|
|
|
88
104
|
} | {
|
|
89
105
|
coin: string[];
|
|
90
106
|
methods: string[];
|
|
91
|
-
min:
|
|
107
|
+
min: {
|
|
108
|
+
T1B1: string;
|
|
109
|
+
T2T1: string;
|
|
110
|
+
T2B1?: undefined;
|
|
111
|
+
};
|
|
92
112
|
comment: string[];
|
|
93
113
|
max?: undefined;
|
|
94
114
|
capabilities?: undefined;
|
|
95
115
|
} | {
|
|
96
116
|
capabilities: string[];
|
|
97
117
|
methods: string[];
|
|
98
|
-
min:
|
|
118
|
+
min: {
|
|
119
|
+
T1B1: string;
|
|
120
|
+
T2T1: string;
|
|
121
|
+
T2B1?: undefined;
|
|
122
|
+
};
|
|
123
|
+
coin?: undefined;
|
|
124
|
+
max?: undefined;
|
|
125
|
+
comment?: undefined;
|
|
126
|
+
} | {
|
|
127
|
+
methods: string[];
|
|
128
|
+
min: {
|
|
129
|
+
T1B1: string;
|
|
130
|
+
T2T1: string;
|
|
131
|
+
T2B1: string;
|
|
132
|
+
};
|
|
133
|
+
comment: string[];
|
|
134
|
+
coin?: undefined;
|
|
135
|
+
max?: undefined;
|
|
136
|
+
capabilities?: undefined;
|
|
137
|
+
} | {
|
|
138
|
+
methods: string[];
|
|
139
|
+
min: {
|
|
140
|
+
T1B1: string;
|
|
141
|
+
T2T1: string;
|
|
142
|
+
T2B1?: undefined;
|
|
143
|
+
};
|
|
99
144
|
coin?: undefined;
|
|
100
145
|
max?: undefined;
|
|
101
146
|
comment?: undefined;
|
|
147
|
+
capabilities?: undefined;
|
|
102
148
|
})[];
|
|
103
149
|
};
|
|
104
150
|
}
|
package/lib/data/DataManager.js
CHANGED
|
@@ -6,6 +6,7 @@ const coinInfo_1 = require("./coinInfo");
|
|
|
6
6
|
const firmwareInfo_1 = require("./firmwareInfo");
|
|
7
7
|
const transportInfo_1 = require("./transportInfo");
|
|
8
8
|
const config_1 = require("./config");
|
|
9
|
+
const types_1 = require("../types");
|
|
9
10
|
class DataManager {
|
|
10
11
|
static async load(settings, withAssets = true) {
|
|
11
12
|
const ts = settings.env === 'web' ? `?r=${settings.timestamp}` : '';
|
|
@@ -23,8 +24,9 @@ class DataManager {
|
|
|
23
24
|
...this.assets.coins,
|
|
24
25
|
eth: this.assets.coinsEth,
|
|
25
26
|
});
|
|
26
|
-
(0, firmwareInfo_1.parseFirmware)(this.assets['firmware-
|
|
27
|
-
(0, firmwareInfo_1.parseFirmware)(this.assets['firmware-
|
|
27
|
+
(0, firmwareInfo_1.parseFirmware)(this.assets['firmware-t1b1'], types_1.DeviceModelInternal.T1B1);
|
|
28
|
+
(0, firmwareInfo_1.parseFirmware)(this.assets['firmware-t2t1'], types_1.DeviceModelInternal.T2T1);
|
|
29
|
+
(0, firmwareInfo_1.parseFirmware)(this.assets['firmware-t2b1'], types_1.DeviceModelInternal.T2B1);
|
|
28
30
|
}
|
|
29
31
|
static getProtobufMessages() {
|
|
30
32
|
return this.messages;
|
package/lib/data/coinInfo.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CoinInfo, BitcoinNetworkInfo, EthereumNetworkInfo, MiscNetworkInfo } from '../types
|
|
2
|
-
export declare const getBitcoinNetwork: (pathOrName:
|
|
3
|
-
export declare const getEthereumNetwork: (pathOrName:
|
|
4
|
-
export declare const getMiscNetwork: (pathOrName:
|
|
1
|
+
import type { CoinInfo, BitcoinNetworkInfo, EthereumNetworkInfo, MiscNetworkInfo, DerivationPath } from '../types';
|
|
2
|
+
export declare const getBitcoinNetwork: (pathOrName: DerivationPath) => BitcoinNetworkInfo | undefined;
|
|
3
|
+
export declare const getEthereumNetwork: (pathOrName: DerivationPath) => EthereumNetworkInfo | undefined;
|
|
4
|
+
export declare const getMiscNetwork: (pathOrName: DerivationPath) => MiscNetworkInfo | undefined;
|
|
5
5
|
export declare const getSegwitNetwork: (coin: BitcoinNetworkInfo) => {
|
|
6
6
|
bip32: {
|
|
7
7
|
public: number;
|
|
@@ -35,7 +35,7 @@ export declare const ethereumNetworkInfoBase: {
|
|
|
35
35
|
minFee: number;
|
|
36
36
|
maxFee: number;
|
|
37
37
|
dustLimit: number;
|
|
38
|
-
defaultFees: import("
|
|
38
|
+
defaultFees: import("../types").FeeLevel[];
|
|
39
39
|
type: "ethereum";
|
|
40
40
|
decimals: number;
|
|
41
41
|
};
|
package/lib/data/coinInfo.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAllNetworks = exports.getUniqueNetworks = exports.parseCoinsJson = exports.ethereumNetworkInfoBase = exports.getCoinName = exports.getCoinInfo = exports.getCoinInfoByHash = exports.fixCoinInfoNetwork = exports.getBech32Network = exports.getSegwitNetwork = exports.getMiscNetwork = exports.getEthereumNetwork = exports.getBitcoinNetwork = void 0;
|
|
4
|
+
const utils_1 = require("@trezor/utils");
|
|
4
5
|
const defaultFeeLevels_1 = require("./defaultFeeLevels");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
6
7
|
const pathUtils_1 = require("../utils/pathUtils");
|
|
7
|
-
const utils_1 = require("@trezor/utils");
|
|
8
8
|
const bitcoinNetworks = [];
|
|
9
9
|
const ethereumNetworks = [];
|
|
10
10
|
const miscNetworks = [];
|
package/lib/data/config.d.ts
CHANGED
|
@@ -48,27 +48,43 @@ export declare const config: {
|
|
|
48
48
|
supportedFirmware: ({
|
|
49
49
|
coin: string[];
|
|
50
50
|
methods: string[];
|
|
51
|
-
min:
|
|
51
|
+
min: {
|
|
52
|
+
T1B1: string;
|
|
53
|
+
T2T1: string;
|
|
54
|
+
T2B1?: undefined;
|
|
55
|
+
};
|
|
52
56
|
max: undefined;
|
|
53
57
|
comment: string[];
|
|
54
58
|
capabilities?: undefined;
|
|
55
59
|
} | {
|
|
56
60
|
coin: string[];
|
|
57
|
-
min:
|
|
61
|
+
min: {
|
|
62
|
+
T1B1: string;
|
|
63
|
+
T2T1: string;
|
|
64
|
+
T2B1?: undefined;
|
|
65
|
+
};
|
|
58
66
|
comment: string[];
|
|
59
67
|
methods?: undefined;
|
|
60
68
|
max?: undefined;
|
|
61
69
|
capabilities?: undefined;
|
|
62
70
|
} | {
|
|
63
71
|
methods: string[];
|
|
64
|
-
min:
|
|
72
|
+
min: {
|
|
73
|
+
T1B1: string;
|
|
74
|
+
T2T1: string;
|
|
75
|
+
T2B1?: undefined;
|
|
76
|
+
};
|
|
65
77
|
comment: string[];
|
|
66
78
|
coin?: undefined;
|
|
67
79
|
max?: undefined;
|
|
68
80
|
capabilities?: undefined;
|
|
69
81
|
} | {
|
|
70
82
|
capabilities: string[];
|
|
71
|
-
min:
|
|
83
|
+
min: {
|
|
84
|
+
T1B1: string;
|
|
85
|
+
T2T1: string;
|
|
86
|
+
T2B1?: undefined;
|
|
87
|
+
};
|
|
72
88
|
comment: string[];
|
|
73
89
|
coin?: undefined;
|
|
74
90
|
methods?: undefined;
|
|
@@ -76,17 +92,47 @@ export declare const config: {
|
|
|
76
92
|
} | {
|
|
77
93
|
coin: string[];
|
|
78
94
|
methods: string[];
|
|
79
|
-
min:
|
|
95
|
+
min: {
|
|
96
|
+
T1B1: string;
|
|
97
|
+
T2T1: string;
|
|
98
|
+
T2B1?: undefined;
|
|
99
|
+
};
|
|
80
100
|
comment: string[];
|
|
81
101
|
max?: undefined;
|
|
82
102
|
capabilities?: undefined;
|
|
83
103
|
} | {
|
|
84
104
|
capabilities: string[];
|
|
85
105
|
methods: string[];
|
|
86
|
-
min:
|
|
106
|
+
min: {
|
|
107
|
+
T1B1: string;
|
|
108
|
+
T2T1: string;
|
|
109
|
+
T2B1?: undefined;
|
|
110
|
+
};
|
|
111
|
+
coin?: undefined;
|
|
112
|
+
max?: undefined;
|
|
113
|
+
comment?: undefined;
|
|
114
|
+
} | {
|
|
115
|
+
methods: string[];
|
|
116
|
+
min: {
|
|
117
|
+
T1B1: string;
|
|
118
|
+
T2T1: string;
|
|
119
|
+
T2B1: string;
|
|
120
|
+
};
|
|
121
|
+
comment: string[];
|
|
122
|
+
coin?: undefined;
|
|
123
|
+
max?: undefined;
|
|
124
|
+
capabilities?: undefined;
|
|
125
|
+
} | {
|
|
126
|
+
methods: string[];
|
|
127
|
+
min: {
|
|
128
|
+
T1B1: string;
|
|
129
|
+
T2T1: string;
|
|
130
|
+
T2B1?: undefined;
|
|
131
|
+
};
|
|
87
132
|
coin?: undefined;
|
|
88
133
|
max?: undefined;
|
|
89
134
|
comment?: undefined;
|
|
135
|
+
capabilities?: undefined;
|
|
90
136
|
})[];
|
|
91
137
|
};
|
|
92
138
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/data/config.js
CHANGED
|
@@ -21,19 +21,18 @@ exports.config = {
|
|
|
21
21
|
icon: '',
|
|
22
22
|
},
|
|
23
23
|
{ origin: 'niebkpllfhmpfbffbfifagfgoamhpflf', label: 'Trezor Password Manager', icon: '' },
|
|
24
|
-
{ origin: 'trezor-connect@trezor.io', label: 'Trezor Connect FF Extension', icon: '' },
|
|
25
24
|
{
|
|
26
|
-
origin: '
|
|
27
|
-
label: '
|
|
25
|
+
origin: 'mnpfhpndmjholfdlhpkjfmjkgppmodaf',
|
|
26
|
+
label: 'MetaMask',
|
|
28
27
|
icon: '',
|
|
29
28
|
},
|
|
30
29
|
{
|
|
31
|
-
origin: '
|
|
30
|
+
origin: 'webextension@metamask.io',
|
|
32
31
|
label: 'MetaMask',
|
|
33
32
|
icon: '',
|
|
34
33
|
},
|
|
35
34
|
{
|
|
36
|
-
origin: '
|
|
35
|
+
origin: 'nkbihfbeogaeaoehlefnkodbefgpgknn',
|
|
37
36
|
label: 'MetaMask',
|
|
38
37
|
icon: '',
|
|
39
38
|
},
|
|
@@ -56,12 +55,16 @@ exports.config = {
|
|
|
56
55
|
url: './data/bridge/releases.json',
|
|
57
56
|
},
|
|
58
57
|
{
|
|
59
|
-
name: 'firmware-
|
|
60
|
-
url: './data/firmware/
|
|
58
|
+
name: 'firmware-t1b1',
|
|
59
|
+
url: './data/firmware/t1b1/releases.json',
|
|
61
60
|
},
|
|
62
61
|
{
|
|
63
|
-
name: 'firmware-
|
|
64
|
-
url: './data/firmware/
|
|
62
|
+
name: 'firmware-t2t1',
|
|
63
|
+
url: './data/firmware/t2t1/releases.json',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'firmware-t2b1',
|
|
67
|
+
url: './data/firmware/t2b1/releases.json',
|
|
65
68
|
},
|
|
66
69
|
],
|
|
67
70
|
messages: './data/messages/messages.json',
|
|
@@ -91,7 +94,7 @@ exports.config = {
|
|
|
91
94
|
{
|
|
92
95
|
coin: ['xrp', 'txrp'],
|
|
93
96
|
methods: ['getAccountInfo'],
|
|
94
|
-
min:
|
|
97
|
+
min: { T1B1: '0', T2T1: '2.1.0' },
|
|
95
98
|
max: undefined,
|
|
96
99
|
comment: [
|
|
97
100
|
"Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx",
|
|
@@ -99,70 +102,70 @@ exports.config = {
|
|
|
99
102
|
},
|
|
100
103
|
{
|
|
101
104
|
coin: ['bnb'],
|
|
102
|
-
min:
|
|
105
|
+
min: { T1B1: '1.9.0', T2T1: '2.3.0' },
|
|
103
106
|
comment: [
|
|
104
107
|
'There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares',
|
|
105
108
|
],
|
|
106
109
|
},
|
|
107
110
|
{
|
|
108
111
|
coin: ['eth', 'tsep', 'tgor'],
|
|
109
|
-
min:
|
|
112
|
+
min: { T1B1: '1.8.0', T2T1: '2.1.0' },
|
|
110
113
|
comment: ['There were protobuf backwards incompatible changes.'],
|
|
111
114
|
},
|
|
112
115
|
{
|
|
113
116
|
methods: ['rippleGetAddress', 'rippleSignTransaction'],
|
|
114
|
-
min:
|
|
117
|
+
min: { T1B1: '0', T2T1: '2.1.0' },
|
|
115
118
|
comment: [
|
|
116
119
|
"Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx",
|
|
117
120
|
],
|
|
118
121
|
},
|
|
119
122
|
{
|
|
120
123
|
methods: ['cardanoGetAddress', 'cardanoGetPublicKey'],
|
|
121
|
-
min:
|
|
124
|
+
min: { T1B1: '0', T2T1: '2.3.2' },
|
|
122
125
|
comment: ['Shelley fork support since firmware 2.3.2'],
|
|
123
126
|
},
|
|
124
127
|
{
|
|
125
128
|
methods: ['cardanoSignTransaction'],
|
|
126
|
-
min:
|
|
129
|
+
min: { T1B1: '0', T2T1: '2.4.2' },
|
|
127
130
|
comment: ['Non-streamed signing no longer supported'],
|
|
128
131
|
},
|
|
129
132
|
{
|
|
130
133
|
methods: ['cardanoGetNativeScriptHash'],
|
|
131
|
-
min:
|
|
134
|
+
min: { T1B1: '0', T2T1: '2.4.3' },
|
|
132
135
|
comment: ['Cardano GetNativeScriptHash call added in 2.4.3'],
|
|
133
136
|
},
|
|
134
137
|
{
|
|
135
138
|
methods: ['tezosSignTransaction'],
|
|
136
|
-
min:
|
|
139
|
+
min: { T1B1: '0', T2T1: '2.1.8' },
|
|
137
140
|
comment: [
|
|
138
141
|
'Since 2.1.8 there are new protobuf fields in tezos transaction (Babylon fork)',
|
|
139
142
|
],
|
|
140
143
|
},
|
|
141
144
|
{
|
|
142
145
|
methods: ['stellarSignTransaction'],
|
|
143
|
-
min:
|
|
146
|
+
min: { T1B1: '1.9.0', T2T1: '2.3.0' },
|
|
144
147
|
comment: [
|
|
145
148
|
'There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares',
|
|
146
149
|
],
|
|
147
150
|
},
|
|
148
151
|
{
|
|
149
152
|
capabilities: ['replaceTransaction', 'amountUnit'],
|
|
150
|
-
min:
|
|
153
|
+
min: { T1B1: '1.9.4', T2T1: '2.3.5' },
|
|
151
154
|
comment: ['new sign tx process since 1.9.4/2.3.5'],
|
|
152
155
|
},
|
|
153
156
|
{
|
|
154
157
|
capabilities: ['decreaseOutput'],
|
|
155
|
-
min:
|
|
158
|
+
min: { T1B1: '1.10.0', T2T1: '2.4.0' },
|
|
156
159
|
comment: ['allow reduce output in RBF transaction since 1.10.0/2.4.0'],
|
|
157
160
|
},
|
|
158
161
|
{
|
|
159
162
|
capabilities: ['eip1559'],
|
|
160
|
-
min:
|
|
163
|
+
min: { T1B1: '1.10.4', T2T1: '2.4.2' },
|
|
161
164
|
comment: ['new eth transaction pricing mechanism (EIP1559) since 1.10.4/2.4.2'],
|
|
162
165
|
},
|
|
163
166
|
{
|
|
164
167
|
capabilities: ['taproot', 'signMessageNoScriptType'],
|
|
165
|
-
min:
|
|
168
|
+
min: { T1B1: '1.10.4', T2T1: '2.4.3' },
|
|
166
169
|
comment: [
|
|
167
170
|
'new btc accounts taproot since 1.10.4/2.4.3 (BTC + TEST only)',
|
|
168
171
|
'SignMessage with no_script_type support',
|
|
@@ -171,17 +174,17 @@ exports.config = {
|
|
|
171
174
|
{
|
|
172
175
|
coin: ['dcr', 'tdcr'],
|
|
173
176
|
methods: ['signTransaction'],
|
|
174
|
-
min:
|
|
177
|
+
min: { T1B1: '1.10.1', T2T1: '2.4.0' },
|
|
175
178
|
comment: [''],
|
|
176
179
|
},
|
|
177
180
|
{
|
|
178
181
|
methods: ['ethereumSignTypedData'],
|
|
179
|
-
min:
|
|
182
|
+
min: { T1B1: '1.10.5', T2T1: '2.4.3' },
|
|
180
183
|
comment: ['EIP-712 typed signing support added in 1.10.5/2.4.3'],
|
|
181
184
|
},
|
|
182
185
|
{
|
|
183
186
|
capabilities: ['eip712-domain-only'],
|
|
184
|
-
min:
|
|
187
|
+
min: { T1B1: '1.10.6', T2T1: '2.4.4' },
|
|
185
188
|
comment: ['EIP-712 domain-only signing, when primaryType=EIP712Domain'],
|
|
186
189
|
},
|
|
187
190
|
{
|
|
@@ -194,13 +197,21 @@ exports.config = {
|
|
|
194
197
|
'setBusy',
|
|
195
198
|
'unlockPath',
|
|
196
199
|
],
|
|
197
|
-
min:
|
|
200
|
+
min: { T1B1: '1.12.1', T2T1: '2.5.3' },
|
|
198
201
|
},
|
|
199
202
|
{
|
|
200
|
-
methods: ['showDeviceTutorial'],
|
|
201
|
-
min:
|
|
203
|
+
methods: ['showDeviceTutorial', 'authenticateDevice'],
|
|
204
|
+
min: { T1B1: '0', T2T1: '0', T2B1: '2.6.1' },
|
|
202
205
|
comment: ['Only on T2B1'],
|
|
203
206
|
},
|
|
207
|
+
{
|
|
208
|
+
methods: ['rebootToBootloader'],
|
|
209
|
+
min: { T1B1: '1.11.0', T2T1: '2.6.0' },
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
methods: ['getFirmwareHash'],
|
|
213
|
+
min: { T1B1: '1.11.1', T2T1: '2.5.1' },
|
|
214
|
+
},
|
|
204
215
|
],
|
|
205
216
|
};
|
|
206
217
|
//# sourceMappingURL=config.js.map
|
|
@@ -57,6 +57,9 @@ const parseConnectSettings = (input = {}) => {
|
|
|
57
57
|
settings.debug = input.debug === 'true';
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
if (input.trustedHost === false) {
|
|
61
|
+
settings.trustedHost = input.trustedHost;
|
|
62
|
+
}
|
|
60
63
|
if (typeof input.connectSrc === 'string' && ((_a = input.connectSrc) === null || _a === void 0 ? void 0 : _a.startsWith('http'))) {
|
|
61
64
|
settings.connectSrc = (0, exports.corsValidator)(input.connectSrc);
|
|
62
65
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PROTO } from '../constants';
|
|
2
|
+
type CertPubKeys = {
|
|
3
|
+
rootPubKeys: string[];
|
|
4
|
+
caPubKeys: string[];
|
|
5
|
+
};
|
|
6
|
+
type ModelPubKeys = Record<PROTO.DeviceModelInternal.T2B1, CertPubKeys & {
|
|
7
|
+
debug?: CertPubKeys;
|
|
8
|
+
}> & Partial<Record<Exclude<PROTO.DeviceModelInternal, 'T2B1'>, undefined>>;
|
|
9
|
+
export interface DeviceAuthenticityConfig extends ModelPubKeys {
|
|
10
|
+
version: number;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const deviceAuthenticityConfig: DeviceAuthenticityConfig;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=deviceAuthenticityConfig.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deviceAuthenticityConfig = void 0;
|
|
4
|
+
exports.deviceAuthenticityConfig = {
|
|
5
|
+
version: 1,
|
|
6
|
+
timestamp: '2023-10-24T10:00:00+00:00',
|
|
7
|
+
T2B1: {
|
|
8
|
+
rootPubKeys: [
|
|
9
|
+
'04ca97480ac0d7b1e6efafe518cd433cec2bf8ab9822d76eafd34363b55d63e60380bff20acc75cde03cffcb50ab6f8ce70c878e37ebc58ff7cca0a83b16b15fa5',
|
|
10
|
+
],
|
|
11
|
+
caPubKeys: [
|
|
12
|
+
'04b12efa295ad825a534b7c0bf276e93ad116434426763fa87bfa8a2f12e726906dcf566813f62eba8f8795f94dba0391c53682809cbbd7e4ba01d960b4f1c68f1',
|
|
13
|
+
'04cb87d4c5d0fd5854e829f4c1b666e49a86c25c88a904c0feb66f1338faed0d7760010d7ea1a6474cbcfe1143bd4b5397a4e8b7fe86899113caecf42a984b0c0f',
|
|
14
|
+
'0450c45878b2c6403a5a16e97a8957dc3ea36919bce9321b357f6e7ebe6257ee54102a2c2fa5cefed1dabc498fc76dc0bcf3c3a8a415eac7cc32e7c18185f25b0d',
|
|
15
|
+
],
|
|
16
|
+
debug: {
|
|
17
|
+
rootPubKeys: [
|
|
18
|
+
'047f77368dea2d4d61e989f474a56723c3212dacf8a808d8795595ef38441427c4389bc454f02089d7f08b873005e4c28d432468997871c0bf286fd3861e21e96a',
|
|
19
|
+
],
|
|
20
|
+
caPubKeys: [
|
|
21
|
+
'04ba6084cb9fba7c86d5d5a86108a91d55a27056da4eabbedde88a95e1cae8bce3620889167aaf7f2db166998f950984aa195e868f96e22803c3cd991be31d39e7',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=deviceAuthenticityConfig.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Features, FirmwareRelease, ReleaseInfo } from '../types';
|
|
2
|
-
|
|
2
|
+
import { DeviceModelInternal } from '../types';
|
|
3
|
+
export declare const parseFirmware: (json: any, deviceModel: DeviceModelInternal) => void;
|
|
3
4
|
export interface GetInfoProps {
|
|
4
5
|
features: Features;
|
|
5
6
|
releases: FirmwareRelease[];
|
|
@@ -7,5 +8,5 @@ export interface GetInfoProps {
|
|
|
7
8
|
export declare const getInfo: ({ features, releases }: GetInfoProps) => ReleaseInfo | null;
|
|
8
9
|
export declare const getFirmwareStatus: (features: Features) => "valid" | "outdated" | "required" | "unknown" | "none";
|
|
9
10
|
export declare const getRelease: (features: Features) => ReleaseInfo | null;
|
|
10
|
-
export declare const getReleases: (
|
|
11
|
+
export declare const getReleases: (deviceModel: DeviceModelInternal) => FirmwareRelease[];
|
|
11
12
|
//# sourceMappingURL=firmwareInfo.d.ts.map
|
package/lib/data/firmwareInfo.js
CHANGED
|
@@ -3,14 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getReleases = exports.getRelease = exports.getFirmwareStatus = exports.getInfo = exports.parseFirmware = void 0;
|
|
4
4
|
const utils_1 = require("@trezor/utils");
|
|
5
5
|
const firmwareUtils_1 = require("../utils/firmwareUtils");
|
|
6
|
-
const
|
|
7
|
-
const releases = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const releases = {
|
|
8
|
+
[types_1.DeviceModelInternal.T1B1]: [],
|
|
9
|
+
[types_1.DeviceModelInternal.T2T1]: [],
|
|
10
|
+
[types_1.DeviceModelInternal.T2B1]: [],
|
|
11
|
+
};
|
|
12
|
+
const parseFirmware = (json, deviceModel) => {
|
|
11
13
|
Object.keys(json).forEach(key => {
|
|
12
14
|
const release = json[key];
|
|
13
|
-
releases[
|
|
15
|
+
releases[deviceModel].push({
|
|
14
16
|
...release,
|
|
15
17
|
});
|
|
16
18
|
});
|
|
@@ -77,12 +79,12 @@ const getIntermediaryVersion = (releases, features, offerLatest) => {
|
|
|
77
79
|
const getSafeReleases = ({ features, releases }) => {
|
|
78
80
|
const { bootloader_mode, major_version, minor_version, patch_version, fw_major, fw_minor, fw_patch, } = features;
|
|
79
81
|
const firmwareVersion = [major_version, minor_version, patch_version];
|
|
80
|
-
if (!
|
|
82
|
+
if (!utils_1.versionUtils.isVersionArray(firmwareVersion)) {
|
|
81
83
|
return [];
|
|
82
84
|
}
|
|
83
85
|
if (major_version === 2 && bootloader_mode) {
|
|
84
86
|
const fwVersion = [fw_major, fw_minor, fw_patch];
|
|
85
|
-
if (
|
|
87
|
+
if (utils_1.versionUtils.isVersionArray(fwVersion)) {
|
|
86
88
|
return (0, firmwareUtils_1.filterSafeListByFirmware)(releases, fwVersion);
|
|
87
89
|
}
|
|
88
90
|
return (0, firmwareUtils_1.filterSafeListByBootloader)(releases, firmwareVersion);
|
|
@@ -124,7 +126,10 @@ const getFirmwareStatus = (features) => {
|
|
|
124
126
|
if (features.major_version === 1 && features.bootloader_mode) {
|
|
125
127
|
return 'unknown';
|
|
126
128
|
}
|
|
127
|
-
const info = (0, exports.getInfo)({
|
|
129
|
+
const info = (0, exports.getInfo)({
|
|
130
|
+
features,
|
|
131
|
+
releases: releases[features === null || features === void 0 ? void 0 : features.internal_model],
|
|
132
|
+
});
|
|
128
133
|
if (!info)
|
|
129
134
|
return 'unknown';
|
|
130
135
|
if (info.isRequired)
|
|
@@ -134,8 +139,11 @@ const getFirmwareStatus = (features) => {
|
|
|
134
139
|
return 'valid';
|
|
135
140
|
};
|
|
136
141
|
exports.getFirmwareStatus = getFirmwareStatus;
|
|
137
|
-
const getRelease = (features) => (0, exports.getInfo)({
|
|
142
|
+
const getRelease = (features) => (0, exports.getInfo)({
|
|
143
|
+
features,
|
|
144
|
+
releases: releases[features === null || features === void 0 ? void 0 : features.internal_model],
|
|
145
|
+
});
|
|
138
146
|
exports.getRelease = getRelease;
|
|
139
|
-
const getReleases = (
|
|
147
|
+
const getReleases = (deviceModel) => releases[deviceModel];
|
|
140
148
|
exports.getReleases = getReleases;
|
|
141
149
|
//# sourceMappingURL=firmwareInfo.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const models: {
|
|
2
|
+
T1B1: {
|
|
3
|
+
name: string;
|
|
4
|
+
colors: {};
|
|
5
|
+
};
|
|
6
|
+
T2T1: {
|
|
7
|
+
name: string;
|
|
8
|
+
colors: {};
|
|
9
|
+
};
|
|
10
|
+
T2B1: {
|
|
11
|
+
name: string;
|
|
12
|
+
colors: {
|
|
13
|
+
'1': string;
|
|
14
|
+
'2': string;
|
|
15
|
+
'3': string;
|
|
16
|
+
'4': string;
|
|
17
|
+
'5': string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.models = void 0;
|
|
4
|
+
exports.models = {
|
|
5
|
+
T1B1: {
|
|
6
|
+
name: 'Trezor Model One',
|
|
7
|
+
colors: {},
|
|
8
|
+
},
|
|
9
|
+
T2T1: {
|
|
10
|
+
name: 'Trezor Model T',
|
|
11
|
+
colors: {},
|
|
12
|
+
},
|
|
13
|
+
T2B1: {
|
|
14
|
+
name: 'Trezor Safe 3',
|
|
15
|
+
colors: {
|
|
16
|
+
'1': 'Cosmic Black',
|
|
17
|
+
'2': 'Stellar Silver',
|
|
18
|
+
'3': 'Solar Gold',
|
|
19
|
+
'4': 'Galactic Rose',
|
|
20
|
+
'5': 'Bitcoin Orange',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=models.js.map
|
package/lib/data/version.d.ts
CHANGED
package/lib/data/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '9.1.
|
|
4
|
+
exports.VERSION = '9.1.5';
|
|
5
5
|
const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
|
|
6
6
|
exports.DEFAULT_DOMAIN = `https://connect.trezor.io/${versionN[0]}/`;
|
|
7
7
|
//# sourceMappingURL=version.js.map
|