-
Notifications
You must be signed in to change notification settings - Fork 47
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
Updated version example? #20
Comments
Hey @crimson-med - can you dive a little deeper into what's going wrong for you? We recently updated to use the latest version of siwe in this example. |
Hey @obstropolos thanks for taking the time to reply. Wagmi version: 1.0.6 So the first issue encountered was that now the chain names are not part of the import { mainnet, polygon, optimism, arbitrum } from "@wagmi/core/chains"; Next the import { WagmiConfig, createConfig, configureChains } from "wagmi";
import { mainnet, polygon, optimism, arbitrum } from "@wagmi/core/chains";
import { publicProvider } from "wagmi/providers/public";
import { CoinbaseWalletConnector } from "wagmi/connectors/coinbaseWallet";
import { InjectedConnector } from "wagmi/connectors/injected";
import { MetaMaskConnector } from "wagmi/connectors/metaMask";
import { WalletConnectConnector } from "wagmi/connectors/walletConnect";
// Configure chains & providers with the Alchemy provider.
// Two popular providers are Alchemy (alchemy.com) and Infura (infura.io)
const { chains, publicClient, webSocketPublicClient } = configureChains(
[mainnet, polygon, optimism, arbitrum],
[publicProvider()]
);
// Set up wagmi config
const config = createConfig({
autoConnect: true,
connectors: [
new MetaMaskConnector({ chains }),
new CoinbaseWalletConnector({
chains,
options: {
appName: "wagmi",
},
}),
new WalletConnectConnector({
chains,
options: {
projectId: "...",
},
}),
new InjectedConnector({
chains,
options: {
name: "Injected",
shimDisconnect: true,
},
}),
],
publicClient,
webSocketPublicClient,
});
const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
return (
<WagmiConfig config={config}>
<SessionProvider session={session}>
<Component {...pageProps} />
</SessionProvider>
</WagmiConfig>
);
}; Finally event with the above edited code I get the following error from
|
any updates on this? |
At the moment, this example is not compatible with the latest version of |
@obstropolos @crimson-med I attempted this with the latest versions of all these libraries and it seemed to work. Although the WebSocket connection throws a bunch of errors, wallet connection and SIWE works. |
I have been trying to use the guide described here: https://docs.login.xyz/integrations/nextauth.js
Which uses this repo at it's base however a lot of functions have changed in siwe, wagmi.
Would it be possible to get an updated version?
The text was updated successfully, but these errors were encountered: