-
Notifications
You must be signed in to change notification settings - Fork 158
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: OnchainKitProvider
default dependencies
#1589
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/createWagmiConfig.ts
Outdated
coinbaseWallet({ | ||
appName, | ||
appLogoUrl, | ||
preference: 'smartWalletOnly', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we set this to all
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like it'd be a more flexible implementation, unless we just really want to push to smart wallet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to add a second connector for EOA
coinbaseWallet({ appName: 'OnchainKit', preference: 'eoaOnly', }),
[base.id]: apiKey | ||
? http(`https://api.developer.coinbase.com/rpc/v1/base/${apiKey}`) | ||
: http(), | ||
[baseSepolia.id]: apiKey | ||
? http( | ||
`https://api.developer.coinbase.com/rpc/v1/base-sepolia/${apiKey}`, | ||
) | ||
: http(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses Base networks by default and sets the RPC as the CDP Node
</OnchainKitContext.Provider> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since Wagmi requires QueryClient, the only time 1 dep is missing should be when there is a QueryClient, but no Wagmi? Seems like an edge case, but would be possible to support this usecase, no? or, should we adjust the console.errors at least to only state using default if both don't exist and otherwise prompt the user to fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my mind, if you provide 1 of the 2 deps then it should default to the same logic/behavior as before this PR which is Unhandled Runtime Error
src/createWagmiConfig.test.ts
Outdated
expect(coinbaseWallet).toHaveBeenCalledWith({ | ||
appName: undefined, | ||
appLogoUrl: undefined, | ||
preference: 'smartWalletOnly', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to force the components to use smart wallet ? thinking this might be related to the issue i'm having where i'm unable to connect to EOA
This reverts commit 4a51003.
What changed? Why?
WagmiProvider
andQueryClientProvider
if not provided in the React contextNotes to reviewers
please review the default
WagmiProvider
configuration settings 🙏How has it been tested?
playground and unit test