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

I'm having trouble using Wagmi PublicClient #466

Open
r4topunk opened this issue Nov 25, 2024 · 3 comments
Open

I'm having trouble using Wagmi PublicClient #466

r4topunk opened this issue Nov 25, 2024 · 3 comments

Comments

@r4topunk
Copy link

I can't use Wagmi Public Client

import { getConfig } from '@/utils/wagmi';
import { createCollectorClient } from '@zoralabs/protocol-sdk';
import { base } from 'viem/chains';
import { getClient } from 'wagmi/actions';

export default function Zora() {
  const wagmiConfig = getConfig();
  const client = getClient(wagmiConfig);
  const collectorClient = createCollectorClient({
    chainId: base.id,
    publicClient: client,
  });
  }

Error:

[...]
is missing the following properties from type:
- getBlock
- readContract
- simulateContract
- getBalance

(property) publicClient: PublicClient
Optional public client for the chain. If not provide, it is created

And the public client is not optional, as it is mandatory here:
https://github.com/ourzora/zora-protocol/blame/209fb39ef7da7bafe8198e6359705422c66449a8/packages/protocol-sdk/src/utils.ts#L17C16-L17C16

@iainnash
Copy link
Collaborator

iainnash commented Dec 3, 2024

What version of wagmi are you using? We have some type issues relating to different versions of viem in a project. We use peer dependencies to help fix this issue but if the project being integrated includes two viem versions this can happen or if auto-installing peer deps is setup the same can happen.

@r4topunk
Copy link
Author

r4topunk commented Dec 5, 2024

@iainnash I'm on Wagmi V2

you can see and run my code here
r4topunk/gnars-terminal@main...zora

@iainnash
Copy link
Collaborator

Taking a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants