Skip to content

Commit

Permalink
docs: reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Sep 8, 2023
1 parent ed12877 commit b0f87d9
Show file tree
Hide file tree
Showing 142 changed files with 240 additions and 307 deletions.
250 changes: 134 additions & 116 deletions docs/.vitepress/sidebar.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/core/actions.md → docs/core/api/actions.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup>
import { getSidebar } from '../.vitepress/sidebar'
import { getSidebar } from '../../.vitepress/sidebar'

const actions = getSidebar()['/core']
.find(x => x.text === 'API').items
.find(x => x.link === '/core/actions').items
.find(x => x.link === '/core/api/actions').items
.sort((a, b) => a.text.localeCompare(b.text))
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const typeName = 'Connect'

# connect

Action for connecting accounts with [connectors](/core/connectors).
Action for connecting accounts with [connectors](/core/api/connectors).

## Import

Expand Down Expand Up @@ -60,7 +60,7 @@ const result = await connect(config, {

`CreateConnectorFn | Connector`

[Connector](/core/connectors) to connect with.
[Connector](/core/api/connectors) to connect with.

::: code-group
```ts [index.ts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { type DisconnectParameters } from '@wagmi/core'

`Connector | undefined`

[Connector](/core/connectors) to disconnect with.
[Connector](/core/api/connectors) to disconnect with.

::: code-group
```ts [index.ts]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const typeName = 'Reconnect'

# reconnect

Action for reconnecting [connectors](/core/connectors).
Action for reconnecting [connectors](/core/api/connectors).

## Import

Expand Down Expand Up @@ -37,7 +37,7 @@ import { type ReconnectParameters } from '@wagmi/core'

`(CreateConnectorFn | Connector)[] | undefined`

- [Connectors](/core/connectors) to reconnect to.
- [Connectors](/core/api/connectors) to reconnect to.
- Defaults to [`Config['connectors']`](/core/createConfig#connectors).

::: code-group
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const result = await signMessage(config, {

`Connector | undefined`

[Connector](/core/connectors) to sign message with.
[Connector](/core/api/connectors) to sign message with.

::: code-group
```ts [index.ts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const result = await signTypedData(config, {

`Connector | undefined`

[Connector](/core/connectors) to sign data with.
[Connector](/core/api/connectors) to sign data with.

::: code-group
```ts [index.ts]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { type SwitchAccountParameters } from '@wagmi/core'

`Connector`

[Connector](/core/connectors) to switch to.
[Connector](/core/api/connectors) to switch to.

::: code-group
```ts [index.ts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const result = await switchChain(config, {

`Connector`

[Connector](/core/connectors) to switch chain with.
[Connector](/core/api/connectors) to switch chain with.

::: code-group
```ts [index.ts]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/core/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ yarn add @wagmi/core @wagmi/connectors viem
```
:::

- [Wagmi Connectors](/core/connectors) is a collection of interfaces for linking accounts/wallets to Wagmi.
- [Wagmi Connectors](/core/api/connectors) is a collection of interfaces for linking accounts/wallets to Wagmi.
- [Viem](https://viem.sh) is a TypeScript interface for Ethereum that performs blockchain operations.
- [TypeScript](/react/typescript) is optional, but highly recommended. Learn more about [TypeScript support](/core/typescript).

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/core/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Unfortunately [TypeScript doesn't support importing JSON `as const` yet](https:/

Anywhere you see the `abi` or `types` configuration property, you can likely use const-asserted or inline ABIs and Typed Data to get type-safety and inference. These properties are also called out in the docs.

Here's what [`readContract`](/core/actions/readContract) looks like with and without a const-asserted `abi` property.
Here's what [`readContract`](/core/api/actions/readContract) looks like with and without a const-asserted `abi` property.

::: code-group
```ts twoslash [Const-Asserted]
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ features:
- icon: 🚀
title: 20+ React Hooks
details: React Hooks for accounts, wallets, contracts, transactions, signing, ENS, and more.
link: /react/hooks
link: /react/api/hooks
linkText: See all hooks
- icon: 🦄
title: TypeScript Ready
Expand All @@ -34,7 +34,7 @@ features:
- icon: 💼
title: Connect Wallet
details: Official wallet connectors for MetaMask, WalletConnect, Coinbase Wallet, and more.
link: /react/connectors
link: /react/api/connectors
linkText: See all connectors
- icon: 👟
title: Caching, Deduplication & Persistence
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/react/actions.md → docs/react/api/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ function App() {
<<< @/snippets/react/config.ts[config.ts]
:::

See the [Wagmi Core docs](/core/actions) for more info on what actions are available.
See the [Wagmi Core docs](/core/api/actions) for more info on what actions are available.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/react/connectors.md → docs/react/api/connectors.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup>
import { getSidebar } from '../.vitepress/sidebar'
import { getSidebar } from '../../.vitepress/sidebar'

const connectors = getSidebar()['/react']
.find(x => x.text === 'API').items
.find(x => x.link === '/react/connectors').items
.find(x => x.link === '/react/api/connectors').items
.sort((a, b) => a.text.localeCompare(b.text))
</script>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/react/hooks.md → docs/react/api/hooks.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup>
import { getSidebar } from '../.vitepress/sidebar'
import { getSidebar } from '../../.vitepress/sidebar'

const hooks = getSidebar()['/react']
.find(x => x.text === 'API').items
.find(x => x.link === '/react/hooks').items
.find(x => x.link === '/react/api/hooks').items
.sort((a, b) => a.text.localeCompare(b.text))
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ import { type UseAccountReturnType } from 'wagmi'

## Action

- [`getAccount`](/core/actions/getAccount)
- [`watchAccount`](/core/actions/getAccount#watchaccount)
- [`getAccount`](/core/api/actions/getAccount)
- [`watchAccount`](/core/api/actions/watchAccount)
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ import { type UseBalanceReturnType } from 'wagmi'

## Action

[getBalance](/core/actions/getBalance)
[getBalance](/core/api/actions/getBalance)
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function App() {
`boolean | UseWatchBlockNumberParameters | undefined`

- Enables/disables listening for block number changes.
- Can pass a subset of [`UseWatchBlockNumberParameters`](/react/hooks/useWatchBlockNumber#parameters)directly to [`useWatchBlockNumber`](/react/hooks/useWatchBlockNumber).
- Can pass a subset of [`UseWatchBlockNumberParameters`](/react/api/hooks/useWatchBlockNumber#parameters)directly to [`useWatchBlockNumber`](/react/api/hooks/useWatchBlockNumber).

::: code-group
```tsx [index.tsx]
Expand Down Expand Up @@ -139,5 +139,5 @@ import { type UseBlockNumberReturnType } from 'wagmi'

## Action

- [getBlockNumber](/core/actions/getBlockNumber)
- [watchBlockNumber](/core/actions/getBlockNumber#watchblocknumber)
- [getBlockNumber](/core/api/actions/getBlockNumber)
- [watchBlockNumber](/core/api/actions/watchBlockNumber)
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ Current chain ID from [`config.state.chainId`](/react/createConfig#chainid).

## Action

- [`getChainId`](/core/actions/getChainId)
- [`watchChainId`](/core/actions/getChainId#watchchainid)
- [`getChainId`](/core/api/actions/getChainId)
- [`watchChainId`](/core/api/actions/watchChainId)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TVariables = '{ chainId?: number | undefined; connector?: CreateConnectorF

# useConnect

Hook for connecting accounts with [connectors](/react/connectors).
Hook for connecting accounts with [connectors](/react/api/connectors).

## Import

Expand Down Expand Up @@ -110,4 +110,4 @@ Not all connectors support connecting directly to a `chainId` (e.g. they don't s

## Action

[`connect`](/core/actions/connect)
[`connect`](/core/api/actions/connect)
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ import { type UseConnectionsReturnType } from 'wagmi'

## Action

- [`getConnections`](/core/actions/getConnections)
- [`watchConnections`](/core/actions/getConnections#watchconnections)
- [`getConnections`](/core/api/actions/getConnections)
- [`watchConnections`](/core/api/actions/watchConnections)
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ function App() {

## Actions

[`disconnect`](/core/actions/connect)
[`disconnect`](/core/api/actions/connect)
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ import { type UseEnsAddressReturnType } from 'wagmi'

## Action

[getEnsAddress](/core/actions/getEnsAddress)
[getEnsAddress](/core/api/actions/getEnsAddress)
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ import { type UseEnsAvatarReturnType } from 'wagmi'

## Action

[getEnsAvatar](/core/actions/getEnsAvatar)
[getEnsAvatar](/core/api/actions/getEnsAvatar)
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ import { type UseEnsNameReturnType } from 'wagmi'

## Action

[getEnsName](/core/actions/getEnsName)
[getEnsName](/core/api/actions/getEnsName)
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,4 @@ import { type UseEnsResolverReturnType } from 'wagmi'

## Action

[getEnsResolver](/core/actions/getEnsResolver)
[getEnsResolver](/core/api/actions/getEnsResolver)
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ import { type UseEstimateFeesPerGasReturnType } from 'wagmi'

## Action

[estimateFeesPerGas](/core/actions/estimateFeesPerGas)
[estimateFeesPerGas](/core/api/actions/estimateFeesPerGas)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TVariables = '{ connectors?: (CreateConnectorFn | Connector)[] | undefined

# useReconnect

Hook for reconnecting [connectors](/core/connectors).
Hook for reconnecting [connectors](/core/api/connectors).

## Import

Expand Down Expand Up @@ -102,4 +102,4 @@ function App() {

## Action

[`reconnect`](/core/actions/reconnect)
[`reconnect`](/core/api/actions/reconnect)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# useSwitchAccount

Hook for switching accounts with [connectors](/core/connectors).
Hook for switching accounts with [connectors](/core/api/connectors).

## Import

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ import { type UseTokenReturnType } from 'wagmi'

## Action

[getToken](/core/actions/getToken)
[getToken](/core/api/actions/getToken)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
85 changes: 0 additions & 85 deletions docs/react/migration-guide.md

This file was deleted.

Loading

0 comments on commit b0f87d9

Please sign in to comment.