Skip to content

Commit

Permalink
Merge pull request #45 from reown-com/update-wagmiAdapter
Browse files Browse the repository at this point in the history
Docs Update: Update WagmiAdapter config
  • Loading branch information
rohit-710 authored Sep 17, 2024
2 parents 9a7b5ad + 61be34b commit 04b31ac
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 13 deletions.
7 changes: 6 additions & 1 deletion docs/appkit/javascript/core/custom-connectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ connectors.push(
})
)

export const networks = [sepolia]

export const wagmiAdapter = new WagmiAdapter({
storage:
transports: {
[sepolia.id]: http()
},
connectors
connectors,
projectId,
networks

})

export const config = wagmiAdapter.wagmiConfig
Expand Down
7 changes: 6 additions & 1 deletion docs/appkit/javascript/wagmi/about/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
// 1. Get a project ID at https://cloud.reown.com
const projectId = 'YOUR_PROJECT_ID'

export const networks = [mainnet, arbitrum]

// 2. Set up Wagmi adapter
const wagmiAdapter = new WagmiAdapter()
const wagmiAdapter = new WagmiAdapter({
projectId,
networks
})

// 3. Configure the metadata
const metadata = {
Expand Down
6 changes: 5 additions & 1 deletion docs/appkit/next/core/custom-connectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ connectors.push(
})
)

export const networks = [sepolia]

export const wagmiAdapter = new WagmiAdapter({
storage:
transports: {
[sepolia.id]: http()
},
connectors
connectors,
projectId,
networks
})

export const config = wagmiAdapter.wagmiConfig
Expand Down
5 changes: 5 additions & 0 deletions docs/appkit/next/wagmi/about/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For this example we will create a file called `config/index.tsx` outside our app
```tsx
import { cookieStorage, createStorage, http } from '@wagmi/core'
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
import { mainnet, arbitrum } from '@reown/appkit/networks'

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

export const networks = [mainnet, arbitrum]

//Set up the Wagmi Adapter (Config)
export const wagmiAdapter = new WagmiAdapter({
storage: createStorage({
storage: cookieStorage
}),
ssr: true,
projectId,
networks
})

export const config = wagmiAdapter.wagmiConfig
Expand Down
6 changes: 5 additions & 1 deletion docs/appkit/react/core/custom-connectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ connectors.push(
})
)

export const networks = [sepolia]

export const wagmiAdapter = new WagmiAdapter({
storage:
transports: {
[sepolia.id]: http()
},
connectors
connectors,
projectId,
networks
})

export const config = wagmiAdapter.wagmiConfig
Expand Down
6 changes: 5 additions & 1 deletion docs/appkit/react/wagmi/about/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ const metadata = {
icons: ['https://avatars.githubusercontent.com/u/179229932']
}

export const networks = [mainnet, arbitrum]

// 3. Create Wagmi Adapter
const wagmiConfig = new WagmiAdapter({
ssr: true
ssr: true,
networks,
projectId
})

// 4. Create modal
Expand Down
14 changes: 9 additions & 5 deletions docs/appkit/shared/multichain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,23 @@ import { mainnet, arbitrum, sepolia } from '@reown/appkit/networks'

import { SolflareWalletAdapter, PhantomWalletAdapter } from '@solana/wallet-adapter-wallets'

// 0. Create the Wagmi adapter
export const networks = [solana, solanaTestnet, solanaDevnet]

// 0. Get projectId from https://cloud.reown.com
const projectId = 'YOUR_PROJECT_ID'

// 1. Create the Wagmi adapter
export const wagmiAdapter = new WagmiAdapter({
ssr: true,
projectId,
networks
})

// 1. Create Solana adapter
// 2. Create Solana adapter
const solanaWeb3JsAdapter = new SolanaAdapter({
wallets: [new PhantomWalletAdapter(), new SolflareWalletAdapter()]
})

// 2. Get projectId from https://cloud.reown.com
const projectId = 'YOUR_PROJECT_ID'

// 3. Set up the metadata - Optional
const metadata = {
name: 'AppKit',
Expand Down
4 changes: 3 additions & 1 deletion docs/appkit/shared/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ const adapter = new WagmiAdapter({
/* highlight-add-start */
preference: 'smartWalletOnly'
/* highlight-add-end */
})
}),
projectId,
networks
]
})

Expand Down
6 changes: 5 additions & 1 deletion docs/appkit/vue/core/custom-connectors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ connectors.push(
})
)

const export networks = [sepolia]

export const wagmiAdapter = new WagmiAdapter({
transports: {
[sepolia.id]: http()
},
connectors
connectors,
projectId,
networks
})

export const config = wagmiAdapter.wagmiConfig
Expand Down
6 changes: 5 additions & 1 deletion docs/appkit/vue/wagmi/about/implementation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ In your `App.vue` file set up the following configuration
icons: ['https://avatars.githubusercontent.com/u/179229932']
}
export const networks = [mainnet, arbitrum]
// 3. Create Wagmi Adapter
const wagmiAdapter = new WagmiAdapter({
ssr: true
ssr: true,
projectId,
networks
})
// 4. Create modal
Expand Down

0 comments on commit 04b31ac

Please sign in to comment.