@@ -134,7 +134,12 @@ export class Account extends Provider implements AccountInterface {
134134 calls : AllowArray < Call > ,
135135 details : UniversalDetails = { }
136136 ) : Promise < EstimateFee > {
137- const { nonce : providedNonce , blockIdentifier, version : providedVersion } = details ;
137+ const {
138+ nonce : providedNonce ,
139+ blockIdentifier,
140+ version : providedVersion ,
141+ skipValidate = true ,
142+ } = details ;
138143
139144 const transactions = Array . isArray ( calls ) ? calls : [ calls ] ;
140145 const nonce = toBigInt ( providedNonce ?? ( await this . getNonce ( ) ) ) ;
@@ -152,6 +157,7 @@ export class Account extends Provider implements AccountInterface {
152157 version,
153158 chainId,
154159 cairoVersion : await this . getCairoVersion ( ) ,
160+ skipValidate,
155161 } ;
156162
157163 const invocation = await this . buildInvocation ( transactions , signerDetails ) ;
@@ -167,7 +173,12 @@ export class Account extends Provider implements AccountInterface {
167173 payload : DeclareContractPayload ,
168174 details : UniversalDetails = { }
169175 ) : Promise < EstimateFee > {
170- const { blockIdentifier, nonce : providedNonce , version : providedVersion } = details ;
176+ const {
177+ blockIdentifier,
178+ nonce : providedNonce ,
179+ version : providedVersion ,
180+ skipValidate = true ,
181+ } = details ;
171182 const nonce = toBigInt ( providedNonce ?? ( await this . getNonce ( ) ) ) ;
172183 const version = toTransactionVersion (
173184 ! isSierra ( payload . contract )
@@ -185,6 +196,7 @@ export class Account extends Provider implements AccountInterface {
185196 walletAddress : this . address ,
186197 maxFee : ZERO ,
187198 cairoVersion : undefined , // unused parameter
199+ skipValidate,
188200 } ) ;
189201
190202 return super . getDeclareEstimateFee (
@@ -204,7 +216,7 @@ export class Account extends Provider implements AccountInterface {
204216 } : DeployAccountContractPayload ,
205217 details : UniversalDetails = { }
206218 ) : Promise < EstimateFee > {
207- const { blockIdentifier, version : providedVersion } = details ;
219+ const { blockIdentifier, version : providedVersion , skipValidate = true } = details ;
208220 const version = toTransactionVersion (
209221 this . getPreferredVersion ( ETransactionVersion . F1 , ETransactionVersion . F3 ) ,
210222 toFeeVersion ( providedVersion )
@@ -222,6 +234,7 @@ export class Account extends Provider implements AccountInterface {
222234 walletAddress : this . address , // unused parameter
223235 maxFee : ZERO ,
224236 cairoVersion : undefined , // unused parameter,
237+ skipValidate,
225238 }
226239 ) ;
227240
@@ -269,7 +282,7 @@ export class Account extends Provider implements AccountInterface {
269282 invocations : Invocations ,
270283 details : SimulateTransactionDetails = { }
271284 ) : Promise < SimulateTransactionResponse > {
272- const { nonce, blockIdentifier, skipValidate, skipExecute, version } = details ;
285+ const { nonce, blockIdentifier, skipValidate = true , skipExecute, version } = details ;
273286 const accountInvocations = await this . accountInvocationsFactory ( invocations , {
274287 ...v3Details ( details ) ,
275288 versions : [
@@ -281,6 +294,7 @@ export class Account extends Provider implements AccountInterface {
281294 ] ,
282295 nonce,
283296 blockIdentifier,
297+ skipValidate,
284298 } ) ;
285299
286300 return super . getSimulateTransaction ( accountInvocations , {
@@ -649,7 +663,7 @@ export class Account extends Provider implements AccountInterface {
649663 details : InvocationsSignerDetails
650664 ) : Promise < Invocation > {
651665 const calldata = getExecuteCalldata ( call , await this . getCairoVersion ( ) ) ;
652- const signature = await this . signer . signTransaction ( call , details ) ;
666+ const signature = ! details . skipValidate ? await this . signer . signTransaction ( call , details ) : [ ] ;
653667
654668 return {
655669 ...v3Details ( details ) ,
@@ -673,13 +687,15 @@ export class Account extends Provider implements AccountInterface {
673687 throw Error ( 'V3 Transaction work with Cairo1 Contracts and require compiledClassHash' ) ;
674688 }
675689
676- const signature = await this . signer . signDeclareTransaction ( {
677- ...details ,
678- ...v3Details ( details ) ,
679- classHash,
680- compiledClassHash : compiledClassHash as string , // TODO: TS Nekuzi da v2 nemora imat a v3 mora i da je throvano ako nije definiran
681- senderAddress : details . walletAddress ,
682- } ) ;
690+ const signature = ! details . skipValidate
691+ ? await this . signer . signDeclareTransaction ( {
692+ ...details ,
693+ ...v3Details ( details ) ,
694+ classHash,
695+ compiledClassHash : compiledClassHash as string , // TODO: TS Nekuzi da v2 nemora imat a v3 mora i da je throvano ako nije definiran
696+ senderAddress : details . walletAddress ,
697+ } )
698+ : [ ] ;
683699
684700 return {
685701 senderAddress : details . walletAddress ,
@@ -703,14 +719,16 @@ export class Account extends Provider implements AccountInterface {
703719 providedContractAddress ??
704720 calculateContractAddressFromHash ( addressSalt , classHash , compiledCalldata , 0 ) ;
705721
706- const signature = await this . signer . signDeployAccountTransaction ( {
707- ...details ,
708- ...v3Details ( details ) ,
709- classHash,
710- contractAddress,
711- addressSalt,
712- constructorCalldata : compiledCalldata ,
713- } ) ;
722+ const signature = ! details . skipValidate
723+ ? await this . signer . signDeployAccountTransaction ( {
724+ ...details ,
725+ ...v3Details ( details ) ,
726+ classHash,
727+ contractAddress,
728+ addressSalt,
729+ constructorCalldata : compiledCalldata ,
730+ } )
731+ : [ ] ;
714732
715733 return {
716734 ...v3Details ( details ) ,
@@ -752,7 +770,7 @@ export class Account extends Provider implements AccountInterface {
752770 invocations : Invocations ,
753771 details : AccountInvocationsFactoryDetails
754772 ) {
755- const { nonce, blockIdentifier } = details ;
773+ const { nonce, blockIdentifier, skipValidate = true } = details ;
756774 const safeNonce = await this . getNonceSafe ( nonce ) ;
757775 const chainId = await this . getChainId ( ) ;
758776 const versions = details . versions . map ( ( it ) => toTransactionVersion ( it ) ) ;
@@ -775,6 +793,7 @@ export class Account extends Provider implements AccountInterface {
775793 chainId,
776794 cairoVersion,
777795 version : '' as ETransactionVersion ,
796+ skipValidate,
778797 } ;
779798 const common = {
780799 type : transaction . type ,
0 commit comments