Skip to content

Commit

Permalink
docs: add StarknetConfig documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fracek committed Oct 18, 2024
1 parent dacb495 commit 9d7fc85
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
65 changes: 65 additions & 0 deletions docs/pages/docs/starknet-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# StarknetConfig

The React Context provider for Starknet.

## Usage

```tsx twoslash
"use client";
import React from "react";

import { mainnet } from "@starknet-react/chains";
import { StarknetConfig, publicProvider } from "@starknet-react/core";

function App() {
return (
<StarknetConfig chains={[mainnet]} provider={publicProvider()}>
{/* your app here */}
</StarknetConfig>
);
}
```

## Arguments

### chains

- Type: `Chain[]`

List of supported chains.

### provider

- Type: `ChainProviderFactory`

The JSON-RPC provider you want to use. See [the RPC providers page](/docs/providers) for more information.

### connectors

- Type: `Connector[]`

List of wallet connectors you want to use. See [the wallets page](/docs/wallets) for more information.

### explorer

- Type: `ExplorerFactory`

Explorer factory to use. See [the explorers page](/docs/explorers) for more information.

### autoConnect

- Type: `boolean | undefined`

Whether to automatically connect to the first available wallet.

### queryClient

- Type: `QueryClient`

React Query client to use.

### defaultChainId

- Type: `bigint | undefined`

Default chain to use when no wallet is connected. This chain must be included in the `chains` array.
4 changes: 4 additions & 0 deletions docs/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export const sidebar = {
text: "Upgrading to V3",
link: "/docs/upgrading-to-v3",
},
{
text: "StarknetConfig",
link: "/docs/starknet-config",
},
{
text: "Wallets",
link: "/docs/wallets",
Expand Down

0 comments on commit 9d7fc85

Please sign in to comment.