11import type { ResolverRecordsSelection } from "../resolution" ;
22import {
3- type ConfigResponse ,
4- deserializeConfigResponse ,
53 deserializedNameTokensResponse ,
4+ deserializeEnsApiConfigResponse ,
5+ deserializeEnsApiIndexingStatusResponse ,
66 deserializeErrorResponse ,
7- deserializeIndexingStatusResponse ,
87 deserializeRegistrarActionsResponse ,
8+ type EnsApiConfigResponse ,
9+ type EnsApiIndexingStatusResponse ,
910 type ErrorResponse ,
10- type IndexingStatusResponse ,
1111 type NameTokensRequest ,
1212 type NameTokensResponse ,
1313 type RegistrarActionsFilter ,
@@ -22,8 +22,8 @@ import {
2222 type ResolvePrimaryNamesResponse ,
2323 type ResolveRecordsRequest ,
2424 type ResolveRecordsResponse ,
25- type SerializedConfigResponse ,
26- type SerializedIndexingStatusResponse ,
25+ type SerializedEnsApiConfigResponse ,
26+ type SerializedEnsApiIndexingStatusResponse ,
2727 type SerializedNameTokensResponse ,
2828 type SerializedRegistrarActionsResponse ,
2929} from "./api" ;
@@ -304,22 +304,22 @@ export class EnsApiClient {
304304 }
305305
306306 /**
307- * Fetch ENSNode Config
307+ * Fetch ENSApi Config
308308 *
309- * Fetch the ENSNode 's configuration.
309+ * Fetch the ENSApi 's configuration.
310310 *
311- * @returns {ConfigResponse }
311+ * @returns {EnsApiConfigResponse }
312312 *
313- * @throws if the ENSNode request fails
314- * @throws if the ENSNode API returns an error response
315- * @throws if the ENSNode response breaks required invariants
313+ * @throws if the ENSApi request fails
314+ * @throws if the ENSApi returns an error response
315+ * @throws if the ENSApi response breaks required invariants
316316 */
317- async config ( ) : Promise < ConfigResponse > {
317+ async config ( ) : Promise < EnsApiConfigResponse > {
318318 const url = new URL ( `/api/config` , this . options . url ) ;
319319
320320 const response = await fetch ( url ) ;
321321
322- // ENSNode API should always allow parsing a response as JSON object.
322+ // ENSApi should always allow parsing a response as JSON object.
323323 // If for some reason it's not the case, throw an error.
324324 let responseData : unknown ;
325325 try {
@@ -330,27 +330,27 @@ export class EnsApiClient {
330330
331331 if ( ! response . ok ) {
332332 const errorResponse = deserializeErrorResponse ( responseData ) ;
333- throw new Error ( `Fetching ENSNode Config Failed: ${ errorResponse . message } ` ) ;
333+ throw new Error ( `Fetching ENSApi Config Failed: ${ errorResponse . message } ` ) ;
334334 }
335335
336- return deserializeConfigResponse ( responseData as SerializedConfigResponse ) ;
336+ return deserializeEnsApiConfigResponse ( responseData as SerializedEnsApiConfigResponse ) ;
337337 }
338338
339339 /**
340- * Fetch ENSNode Indexing Status
340+ * Fetch ENSApi Indexing Status
341341 *
342- * @returns {IndexingStatusResponse }
342+ * @returns {EnsApiIndexingStatusResponse }
343343 *
344- * @throws if the ENSNode request fails
345- * @throws if the ENSNode API returns an error response
346- * @throws if the ENSNode response breaks required invariants
344+ * @throws if the ENSApi request fails
345+ * @throws if the ENSApi returns an error response
346+ * @throws if the ENSApi response breaks required invariants
347347 */
348- async indexingStatus ( ) : Promise < IndexingStatusResponse > {
348+ async indexingStatus ( ) : Promise < EnsApiIndexingStatusResponse > {
349349 const url = new URL ( `/api/indexing-status` , this . options . url ) ;
350350
351351 const response = await fetch ( url ) ;
352352
353- // ENSNode API should always allow parsing a response as JSON object.
353+ // ENSApi should always allow parsing a response as JSON object.
354354 // If for some reason it's not the case, throw an error.
355355 let responseData : unknown ;
356356 try {
@@ -374,11 +374,13 @@ export class EnsApiClient {
374374 // however, if errorResponse was defined,
375375 // throw an error with the generic server error message
376376 if ( typeof errorResponse !== "undefined" ) {
377- throw new Error ( `Fetching ENSNode Indexing Status Failed: ${ errorResponse . message } ` ) ;
377+ throw new Error ( `Fetching ENSApi Indexing Status Failed: ${ errorResponse . message } ` ) ;
378378 }
379379 }
380380
381- return deserializeIndexingStatusResponse ( responseData as SerializedIndexingStatusResponse ) ;
381+ return deserializeEnsApiIndexingStatusResponse (
382+ responseData as SerializedEnsApiIndexingStatusResponse ,
383+ ) ;
382384 }
383385
384386 /**
0 commit comments