-
Notifications
You must be signed in to change notification settings - Fork 2
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: Hooks to update Safe threshold + owners #13
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The useSendTransaction hook now handles both TransactionBase and SafeTransaction objects. It maps the transactions array and converts any SafeTransaction objects to the required format before sending them to the signerClient.
It defines whether the connected signer is an owner of the configured Safe
It wraps the individual hooks: - `useAddOwner` - `useRemoveOwner` - `useSwapOwner`
Refactor the usePendingTransactions hook to use the usePublicClientQuery hook instead of the usePublicClient hook.
Also add fixtures for mutation result objects
… in previous commit
…sult` for consistency
…stomMutationResult
…f from `SafeClient.protocolKit`
Call `signerClient.isOwner` instead of checking owners array to compute `isOwnerConnected`. Throw error if not rendered in SafeProvider
The config param can only be defined in combination with the safeTxHash param.
dasanra
approved these changes
Oct 9, 2024
e83b6f7
to
2d931f4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: Issue #5
This pull request introduces new functionality to manage a Safe's threshold and owners by adding the following hooks:
New Hooks
1.
useUpdateThreshold
Hook to update the threshold of the connected Safe.
2.
useUpdateOwners
Hook to manage the owners of the connected Safe, including adding, removing, or swapping owners. This hook internally uses:
useAddOwner
: Adds a new owner to the Safe.useRemoveOwner
: Removes an existing owner from the Safe.useSwapOwner
: Swaps an owner in the Safe.3.
useSignerClientMutation
(internal hook)An internal hook for sending custom mutations via the SafeClient. This is used by the newly added
useUpdateThreshold
anduseUpdateOwners
hooks to facilitate the necessary mutations.Demo
The new hooks are used on the demo app in this PR.