@ensnode/ensnode-react 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,203 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { QueryObserverOptions, QueryClient } from '@tanstack/react-query';
3
+ export { QueryClient } from '@tanstack/react-query';
4
+ import * as _ensnode_ensnode_sdk from '@ensnode/ensnode-sdk';
5
+ import { ClientOptions, ResolverRecordsSelection, ResolveRecordsRequest, ResolveRecordsResponse, ResolvePrimaryNameRequest, ResolvePrimaryNameResponse, ResolvePrimaryNamesRequest, ResolvePrimaryNamesResponse, ConfigResponse, IndexingStatusRequest, IndexingStatusResponse } from '@ensnode/ensnode-sdk';
6
+ export { ResolverRecordsSelection } from '@ensnode/ensnode-sdk';
7
+ import * as react from 'react';
8
+
9
+ /**
10
+ * Configuration options for the ENSNode provider
11
+ */
12
+ interface ENSNodeConfig {
13
+ /** The ENSNode API client configuration */
14
+ client: ClientOptions;
15
+ }
16
+ /**
17
+ * Base query parameters that can be passed to hooks
18
+ */
19
+ interface QueryParameter<TData = unknown, TError = Error> {
20
+ query?: Partial<QueryObserverOptions<TData, TError, TData, TData, readonly unknown[]>>;
21
+ }
22
+ /**
23
+ * Configuration parameter for hooks that need access to config
24
+ */
25
+ interface ConfigParameter<TConfig extends ENSNodeConfig = ENSNodeConfig> {
26
+ config?: TConfig | undefined;
27
+ }
28
+ /**
29
+ * Parameters for the useRecords hook.
30
+ *
31
+ * If `name` is null, the query will not be executed.
32
+ */
33
+ interface UseRecordsParameters<SELECTION extends ResolverRecordsSelection> extends Omit<ResolveRecordsRequest<SELECTION>, "name">, QueryParameter<ResolveRecordsResponse<SELECTION>> {
34
+ name: ResolveRecordsRequest<SELECTION>["name"] | null;
35
+ }
36
+ /**
37
+ * Parameters for the usePrimaryName hook.
38
+ *
39
+ * If `address` is null, the query will not be executed.
40
+ */
41
+ interface UsePrimaryNameParameters extends Omit<ResolvePrimaryNameRequest, "address">, QueryParameter<ResolvePrimaryNameResponse> {
42
+ address: ResolvePrimaryNameRequest["address"] | null;
43
+ }
44
+ /**
45
+ * Parameters for the usePrimaryNames hook.
46
+ *
47
+ * If `address` is null, the query will not be executed.
48
+ */
49
+ interface UsePrimaryNamesParameters extends Omit<ResolvePrimaryNamesRequest, "address">, QueryParameter<ResolvePrimaryNamesResponse> {
50
+ address: ResolvePrimaryNamesRequest["address"] | null;
51
+ }
52
+
53
+ interface ENSNodeProviderProps {
54
+ /** ENSNode configuration */
55
+ config: ENSNodeConfig;
56
+ /**
57
+ * Optional QueryClient instance. If provided, you must wrap your app with QueryClientProvider yourself.
58
+ * If not provided, ENSNodeProvider will create and manage its own QueryClient internally.
59
+ */
60
+ queryClient?: QueryClient;
61
+ /**
62
+ * Custom query client options when auto-creating a QueryClient.
63
+ * Only used when queryClient is not provided.
64
+ */
65
+ queryClientOptions?: ConstructorParameters<typeof QueryClient>[0];
66
+ }
67
+ declare function ENSNodeProvider(parameters: React.PropsWithChildren<ENSNodeProviderProps>): react.FunctionComponentElement<{
68
+ children: React.ReactNode;
69
+ config: ENSNodeConfig;
70
+ }> | react.FunctionComponentElement<_tanstack_react_query.QueryClientProviderProps>;
71
+ /**
72
+ * Helper function to create ENSNode configuration
73
+ */
74
+ declare function createConfig(options?: {
75
+ url?: string | URL;
76
+ }): ENSNodeConfig;
77
+
78
+ /**
79
+ * React context for ENSNode configuration
80
+ */
81
+ declare const ENSNodeContext: react.Context<ENSNodeConfig | undefined>;
82
+
83
+ /**
84
+ * Hook to access the ENSNode configuration from context or parameters
85
+ *
86
+ * @param parameters - Optional config parameter that overrides context
87
+ * @returns The ENSNode configuration
88
+ * @throws Error if no config is available in context or parameters
89
+ */
90
+ declare function useENSNodeConfig<TConfig extends ENSNodeConfig = ENSNodeConfig>(config: TConfig | undefined): TConfig;
91
+
92
+ /**
93
+ * Resolves records for an ENS name (Forward Resolution).
94
+ *
95
+ * @param parameters - Configuration for the ENS name resolution
96
+ * @returns Query result with resolved records
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * import { useRecords } from "@ensnode/ensnode-react";
101
+ *
102
+ * function DisplayNameRecords() {
103
+ * const { data, isLoading, error } = useRecords({
104
+ * name: "jesse.base.eth",
105
+ * selection: {
106
+ * addresses: [60], // ETH CoinType
107
+ * texts: ["avatar", "com.twitter"]
108
+ * }
109
+ * });
110
+ *
111
+ * if (isLoading) return <div>Loading...</div>;
112
+ * if (error) return <div>Error: {error.message}</div>;
113
+ *
114
+ * return (
115
+ * <div>
116
+ * <h3>Resolved Records for vitalik.eth</h3>
117
+ * {data.records.addresses && (
118
+ * <p>ETH Address: {data.records.addresses[60]}</p>
119
+ * )}
120
+ * {data.records.texts && (
121
+ * <div>
122
+ * <p>Avatar: {data.records.texts.avatar}</p>
123
+ * <p>Twitter: {data.records.texts["com.twitter"]}</p>
124
+ * </div>
125
+ * )}
126
+ * </div>
127
+ * );
128
+ * }
129
+ * ```
130
+ */
131
+ declare function useRecords<SELECTION extends ResolverRecordsSelection>(parameters: UseRecordsParameters<SELECTION> & ConfigParameter): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ResolveRecordsResponse<SELECTION>, Error>;
132
+
133
+ /**
134
+ * Resolves the primary name of a specified address (Reverse Resolution).
135
+ *
136
+ * @param parameters - Configuration for the address resolution
137
+ * @returns Query result with resolved primary name
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * import { usePrimaryName } from "@ensnode/ensnode-react";
142
+ *
143
+ * function DisplayPrimaryNameAndAvatar() {
144
+ * const { data, isLoading, error } = usePrimaryName({
145
+ * address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
146
+ * chainId: 1, // Ethereum Mainnet
147
+ * });
148
+ *
149
+ * if (isLoading) return <div>Loading...</div>;
150
+ * if (error) return <div>Error: {error.message}</div>;
151
+ *
152
+ * return (
153
+ * <div>
154
+ * <h3>Primary Name (for Mainnet)</h3>
155
+ * <p>{data.name ?? "No Primary Name"}</p>
156
+ * </div>
157
+ * );
158
+ * }
159
+ * ```
160
+ */
161
+ declare function usePrimaryName(parameters: UsePrimaryNameParameters & ConfigParameter): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ResolvePrimaryNameResponse, Error>;
162
+
163
+ /**
164
+ * Resolves the primary names of a specified address across multiple chains.
165
+ *
166
+ * @param parameters - Configuration for the address resolution
167
+ * @returns Query result with resolved primary names
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * import { usePrimaryNames } from "@ensnode/ensnode-react";
172
+ *
173
+ * function DisplayPrimaryNames() {
174
+ * const { data, isLoading, error } = usePrimaryNames({
175
+ * address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
176
+ * });
177
+ *
178
+ * if (isLoading) return <div>Loading...</div>;
179
+ * if (error) return <div>Error: {error.message}</div>;
180
+ *
181
+ * return (
182
+ * <div>
183
+ * {Object.entries(data.names).map(([chainId, name]) => (
184
+ * <div key={chainId}>
185
+ * <h3>Primary Name (Chain Id: {chainId})</h3>
186
+ * <p>{name}</p>
187
+ * </div>
188
+ * ))}
189
+ * </div>
190
+ * );
191
+ * }
192
+ * ```
193
+ */
194
+ declare function usePrimaryNames(parameters: UsePrimaryNamesParameters & ConfigParameter): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ResolvePrimaryNamesResponse, Error>;
195
+
196
+ type UseENSIndexerConfigParameters = QueryParameter<ConfigResponse>;
197
+ declare function useENSIndexerConfig(parameters?: ConfigParameter & UseENSIndexerConfigParameters): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ENSIndexerPublicConfig, Error>;
198
+
199
+ interface UseIndexingStatusParameters extends IndexingStatusRequest, QueryParameter<IndexingStatusResponse> {
200
+ }
201
+ declare function useIndexingStatus(parameters?: ConfigParameter & UseIndexingStatusParameters): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ENSIndexerOverallIndexingStatus, Error>;
202
+
203
+ export { type ConfigParameter, type ENSNodeConfig, ENSNodeContext, ENSNodeProvider, type ENSNodeProviderProps, type QueryParameter, type UsePrimaryNameParameters, type UsePrimaryNamesParameters, type UseRecordsParameters, createConfig, useENSIndexerConfig, useENSNodeConfig, useIndexingStatus, usePrimaryName, usePrimaryNames, useRecords };
@@ -0,0 +1,203 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { QueryObserverOptions, QueryClient } from '@tanstack/react-query';
3
+ export { QueryClient } from '@tanstack/react-query';
4
+ import * as _ensnode_ensnode_sdk from '@ensnode/ensnode-sdk';
5
+ import { ClientOptions, ResolverRecordsSelection, ResolveRecordsRequest, ResolveRecordsResponse, ResolvePrimaryNameRequest, ResolvePrimaryNameResponse, ResolvePrimaryNamesRequest, ResolvePrimaryNamesResponse, ConfigResponse, IndexingStatusRequest, IndexingStatusResponse } from '@ensnode/ensnode-sdk';
6
+ export { ResolverRecordsSelection } from '@ensnode/ensnode-sdk';
7
+ import * as react from 'react';
8
+
9
+ /**
10
+ * Configuration options for the ENSNode provider
11
+ */
12
+ interface ENSNodeConfig {
13
+ /** The ENSNode API client configuration */
14
+ client: ClientOptions;
15
+ }
16
+ /**
17
+ * Base query parameters that can be passed to hooks
18
+ */
19
+ interface QueryParameter<TData = unknown, TError = Error> {
20
+ query?: Partial<QueryObserverOptions<TData, TError, TData, TData, readonly unknown[]>>;
21
+ }
22
+ /**
23
+ * Configuration parameter for hooks that need access to config
24
+ */
25
+ interface ConfigParameter<TConfig extends ENSNodeConfig = ENSNodeConfig> {
26
+ config?: TConfig | undefined;
27
+ }
28
+ /**
29
+ * Parameters for the useRecords hook.
30
+ *
31
+ * If `name` is null, the query will not be executed.
32
+ */
33
+ interface UseRecordsParameters<SELECTION extends ResolverRecordsSelection> extends Omit<ResolveRecordsRequest<SELECTION>, "name">, QueryParameter<ResolveRecordsResponse<SELECTION>> {
34
+ name: ResolveRecordsRequest<SELECTION>["name"] | null;
35
+ }
36
+ /**
37
+ * Parameters for the usePrimaryName hook.
38
+ *
39
+ * If `address` is null, the query will not be executed.
40
+ */
41
+ interface UsePrimaryNameParameters extends Omit<ResolvePrimaryNameRequest, "address">, QueryParameter<ResolvePrimaryNameResponse> {
42
+ address: ResolvePrimaryNameRequest["address"] | null;
43
+ }
44
+ /**
45
+ * Parameters for the usePrimaryNames hook.
46
+ *
47
+ * If `address` is null, the query will not be executed.
48
+ */
49
+ interface UsePrimaryNamesParameters extends Omit<ResolvePrimaryNamesRequest, "address">, QueryParameter<ResolvePrimaryNamesResponse> {
50
+ address: ResolvePrimaryNamesRequest["address"] | null;
51
+ }
52
+
53
+ interface ENSNodeProviderProps {
54
+ /** ENSNode configuration */
55
+ config: ENSNodeConfig;
56
+ /**
57
+ * Optional QueryClient instance. If provided, you must wrap your app with QueryClientProvider yourself.
58
+ * If not provided, ENSNodeProvider will create and manage its own QueryClient internally.
59
+ */
60
+ queryClient?: QueryClient;
61
+ /**
62
+ * Custom query client options when auto-creating a QueryClient.
63
+ * Only used when queryClient is not provided.
64
+ */
65
+ queryClientOptions?: ConstructorParameters<typeof QueryClient>[0];
66
+ }
67
+ declare function ENSNodeProvider(parameters: React.PropsWithChildren<ENSNodeProviderProps>): react.FunctionComponentElement<{
68
+ children: React.ReactNode;
69
+ config: ENSNodeConfig;
70
+ }> | react.FunctionComponentElement<_tanstack_react_query.QueryClientProviderProps>;
71
+ /**
72
+ * Helper function to create ENSNode configuration
73
+ */
74
+ declare function createConfig(options?: {
75
+ url?: string | URL;
76
+ }): ENSNodeConfig;
77
+
78
+ /**
79
+ * React context for ENSNode configuration
80
+ */
81
+ declare const ENSNodeContext: react.Context<ENSNodeConfig | undefined>;
82
+
83
+ /**
84
+ * Hook to access the ENSNode configuration from context or parameters
85
+ *
86
+ * @param parameters - Optional config parameter that overrides context
87
+ * @returns The ENSNode configuration
88
+ * @throws Error if no config is available in context or parameters
89
+ */
90
+ declare function useENSNodeConfig<TConfig extends ENSNodeConfig = ENSNodeConfig>(config: TConfig | undefined): TConfig;
91
+
92
+ /**
93
+ * Resolves records for an ENS name (Forward Resolution).
94
+ *
95
+ * @param parameters - Configuration for the ENS name resolution
96
+ * @returns Query result with resolved records
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * import { useRecords } from "@ensnode/ensnode-react";
101
+ *
102
+ * function DisplayNameRecords() {
103
+ * const { data, isLoading, error } = useRecords({
104
+ * name: "jesse.base.eth",
105
+ * selection: {
106
+ * addresses: [60], // ETH CoinType
107
+ * texts: ["avatar", "com.twitter"]
108
+ * }
109
+ * });
110
+ *
111
+ * if (isLoading) return <div>Loading...</div>;
112
+ * if (error) return <div>Error: {error.message}</div>;
113
+ *
114
+ * return (
115
+ * <div>
116
+ * <h3>Resolved Records for vitalik.eth</h3>
117
+ * {data.records.addresses && (
118
+ * <p>ETH Address: {data.records.addresses[60]}</p>
119
+ * )}
120
+ * {data.records.texts && (
121
+ * <div>
122
+ * <p>Avatar: {data.records.texts.avatar}</p>
123
+ * <p>Twitter: {data.records.texts["com.twitter"]}</p>
124
+ * </div>
125
+ * )}
126
+ * </div>
127
+ * );
128
+ * }
129
+ * ```
130
+ */
131
+ declare function useRecords<SELECTION extends ResolverRecordsSelection>(parameters: UseRecordsParameters<SELECTION> & ConfigParameter): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ResolveRecordsResponse<SELECTION>, Error>;
132
+
133
+ /**
134
+ * Resolves the primary name of a specified address (Reverse Resolution).
135
+ *
136
+ * @param parameters - Configuration for the address resolution
137
+ * @returns Query result with resolved primary name
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * import { usePrimaryName } from "@ensnode/ensnode-react";
142
+ *
143
+ * function DisplayPrimaryNameAndAvatar() {
144
+ * const { data, isLoading, error } = usePrimaryName({
145
+ * address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
146
+ * chainId: 1, // Ethereum Mainnet
147
+ * });
148
+ *
149
+ * if (isLoading) return <div>Loading...</div>;
150
+ * if (error) return <div>Error: {error.message}</div>;
151
+ *
152
+ * return (
153
+ * <div>
154
+ * <h3>Primary Name (for Mainnet)</h3>
155
+ * <p>{data.name ?? "No Primary Name"}</p>
156
+ * </div>
157
+ * );
158
+ * }
159
+ * ```
160
+ */
161
+ declare function usePrimaryName(parameters: UsePrimaryNameParameters & ConfigParameter): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ResolvePrimaryNameResponse, Error>;
162
+
163
+ /**
164
+ * Resolves the primary names of a specified address across multiple chains.
165
+ *
166
+ * @param parameters - Configuration for the address resolution
167
+ * @returns Query result with resolved primary names
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * import { usePrimaryNames } from "@ensnode/ensnode-react";
172
+ *
173
+ * function DisplayPrimaryNames() {
174
+ * const { data, isLoading, error } = usePrimaryNames({
175
+ * address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
176
+ * });
177
+ *
178
+ * if (isLoading) return <div>Loading...</div>;
179
+ * if (error) return <div>Error: {error.message}</div>;
180
+ *
181
+ * return (
182
+ * <div>
183
+ * {Object.entries(data.names).map(([chainId, name]) => (
184
+ * <div key={chainId}>
185
+ * <h3>Primary Name (Chain Id: {chainId})</h3>
186
+ * <p>{name}</p>
187
+ * </div>
188
+ * ))}
189
+ * </div>
190
+ * );
191
+ * }
192
+ * ```
193
+ */
194
+ declare function usePrimaryNames(parameters: UsePrimaryNamesParameters & ConfigParameter): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ResolvePrimaryNamesResponse, Error>;
195
+
196
+ type UseENSIndexerConfigParameters = QueryParameter<ConfigResponse>;
197
+ declare function useENSIndexerConfig(parameters?: ConfigParameter & UseENSIndexerConfigParameters): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ENSIndexerPublicConfig, Error>;
198
+
199
+ interface UseIndexingStatusParameters extends IndexingStatusRequest, QueryParameter<IndexingStatusResponse> {
200
+ }
201
+ declare function useIndexingStatus(parameters?: ConfigParameter & UseIndexingStatusParameters): _tanstack_react_query.UseQueryResult<_ensnode_ensnode_sdk.ENSIndexerOverallIndexingStatus, Error>;
202
+
203
+ export { type ConfigParameter, type ENSNodeConfig, ENSNodeContext, ENSNodeProvider, type ENSNodeProviderProps, type QueryParameter, type UsePrimaryNameParameters, type UsePrimaryNamesParameters, type UseRecordsParameters, createConfig, useENSIndexerConfig, useENSNodeConfig, useIndexingStatus, usePrimaryName, usePrimaryNames, useRecords };
package/dist/index.js ADDED
@@ -0,0 +1,231 @@
1
+ // src/provider.tsx
2
+ import { ENSNodeClient } from "@ensnode/ensnode-sdk";
3
+ import { QueryClient, QueryClientProvider, useQueryClient } from "@tanstack/react-query";
4
+ import { createElement, useMemo } from "react";
5
+
6
+ // src/context.ts
7
+ import { createContext } from "react";
8
+ var ENSNodeContext = createContext(void 0);
9
+ ENSNodeContext.displayName = "ENSNodeContext";
10
+
11
+ // src/provider.tsx
12
+ function ENSNodeInternalProvider({
13
+ children,
14
+ config
15
+ }) {
16
+ const memoizedConfig = useMemo(() => config, [config]);
17
+ return createElement(ENSNodeContext.Provider, { value: memoizedConfig }, children);
18
+ }
19
+ function ENSNodeProvider(parameters) {
20
+ const { children, config, queryClient, queryClientOptions } = parameters;
21
+ let hasExistingQueryClient = false;
22
+ try {
23
+ hasExistingQueryClient = Boolean(useQueryClient());
24
+ } catch {
25
+ hasExistingQueryClient = false;
26
+ }
27
+ if (queryClient) {
28
+ if (!hasExistingQueryClient) {
29
+ throw new Error(
30
+ "When providing a custom queryClient, you must wrap your app with QueryClientProvider. Either remove the queryClient prop to use auto-managed setup, or wrap with QueryClientProvider."
31
+ );
32
+ }
33
+ return createElement(ENSNodeInternalProvider, { config, children });
34
+ }
35
+ if (hasExistingQueryClient) {
36
+ return createElement(ENSNodeInternalProvider, { config, children });
37
+ }
38
+ const defaultQueryClient = useMemo(
39
+ () => new QueryClient({
40
+ defaultOptions: {
41
+ queries: {
42
+ retry: 3,
43
+ staleTime: 1e3 * 60 * 5,
44
+ // 5 minutes
45
+ gcTime: 1e3 * 60 * 30
46
+ // 30 minutes
47
+ }
48
+ },
49
+ ...queryClientOptions
50
+ }),
51
+ [queryClientOptions]
52
+ );
53
+ return createElement(
54
+ QueryClientProvider,
55
+ { client: defaultQueryClient },
56
+ createElement(ENSNodeInternalProvider, { config, children })
57
+ );
58
+ }
59
+ function createConfig(options) {
60
+ const url = options?.url ? new URL(options.url) : ENSNodeClient.defaultOptions().url;
61
+ return {
62
+ client: {
63
+ ...ENSNodeClient.defaultOptions(),
64
+ url
65
+ }
66
+ };
67
+ }
68
+
69
+ // src/hooks/useENSNodeConfig.ts
70
+ import { useContext } from "react";
71
+ function useENSNodeConfig(config) {
72
+ const contextConfig = useContext(ENSNodeContext);
73
+ const resolvedConfig = config ?? contextConfig;
74
+ if (!resolvedConfig) {
75
+ throw new Error(
76
+ "useENSNodeConfig must be used within an ENSNodeProvider or you must pass a config parameter"
77
+ );
78
+ }
79
+ return resolvedConfig;
80
+ }
81
+
82
+ // src/hooks/useRecords.ts
83
+ import { useQuery } from "@tanstack/react-query";
84
+
85
+ // src/utils/query.ts
86
+ import {
87
+ ENSNodeClient as ENSNodeClient2
88
+ } from "@ensnode/ensnode-sdk";
89
+ var queryKeys = {
90
+ base: (url) => ["ensnode", url],
91
+ resolve: (url) => [...queryKeys.base(url), "resolve"],
92
+ records: (url, args) => [...queryKeys.resolve(url), "records", args],
93
+ primaryName: (url, args) => [...queryKeys.resolve(url), "primary-name", args],
94
+ primaryNames: (url, args) => [...queryKeys.resolve(url), "primary-names", args],
95
+ config: (url) => [...queryKeys.base(url), "config"],
96
+ indexingStatus: (url, args) => [...queryKeys.base(url), "config", args]
97
+ };
98
+ function createRecordsQueryOptions(config, args) {
99
+ return {
100
+ enabled: true,
101
+ queryKey: queryKeys.records(config.client.url.href, args),
102
+ queryFn: async () => {
103
+ const client = new ENSNodeClient2(config.client);
104
+ return client.resolveRecords(args.name, args.selection, args);
105
+ }
106
+ };
107
+ }
108
+ function createPrimaryNameQueryOptions(config, args) {
109
+ return {
110
+ enabled: true,
111
+ queryKey: queryKeys.primaryName(config.client.url.href, args),
112
+ queryFn: async () => {
113
+ const client = new ENSNodeClient2(config.client);
114
+ return client.resolvePrimaryName(args.address, args.chainId, args);
115
+ }
116
+ };
117
+ }
118
+ function createPrimaryNamesQueryOptions(config, args) {
119
+ return {
120
+ enabled: true,
121
+ queryKey: queryKeys.primaryNames(config.client.url.href, args),
122
+ queryFn: async () => {
123
+ const client = new ENSNodeClient2(config.client);
124
+ return client.resolvePrimaryNames(args.address, args);
125
+ }
126
+ };
127
+ }
128
+ function createENSIndexerConfigQueryOptions(config) {
129
+ return {
130
+ enabled: true,
131
+ queryKey: queryKeys.config(config.client.url.href),
132
+ queryFn: async () => {
133
+ const client = new ENSNodeClient2(config.client);
134
+ return client.config();
135
+ }
136
+ };
137
+ }
138
+ function createIndexingStatusQueryOptions(config, args) {
139
+ return {
140
+ enabled: true,
141
+ queryKey: queryKeys.indexingStatus(config.client.url.href, args),
142
+ queryFn: async () => {
143
+ const client = new ENSNodeClient2(config.client);
144
+ return client.indexingStatus(args);
145
+ }
146
+ };
147
+ }
148
+
149
+ // src/hooks/useRecords.ts
150
+ function useRecords(parameters) {
151
+ const { config, query = {}, name, ...args } = parameters;
152
+ const _config = useENSNodeConfig(config);
153
+ const canEnable = name !== null;
154
+ const queryOptions = canEnable ? createRecordsQueryOptions(_config, { ...args, name }) : { enabled: false, queryKey: ["disabled"] };
155
+ const options = {
156
+ ...queryOptions,
157
+ ...query,
158
+ enabled: canEnable && (query.enabled ?? queryOptions.enabled)
159
+ };
160
+ return useQuery(options);
161
+ }
162
+
163
+ // src/hooks/usePrimaryName.ts
164
+ import { useQuery as useQuery2 } from "@tanstack/react-query";
165
+ function usePrimaryName(parameters) {
166
+ const { config, query = {}, address, ...args } = parameters;
167
+ const _config = useENSNodeConfig(config);
168
+ const canEnable = address !== null;
169
+ const queryOptions = canEnable ? createPrimaryNameQueryOptions(_config, { ...args, address }) : { enabled: false, queryKey: ["disabled"] };
170
+ const options = {
171
+ ...queryOptions,
172
+ ...query,
173
+ enabled: canEnable && (query.enabled ?? queryOptions.enabled)
174
+ };
175
+ return useQuery2(options);
176
+ }
177
+
178
+ // src/hooks/usePrimaryNames.ts
179
+ import { useQuery as useQuery3 } from "@tanstack/react-query";
180
+ function usePrimaryNames(parameters) {
181
+ const { config, query = {}, address, ...args } = parameters;
182
+ const _config = useENSNodeConfig(config);
183
+ const canEnable = address !== null;
184
+ const queryOptions = canEnable ? createPrimaryNamesQueryOptions(_config, { ...args, address }) : { enabled: false, queryKey: ["disabled"] };
185
+ const options = {
186
+ ...queryOptions,
187
+ ...query,
188
+ enabled: canEnable && (query.enabled ?? queryOptions.enabled)
189
+ };
190
+ return useQuery3(options);
191
+ }
192
+
193
+ // src/hooks/useENSIndexerConfig.ts
194
+ import { useQuery as useQuery4 } from "@tanstack/react-query";
195
+ function useENSIndexerConfig(parameters = {}) {
196
+ const { config, query = {} } = parameters;
197
+ const _config = useENSNodeConfig(config);
198
+ const queryOptions = createENSIndexerConfigQueryOptions(_config);
199
+ const options = {
200
+ ...queryOptions,
201
+ ...query,
202
+ enabled: query.enabled ?? queryOptions.enabled
203
+ };
204
+ return useQuery4(options);
205
+ }
206
+
207
+ // src/hooks/useIndexingStatus.ts
208
+ import { useQuery as useQuery5 } from "@tanstack/react-query";
209
+ function useIndexingStatus(parameters = {}) {
210
+ const { config, query = {}, ...args } = parameters;
211
+ const _config = useENSNodeConfig(config);
212
+ const queryOptions = createIndexingStatusQueryOptions(_config, { ...args });
213
+ const options = {
214
+ ...queryOptions,
215
+ ...query,
216
+ enabled: query.enabled ?? queryOptions.enabled
217
+ };
218
+ return useQuery5(options);
219
+ }
220
+ export {
221
+ ENSNodeContext,
222
+ ENSNodeProvider,
223
+ createConfig,
224
+ useENSIndexerConfig,
225
+ useENSNodeConfig,
226
+ useIndexingStatus,
227
+ usePrimaryName,
228
+ usePrimaryNames,
229
+ useRecords
230
+ };
231
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/provider.tsx","../src/context.ts","../src/hooks/useENSNodeConfig.ts","../src/hooks/useRecords.ts","../src/utils/query.ts","../src/hooks/usePrimaryName.ts","../src/hooks/usePrimaryNames.ts","../src/hooks/useENSIndexerConfig.ts","../src/hooks/useIndexingStatus.ts"],"sourcesContent":["\"use client\";\n\nimport { ENSNodeClient } from \"@ensnode/ensnode-sdk\";\nimport { QueryClient, QueryClientProvider, useQueryClient } from \"@tanstack/react-query\";\nimport { createElement, useMemo } from \"react\";\n\nimport { ENSNodeContext } from \"./context\";\nimport type { ENSNodeConfig } from \"./types\";\n\nexport interface ENSNodeProviderProps {\n /** ENSNode configuration */\n config: ENSNodeConfig;\n\n /**\n * Optional QueryClient instance. If provided, you must wrap your app with QueryClientProvider yourself.\n * If not provided, ENSNodeProvider will create and manage its own QueryClient internally.\n */\n queryClient?: QueryClient;\n\n /**\n * Custom query client options when auto-creating a QueryClient.\n * Only used when queryClient is not provided.\n */\n queryClientOptions?: ConstructorParameters<typeof QueryClient>[0];\n}\n\nfunction ENSNodeInternalProvider({\n children,\n config,\n}: {\n children: React.ReactNode;\n config: ENSNodeConfig;\n}) {\n // Memoize the config to prevent unnecessary re-renders\n const memoizedConfig = useMemo(() => config, [config]);\n\n return createElement(ENSNodeContext.Provider, { value: memoizedConfig }, children);\n}\n\nexport function ENSNodeProvider(parameters: React.PropsWithChildren<ENSNodeProviderProps>) {\n const { children, config, queryClient, queryClientOptions } = parameters;\n\n // Check if we're already inside a QueryClientProvider\n let hasExistingQueryClient = false;\n try {\n hasExistingQueryClient = Boolean(useQueryClient());\n } catch {\n // useQueryClient throws if not inside a QueryClientProvider\n hasExistingQueryClient = false;\n }\n\n // If user provided a queryClient, they must handle QueryClientProvider themselves\n if (queryClient) {\n if (!hasExistingQueryClient) {\n throw new Error(\n \"When providing a custom queryClient, you must wrap your app with QueryClientProvider. \" +\n \"Either remove the queryClient prop to use auto-managed setup, or wrap with QueryClientProvider.\",\n );\n }\n return createElement(ENSNodeInternalProvider, { config, children });\n }\n\n // If already inside a QueryClientProvider, just use that\n if (hasExistingQueryClient) {\n return createElement(ENSNodeInternalProvider, { config, children });\n }\n\n // Create our own QueryClient and QueryClientProvider\n const defaultQueryClient = useMemo(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: {\n retry: 3,\n staleTime: 1000 * 60 * 5, // 5 minutes\n gcTime: 1000 * 60 * 30, // 30 minutes\n },\n },\n ...queryClientOptions,\n }),\n [queryClientOptions],\n );\n\n return createElement(\n QueryClientProvider,\n { client: defaultQueryClient },\n createElement(ENSNodeInternalProvider, { config, children }),\n );\n}\n\n/**\n * Helper function to create ENSNode configuration\n */\nexport function createConfig(options?: {\n url?: string | URL;\n}): ENSNodeConfig {\n const url = options?.url ? new URL(options.url) : ENSNodeClient.defaultOptions().url;\n\n return {\n client: {\n ...ENSNodeClient.defaultOptions(),\n url,\n },\n };\n}\n","import { createContext } from \"react\";\n\nimport type { ENSNodeConfig } from \"./types\";\n\n/**\n * React context for ENSNode configuration\n */\nexport const ENSNodeContext = createContext<ENSNodeConfig | undefined>(undefined);\n\n/**\n * Display name for debugging\n */\nENSNodeContext.displayName = \"ENSNodeContext\";\n","\"use client\";\n\nimport { useContext } from \"react\";\nimport { ENSNodeContext } from \"../context\";\nimport type { ENSNodeConfig } from \"../types\";\n\n/**\n * Hook to access the ENSNode configuration from context or parameters\n *\n * @param parameters - Optional config parameter that overrides context\n * @returns The ENSNode configuration\n * @throws Error if no config is available in context or parameters\n */\nexport function useENSNodeConfig<TConfig extends ENSNodeConfig = ENSNodeConfig>(\n config: TConfig | undefined,\n): TConfig {\n const contextConfig = useContext(ENSNodeContext);\n\n // Use provided config or fall back to context\n const resolvedConfig = config ?? contextConfig;\n\n if (!resolvedConfig) {\n throw new Error(\n \"useENSNodeConfig must be used within an ENSNodeProvider or you must pass a config parameter\",\n );\n }\n\n return resolvedConfig as TConfig;\n}\n","\"use client\";\n\nimport type { ResolverRecordsSelection } from \"@ensnode/ensnode-sdk\";\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport type { ConfigParameter, UseRecordsParameters } from \"../types\";\nimport { createRecordsQueryOptions } from \"../utils/query\";\nimport { useENSNodeConfig } from \"./useENSNodeConfig\";\n\n/**\n * Resolves records for an ENS name (Forward Resolution).\n *\n * @param parameters - Configuration for the ENS name resolution\n * @returns Query result with resolved records\n *\n * @example\n * ```typescript\n * import { useRecords } from \"@ensnode/ensnode-react\";\n *\n * function DisplayNameRecords() {\n * const { data, isLoading, error } = useRecords({\n * name: \"jesse.base.eth\",\n * selection: {\n * addresses: [60], // ETH CoinType\n * texts: [\"avatar\", \"com.twitter\"]\n * }\n * });\n *\n * if (isLoading) return <div>Loading...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div>\n * <h3>Resolved Records for vitalik.eth</h3>\n * {data.records.addresses && (\n * <p>ETH Address: {data.records.addresses[60]}</p>\n * )}\n * {data.records.texts && (\n * <div>\n * <p>Avatar: {data.records.texts.avatar}</p>\n * <p>Twitter: {data.records.texts[\"com.twitter\"]}</p>\n * </div>\n * )}\n * </div>\n * );\n * }\n * ```\n */\nexport function useRecords<SELECTION extends ResolverRecordsSelection>(\n parameters: UseRecordsParameters<SELECTION> & ConfigParameter,\n) {\n const { config, query = {}, name, ...args } = parameters;\n const _config = useENSNodeConfig(config);\n\n const canEnable = name !== null;\n\n const queryOptions = canEnable\n ? createRecordsQueryOptions(_config, { ...args, name })\n : { enabled: false, queryKey: [\"disabled\"] as const };\n\n const options = {\n ...queryOptions,\n ...query,\n enabled: canEnable && (query.enabled ?? queryOptions.enabled),\n };\n\n return useQuery(options);\n}\n","\"use client\";\n\nimport {\n ENSNodeClient,\n IndexingStatusRequest,\n ResolvePrimaryNameRequest,\n ResolvePrimaryNamesRequest,\n ResolveRecordsRequest,\n ResolverRecordsSelection,\n} from \"@ensnode/ensnode-sdk\";\nimport type { ENSNodeConfig } from \"../types\";\n\n/**\n * Query keys for hooks. Simply keys by path and arguments.\n */\nexport const queryKeys = {\n base: (url: string) => [\"ensnode\", url] as const,\n\n resolve: (url: string) => [...queryKeys.base(url), \"resolve\"] as const,\n\n records: (url: string, args: ResolveRecordsRequest<any>) =>\n [...queryKeys.resolve(url), \"records\", args] as const,\n\n primaryName: (url: string, args: ResolvePrimaryNameRequest) =>\n [...queryKeys.resolve(url), \"primary-name\", args] as const,\n\n primaryNames: (url: string, args: ResolvePrimaryNamesRequest) =>\n [...queryKeys.resolve(url), \"primary-names\", args] as const,\n\n config: (url: string) => [...queryKeys.base(url), \"config\"] as const,\n\n indexingStatus: (url: string, args: IndexingStatusRequest) =>\n [...queryKeys.base(url), \"config\", args] as const,\n};\n\n/**\n * Creates query options for Records Resolution\n */\nexport function createRecordsQueryOptions<SELECTION extends ResolverRecordsSelection>(\n config: ENSNodeConfig,\n args: ResolveRecordsRequest<SELECTION>,\n) {\n return {\n enabled: true,\n queryKey: queryKeys.records(config.client.url.href, args),\n queryFn: async () => {\n const client = new ENSNodeClient(config.client);\n return client.resolveRecords(args.name, args.selection, args);\n },\n };\n}\n\n/**\n * Creates query options for Primary Name Resolution\n */\nexport function createPrimaryNameQueryOptions(\n config: ENSNodeConfig,\n args: ResolvePrimaryNameRequest,\n) {\n return {\n enabled: true,\n queryKey: queryKeys.primaryName(config.client.url.href, args),\n queryFn: async () => {\n const client = new ENSNodeClient(config.client);\n return client.resolvePrimaryName(args.address, args.chainId, args);\n },\n };\n}\n\n/**\n * Creates query options for Primary Name Resolution\n */\nexport function createPrimaryNamesQueryOptions(\n config: ENSNodeConfig,\n args: ResolvePrimaryNamesRequest,\n) {\n return {\n enabled: true,\n queryKey: queryKeys.primaryNames(config.client.url.href, args),\n queryFn: async () => {\n const client = new ENSNodeClient(config.client);\n return client.resolvePrimaryNames(args.address, args);\n },\n };\n}\n\n/**\n * Creates query options for ENSIndexer Config API\n */\nexport function createENSIndexerConfigQueryOptions(config: ENSNodeConfig) {\n return {\n enabled: true,\n queryKey: queryKeys.config(config.client.url.href),\n queryFn: async () => {\n const client = new ENSNodeClient(config.client);\n return client.config();\n },\n };\n}\n\n/**\n * Creates query options for ENSIndexer Indexing Status API\n */\nexport function createIndexingStatusQueryOptions(\n config: ENSNodeConfig,\n args: IndexingStatusRequest,\n) {\n return {\n enabled: true,\n queryKey: queryKeys.indexingStatus(config.client.url.href, args),\n queryFn: async () => {\n const client = new ENSNodeClient(config.client);\n return client.indexingStatus(args);\n },\n };\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ConfigParameter, UsePrimaryNameParameters } from \"../types\";\nimport { createPrimaryNameQueryOptions } from \"../utils/query\";\nimport { useENSNodeConfig } from \"./useENSNodeConfig\";\n\n/**\n * Resolves the primary name of a specified address (Reverse Resolution).\n *\n * @param parameters - Configuration for the address resolution\n * @returns Query result with resolved primary name\n *\n * @example\n * ```typescript\n * import { usePrimaryName } from \"@ensnode/ensnode-react\";\n *\n * function DisplayPrimaryNameAndAvatar() {\n * const { data, isLoading, error } = usePrimaryName({\n * address: \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n * chainId: 1, // Ethereum Mainnet\n * });\n *\n * if (isLoading) return <div>Loading...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div>\n * <h3>Primary Name (for Mainnet)</h3>\n * <p>{data.name ?? \"No Primary Name\"}</p>\n * </div>\n * );\n * }\n * ```\n */\nexport function usePrimaryName(parameters: UsePrimaryNameParameters & ConfigParameter) {\n const { config, query = {}, address, ...args } = parameters;\n const _config = useENSNodeConfig(config);\n\n const canEnable = address !== null;\n\n const queryOptions = canEnable\n ? createPrimaryNameQueryOptions(_config, { ...args, address })\n : { enabled: false, queryKey: [\"disabled\"] as const };\n\n const options = {\n ...queryOptions,\n ...query,\n enabled: canEnable && (query.enabled ?? queryOptions.enabled),\n };\n\n return useQuery(options);\n}\n","\"use client\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ConfigParameter, UsePrimaryNamesParameters } from \"../types\";\nimport { createPrimaryNamesQueryOptions } from \"../utils/query\";\nimport { useENSNodeConfig } from \"./useENSNodeConfig\";\n\n/**\n * Resolves the primary names of a specified address across multiple chains.\n *\n * @param parameters - Configuration for the address resolution\n * @returns Query result with resolved primary names\n *\n * @example\n * ```typescript\n * import { usePrimaryNames } from \"@ensnode/ensnode-react\";\n *\n * function DisplayPrimaryNames() {\n * const { data, isLoading, error } = usePrimaryNames({\n * address: \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n * });\n *\n * if (isLoading) return <div>Loading...</div>;\n * if (error) return <div>Error: {error.message}</div>;\n *\n * return (\n * <div>\n * {Object.entries(data.names).map(([chainId, name]) => (\n * <div key={chainId}>\n * <h3>Primary Name (Chain Id: {chainId})</h3>\n * <p>{name}</p>\n * </div>\n * ))}\n * </div>\n * );\n * }\n * ```\n */\nexport function usePrimaryNames(parameters: UsePrimaryNamesParameters & ConfigParameter) {\n const { config, query = {}, address, ...args } = parameters;\n const _config = useENSNodeConfig(config);\n\n const canEnable = address !== null;\n\n const queryOptions = canEnable\n ? createPrimaryNamesQueryOptions(_config, { ...args, address })\n : { enabled: false, queryKey: [\"disabled\"] as const };\n\n const options = {\n ...queryOptions,\n ...query,\n enabled: canEnable && (query.enabled ?? queryOptions.enabled),\n };\n\n return useQuery(options);\n}\n","import { ConfigResponse } from \"@ensnode/ensnode-sdk\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport { ConfigParameter, QueryParameter } from \"../types\";\nimport { createENSIndexerConfigQueryOptions } from \"../utils/query\";\nimport { useENSNodeConfig } from \"./useENSNodeConfig\";\n\ntype UseENSIndexerConfigParameters = QueryParameter<ConfigResponse>;\n\nexport function useENSIndexerConfig(\n parameters: ConfigParameter & UseENSIndexerConfigParameters = {},\n) {\n const { config, query = {} } = parameters;\n const _config = useENSNodeConfig(config);\n\n const queryOptions = createENSIndexerConfigQueryOptions(_config);\n\n const options = {\n ...queryOptions,\n ...query,\n enabled: query.enabled ?? queryOptions.enabled,\n };\n\n return useQuery(options);\n}\n","import { IndexingStatusRequest, IndexingStatusResponse } from \"@ensnode/ensnode-sdk\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { ConfigParameter, QueryParameter } from \"../types\";\nimport { createIndexingStatusQueryOptions } from \"../utils/query\";\nimport { useENSNodeConfig } from \"./useENSNodeConfig\";\n\ninterface UseIndexingStatusParameters\n extends IndexingStatusRequest,\n QueryParameter<IndexingStatusResponse> {}\n\nexport function useIndexingStatus(parameters: ConfigParameter & UseIndexingStatusParameters = {}) {\n const { config, query = {}, ...args } = parameters;\n const _config = useENSNodeConfig(config);\n\n const queryOptions = createIndexingStatusQueryOptions(_config, { ...args });\n\n const options = {\n ...queryOptions,\n ...query,\n enabled: query.enabled ?? queryOptions.enabled,\n };\n\n return useQuery(options);\n}\n"],"mappings":";AAEA,SAAS,qBAAqB;AAC9B,SAAS,aAAa,qBAAqB,sBAAsB;AACjE,SAAS,eAAe,eAAe;;;ACJvC,SAAS,qBAAqB;AAOvB,IAAM,iBAAiB,cAAyC,MAAS;AAKhF,eAAe,cAAc;;;ADc7B,SAAS,wBAAwB;AAAA,EAC/B;AAAA,EACA;AACF,GAGG;AAED,QAAM,iBAAiB,QAAQ,MAAM,QAAQ,CAAC,MAAM,CAAC;AAErD,SAAO,cAAc,eAAe,UAAU,EAAE,OAAO,eAAe,GAAG,QAAQ;AACnF;AAEO,SAAS,gBAAgB,YAA2D;AACzF,QAAM,EAAE,UAAU,QAAQ,aAAa,mBAAmB,IAAI;AAG9D,MAAI,yBAAyB;AAC7B,MAAI;AACF,6BAAyB,QAAQ,eAAe,CAAC;AAAA,EACnD,QAAQ;AAEN,6BAAyB;AAAA,EAC3B;AAGA,MAAI,aAAa;AACf,QAAI,CAAC,wBAAwB;AAC3B,YAAM,IAAI;AAAA,QACR;AAAA,MAEF;AAAA,IACF;AACA,WAAO,cAAc,yBAAyB,EAAE,QAAQ,SAAS,CAAC;AAAA,EACpE;AAGA,M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