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

Bug: Docs improperly set connectors on rainbowkit's getDefaultConfig #1076

Open
mykcryptodev opened this issue Aug 15, 2024 · 1 comment
Open

Comments

@mykcryptodev
Copy link
Contributor

Describe the bug and the steps to reproduce it

  1. Go to the wallet aggregator section of the docs

  2. Notice how the getDefaultConfig is setting a "connectors" key:
    Screenshot 2024-08-15 at 7 21 15 PM

  3. Connectors arent available as a key on the getDefaultConfig param:

Object literal may only specify known properties, and 'connectors' does not exist in type 'GetDefaultConfigParameters<[{ blockExplorers: { readonly default: { readonly name: "Basescan"; readonly url: "https://basescan.org"; readonly apiUrl: "https://api.basescan.org/api"; }; }; contracts: { readonly l2OutputOracle: { ...; }; ... 8 more ...; readonly l2ToL1MessagePasser: { ...; }; }; ... 9 more ...; serial...'.ts(2353)

What's the expected behavior?

Use createConfig from wagmi to include the connectors like this:

const connectors = connectorsForWallets( 
  [
    {
      groupName: 'Recommended Wallet',
      wallets: [coinbaseWallet],
    },
    {
      groupName: 'Other Wallets',
      wallets: [rainbowWallet, metaMaskWallet],
    },
  ],
  {
    appName: 'onchainkit',
    projectId: env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID,
  },
);

const wagmiConfig = createConfig({
  chains: [base],
  multiInjectedProviderDiscovery: false,
  connectors,
  ssr: false,
  transports: {
    [base.id]: http(),
  },
});

requires importing { http, createConfig } from 'wagmi'

also, the props type is missing in the example:

type Props = {
  children: ReactNode;
};

What version of the libraries are you using?

No response

@Zizzamia
Copy link
Contributor

Great point, let me get this prioritized. cc @cpcramer

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

No branches or pull requests

2 participants