@justaname.id/react
Interfaces
- BaseAcceptSubnameRequest
- BaseAddSubnameRequest
- BaseRejectSubnameRequest
- BaseRevokeSubnameRequest
- JustaNameContextProps
- JustaNameProvider
- SubnameUpdate
- UseAcceptSubname
- UseAccountInvitationsOptions
- UseAddSubname
- UseAddressSubnamesOptions
- UseCommunitiesOptions
- UseCommunitySubnamesOptions
- UseConnectedWalletSubnamesOptions
- UseIsSubnameAvailableOptions
- UseIsSubnameAvailableResult
- UseRejectSubname
- UseRevokeSubname
- UseSearchSubnamesOptions
- UseSubnameOptions
- UseSubnameSignatureResult
- UseUpdateSubnameResult
Functions
JustaNameProvider
▸ JustaNameProvider(props
, context?
): ReactNode
Provides JustaName context to child components, allowing them to access and interact with the JustaName service.
Parameters
Name | Type | Description |
---|---|---|
props | JustaNameProvider | The props for the JustaNameProvider component. |
context? | any | - |
Returns
ReactNode
The provider component wrapping children.
Component
Defined in
packages/@justaname.id/react/src/lib/providers/JustaNameProvider.tsx:58
packages/@justaname.id/react/src/lib/providers/JustaNameProvider.tsx:73
SignatureOnMounted
▸ SignatureOnMounted(props
, context?
): ReactNode
Parameters
Name | Type |
---|---|
props | Object |
context? | any |
Returns
ReactNode
Defined in
packages/@justaname.id/react/src/lib/components/SignatureOnMounted.tsx:5
buildAccountInvitationsKey
▸ buildAccountInvitationsKey(address
, chainId
): (undefined
| string
| ChainId
)[]
Parameters
Name | Type |
---|---|
address | undefined | string |
chainId | ChainId |
Returns
(undefined
| string
| ChainId
)[]
Defined in
packages/@justaname.id/react/src/lib/hooks/useAccountInvitations.ts:11
buildAccountSubnamesKey
▸ buildAccountSubnamesKey(address
, chainId
, ensDomain?
): any
[]
Constructs a unique cache key for storing and retrieving subnames data associated with a wallet address.
Parameters
Name | Type | Description |
---|---|---|
address | undefined | string | The Ethereum address of the connected wallet. |
chainId | ChainId | |
ensDomain? | string |
Returns
any
[]
A unique cache key array for react-query.
Defined in
packages/@justaname.id/react/src/lib/hooks/useAccountSubnames.ts:23
buildAddressSubnamesKey
▸ buildAddressSubnamesKey(address
, chainId
): any
[]
Constructs a unique cache key for storing and retrieving subnames data associated with a wallet address.
Parameters
Name | Type | Description |
---|---|---|
address | undefined | string | The Ethereum address of the connected wallet. |
chainId | ChainId |
Returns
any
[]
A unique cache key array for react-query.
Defined in
packages/@justaname.id/react/src/lib/hooks/useAddressSubnames.ts:21
buildCommunitiesKey
▸ buildCommunitiesKey(chainId
, orderBy
, orderDirection
): (string
| ChainId
)[]
Parameters
Name | Type |
---|---|
chainId | ChainId |
orderBy | string |
orderDirection | string |
Returns
(string
| ChainId
)[]
Defined in
packages/@justaname.id/react/src/lib/hooks/useCommunities.ts:5
buildCommunitySubnamesKey
▸ buildCommunitySubnamesKey(domainName
, isClaimed
, chainId
, page
, limit
): (undefined
| string
| number
| boolean
)[]
Parameters
Name | Type |
---|---|
domainName | undefined | string |
isClaimed | boolean |
chainId | ChainId |
page | number |
limit | number |
Returns
(undefined
| string
| number
| boolean
)[]
Defined in
packages/@justaname.id/react/src/lib/hooks/useCommunitySubnames.ts:5
buildIsSubnameAvailableKey
▸ buildIsSubnameAvailableKey(username
, ensDomain
, chainId
): (string
| ChainId
)[]
Parameters
Name | Type |
---|---|
username | string |
ensDomain | string |
chainId | ChainId |
Returns
(string
| ChainId
)[]
Defined in
packages/@justaname.id/react/src/lib/hooks/useIsSubnameAvailable.ts:7
buildRecordsBySubnameKey
▸ buildRecordsBySubnameKey(subname
, chainId
, providerUrl
): (string
| ChainId
)[]
Parameters
Name | Type |
---|---|
subname | string |
chainId | ChainId |
providerUrl | string |
Returns
(string
| ChainId
)[]
Defined in
packages/@justaname.id/react/src/lib/hooks/useRecords.ts:5
buildSearchSubnamesKey
▸ buildSearchSubnamesKey(subname
): (undefined
| string
)[]
Parameters
Name | Type |
---|---|
subname | undefined | string |
Returns
(undefined
| string
)[]
Defined in
packages/@justaname.id/react/src/lib/hooks/useSearchSubnames.ts:9
buildSignature
▸ buildSignature(address
): string
[]
Parameters
Name | Type |
---|---|
address | string |
Returns
string
[]
Defined in
packages/@justaname.id/react/src/lib/hooks/useSubnameSignature.ts:9
buildSubnameBySubnameKey
▸ buildSubnameBySubnameKey(subname
, chainId
): (string
| ChainId
)[]
Generates a unique cache key for storing and retrieving subname details.
Parameters
Name | Type | Description |
---|---|---|
subname | string | The subname to generate a cache key for. |
chainId | ChainId | - |
Returns
(string
| ChainId
)[]
A unique cache key array for react-query.
Defined in
packages/@justaname.id/react/src/lib/hooks/useSubname.ts:13
getSubnameDetails
▸ getSubnameDetails(fullName
, justaname
, chainId
, providerUrl
): Promise
<{ records
: SubnameRecordsResponse
= result; sanitizedRecords
: SanitizedRecords
= sanitized }>
Parameters
Name | Type |
---|---|
fullName | string |
justaname | JustaName |
chainId | ChainId |
providerUrl | string |
Returns
Promise
<{ records
: SubnameRecordsResponse
= result; sanitizedRecords
: SanitizedRecords
= sanitized }>
Defined in
packages/@justaname.id/react/src/lib/hooks/useRecords.ts:17
useAcceptSubname
▸ useAcceptSubname(): UseAcceptSubname
Custom hook for performing a mutation to accept a subname.
Returns
An object containing the acceptSubname
async function to initiate the subname accept, and a boolean acceptSubnamePending
indicating the mutation's pending state.
Defined in
packages/@justaname.id/react/src/lib/hooks/useAcceptSubname.ts:44
useAccountInvitations
▸ useAccountInvitations(props?
): UseAccountInvitationsResult
Parameters
Name | Type |
---|---|
props | UseAccountInvitationsOptions |
Returns
UseAccountInvitationsResult
Defined in
packages/@justaname.id/react/src/lib/hooks/useAccountInvitations.ts:41
useAccountSubnames
▸ useAccountSubnames(props?
): UseAccountSubnamesResult
Custom hook to fetch subnames associated with the connected wallet's address.
Parameters
Name | Type | Description |
---|---|---|
props | UseConnectedWalletSubnamesOptions | Optional configurations for subname retrieval. |
Returns
UseAccountSubnamesResult
The result object containing subnames data, loading state, and a refetch function.
Defined in
packages/@justaname.id/react/src/lib/hooks/useAccountSubnames.ts:73
useAddSubname
▸ useAddSubname<T
>(): UseAddSubname
<T
>
Custom hook for performing a mutation to add a subname.
Type parameters
Name | Type | Description |
---|---|---|
T | any | The type of additional parameters that can be passed to the claim subname mutation, extending the base request. |
Returns
An object containing the addSubname
async function to initiate the subname claim, and a boolean claimSubnamePending
indicating the mutation's pending state.
Defined in
packages/@justaname.id/react/src/lib/hooks/useAddSubname.ts:35
useAddressSubnames
▸ useAddressSubnames(props
): UseAddressSubnamesResult
Custom hook to fetch subnames associated with a wallet's address.
Parameters
Name | Type | Description |
---|---|---|
props | UseAddressSubnamesOptions | Optional configurations for subname retrieval. |
Returns
UseAddressSubnamesResult
The result object containing subnames data, loading state, and a refetch function.
Defined in
packages/@justaname.id/react/src/lib/hooks/useAddressSubnames.ts:71
useCommunities
▸ useCommunities(props
): UseInfiniteQueryResult
<InfiniteData
<SubnameGetAllCommunitiesChainIdResponse
, unknown
>, Error
>
Parameters
Name | Type |
---|---|
props | UseCommunitiesOptions |
Returns
UseInfiniteQueryResult
<InfiniteData
<SubnameGetAllCommunitiesChainIdResponse
, unknown
>, Error
>
Defined in
packages/@justaname.id/react/src/lib/hooks/useCommunities.ts:21
useCommunitySubnames
▸ useCommunitySubnames(props
): UseInfiniteQueryResult
<InfiniteData
<SubnameGetAllByDomainChainIdResponse
, unknown
>, Error
>
Parameters
Name | Type |
---|---|
props | UseCommunitySubnamesOptions |
Returns
UseInfiniteQueryResult
<InfiniteData
<SubnameGetAllByDomainChainIdResponse
, unknown
>, Error
>
Defined in
packages/@justaname.id/react/src/lib/hooks/useCommunitySubnames.ts:27
useIsSubnameAvailable
▸ useIsSubnameAvailable(props
): UseIsSubnameAvailableResult
Custom hook to check if a subname is available for registration under a given ENS domain.
Parameters
Name | Type | Description |
---|---|---|
props | UseIsSubnameAvailableOptions | The options including the username and ENS domain to check. |
Returns
An object containing the availability status of the subname (isAvailable
)
and the loading state of the query (isLoading
).
Defined in
packages/@justaname.id/react/src/lib/hooks/useIsSubnameAvailable.ts:39
useJustaName
▸ useJustaName(): JustaNameContextProps
Custom hook for accessing the JustaNameContext.
Returns
The context value with JustaName service instance and configuration.
Hook
Throws
If the hook is used outside a JustaNameProvider.
Defined in
packages/@justaname.id/react/src/lib/providers/JustaNameProvider.tsx:107
useMounted
▸ useMounted(): boolean
A custom React hook to determine if a component has been mounted.
Returns
boolean
A boolean flag indicating whether the component is currently mounted.
Defined in
packages/@justaname.id/react/src/lib/hooks/useMounted.ts:10
useMountedAccount
▸ useMountedAccount(): { address
: undefined
; addresses
: undefined
; chain
: undefined
; chainId
: undefined
; connector
: undefined
; isConnected
: boolean
; isConnecting
: false
; isDisconnected
: true
; isReconnecting
: false
; status
: "disconnected"
} | { address
: `0x\{string}\` ; `addresses`: readonly [\`0x{string}`, `0x\{string}\`] ; `chain`: `undefined` \| `Chain` ; `chainId`: `number` ; `connector`: `Connector` ; `isConnected`: `boolean` ; `isConnecting`: ``false`` ; `isDisconnected`: ``false`` ; `isReconnecting`: ``false`` ; `status`: ``"connected"`` } \| \{ `address`: `undefined` \| \`0x{string}` ; addresses
: undefined
| readonly `0x\{string}\`[] ; `chain`: `undefined` \| `Chain` ; `chainId`: `undefined` \| `number` ; `connector`: `undefined` \| `Connector` ; `isConnected`: `boolean` ; `isConnecting`: ``false`` ; `isDisconnected`: ``false`` ; `isReconnecting`: ``true`` ; `status`: ``"reconnecting"`` } \| \{ `address`: `undefined` \| \`0x{string}` ; addresses
: undefined
| readonly `0x${string}`[] ; chain
: undefined
| Chain
; chainId
: undefined
| number
; connector
: undefined
| Connector
; isConnected
: boolean
; isConnecting
: true
; isDisconnected
: false
; isReconnecting
: false
; status
: "connecting"
}
A custom hook that wraps the useAccount
hook from wagmi, incorporating a component mount check.
Returns
{ address
: undefined
; addresses
: undefined
; chain
: undefined
; chainId
: undefined
; connector
: undefined
; isConnected
: boolean
; isConnecting
: false
; isDisconnected
: true
; isReconnecting
: false
; status
: "disconnected"
} | { address
: `0x\{string}\` ; `addresses`: readonly [\`0x{string}`, `0x\{string}\`] ; `chain`: `undefined` \| `Chain` ; `chainId`: `number` ; `connector`: `Connector` ; `isConnected`: `boolean` ; `isConnecting`: ``false`` ; `isDisconnected`: ``false`` ; `isReconnecting`: ``false`` ; `status`: ``"connected"`` } \| \{ `address`: `undefined` \| \`0x{string}` ; addresses
: undefined
| readonly `0x\{string}\`[] ; `chain`: `undefined` \| `Chain` ; `chainId`: `undefined` \| `number` ; `connector`: `undefined` \| `Connector` ; `isConnected`: `boolean` ; `isConnecting`: ``false`` ; `isDisconnected`: ``false`` ; `isReconnecting`: ``true`` ; `status`: ``"reconnecting"`` } \| \{ `address`: `undefined` \| \`0x{string}` ; addresses
: undefined
| readonly `0x${string}`[] ; chain
: undefined
| Chain
; chainId
: undefined
| number
; connector
: undefined
| Connector
; isConnected
: boolean
; isConnecting
: true
; isDisconnected
: false
; isReconnecting
: false
; status
: "connecting"
}
An enhanced account object that includes all properties and methods from useAccount
,
along with an improved isConnected
boolean that also takes the component's mount state into consideration.
Defined in
packages/@justaname.id/react/src/lib/hooks/useMountedAccount.ts:12
useRecords
▸ useRecords(props
): UseRecordsResult
Parameters
Name | Type |
---|---|
props | UseRecordsProps |
Returns
UseRecordsResult
Defined in
packages/@justaname.id/react/src/lib/hooks/useRecords.ts:71
useRejectSubname
▸ useRejectSubname(): UseRejectSubname
Custom hook for performing a mutation to reject a subname.
Returns
An object containing the rejectSubname
async function to initiate the subname reject, and a boolean rejectSubnamePending
indicating the mutation's pending state.
Defined in
packages/@justaname.id/react/src/lib/hooks/useRejectSubname.ts:38
useRevokeSubname
▸ useRevokeSubname<T
>(): UseRevokeSubname
<T
>
Custom hook for performing a mutation to revoke a subname.
Type parameters
Name | Type | Description |
---|---|---|
T | any | The type of additional parameters that can be passed to the revoke subname mutation, extending the base request. |
Returns
An object containing the revokeSubname
async function to initiate the subname revoke, and a boolean revokeSubnamePending
indicating the mutation's pending state.
Defined in
packages/@justaname.id/react/src/lib/hooks/useRevokeSubname.ts:39
useSearchSubnames
▸ useSearchSubnames(props?
): UseSearchSubnamesResult
Parameters
Name | Type |
---|---|
props | UseSearchSubnamesOptions |
Returns
UseSearchSubnamesResult
Defined in
packages/@justaname.id/react/src/lib/hooks/useSearchSubnames.ts:29
useSubname
▸ useSubname(props
): UseSubnameResult
Custom hook to query for details about a specific subname using the JustaName service.
Parameters
Name | Type | Description |
---|---|---|
props | UseSubnameOptions | The options for fetching the subname. |
Returns
UseSubnameResult
An object containing the subname data, loading state, and a refetch function.
Defined in
packages/@justaname.id/react/src/lib/hooks/useSubname.ts:52
useSubnameSignature
▸ useSubnameSignature(): UseSubnameSignatureResult
Custom hook to request a challenge for a subname and obtain a signature proving ownership of an address.
Returns
An object containing the function to initiate the signing process (subnameSignature
)
and a boolean indicating if the signature operation is pending (subnameSignaturePending
).
Defined in
packages/@justaname.id/react/src/lib/hooks/useSubnameSignature.ts:22
useUpdateSubname
▸ useUpdateSubname(): UseUpdateSubnameResult
Custom hook to handle the subname claim or update process.
Returns
An object containing methods and properties to handle the mutation state.
Defined in
packages/@justaname.id/react/src/lib/hooks/useUpdateSubname.ts:32