@ensnode/ensnode-sdk 1.9.0 → 1.10.1

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.
package/README.md CHANGED
@@ -10,20 +10,19 @@ Learn more about [ENSNode](https://ensnode.io/) from [the ENSNode docs](https://
10
10
  npm install @ensnode/ensnode-sdk
11
11
  ```
12
12
 
13
- ## ENSNode Client
13
+ ## EnsNodeClient
14
14
 
15
- The `ENSNodeClient` provides a unified interface for the supported ENSNode APIs:
15
+ The `EnsNodeClient` provides a unified interface for the ENSNode REST APIs:
16
16
  - Resolution API (Protocol Accelerated Forward/Reverse Resolution)
17
17
  - Indexing Status API
18
- - Configuration API
19
18
 
20
19
  ### Basic Usage
21
20
 
22
21
  ```typescript
23
- import { ENSNodeClient, evmChainIdToCoinType } from "@ensnode/ensnode-sdk";
24
- import { mainnet } from 'viem/chains';
22
+ import { EnsNodeClient, evmChainIdToCoinType } from "@ensnode/ensnode-sdk";
23
+ import { mainnet } from "viem/chains";
25
24
 
26
- const client = new ENSNodeClient();
25
+ const client = new EnsNodeClient();
27
26
 
28
27
  // Resolution API: Records Resolution
29
28
  const { records } = await client.resolveRecords("jesse.base.eth", {
@@ -152,41 +151,32 @@ console.log(names);
152
151
  // }
153
152
  ```
154
153
 
155
- #### Configuration API
156
-
157
- ##### `config()`
158
-
159
- Fetches the ENSNode's configuration.
160
-
161
- - Returns: `ConfigResponse` - The ENSNode configuration data
162
- - Throws: Error if the request fails or the ENSNode API returns an error response
163
-
164
- ```ts
165
- const config = await client.config();
166
- console.log(config);
167
- // Returns the ENSNode configuration including indexed chains, etc.
168
- ```
169
-
170
154
  #### Indexing Status API
171
155
 
172
156
  ##### `indexingStatus()`
173
157
 
174
- Fetches the ENSNode's multichain indexing status.
158
+ Fetches the ENSNode's omnichain indexing status.
175
159
 
176
160
  - Returns: `IndexingStatusResponse` - The indexing status data for all indexed chains
177
161
  - Throws: Error if the request fails or the ENSNode API returns an error response
178
162
 
179
163
  ```ts
180
164
  // Get current indexing status
181
- const status = await client.indexingStatus();
182
- console.log(status);
183
- // Returns indexing status for all indexed chains
165
+ const indexingStatusResponse = await client.indexingStatus();
166
+
167
+ if (indexingStatusResponse.responseCode === EnsApiIndexingStatusResponseCodes.Ok) {
168
+ const { realtimeProjection, stackInfo } = indexingStatusResponse;
169
+ console.log("RealtimeIndexingStatusProjection:", realtimeProjection);
170
+ console.log("EnsNodeStackInfo:", stackInfo);
171
+ } else {
172
+ console.error("Error while fetching Indexing Status");
173
+ }
184
174
  ```
185
175
 
186
176
  ### Configuration
187
177
 
188
178
  ```typescript
189
- const client = new ENSNodeClient({
179
+ const client = new EnsNodeClient({
190
180
  url: new URL("https://my-ensnode-instance.com"),
191
181
  });
192
182
  ```