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

Improve types and make wallet providers more flexible #264

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gskril
Copy link

@gskril gskril commented Feb 5, 2025

What changed? Why?

Replaced all cases of 0x${string} with Hex from Viem for cleanliness.

Also fixed the response type of waitForTransactionReceipt() in a few wallet providers.

Qualified Impact

Exposes publicClient and walletClient from VieimWalletProvider to allow more custom provider flexibility, since not all viem methods are explicitly included in the class.

Closes #272

@cb-heimdall
Copy link

cb-heimdall commented Feb 5, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@gskril gskril changed the title Clean up Hex types and improve response types Improve types and make wallet providers more flexible Feb 5, 2025
@cb-heimdall
Copy link

Review Error for BradleeA2024 @ 2025-02-09 18:09:16 UTC
User must have write permissions to review

@debuggingfuture
Copy link
Contributor

wondered the same if agentkit original motivation is try to stick with own type 0x${string} to avoid the dependency
if viem types are used, will suggest distinguishing between Hex and Address to further clarify the type.

@John-peterson-coinbase John-peterson-coinbase added enhancement New feature or request triaged needs review PR / issue needs review cherry labels Feb 10, 2025
@gskril
Copy link
Author

gskril commented Feb 10, 2025

It already depends on viem pretty heavily so I figured it's safe. And if that is the case, I'd still be in favor of AgentKit's own reusable Hex type rather than 0x${string} everywhere.

I never really understood why Viem has a Hex and Address when they're exactly the same thing 😅

@0xRAG 0xRAG removed the triaged label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry enhancement New feature or request needs review PR / issue needs review
Development

Successfully merging this pull request may close these issues.

Expose viem public client actions from ViemWalletProvider
6 participants