@@ -16,7 +16,10 @@ import {
1616import { getErrorObject } from "../../shared/utils/error"
1717import { isAccountDeployed } from "../accountDeploy"
1818import { HandleMessage , UnhandledMessage } from "../background"
19- import { isAccountV5 } from "../../shared/utils/accountv4"
19+ import {
20+ isAccountV4__deprecated ,
21+ isAccountV5 ,
22+ } from "../../shared/utils/accountv4"
2023import { argentMaxFee } from "../utils/argentMaxFee"
2124import { addEstimatedFees } from "../../shared/transactionSimulation/fees/estimatedFeesRepository"
2225import { transactionCallsAdapter } from "./transactionAdapter"
@@ -472,12 +475,16 @@ export const handleTransactionMessage: HandleMessage<
472475 throw new AccountError ( { code : "NOT_FOUND" } )
473476 }
474477 const starknetAccount = await wallet . getSelectedStarknetAccount ( )
475-
476- if ( ! isAccountV5 ( starknetAccount ) ) {
478+ if ( isAccountV4__deprecated ( starknetAccount ) ) {
477479 // Old accounts are not supported
480+ // This should no longer happen as we prevent deprecated accounts from being used
478481 return respond ( {
479- type : "SIMULATE_TRANSACTION_INVOCATION_RES" ,
480- data : null ,
482+ type : "SIMULATE_TRANSACTIONS_REJ" ,
483+ data : {
484+ error : new TransactionError ( {
485+ code : "DEPRECATED_ACCOUNT" ,
486+ } ) ,
487+ } ,
481488 } )
482489 }
483490
0 commit comments