@@ -11,9 +11,10 @@ import {
1111 type SerializedIndexingStatusResponseOk ,
1212 serializeIndexingStatusResponse ,
1313} from "./api" ;
14- import { DEFAULT_ENSNODE_API_URL , ENSNodeClient } from "./client" ;
14+ import { ENSNodeClient } from "./client" ;
1515import { ClientError } from "./client-error" ;
16- import type { Name } from "./ens" ;
16+ import { DEFAULT_ENSNODE_API_URL_MAINNET , getDefaultEnsNodeUrl } from "./deployments" ;
17+ import { ENSNamespaceIds , type Name } from "./ens" ;
1718import { deserializeENSApiPublicConfig , type SerializedENSApiPublicConfig } from "./ensapi" ;
1819import {
1920 ChainIndexingConfigTypeIds ,
@@ -210,7 +211,7 @@ describe("ENSNodeClient", () => {
210211 const client = new ENSNodeClient ( ) ;
211212 const options = client . getOptions ( ) ;
212213
213- expect ( options ) . toEqual ( { url : new URL ( DEFAULT_ENSNODE_API_URL ) } ) ;
214+ expect ( options ) . toEqual ( { url : getDefaultEnsNodeUrl ( ENSNamespaceIds . Mainnet ) } ) ;
214215 } ) ;
215216
216217 it ( "should merge provided options with defaults" , ( ) => {
@@ -238,7 +239,10 @@ describe("ENSNodeClient", () => {
238239 const client = new ENSNodeClient ( ) ;
239240 const response = await client . resolveRecords ( EXAMPLE_NAME , EXAMPLE_SELECTION ) ;
240241
241- const expectedUrl = new URL ( `/api/resolve/records/${ EXAMPLE_NAME } ` , DEFAULT_ENSNODE_API_URL ) ;
242+ const expectedUrl = new URL (
243+ `/api/resolve/records/${ EXAMPLE_NAME } ` ,
244+ DEFAULT_ENSNODE_API_URL_MAINNET ,
245+ ) ;
242246 expectedUrl . searchParams . set ( "addresses" , EXAMPLE_SELECTION . addresses . join ( "," ) ) ;
243247 expectedUrl . searchParams . set ( "texts" , EXAMPLE_SELECTION . texts . join ( "," ) ) ;
244248
@@ -255,7 +259,10 @@ describe("ENSNodeClient", () => {
255259 trace : true ,
256260 } ) ;
257261
258- const expectedUrl = new URL ( `/api/resolve/records/${ EXAMPLE_NAME } ` , DEFAULT_ENSNODE_API_URL ) ;
262+ const expectedUrl = new URL (
263+ `/api/resolve/records/${ EXAMPLE_NAME } ` ,
264+ DEFAULT_ENSNODE_API_URL_MAINNET ,
265+ ) ;
259266 expectedUrl . searchParams . set ( "addresses" , EXAMPLE_SELECTION . addresses . join ( "," ) ) ;
260267 expectedUrl . searchParams . set ( "texts" , EXAMPLE_SELECTION . texts . join ( "," ) ) ;
261268 expectedUrl . searchParams . set ( "trace" , "true" ) ;
@@ -286,7 +293,7 @@ describe("ENSNodeClient", () => {
286293
287294 const expectedUrl = new URL (
288295 `/api/resolve/primary-name/${ EXAMPLE_ADDRESS } /1` ,
289- DEFAULT_ENSNODE_API_URL ,
296+ DEFAULT_ENSNODE_API_URL_MAINNET ,
290297 ) ;
291298
292299 expect ( mockFetch ) . toHaveBeenCalledWith ( expectedUrl ) ;
@@ -302,7 +309,7 @@ describe("ENSNodeClient", () => {
302309
303310 const expectedUrl = new URL (
304311 `/api/resolve/primary-name/${ EXAMPLE_ADDRESS } /1` ,
305- DEFAULT_ENSNODE_API_URL ,
312+ DEFAULT_ENSNODE_API_URL_MAINNET ,
306313 ) ;
307314 expectedUrl . searchParams . set ( "trace" , "true" ) ;
308315
@@ -321,7 +328,7 @@ describe("ENSNodeClient", () => {
321328
322329 const expectedUrl = new URL (
323330 `/api/resolve/primary-name/${ EXAMPLE_ADDRESS } /1` ,
324- DEFAULT_ENSNODE_API_URL ,
331+ DEFAULT_ENSNODE_API_URL_MAINNET ,
325332 ) ;
326333 expectedUrl . searchParams . set ( "accelerate" , "true" ) ;
327334
@@ -348,7 +355,7 @@ describe("ENSNodeClient", () => {
348355
349356 const expectedUrl = new URL (
350357 `/api/resolve/primary-names/${ EXAMPLE_ADDRESS } ` ,
351- DEFAULT_ENSNODE_API_URL ,
358+ DEFAULT_ENSNODE_API_URL_MAINNET ,
352359 ) ;
353360
354361 expect ( mockFetch ) . toHaveBeenCalledWith ( expectedUrl ) ;
@@ -366,7 +373,7 @@ describe("ENSNodeClient", () => {
366373
367374 const expectedUrl = new URL (
368375 `/api/resolve/primary-names/${ EXAMPLE_ADDRESS } ` ,
369- DEFAULT_ENSNODE_API_URL ,
376+ DEFAULT_ENSNODE_API_URL_MAINNET ,
370377 ) ;
371378 expectedUrl . searchParams . set ( "chainIds" , "1,10" ) ;
372379
@@ -382,7 +389,7 @@ describe("ENSNodeClient", () => {
382389
383390 const expectedUrl = new URL (
384391 `/api/resolve/primary-names/${ EXAMPLE_ADDRESS } ` ,
385- DEFAULT_ENSNODE_API_URL ,
392+ DEFAULT_ENSNODE_API_URL_MAINNET ,
386393 ) ;
387394 expectedUrl . searchParams . set ( "trace" , "true" ) ;
388395
@@ -401,7 +408,7 @@ describe("ENSNodeClient", () => {
401408
402409 const expectedUrl = new URL (
403410 `/api/resolve/primary-names/${ EXAMPLE_ADDRESS } ` ,
404- DEFAULT_ENSNODE_API_URL ,
411+ DEFAULT_ENSNODE_API_URL_MAINNET ,
405412 ) ;
406413 expectedUrl . searchParams . set ( "accelerate" , "true" ) ;
407414
@@ -419,7 +426,7 @@ describe("ENSNodeClient", () => {
419426 describe ( "Config API" , ( ) => {
420427 it ( "can fetch config object successfully" , async ( ) => {
421428 // arrange
422- const requestUrl = new URL ( `/api/config` , DEFAULT_ENSNODE_API_URL ) ;
429+ const requestUrl = new URL ( `/api/config` , DEFAULT_ENSNODE_API_URL_MAINNET ) ;
423430 const serializedMockedResponse = EXAMPLE_CONFIG_RESPONSE ;
424431 const mockedResponse = deserializeENSApiPublicConfig ( serializedMockedResponse ) ;
425432 const client = new ENSNodeClient ( ) ;
@@ -446,7 +453,7 @@ describe("ENSNodeClient", () => {
446453 describe ( "Indexing Status API" , ( ) => {
447454 it ( "can fetch overall indexing 'backfill' status object successfully" , async ( ) => {
448455 // arrange
449- const requestUrl = new URL ( `/api/indexing-status` , DEFAULT_ENSNODE_API_URL ) ;
456+ const requestUrl = new URL ( `/api/indexing-status` , DEFAULT_ENSNODE_API_URL_MAINNET ) ;
450457 const mockedResponse = EXAMPLE_INDEXING_STATUS_BACKFILL_RESPONSE ;
451458
452459 const client = new ENSNodeClient ( ) ;
0 commit comments