Skip to content

fix: type code for networks #382

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appkit/migration/from-connectkit-next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

// Include networks from AppKit
+ import { mainnet, arbitrum } from '@reown/appkit/networks'
+ import type { AppKitNetwork } from '@reown/appkit/networks'
+ import { createAppKit } from '@reown/appkit';
+ export const networks = [mainnet, arbitrum]
+ export const networks = [mainnet, arbitrum] as [AppKitNetwork, ...AppKitNetwork[]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this?

All my demos work without exporting it with this type format

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try to build them ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the demos are live and deployed via Vercel. My Vercel build always goes through.


- const config = createConfig(
- getDefaultConfig({
Expand Down
3 changes: 2 additions & 1 deletion appkit/migration/from-rainbowkit-next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ AppKit's web components are global HTML elements that don't require importing.
```tsx {1-15}
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
import { arbitrum, mainnet } from '@reown/appkit/networks'
import { createAppKit } from '@reown/appkit';
export const projectId = 'YOUR_PROJECT_ID'

export const networks = [mainnet, arbitrum]
export const networks = [mainnet, arbitrum] as [AppKitNetwork, ...AppKitNetwork[]]

//Set up the Wagmi Adapter (Config)
export const wagmiAdapter = new WagmiAdapter({
Expand Down
3 changes: 2 additions & 1 deletion appkit/next/core/custom-connectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { http, WagmiProvider, CreateConnectorFn } from 'wagmi'
import { sepolia } from '@reown/appkit/networks'
import { walletConnect, coinbaseWallet, injected } from 'wagmi/connectors'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import type { AppKitNetwork } from '@reown/appkit/networks'

const queryClient = new QueryClient()

Expand All @@ -41,7 +42,7 @@ connectors.push(
})
)

export const networks = [sepolia]
export const networks = [sepolia] as [AppKitNetwork, ...AppKitNetwork[]]

export const wagmiAdapter = new WagmiAdapter({
storage:
Expand Down
3 changes: 2 additions & 1 deletion appkit/react/core/custom-connectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
import { http, WagmiProvider, CreateConnectorFn } from 'wagmi'
import { sepolia } from '@reown/appkit/networks'
import { walletConnect, coinbaseWallet, injected } from 'wagmi/connectors'
import type { AppKitNetwork } from '@reown/appkit/networks'

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

Expand All @@ -43,7 +44,7 @@ connectors.push(
})
)

export const networks = [sepolia]
export const networks = [sepolia] as [AppKitNetwork, ...AppKitNetwork[]]

export const wagmiAdapter = new WagmiAdapter({
storage:
Expand Down
3 changes: 2 additions & 1 deletion appkit/recipes/tenderly-virtual-testnets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ import { cookieStorage, createStorage, http } from "@wagmi/core";
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
import { mainnet, arbitrum } from "@reown/appkit/networks";
import { vTestnet } from "@/app/tenderly.config";
import type { AppKitNetwork } from '@reown/appkit/networks';

// Get projectId from https://cloud.reown.com
export const projectId = process.env.NEXT_PUBLIC_PROJECT_ID;
Expand All @@ -163,7 +164,7 @@ if (!projectId) {
throw new Error("Project ID is not defined");
}

export const networks = [mainnet, arbitrum, vTestnet];
export const networks = [mainnet, arbitrum, vTestnet] as [AppKitNetwork, ...AppKitNetwork[]];

//Set up the Wagmi Adapter (Config)
export const wagmiAdapter = new WagmiAdapter({
Expand Down
3 changes: 2 additions & 1 deletion snippets/appkit/javascript/wagmi/about/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ In your `main.js` file set up the following configuration.
import { createAppKit } from '@reown/appkit'
import { mainnet, arbitrum } from '@reown/appkit/networks'
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
import type { AppKitNetwork } from '@reown/appkit/networks'

// 1. Get a project ID at https://cloud.reown.com
const projectId = 'YOUR_PROJECT_ID'

export const networks = [mainnet, arbitrum]
export const networks = [mainnet, arbitrum] as [AppKitNetwork, ...AppKitNetwork[]]

// 2. Set up Wagmi adapter
const wagmiAdapter = new WagmiAdapter({
Expand Down
3 changes: 2 additions & 1 deletion snippets/appkit/next/wagmi/about/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ For this example we will create a file called `config/index.tsx` outside our app
import { cookieStorage, createStorage, http } from '@wagmi/core'
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
import { mainnet, arbitrum } from '@reown/appkit/networks'
import type { AppKitNetwork } from '@reown/appkit/networks'

// Get projectId from https://cloud.reown.com
export const projectId = process.env.NEXT_PUBLIC_PROJECT_ID
Expand All @@ -20,7 +21,7 @@ if (!projectId) {
throw new Error('Project ID is not defined')
}

export const networks = [mainnet, arbitrum]
export const networks = [mainnet, arbitrum] as [AppKitNetwork, ...AppKitNetwork[]]

//Set up the Wagmi Adapter (Config)
export const wagmiAdapter = new WagmiAdapter({
Expand Down