safe-global / safe-core-sdk

The Safe{Core} SDK allows builders to add account abstraction functionality into their apps.
https://docs.safe.global/sdk/overview
MIT License
242 stars 177 forks source link

[4337] Align pack init `provider` and `rpcUrl` #844

Closed dasanra closed 2 weeks ago

dasanra commented 3 weeks ago

Context / issue

After we removed the EthAdapter, the provider can get a rpcUrl as parameter. In the Safe4337Pack we needed the rpcUrl for other tasks, but currently it may happen that we have to set the rpcUrl to 2 parameters when calling the init

Proposed solution

The rpcUrl parameter is only used to initialize a publicClient in order to get the entrypoint contract to fetch the nonce. The safeProvider that we initialize with the provider parameter should be able to do this kind of query, removing the need to pass an specific rpcUrl