Skip to content

fix: share manager JsonRpcProvider with ERC-4337 accounts - #123

Closed
jonathunne wants to merge 1 commit into
tetherto:mainfrom
jonathunne:fix/share-manager-provider
Closed

fix: share manager JsonRpcProvider with ERC-4337 accounts#123
jonathunne wants to merge 1 commit into
tetherto:mainfrom
jonathunne:fix/share-manager-provider

Conversation

@jonathunne

Copy link
Copy Markdown
Contributor

Summary

  • Manager keeps a single JsonRpcProvider (already used for getFeeRates) and injects an EIP-1193 adapter into getAccount, matching wdk-wallet-btc (client: this._client).
  • Owner WalletAccountEvm is constructed without provider (keys/address only); 4337 account and balance/verify helpers reuse the shared provider instead of rebuilding from the URL.
  • approve() no longer depends on owner._provider (encodes calldata without a runner; still requires the 4337 account provider for chainId/allowance).
  • Adds a regression test: manager → getAccountgetBalance constructs exactly one JsonRpcProvider.

Test plan

  • jest tests/provider-instance-count.test.js
  • jest tests/wallet-manager-evm-erc-4337.test.js
  • jest tests/wallet-account-evm-erc-4337.test.js
  • Spot-check manager + EIP-1193 object config still works (already covered in existing account/integration tests)

Stop opening a new JsonRpcProvider per owner account, 4337 wrap, and
balance helper when accounts are spawned from a manager. Follow the
wdk-wallet-btc pattern: one client on the manager, inject into getAccount.
@jonathunne

Copy link
Copy Markdown
Contributor Author

Closing for now — will reopen when ready.

@jonathunne jonathunne closed this Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant