@@ -6,12 +6,7 @@ import { validatePath } from '../../utils/pathUtils';
6
6
import { getEthereumNetwork } from '../../data/CoinInfo' ;
7
7
import { toChecksumAddress , getNetworkLabel } from '../../utils/ethereumUtils' ;
8
8
import type { CoreMessage , EthereumNetworkInfo } from '../../types' ;
9
- import type {
10
- MessageResponse ,
11
- EthereumTypedDataSignature ,
12
- EthereumTypedDataStructAck ,
13
- EthereumTypedDataValueRequest ,
14
- } from '../../types/trezor/protobuf' ;
9
+ import type { MessageResponse , EthereumTypedDataStructAck } from '../../types/trezor/protobuf' ;
15
10
import { ERRORS } from '../../constants' ;
16
11
import type { EthereumSignTypedData as EthereumSignTypedDataParams } from '../../types/networks/ethereum' ;
17
12
import { getFieldType , parseArrayType , encodeData } from './helpers/ethereumSignTypedData' ;
@@ -104,8 +99,7 @@ export default class EthereumSignTypedData extends AbstractMethod {
104
99
// sending the whole message to be signed
105
100
while ( response . type === 'EthereumTypedDataValueRequest' ) {
106
101
// $FlowIssue disjoint union Refinements not working, TODO: check if new Flow versions fix this
107
- const valueRequestMessage : EthereumTypedDataValueRequest = response . message ;
108
- const { member_path } = valueRequestMessage ;
102
+ const { member_path } = response . message ;
109
103
110
104
let memberData ;
111
105
let memberTypeName ;
@@ -160,10 +154,10 @@ export default class EthereumSignTypedData extends AbstractMethod {
160
154
}
161
155
162
156
// $FlowIssue disjoint union Refinements not working, TODO: check if new Flow versions fix this
163
- const signatureMessage : EthereumTypedDataSignature = response . message ;
157
+ const { address , signature } = response . message ;
164
158
return {
165
- address : toChecksumAddress ( signatureMessage . address , network ) ,
166
- signature : `0x${ signatureMessage . signature } ` ,
159
+ address : toChecksumAddress ( address , network ) ,
160
+ signature : `0x${ signature } ` ,
167
161
} ;
168
162
}
169
163
}
0 commit comments