@trezor/connect 9.1.4 → 9.1.6
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 +50 -0
- package/README.md +1 -1
- package/lib/api/authenticateDevice.d.ts +7 -0
- package/lib/api/authenticateDevice.js +51 -0
- package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +3 -3
- package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +6 -6
- package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
- package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
- package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +2 -2
- package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +5 -5
- package/lib/api/binance/api/index.d.ts +4 -0
- package/lib/api/binance/api/index.js +13 -0
- package/lib/api/bitcoin/TransactionComposer.d.ts +4 -4
- package/lib/api/bitcoin/TransactionComposer.js +4 -18
- package/lib/api/bitcoin/inputs.d.ts +2 -2
- package/lib/api/bitcoin/inputs.js +4 -5
- package/lib/api/bitcoin/outputs.d.ts +4 -4
- package/lib/api/bitcoin/outputs.js +14 -23
- package/lib/api/blockchainEstimateFee.d.ts +2 -2
- package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
- package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
- package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +3 -3
- package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +7 -7
- package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
- package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
- package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
- package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
- package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +18 -8
- package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +30 -13
- package/lib/api/cardano/api/index.d.ts +6 -0
- package/lib/api/cardano/api/index.js +17 -0
- package/lib/api/cardano/cardanoUtils.d.ts +6 -0
- package/lib/api/cardano/cardanoUtils.js +64 -1
- package/lib/api/checkFirmwareAuthenticity.js +7 -5
- package/lib/api/common/paramsValidator.js +45 -51
- package/lib/api/composeTransaction.d.ts +5 -5
- package/lib/api/composeTransaction.js +14 -19
- package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
- package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +5 -5
- package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +2 -2
- package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +5 -5
- package/lib/api/eos/api/index.d.ts +3 -0
- package/lib/api/eos/api/index.js +11 -0
- package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +4 -4
- package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +9 -9
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
- package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
- package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
- package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
- package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +11 -9
- package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +36 -43
- package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
- package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
- package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
- package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
- package/lib/api/ethereum/api/index.d.ts +7 -0
- package/lib/api/ethereum/api/index.js +19 -0
- package/lib/api/ethereum/ethereumDefinitions.js +3 -2
- package/lib/api/ethereum/ethereumSignTx.d.ts +2 -0
- package/lib/api/ethereum/ethereumSignTx.js +15 -1
- 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 +74 -0
- package/lib/api/firmware/x509certificate.js +235 -0
- package/lib/api/firmwareUpdate.js +2 -1
- package/lib/api/getAccountDescriptor.d.ts +20 -0
- package/lib/api/getAccountDescriptor.js +162 -0
- package/lib/api/getAccountInfo.d.ts +2 -0
- package/lib/api/getAccountInfo.js +1 -5
- package/lib/api/getFirmwareHash.js +1 -4
- package/lib/api/index.d.ts +2 -24
- package/lib/api/index.js +5 -50
- package/lib/api/nem/api/index.d.ts +3 -0
- package/lib/api/nem/api/index.js +11 -0
- package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +3 -3
- package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +6 -6
- package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
- package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +5 -5
- package/lib/api/rebootToBootloader.js +1 -4
- package/lib/api/ripple/api/index.d.ts +3 -0
- package/lib/api/ripple/api/index.js +11 -0
- package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +3 -3
- package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +6 -6
- package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
- package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +4 -4
- package/lib/api/solana/api/index.d.ts +4 -0
- package/lib/api/solana/api/index.js +13 -0
- package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
- package/lib/api/solana/api/solanaGetAddress.js +131 -0
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
- package/lib/api/solana/api/solanaGetPublicKey.js +84 -0
- package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
- package/lib/api/solana/api/solanaSignTransaction.js +33 -0
- package/lib/api/stellar/api/index.d.ts +3 -0
- package/lib/api/stellar/api/index.js +11 -0
- package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +3 -3
- package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +6 -6
- package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
- package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
- package/lib/api/tezos/api/index.d.ts +4 -0
- package/lib/api/tezos/api/index.js +13 -0
- package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +3 -3
- package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +6 -6
- package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
- package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +5 -5
- package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
- package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
- package/lib/backend/Blockchain.js +2 -0
- package/lib/constants/cardano.js +2 -2
- package/lib/constants/nem.js +3 -3
- package/lib/constants/network.d.ts +3 -0
- package/lib/constants/network.js +13 -1
- package/lib/core/AbstractMethod.d.ts +1 -0
- package/lib/core/AbstractMethod.js +11 -10
- package/lib/core/index.d.ts +5 -2
- package/lib/core/index.js +28 -7
- package/lib/core/method.d.ts +2 -2
- package/lib/core/method.js +8 -2
- package/lib/core/method.native.d.ts +5 -0
- package/lib/core/method.native.js +34 -0
- package/lib/data/DataManager.d.ts +64 -7
- package/lib/data/DataManager.js +4 -2
- package/lib/data/config.d.ts +63 -6
- package/lib/data/config.js +39 -23
- package/lib/data/connectSettings.js +7 -0
- package/lib/data/defaultFeeLevels.js +8 -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 +17 -8
- package/lib/data/models.d.ts +4 -1
- package/lib/data/models.js +6 -3
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +2 -2
- package/lib/device/Device.js +22 -13
- package/lib/device/DeviceCommands.js +9 -0
- package/lib/device/DeviceList.d.ts +1 -0
- package/lib/device/DeviceList.js +8 -4
- package/lib/events/iframe.d.ts +7 -1
- package/lib/events/iframe.js +1 -0
- package/lib/events/popup.d.ts +19 -3
- package/lib/events/popup.js +3 -0
- package/lib/factory.js +6 -0
- package/lib/types/api/authenticateDevice.d.ts +21 -0
- package/lib/types/api/authenticateDevice.js +3 -0
- package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
- package/lib/types/api/cardanoComposeTransaction.js +3 -0
- package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
- package/lib/types/api/composeTransaction.d.ts +28 -54
- package/lib/types/api/ethereum/index.d.ts +1 -0
- package/lib/types/api/getAccountDescriptor.d.ts +16 -0
- package/lib/types/api/getAccountDescriptor.js +3 -0
- package/lib/types/api/index.d.ts +12 -0
- package/lib/types/api/solana/index.d.ts +12 -0
- package/lib/types/api/solana/index.js +3 -0
- package/lib/types/api/solanaGetAddress.d.ts +4 -0
- package/lib/types/api/solanaGetAddress.js +3 -0
- package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
- package/lib/types/api/solanaGetPublicKey.js +3 -0
- package/lib/types/api/solanaSignTransaction.d.ts +4 -0
- package/lib/types/api/solanaSignTransaction.js +3 -0
- package/lib/types/coinInfo.d.ts +5 -15
- package/lib/types/device.js +1 -1
- package/lib/types/firmware.d.ts +6 -2
- package/lib/types/index.d.ts +4 -1
- package/lib/types/index.js +1 -0
- package/lib/types/settings.d.ts +1 -0
- package/lib/utils/assetUtils.js +6 -4
- package/lib/utils/debug.d.ts +10 -5
- package/lib/utils/debug.js +55 -17
- package/lib/utils/deviceFeaturesUtils.js +5 -3
- package/lib/utils/formatUtils.d.ts +2 -0
- package/lib/utils/formatUtils.js +19 -1
- package/lib/workers/workers-browser.d.ts +2 -1
- package/lib/workers/workers-browser.js +3 -1
- package/lib/workers/workers-react-native.d.ts +2 -1
- package/lib/workers/workers-react-native.js +3 -1
- package/lib/workers/workers.d.ts +8 -5
- package/lib/workers/workers.js +34 -10
- package/package.json +25 -18
- package/lib/api/eosGetPublicKey.d.ts +0 -11
- package/lib/api/ethereumGetPublicKey.d.ts +0 -16
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,58 @@ 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
|
+
};
|
|
87
111
|
coin?: undefined;
|
|
88
112
|
max?: undefined;
|
|
89
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
|
+
};
|
|
132
|
+
coin?: undefined;
|
|
133
|
+
max?: undefined;
|
|
134
|
+
comment?: undefined;
|
|
135
|
+
capabilities?: undefined;
|
|
136
|
+
} | {
|
|
137
|
+
methods: string[];
|
|
138
|
+
min: {
|
|
139
|
+
T1B1: string;
|
|
140
|
+
T2T1: string;
|
|
141
|
+
T2B1: string;
|
|
142
|
+
};
|
|
143
|
+
coin?: undefined;
|
|
144
|
+
max?: undefined;
|
|
145
|
+
comment?: undefined;
|
|
146
|
+
capabilities?: undefined;
|
|
90
147
|
})[];
|
|
91
148
|
};
|
|
92
149
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/data/config.js
CHANGED
|
@@ -55,12 +55,16 @@ exports.config = {
|
|
|
55
55
|
url: './data/bridge/releases.json',
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
name: 'firmware-
|
|
59
|
-
url: './data/firmware/
|
|
58
|
+
name: 'firmware-t1b1',
|
|
59
|
+
url: './data/firmware/t1b1/releases.json',
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
|
-
name: 'firmware-
|
|
63
|
-
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',
|
|
64
68
|
},
|
|
65
69
|
],
|
|
66
70
|
messages: './data/messages/messages.json',
|
|
@@ -90,7 +94,7 @@ exports.config = {
|
|
|
90
94
|
{
|
|
91
95
|
coin: ['xrp', 'txrp'],
|
|
92
96
|
methods: ['getAccountInfo'],
|
|
93
|
-
min:
|
|
97
|
+
min: { T1B1: '0', T2T1: '2.1.0' },
|
|
94
98
|
max: undefined,
|
|
95
99
|
comment: [
|
|
96
100
|
"Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx",
|
|
@@ -98,70 +102,70 @@ exports.config = {
|
|
|
98
102
|
},
|
|
99
103
|
{
|
|
100
104
|
coin: ['bnb'],
|
|
101
|
-
min:
|
|
105
|
+
min: { T1B1: '1.9.0', T2T1: '2.3.0' },
|
|
102
106
|
comment: [
|
|
103
107
|
'There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares',
|
|
104
108
|
],
|
|
105
109
|
},
|
|
106
110
|
{
|
|
107
111
|
coin: ['eth', 'tsep', 'tgor'],
|
|
108
|
-
min:
|
|
112
|
+
min: { T1B1: '1.8.0', T2T1: '2.1.0' },
|
|
109
113
|
comment: ['There were protobuf backwards incompatible changes.'],
|
|
110
114
|
},
|
|
111
115
|
{
|
|
112
116
|
methods: ['rippleGetAddress', 'rippleSignTransaction'],
|
|
113
|
-
min:
|
|
117
|
+
min: { T1B1: '0', T2T1: '2.1.0' },
|
|
114
118
|
comment: [
|
|
115
119
|
"Since firmware 2.1.0 there is a new protobuf field 'destination_tag' in RippleSignTx",
|
|
116
120
|
],
|
|
117
121
|
},
|
|
118
122
|
{
|
|
119
123
|
methods: ['cardanoGetAddress', 'cardanoGetPublicKey'],
|
|
120
|
-
min:
|
|
124
|
+
min: { T1B1: '0', T2T1: '2.3.2' },
|
|
121
125
|
comment: ['Shelley fork support since firmware 2.3.2'],
|
|
122
126
|
},
|
|
123
127
|
{
|
|
124
128
|
methods: ['cardanoSignTransaction'],
|
|
125
|
-
min:
|
|
129
|
+
min: { T1B1: '0', T2T1: '2.4.2' },
|
|
126
130
|
comment: ['Non-streamed signing no longer supported'],
|
|
127
131
|
},
|
|
128
132
|
{
|
|
129
133
|
methods: ['cardanoGetNativeScriptHash'],
|
|
130
|
-
min:
|
|
134
|
+
min: { T1B1: '0', T2T1: '2.4.3' },
|
|
131
135
|
comment: ['Cardano GetNativeScriptHash call added in 2.4.3'],
|
|
132
136
|
},
|
|
133
137
|
{
|
|
134
138
|
methods: ['tezosSignTransaction'],
|
|
135
|
-
min:
|
|
139
|
+
min: { T1B1: '0', T2T1: '2.1.8' },
|
|
136
140
|
comment: [
|
|
137
141
|
'Since 2.1.8 there are new protobuf fields in tezos transaction (Babylon fork)',
|
|
138
142
|
],
|
|
139
143
|
},
|
|
140
144
|
{
|
|
141
145
|
methods: ['stellarSignTransaction'],
|
|
142
|
-
min:
|
|
146
|
+
min: { T1B1: '1.9.0', T2T1: '2.3.0' },
|
|
143
147
|
comment: [
|
|
144
148
|
'There were protobuf backwards incompatible changes with introduction of 1.9.0/2.3.0 firmwares',
|
|
145
149
|
],
|
|
146
150
|
},
|
|
147
151
|
{
|
|
148
152
|
capabilities: ['replaceTransaction', 'amountUnit'],
|
|
149
|
-
min:
|
|
153
|
+
min: { T1B1: '1.9.4', T2T1: '2.3.5' },
|
|
150
154
|
comment: ['new sign tx process since 1.9.4/2.3.5'],
|
|
151
155
|
},
|
|
152
156
|
{
|
|
153
157
|
capabilities: ['decreaseOutput'],
|
|
154
|
-
min:
|
|
158
|
+
min: { T1B1: '1.10.0', T2T1: '2.4.0' },
|
|
155
159
|
comment: ['allow reduce output in RBF transaction since 1.10.0/2.4.0'],
|
|
156
160
|
},
|
|
157
161
|
{
|
|
158
162
|
capabilities: ['eip1559'],
|
|
159
|
-
min:
|
|
163
|
+
min: { T1B1: '1.10.4', T2T1: '2.4.2' },
|
|
160
164
|
comment: ['new eth transaction pricing mechanism (EIP1559) since 1.10.4/2.4.2'],
|
|
161
165
|
},
|
|
162
166
|
{
|
|
163
167
|
capabilities: ['taproot', 'signMessageNoScriptType'],
|
|
164
|
-
min:
|
|
168
|
+
min: { T1B1: '1.10.4', T2T1: '2.4.3' },
|
|
165
169
|
comment: [
|
|
166
170
|
'new btc accounts taproot since 1.10.4/2.4.3 (BTC + TEST only)',
|
|
167
171
|
'SignMessage with no_script_type support',
|
|
@@ -170,17 +174,17 @@ exports.config = {
|
|
|
170
174
|
{
|
|
171
175
|
coin: ['dcr', 'tdcr'],
|
|
172
176
|
methods: ['signTransaction'],
|
|
173
|
-
min:
|
|
177
|
+
min: { T1B1: '1.10.1', T2T1: '2.4.0' },
|
|
174
178
|
comment: [''],
|
|
175
179
|
},
|
|
176
180
|
{
|
|
177
181
|
methods: ['ethereumSignTypedData'],
|
|
178
|
-
min:
|
|
182
|
+
min: { T1B1: '1.10.5', T2T1: '2.4.3' },
|
|
179
183
|
comment: ['EIP-712 typed signing support added in 1.10.5/2.4.3'],
|
|
180
184
|
},
|
|
181
185
|
{
|
|
182
186
|
capabilities: ['eip712-domain-only'],
|
|
183
|
-
min:
|
|
187
|
+
min: { T1B1: '1.10.6', T2T1: '2.4.4' },
|
|
184
188
|
comment: ['EIP-712 domain-only signing, when primaryType=EIP712Domain'],
|
|
185
189
|
},
|
|
186
190
|
{
|
|
@@ -193,13 +197,25 @@ exports.config = {
|
|
|
193
197
|
'setBusy',
|
|
194
198
|
'unlockPath',
|
|
195
199
|
],
|
|
196
|
-
min:
|
|
200
|
+
min: { T1B1: '1.12.1', T2T1: '2.5.3' },
|
|
197
201
|
},
|
|
198
202
|
{
|
|
199
|
-
methods: ['showDeviceTutorial'],
|
|
200
|
-
min:
|
|
203
|
+
methods: ['showDeviceTutorial', 'authenticateDevice'],
|
|
204
|
+
min: { T1B1: '0', T2T1: '0', T2B1: '2.6.1' },
|
|
201
205
|
comment: ['Only on T2B1'],
|
|
202
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
|
+
},
|
|
215
|
+
{
|
|
216
|
+
methods: ['solanaGetPublicKey', 'solanaGetAddress', 'solanaSignTransaction'],
|
|
217
|
+
min: { T1B1: '0', T2T1: '2.7.0', T2B1: '2.7.0' },
|
|
218
|
+
},
|
|
203
219
|
],
|
|
204
220
|
};
|
|
205
221
|
//# sourceMappingURL=config.js.map
|
|
@@ -20,6 +20,7 @@ const initialSettings = {
|
|
|
20
20
|
lazyLoad: false,
|
|
21
21
|
timestamp: new Date().getTime(),
|
|
22
22
|
interactionTimeout: 600,
|
|
23
|
+
sharedLogger: true,
|
|
23
24
|
};
|
|
24
25
|
const parseManifest = (manifest) => {
|
|
25
26
|
if (!manifest)
|
|
@@ -57,6 +58,9 @@ const parseConnectSettings = (input = {}) => {
|
|
|
57
58
|
settings.debug = input.debug === 'true';
|
|
58
59
|
}
|
|
59
60
|
}
|
|
61
|
+
if (input.trustedHost === false) {
|
|
62
|
+
settings.trustedHost = input.trustedHost;
|
|
63
|
+
}
|
|
60
64
|
if (typeof input.connectSrc === 'string' && ((_a = input.connectSrc) === null || _a === void 0 ? void 0 : _a.startsWith('http'))) {
|
|
61
65
|
settings.connectSrc = (0, exports.corsValidator)(input.connectSrc);
|
|
62
66
|
}
|
|
@@ -100,6 +104,9 @@ const parseConnectSettings = (input = {}) => {
|
|
|
100
104
|
if (typeof input.manifest === 'object') {
|
|
101
105
|
settings.manifest = parseManifest(input.manifest);
|
|
102
106
|
}
|
|
107
|
+
if (typeof input.sharedLogger === 'boolean') {
|
|
108
|
+
settings.sharedLogger = input.sharedLogger;
|
|
109
|
+
}
|
|
103
110
|
return settings;
|
|
104
111
|
};
|
|
105
112
|
exports.parseConnectSettings = parseConnectSettings;
|
|
@@ -64,11 +64,19 @@ const CARDANO_FEE_INFO = {
|
|
|
64
64
|
maxFee: 16384 * 44 + 155381,
|
|
65
65
|
dustLimit: -1,
|
|
66
66
|
};
|
|
67
|
+
const SOLANA_FEE_INFO = {
|
|
68
|
+
blockTime: -1,
|
|
69
|
+
defaultFees: [{ label: 'normal', feePerUnit: '5000', blocks: -1 }],
|
|
70
|
+
minFee: -1,
|
|
71
|
+
maxFee: -1,
|
|
72
|
+
dustLimit: -1,
|
|
73
|
+
};
|
|
67
74
|
const MISC_FEE_LEVELS = {
|
|
68
75
|
xrp: RIPPLE_FEE_INFO,
|
|
69
76
|
txrp: RIPPLE_FEE_INFO,
|
|
70
77
|
ada: CARDANO_FEE_INFO,
|
|
71
78
|
tada: CARDANO_FEE_INFO,
|
|
79
|
+
sol: SOLANA_FEE_INFO,
|
|
72
80
|
};
|
|
73
81
|
const getMiscFeeLevels = (data) => {
|
|
74
82
|
const shortcut = data.shortcut.toLowerCase();
|
|
@@ -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,13 +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
|
-
releases
|
|
8
|
-
|
|
9
|
-
|
|
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) => {
|
|
10
13
|
Object.keys(json).forEach(key => {
|
|
11
14
|
const release = json[key];
|
|
12
|
-
releases[
|
|
15
|
+
releases[deviceModel].push({
|
|
13
16
|
...release,
|
|
14
17
|
});
|
|
15
18
|
});
|
|
@@ -123,7 +126,10 @@ const getFirmwareStatus = (features) => {
|
|
|
123
126
|
if (features.major_version === 1 && features.bootloader_mode) {
|
|
124
127
|
return 'unknown';
|
|
125
128
|
}
|
|
126
|
-
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
|
+
});
|
|
127
133
|
if (!info)
|
|
128
134
|
return 'unknown';
|
|
129
135
|
if (info.isRequired)
|
|
@@ -133,8 +139,11 @@ const getFirmwareStatus = (features) => {
|
|
|
133
139
|
return 'valid';
|
|
134
140
|
};
|
|
135
141
|
exports.getFirmwareStatus = getFirmwareStatus;
|
|
136
|
-
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
|
+
});
|
|
137
146
|
exports.getRelease = getRelease;
|
|
138
|
-
const getReleases = (
|
|
147
|
+
const getReleases = (deviceModel) => releases[deviceModel];
|
|
139
148
|
exports.getReleases = getReleases;
|
|
140
149
|
//# sourceMappingURL=firmwareInfo.js.map
|
package/lib/data/models.d.ts
CHANGED
package/lib/data/models.js
CHANGED
|
@@ -11,10 +11,13 @@ exports.models = {
|
|
|
11
11
|
colors: {},
|
|
12
12
|
},
|
|
13
13
|
T2B1: {
|
|
14
|
-
name: 'Trezor
|
|
14
|
+
name: 'Trezor Safe 3',
|
|
15
15
|
colors: {
|
|
16
|
-
'
|
|
17
|
-
'
|
|
16
|
+
'1': 'Cosmic Black',
|
|
17
|
+
'2': 'Stellar Silver',
|
|
18
|
+
'3': 'Solar Gold',
|
|
19
|
+
'4': 'Galactic Rose',
|
|
20
|
+
'5': 'Bitcoin Orange',
|
|
18
21
|
},
|
|
19
22
|
},
|
|
20
23
|
};
|
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.6';
|
|
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
|
package/lib/device/Device.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
76
76
|
isInitialized(): boolean;
|
|
77
77
|
isSeedless(): boolean;
|
|
78
78
|
isInconsistent(): boolean;
|
|
79
|
-
getVersion():
|
|
79
|
+
getVersion(): never[] | [number, number, number];
|
|
80
80
|
atLeast(versions: string[] | string): boolean;
|
|
81
81
|
isUsed(): boolean;
|
|
82
82
|
isUsedHere(): boolean;
|
|
@@ -90,7 +90,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
90
90
|
dispose(): import("packages/transport/lib/types").AbortableCall<void, "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" | "session not found"> | undefined;
|
|
91
91
|
getMode(): "normal" | "bootloader" | "initialize" | "seedless";
|
|
92
92
|
toMessageObject(): DeviceTyped;
|
|
93
|
-
_getNetworkTypeState(): "
|
|
93
|
+
_getNetworkTypeState(): "binance" | "cardano" | "eos" | "ethereum" | "nem" | "ripple" | "solana" | "stellar" | "tezos" | "bitcoin";
|
|
94
94
|
_setNetworkTypeState(networkType?: NETWORK.NetworkType): void;
|
|
95
95
|
_altModeChange(networkType?: NETWORK.NetworkType): boolean;
|
|
96
96
|
_isAltModeNetworkType(networkType?: keyof typeof NETWORK.TYPES): boolean;
|
package/lib/device/Device.js
CHANGED
|
@@ -117,7 +117,10 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
117
117
|
options = parseRunOptions(options);
|
|
118
118
|
const runPromise = (0, utils_1.createDeferred)();
|
|
119
119
|
this.runPromise = runPromise;
|
|
120
|
-
|
|
120
|
+
this._runInner(fn, options).catch(err => {
|
|
121
|
+
runPromise.reject(err);
|
|
122
|
+
});
|
|
123
|
+
return runPromise.promise;
|
|
121
124
|
}
|
|
122
125
|
async override(error) {
|
|
123
126
|
if (this.acquirePromise) {
|
|
@@ -303,16 +306,6 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
303
306
|
var _a;
|
|
304
307
|
const capabilities = (0, deviceFeaturesUtils_1.parseCapabilities)(feat);
|
|
305
308
|
feat.capabilities = capabilities;
|
|
306
|
-
const version = [feat.major_version, feat.minor_version, feat.patch_version];
|
|
307
|
-
const capabilitiesDidChange = this.features &&
|
|
308
|
-
this.features.capabilities &&
|
|
309
|
-
this.features.capabilities.join('') !== capabilities.join('');
|
|
310
|
-
if (!utils_1.versionUtils.isEqual(version.join('.'), this.getVersion().join('.')) ||
|
|
311
|
-
capabilitiesDidChange) {
|
|
312
|
-
this.unavailableCapabilities = (0, deviceFeaturesUtils_1.getUnavailableCapabilities)(feat, (0, coinInfo_1.getAllNetworks)());
|
|
313
|
-
this.firmwareStatus = (0, firmwareInfo_1.getFirmwareStatus)(feat);
|
|
314
|
-
this.firmwareRelease = (0, firmwareInfo_1.getRelease)(feat);
|
|
315
|
-
}
|
|
316
309
|
if (this.features && this.features.session_id && !feat.session_id) {
|
|
317
310
|
feat.session_id = this.features.session_id;
|
|
318
311
|
}
|
|
@@ -325,9 +318,25 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
325
318
|
if (!feat.internal_model) {
|
|
326
319
|
feat.internal_model = (0, deviceFeaturesUtils_1.ensureInternalModelFeature)(feat.model);
|
|
327
320
|
}
|
|
321
|
+
const version = [
|
|
322
|
+
feat.major_version,
|
|
323
|
+
feat.minor_version,
|
|
324
|
+
feat.patch_version,
|
|
325
|
+
];
|
|
326
|
+
if (!utils_1.versionUtils.isEqual(version, this.getVersion())) {
|
|
327
|
+
this.unavailableCapabilities = (0, deviceFeaturesUtils_1.getUnavailableCapabilities)(feat, (0, coinInfo_1.getAllNetworks)());
|
|
328
|
+
this.firmwareStatus = (0, firmwareInfo_1.getFirmwareStatus)(feat);
|
|
329
|
+
this.firmwareRelease = (0, firmwareInfo_1.getRelease)(feat);
|
|
330
|
+
}
|
|
328
331
|
this.features = feat;
|
|
329
332
|
this.featuresNeedsReload = false;
|
|
330
|
-
if (
|
|
333
|
+
if (feat.fw_vendor === 'Trezor Bitcoin-only') {
|
|
334
|
+
this.firmwareType = types_1.FirmwareType.BitcoinOnly;
|
|
335
|
+
}
|
|
336
|
+
else if (feat.fw_vendor === 'Trezor') {
|
|
337
|
+
this.firmwareType = types_1.FirmwareType.Regular;
|
|
338
|
+
}
|
|
339
|
+
else if (this.getMode() !== 'bootloader') {
|
|
331
340
|
this.firmwareType =
|
|
332
341
|
feat.capabilities &&
|
|
333
342
|
feat.capabilities.length > 0 &&
|
|
@@ -340,7 +349,7 @@ class Device extends typedEventEmitter_1.TypedEmitter {
|
|
|
340
349
|
if (feat === null || feat === void 0 ? void 0 : feat.unit_color) {
|
|
341
350
|
const deviceUnitColor = feat.unit_color.toString();
|
|
342
351
|
if (deviceUnitColor in deviceInfo.colors) {
|
|
343
|
-
this.color = deviceInfo.colors[deviceUnitColor]
|
|
352
|
+
this.color = deviceInfo.colors[deviceUnitColor];
|
|
344
353
|
}
|
|
345
354
|
}
|
|
346
355
|
}
|
|
@@ -474,6 +474,15 @@ class DeviceCommands {
|
|
|
474
474
|
address_n,
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
|
+
if (coinInfo.shortcut === 'SOL' || coinInfo.shortcut === 'DSOL') {
|
|
478
|
+
const { message } = await this.typedCall('SolanaGetAddress', 'SolanaAddress', {
|
|
479
|
+
address_n,
|
|
480
|
+
});
|
|
481
|
+
return {
|
|
482
|
+
descriptor: message.address,
|
|
483
|
+
address_n,
|
|
484
|
+
};
|
|
485
|
+
}
|
|
477
486
|
throw constants_1.ERRORS.TypedError('Runtime', 'DeviceCommands.getAccountDescriptor: unsupported coinInfo.type');
|
|
478
487
|
}
|
|
479
488
|
async cancel() {
|
|
@@ -27,6 +27,7 @@ export declare class DeviceList extends TypedEmitter<DeviceListEvents> {
|
|
|
27
27
|
penalizedDevices: {
|
|
28
28
|
[deviceID: string]: number;
|
|
29
29
|
};
|
|
30
|
+
transportFirstEventPromise: Promise<void> | undefined;
|
|
30
31
|
constructor();
|
|
31
32
|
init(): Promise<void>;
|
|
32
33
|
private resolveTransportEvent;
|
package/lib/device/DeviceList.js
CHANGED
|
@@ -60,7 +60,10 @@ class DeviceList extends typedEventEmitter_1.TypedEmitter {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
else if (transportType instanceof transport_1.Transport) {
|
|
63
|
-
|
|
63
|
+
if (!transportType.getMessage()) {
|
|
64
|
+
transportType.updateMessages(this.messages);
|
|
65
|
+
}
|
|
66
|
+
this.transports.push(transportType);
|
|
64
67
|
}
|
|
65
68
|
else {
|
|
66
69
|
throw constants_1.ERRORS.TypedError('Runtime', 'DeviceList.init: transports[] of unexpected type');
|
|
@@ -126,7 +129,7 @@ class DeviceList extends typedEventEmitter_1.TypedEmitter {
|
|
|
126
129
|
await (0, promiseUtils_1.resolveAfter)(1000, null).promise;
|
|
127
130
|
if (device) {
|
|
128
131
|
if (!device.isUsed() && device.isUnacquired() && !device.isInconsistent()) {
|
|
129
|
-
_log.debug('Create device from unacquired', device);
|
|
132
|
+
_log.debug('Create device from unacquired', device.toMessageObject());
|
|
130
133
|
await this._createAndSaveDevice(descriptor);
|
|
131
134
|
}
|
|
132
135
|
}
|
|
@@ -149,7 +152,7 @@ class DeviceList extends typedEventEmitter_1.TypedEmitter {
|
|
|
149
152
|
d.forEach(descriptor => {
|
|
150
153
|
const path = descriptor.path.toString();
|
|
151
154
|
const device = this.devices[path];
|
|
152
|
-
_log.debug('Event', e, device);
|
|
155
|
+
_log.debug('Event', e, device.toMessageObject());
|
|
153
156
|
if (device) {
|
|
154
157
|
this.emit(e, device.toMessageObject());
|
|
155
158
|
}
|
|
@@ -210,7 +213,7 @@ class DeviceList extends typedEventEmitter_1.TypedEmitter {
|
|
|
210
213
|
}
|
|
211
214
|
}
|
|
212
215
|
async waitForTransportFirstEvent() {
|
|
213
|
-
|
|
216
|
+
this.transportFirstEventPromise = new Promise(resolve => {
|
|
214
217
|
const handler = () => {
|
|
215
218
|
this.removeListener(transport_1.TRANSPORT.START, handler);
|
|
216
219
|
this.removeListener(transport_1.TRANSPORT.ERROR, handler);
|
|
@@ -219,6 +222,7 @@ class DeviceList extends typedEventEmitter_1.TypedEmitter {
|
|
|
219
222
|
this.on(transport_1.TRANSPORT.START, handler);
|
|
220
223
|
this.on(transport_1.TRANSPORT.ERROR, handler);
|
|
221
224
|
});
|
|
225
|
+
await this.transportFirstEventPromise;
|
|
222
226
|
}
|
|
223
227
|
async _createAndSaveDevice(descriptor) {
|
|
224
228
|
_log.debug('Creating Device', descriptor);
|
package/lib/events/iframe.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { UI_EVENT } from './ui-request';
|
|
2
2
|
import type { ConnectSettings, SystemInfo } from '../types';
|
|
3
3
|
import type { MessageFactoryFn } from '../types/utils';
|
|
4
|
+
import { LogMessage } from '../utils/debug';
|
|
4
5
|
export declare const IFRAME: {
|
|
5
6
|
readonly BOOTSTRAP: "iframe-bootstrap";
|
|
6
7
|
readonly LOADED: "iframe-loaded";
|
|
7
8
|
readonly INIT: "iframe-init";
|
|
8
9
|
readonly ERROR: "iframe-error";
|
|
9
10
|
readonly CALL: "iframe-call";
|
|
11
|
+
readonly LOG: "iframe-log";
|
|
10
12
|
};
|
|
11
13
|
export interface IFrameError {
|
|
12
14
|
type: typeof IFRAME.ERROR;
|
|
@@ -29,10 +31,14 @@ export interface IFrameInit {
|
|
|
29
31
|
extension?: string;
|
|
30
32
|
};
|
|
31
33
|
}
|
|
34
|
+
export interface IFrameLogRequest {
|
|
35
|
+
type: typeof IFRAME.LOG;
|
|
36
|
+
payload: LogMessage;
|
|
37
|
+
}
|
|
32
38
|
export type IFrameEvent = {
|
|
33
39
|
type: typeof IFRAME.BOOTSTRAP;
|
|
34
40
|
payload?: typeof undefined;
|
|
35
|
-
} | IFrameLoaded | IFrameInit | IFrameError;
|
|
41
|
+
} | IFrameLoaded | IFrameInit | IFrameLogRequest | IFrameError;
|
|
36
42
|
export type IFrameEventMessage = IFrameEvent & {
|
|
37
43
|
event: typeof UI_EVENT;
|
|
38
44
|
};
|