Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Extend SafeProviders externalClient type #928

Merged

Conversation

tmjssz
Copy link
Contributor

@tmjssz tmjssz commented Jul 25, 2024

What it solves

Addresses the feedback provided in this comment.

How this PR fixes it

This PR enhances the SafeProvider by enabling it to support both PublicClient and WalletClient as external providers.

Key Changes:

  • Type Alias Introduction: A new type alias ExternalClient has been introduced, defined as PublicClient | ExternalSigner. This type is now used for the #externalProvider property in SafeProvider.
  • Method Adjustments: Due to the extended type, viem methods are now individually imported from viem/actions instead of being directly invoked on the client.

These changes ensure that SafeProvider can handle a broader range of external providers, enhancing its flexibility and functionality.

tmjssz added 3 commits July 25, 2024 17:39
…lient`

* Introduce `ExternalClient` type alias and use it as type for `#externalProvider` in SafeProvider
* With the extended type we need to use viem methods individually from `viem/actions` instead of calling them directly on the client itself
…e4337Pack

Also fix unit test for Safe4337Pack
@tmjssz tmjssz mentioned this pull request Jul 25, 2024
@tmjssz
Copy link
Contributor Author

tmjssz commented Jul 25, 2024

No idea why the build in the pipeline is failing. There is no issue when running the build locally 🤔

@tmjssz tmjssz requested review from leonardotc and dasanra July 25, 2024 16:30
@dasanra dasanra merged commit 00a292e into feat/viem-migration Jul 30, 2024
20 checks passed
@dasanra dasanra deleted the feat/viem-migration-external-client-refactor branch July 30, 2024 11:04
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants