Skip to content

Commit

Permalink
dope
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia committed Aug 27, 2024
1 parent 4815844 commit 1857c11
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
20 changes: 20 additions & 0 deletions site/docs/pages/identity/use-address.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# `useAddress`

The `useAddress` hook is used to get an address from an onchain identity provider for a given name.

## Usage

```tsx
import { useAddress } from '@coinbase/onchainkit/identity';

const { data: address, isLoading } = useAddress({ name: 'zizzamia.base.eth' });
```

## Returns

[`useQuery<Promise<GetAddressReturnType>>`](/identity/types#getaddressreturntype)

## Parameters

[`UseAddressOptions`](/identity/types#useaddressoptions)
[`UseQueryOptions`](/identity/types#usequeryoptions)
17 changes: 6 additions & 11 deletions site/docs/pages/identity/use-avatar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ const { data: avatar, isLoading } = useAvatar({ ensName: 'vitalik.eth' });

## Returns

```ts
type UseAvatarOptions = {
ensName: string;
chain?: Chain;
};

type UseAvatarQueryOptions = {
enabled?: boolean;
cacheTime?: number;
};
```
[`useQuery<Promise<GetAddressReturnType>>`](/identity/types#getaddressreturntype)

## Parameters

[`UseAvatarOptions`](/identity/types#useavataroptions)
[`UseQueryOptions`](/identity/types#usequeryoptions)
17 changes: 6 additions & 11 deletions site/docs/pages/identity/use-name.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ const { data: name, isLoading } = useName({ address: '0x1234' });

## Returns

```ts
type UseNameOptions = {
address: Address; // The Ethereum address for which the ENS name is to be fetched.
chain?: Chain; // Optional chain for domain resolution
};

type UseNameQueryOptions = {
enabled?: boolean;
cacheTime?: number;
};
```
[`useQuery<Promise<GetAddressReturnType>>`](/identity/types#getaddressreturntype)

## Parameters

[`UseNameOptions`](/identity/types#usenameoptions)
[`UseQueryOptions`](/identity/types#usequeryoptions)

0 comments on commit 1857c11

Please sign in to comment.