Skip to content

Commit

Permalink
docs: update stalltimeout code usage (#3187)
Browse files Browse the repository at this point in the history
* docs: update stalltimeout code usage

* docs: remove stallTimeout options
  • Loading branch information
1997roylee authored Nov 6, 2023
1 parent fd9be40 commit cb09fbe
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 261 deletions.
23 changes: 1 addition & 22 deletions docs/pages/core/providers/alchemy.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,4 @@ const { chains, publicClient } = configureChains(
[mainnet],
[alchemyProvider({ apiKey: 'yourAlchemyApiKey' })],
)
```

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {10}
import { configureChains, mainnet } from '@wagmi/core'
import { alchemyProvider } from '@wagmi/core/providers/alchemy'
import { publicProvider } from '@wagmi/core/providers/public'

const { chains, publicClient } = configureChains(
[mainnet],
[
alchemyProvider({
apiKey: 'yourAlchemyApiKey',
stallTimeout: 1_000,
}),
publicProvider(),
],
)
```
```
22 changes: 0 additions & 22 deletions docs/pages/core/providers/infura.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,3 @@ const { chains, publicClient } = configureChains(
[infuraProvider({ apiKey: 'yourInfuraApiKey' })],
)
```

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {11}
import { configureChains } from '@wagmi/core'
import { mainnet, polygon } from '@wagmi/core/chains'
import { infuraProvider } from '@wagmi/core/providers/infura'
import { publicProvider } from '@wagmi/core/providers/public'

const { chains, publicClient } = configureChains(
[mainnet, polygon],
[
infuraProvider({
apiKey: 'yourInfuraApiKey',
stallTimeout: 1_000,
}),
publicProvider(),
],
)
```
24 changes: 0 additions & 24 deletions docs/pages/core/providers/jsonRpc.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,3 @@ const { chains, publicClient } = configureChains(
],
)
```

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {13,15}
import { configureChains } from '@wagmi/core'
import { mainnet, polygon } from '@wagmi/core/chains'
import { jsonRpcProvider } from '@wagmi/core/providers/jsonRpc'

const { chains, publicClient } = configureChains(
[mainnet, polygon],
[
jsonRpcProvider({
rpc: (chain) => ({
http: `https://${chain.id}.example.com`,
webSocket: `wss://${chain.id}.example.com`,
}),
stallTimeout: 1000,
}),
alchemyProvider({ stallTimeout: 1000 }),
],
)
```
20 changes: 0 additions & 20 deletions docs/pages/core/providers/public.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,3 @@ Note: The above example is using chains from [`@wagmi/core/chains`](/core/chains
webSocketPublicClient: PublicClient
}
```

## Configuration

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {9}
import { configureChains } from '@wagmi/core'
import { mainnet, polygon } from '@wagmi/core/chains'
import { publicProvider } from '@wagmi/core/providers/public'

const { chains, publicClient } = configureChains(
[mainnet, polygon],
[
alchemyProvider({ apiKey: 'yourAlchemyApiKey' }),
publicProvider({ stallTimeout: 1_000 }),
],
)
```
22 changes: 0 additions & 22 deletions docs/pages/react/providers/alchemy.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,3 @@ const { chains, publicClient } = configureChains(
[alchemyProvider({ apiKey: 'yourAlchemyApiKey' })],
)
```

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {11}
import { configureChains } from 'wagmi'
import { mainnet, polygon } from 'wagmi/chains'
import { alchemyProvider } from 'wagmi/providers/alchemy'
import { publicProvider } from 'wagmi/providers/public'

const { chains, publicClient } = configureChains(
[mainnet, polygon],
[
alchemyProvider({
apiKey: 'yourAlchemyApiKey',
}),
publicProvider(),
],
{ stallTimeout: 5000 },
)
```
22 changes: 0 additions & 22 deletions docs/pages/react/providers/alchemy.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,3 @@ const { chains, publicClient } = configureChains(
[alchemyProvider({ apiKey: 'yourAlchemyApiKey' })],
)
```

### stallTimeout (可选)

请求超时时间,以毫秒为单位,超时后将尝试另一个 Provider。

```ts {11}
import { configureChains } from 'wagmi'
import { mainnet, polygon } from 'wagmi/chains'
import { alchemyProvider } from 'wagmi/providers/alchemy'
import { publicProvider } from 'wagmi/providers/public'

const { chains, publicClient } = configureChains(
[mainnet, polygon],
[
alchemyProvider({
apiKey: 'yourAlchemyApiKey',
stallTimeout: 1_000,
}),
publicProvider(),
],
)
```
22 changes: 0 additions & 22 deletions docs/pages/react/providers/infura.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,3 @@ const { chains, publicClient } = configureChains(
[infuraProvider({ apiKey: 'yourInfuraApiKey' })],
)
```

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {11}
import { configureChains } from 'wagmi'
import { mainnet, polygon } from 'wagmi/chains'
import { infuraProvider } from 'wagmi/providers/infura'
import { publicProvider } from 'wagmi/providers/public'

const { chains, publicClient } = configureChains(
[mainnet, polygon],
[
infuraProvider({
apiKey: 'yourInfuraApiKey',
stallTimeout: 1_000,
}),
publicProvider(),
],
)
```
24 changes: 1 addition & 23 deletions docs/pages/react/providers/infura.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,4 @@ const { chains, publicClient } = configureChains(
[mainnet, polygon],
[infuraProvider({ apiKey: 'yourInfuraApiKey' })],
)
```

### stallTimeout (可选)

请求超时时间,以毫秒为单位,超时后将尝试另一个 Provider。

```ts {11}
import { configureChains } from 'wagmi'
import { mainnet, polygon } from 'wagmi/chains'
import { infuraProvider } from 'wagmi/providers/infura'
import { publicProvider } from 'wagmi/providers/public'

const { chains, publicClient } = configureChains(
[mainnet, polygon],
[
infuraProvider({
apiKey: 'yourInfuraApiKey',
stallTimeout: 1_000,
}),
publicProvider(),
],
)
```
```
22 changes: 0 additions & 22 deletions docs/pages/react/providers/jsonRpc.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,3 @@ const { chains, publicClient } = configureChains(
)
```

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {12}
import { chain, configureChains } from 'wagmi'
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'

const { chains, publicClient } = configureChains(
[chain.mainnet, chain.polygon],
[
jsonRpcProvider({
rpc: (chain) => ({
http: `https://${chain.id}.example.com`,
webSocket: `wss://${chain.id}.example.com`,
}),
stallTimeout: 1000,
}),
alchemyProvider({ stallTimeout: 1000 }),
],
)
```
23 changes: 0 additions & 23 deletions docs/pages/react/providers/jsonRpc.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,3 @@ const { chains, publicClient } = configureChains(
],
)
```

### stallTimeout (可选)

请求超时时间,以毫秒为单位,超时后将尝试另一个 Provider。

```ts {12}
import { chain, configureChains } from 'wagmi'
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'

const { chains, publicClient } = configureChains(
[chain.mainnet, chain.polygon],
[
jsonRpcProvider({
rpc: (chain) => ({
http: `https://${chain.id}.example.com`,
webSocket: `wss://${chain.id}.example.com`,
}),
stallTimeout: 1000,
}),
alchemyProvider({ stallTimeout: 1000 }),
],
)
```
21 changes: 1 addition & 20 deletions docs/pages/react/providers/public.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,4 @@ const { chains, publicClient } = configureChains(
publicClient: PublicClient,
webSocketPublicClient: PublicClient
}
```

## Configuration

### stallTimeout (optional)

The timeout in milliseconds after which another provider will be attempted.

```ts {8}
import { chain, configureChains } from 'wagmi'
import { publicProvider } from 'wagmi/providers/public'

const { chains, publicClient } = configureChains(
[chain.mainnet, chain.polygon],
[
alchemyProvider({ apiKey: 'yourAlchemyApiKey' }),
publicProvider({ stallTimeout: 1_000 }),
],
)
```
```
19 changes: 0 additions & 19 deletions docs/pages/react/providers/public.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,3 @@ const { chains, publicClient } = configureChains(
webSocketPublicClient: PublicClient
}
```

## 配置项

### stallTimeout (可选)

请求超时时间,以毫秒为单位,超时后将尝试另一个 Provider。

```ts {8}
import { chain, configureChains } from 'wagmi'
import { publicProvider } from 'wagmi/providers/public'

const { chains, publicClient } = configureChains(
[chain.mainnet, chain.polygon],
[
alchemyProvider({ apiKey: 'yourAlchemyApiKey' }),
publicProvider({ stallTimeout: 1_000 }),
],
)
```

1 comment on commit cb09fbe

@vercel
Copy link

@vercel vercel bot commented on cb09fbe Nov 6, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.