Skip to content

Commit d1df864

Browse files
authored
Merge pull request #72 from jonathunne/fix/reuse-provider
fix: re-use read only class
2 parents 24db2ac + f832d7e commit d1df864

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/wallet-account-read-only-evm-erc-4337.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,12 @@ export default class WalletAccountReadOnlyEvmErc4337 extends WalletAccountReadOn
420420

421421
/** @private */
422422
async _getEvmReadOnlyAccount () {
423-
const address = await this.getAddress()
424-
425-
const evmReadOnlyAccount = new WalletAccountReadOnlyEvm(address, this._config)
423+
if (!this._evmReadOnlyAccount) {
424+
const address = await this.getAddress()
425+
this._evmReadOnlyAccount = new WalletAccountReadOnlyEvm(address, this._config)
426+
}
426427

427-
return evmReadOnlyAccount
428+
return this._evmReadOnlyAccount
428429
}
429430

430431
/** @private */

0 commit comments

Comments
 (0)