@@ -136,6 +136,7 @@ export async function createUnsignedUserOp(args: {
136136 adminAddress : string ;
137137 sponsorGas : boolean ;
138138 waitForDeployment ?: boolean ;
139+ isDeployedOverride ?: boolean ;
139140 overrides ?: SmartWalletOptions [ "overrides" ] ;
140141} ) : Promise < UserOperationV06 | UserOperationV07 > {
141142 const {
@@ -146,6 +147,7 @@ export async function createUnsignedUserOp(args: {
146147 overrides,
147148 sponsorGas,
148149 waitForDeployment = true ,
150+ isDeployedOverride,
149151 } = args ;
150152 const chain = executeTx . chain ;
151153 const client = executeTx . client ;
@@ -163,7 +165,11 @@ export async function createUnsignedUserOp(args: {
163165
164166 const [ isDeployed , callData , callGasLimit , gasFees , nonce ] =
165167 await Promise . all ( [
166- isContractDeployed ( accountContract ) ,
168+ typeof isDeployedOverride === "boolean"
169+ ? isDeployedOverride
170+ : isContractDeployed ( accountContract ) . then (
171+ ( isDeployed ) => isDeployed || isAccountDeploying ( accountContract ) ,
172+ ) ,
167173 encode ( executeTx ) ,
168174 resolvePromisedValue ( executeTx . gas ) ,
169175 getGasFees ( {
@@ -299,7 +305,7 @@ async function populateUserOp_v0_7(args: {
299305
300306 let factory : string | undefined ;
301307 let factoryData : Hex ;
302- if ( isDeployed || isAccountDeploying ( accountContract ) ) {
308+ if ( isDeployed ) {
303309 factoryData = "0x" ;
304310 if ( waitForDeployment ) {
305311 // lock until account is deployed if needed to avoid 'sender already created' errors when sending multiple transactions in parallel
@@ -462,7 +468,7 @@ async function populateUserOp_v0_6(args: {
462468 const { chain, client } = bundlerOptions ;
463469 let initCode : Hex ;
464470
465- if ( isDeployed || isAccountDeploying ( accountContract ) ) {
471+ if ( isDeployed ) {
466472 initCode = "0x" ;
467473 if ( waitForDeployment ) {
468474 // lock until account is deployed if needed to avoid 'sender already created' errors when sending multiple transactions in parallel
@@ -699,6 +705,7 @@ export async function createAndSignUserOp(options: {
699705 client : ThirdwebClient ;
700706 smartWalletOptions : SmartWalletOptions ;
701707 waitForDeployment ?: boolean ;
708+ isDeployedOverride ?: boolean ;
702709} ) {
703710 const config = options . smartWalletOptions ;
704711 const factoryContract = getContract ( {
@@ -757,6 +764,7 @@ export async function createAndSignUserOp(options: {
757764 sponsorGas : "sponsorGas" in config ? config . sponsorGas : config . gasless ,
758765 overrides : config . overrides ,
759766 waitForDeployment : options . waitForDeployment ,
767+ isDeployedOverride : options . isDeployedOverride ,
760768 } ) ;
761769 const signedUserOp = await signUserOp ( {
762770 client : options . client ,
0 commit comments