@@ -99,14 +99,14 @@ export class WalletServicesPlugin extends SafeEventEmitter implements IPlugin {
9999 if ( ! connectedChainConfig . ticker ) throw WalletServicesPluginError . invalidParams ( "ticker is required in chainConfig" ) ;
100100 if ( ! connectedChainConfig . tickerName ) throw WalletServicesPluginError . invalidParams ( "tickerName is required in chainConfig" ) ;
101101
102- const enableAccountAbstraction =
102+ const hasAaProvider =
103103 web3auth . coreOptions . accountAbstractionProvider &&
104104 ( web3auth . connectedAdapterName === WALLET_ADAPTERS . AUTH ||
105105 ( web3auth . connectedAdapterName !== WALLET_ADAPTERS . AUTH && web3auth . coreOptions . useAAWithExternalWallet ) ) ;
106106
107107 let accountAbstractionConfig : AccountAbstractionConfig ;
108108
109- if ( enableAccountAbstraction ) {
109+ if ( hasAaProvider ) {
110110 const smartAccountAddress = ( web3auth . coreOptions . accountAbstractionProvider as AccountAbstractionProvider ) ?. smartAccount . address ;
111111 const smartAccountType = ( web3auth . coreOptions . accountAbstractionProvider as AccountAbstractionProvider ) ?. config . smartAccountInit . name ;
112112 const paymasterConfig = ( web3auth . coreOptions . accountAbstractionProvider as AccountAbstractionProvider ) ?. config ?. paymasterConfig ;
@@ -119,6 +119,9 @@ export class WalletServicesPlugin extends SafeEventEmitter implements IPlugin {
119119 paymasterConfig : paymasterConfig || undefined ,
120120 bundlerConfig : bundlerConfig || undefined ,
121121 } as AccountAbstractionConfig ;
122+ } else if ( this . walletInitOptions ?. accountAbstractionConfig && Object . keys ( this . walletInitOptions . accountAbstractionConfig ) . length > 0 ) {
123+ // if wallet services plugin is initialized with accountAbstractionConfig we enable wallet service AA without AA provider
124+ accountAbstractionConfig = this . walletInitOptions . accountAbstractionConfig ;
122125 }
123126
124127 const finalInitOptions = {
0 commit comments