|
5 | 5 | isBroadcastedTransactionResult, |
6 | 6 | isSignedMessageOrTypedDataResult, |
7 | 7 | isSignedTransactionResult, |
| 8 | + isSignPersonalMessageParams, |
| 9 | + isSignRawTransactionParams, |
| 10 | + isSignTransactionParams, |
8 | 11 | type SignedResults, |
9 | 12 | type SignFlowStatus, |
10 | 13 | type SignPersonalMessageParams, |
@@ -161,6 +164,28 @@ export class SignTransactionController implements ReactiveController { |
161 | 164 | : this.lang.currentTranslation.common.device.model.fallback; |
162 | 165 | } |
163 | 166 |
|
| 167 | + private isTransactionParameter( |
| 168 | + transactionParams: |
| 169 | + | SignTransactionParams |
| 170 | + | SignRawTransactionParams |
| 171 | + | SignTypedMessageParams |
| 172 | + | SignPersonalMessageParams |
| 173 | + | undefined, |
| 174 | + ): boolean { |
| 175 | + if (!transactionParams) { |
| 176 | + return false; |
| 177 | + } |
| 178 | + |
| 179 | + if (isSignPersonalMessageParams(transactionParams)) { |
| 180 | + return false; |
| 181 | + } |
| 182 | + |
| 183 | + return ( |
| 184 | + isSignTransactionParams(transactionParams) || |
| 185 | + isSignRawTransactionParams(transactionParams) |
| 186 | + ); |
| 187 | + } |
| 188 | + |
164 | 189 | private mapSuccessToState(data: SignedResults): ScreenState { |
165 | 190 | const lang = this.lang.currentTranslation; |
166 | 191 |
|
@@ -323,7 +348,7 @@ export class SignTransactionController implements ReactiveController { |
323 | 348 | } |
324 | 349 | case error instanceof UserRejectedTransactionError: { |
325 | 350 | const deviceName = this.getDeviceName(); |
326 | | - const isTx = isSignedTransactionResult(this.currentTransaction); |
| 351 | + const isTx = this.isTransactionParameter(this.currentTransaction); |
327 | 352 | this.state = { |
328 | 353 | screen: "error", |
329 | 354 | status: { |
|
0 commit comments