Skip to content

Commit

Permalink
add useAppKitAccount to hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomas committed Sep 30, 2024
1 parent b4e72e2 commit b9269aa
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
17 changes: 17 additions & 0 deletions docs/appkit/next/core/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,23 @@ export default Component(){
}
```

## useAppKitAccount

Hook for accessing account data and connection status.

List of possible status: "reconnecting" | "connected" | "disconnected" | "connecting" | undefined

```ts
import { useAppKitAccount } from "@reown/appkit/react";


export default Component(){
const { address, isConnected, status } = useAppKitAccount()

//...
}
```

## Ethereum Library

<PlatformTabs groupId="eth-lib" activeOptions={["wagmi", "ethers"]}>
Expand Down
18 changes: 18 additions & 0 deletions docs/appkit/react/core/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,24 @@ export default Component(){
}
```


## useAppKitAccount

Hook for accessing account data and connection status.

List of possible status: "reconnecting" | "connected" | "disconnected" | "connecting" | undefined

```ts
import { useAppKitAccount } from "@reown/appkit/react";


export default Component(){
const { address, isConnected, status } = useAppKitAccount()

//...
}
```

## Ethereum Library

<PlatformTabs groupId="eth-lib" activeOptions={["wagmi", "ethers"]}>
Expand Down
16 changes: 0 additions & 16 deletions docs/appkit/react/wagmi/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@ import Button from '../../../components/button'

You can use [Wagmi hooks](https://wagmi.sh/react/hooks/useAccount) to sign messages, interact with smart contracts, and much more.

### useAccount

Hook for accessing account data and connection status.

```tsx
import { useAccount } from 'wagmi'

function App() {
const { address, isConnecting, isDisconnected } = useAccount()

if (isConnecting) return <div>Connecting…</div>
if (isDisconnected) return <div>Disconnected</div>
return <div>{address}</div>
}
```

### useSignMessage

Hook for signing messages with connected account.
Expand Down

0 comments on commit b9269aa

Please sign in to comment.