@@ -136,6 +136,7 @@ export async function createUnsignedUserOp(args: {
136
136
adminAddress : string ;
137
137
sponsorGas : boolean ;
138
138
waitForDeployment ?: boolean ;
139
+ isDeployedOverride ?: boolean ;
139
140
overrides ?: SmartWalletOptions [ "overrides" ] ;
140
141
} ) : Promise < UserOperationV06 | UserOperationV07 > {
141
142
const {
@@ -146,6 +147,7 @@ export async function createUnsignedUserOp(args: {
146
147
overrides,
147
148
sponsorGas,
148
149
waitForDeployment = true ,
150
+ isDeployedOverride,
149
151
} = args ;
150
152
const chain = executeTx . chain ;
151
153
const client = executeTx . client ;
@@ -163,7 +165,11 @@ export async function createUnsignedUserOp(args: {
163
165
164
166
const [ isDeployed , callData , callGasLimit , gasFees , nonce ] =
165
167
await Promise . all ( [
166
- isContractDeployed ( accountContract ) ,
168
+ typeof isDeployedOverride === "boolean"
169
+ ? isDeployedOverride
170
+ : isContractDeployed ( accountContract ) . then (
171
+ ( isDeployed ) => isDeployed || isAccountDeploying ( accountContract ) ,
172
+ ) ,
167
173
encode ( executeTx ) ,
168
174
resolvePromisedValue ( executeTx . gas ) ,
169
175
getGasFees ( {
@@ -299,7 +305,7 @@ async function populateUserOp_v0_7(args: {
299
305
300
306
let factory : string | undefined ;
301
307
let factoryData : Hex ;
302
- if ( isDeployed || isAccountDeploying ( accountContract ) ) {
308
+ if ( isDeployed ) {
303
309
factoryData = "0x" ;
304
310
if ( waitForDeployment ) {
305
311
// 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: {
462
468
const { chain, client } = bundlerOptions ;
463
469
let initCode : Hex ;
464
470
465
- if ( isDeployed || isAccountDeploying ( accountContract ) ) {
471
+ if ( isDeployed ) {
466
472
initCode = "0x" ;
467
473
if ( waitForDeployment ) {
468
474
// 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: {
699
705
client : ThirdwebClient ;
700
706
smartWalletOptions : SmartWalletOptions ;
701
707
waitForDeployment ?: boolean ;
708
+ isDeployedOverride ?: boolean ;
702
709
} ) {
703
710
const config = options . smartWalletOptions ;
704
711
const factoryContract = getContract ( {
@@ -757,6 +764,7 @@ export async function createAndSignUserOp(options: {
757
764
sponsorGas : "sponsorGas" in config ? config . sponsorGas : config . gasless ,
758
765
overrides : config . overrides ,
759
766
waitForDeployment : options . waitForDeployment ,
767
+ isDeployedOverride : options . isDeployedOverride ,
760
768
} ) ;
761
769
const signedUserOp = await signUserOp ( {
762
770
client : options . client ,
0 commit comments