@ensnode/ensnode-sdk 1.9.0 → 1.10.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.
package/dist/index.d.cts CHANGED
@@ -1,63 +1,15 @@
1
1
  import { ENSNamespaceId, DatasourceName } from '@ensnode/datasources';
2
2
  export { ENSNamespaceId, ENSNamespaceIds, getENSRootChainId } from '@ensnode/datasources';
3
- import { EvmCoinType, CoinType } from '@ensdomains/address-encoder';
4
- export { CoinType, EvmCoinType } from '@ensdomains/address-encoder';
5
- import { Address, Hex, Hash, ByteArray } from 'viem';
3
+ import * as enssdk from 'enssdk';
4
+ import { UnixTimestamp, ChainId, Duration, ChainIdString, LabelHash, Node, Name, AssetId, Hex, AccountId, TokenId, AssetNamespace, Address, AssetIdString, InterpretedName, NormalizedAddress, DefaultableChainId, CoinType, ContentType, InterfaceId, RecordVersion, UrlString, LiteralName, DatetimeISO8601 } from 'enssdk';
6
5
  import { z } from 'zod/v4';
6
+ import { ByteArray, Hash } from 'viem';
7
7
 
8
8
  /**
9
- * Chain ID
10
- *
11
- * Represents a unique identifier for a chain.
12
- * Guaranteed to be a positive integer.
13
- *
14
- * Chain id standards are organized by the Ethereum Community @ https://github.com/ethereum-lists/chains
15
- **/
16
- type ChainId = number;
17
- /**
18
- * Defaultable Chain ID
19
- *
20
- * Represents a unique identifier for a chain, or
21
- * the default chain as defined by ENSIP-19.
22
- *
23
- * @see https://docs.ens.domains/ensip/19/#annex-supported-chains
24
- *
25
- * Guaranteed to be a non-negative integer.
26
- **/
27
- type DefaultableChainId = typeof DEFAULT_EVM_CHAIN_ID | ChainId;
28
- /**
29
- * Represents an account (contract or EOA) at `address` on chain `chainId`.
30
- *
31
- * @see https://chainagnostic.org/CAIPs/caip-10
32
- */
33
- interface AccountId {
34
- chainId: ChainId;
35
- address: Address;
36
- }
37
- /**
38
- * An enum representing the possible CAIP-19 Asset Namespace values.
39
- *
40
- * @see https://chainagnostic.org/CAIPs/caip-19
41
- */
42
- declare const AssetNamespaces: {
43
- readonly ERC721: "erc721";
44
- readonly ERC1155: "erc1155";
45
- };
46
- type AssetNamespace = (typeof AssetNamespaces)[keyof typeof AssetNamespaces];
47
- /**
48
- * A uint256 value that identifies a specific NFT within a NFT contract.
49
- */
50
- type TokenId = bigint;
51
- /**
52
- * Represents an Asset in `assetNamespace` by `tokenId` in `contract`.
53
- *
54
- * @see https://chainagnostic.org/CAIPs/caip-19
9
+ * Determines whether `fuses` has set ('burnt') the PARENT_CANNOT_CONTROL fuse.
55
10
  */
56
- interface AssetId {
57
- assetNamespace: AssetNamespace;
58
- contract: AccountId;
59
- tokenId: TokenId;
60
- }
11
+ declare const isPccFuseSet: (fuses: number) => boolean;
12
+
61
13
  /**
62
14
  * Block Number
63
15
  *
@@ -68,16 +20,6 @@ type BlockNumber = number;
68
20
  * Datetime value
69
21
  */
70
22
  type Datetime = Date;
71
- /**
72
- * Unix timestamp value
73
- *
74
- * Represents the number of seconds that have elapsed
75
- * since January 1, 1970 (midnight UTC/GMT).
76
- *
77
- * Guaranteed to be an integer. May be zero or negative to represent a time at or
78
- * before Jan 1, 1970.
79
- */
80
- type UnixTimestamp = number;
81
23
  /**
82
24
  * Represents a URL that is used for RPC endpoints.
83
25
  */
@@ -96,14 +38,6 @@ interface BlockRef {
96
38
  /** Block timestamp */
97
39
  timestamp: UnixTimestamp;
98
40
  }
99
- /**
100
- * Duration
101
- *
102
- * Representing a duration in seconds.
103
- *
104
- * Guaranteed to be a non-negative integer.
105
- */
106
- type Duration = number;
107
41
  /**
108
42
  * A utility type that makes all properties of a type optional recursively,
109
43
  * including nested objects and arrays.
@@ -175,1758 +109,1582 @@ type RequiredAndNotNull<T, K extends keyof T> = T & {
175
109
  };
176
110
 
177
111
  /**
178
- * The ETH coinType.
179
- *
180
- * @see https://docs.ens.domains/ensip/9
112
+ * A label set ID identifies a label set (see https://ensnode.io/ensrainbow/concepts/glossary#label-set for definition).
113
+ * It is guaranteed to be 1 to 50 characters long and contain only lowercase letters (a-z)
114
+ * and hyphens (-).
181
115
  */
182
- declare const ETH_COIN_TYPE: CoinType;
116
+ type LabelSetId = string;
183
117
  /**
184
- * The 'default' chainId corresponding to the below {@link DEFAULT_EVM_COIN_TYPE} in the context of
185
- * ENSIP-19.
118
+ * A label set version identifies a specific version of a label set. It allows clients to
119
+ * request data from a specific snapshot in time, ensuring deterministic results.
186
120
  *
187
- * @see https://docs.ens.domains/ensip/19
121
+ * It is guaranteed to be a non-negative integer.
188
122
  */
189
- declare const DEFAULT_EVM_CHAIN_ID = 0;
123
+ type LabelSetVersion = number;
190
124
  /**
191
- * ENSIP-19 EVM CoinType representing the 'default' coinType for EVM chains in ENS.
192
- *
193
- * @see https://docs.ens.domains/ensip/19/#reverse-resolution
125
+ * The label set preferences of an ENSRainbow client.
194
126
  */
195
- declare const DEFAULT_EVM_COIN_TYPE: EvmCoinType;
127
+ interface EnsRainbowClientLabelSet {
128
+ /**
129
+ * Optional label set ID that the ENSRainbow server is expected to use. If provided, heal
130
+ * operations will validate the ENSRainbow server is using this labelSetId.
131
+ * Required if `labelSetVersion` is defined.
132
+ */
133
+ labelSetId?: LabelSetId;
134
+ /**
135
+ * Optional highest label set version of label set id to query. Enables deterministic heal
136
+ * results across time even if the ENSRainbow server ingests label sets with greater versions
137
+ * than this value. If provided, only labels from label sets with versions less than or equal to this
138
+ * value will be returned. If not provided, the server will use the latest available version.
139
+ * When `labelSetVersion` is defined, `labelSetId` must also be defined.
140
+ */
141
+ labelSetVersion?: LabelSetVersion;
142
+ }
196
143
  /**
197
- * Converts a CoinType to an EVM Chain Id.
198
- *
199
- * NOTE: for whatever reason @ensdomains/address-encoder#coinTypeToEvmChainId doesn't handle the
200
- * mainnet case so we implement that here
201
- *
202
- * @see https://docs.ens.domains/ensip/11/
144
+ * The state of label sets managed by an ENSRainbow server.
203
145
  */
204
- declare const coinTypeToEvmChainId: (coinType: CoinType) => ChainId;
146
+ interface EnsRainbowServerLabelSet {
147
+ /**
148
+ * The LabelSetId managed by the ENSRainbow server.
149
+ */
150
+ labelSetId: LabelSetId;
151
+ /**
152
+ * The highest label set version available on the ENSRainbow server for the current
153
+ * label set ID. This represents the most recent version of the label set that the
154
+ * server has ingested and can provide label healing results for.
155
+ */
156
+ highestLabelSetVersion: LabelSetVersion;
157
+ }
158
+
205
159
  /**
206
- * Converts an EVM Chain Id to a CoinType.
160
+ * Complete public configuration object for ENSRainbow.
207
161
  *
208
- * NOTE: for whatever reason @ensdomains/address-encoder#evmChainIdToCoinType doesn't handle the
209
- * mainnet case so we implement that here
162
+ * Contains all public configuration information about the ENSRainbow service instance,
163
+ * including version, label set information, and record counts.
210
164
  */
211
- declare const evmChainIdToCoinType: (chainId: ChainId) => CoinType;
165
+ interface EnsRainbowPublicConfig {
166
+ /**
167
+ * ENSRainbow service version
168
+ *
169
+ * @see https://ghcr.io/namehash/ensnode/ensrainbow
170
+ */
171
+ version: string;
172
+ /**
173
+ * The label set reference managed by the ENSRainbow server.
174
+ */
175
+ labelSet: EnsRainbowServerLabelSet;
176
+ /**
177
+ * The total count of records managed by the ENSRainbow service.
178
+ */
179
+ recordsCount: number;
180
+ }
181
+
212
182
  /**
213
- * Converts a bigint value representing a CoinType into a valid CoinType.
214
- *
215
- * This is useful when onchain events emit coinTypes as bigint but we want to constrain them to
216
- * the CoinType type.
217
- *
218
- * @throws if `value` is too large to fit in Number.MAX_SAFE_INTEGER
183
+ * Serialized representation of {@link EnsRainbowPublicConfig}
219
184
  */
220
- declare const bigintToCoinType: (value: bigint) => CoinType;
185
+ type SerializedEnsRainbowPublicConfig = EnsRainbowPublicConfig;
221
186
 
222
187
  /**
223
- * Serialized CAIP-10 Asset ID that uniquely identifies a Registry contract.
188
+ * A PluginName is a unique id for a 'plugin': we use the notion of
189
+ * 'plugins' to describe bundles of indexing logic.
224
190
  */
225
- type RegistryId = string & {
226
- __brand: "RegistryContractId";
227
- };
191
+ declare enum PluginName {
192
+ Subgraph = "subgraph",
193
+ Basenames = "basenames",
194
+ Lineanames = "lineanames",
195
+ ThreeDNS = "threedns",
196
+ ProtocolAcceleration = "protocol-acceleration",
197
+ Registrars = "registrars",
198
+ TokenScope = "tokenscope",
199
+ ENSv2 = "ensv2"
200
+ }
228
201
  /**
229
- * A Domain's Canonical Id is uint256(labelHash) with lower (right-most) 32 bits zero'd.
202
+ * Version info about ENSIndexer and its dependencies.
230
203
  */
231
- type CanonicalId = bigint;
204
+ interface EnsIndexerVersionInfo {
205
+ /**
206
+ * Ponder framework version
207
+ *
208
+ * @see https://www.npmjs.com/package/ponder
209
+ **/
210
+ ponder: string;
211
+ /**
212
+ * ENSDb service version
213
+ *
214
+ * Guaranteed to be the same as {@link ENSIndexerVersionInfo.ensIndexer}.
215
+ * */
216
+ ensDb: string;
217
+ /**
218
+ * ENSIndexer service version
219
+ *
220
+ * @see https://ghcr.io/namehash/ensnode/ensindexer
221
+ **/
222
+ ensIndexer: string;
223
+ /**
224
+ * ENS Normalize package version
225
+ *
226
+ * Available on NPM as: `@adraffy/ens-normalize`
227
+ *
228
+ * @see https://www.npmjs.com/package/@adraffy/ens-normalize
229
+ **/
230
+ ensNormalize: string;
231
+ }
232
232
  /**
233
- * The node that uniquely identifies an ENSv1 name.
233
+ * Version info about ENSIndexer and its dependencies.
234
+ *
235
+ * @deprecated Use {@link EnsIndexerVersionInfo} instead.
234
236
  */
235
- type ENSv1DomainId = Node & {
236
- __brand: "ENSv1DomainId";
237
- };
237
+ type ENSIndexerVersionInfo = EnsIndexerVersionInfo;
238
238
  /**
239
- * The Serialized CAIP-19 Asset ID that uniquely identifies an ENSv2 name.
239
+ * Complete public configuration object for ENSIndexer.
240
+ *
241
+ * We use parameter types to maintain fields layout and documentation across
242
+ * the domain model and its serialized counterpart.
240
243
  */
241
- type ENSv2DomainId = string & {
242
- __brand: "ENSv2DomainId";
243
- };
244
+ interface EnsIndexerPublicConfig {
245
+ /**
246
+ * The ENS namespace that ENSNode operates in the context of.
247
+ *
248
+ * See {@link ENSNamespaceIds} for available namespace identifiers.
249
+ */
250
+ namespace: ENSNamespaceId;
251
+ /**
252
+ * The "fully pinned" label set reference that ENSIndexer will request ENSRainbow use for deterministic label healing across time. This label set reference is "fully pinned" as it requires both the labelSetId and labelSetVersion fields to be defined.
253
+ */
254
+ labelSet: Required<EnsRainbowClientLabelSet>;
255
+ /**
256
+ * The name of the ENSIndexer Schema in the ENSDb instance,
257
+ * where the ENSIndexer instance writes indexed data.
258
+ *
259
+ * Invariants:
260
+ * - Must be a non-empty string that is a valid Postgres database schema
261
+ * identifier.
262
+ */
263
+ ensIndexerSchemaName: string;
264
+ /**
265
+ * ENSRainbow public config
266
+ *
267
+ * Represents the public config of the connected ENSRainbow instance.
268
+ */
269
+ ensRainbowPublicConfig: EnsRainbowPublicConfig;
270
+ /**
271
+ * A set of strings referring to the names of plugins that are active.
272
+ *
273
+ * For future-proofing, this is a list of strings that may or may
274
+ * not be currently valid {@link PluginName} values.
275
+ *
276
+ * Invariants:
277
+ * - A set of strings with at least one value.
278
+ */
279
+ plugins: string[];
280
+ /**
281
+ * Indexed Chain IDs
282
+ *
283
+ * Includes the {@link ChainId} for each chain being indexed.
284
+ */
285
+ indexedChainIds: Set<ChainId>;
286
+ /**
287
+ * A feature flag to enable/disable ENSIndexer's Subgraph Compatible Indexing Behavior.
288
+ *
289
+ * If {@link isSubgraphCompatible} is true, indexing behavior will match that of the legacy ENS
290
+ * Subgraph.
291
+ *
292
+ * ENSIndexer will store and return Literal Labels and Literal Names without further interpretation.
293
+ * @see https://ensnode.io/docs/reference/terminology#literal-label
294
+ * @see https://ensnode.io/docs/reference/terminology#literal-name
295
+ *
296
+ * If {@link isSubgraphCompatible} is true, the following invariants are true for the ENSIndexerConfig:
297
+ * 1. only the 'subgraph' plugin is enabled, and
298
+ * 2. the labelSet must be { labelSetId: 'subgraph', labelSetVersion: 0 }
299
+ *
300
+ * If {@link isSubgraphCompatible} is false, ENSIndexer will additionally:
301
+ *
302
+ * 1. ENSIndexer will heal all subnames of addr.reverse on the ENS Root Chain.
303
+ *
304
+ * 2. ENSIndexer will track both the keys and the values of Resolver records.
305
+ *
306
+ * WARNING: Special care must be taken when interacting with indexed resolver record values. It
307
+ * is unsafe to naively assume that indexed resolver record values are equivalent to the
308
+ * resolver record values that would be returned through dynamic lookups via the ENS protocol.
309
+ * For example, if a resolver implements CCIP-Read, the resolver records may not be
310
+ * discoverable through onchain indexing.
311
+ *
312
+ * 3. Literal Labels and Literal Names encountered by ENSIndexer will be Interpreted.
313
+ * @see https://ensnode.io/docs/reference/terminology#interpreted-label
314
+ * @see https://ensnode.io/docs/reference/terminology#interpreted-name
315
+ *
316
+ * That is,
317
+ * a) all Labels stored and returned by ENSIndexer will be Interpreted Labels, which are either:
318
+ * i. normalized, or
319
+ * ii. represented as an Encoded LabelHash of the Literal Label value found onchain, and
320
+ * b) all Names stored and returned by ENSIndexer will be Interpreted Names, which are exclusively
321
+ * composed of Interpreted Labels.
322
+ */
323
+ isSubgraphCompatible: boolean;
324
+ /**
325
+ * Version info about ENSIndexer.
326
+ */
327
+ versionInfo: EnsIndexerVersionInfo;
328
+ }
244
329
  /**
245
- * A DomainId is one of ENSv1DomainId or ENSv2DomainId.
330
+ * Complete public configuration object for ENSIndexer.
331
+ *
332
+ * @deprecated Use {@link EnsIndexerPublicConfig} instead.
246
333
  */
247
- type DomainId = ENSv1DomainId | ENSv2DomainId;
334
+ type ENSIndexerPublicConfig = EnsIndexerPublicConfig;
335
+
336
+ type SerializedIndexedChainIds = Array<ChainId>;
248
337
  /**
249
- * Uniquely identifies a Permissions entity.
338
+ * Serialized representation of {@link EnsIndexerPublicConfig}
250
339
  */
251
- type PermissionsId = AccountIdString & {
252
- __brand: "PermissionsId";
253
- };
340
+ interface SerializedEnsIndexerPublicConfig extends Omit<EnsIndexerPublicConfig, "indexedChainIds"> {
341
+ /**
342
+ * Array representation of {@link EnsIndexerPublicConfig.indexedChainIds}.
343
+ */
344
+ indexedChainIds: ChainId[];
345
+ }
254
346
  /**
255
- * Uniquely identifies a PermissionsResource entity.
347
+ * Serialized representation of {@link EnsIndexerPublicConfig}
348
+ *
349
+ * @deprecated Use {@link SerializedEnsIndexerPublicConfig} instead.
256
350
  */
257
- type PermissionsResourceId = string & {
258
- __brand: "PermissionsResourceId";
259
- };
351
+ type SerializedENSIndexerPublicConfig = SerializedEnsIndexerPublicConfig;
260
352
  /**
261
- * Uniquely identifies a PermissionsUser entity.
353
+ * Serialized representation of {@link EnsIndexerVersionInfo}
262
354
  */
263
- type PermissionsUserId = string & {
264
- __brand: "PermissionsUserId";
265
- };
355
+ type SerializedEnsIndexerVersionInfo = EnsIndexerVersionInfo;
266
356
  /**
267
- * Uniquely identifies a Resolver entity.
268
- */
269
- type ResolverId = AccountIdString & {
270
- __brand: "ResolverId";
271
- };
272
- /**
273
- * Uniquely identifies a ResolverRecords entity.
274
- */
275
- type ResolverRecordsId = string & {
276
- __brand: "ResolverRecordsId";
277
- };
278
- /**
279
- * Uniquely identifies a Registration entity.
280
- */
281
- type RegistrationId = string & {
282
- __brand: "RegistrationId";
283
- };
284
- /**
285
- * Uniquely identifies a Renewal entity.
357
+ * Serialized representation of {@link EnsIndexerVersionInfo}
358
+ *
359
+ * @deprecated Use {@link SerializedEnsIndexerVersionInfo} instead.
286
360
  */
287
- type RenewalId = string & {
288
- __brand: "RenewalId";
289
- };
361
+ type SerializedENSIndexerVersionInfo = SerializedEnsIndexerVersionInfo;
290
362
 
291
363
  /**
292
- * Formats and brands an AccountId as a RegistryId.
293
- */
294
- declare const makeRegistryId: (accountId: AccountId) => RegistryId;
295
- /**
296
- * Makes an ENSv1 Domain Id given the ENSv1 Domain's `node`
364
+ * Reasons why TheGraph fallback cannot be used.
297
365
  */
298
- declare const makeENSv1DomainId: (node: Node) => ENSv1DomainId;
366
+ declare const TheGraphCannotFallbackReasonSchema: z.ZodEnum<{
367
+ readonly NotSubgraphCompatible: "not-subgraph-compatible";
368
+ readonly NoApiKey: "no-api-key";
369
+ readonly NoSubgraphUrl: "no-subgraph-url";
370
+ }>;
371
+ type TheGraphCannotFallbackReason = z.infer<typeof TheGraphCannotFallbackReasonSchema>;
299
372
  /**
300
- * Makes an ENSv2 Domain Id given the parent `registry` and the domain's `canonicalId`.
373
+ * Configuration for TheGraph fallback behavior.
374
+ * Indicates whether fallback to TheGraph is possible and the reason if not.
301
375
  */
302
- declare const makeENSv2DomainId: (registry: AccountId, canonicalId: CanonicalId) => ENSv2DomainId;
376
+ declare const TheGraphFallbackSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
377
+ canFallback: z.ZodLiteral<true>;
378
+ url: z.ZodString;
379
+ }, z.core.$strict>, z.ZodObject<{
380
+ canFallback: z.ZodLiteral<false>;
381
+ reason: z.ZodEnum<{
382
+ readonly NotSubgraphCompatible: "not-subgraph-compatible";
383
+ readonly NoApiKey: "no-api-key";
384
+ readonly NoSubgraphUrl: "no-subgraph-url";
385
+ }>;
386
+ }, z.core.$strict>], "canFallback">;
387
+ type TheGraphFallback = z.infer<typeof TheGraphFallbackSchema>;
388
+
303
389
  /**
304
- * Computes a Domain's {@link CanonicalId} given its tokenId or LabelHash as `input`.
390
+ * Version info about ENSApi and its dependencies.
305
391
  */
306
- declare const getCanonicalId: (input: bigint | LabelHash) => CanonicalId;
392
+ interface EnsApiVersionInfo {
393
+ /**
394
+ * ENSApi service version
395
+ *
396
+ * @see https://ghcr.io/namehash/ensnode/ensapi
397
+ */
398
+ ensApi: string;
399
+ /**
400
+ * ENS Normalize package version
401
+ *
402
+ * Available on NPM as: `@adraffy/ens-normalize`
403
+ *
404
+ * @see https://www.npmjs.com/package/@adraffy/ens-normalize
405
+ **/
406
+ ensNormalize: string;
407
+ }
307
408
  /**
308
- * Formats and brands an AccountId as a PermissionsId.
409
+ * Complete public configuration object for ENSApi.
410
+ *
411
+ * Contains ENSApi-specific configuration at the top level and
412
+ * embeds the complete ENSIndexer public configuration.
309
413
  */
310
- declare const makePermissionsId: (contract: AccountId) => PermissionsId;
414
+ interface EnsApiPublicConfig {
415
+ /**
416
+ * The Graph Fallback-related info.
417
+ */
418
+ theGraphFallback: TheGraphFallback;
419
+ /**
420
+ * Complete ENSIndexer public configuration
421
+ *
422
+ * Contains all ENSIndexer public configuration including
423
+ * namespace, plugins, version info, etc.
424
+ */
425
+ ensIndexerPublicConfig: EnsIndexerPublicConfig;
426
+ /**
427
+ * Version info about ENSApi.
428
+ */
429
+ versionInfo: EnsApiVersionInfo;
430
+ }
311
431
  /**
312
- * Constructs a PermissionsResourceId for a given `contract`'s `resource`.
432
+ * ENSApi Public Config
433
+ *
434
+ * @deprecated Use {@link EnsApiPublicConfig} instead.
313
435
  */
314
- declare const makePermissionsResourceId: (contract: AccountId, resource: bigint) => PermissionsResourceId;
436
+ type ENSApiPublicConfig = EnsApiPublicConfig;
437
+
315
438
  /**
316
- * Constructs a PermissionsUserId for a given `contract`'s `resource`'s `user`.
439
+ * Serialized representation of {@link EnsApiPublicConfig}
317
440
  */
318
- declare const makePermissionsUserId: (contract: AccountId, resource: bigint, user: Address) => PermissionsUserId;
441
+ interface SerializedEnsApiPublicConfig extends Omit<EnsApiPublicConfig, "ensIndexerPublicConfig"> {
442
+ /**
443
+ * Serialized representation of {@link EnsApiPublicConfig.ensIndexerPublicConfig}.
444
+ */
445
+ ensIndexerPublicConfig: SerializedEnsIndexerPublicConfig;
446
+ }
319
447
  /**
320
- * Formats and brands an AccountId as a ResolverId.
448
+ * Serialized representation of {@link EnsApiPublicConfig}
449
+ *
450
+ * @deprecated Use {@link SerializedEnsApiPublicConfig} instead.
321
451
  */
322
- declare const makeResolverId: (contract: AccountId) => ResolverId;
452
+ type SerializedENSApiPublicConfig = SerializedEnsApiPublicConfig;
453
+
323
454
  /**
324
- * Constructs a ResolverRecordsId for a given `node` under `resolver`.
455
+ * Builds an unvalidated {@link EnsApiPublicConfig} object to be
456
+ * validated with {@link makeEnsApiPublicConfigSchema}.
457
+ *
458
+ * @param serializedPublicConfig - The serialized public config to build from.
459
+ * @return An unvalidated {@link EnsApiPublicConfig} object.
325
460
  */
326
- declare const makeResolverRecordsId: (resolver: AccountId, node: Node) => ResolverRecordsId;
461
+ declare function buildUnvalidatedEnsApiPublicConfig(serializedPublicConfig: SerializedEnsApiPublicConfig): Unvalidated<EnsApiPublicConfig>;
327
462
  /**
328
- * Constructs a RegistrationId for a `domainId`'s `index`'thd Registration.
463
+ * Deserialize value into {@link EnsApiPublicConfig} object.
329
464
  */
330
- declare const makeRegistrationId: (domainId: DomainId, index: number) => RegistrationId;
465
+ declare function deserializeEnsApiPublicConfig(maybePublicConfig: Unvalidated<SerializedEnsApiPublicConfig>, valueLabel?: string): EnsApiPublicConfig;
331
466
  /**
332
- * Constructs a RenewalId for a `domainId`'s `registrationIndex`thd Registration's `index`'thd Renewal.
467
+ * Deserialize a {@link EnsApiPublicConfig} object.
468
+ *
469
+ * @deprecated Use {@link deserializeEnsApiPublicConfig} instead.
333
470
  */
334
- declare const makeRenewalId: (domainId: DomainId, registrationIndex: number, index: number) => RenewalId;
471
+ declare const deserializeENSApiPublicConfig: typeof deserializeEnsApiPublicConfig;
335
472
 
336
473
  /**
337
- * A hash value that uniquely identifies a single ENS name.
338
- * Result of `namehash` function as specified in ENSIP-1.
339
- *
340
- * @example
341
- * ```
342
- * namehash("vitalik.eth") === "0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835"
343
- * ```
344
- * @see https://docs.ens.domains/ensip/1#namehash-algorithm
345
- * @see https://ensnode.io/docs/reference/terminology#name-node-namehash
474
+ * Serialize a {@link EnsApiPublicConfig} object.
346
475
  */
347
- type Node = Hex;
476
+ declare function serializeEnsApiPublicConfig(config: EnsApiPublicConfig): SerializedEnsApiPublicConfig;
348
477
  /**
349
- * An ENS Name that may or may not be normalized.
478
+ * Serialize a {@link EnsApiPublicConfig} object.
350
479
  *
351
- * @example vitalik.eth
352
- * @see https://ensnode.io/docs/reference/terminology#name-node-namehash
353
- * @see https://docs.ens.domains/ensip/15
480
+ * @deprecated Use {@link serializeEnsApiPublicConfig} instead.
354
481
  */
355
- type Name = string;
482
+ declare const serializeENSApiPublicConfig: typeof serializeEnsApiPublicConfig;
483
+
356
484
  /**
357
- * A Normalized Name is an ENS Name that is guaranteed to be normalized.
485
+ * Create a Zod schema for validating ENSApiPublicConfig.
358
486
  *
359
- * @example vitalik.eth
360
- * @see https://ensnode.io/docs/reference/terminology#name-node-namehash
361
- * @see https://docs.ens.domains/ensip/15
362
- * @dev nominally typed to enforce usage & enhance codebase clarity
487
+ * @param valueLabel - Optional label for the value being validated (used in error messages)
363
488
  */
364
- type NormalizedName = Name & {
365
- __brand: "NormalizedName";
366
- };
489
+ declare function makeEnsApiPublicConfigSchema(valueLabel?: string): z.ZodObject<{
490
+ theGraphFallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
491
+ canFallback: z.ZodLiteral<true>;
492
+ url: z.ZodString;
493
+ }, z.core.$strict>, z.ZodObject<{
494
+ canFallback: z.ZodLiteral<false>;
495
+ reason: z.ZodEnum<{
496
+ readonly NotSubgraphCompatible: "not-subgraph-compatible";
497
+ readonly NoApiKey: "no-api-key";
498
+ readonly NoSubgraphUrl: "no-subgraph-url";
499
+ }>;
500
+ }, z.core.$strict>], "canFallback">;
501
+ ensIndexerPublicConfig: z.ZodObject<{
502
+ ensIndexerSchemaName: z.ZodString;
503
+ ensRainbowPublicConfig: z.ZodObject<{
504
+ version: z.ZodString;
505
+ labelSet: z.ZodObject<{
506
+ labelSetId: z.ZodString;
507
+ highestLabelSetVersion: z.ZodInt;
508
+ }, z.core.$strip>;
509
+ recordsCount: z.ZodInt;
510
+ }, z.core.$strip>;
511
+ indexedChainIds: z.ZodSet<z.ZodPipe<z.ZodInt, z.ZodTransform<number, number>>>;
512
+ isSubgraphCompatible: z.ZodBoolean;
513
+ labelSet: z.ZodObject<{
514
+ labelSetId: z.ZodString;
515
+ labelSetVersion: z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodInt>;
516
+ }, z.core.$strip>;
517
+ namespace: z.ZodEnum<{
518
+ readonly Mainnet: "mainnet";
519
+ readonly Sepolia: "sepolia";
520
+ readonly SepoliaV2: "sepolia-v2";
521
+ readonly EnsTestEnv: "ens-test-env";
522
+ }>;
523
+ plugins: z.ZodArray<z.ZodString>;
524
+ versionInfo: z.ZodObject<{
525
+ ponder: z.ZodString;
526
+ ensDb: z.ZodString;
527
+ ensIndexer: z.ZodString;
528
+ ensNormalize: z.ZodString;
529
+ }, z.core.$strip>;
530
+ }, z.core.$strip>;
531
+ versionInfo: z.ZodObject<{
532
+ ensApi: z.ZodString;
533
+ ensNormalize: z.ZodString;
534
+ }, z.core.$strip>;
535
+ }, z.core.$strip>;
367
536
  /**
368
- * A LabelHash is the result of the labelhash function (which is just keccak256) on a Label.
369
- *
370
- * @example
371
- * ```
372
- * labelhash('vitalik') === '0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc'
373
- * ```
537
+ * Create a Zod schema for validating a serialized ENSApiPublicConfig.
374
538
  *
375
- * @see https://docs.ens.domains/terminology#labelhash
376
- * @see https://ensnode.io/docs/reference/terminology#labels-labelhashes-labelhash-function
377
- * @see https://ensnode.io/ensrainbow/concepts/glossary#labelhash
539
+ * @deprecated Use {@link makeEnsApiPublicConfigSchema} instead.
378
540
  */
379
- type LabelHash = Hex;
541
+ declare const makeENSApiPublicConfigSchema: typeof makeEnsApiPublicConfigSchema;
542
+ declare function makeSerializedEnsApiPublicConfigSchema(valueLabel?: string): z.ZodObject<{
543
+ ensIndexerPublicConfig: z.ZodObject<{
544
+ ensIndexerSchemaName: z.ZodString;
545
+ ensRainbowPublicConfig: z.ZodObject<{
546
+ version: z.ZodString;
547
+ labelSet: z.ZodObject<{
548
+ labelSetId: z.ZodString;
549
+ highestLabelSetVersion: z.ZodInt;
550
+ }, z.core.$strip>;
551
+ recordsCount: z.ZodInt;
552
+ }, z.core.$strip>;
553
+ indexedChainIds: z.ZodArray<z.ZodPipe<z.ZodInt, z.ZodTransform<number, number>>>;
554
+ isSubgraphCompatible: z.ZodBoolean;
555
+ labelSet: z.ZodObject<{
556
+ labelSetId: z.ZodString;
557
+ labelSetVersion: z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodInt>;
558
+ }, z.core.$strip>;
559
+ namespace: z.ZodEnum<{
560
+ readonly Mainnet: "mainnet";
561
+ readonly Sepolia: "sepolia";
562
+ readonly SepoliaV2: "sepolia-v2";
563
+ readonly EnsTestEnv: "ens-test-env";
564
+ }>;
565
+ plugins: z.ZodArray<z.ZodString>;
566
+ versionInfo: z.ZodObject<{
567
+ ponder: z.ZodString;
568
+ ensDb: z.ZodString;
569
+ ensIndexer: z.ZodString;
570
+ ensNormalize: z.ZodString;
571
+ }, z.core.$strip>;
572
+ }, z.core.$strip>;
573
+ theGraphFallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
574
+ canFallback: z.ZodLiteral<true>;
575
+ url: z.ZodString;
576
+ }, z.core.$strict>, z.ZodObject<{
577
+ canFallback: z.ZodLiteral<false>;
578
+ reason: z.ZodEnum<{
579
+ readonly NotSubgraphCompatible: "not-subgraph-compatible";
580
+ readonly NoApiKey: "no-api-key";
581
+ readonly NoSubgraphUrl: "no-subgraph-url";
582
+ }>;
583
+ }, z.core.$strict>], "canFallback">;
584
+ versionInfo: z.ZodObject<{
585
+ ensApi: z.ZodString;
586
+ ensNormalize: z.ZodString;
587
+ }, z.core.$strip>;
588
+ }, z.core.$strip>;
589
+
380
590
  /**
381
- * A LabelHashPath is an ordered list of LabelHashes that uniquely identify an ENS Name.
382
- * It is ordered in namegraph TRAVERSAL order (i.e. the opposite order of an ENS Name's labels).
383
- *
384
- * ex: example.eth's LabelHashPath is
385
- * [
386
- * '0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0', // 'eth'
387
- * '0x6fd43e7cffc31bb581d7421c8698e29aa2bd8e7186a394b85299908b4eb9b175', // 'example'
388
- * ]
591
+ * Version info about ENSDb and its dependencies.
389
592
  */
390
- type LabelHashPath = LabelHash[];
593
+ interface EnsDbVersionInfo {
594
+ /**
595
+ * Version of the PostgreSQL server hosting the ENSDb instance.
596
+ */
597
+ postgresql: string;
598
+ }
391
599
  /**
392
- * CanonicalPath is an ordered list of DomainIds describing the canonical path to a Domain.
393
- * It is ordered in namegraph TRAVERSAL order (i.e. the opposite order of an ENS Name's labels).
600
+ * The public configuration of an ENSDb instance.
394
601
  */
395
- type CanonicalPath = DomainId[];
602
+ interface EnsDbPublicConfig {
603
+ /**
604
+ * Version info about ENSDb.
605
+ */
606
+ versionInfo: EnsDbVersionInfo;
607
+ }
608
+
396
609
  /**
397
- * A Label is a single part of an ENS Name.
398
- *
399
- * @example vitalik
400
- *
401
- * @see https://docs.ens.domains/terminology#label
402
- * @see https://ensnode.io/docs/reference/terminology#labels-labelhashes-labelhash-function
610
+ * Serialized representation of {@link EnsDbPublicConfig}
403
611
  */
404
- type Label = string;
612
+ type SerializedEnsDbPublicConfig = EnsDbPublicConfig;
613
+
405
614
  /**
406
- * An EncodedLabelHash is a specially formatted (unnormalized) Label formatted
407
- * as a non-0x prefixed 32-byte hex string enclosed in square brackets.
408
- *
409
- * Care should be taken to distinguish Label values formatted as an
410
- * EncodedLabelHash as either a LiteralLabel or an InterpretedLabel:
411
- * - If a LiteralLabel is formatted as an EncodedLabelHash it does NOT
412
- * symbolically represent the encoding of a LabelHash literal.
413
- * - If an InterpretedLabel is formatted as an EncodedLabelHash it should be
414
- * interpreted as encoding a LabelHash literal.
415
- *
416
- * An InterpretedLabel may be formatted as an EncodedLabelHash if the related
417
- * LiteralLabel is:
418
- * - not a normalized label
419
- * - is an unknown value that could not be healed.
420
- * - is too long for DNS-Encoding in contexts where DNS-Encoding was required.
421
- *
422
- * @example [af2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc]
423
- *
424
- * @see https://ensnode.io/docs/reference/terminology#encoded-labelhash
615
+ * ENSIndexer Public Config Response
425
616
  */
426
- type EncodedLabelHash = `[${string}]`;
617
+ type EnsIndexerConfigResponse = EnsIndexerPublicConfig;
618
+
619
+ type SerializedEnsIndexerConfigResponse = SerializedEnsIndexerPublicConfig;
620
+
427
621
  /**
428
- * A Literal Label is a Label as it literally appears onchain, without any interpretation
429
- * or normalization processing. It may be an unnormalized label for reasons including:
430
- * - being an empty label,
431
- * - containing '.' characters,
432
- * - being formatted as an EncodedLabelHash (which are not normalizable). Note that
433
- * when LiteralLabel are formatted as an EncodedLabelHash they do NOT symbolically
434
- * represent the encoding of a LabelHash literal, or
435
- * - containing other unnormalized characters such as null bytes or other characters
436
- * not suitable for display.
437
- *
438
- *
439
- * @see https://ensnode.io/docs/reference/terminology#literal-label
440
- * @dev nominally typed to enforce usage & enhance codebase clarity
622
+ * Deserialize value into {@link EnsIndexerConfigResponse} object.
441
623
  */
442
- type LiteralLabel = Label & {
443
- __brand: "LiteralLabel";
624
+ declare function deserializeEnsIndexerConfigResponse(maybeResponse: Unvalidated<SerializedEnsIndexerConfigResponse>): EnsIndexerConfigResponse;
625
+
626
+ declare function serializeEnsIndexerConfigResponse(response: EnsIndexerConfigResponse): SerializedEnsIndexerConfigResponse;
627
+
628
+ declare const RangeTypeIds: {
629
+ readonly Unbounded: "unbounded";
630
+ readonly LeftBounded: "left-bounded";
631
+ readonly RightBounded: "right-bounded";
632
+ readonly Bounded: "bounded";
444
633
  };
634
+ type RangeType = (typeof RangeTypeIds)[keyof typeof RangeTypeIds];
635
+ /************************
636
+ * Block number range
637
+ ***********************/
445
638
  /**
446
- * An Interpreted Label is a Label that is either:
447
- * a) a Normalized Label, or
448
- * b) an Unnormalizable Label exclusively for the reason that it is formatted
449
- * as an Encoded LabelHash that should be interpreted as encoding a
450
- * LabelHash literal, where the encoded LabelHash literal is the `labelhash`
451
- * of the related LiteralLabel.
452
- *
453
- * @see https://ensnode.io/docs/reference/terminology#interpreted-label
454
- * @dev nominally typed to enforce usage & enhance codebase clarity
639
+ * Block number range unbounded
455
640
  */
456
- type InterpretedLabel = Label & {
457
- __brand: "InterpretedLabel";
458
- };
459
- /**
460
- * A Literal Name is a Name as it literally appears onchain, composed of 0 or more Literal Labels
461
- * joined by dots. It may be an unnormalized name for reasons including:
462
- * - containing empty labels,
463
- * - containing LiteralLabel values formatted as an EncodedLabelHash (which are
464
- * not normalizable)). Note that when LiteralLabel values are formatted as an
465
- * EncodedLabelHash they do NOT symbolically represent the encoding of a
466
- * LabelHash literal, or
467
- * - containing other unnormalized characters such as null bytes or other characters
468
- * not suitable for display.
469
- *
470
- * @see https://ensnode.io/docs/reference/terminology#literal-name
471
- * @dev nominally typed to enforce usage & enhance codebase clarity
472
- */
473
- type LiteralName = Name & {
474
- __brand: "LiteralName";
475
- };
641
+ interface BlockNumberRangeUnbounded {
642
+ rangeType: typeof RangeTypeIds.Unbounded;
643
+ startBlock?: undefined;
644
+ endBlock?: undefined;
645
+ }
476
646
  /**
477
- * An Interpreted Name is a Name that is entirely composed of 0 or more Interpreted Labels.
478
- *
479
- * That is, it is either:
480
- * a) a Normalized Name, or
481
- * b) an Unnormalizable Name exclusively for the reason that it contains 1 or
482
- * more labels formatted as Encoded LabelHashes that should be interpreted
483
- * as encoding a LabelHash literal, where the encoded LabelHash literal is
484
- * the `labelhash` of the related LiteralLabel.
647
+ * Block number range left bounded
485
648
  *
486
- * @see https://ensnode.io/docs/reference/terminology#interpreted-name
487
- * @dev nominally typed to enforce usage & enhance codebase clarity
649
+ * Range is inclusive of its left bound.
488
650
  */
489
- type InterpretedName = Name & {
490
- __brand: "InterpretedName";
491
- };
651
+ interface BlockNumberRangeLeftBounded {
652
+ rangeType: typeof RangeTypeIds.LeftBounded;
653
+ startBlock: BlockNumber;
654
+ endBlock?: undefined;
655
+ }
492
656
  /**
493
- * A Subgraph Interpreted Label is a Literal Label that is either:
494
- * a) (if subgraph-indexable): a Literal Label, of unknown normalization status, guaranteed to not
495
- * contain any of the subgraph-unindexable UTF-8 characters (and therefore guaranteed not to be
496
- * an Encoded LabelHash), or
497
- * b) (if subgraph-unindexable): an Encoded LabelHash.
657
+ * Block number range right bounded
498
658
  *
499
- * @see https://ensnode.io/docs/reference/terminology#subgraph-interpreted-label
500
- * @dev nominally typed to enforce usage & enhance codebase clarity
501
- */
502
- type SubgraphInterpretedLabel = Label & {
503
- __brand: "SubgraphInterpretedLabel";
504
- };
505
- /**
506
- * A Subgraph Interpreted Name is a name exclusively composed of 0 or more Subgraph Interpreted Labels.
507
- *
508
- * @see https://ensnode.io/docs/reference/terminology#subgraph-interpreted-name
509
- * @dev nominally typed to enforce usage & enhance codebase clarity
659
+ * Range is inclusive of its right bound.
510
660
  */
511
- type SubgraphInterpretedName = Name & {
512
- __brand: "SubgraphInterpretedName";
513
- };
661
+ interface BlockNumberRangeRightBounded {
662
+ rangeType: typeof RangeTypeIds.RightBounded;
663
+ startBlock?: undefined;
664
+ endBlock: BlockNumber;
665
+ }
514
666
  /**
515
- * A DNS-Encoded Name as a hex string, representing the binary DNS wire format encoding
516
- * of a domain name. Used in ENS contracts for efficient name storage and transmission.
517
- * Each label is prefixed with a length byte, and the entire sequence is null-terminated.
518
- *
519
- * @example "0x076578616d706c650365746800" represents "example.eth"
520
- *
521
- * @see https://docs.ens.domains/resolution/names/#dns-encoding
522
- * @see https://github.com/ensdomains/ens-contracts/blob/staging/contracts/utils/NameCoder.sol
523
- *
524
- * DNS Packet Format for Domain Names:
525
- * - Domain names are encoded as a sequence of 0 or more labels
526
- * - Each label begins with a length byte (1 byte) indicating how many bytes follow for that label
527
- * Note how this constrains each label in DNS encoded names to a max byte length of 255 bytes.
528
- * - The bytes after the length byte represent the label, as a UTF-8 byte array
529
- * - Labels are concatenated with no separators
530
- * - The sequence ends with a null byte (0x00)
531
- *
532
- * Example: "example.eth" is encoded as:
533
- * [0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x03, 'e', 't', 'h', 0x00]
534
- * Where 0x07 is the length of "example", 0x03 is the length of "eth", and 0x00 marks the end
535
- *
536
- * Example: "" (empty string, i.e. root node) is encoded as:
537
- * [0x00]
538
- *
539
- * Example: "👩🏼‍❤‍💋‍👨🏼.eth" (multi-byte unicode character) is encoded as:
540
- * [0x20, 240, 159, 145, 169, 240, 159, 143, 188, 226, 128, 141, 226, 157, 164, 226,
541
- * 128, 141, 240, 159, 146, 139, 226, 128, 141, 240, 159, 145, 168, 240, 159, 143,
542
- * 188, 3, 'e', 't', 'h', 0x00]
667
+ * Block number range bounded
543
668
  *
544
- * A DNS-Encoded Name Packet may be malformed if it does not exactly follow that specification.
545
- * Possible reasons a DNS-Encoded Name may be malfomed include:
546
- * - 'empty' packet
547
- * - e.g. []
548
- * ^-- that's empty!
549
- * - 'length' byte overflowing packet byte length
550
- * - e.g. [0x06, 'e', 't', 'h', 0x00]
551
- * ^-- length overflows available bytes!
552
- * - 'junk' at the end of the dns-encoded
553
- * - e.g. [0x03, 'e', 't', 'h', 0x00, 0x01]
554
- * ^-- junk!
669
+ * Range is inclusive of its bounds.
555
670
  *
556
- * @dev This type is _structurally_ typed to aid Event Argument Typing — consumers should further
557
- * cast the type of the event argument to a _nominally_ typed DNSEncodedName like {@link DNSEncodedLiteralName}
558
- * or {@link DNSEncodedPartiallyInterpretedName} depending on the context.
671
+ * Invariants:
672
+ * - `startBlock` is lower than or equal to `endBlock`
559
673
  */
560
- type DNSEncodedName = Hex;
674
+ interface BlockNumberRangeBounded {
675
+ rangeType: typeof RangeTypeIds.Bounded;
676
+ startBlock: BlockNumber;
677
+ endBlock: BlockNumber;
678
+ }
561
679
  /**
562
- * A DNSEncodedName that encodes a name containing 0 or more {@link LiteralLabel}s.
563
- *
564
- * In a DNSEncodedLiteralName, all labels are Literal Labels, including any Encoded-LabelHash-looking
565
- * labels. Any Encoded-LabelHash-looking Literal Label values, when interpreted, will be formatted as
566
- * the `labelhash` of the Literal Label value.
567
- *
568
- * The NameWrapper contract emits DNSEncodedLiteralNames:
569
- * @see https://github.com/ensdomains/ens-contracts/blob/staging/contracts/utils/BytesUtils_LEGACY.sol
570
- *
571
- * The ThreeDNSToken contract emits DNSEncodedLiteralNames:
572
- * @see https://github.com/3dns-xyz/contracts/blob/44937318ae26cc036982e8c6a496cd82ebdc2b12/src/regcontrol/libraries/BytesUtils.sol
680
+ * Block number range with start block defined.
573
681
  *
574
- * @dev nominally typed to enforce usage & enhance codebase clarity
682
+ * This is a useful type for representing block ranges for indexed chains.
575
683
  */
576
- type DNSEncodedLiteralName = DNSEncodedName & {
577
- __brand: "DNSEncodedLiteralName";
578
- };
684
+ type BlockNumberRangeWithStartBlock = BlockNumberRangeLeftBounded | BlockNumberRangeBounded;
579
685
  /**
580
- * A DNSEncodedName that encodes a name consisting of 0 or more labels that are either:
581
- * a) Literal Labels, or
582
- * b) Encoded LabelHashes, which are already an Interpreted Label.
583
- *
584
- * In a DNSEncodedPartiallyInterpretedName, any Encoded-LabelHash-looking decoded Labels (i.e. ones
585
- * that match the regex /^\[[\da-f]{64}\]$/) represent an Encoded LabelHash. When decoding a
586
- * DNSEncodedPartiallyInterpretedName, these labels are already considered Interpreted.
587
- *
588
- * NOTE: This type is unused in ENSv1, but its usage is anticipated in ENSv2 due to Encoded
589
- * LabelHash support in the ENSv2 implementation of the NameCoder contract.
590
- *
591
- * @see https://github.com/ensdomains/ens-contracts/blob/staging/contracts/utils/NameCoder.sol
686
+ * Block number range
592
687
  *
593
- * @dev nominally typed to enforce usage & enhance codebase clarity
594
- */
595
- type DNSEncodedPartiallyInterpretedName = DNSEncodedName & {
596
- __brand: "DNSEncodedPartiallyInterpretedName";
597
- };
598
-
599
- declare const ROOT_NODE: Node;
600
- declare const ETH_NODE: Node;
601
- declare const BASENAMES_NODE: Node;
602
- declare const LINEANAMES_NODE: Node;
603
- declare const ADDR_REVERSE_NODE: Node;
604
- /**
605
- * NODE_ANY is a placeholder Node used in the context of DedicatedResolvers — IResolver events are
606
- * emitted with NODE_ANY as the `node` for which the records are issued, but the DedicatedResolver
607
- * returns those records regardless of the name used for record resolution.
608
- */
609
- declare const NODE_ANY: Node;
610
- /**
611
- * ROOT_RESOURCE represents the 'root' resource in an EnhancedAccessControl contract.
688
+ * Use the `rangeType` field to determine the specific type interpretation
689
+ * at runtime.
612
690
  */
613
- declare const ROOT_RESOURCE = 0n;
614
-
691
+ type BlockNumberRange = BlockNumberRangeUnbounded | BlockNumberRangeLeftBounded | BlockNumberRangeRightBounded | BlockNumberRangeBounded;
615
692
  /**
616
- * Decodes a DNS-Encoded name consisting of Literal Labels into an ordered list of Literal Labels.
617
- *
618
- * For discussion on DNS-Encoding, see the {@link DNSEncodedName} and {@link DNSEncodedLiteralName} types.
619
- *
620
- * Due to the constraints of DNS-Encoding, there is an additional guarantee that each Literal Label
621
- * in the resulting list is guaranteed to have a maximum byte length of 255.
622
- *
623
- * @param packet a hex string that encodes a DNSEncodedLiteralName
624
- * @returns A list of the LiteralLabels contained in packet
625
- * @throws If the packet is malformed
626
- * @dev This is just `decodeDNSEncodedName` with semantic input/output
693
+ * Build a block number range object.
627
694
  */
628
- declare function decodeDNSEncodedLiteralName(packet: DNSEncodedLiteralName): LiteralLabel[];
695
+ declare function buildBlockNumberRange(startBlock: undefined, endBlock: undefined): BlockNumberRangeUnbounded;
696
+ declare function buildBlockNumberRange(startBlock: BlockNumber, endBlock: undefined): BlockNumberRangeLeftBounded;
697
+ declare function buildBlockNumberRange(startBlock: undefined, endBlock: BlockNumber): BlockNumberRangeRightBounded;
698
+ declare function buildBlockNumberRange(startBlock: BlockNumber, endBlock: BlockNumber): BlockNumberRangeBounded;
699
+ declare function buildBlockNumberRange(startBlock?: BlockNumber, endBlock?: BlockNumber): BlockNumberRange;
629
700
  /**
630
- * Decodes a DNS-Encoded Name into an ordered list of string segments.
631
- *
632
- * For discussion on DNS-Encoding, see the {@link DNSEncodedName} type.
633
- *
634
- * Due to the constraints of DNS-Encoding, there is an additional guarantee that each segment
635
- * in the resulting list is guaranteed to have a maximum byte length of 255.
701
+ * Merge multiple block number ranges into a single range.
636
702
  *
637
- * @param packet a hex string that encodes a DNSEncodedName
638
- * @returns A UTF-8 string array of the segments contained in packet
639
- * @throws If the packet is malformed
640
- * @dev This is the generic implementation of DNS-Encoded Name Decoding
641
- */
642
- declare function decodeDNSEncodedName(packet: DNSEncodedName): string[];
643
-
644
- /**
645
- * Formats a LabelHash as an Encoded LabelHash.
703
+ * The resulting range is a union that covers all input ranges:
704
+ * - Uses the minimum start block when every input range has a start block
705
+ * - Uses the maximum end block when every input range has an end block
706
+ * - Leaves a side unbounded when any input range is unbounded on that side
646
707
  *
647
- * @see https://ensnode.io/docs/reference/terminology#encoded-labelhash
708
+ * Returns an unbounded range if no ranges are provided.
648
709
  *
649
- * @param labelHash - A 32-byte lowercase hash string starting with '0x'
650
- * @returns The encoded label hash in format `[hash_without_0x_prefix]`
651
- */
652
- declare const encodeLabelHash: (labelHash: LabelHash) => EncodedLabelHash;
653
- /**
654
- * Checks if the input value is an {@link EncodedLabelHash}.
655
- */
656
- declare function isEncodedLabelHash(maybeEncodedLabelHash: string): maybeEncodedLabelHash is EncodedLabelHash;
657
-
658
- /**
659
- * Determines whether `fuses` has set ('burnt') the PARENT_CANNOT_CONTROL fuse.
710
+ * @param ranges - The block number ranges to merge
711
+ * @returns A single merged block number range covering all inputs
660
712
  */
661
- declare const isPccFuseSet: (fuses: number) => boolean;
662
-
713
+ declare function mergeBlockNumberRanges(...ranges: BlockNumberRange[]): BlockNumberRange;
714
+ /************************
715
+ * Block ref range
716
+ ***********************/
663
717
  /**
664
- * Determines whether the Name is normalized.
665
- *
666
- * @param name - The Name to check for normalization
667
- * @returns True if the name is normalized according to ENS normalization rules, false otherwise
718
+ * Block ref range unbounded
668
719
  */
669
- declare function isNormalizedName(name: Name): name is NormalizedName;
720
+ interface BlockRefRangeUnbounded {
721
+ rangeType: typeof RangeTypeIds.Unbounded;
722
+ startBlock?: undefined;
723
+ endBlock?: undefined;
724
+ }
670
725
  /**
671
- * Determines whether the Label is normalized.
726
+ * Block ref range left bounded
672
727
  *
673
- * @param label - The Label to check for normalization
674
- * @returns True if the label is normalized according to ENS normalization rules, false otherwise
728
+ * Range is inclusive of its left bound.
675
729
  */
676
- declare function isNormalizedLabel(label: Label): boolean;
677
-
730
+ interface BlockRefRangeLeftBounded {
731
+ rangeType: typeof RangeTypeIds.LeftBounded;
732
+ startBlock: BlockRef;
733
+ endBlock?: undefined;
734
+ }
678
735
  /**
679
- * Checks if the input is a {@link LabelHash}.
736
+ * Block ref range right bounded
680
737
  *
681
- * @see https://ensnode.io/docs/reference/terminology#label-processing-and-classification
682
- */
683
- declare function isLabelHash(maybeLabelHash: string): maybeLabelHash is LabelHash;
684
-
685
- /**
686
- * Name for the ENS Root
738
+ * Range is inclusive of its right bound.
687
739
  */
688
- declare const ENS_ROOT: Name;
740
+ interface BlockRefRangeRightBounded {
741
+ rangeType: typeof RangeTypeIds.RightBounded;
742
+ startBlock?: undefined;
743
+ endBlock: BlockRef;
744
+ }
689
745
  /**
690
- * Constructs a name hierarchy from a given NormalizedName.
691
- *
692
- * @example
693
- * ```
694
- * getNameHierarchy("sub.example.eth") -> ["sub.example.eth", "example.eth", "eth"]
695
- * ```
746
+ * Block ref range bounded
696
747
  *
697
- * @dev by restricting the input type to NormalizedName we guarantee that we can split and join
698
- * on '.' and receive NormalizedNames as a result
699
- */
700
- declare const getNameHierarchy: (name: NormalizedName) => NormalizedName[];
701
- /**
702
- * Get FQDN of parent for a name.
703
- */
704
- declare const getParentNameFQDN: (name: Name) => Name;
705
- /**
706
- * Beautifies a name by converting each normalized label in the provided name to
707
- * its "beautified" form. Labels that are not normalized retain their original value.
748
+ * Range is inclusive of its bounds.
708
749
  *
709
750
  * Invariants:
710
- * - The number of labels in the returned name is the same as the number of labels in the input name.
711
- * - The order of the labels in the returned name is the same as the order of the labels in the input name.
712
- * - If a label in the input is normalized, it is returned in its "beautified" form.
713
- * - If a label in the input name is not normalized, it is returned without modification.
714
- * - Therefore, the result of ens_normalize(beautifyName(name)) is the same as the result of ens_normalize(name).
715
- *
716
- * The "beautified form" of a normalized label converts special sequences of
717
- * emojis and other special characters to their "beautified" equivalents. All
718
- * such conversions transform X -> Y where Y is normalizable and normalizes back to X.
719
- * Ex: '1⃣2⃣' (normalized) to '1️⃣2️⃣' (normalizable but not normalized).
720
- * Ex: 'ξethereum' (normalized) to 'Ξethereum' (normalizable, but not normalized).
721
- * Ex: 'abc' (normalized) to 'abc' (also normalized, no conversion).
722
- * Ex: 'ABC' (normalizable but not normalized) to 'ABC' (no conversion).
723
- * Ex: 'invalid|label' (not normalizable) to 'invalid|label' (no conversion).
724
- * Ex: '' (unnormalized as a label) to '' (no conversion).
725
- *
726
- * @param name - The name to beautify.
727
- * @returns The beautified name.
728
- */
729
- declare const beautifyName: (name: Name) => Name;
730
-
731
- /**
732
- * Parses a labelHash string and normalizes it to a canonical `LabelHash`.
733
- *
734
- * Normalization rules applied in order:
735
- * 1. Adds `0x` prefix if missing
736
- * 2. Validates all characters (excluding the optional `0x` prefix) are valid hex digits
737
- * (uppercase or lowercase A-F are accepted and normalized to lowercase)
738
- * 3. If the hex digit count is odd, adds a leading `0` to make it even
739
- * 4. Validates the result is exactly 64 hex digits (32 bytes)
740
- *
741
- * @param maybeLabelHash - The string to parse as a labelHash
742
- * @throws {Error} If the input cannot be normalized to a valid labelHash
743
- */
744
- declare function parseLabelHash(maybeLabelHash: string): LabelHash;
745
- /**
746
- * Parses an encoded labelHash string (surrounded by square brackets) and normalizes it.
747
- *
748
- * This function is intentionally more lenient than {@link isEncodedLabelHash}: it accepts
749
- * both the canonical format `[hash]` (no `0x` inside brackets) and the non-canonical
750
- * `[0xhash]` format by delegating to {@link parseLabelHash} for the inner value.
751
- * `isEncodedLabelHash("[0xhash]")` returns `false` for the same input.
752
- *
753
- * @param maybeEncodedLabelHash - The string to parse as an encoded labelHash
754
- * @throws {Error} If the input is not properly enclosed in brackets or cannot be normalized
755
- */
756
- declare function parseEncodedLabelHash(maybeEncodedLabelHash: string): LabelHash;
757
- /**
758
- * Parses a labelHash or encoded labelHash string and normalizes it.
759
- *
760
- * Tries both formats to be maximally generous with accepted inputs:
761
- * - If the input starts with `[` and ends with `]`, it is treated as an encoded labelHash
762
- * - Otherwise, it is treated as a plain labelHash
763
- *
764
- * @param maybeLabelHash - The string to parse as a labelHash or encoded labelHash
765
- * @throws {Error} If the input cannot be normalized to a valid labelHash
766
- */
767
- declare function parseLabelHashOrEncodedLabelHash(maybeLabelHash: string): LabelHash;
768
-
769
- /**
770
- * Parse the address and coinType out of an ENSIP-19 reverse name.
771
- */
772
- declare function parseReverseName(name: Name): {
773
- address: Address;
774
- coinType: CoinType;
775
- } | null;
776
-
777
- /**
778
- * Gets the Label used for the reverse names of subnames as per ENSIP-11 & ENSIP-19.
779
- *
780
- * @see https://docs.ens.domains/ensip/19/#reverse-resolution
751
+ * - `startBlock` is before or equal to `endBlock`
781
752
  */
782
- declare const addrReverseLabel: (address: Address) => LiteralLabel;
753
+ interface BlockRefRangeBounded {
754
+ rangeType: typeof RangeTypeIds.Bounded;
755
+ startBlock: BlockRef;
756
+ endBlock: BlockRef;
757
+ }
783
758
  /**
784
- * Converts `coinType` to prefix-free hex string.
759
+ * Block ref range
785
760
  *
786
- * @see https://docs.ens.domains/ensip/19
761
+ * Use the `rangeType` field to determine the specific type interpretation
762
+ * at runtime.
787
763
  */
788
- declare const coinTypeReverseLabel: (coinType: CoinType) => Label;
764
+ type BlockRefRange = BlockRefRangeUnbounded | BlockRefRangeLeftBounded | BlockRefRangeRightBounded | BlockRefRangeBounded;
789
765
  /**
790
- * Gets the reverse name for an address according to ENSIP-11 & ENSIP-19.
791
- *
792
- * @see https://docs.ens.domains/ensip/11#specification
793
- * @see https://docs.ens.domains/ensip/19#specification
794
- *
795
- * @param address - The address to get the reverse name for
796
- * @param coinType - The coin type to use for the reverse name
797
- * @returns The reverse name for the address
766
+ * Block ref range with start block defined.
798
767
  *
799
- * @example
800
- * ```ts
801
- * reverseName("0x1234", BigInt(ETH_COIN_TYPE)) // "1234.addr.reverse"
802
- * reverseName("0x1234", BigInt(0x80000000)) // "1234.default.reverse"
803
- * reverseName("0x1234", BigInt(0x5678)) // "1234.5678.reverse"
804
- * ```
805
- */
806
- declare function reverseName(address: Address, coinType: CoinType): Name;
807
-
808
- /**
809
- * Implements one step of the namehash algorithm, combining `labelHash` with `node` to produce
810
- * the `node` of a given subdomain. Note that the order of the arguments is 'reversed' (as compared to
811
- * the actual concatenation) in order to improve readability (i.e. read as [labelHash].[node]).
768
+ * This is a useful type for representing block ranges for indexed chains.
812
769
  */
813
- declare const makeSubdomainNode: (labelHash: LabelHash, node: Node) => Node;
770
+ type BlockRefRangeWithStartBlock = BlockRefRangeLeftBounded | BlockRefRangeBounded;
814
771
  /**
815
- * Encodes a uint256 bigint as hex string sized to 32 bytes.
816
- * Uses include, in the context of ENS, decoding the uint256-encoded tokenId of NFT-issuing contracts
817
- * into Node or LabelHash, which is a common behavior in the ENS ecosystem.
818
- * (see NameWrapper, ETHRegistrarController)
772
+ * Build a block ref range object.
819
773
  */
820
- declare const uint256ToHex32: (num: bigint) => Hex;
774
+ declare function buildBlockRefRange(startBlock: undefined, endBlock: undefined): BlockRefRangeUnbounded;
775
+ declare function buildBlockRefRange(startBlock: BlockRef, endBlock: undefined): BlockRefRangeLeftBounded;
776
+ declare function buildBlockRefRange(startBlock: undefined, endBlock: BlockRef): BlockRefRangeRightBounded;
777
+ declare function buildBlockRefRange(startBlock: BlockRef, endBlock: BlockRef): BlockRefRangeBounded;
778
+ declare function buildBlockRefRange(startBlock?: BlockRef, endBlock?: BlockRef): BlockRefRange;
821
779
 
822
780
  /**
823
- * A label set ID identifies a label set (see https://ensnode.io/ensrainbow/concepts/glossary#label-set for definition).
824
- * It is guaranteed to be 1 to 50 characters long and contain only lowercase letters (a-z)
825
- * and hyphens (-).
826
- */
827
- type LabelSetId = string;
828
- /**
829
- * A label set version identifies a specific version of a label set. It allows clients to
830
- * request data from a specific snapshot in time, ensuring deterministic results.
831
- *
832
- * It is guaranteed to be a non-negative integer.
833
- */
834
- type LabelSetVersion = number;
835
- /**
836
- * The label set preferences of an ENSRainbow client.
781
+ * The status of indexing a chain at the time an indexing status snapshot
782
+ * is captured.
837
783
  */
838
- interface EnsRainbowClientLabelSet {
784
+ declare const ChainIndexingStatusIds: {
839
785
  /**
840
- * Optional label set ID that the ENSRainbow server is expected to use. If provided, heal
841
- * operations will validate the ENSRainbow server is using this labelSetId.
842
- * Required if `labelSetVersion` is defined.
786
+ * Represents that indexing of the chain is not ready to begin yet because:
787
+ * - ENSIndexer is in its initialization phase and the data to build a
788
+ * "true" {@link ChainIndexingStatusSnapshot} for the chain is still being loaded; or
789
+ * - ENSIndexer is using an omnichain indexing strategy and the
790
+ * `omnichainIndexingCursor` is <= `config.startBlock.timestamp` for the chain's
791
+ * {@link ChainIndexingStatusSnapshot}.
843
792
  */
844
- labelSetId?: LabelSetId;
793
+ readonly Queued: "chain-queued";
845
794
  /**
846
- * Optional highest label set version of label set id to query. Enables deterministic heal
847
- * results across time even if the ENSRainbow server ingests label sets with greater versions
848
- * than this value. If provided, only labels from label sets with versions less than or equal to this
849
- * value will be returned. If not provided, the server will use the latest available version.
850
- * When `labelSetVersion` is defined, `labelSetId` must also be defined.
795
+ * Represents that indexing of the chain is in progress and under a special
796
+ * "backfill" phase that optimizes for accelerated indexing until reaching the
797
+ * "fixed target" `backfillEndBlock`.
851
798
  */
852
- labelSetVersion?: LabelSetVersion;
853
- }
854
- /**
855
- * The state of label sets managed by an ENSRainbow server.
856
- */
857
- interface EnsRainbowServerLabelSet {
799
+ readonly Backfill: "chain-backfill";
858
800
  /**
859
- * The LabelSetId managed by the ENSRainbow server.
801
+ * Represents that the "backfill" phase of indexing the chain is completed
802
+ * and that the chain is configured to be indexed for an indefinite range.
803
+ * Therefore, indexing of the chain remains indefinitely in progress where
804
+ * ENSIndexer will continuously work to discover and index new blocks as they
805
+ * are added to the chain across time.
860
806
  */
861
- labelSetId: LabelSetId;
807
+ readonly Following: "chain-following";
862
808
  /**
863
- * The highest label set version available on the ENSRainbow server for the current
864
- * label set ID. This represents the most recent version of the label set that the
865
- * server has ingested and can provide label healing results for.
809
+ * Represents that indexing of the chain is completed as the chain is configured
810
+ * to be indexed for a definite range and the indexing of all blocks through
811
+ * that definite range is completed.
866
812
  */
867
- highestLabelSetVersion: LabelSetVersion;
868
- }
869
-
813
+ readonly Completed: "chain-completed";
814
+ };
870
815
  /**
871
- * Complete public configuration object for ENSRainbow.
816
+ * The derived string union of possible {@link ChainIndexingStatusIds}.
817
+ */
818
+ type ChainIndexingStatusId = (typeof ChainIndexingStatusIds)[keyof typeof ChainIndexingStatusIds];
819
+ /**
820
+ * Chain indexing status snapshot for a chain whose `chainStatus` is
821
+ * {@link ChainIndexingStatusIds.Queued}.
872
822
  *
873
- * Contains all public configuration information about the ENSRainbow service instance,
874
- * including version, label set information, and record counts.
823
+ * Invariants:
824
+ * - `chainStatus` is always {@link ChainIndexingStatusIds.Queued}.
875
825
  */
876
- interface EnsRainbowPublicConfig {
877
- /**
878
- * ENSRainbow service version
879
- *
880
- * @see https://ghcr.io/namehash/ensnode/ensrainbow
881
- */
882
- version: string;
826
+ interface ChainIndexingStatusSnapshotQueued {
883
827
  /**
884
- * The label set reference managed by the ENSRainbow server.
828
+ * The status of indexing the chain at the time the indexing status snapshot
829
+ * was captured.
885
830
  */
886
- labelSet: EnsRainbowServerLabelSet;
831
+ chainStatus: typeof ChainIndexingStatusIds.Queued;
887
832
  /**
888
- * The total count of records managed by the ENSRainbow service.
833
+ * The indexing configuration of the chain.
889
834
  */
890
- recordsCount: number;
835
+ config: BlockRefRangeWithStartBlock;
891
836
  }
892
-
893
837
  /**
894
- * A PluginName is a unique id for a 'plugin': we use the notion of
895
- * 'plugins' to describe bundles of indexing logic.
896
- */
897
- declare enum PluginName {
898
- Subgraph = "subgraph",
899
- Basenames = "basenames",
900
- Lineanames = "lineanames",
901
- ThreeDNS = "threedns",
902
- ProtocolAcceleration = "protocol-acceleration",
903
- Registrars = "registrars",
904
- TokenScope = "tokenscope",
905
- ENSv2 = "ensv2"
906
- }
907
- /**
908
- * Version info about ENSIndexer and its dependencies.
909
- */
910
- interface EnsIndexerVersionInfo {
911
- /**
912
- * Node.js runtime version
913
- *
914
- * @see https://nodejs.org/en/about/previous-releases
915
- **/
916
- nodejs: string;
917
- /**
918
- * Ponder framework version
919
- *
920
- * @see https://www.npmjs.com/package/ponder
921
- **/
922
- ponder: string;
923
- /**
924
- * ENSDb service version
925
- *
926
- * Guaranteed to be the same as {@link ENSIndexerVersionInfo.ensIndexer}.
927
- * */
928
- ensDb: string;
929
- /**
930
- * ENSIndexer service version
931
- *
932
- * @see https://ghcr.io/namehash/ensnode/ensindexer
933
- **/
934
- ensIndexer: string;
935
- /**
936
- * ENS Normalize package version
937
- *
938
- * Available on NPM as: `@adraffy/ens-normalize`
939
- *
940
- * @see https://www.npmjs.com/package/@adraffy/ens-normalize
941
- **/
942
- ensNormalize: string;
943
- }
944
- /**
945
- * Version info about ENSIndexer and its dependencies.
838
+ * Chain indexing status snapshot for a chain whose `chainStatus` is
839
+ * {@link ChainIndexingStatusIds.Backfill}.
946
840
  *
947
- * @deprecated Use {@link EnsIndexerVersionInfo} instead.
948
- */
949
- type ENSIndexerVersionInfo = EnsIndexerVersionInfo;
950
- /**
951
- * Complete public configuration object for ENSIndexer.
841
+ * During a backfill, special performance optimizations are applied to
842
+ * index all blocks between `config.startBlock` and `backfillEndBlock`
843
+ * as fast as possible.
952
844
  *
953
- * We use parameter types to maintain fields layout and documentation across
954
- * the domain model and its serialized counterpart.
845
+ * Note how `backfillEndBlock` is a "fixed target" that does not change during
846
+ * the lifetime of an ENSIndexer process instance:
847
+ * - If the `config` is {@link BlockRefRangeBounded}:
848
+ * `backfillEndBlock` is always the same as `config.endBlock`.
849
+ * - If the `config` is {@link BlockRefRangeLeftBounded}:
850
+ * `backfillEndBlock` is a {@link BlockRef} to what was the latest block on the
851
+ * chain when the ENSIndexer process was performing its initialization. Note how
852
+ * this means that if the backfill process takes X hours to complete, because the
853
+ * `backfillEndBlock` is a "fixed target", when `chainStatus` transitions to
854
+ * {@link ChainIndexingStatusIds.Following} the chain will be X hours behind
855
+ * "realtime" indexing.
856
+ *
857
+ * When `latestIndexedBlock` reaches `backfillEndBlock` the backfill is complete.
858
+ * The moment backfill is complete the `chainStatus` may not immediately transition.
859
+ * Instead, internal processing is completed for a period of time while
860
+ * `chainStatus` remains {@link ChainIndexingStatusIds.Backfill}. After this internal
861
+ * processing is completed `chainStatus` will transition:
862
+ * - to {@link ChainIndexingStatusIds.Following} if the `config` is
863
+ * {@link BlockRefRangeLeftBounded}.
864
+ * - to {@link ChainIndexingStatusIds.Completed} if the `config` is
865
+ * {@link BlockRefRangeBounded}.
866
+ *
867
+ * Invariants:
868
+ * - `chainStatus` is always {@link ChainIndexingStatusIds.Backfill}.
869
+ * - `config.startBlock` is always before or the same as `latestIndexedBlock`
870
+ * - `config.endBlock` is always the same as `backfillEndBlock` if and only if
871
+ * the config is {@link BlockRefRangeBounded}.
872
+ * - `latestIndexedBlock` is always before or the same as `backfillEndBlock`
955
873
  */
956
- interface EnsIndexerPublicConfig {
874
+ interface ChainIndexingStatusSnapshotBackfill {
957
875
  /**
958
- * The ENS namespace that ENSNode operates in the context of.
959
- *
960
- * See {@link ENSNamespaceIds} for available namespace identifiers.
876
+ * The status of indexing the chain at the time the indexing status snapshot
877
+ * was captured.
961
878
  */
962
- namespace: ENSNamespaceId;
879
+ chainStatus: typeof ChainIndexingStatusIds.Backfill;
963
880
  /**
964
- * The "fully pinned" label set reference that ENSIndexer will request ENSRainbow use for deterministic label healing across time. This label set reference is "fully pinned" as it requires both the labelSetId and labelSetVersion fields to be defined.
881
+ * The indexing configuration of the chain.
965
882
  */
966
- labelSet: Required<EnsRainbowClientLabelSet>;
883
+ config: BlockRefRangeWithStartBlock;
967
884
  /**
968
- * A Postgres database schema name. This instance of ENSIndexer will write
969
- * indexed data to the tables in this schema.
970
- *
971
- * Invariants:
972
- * - Must be a non-empty string that is a valid Postgres database schema
973
- * identifier.
885
+ * A {@link BlockRef} to the block that was most recently indexed as of the time the
886
+ * indexing status snapshot was captured.
974
887
  */
975
- databaseSchemaName: string;
888
+ latestIndexedBlock: BlockRef;
976
889
  /**
977
- * ENSRainbow public config
978
- *
979
- * Represents the public config of the connected ENSRainbow instance.
890
+ * A {@link BlockRef} to the block where the backfill will end.
980
891
  */
981
- ensRainbowPublicConfig: EnsRainbowPublicConfig;
892
+ backfillEndBlock: BlockRef;
893
+ }
894
+ /**
895
+ * Chain indexing status snapshot for a chain whose `chainStatus` is
896
+ * {@link ChainIndexingStatusIds.Following}.
897
+ *
898
+ * Invariants:
899
+ * - `chainStatus` is always {@link ChainIndexingStatusIds.Following}.
900
+ * - `config.startBlock` is always before or the same as `latestIndexedBlock`
901
+ * - `latestIndexedBlock` is always before or the same as `latestKnownBlock`
902
+ */
903
+ interface ChainIndexingStatusSnapshotFollowing {
982
904
  /**
983
- * A set of strings referring to the names of plugins that are active.
984
- *
985
- * For future-proofing, this is a list of strings that may or may
986
- * not be currently valid {@link PluginName} values.
987
- *
988
- * Invariants:
989
- * - A set of strings with at least one value.
905
+ * The status of indexing the chain at the time the indexing status snapshot
906
+ * was captured.
990
907
  */
991
- plugins: string[];
908
+ chainStatus: typeof ChainIndexingStatusIds.Following;
992
909
  /**
993
- * Indexed Chain IDs
994
- *
995
- * Includes the {@link ChainId} for each chain being indexed.
910
+ * The indexing configuration of the chain.
996
911
  */
997
- indexedChainIds: Set<ChainId>;
912
+ config: BlockRefRangeLeftBounded;
998
913
  /**
999
- * A feature flag to enable/disable ENSIndexer's Subgraph Compatible Indexing Behavior.
1000
- *
1001
- * If {@link isSubgraphCompatible} is true, indexing behavior will match that of the legacy ENS
1002
- * Subgraph.
1003
- *
1004
- * ENSIndexer will store and return Literal Labels and Literal Names without further interpretation.
1005
- * @see https://ensnode.io/docs/reference/terminology#literal-label
1006
- * @see https://ensnode.io/docs/reference/terminology#literal-name
1007
- *
1008
- * If {@link isSubgraphCompatible} is true, the following invariants are true for the ENSIndexerConfig:
1009
- * 1. only the 'subgraph' plugin is enabled, and
1010
- * 2. the labelSet must be { labelSetId: 'subgraph', labelSetVersion: 0 }
1011
- *
1012
- * If {@link isSubgraphCompatible} is false, ENSIndexer will additionally:
1013
- *
1014
- * 1. ENSIndexer will heal all subnames of addr.reverse on the ENS Root Chain.
1015
- *
1016
- * 2. ENSIndexer will track both the keys and the values of Resolver records.
1017
- *
1018
- * WARNING: Special care must be taken when interacting with indexed resolver record values. It
1019
- * is unsafe to naively assume that indexed resolver record values are equivalent to the
1020
- * resolver record values that would be returned through dynamic lookups via the ENS protocol.
1021
- * For example, if a resolver implements CCIP-Read, the resolver records may not be
1022
- * discoverable through onchain indexing.
1023
- *
1024
- * 3. Literal Labels and Literal Names encountered by ENSIndexer will be Interpreted.
1025
- * @see https://ensnode.io/docs/reference/terminology#interpreted-label
1026
- * @see https://ensnode.io/docs/reference/terminology#interpreted-name
1027
- *
1028
- * That is,
1029
- * a) all Labels stored and returned by ENSIndexer will be Interpreted Labels, which are either:
1030
- * i. normalized, or
1031
- * ii. represented as an Encoded LabelHash of the Literal Label value found onchain, and
1032
- * b) all Names stored and returned by ENSIndexer will be Interpreted Names, which are exclusively
1033
- * composed of Interpreted Labels.
914
+ * A {@link BlockRef} to the block that was most recently indexed as of the time the
915
+ * indexing status snapshot was captured.
1034
916
  */
1035
- isSubgraphCompatible: boolean;
917
+ latestIndexedBlock: BlockRef;
1036
918
  /**
1037
- * Version info about ENSIndexer.
919
+ * A {@link BlockRef} to the "highest" block that has been discovered by RPCs
920
+ * and stored in the RPC cache as of the time the indexing status snapshot was
921
+ * captured.
1038
922
  */
1039
- versionInfo: EnsIndexerVersionInfo;
923
+ latestKnownBlock: BlockRef;
1040
924
  }
1041
925
  /**
1042
- * Complete public configuration object for ENSIndexer.
926
+ * Chain indexing status snapshot for a chain whose `chainStatus` is
927
+ * {@link ChainIndexingStatusIds.Completed}.
1043
928
  *
1044
- * @deprecated Use {@link EnsIndexerPublicConfig} instead.
1045
- */
1046
- type ENSIndexerPublicConfig = EnsIndexerPublicConfig;
1047
-
1048
- /**
1049
- * Reasons why TheGraph fallback cannot be used.
1050
- */
1051
- declare const TheGraphCannotFallbackReasonSchema: z.ZodEnum<{
1052
- readonly NotSubgraphCompatible: "not-subgraph-compatible";
1053
- readonly NoApiKey: "no-api-key";
1054
- readonly NoSubgraphUrl: "no-subgraph-url";
1055
- }>;
1056
- type TheGraphCannotFallbackReason = z.infer<typeof TheGraphCannotFallbackReasonSchema>;
1057
- /**
1058
- * Configuration for TheGraph fallback behavior.
1059
- * Indicates whether fallback to TheGraph is possible and the reason if not.
1060
- */
1061
- declare const TheGraphFallbackSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1062
- canFallback: z.ZodLiteral<true>;
1063
- url: z.ZodString;
1064
- }, z.core.$strict>, z.ZodObject<{
1065
- canFallback: z.ZodLiteral<false>;
1066
- reason: z.ZodEnum<{
1067
- readonly NotSubgraphCompatible: "not-subgraph-compatible";
1068
- readonly NoApiKey: "no-api-key";
1069
- readonly NoSubgraphUrl: "no-subgraph-url";
1070
- }>;
1071
- }, z.core.$strict>], "canFallback">;
1072
- type TheGraphFallback = z.infer<typeof TheGraphFallbackSchema>;
1073
-
1074
- /**
1075
- * Complete public configuration object for ENSApi.
929
+ * After the backfill of a chain is completed, if the chain was configured
930
+ * to be indexed for a definite range, the chain indexing status will transition to
931
+ * {@link ChainIndexingStatusIds.Completed}.
1076
932
  *
1077
- * Contains ENSApi-specific configuration at the top level and
1078
- * embeds the complete ENSIndexer public configuration.
933
+ * Invariants:
934
+ * - `chainStatus` is always {@link ChainIndexingStatusIds.Completed}.
935
+ * - `config.startBlock` is always before or the same as `latestIndexedBlock`
936
+ * - `latestIndexedBlock` is always the same as `config.endBlock`.
1079
937
  */
1080
- interface EnsApiPublicConfig {
938
+ interface ChainIndexingStatusSnapshotCompleted {
1081
939
  /**
1082
- * ENSApi service version
1083
- *
1084
- * @see https://ghcr.io/namehash/ensnode/ensapi
940
+ * The status of indexing the chain at the time the indexing status snapshot
941
+ * was captured.
1085
942
  */
1086
- version: string;
943
+ chainStatus: typeof ChainIndexingStatusIds.Completed;
1087
944
  /**
1088
- * The Graph Fallback-related info.
945
+ * The indexing configuration of the chain.
1089
946
  */
1090
- theGraphFallback: TheGraphFallback;
947
+ config: BlockRefRangeBounded;
1091
948
  /**
1092
- * Complete ENSIndexer public configuration
1093
- *
1094
- * Contains all ENSIndexer public configuration including
1095
- * namespace, plugins, version info, etc.
949
+ * A {@link BlockRef} to the block that was most recently indexed as of the time the
950
+ * indexing status snapshot was captured.
1096
951
  */
1097
- ensIndexerPublicConfig: EnsIndexerPublicConfig;
952
+ latestIndexedBlock: BlockRef;
1098
953
  }
1099
954
  /**
1100
- * ENSApi Public Config
955
+ * Indexing status snapshot for a single chain.
1101
956
  *
1102
- * @deprecated Use {@link EnsApiPublicConfig} instead.
957
+ * Use the `chainStatus` field to determine the specific type interpretation
958
+ * at runtime.
1103
959
  */
1104
- type ENSApiPublicConfig = EnsApiPublicConfig;
1105
-
960
+ type ChainIndexingStatusSnapshot = ChainIndexingStatusSnapshotQueued | ChainIndexingStatusSnapshotBackfill | ChainIndexingStatusSnapshotFollowing | ChainIndexingStatusSnapshotCompleted;
1106
961
  /**
1107
- * ENSApi Public Config Response
962
+ * Get the timestamp of the lowest `config.startBlock` across all chains
963
+ * in the provided array of {@link ChainIndexingStatusSnapshot}.
964
+ *
965
+ * Such timestamp is useful when presenting the "lowest" block
966
+ * to be indexed across all chains.
1108
967
  */
1109
- type EnsApiConfigResponse = EnsApiPublicConfig;
968
+ declare function getTimestampForLowestOmnichainStartBlock(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
1110
969
  /**
1111
- * ENSApi Config API Response
970
+ * Get the timestamp of the "highest known block" across all chains
971
+ * in the provided array of {@link ChainIndexingStatusSnapshot}.
972
+ *
973
+ * Such timestamp is useful when presenting the "highest known block"
974
+ * to be indexed across all chains.
1112
975
  *
1113
- * @deprecated Use {@link EnsApiConfigResponse} instead.
976
+ * The "highest known block" for a chain depends on its status:
977
+ * - `config.endBlock` for a "queued" chain (only if the config range type is `Bounded`),
978
+ * - `backfillEndBlock` for a "backfill" chain,
979
+ * - `latestIndexedBlock` for a "completed" chain,
980
+ * - `latestKnownBlock` for a "following" chain.
981
+ */
982
+ declare function getTimestampForHighestOmnichainKnownBlock(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
983
+ /**
984
+ * Sort a list of [{@link ChainId}, {@link ChainIndexingStatusSnapshot}] tuples
985
+ * by the omnichain start block timestamp in ascending order.
1114
986
  */
1115
- type ConfigResponse = EnsApiConfigResponse;
987
+ declare function sortChainStatusesByStartBlockAsc<ChainStatusType extends ChainIndexingStatusSnapshot>(chains: [ChainId, ChainStatusType][]): [ChainId, ChainStatusType][];
1116
988
 
1117
- type SerializedIndexedChainIds = Array<ChainId>;
1118
989
  /**
1119
- * Serialized representation of {@link EnsIndexerPublicConfig}
990
+ * The status of omnichain indexing at the time an omnichain indexing status
991
+ * snapshot is captured.
1120
992
  */
1121
- interface SerializedEnsIndexerPublicConfig extends Omit<EnsIndexerPublicConfig, "indexedChainIds"> {
993
+ declare const OmnichainIndexingStatusIds: {
1122
994
  /**
1123
- * Array representation of {@link EnsIndexerPublicConfig.indexedChainIds}.
995
+ * Represents that omnichain indexing is not ready to begin yet because
996
+ * ENSIndexer is in its initialization phase and the data to build a "true"
997
+ * {@link OmnichainIndexingStatusSnapshot} is still being loaded.
1124
998
  */
1125
- indexedChainIds: ChainId[];
1126
- }
999
+ readonly Unstarted: "omnichain-unstarted";
1000
+ /**
1001
+ * Represents that omnichain indexing is in an overall "backfill" status because
1002
+ * - At least one indexed chain has a `chainStatus` of
1003
+ * {@link ChainIndexingStatusIds.Backfill}; and
1004
+ * - No indexed chain has a `chainStatus` of {@link ChainIndexingStatusIds.Following}.
1005
+ */
1006
+ readonly Backfill: "omnichain-backfill";
1007
+ /**
1008
+ * Represents that omnichain indexing is in an overall "following" status because
1009
+ * at least one indexed chain has a `chainStatus` of
1010
+ * {@link ChainIndexingStatusIds.Following}.
1011
+ */
1012
+ readonly Following: "omnichain-following";
1013
+ /**
1014
+ * Represents that omnichain indexing has completed because all indexed chains have
1015
+ * a `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
1016
+ */
1017
+ readonly Completed: "omnichain-completed";
1018
+ };
1127
1019
  /**
1128
- * Serialized representation of {@link EnsIndexerPublicConfig}
1020
+ * The derived string union of possible {@link OmnichainIndexingStatusIds}.
1021
+ */
1022
+ type OmnichainIndexingStatusId = (typeof OmnichainIndexingStatusIds)[keyof typeof OmnichainIndexingStatusIds];
1023
+ /**
1024
+ * Omnichain indexing status snapshot when the overall `omnichainStatus` is
1025
+ * {@link OmnichainIndexingStatusIds.Unstarted}.
1129
1026
  *
1130
- * @deprecated Use {@link SerializedEnsIndexerPublicConfig} instead.
1027
+ * Invariants:
1028
+ * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Unstarted}.
1029
+ * - `chains` is always a map to {@link ChainIndexingStatusSnapshotQueued} values exclusively.
1030
+ * - `omnichainIndexingCursor` is always < the `config.startBlock.timestamp` for all
1031
+ * chains with `chainStatus` of {@link ChainIndexingStatusIds.Queued}.
1131
1032
  */
1132
- type SerializedENSIndexerPublicConfig = SerializedEnsIndexerPublicConfig;
1033
+ interface OmnichainIndexingStatusSnapshotUnstarted {
1034
+ /**
1035
+ * The status of omnichain indexing.
1036
+ */
1037
+ omnichainStatus: typeof OmnichainIndexingStatusIds.Unstarted;
1038
+ /**
1039
+ * The indexing status snapshot for each indexed chain.
1040
+ */
1041
+ chains: Map<ChainId, ChainIndexingStatusSnapshotQueued>;
1042
+ /**
1043
+ * The timestamp of omnichain indexing progress across all indexed chains.
1044
+ */
1045
+ omnichainIndexingCursor: UnixTimestamp;
1046
+ }
1133
1047
  /**
1134
- * Serialized representation of {@link EnsIndexerVersionInfo}
1048
+ * The range of {@link ChainIndexingSnapshot} types allowed when the
1049
+ * overall omnichain indexing status is {@link OmnichainIndexingStatusIds.Backfill}.
1050
+ *
1051
+ * Note that this is all of the {@link ChainIndexingSnapshot} types with the exception
1052
+ * of {@link ChainIndexingStatusSnapshotFollowing}.
1135
1053
  */
1136
- type SerializedEnsIndexerVersionInfo = EnsIndexerVersionInfo;
1054
+ type ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill = ChainIndexingStatusSnapshotQueued | ChainIndexingStatusSnapshotBackfill | ChainIndexingStatusSnapshotCompleted;
1137
1055
  /**
1138
- * Serialized representation of {@link EnsIndexerVersionInfo}
1056
+ * Omnichain indexing status snapshot when the `omnichainStatus` is
1057
+ * {@link OmnichainIndexingStatusIds.Backfill}.
1139
1058
  *
1140
- * @deprecated Use {@link SerializedEnsIndexerVersionInfo} instead.
1059
+ * Invariants:
1060
+ * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Backfill}.
1061
+ * - `chains` is guaranteed to contain at least one chain with a `chainStatus` of
1062
+ * {@link ChainIndexingStatusIds.Backfill}.
1063
+ * - `chains` is guaranteed to not to contain any chain with a `chainStatus` of
1064
+ * {@link ChainIndexingStatusIds.Following}
1065
+ * - `omnichainIndexingCursor` is always < the `config.startBlock.timestamp` for all
1066
+ * chains with `chainStatus` of {@link ChainIndexingStatusIds.Queued}.
1067
+ * - `omnichainIndexingCursor` is always <= the `backfillEndBlock.timestamp` for all
1068
+ * chains with `chainStatus` of {@link ChainIndexingStatusIds.Backfill}.
1069
+ * - `omnichainIndexingCursor` is always >= the `latestIndexedBlock.timestamp` for all
1070
+ * chains with `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
1071
+ * - `omnichainIndexingCursor` is always equal to the timestamp of the highest
1072
+ * `latestIndexedBlock` across all chains that have started indexing
1073
+ * (`chainStatus` is not {@link ChainIndexingStatusIds.Queued}).
1141
1074
  */
1142
- type SerializedENSIndexerVersionInfo = SerializedEnsIndexerVersionInfo;
1143
-
1075
+ interface OmnichainIndexingStatusSnapshotBackfill {
1076
+ /**
1077
+ * The status of omnichain indexing.
1078
+ */
1079
+ omnichainStatus: typeof OmnichainIndexingStatusIds.Backfill;
1080
+ /**
1081
+ * The indexing status snapshot for each indexed chain.
1082
+ */
1083
+ chains: Map<ChainId, ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill>;
1084
+ /**
1085
+ * The timestamp of omnichain indexing progress across all indexed chains.
1086
+ */
1087
+ omnichainIndexingCursor: UnixTimestamp;
1088
+ }
1144
1089
  /**
1145
- * Serialized representation of {@link EnsApiPublicConfig}
1090
+ * Omnichain indexing status snapshot when the overall `omnichainStatus` is
1091
+ * {@link OmnichainIndexingStatusIds.Following}.
1092
+ *
1093
+ * Invariants:
1094
+ * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Following}.
1095
+ * - `chains` is guaranteed to contain at least one chain with a `status` of
1096
+ * {@link ChainIndexingStatusIds.Following}.
1097
+ * - `omnichainIndexingCursor` is always < the `config.startBlock.timestamp` for all
1098
+ * chains with `chainStatus` of {@link ChainIndexingStatusIds.Queued}.
1099
+ * - `omnichainIndexingCursor` is always <= the `backfillEndBlock.timestamp` for all
1100
+ * chains with `chainStatus` of {@link ChainIndexingStatusIds.Backfill}.
1101
+ * - `omnichainIndexingCursor` is always >= the `latestIndexedBlock.timestamp` for all
1102
+ * chains with `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
1103
+ * - `omnichainIndexingCursor` is always equal to the timestamp of the highest
1104
+ * `latestIndexedBlock` across all chains that have started indexing
1105
+ * (`chainStatus` is not {@link ChainIndexingStatusIds.Queued}).
1146
1106
  */
1147
- interface SerializedEnsApiPublicConfig extends Omit<EnsApiPublicConfig, "ensIndexerPublicConfig"> {
1107
+ interface OmnichainIndexingStatusSnapshotFollowing {
1148
1108
  /**
1149
- * Serialized representation of {@link EnsApiPublicConfig.ensIndexerPublicConfig}.
1109
+ * The status of omnichain indexing.
1150
1110
  */
1151
- ensIndexerPublicConfig: SerializedEnsIndexerPublicConfig;
1111
+ omnichainStatus: typeof OmnichainIndexingStatusIds.Following;
1112
+ /**
1113
+ * The indexing status snapshot for each indexed chain.
1114
+ */
1115
+ chains: Map<ChainId, ChainIndexingStatusSnapshot>;
1116
+ /**
1117
+ * The timestamp of omnichain indexing progress across all indexed chains.
1118
+ */
1119
+ omnichainIndexingCursor: UnixTimestamp;
1152
1120
  }
1153
1121
  /**
1154
- * Serialized representation of {@link EnsApiPublicConfig}
1122
+ * Omnichain indexing status snapshot when the overall `omnichainStatus` is
1123
+ * {@link OmnichainIndexingStatusIds.Completed}.
1155
1124
  *
1156
- * @deprecated Use {@link SerializedEnsApiPublicConfig} instead.
1125
+ * Invariants:
1126
+ * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Completed}.
1127
+ * - `chains` is always a map to {@link ChainIndexingStatusSnapshotCompleted} values exclusively.
1128
+ * - `omnichainIndexingCursor` is always equal to the highest
1129
+ * `latestIndexedBlock.timestamp` for all chains.
1157
1130
  */
1158
- type SerializedENSApiPublicConfig = SerializedEnsApiPublicConfig;
1159
-
1131
+ interface OmnichainIndexingStatusSnapshotCompleted {
1132
+ /**
1133
+ * The status of omnichain indexing.
1134
+ */
1135
+ omnichainStatus: typeof OmnichainIndexingStatusIds.Completed;
1136
+ /**
1137
+ * The indexing status snapshot for each indexed chain.
1138
+ */
1139
+ chains: Map<ChainId, ChainIndexingStatusSnapshotCompleted>;
1140
+ /**
1141
+ * The timestamp of omnichain indexing progress across all indexed chains.
1142
+ */
1143
+ omnichainIndexingCursor: UnixTimestamp;
1144
+ }
1160
1145
  /**
1161
- * Serialized representation of {@link EnsApiConfigResponse}
1146
+ * Omnichain indexing status snapshot for one or more chains.
1147
+ *
1148
+ * Use the `omnichainStatus` field to determine the specific type interpretation
1149
+ * at runtime.
1162
1150
  */
1163
- type SerializedEnsApiConfigResponse = SerializedEnsApiPublicConfig;
1151
+ type OmnichainIndexingStatusSnapshot = OmnichainIndexingStatusSnapshotUnstarted | OmnichainIndexingStatusSnapshotBackfill | OmnichainIndexingStatusSnapshotCompleted | OmnichainIndexingStatusSnapshotFollowing;
1164
1152
  /**
1165
- * @deprecated Use {@link SerializedEnsApiConfigResponse} instead.
1153
+ * Check if Chain Indexing Status Snapshots fit the 'unstarted' overall status
1154
+ * snapshot requirements:
1155
+ * - All chains are guaranteed to have a status of "queued".
1156
+ *
1157
+ * Note: This function narrows the {@link ChainIndexingStatusSnapshot} type to
1158
+ * {@link ChainIndexingStatusSnapshotQueued}.
1166
1159
  */
1167
- type SerializedConfigResponse = SerializedEnsApiConfigResponse;
1168
-
1160
+ declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted(chains: ChainIndexingStatusSnapshot[]): chains is ChainIndexingStatusSnapshotQueued[];
1169
1161
  /**
1170
- * Deserialize a {@link EnsApiConfigResponse} object.
1162
+ * Check if Chain Indexing Status Snapshots fit the 'backfill' overall status
1163
+ * snapshot requirements:
1164
+ * - At least one chain is guaranteed to be in the "backfill" status.
1165
+ * - Each chain is guaranteed to have a status of either "queued",
1166
+ * "backfill" or "completed".
1167
+ *
1168
+ * Note: This function narrows the {@link ChainIndexingStatusSnapshot} type to
1169
+ * {@link ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill}.
1171
1170
  */
1172
- declare function deserializeEnsApiConfigResponse(maybeResponse: Unvalidated<SerializedEnsApiConfigResponse>): EnsApiConfigResponse;
1171
+ declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill(chains: ChainIndexingStatusSnapshot[]): chains is ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill[];
1173
1172
  /**
1174
- * Deserialize a {@link EnsApiConfigResponse} object.
1173
+ * Checks if Chain Indexing Status Snapshots fit the 'completed' overall status
1174
+ * snapshot requirements:
1175
+ * - All chains are guaranteed to have a status of "completed".
1175
1176
  *
1176
- * @deprecated Use {@link deserializeEnsApiConfigResponse} instead.
1177
+ * Note: This function narrows the {@link ChainIndexingStatusSnapshot} type to
1178
+ * {@link ChainIndexingStatusSnapshotCompleted}.
1177
1179
  */
1178
- declare const deserializeConfigResponse: typeof deserializeEnsApiConfigResponse;
1179
-
1180
+ declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted(chains: ChainIndexingStatusSnapshot[]): chains is ChainIndexingStatusSnapshotCompleted[];
1180
1181
  /**
1181
- * Serialize ENSApi Config API Response
1182
+ * Checks Chain Indexing Status Snapshots fit the 'following' overall status
1183
+ * snapshot requirements:
1184
+ * - At least one chain is guaranteed to be in the "following" status.
1185
+ * - Any other chain can have any status.
1182
1186
  */
1183
- declare function serializeEnsApiConfigResponse(response: EnsApiConfigResponse): SerializedEnsApiConfigResponse;
1187
+ declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing(chains: ChainIndexingStatusSnapshot[]): boolean;
1184
1188
  /**
1185
- * Serialize ENSApi Config API Response
1189
+ * Get {@link OmnichainIndexingStatusId} based on indexed chains' statuses.
1190
+ *
1191
+ * This function decides what is the `OmnichainIndexingStatusId` is,
1192
+ * based on provided chain indexing statuses.
1186
1193
  *
1187
- * @deprecated Use {@link serializeEnsApiConfigResponse} instead.
1194
+ * @throws an error if unable to determine overall indexing status
1188
1195
  */
1189
- declare const serializeConfigResponse: typeof serializeEnsApiConfigResponse;
1190
-
1191
- declare const RangeTypeIds: {
1192
- readonly Unbounded: "unbounded";
1193
- readonly LeftBounded: "left-bounded";
1194
- readonly RightBounded: "right-bounded";
1195
- readonly Bounded: "bounded";
1196
- };
1197
- type RangeType = (typeof RangeTypeIds)[keyof typeof RangeTypeIds];
1198
- /************************
1199
- * Block number range
1200
- ***********************/
1196
+ declare function getOmnichainIndexingStatus(chains: ChainIndexingStatusSnapshot[]): OmnichainIndexingStatusId;
1201
1197
  /**
1202
- * Block number range unbounded
1198
+ * Get Omnichain Indexing Cursor
1199
+ *
1200
+ * The cursor tracks the "highest" latest indexed block timestamp across
1201
+ * all indexed chains. If all chains are queued, the cursor tracks the moment
1202
+ * just before the earliest start block timestamp across those chains.
1203
+ *
1204
+ * @throws an error if no chains are provided
1203
1205
  */
1204
- interface BlockNumberRangeUnbounded {
1205
- rangeType: typeof RangeTypeIds.Unbounded;
1206
- startBlock?: undefined;
1207
- endBlock?: undefined;
1208
- }
1206
+ declare function getOmnichainIndexingCursor(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
1209
1207
  /**
1210
- * Block number range left bounded
1208
+ * Build an Omnichain Indexing Status Snapshot based on the indexing status snapshots of all indexed chains.
1211
1209
  *
1212
- * Range is inclusive of its left bound.
1210
+ * @param chainStatusSnapshots - A map of chain IDs to their chain indexing status snapshots.
1211
+ * @returns The omnichain indexing status snapshot.
1213
1212
  */
1214
- interface BlockNumberRangeLeftBounded {
1215
- rangeType: typeof RangeTypeIds.LeftBounded;
1216
- startBlock: BlockNumber;
1217
- endBlock?: undefined;
1218
- }
1213
+ declare function buildOmnichainIndexingStatusSnapshot(chainStatusSnapshots: Map<ChainId, ChainIndexingStatusSnapshot>): OmnichainIndexingStatusSnapshot;
1214
+
1219
1215
  /**
1220
- * Block number range right bounded
1216
+ * The strategy used for indexing one or more chains.
1221
1217
  *
1222
- * Range is inclusive of its right bound.
1218
+ * @see https://ponder.sh/docs/api-reference/ponder/config#parameters
1223
1219
  */
1224
- interface BlockNumberRangeRightBounded {
1225
- rangeType: typeof RangeTypeIds.RightBounded;
1226
- startBlock?: undefined;
1227
- endBlock: BlockNumber;
1228
- }
1220
+ declare const CrossChainIndexingStrategyIds: {
1221
+ /**
1222
+ * Represents that the indexing of events across all indexed chains will
1223
+ * proceed in a deterministic "omnichain" ordering by block timestamp, chain ID,
1224
+ * and block number.
1225
+ *
1226
+ * This strategy is "deterministic" in that the order of processing cross-chain indexed
1227
+ * events and each resulting indexed data state transition recorded in ENSDb is always
1228
+ * the same for each ENSIndexer instance operating with an equivalent
1229
+ * `ENSIndexerConfig` and ENSIndexer version. However it also has the drawbacks of:
1230
+ * - increased indexing latency that must wait for the slowest indexed chain to
1231
+ * add new blocks or to discover new blocks through the configured RPCs.
1232
+ * - if any indexed chain gets "stuck" due to chain or RPC failures, all indexed chains
1233
+ * will be affected.
1234
+ */
1235
+ readonly Omnichain: "omnichain";
1236
+ };
1229
1237
  /**
1230
- * Block number range bounded
1231
- *
1232
- * Range is inclusive of its bounds.
1233
- *
1234
- * Invariants:
1235
- * - `startBlock` is lower than or equal to `endBlock`
1238
+ * The derived string union of possible {@link CrossChainIndexingStrategyIds}.
1236
1239
  */
1237
- interface BlockNumberRangeBounded {
1238
- rangeType: typeof RangeTypeIds.Bounded;
1239
- startBlock: BlockNumber;
1240
- endBlock: BlockNumber;
1241
- }
1240
+ type CrossChainIndexingStrategyId = (typeof CrossChainIndexingStrategyIds)[keyof typeof CrossChainIndexingStrategyIds];
1242
1241
  /**
1243
- * Block number range with start block defined.
1242
+ * Cross-chain indexing status snapshot when the `strategy` is
1243
+ * {@link CrossChainIndexingStrategyId.Omnichain}.
1244
1244
  *
1245
- * This is a useful type for representing block ranges for indexed chains.
1245
+ * Invariants:
1246
+ * - `strategy` is always {@link CrossChainIndexingStrategyId.Omnichain}.
1247
+ * - `slowestChainIndexingCursor` is always equal to
1248
+ * `omnichainSnapshot.omnichainIndexingCursor`.
1249
+ * - `snapshotTime` is always >= the "highest known block timestamp", defined as the max of:
1250
+ * - the `slowestChainIndexingCursor`.
1251
+ * - the `config.startBlock.timestamp` for all indexed chains.
1252
+ * - the `config.endBlock.timestamp` for all indexed chains with a `config.rangeType` of
1253
+ * {@link RangeTypeIds.Bounded}.
1254
+ * - the `backfillEndBlock.timestamp` for all chains with `chainStatus` of
1255
+ * {@link ChainIndexingStatusIds.Backfill}.
1256
+ * - the `latestKnownBlock.timestamp` for all chains with `chainStatus` of
1257
+ * {@link ChainIndexingStatusIds.Following}.
1246
1258
  */
1247
- type BlockNumberRangeWithStartBlock = BlockNumberRangeLeftBounded | BlockNumberRangeBounded;
1259
+ interface CrossChainIndexingStatusSnapshotOmnichain {
1260
+ /**
1261
+ * The strategy used for indexing one or more chains.
1262
+ */
1263
+ strategy: typeof CrossChainIndexingStrategyIds.Omnichain;
1264
+ /**
1265
+ * The timestamp of the "slowest" latest indexed block timestamp
1266
+ * across all indexed chains.
1267
+ */
1268
+ slowestChainIndexingCursor: UnixTimestamp;
1269
+ /**
1270
+ * The timestamp when the cross-chain indexing status snapshot was generated.
1271
+ *
1272
+ * Due to possible clock skew between different systems this value must be set
1273
+ * to the max of each of the following values to ensure all invariants are followed:
1274
+ * - the current system time of the system generating this cross-chain indexing
1275
+ * status snapshot.
1276
+ * - the "highest known block timestamp" (see invariants above for full definition).
1277
+ */
1278
+ snapshotTime: UnixTimestamp;
1279
+ /**
1280
+ * The omnichain indexing status snapshot for one or more chains.
1281
+ */
1282
+ omnichainSnapshot: OmnichainIndexingStatusSnapshot;
1283
+ }
1248
1284
  /**
1249
- * Block number range
1285
+ * Cross-chain indexing status snapshot for one or more chains.
1250
1286
  *
1251
- * Use the `rangeType` field to determine the specific type interpretation
1287
+ * Use the `strategy` field to determine the specific type interpretation
1252
1288
  * at runtime.
1253
- */
1254
- type BlockNumberRange = BlockNumberRangeUnbounded | BlockNumberRangeLeftBounded | BlockNumberRangeRightBounded | BlockNumberRangeBounded;
1255
- /**
1256
- * Build a block number range object.
1257
- */
1258
- declare function buildBlockNumberRange(startBlock: undefined, endBlock: undefined): BlockNumberRangeUnbounded;
1259
- declare function buildBlockNumberRange(startBlock: BlockNumber, endBlock: undefined): BlockNumberRangeLeftBounded;
1260
- declare function buildBlockNumberRange(startBlock: undefined, endBlock: BlockNumber): BlockNumberRangeRightBounded;
1261
- declare function buildBlockNumberRange(startBlock: BlockNumber, endBlock: BlockNumber): BlockNumberRangeBounded;
1262
- declare function buildBlockNumberRange(startBlock?: BlockNumber, endBlock?: BlockNumber): BlockNumberRange;
1263
- /**
1264
- * Merge multiple block number ranges into a single range.
1265
- *
1266
- * The resulting range is a union that covers all input ranges:
1267
- * - Uses the minimum start block when every input range has a start block
1268
- * - Uses the maximum end block when every input range has an end block
1269
- * - Leaves a side unbounded when any input range is unbounded on that side
1270
- *
1271
- * Returns an unbounded range if no ranges are provided.
1272
- *
1273
- * @param ranges - The block number ranges to merge
1274
- * @returns A single merged block number range covering all inputs
1275
- */
1276
- declare function mergeBlockNumberRanges(...ranges: BlockNumberRange[]): BlockNumberRange;
1277
- /************************
1278
- * Block ref range
1279
- ***********************/
1280
- /**
1281
- * Block ref range unbounded
1282
- */
1283
- interface BlockRefRangeUnbounded {
1284
- rangeType: typeof RangeTypeIds.Unbounded;
1285
- startBlock?: undefined;
1286
- endBlock?: undefined;
1287
- }
1288
- /**
1289
- * Block ref range left bounded
1290
1289
  *
1291
- * Range is inclusive of its left bound.
1290
+ * Currently, only omnichain indexing is supported. This type could theoretically
1291
+ * be extended to support other cross-chain indexing strategies in the future,
1292
+ * such as Ponder's "multichain" indexing strategy that indexes each chain
1293
+ * independently without deterministic ordering.
1292
1294
  */
1293
- interface BlockRefRangeLeftBounded {
1294
- rangeType: typeof RangeTypeIds.LeftBounded;
1295
- startBlock: BlockRef;
1296
- endBlock?: undefined;
1297
- }
1295
+ type CrossChainIndexingStatusSnapshot = CrossChainIndexingStatusSnapshotOmnichain;
1298
1296
  /**
1299
- * Block ref range right bounded
1297
+ * Gets the latest indexed {@link BlockRef} for the given {@link ChainId}.
1300
1298
  *
1301
- * Range is inclusive of its right bound.
1299
+ * @returns the latest indexed {@link BlockRef} for the given {@link ChainId}, or null if the chain
1300
+ * isn't being indexed at all or is queued and therefore hasn't started indexing yet.
1302
1301
  */
1303
- interface BlockRefRangeRightBounded {
1304
- rangeType: typeof RangeTypeIds.RightBounded;
1305
- startBlock?: undefined;
1306
- endBlock: BlockRef;
1307
- }
1302
+ declare function getLatestIndexedBlockRef(indexingStatus: CrossChainIndexingStatusSnapshot, chainId: ChainId): BlockRef | null;
1308
1303
  /**
1309
- * Block ref range bounded
1304
+ * Get the "highest known block timestamp" from chain indexing status snapshots.
1310
1305
  *
1311
- * Range is inclusive of its bounds.
1306
+ * Returns the maximum timestamp referenced anywhere in the provided chain snapshots,
1307
+ * across all of:
1308
+ * - `config.startBlock` timestamps for all chains
1309
+ * - `config.endBlock` timestamps for bounded chains
1310
+ * - `backfillEndBlock` timestamps for chains in backfill status
1311
+ * - `latestKnownBlock` timestamps for chains in following status
1312
1312
  *
1313
- * Invariants:
1314
- * - `startBlock` is before or equal to `endBlock`
1315
- */
1316
- interface BlockRefRangeBounded {
1317
- rangeType: typeof RangeTypeIds.Bounded;
1318
- startBlock: BlockRef;
1319
- endBlock: BlockRef;
1320
- }
1321
- /**
1322
- * Block ref range
1313
+ * This is used to enforce the invariant that `snapshotTime` must be >= all
1314
+ * referenced block timestamps. It differs from {@link getTimestampForHighestOmnichainKnownBlock},
1315
+ * which computes the highest "target" block timestamp for progress display and
1316
+ * does not include `startBlock` timestamps.
1323
1317
  *
1324
- * Use the `rangeType` field to determine the specific type interpretation
1325
- * at runtime.
1318
+ * @throws Error if `chains` is empty.
1326
1319
  */
1327
- type BlockRefRange = BlockRefRangeUnbounded | BlockRefRangeLeftBounded | BlockRefRangeRightBounded | BlockRefRangeBounded;
1320
+ declare function getHighestKnownBlockTimestamp(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
1328
1321
  /**
1329
- * Block ref range with start block defined.
1322
+ * Build a Cross-Chain Indexing Status Snapshot based on the omnichain indexing status snapshot.
1330
1323
  *
1331
- * This is a useful type for representing block ranges for indexed chains.
1332
- */
1333
- type BlockRefRangeWithStartBlock = BlockRefRangeLeftBounded | BlockRefRangeBounded;
1334
- /**
1335
- * Build a block ref range object.
1324
+ * @param omnichainSnapshot - The omnichain indexing status snapshot.
1325
+ * @param snapshotTime - The timestamp when the cross-chain indexing status snapshot was generated.
1326
+ * Will be adjusted upward if necessary to satisfy the invariant that snapshotTime must
1327
+ * be >= the highest known block timestamp (handles clock skew and future block timestamps).
1328
+ * @returns The cross-chain indexing status snapshot.
1329
+ * @throws if the generated snapshot does not satisfy the invariants defined
1330
+ * in {@link CrossChainIndexingStatusSnapshotOmnichain}
1336
1331
  */
1337
- declare function buildBlockRefRange(startBlock: undefined, endBlock: undefined): BlockRefRangeUnbounded;
1338
- declare function buildBlockRefRange(startBlock: BlockRef, endBlock: undefined): BlockRefRangeLeftBounded;
1339
- declare function buildBlockRefRange(startBlock: undefined, endBlock: BlockRef): BlockRefRangeRightBounded;
1340
- declare function buildBlockRefRange(startBlock: BlockRef, endBlock: BlockRef): BlockRefRangeBounded;
1341
- declare function buildBlockRefRange(startBlock?: BlockRef, endBlock?: BlockRef): BlockRefRange;
1332
+ declare function buildCrossChainIndexingStatusSnapshotOmnichain(omnichainSnapshot: OmnichainIndexingStatusSnapshot, snapshotTime: UnixTimestamp): CrossChainIndexingStatusSnapshotOmnichain;
1342
1333
 
1343
1334
  /**
1344
- * The status of indexing a chain at the time an indexing status snapshot
1345
- * is captured.
1335
+ * A "realtime" indexing status projection based on worst-case assumptions
1336
+ * from the `snapshot`.
1337
+ *
1338
+ * Invariants:
1339
+ * - `projectedAt` is always >= `snapshot.snapshotTime`.
1340
+ * - `worstCaseDistance` is always equal to
1341
+ * `projectedAt - snapshot.slowestChainIndexingCursor`.
1346
1342
  */
1347
- declare const ChainIndexingStatusIds: {
1348
- /**
1349
- * Represents that indexing of the chain is not ready to begin yet because:
1350
- * - ENSIndexer is in its initialization phase and the data to build a
1351
- * "true" {@link ChainIndexingStatusSnapshot} for the chain is still being loaded; or
1352
- * - ENSIndexer is using an omnichain indexing strategy and the
1353
- * `omnichainIndexingCursor` is <= `config.startBlock.timestamp` for the chain's
1354
- * {@link ChainIndexingStatusSnapshot}.
1355
- */
1356
- readonly Queued: "chain-queued";
1343
+ type RealtimeIndexingStatusProjection = {
1357
1344
  /**
1358
- * Represents that indexing of the chain is in progress and under a special
1359
- * "backfill" phase that optimizes for accelerated indexing until reaching the
1360
- * "fixed target" `backfillEndBlock`.
1345
+ * The timestamp representing "now" as of the time this projection was generated.
1361
1346
  */
1362
- readonly Backfill: "chain-backfill";
1347
+ projectedAt: UnixTimestamp;
1363
1348
  /**
1364
- * Represents that the "backfill" phase of indexing the chain is completed
1365
- * and that the chain is configured to be indexed for an indefinite range.
1366
- * Therefore, indexing of the chain remains indefinitely in progress where
1367
- * ENSIndexer will continuously work to discover and index new blocks as they
1368
- * are added to the chain across time.
1349
+ * The distance between `projectedAt` and `snapshot.slowestChainIndexingCursor`.
1350
+ *
1351
+ * This is "worst-case" because it assumes all of the following:
1352
+ * - the `snapshot` (which may have `snapshot.snapshotTime < projectedAt`) is still the
1353
+ * latest snapshot and no indexing progress has been made since `snapshotTime`.
1354
+ * - each indexed chain has added a new block as of `projectedAt`.
1369
1355
  */
1370
- readonly Following: "chain-following";
1356
+ worstCaseDistance: Duration;
1371
1357
  /**
1372
- * Represents that indexing of the chain is completed as the chain is configured
1373
- * to be indexed for a definite range and the indexing of all blocks through
1374
- * that definite range is completed.
1358
+ * The {@link CrossChainIndexingStatusSnapshot} that this projection is based on.
1375
1359
  */
1376
- readonly Completed: "chain-completed";
1360
+ snapshot: CrossChainIndexingStatusSnapshot;
1377
1361
  };
1378
1362
  /**
1379
- * The derived string union of possible {@link ChainIndexingStatusIds}.
1363
+ * Create realtime indexing status projection from
1364
+ * a {@link CrossChainIndexingStatusSnapshot}.
1380
1365
  */
1381
- type ChainIndexingStatusId = (typeof ChainIndexingStatusIds)[keyof typeof ChainIndexingStatusIds];
1366
+ declare function createRealtimeIndexingStatusProjection(snapshot: CrossChainIndexingStatusSnapshot, now: UnixTimestamp): RealtimeIndexingStatusProjection;
1367
+
1382
1368
  /**
1383
- * Chain indexing status snapshot for a chain whose `chainStatus` is
1384
- * {@link ChainIndexingStatusIds.Queued}.
1385
- *
1386
- * Invariants:
1387
- * - `chainStatus` is always {@link ChainIndexingStatusIds.Queued}.
1369
+ * A status code for ENSIndexer indexing status responses.
1388
1370
  */
1389
- interface ChainIndexingStatusSnapshotQueued {
1371
+ declare const EnsIndexerIndexingStatusResponseCodes: {
1390
1372
  /**
1391
- * The status of indexing the chain at the time the indexing status snapshot
1392
- * was captured.
1373
+ * Represents that the indexing status is available.
1393
1374
  */
1394
- chainStatus: typeof ChainIndexingStatusIds.Queued;
1375
+ readonly Ok: "ok";
1395
1376
  /**
1396
- * The indexing configuration of the chain.
1377
+ * Represents that the indexing status is unavailable.
1397
1378
  */
1398
- config: BlockRefRangeWithStartBlock;
1399
- }
1379
+ readonly Error: "error";
1380
+ };
1400
1381
  /**
1401
- * Chain indexing status snapshot for a chain whose `chainStatus` is
1402
- * {@link ChainIndexingStatusIds.Backfill}.
1403
- *
1404
- * During a backfill, special performance optimizations are applied to
1405
- * index all blocks between `config.startBlock` and `backfillEndBlock`
1406
- * as fast as possible.
1407
- *
1408
- * Note how `backfillEndBlock` is a "fixed target" that does not change during
1409
- * the lifetime of an ENSIndexer process instance:
1410
- * - If the `config` is {@link BlockRefRangeBounded}:
1411
- * `backfillEndBlock` is always the same as `config.endBlock`.
1412
- * - If the `config` is {@link BlockRefRangeLeftBounded}:
1413
- * `backfillEndBlock` is a {@link BlockRef} to what was the latest block on the
1414
- * chain when the ENSIndexer process was performing its initialization. Note how
1415
- * this means that if the backfill process takes X hours to complete, because the
1416
- * `backfillEndBlock` is a "fixed target", when `chainStatus` transitions to
1417
- * {@link ChainIndexingStatusIds.Following} the chain will be X hours behind
1418
- * "realtime" indexing.
1419
- *
1420
- * When `latestIndexedBlock` reaches `backfillEndBlock` the backfill is complete.
1421
- * The moment backfill is complete the `chainStatus` may not immediately transition.
1422
- * Instead, internal processing is completed for a period of time while
1423
- * `chainStatus` remains {@link ChainIndexingStatusIds.Backfill}. After this internal
1424
- * processing is completed `chainStatus` will transition:
1425
- * - to {@link ChainIndexingStatusIds.Following} if the `config` is
1426
- * {@link BlockRefRangeLeftBounded}.
1427
- * - to {@link ChainIndexingStatusIds.Completed} if the `config` is
1428
- * {@link BlockRefRangeBounded}.
1429
- *
1430
- * Invariants:
1431
- * - `chainStatus` is always {@link ChainIndexingStatusIds.Backfill}.
1432
- * - `config.startBlock` is always before or the same as `latestIndexedBlock`
1433
- * - `config.endBlock` is always the same as `backfillEndBlock` if and only if
1434
- * the config is {@link BlockRefRangeBounded}.
1435
- * - `latestIndexedBlock` is always before or the same as `backfillEndBlock`
1382
+ * The derived string union of possible {@link EnsIndexerIndexingStatusResponseCodes}.
1436
1383
  */
1437
- interface ChainIndexingStatusSnapshotBackfill {
1438
- /**
1439
- * The status of indexing the chain at the time the indexing status snapshot
1440
- * was captured.
1441
- */
1442
- chainStatus: typeof ChainIndexingStatusIds.Backfill;
1443
- /**
1444
- * The indexing configuration of the chain.
1445
- */
1446
- config: BlockRefRangeWithStartBlock;
1447
- /**
1448
- * A {@link BlockRef} to the block that was most recently indexed as of the time the
1449
- * indexing status snapshot was captured.
1450
- */
1451
- latestIndexedBlock: BlockRef;
1452
- /**
1453
- * A {@link BlockRef} to the block where the backfill will end.
1454
- */
1455
- backfillEndBlock: BlockRef;
1456
- }
1384
+ type EnsIndexerIndexingStatusResponseCode = (typeof EnsIndexerIndexingStatusResponseCodes)[keyof typeof EnsIndexerIndexingStatusResponseCodes];
1457
1385
  /**
1458
- * Chain indexing status snapshot for a chain whose `chainStatus` is
1459
- * {@link ChainIndexingStatusIds.Following}.
1460
- *
1461
- * Invariants:
1462
- * - `chainStatus` is always {@link ChainIndexingStatusIds.Following}.
1463
- * - `config.startBlock` is always before or the same as `latestIndexedBlock`
1464
- * - `latestIndexedBlock` is always before or the same as `latestKnownBlock`
1386
+ * An ENSIndexer indexing status response when the indexing status is available.
1465
1387
  */
1466
- interface ChainIndexingStatusSnapshotFollowing {
1467
- /**
1468
- * The status of indexing the chain at the time the indexing status snapshot
1469
- * was captured.
1470
- */
1471
- chainStatus: typeof ChainIndexingStatusIds.Following;
1472
- /**
1473
- * The indexing configuration of the chain.
1474
- */
1475
- config: BlockRefRangeLeftBounded;
1476
- /**
1477
- * A {@link BlockRef} to the block that was most recently indexed as of the time the
1478
- * indexing status snapshot was captured.
1479
- */
1480
- latestIndexedBlock: BlockRef;
1481
- /**
1482
- * A {@link BlockRef} to the "highest" block that has been discovered by RPCs
1483
- * and stored in the RPC cache as of the time the indexing status snapshot was
1484
- * captured.
1485
- */
1486
- latestKnownBlock: BlockRef;
1487
- }
1388
+ type EnsIndexerIndexingStatusResponseOk = {
1389
+ responseCode: typeof EnsIndexerIndexingStatusResponseCodes.Ok;
1390
+ realtimeProjection: RealtimeIndexingStatusProjection;
1391
+ };
1488
1392
  /**
1489
- * Chain indexing status snapshot for a chain whose `chainStatus` is
1490
- * {@link ChainIndexingStatusIds.Completed}.
1491
- *
1492
- * After the backfill of a chain is completed, if the chain was configured
1493
- * to be indexed for a definite range, the chain indexing status will transition to
1494
- * {@link ChainIndexingStatusIds.Completed}.
1495
- *
1496
- * Invariants:
1497
- * - `chainStatus` is always {@link ChainIndexingStatusIds.Completed}.
1498
- * - `config.startBlock` is always before or the same as `latestIndexedBlock`
1499
- * - `latestIndexedBlock` is always the same as `config.endBlock`.
1393
+ * An ENSIndexer indexing status response when the indexing status is unavailable.
1500
1394
  */
1501
- interface ChainIndexingStatusSnapshotCompleted {
1502
- /**
1503
- * The status of indexing the chain at the time the indexing status snapshot
1504
- * was captured.
1505
- */
1506
- chainStatus: typeof ChainIndexingStatusIds.Completed;
1507
- /**
1508
- * The indexing configuration of the chain.
1509
- */
1510
- config: BlockRefRangeBounded;
1511
- /**
1512
- * A {@link BlockRef} to the block that was most recently indexed as of the time the
1513
- * indexing status snapshot was captured.
1514
- */
1515
- latestIndexedBlock: BlockRef;
1516
- }
1395
+ type EnsIndexerIndexingStatusResponseError = {
1396
+ responseCode: typeof EnsIndexerIndexingStatusResponseCodes.Error;
1397
+ };
1517
1398
  /**
1518
- * Indexing status snapshot for a single chain.
1399
+ * ENSIndexer indexing status response.
1519
1400
  *
1520
- * Use the `chainStatus` field to determine the specific type interpretation
1401
+ * Use the `responseCode` field to determine the specific type interpretation
1521
1402
  * at runtime.
1522
1403
  */
1523
- type ChainIndexingStatusSnapshot = ChainIndexingStatusSnapshotQueued | ChainIndexingStatusSnapshotBackfill | ChainIndexingStatusSnapshotFollowing | ChainIndexingStatusSnapshotCompleted;
1404
+ type EnsIndexerIndexingStatusResponse = EnsIndexerIndexingStatusResponseOk | EnsIndexerIndexingStatusResponseError;
1405
+
1524
1406
  /**
1525
- * Get the timestamp of the lowest `config.startBlock` across all chains
1526
- * in the provided array of {@link ChainIndexingStatusSnapshot}.
1527
- *
1528
- * Such timestamp is useful when presenting the "lowest" block
1529
- * to be indexed across all chains.
1407
+ * Serialized representation of {@link OmnichainIndexingStatusSnapshotUnstarted}
1530
1408
  */
1531
- declare function getTimestampForLowestOmnichainStartBlock(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
1409
+ interface SerializedOmnichainIndexingStatusSnapshotUnstarted extends Omit<OmnichainIndexingStatusSnapshotUnstarted, "chains"> {
1410
+ chains: Record<ChainIdString, ChainIndexingStatusSnapshotQueued>;
1411
+ }
1532
1412
  /**
1533
- * Get the timestamp of the "highest known block" across all chains
1534
- * in the provided array of {@link ChainIndexingStatusSnapshot}.
1535
- *
1536
- * Such timestamp is useful when presenting the "highest known block"
1537
- * to be indexed across all chains.
1538
- *
1539
- * The "highest known block" for a chain depends on its status:
1540
- * - `config.endBlock` for a "queued" chain (only if the config range type is `Bounded`),
1541
- * - `backfillEndBlock` for a "backfill" chain,
1542
- * - `latestIndexedBlock` for a "completed" chain,
1543
- * - `latestKnownBlock` for a "following" chain.
1413
+ * Serialized representation of {@link OmnichainIndexingStatusSnapshotBackfill}
1544
1414
  */
1545
- declare function getTimestampForHighestOmnichainKnownBlock(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
1415
+ interface SerializedOmnichainIndexingStatusSnapshotBackfill extends Omit<OmnichainIndexingStatusSnapshotBackfill, "chains"> {
1416
+ chains: Record<ChainIdString, ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill>;
1417
+ }
1546
1418
  /**
1547
- * Sort a list of [{@link ChainId}, {@link ChainIndexingStatusSnapshot}] tuples
1548
- * by the omnichain start block timestamp in ascending order.
1419
+ * Serialized representation of {@link OmnichainIndexingStatusSnapshotCompleted}
1549
1420
  */
1550
- declare function sortChainStatusesByStartBlockAsc<ChainStatusType extends ChainIndexingStatusSnapshot>(chains: [ChainId, ChainStatusType][]): [ChainId, ChainStatusType][];
1551
-
1421
+ interface SerializedOmnichainIndexingStatusSnapshotCompleted extends Omit<OmnichainIndexingStatusSnapshotCompleted, "chains"> {
1422
+ chains: Record<ChainIdString, ChainIndexingStatusSnapshotCompleted>;
1423
+ }
1552
1424
  /**
1553
- * The status of omnichain indexing at the time an omnichain indexing status
1554
- * snapshot is captured.
1425
+ * Serialized representation of {@link OmnichainIndexingStatusSnapshotFollowing}
1555
1426
  */
1556
- declare const OmnichainIndexingStatusIds: {
1557
- /**
1558
- * Represents that omnichain indexing is not ready to begin yet because
1559
- * ENSIndexer is in its initialization phase and the data to build a "true"
1560
- * {@link OmnichainIndexingStatusSnapshot} is still being loaded.
1561
- */
1562
- readonly Unstarted: "omnichain-unstarted";
1563
- /**
1564
- * Represents that omnichain indexing is in an overall "backfill" status because
1565
- * - At least one indexed chain has a `chainStatus` of
1566
- * {@link ChainIndexingStatusIds.Backfill}; and
1567
- * - No indexed chain has a `chainStatus` of {@link ChainIndexingStatusIds.Following}.
1568
- */
1569
- readonly Backfill: "omnichain-backfill";
1570
- /**
1571
- * Represents that omnichain indexing is in an overall "following" status because
1572
- * at least one indexed chain has a `chainStatus` of
1573
- * {@link ChainIndexingStatusIds.Following}.
1574
- */
1575
- readonly Following: "omnichain-following";
1576
- /**
1577
- * Represents that omnichain indexing has completed because all indexed chains have
1578
- * a `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
1579
- */
1580
- readonly Completed: "omnichain-completed";
1581
- };
1427
+ interface SerializedOmnichainIndexingStatusSnapshotFollowing extends Omit<OmnichainIndexingStatusSnapshotFollowing, "chains"> {
1428
+ chains: Record<ChainIdString, ChainIndexingStatusSnapshot>;
1429
+ }
1582
1430
  /**
1583
- * The derived string union of possible {@link OmnichainIndexingStatusIds}.
1431
+ * Serialized representation of {@link OmnichainIndexingStatusSnapshot}
1584
1432
  */
1585
- type OmnichainIndexingStatusId = (typeof OmnichainIndexingStatusIds)[keyof typeof OmnichainIndexingStatusIds];
1433
+ type SerializedOmnichainIndexingStatusSnapshot = SerializedOmnichainIndexingStatusSnapshotUnstarted | SerializedOmnichainIndexingStatusSnapshotBackfill | SerializedOmnichainIndexingStatusSnapshotCompleted | SerializedOmnichainIndexingStatusSnapshotFollowing;
1586
1434
  /**
1587
- * Omnichain indexing status snapshot when the overall `omnichainStatus` is
1588
- * {@link OmnichainIndexingStatusIds.Unstarted}.
1589
- *
1590
- * Invariants:
1591
- * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Unstarted}.
1592
- * - `chains` is always a map to {@link ChainIndexingStatusSnapshotQueued} values exclusively.
1593
- * - `omnichainIndexingCursor` is always < the `config.startBlock.timestamp` for all
1594
- * chains with `chainStatus` of {@link ChainIndexingStatusIds.Queued}.
1435
+ * Serialize a {@link OmnichainIndexingStatusSnapshot} object.
1595
1436
  */
1596
- interface OmnichainIndexingStatusSnapshotUnstarted {
1597
- /**
1598
- * The status of omnichain indexing.
1599
- */
1600
- omnichainStatus: typeof OmnichainIndexingStatusIds.Unstarted;
1601
- /**
1602
- * The indexing status snapshot for each indexed chain.
1603
- */
1604
- chains: Map<ChainId, ChainIndexingStatusSnapshotQueued>;
1605
- /**
1606
- * The timestamp of omnichain indexing progress across all indexed chains.
1607
- */
1608
- omnichainIndexingCursor: UnixTimestamp;
1437
+ declare function serializeOmnichainIndexingStatusSnapshot(indexingStatus: OmnichainIndexingStatusSnapshot): SerializedOmnichainIndexingStatusSnapshot;
1438
+
1439
+ /**
1440
+ * Serialized representation of {@link CrossChainIndexingStatusSnapshotOmnichain}
1441
+ */
1442
+ interface SerializedCrossChainIndexingStatusSnapshotOmnichain extends Omit<CrossChainIndexingStatusSnapshotOmnichain, "omnichainSnapshot"> {
1443
+ omnichainSnapshot: SerializedOmnichainIndexingStatusSnapshot;
1609
1444
  }
1610
1445
  /**
1611
- * The range of {@link ChainIndexingSnapshot} types allowed when the
1612
- * overall omnichain indexing status is {@link OmnichainIndexingStatusIds.Backfill}.
1613
- *
1614
- * Note that this is all of the {@link ChainIndexingSnapshot} types with the exception
1615
- * of {@link ChainIndexingStatusSnapshotFollowing}.
1446
+ * Serialized representation of {@link CrossChainIndexingStatusSnapshot}
1616
1447
  */
1617
- type ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill = ChainIndexingStatusSnapshotQueued | ChainIndexingStatusSnapshotBackfill | ChainIndexingStatusSnapshotCompleted;
1448
+ type SerializedCrossChainIndexingStatusSnapshot = SerializedCrossChainIndexingStatusSnapshotOmnichain;
1449
+ declare function serializeCrossChainIndexingStatusSnapshotOmnichain({ strategy, slowestChainIndexingCursor, snapshotTime, omnichainSnapshot, }: CrossChainIndexingStatusSnapshotOmnichain): SerializedCrossChainIndexingStatusSnapshotOmnichain;
1450
+ declare function serializeCrossChainIndexingStatusSnapshot(snapshot: CrossChainIndexingStatusSnapshot): SerializedCrossChainIndexingStatusSnapshot;
1451
+
1618
1452
  /**
1619
- * Omnichain indexing status snapshot when the `omnichainStatus` is
1620
- * {@link OmnichainIndexingStatusIds.Backfill}.
1621
- *
1622
- * Invariants:
1623
- * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Backfill}.
1624
- * - `chains` is guaranteed to contain at least one chain with a `chainStatus` of
1625
- * {@link ChainIndexingStatusIds.Backfill}.
1626
- * - `chains` is guaranteed to not to contain any chain with a `chainStatus` of
1627
- * {@link ChainIndexingStatusIds.Following}
1628
- * - `omnichainIndexingCursor` is always < the `config.startBlock.timestamp` for all
1629
- * chains with `chainStatus` of {@link ChainIndexingStatusIds.Queued}.
1630
- * - `omnichainIndexingCursor` is always <= the `backfillEndBlock.timestamp` for all
1631
- * chains with `chainStatus` of {@link ChainIndexingStatusIds.Backfill}.
1632
- * - `omnichainIndexingCursor` is always >= the `latestIndexedBlock.timestamp` for all
1633
- * chains with `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
1634
- * - `omnichainIndexingCursor` is always equal to the timestamp of the highest
1635
- * `latestIndexedBlock` across all chains that have started indexing
1636
- * (`chainStatus` is not {@link ChainIndexingStatusIds.Queued}).
1453
+ * Serialized representation of {@link RealtimeIndexingStatusProjection}
1637
1454
  */
1638
- interface OmnichainIndexingStatusSnapshotBackfill {
1639
- /**
1640
- * The status of omnichain indexing.
1641
- */
1642
- omnichainStatus: typeof OmnichainIndexingStatusIds.Backfill;
1643
- /**
1644
- * The indexing status snapshot for each indexed chain.
1645
- */
1646
- chains: Map<ChainId, ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill>;
1647
- /**
1648
- * The timestamp of omnichain indexing progress across all indexed chains.
1649
- */
1650
- omnichainIndexingCursor: UnixTimestamp;
1455
+ interface SerializedCurrentIndexingProjectionOmnichain extends Omit<RealtimeIndexingStatusProjection, "snapshot"> {
1456
+ snapshot: SerializedOmnichainIndexingStatusSnapshot;
1651
1457
  }
1652
1458
  /**
1653
- * Omnichain indexing status snapshot when the overall `omnichainStatus` is
1654
- * {@link OmnichainIndexingStatusIds.Following}.
1655
- *
1656
- * Invariants:
1657
- * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Following}.
1658
- * - `chains` is guaranteed to contain at least one chain with a `status` of
1659
- * {@link ChainIndexingStatusIds.Following}.
1660
- * - `omnichainIndexingCursor` is always < the `config.startBlock.timestamp` for all
1661
- * chains with `chainStatus` of {@link ChainIndexingStatusIds.Queued}.
1662
- * - `omnichainIndexingCursor` is always <= the `backfillEndBlock.timestamp` for all
1663
- * chains with `chainStatus` of {@link ChainIndexingStatusIds.Backfill}.
1664
- * - `omnichainIndexingCursor` is always >= the `latestIndexedBlock.timestamp` for all
1665
- * chains with `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
1666
- * - `omnichainIndexingCursor` is always equal to the timestamp of the highest
1667
- * `latestIndexedBlock` across all chains that have started indexing
1668
- * (`chainStatus` is not {@link ChainIndexingStatusIds.Queued}).
1459
+ * Serialized representation of {@link RealtimeIndexingStatusProjection}
1669
1460
  */
1670
- interface OmnichainIndexingStatusSnapshotFollowing {
1671
- /**
1672
- * The status of omnichain indexing.
1673
- */
1674
- omnichainStatus: typeof OmnichainIndexingStatusIds.Following;
1675
- /**
1676
- * The indexing status snapshot for each indexed chain.
1677
- */
1678
- chains: Map<ChainId, ChainIndexingStatusSnapshot>;
1679
- /**
1680
- * The timestamp of omnichain indexing progress across all indexed chains.
1681
- */
1682
- omnichainIndexingCursor: UnixTimestamp;
1461
+ interface SerializedRealtimeIndexingStatusProjection extends Omit<RealtimeIndexingStatusProjection, "snapshot"> {
1462
+ snapshot: SerializedCrossChainIndexingStatusSnapshot;
1683
1463
  }
1464
+ declare function serializeRealtimeIndexingStatusProjection(indexingProjection: RealtimeIndexingStatusProjection): SerializedRealtimeIndexingStatusProjection;
1465
+
1684
1466
  /**
1685
- * Omnichain indexing status snapshot when the overall `omnichainStatus` is
1686
- * {@link OmnichainIndexingStatusIds.Completed}.
1687
- *
1688
- * Invariants:
1689
- * - `omnichainStatus` is always {@link OmnichainIndexingStatusIds.Completed}.
1690
- * - `chains` is always a map to {@link ChainIndexingStatusSnapshotCompleted} values exclusively.
1691
- * - `omnichainIndexingCursor` is always equal to the highest
1692
- * `latestIndexedBlock.timestamp` for all chains.
1467
+ * Serialized representation of {@link EnsIndexerIndexingStatusResponseError}.
1693
1468
  */
1694
- interface OmnichainIndexingStatusSnapshotCompleted {
1695
- /**
1696
- * The status of omnichain indexing.
1697
- */
1698
- omnichainStatus: typeof OmnichainIndexingStatusIds.Completed;
1699
- /**
1700
- * The indexing status snapshot for each indexed chain.
1701
- */
1702
- chains: Map<ChainId, ChainIndexingStatusSnapshotCompleted>;
1703
- /**
1704
- * The timestamp of omnichain indexing progress across all indexed chains.
1705
- */
1706
- omnichainIndexingCursor: UnixTimestamp;
1707
- }
1469
+ type SerializedEnsIndexerIndexingStatusResponseError = EnsIndexerIndexingStatusResponseError;
1708
1470
  /**
1709
- * Omnichain indexing status snapshot for one or more chains.
1710
- *
1711
- * Use the `omnichainStatus` field to determine the specific type interpretation
1712
- * at runtime.
1471
+ * Serialized representation of {@link EnsIndexerIndexingStatusResponseOk}.
1713
1472
  */
1714
- type OmnichainIndexingStatusSnapshot = OmnichainIndexingStatusSnapshotUnstarted | OmnichainIndexingStatusSnapshotBackfill | OmnichainIndexingStatusSnapshotCompleted | OmnichainIndexingStatusSnapshotFollowing;
1473
+ interface SerializedEnsIndexerIndexingStatusResponseOk extends Omit<EnsIndexerIndexingStatusResponseOk, "realtimeProjection"> {
1474
+ realtimeProjection: SerializedRealtimeIndexingStatusProjection;
1475
+ }
1715
1476
  /**
1716
- * Check if Chain Indexing Status Snapshots fit the 'unstarted' overall status
1717
- * snapshot requirements:
1718
- * - All chains are guaranteed to have a status of "queued".
1719
- *
1720
- * Note: This function narrows the {@link ChainIndexingStatusSnapshot} type to
1721
- * {@link ChainIndexingStatusSnapshotQueued}.
1477
+ * Serialized representation of {@link EnsIndexerIndexingStatusResponse}.
1722
1478
  */
1723
- declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted(chains: ChainIndexingStatusSnapshot[]): chains is ChainIndexingStatusSnapshotQueued[];
1479
+ type SerializedEnsIndexerIndexingStatusResponse = SerializedEnsIndexerIndexingStatusResponseOk | SerializedEnsIndexerIndexingStatusResponseError;
1480
+
1724
1481
  /**
1725
- * Check if Chain Indexing Status Snapshots fit the 'backfill' overall status
1726
- * snapshot requirements:
1727
- * - At least one chain is guaranteed to be in the "backfill" status.
1728
- * - Each chain is guaranteed to have a status of either "queued",
1729
- * "backfill" or "completed".
1730
- *
1731
- * Note: This function narrows the {@link ChainIndexingStatusSnapshot} type to
1732
- * {@link ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill}.
1482
+ * Deserialize a {@link EnsIndexerIndexingStatusResponse} object.
1733
1483
  */
1734
- declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill(chains: ChainIndexingStatusSnapshot[]): chains is ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill[];
1484
+ declare function deserializeEnsIndexerIndexingStatusResponse(maybeResponse: Unvalidated<SerializedEnsIndexerIndexingStatusResponse>): EnsIndexerIndexingStatusResponse;
1485
+
1735
1486
  /**
1736
- * Checks if Chain Indexing Status Snapshots fit the 'completed' overall status
1737
- * snapshot requirements:
1738
- * - All chains are guaranteed to have a status of "completed".
1739
- *
1740
- * Note: This function narrows the {@link ChainIndexingStatusSnapshot} type to
1741
- * {@link ChainIndexingStatusSnapshotCompleted}.
1487
+ * Represents a request to ENSIndexer Indexing Status API.
1742
1488
  */
1743
- declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted(chains: ChainIndexingStatusSnapshot[]): chains is ChainIndexingStatusSnapshotCompleted[];
1489
+ type EnsIndexerIndexingStatusRequest = {};
1490
+
1491
+ declare function serializeEnsIndexerIndexingStatusResponse(response: EnsIndexerIndexingStatusResponse): SerializedEnsIndexerIndexingStatusResponse;
1492
+
1744
1493
  /**
1745
- * Checks Chain Indexing Status Snapshots fit the 'following' overall status
1746
- * snapshot requirements:
1747
- * - At least one chain is guaranteed to be in the "following" status.
1748
- * - Any other chain can have any status.
1494
+ * Configuration options for ENSIndexer API client
1749
1495
  */
1750
- declare function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing(chains: ChainIndexingStatusSnapshot[]): boolean;
1496
+ interface EnsIndexerClientOptions {
1497
+ /** The ENSIndexer API URL */
1498
+ url: URL;
1499
+ }
1751
1500
  /**
1752
- * Get {@link OmnichainIndexingStatusId} based on indexed chains' statuses.
1501
+ * ENSIndexer API Client
1753
1502
  *
1754
- * This function decides what is the `OmnichainIndexingStatusId` is,
1755
- * based on provided chain indexing statuses.
1503
+ * Provides access to the following ENSIndexer APIs:
1504
+ * - Configuration API
1505
+ * - Indexing Status API
1756
1506
  *
1757
- * @throws an error if unable to determine overall indexing status
1507
+ * @example
1508
+ * ```typescript
1509
+ * import { EnsIndexerClient } from "@ensnode/ensnode-sdk";
1510
+ *
1511
+ * // Custom configuration
1512
+ * const client = new EnsIndexerClient({
1513
+ * url: new URL("https://my-ENSIndexer-instance.com"),
1514
+ * });
1515
+ * ```
1758
1516
  */
1759
- declare function getOmnichainIndexingStatus(chains: ChainIndexingStatusSnapshot[]): OmnichainIndexingStatusId;
1517
+ declare class EnsIndexerClient {
1518
+ private readonly options;
1519
+ constructor(options: EnsIndexerClientOptions);
1520
+ getOptions(): Readonly<EnsIndexerClientOptions>;
1521
+ /**
1522
+ * Fetch ENSIndexer Config
1523
+ *
1524
+ * Fetch the ENSIndexer's configuration.
1525
+ *
1526
+ * @returns {EnsIndexerConfigResponse}
1527
+ *
1528
+ * @throws if the ENSIndexer request fails
1529
+ * @throws if the ENSIndexer returns a non-ok response
1530
+ * @throws if the ENSIndexer response breaks required invariants
1531
+ */
1532
+ config(): Promise<EnsIndexerConfigResponse>;
1533
+ /**
1534
+ * Fetch ENSIndexer Indexing Status
1535
+ *
1536
+ * @returns {EnsIndexerIndexingStatusResponse}
1537
+ *
1538
+ * @throws if the ENSIndexer request fails
1539
+ * @throws if the ENSIndexer returns a non-ok response
1540
+ * @throws if the ENSIndexer response breaks required invariants
1541
+ */
1542
+ indexingStatus(): Promise<EnsIndexerIndexingStatusResponse>;
1543
+ }
1544
+
1545
+ type EnsIndexerPublicConfigCompatibilityCheck = Omit<EnsIndexerPublicConfig, "ensIndexerSchemaName" | "ensRainbowPublicConfig" | "versionInfo">;
1760
1546
  /**
1761
- * Get Omnichain Indexing Cursor
1547
+ * Validate if `configB` is compatible with `configA`, such that `configA` equals to `configB`.
1762
1548
  *
1763
- * The cursor tracks the "highest" latest indexed block timestamp across
1764
- * all indexed chains. If all chains are queued, the cursor tracks the moment
1765
- * just before the earliest start block timestamp across those chains.
1549
+ * @throws error if configs are incompatible.
1550
+ */
1551
+ declare function validateEnsIndexerPublicConfigCompatibility(configA: EnsIndexerPublicConfigCompatibilityCheck, configB: EnsIndexerPublicConfigCompatibilityCheck): void;
1552
+
1553
+ /**
1554
+ * Builds an unvalidated {@link EnsIndexerPublicConfig} object to be
1555
+ * validated with {@link makeEnsIndexerPublicConfigSchema}.
1766
1556
  *
1767
- * @throws an error if no chains are provided
1557
+ * @param serializedPublicConfig - The serialized public config to build from.
1558
+ * @return An unvalidated {@link EnsIndexerPublicConfig} object.
1768
1559
  */
1769
- declare function getOmnichainIndexingCursor(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
1560
+ declare function buildUnvalidatedEnsIndexerPublicConfig(serializedPublicConfig: SerializedEnsIndexerPublicConfig): Unvalidated<EnsIndexerPublicConfig>;
1770
1561
  /**
1771
- * Build an Omnichain Indexing Status Snapshot based on the indexing status snapshots of all indexed chains.
1562
+ * Deserialize value into {@link EnsIndexerPublicConfig} object.
1563
+ */
1564
+ declare function deserializeEnsIndexerPublicConfig(maybePublicConfig: Unvalidated<SerializedEnsIndexerPublicConfig>, valueLabel?: string): EnsIndexerPublicConfig;
1565
+ /**
1566
+ * Deserialize object into a {@link EnsIndexerPublicConfig} object.
1772
1567
  *
1773
- * @param chainStatusSnapshots - A map of chain IDs to their chain indexing status snapshots.
1774
- * @returns The omnichain indexing status snapshot.
1568
+ * @deprecated Use {@link deserializeEnsIndexerPublicConfig} instead.
1775
1569
  */
1776
- declare function buildOmnichainIndexingStatusSnapshot(chainStatusSnapshots: Map<ChainId, ChainIndexingStatusSnapshot>): OmnichainIndexingStatusSnapshot;
1570
+ declare const deserializeENSIndexerPublicConfig: typeof deserializeEnsIndexerPublicConfig;
1777
1571
 
1778
1572
  /**
1779
- * The strategy used for indexing one or more chains.
1573
+ * Determines if the provided `config` results in indexing behavior compatible with the legacy ENS
1574
+ * Subgraph.
1780
1575
  *
1781
- * @see https://ponder.sh/docs/api-reference/ponder/config#parameters
1576
+ * @see https://ensnode.io/docs/concepts/what-is-the-ens-subgraph
1782
1577
  */
1783
- declare const CrossChainIndexingStrategyIds: {
1784
- /**
1785
- * Represents that the indexing of events across all indexed chains will
1786
- * proceed in a deterministic "omnichain" ordering by block timestamp, chain ID,
1787
- * and block number.
1788
- *
1789
- * This strategy is "deterministic" in that the order of processing cross-chain indexed
1790
- * events and each resulting indexed data state transition recorded in ENSDb is always
1791
- * the same for each ENSIndexer instance operating with an equivalent
1792
- * `ENSIndexerConfig` and ENSIndexer version. However it also has the drawbacks of:
1793
- * - increased indexing latency that must wait for the slowest indexed chain to
1794
- * add new blocks or to discover new blocks through the configured RPCs.
1795
- * - if any indexed chain gets "stuck" due to chain or RPC failures, all indexed chains
1796
- * will be affected.
1797
- */
1798
- readonly Omnichain: "omnichain";
1799
- };
1578
+ declare function isSubgraphCompatible(config: Pick<EnsIndexerPublicConfig, "namespace" | "plugins" | "labelSet">): boolean;
1579
+
1800
1580
  /**
1801
- * The derived string union of possible {@link CrossChainIndexingStrategyIds}.
1581
+ * Converts a Labelhash to bytes, with validation
1582
+ * @param labelHash The Labelhash to convert
1583
+ * @returns A ByteArray containing the bytes
1584
+ * @throws Error if `labelHash` is not a valid 32-byte hex string
1802
1585
  */
1803
- type CrossChainIndexingStrategyId = (typeof CrossChainIndexingStrategyIds)[keyof typeof CrossChainIndexingStrategyIds];
1586
+ declare function labelHashToBytes(labelHash: LabelHash): ByteArray;
1587
+
1804
1588
  /**
1805
- * Cross-chain indexing status snapshot when the `strategy` is
1806
- * {@link CrossChainIndexingStrategyId.Omnichain}.
1807
- *
1808
- * Invariants:
1809
- * - `strategy` is always {@link CrossChainIndexingStrategyId.Omnichain}.
1810
- * - `slowestChainIndexingCursor` is always equal to
1811
- * `omnichainSnapshot.omnichainIndexingCursor`.
1812
- * - `snapshotTime` is always >= the "highest known block timestamp", defined as the max of:
1813
- * - the `slowestChainIndexingCursor`.
1814
- * - the `config.startBlock.timestamp` for all indexed chains.
1815
- * - the `config.endBlock.timestamp` for all indexed chains with a `config.rangeType` of
1816
- * {@link RangeTypeIds.Bounded}.
1817
- * - the `backfillEndBlock.timestamp` for all chains with `chainStatus` of
1818
- * {@link ChainIndexingStatusIds.Backfill}.
1819
- * - the `latestKnownBlock.timestamp` for all chains with `chainStatus` of
1820
- * {@link ChainIndexingStatusIds.Following}.
1589
+ * Builds a valid LabelSetId from a string.
1590
+ * @param maybeLabelSetId - The string to validate and convert to a LabelSetId.
1591
+ * @returns A valid LabelSetId.
1592
+ * @throws If the input string is not a valid LabelSetId.
1821
1593
  */
1822
- interface CrossChainIndexingStatusSnapshotOmnichain {
1823
- /**
1824
- * The strategy used for indexing one or more chains.
1825
- */
1826
- strategy: typeof CrossChainIndexingStrategyIds.Omnichain;
1827
- /**
1828
- * The timestamp of the "slowest" latest indexed block timestamp
1829
- * across all indexed chains.
1830
- */
1831
- slowestChainIndexingCursor: UnixTimestamp;
1832
- /**
1833
- * The timestamp when the cross-chain indexing status snapshot was generated.
1834
- *
1835
- * Due to possible clock skew between different systems this value must be set
1836
- * to the max of each of the following values to ensure all invariants are followed:
1837
- * - the current system time of the system generating this cross-chain indexing
1838
- * status snapshot.
1839
- * - the "highest known block timestamp" (see invariants above for full definition).
1840
- */
1841
- snapshotTime: UnixTimestamp;
1842
- /**
1843
- * The omnichain indexing status snapshot for one or more chains.
1844
- */
1845
- omnichainSnapshot: OmnichainIndexingStatusSnapshot;
1846
- }
1594
+ declare function buildLabelSetId(maybeLabelSetId: string): LabelSetId;
1847
1595
  /**
1848
- * Cross-chain indexing status snapshot for one or more chains.
1849
- *
1850
- * Use the `strategy` field to determine the specific type interpretation
1851
- * at runtime.
1852
- *
1853
- * Currently, only omnichain indexing is supported. This type could theoretically
1854
- * be extended to support other cross-chain indexing strategies in the future,
1855
- * such as Ponder's "multichain" indexing strategy that indexes each chain
1856
- * independently without deterministic ordering.
1596
+ * Builds a valid LabelSetVersion from a number or string.
1597
+ * @param maybeLabelSetVersion - The number or string to validate and convert to a LabelSetVersion.
1598
+ * @returns A valid LabelSetVersion.
1599
+ * @throws If the input is not a valid LabelSetVersion.
1857
1600
  */
1858
- type CrossChainIndexingStatusSnapshot = CrossChainIndexingStatusSnapshotOmnichain;
1601
+ declare function buildLabelSetVersion(maybeLabelSetVersion: number | string): LabelSetVersion;
1859
1602
  /**
1860
- * Gets the latest indexed {@link BlockRef} for the given {@link ChainId}.
1861
- *
1862
- * @returns the latest indexed {@link BlockRef} for the given {@link ChainId}, or null if the chain
1863
- * isn't being indexed at all or is queued and therefore hasn't started indexing yet.
1603
+ * Builds an EnsRainbowClientLabelSet.
1604
+ * @param labelSetId - The label set ID.
1605
+ * @param labelSetVersion - The label set version.
1606
+ * @returns A valid EnsRainbowClientLabelSet object.
1607
+ * @throws If `labelSetVersion` is defined without `labelSetId`.
1864
1608
  */
1865
- declare function getLatestIndexedBlockRef(indexingStatus: CrossChainIndexingStatusSnapshot, chainId: ChainId): BlockRef | null;
1609
+ declare function buildEnsRainbowClientLabelSet(labelSetId?: LabelSetId, labelSetVersion?: LabelSetVersion): EnsRainbowClientLabelSet;
1866
1610
  /**
1867
- * Get the "highest known block timestamp" from chain indexing status snapshots.
1868
- *
1869
- * Returns the maximum timestamp referenced anywhere in the provided chain snapshots,
1870
- * across all of:
1871
- * - `config.startBlock` timestamps for all chains
1872
- * - `config.endBlock` timestamps for bounded chains
1873
- * - `backfillEndBlock` timestamps for chains in backfill status
1874
- * - `latestKnownBlock` timestamps for chains in following status
1875
- *
1876
- * This is used to enforce the invariant that `snapshotTime` must be >= all
1877
- * referenced block timestamps. It differs from {@link getTimestampForHighestOmnichainKnownBlock},
1878
- * which computes the highest "target" block timestamp for progress display and
1879
- * does not include `startBlock` timestamps.
1611
+ * Validates that the server's label set is compatible with the client's requested label set.
1612
+ * @param serverSet - The label set provided by the server.
1613
+ * @param clientSet - The label set requested by the client.
1614
+ * @throws If the server set is not compatible with the client set.
1615
+ */
1616
+ declare function validateSupportedLabelSetAndVersion(serverSet: EnsRainbowServerLabelSet, clientSet: EnsRainbowClientLabelSet): void;
1617
+
1618
+ /**
1619
+ * Parses a string into a non-negative integer.
1620
+ * @param input The string to parse
1621
+ * @returns The parsed non-negative integer
1622
+ * @throws Error if the input is not a valid non-negative integer
1623
+ */
1624
+ declare function parseNonNegativeInteger(maybeNumber: string): number;
1625
+
1626
+ /**
1627
+ * Serializes a {@link ChainConfig} object.
1628
+ */
1629
+ declare function serializeIndexedChainIds(indexedChainIds: Set<ChainId>): SerializedIndexedChainIds;
1630
+ /**
1631
+ * Serialize a {@link EnsIndexerPublicConfig} object.
1632
+ */
1633
+ declare function serializeEnsIndexerPublicConfig(config: EnsIndexerPublicConfig): SerializedEnsIndexerPublicConfig;
1634
+ /**
1635
+ * Serialize a {@link EnsIndexerPublicConfig} object.
1880
1636
  *
1881
- * @throws Error if `chains` is empty.
1637
+ * @deprecated Use {@link serializeEnsIndexerPublicConfig} instead.
1882
1638
  */
1883
- declare function getHighestKnownBlockTimestamp(chains: ChainIndexingStatusSnapshot[]): UnixTimestamp;
1639
+ declare const serializeENSIndexerPublicConfig: typeof serializeEnsIndexerPublicConfig;
1640
+
1884
1641
  /**
1885
- * Build a Cross-Chain Indexing Status Snapshot based on the omnichain indexing status snapshot.
1642
+ * Validates an unvalidated representation of
1643
+ * {@link EnsIndexerPublicConfig} object.
1886
1644
  *
1887
- * @param omnichainSnapshot - The omnichain indexing status snapshot.
1888
- * @param snapshotTime - The timestamp when the cross-chain indexing status snapshot was generated.
1889
- * Will be adjusted upward if necessary to satisfy the invariant that snapshotTime must
1890
- * be >= the highest known block timestamp (handles clock skew and future block timestamps).
1891
- * @returns The cross-chain indexing status snapshot.
1892
- * @throws if the generated snapshot does not satisfy the invariants defined
1893
- * in {@link CrossChainIndexingStatusSnapshotOmnichain}
1645
+ * @throws Error if the provided object is not
1646
+ * a valid {@link EnsIndexerPublicConfig}.
1894
1647
  */
1895
- declare function buildCrossChainIndexingStatusSnapshotOmnichain(omnichainSnapshot: OmnichainIndexingStatusSnapshot, snapshotTime: UnixTimestamp): CrossChainIndexingStatusSnapshotOmnichain;
1648
+ declare function validateEnsIndexerPublicConfig(unvalidatedConfig: Unvalidated<EnsIndexerPublicConfig>): EnsIndexerPublicConfig;
1896
1649
 
1897
1650
  /**
1898
- * A "realtime" indexing status projection based on worst-case assumptions
1899
- * from the `snapshot`.
1651
+ * Validates an unvalidated representation of
1652
+ * {@link EnsIndexerVersionInfo} object.
1900
1653
  *
1901
- * Invariants:
1902
- * - `projectedAt` is always >= `snapshot.snapshotTime`.
1903
- * - `worstCaseDistance` is always equal to
1904
- * `projectedAt - snapshot.slowestChainIndexingCursor`.
1654
+ * @throws Error if the provided object is not
1655
+ * a valid {@link EnsIndexerVersionInfo}.
1905
1656
  */
1906
- type RealtimeIndexingStatusProjection = {
1657
+ declare function validateEnsIndexerVersionInfo(unvalidatedVersionInfo: Unvalidated<EnsIndexerVersionInfo>): EnsIndexerVersionInfo;
1658
+
1659
+ /**
1660
+ * Information about the stack of services inside an ENSNode instance.
1661
+ */
1662
+ interface EnsNodeStackInfo {
1907
1663
  /**
1908
- * The timestamp representing "now" as of the time this projection was generated.
1664
+ * ENSApi Public Config
1909
1665
  */
1910
- projectedAt: UnixTimestamp;
1666
+ ensApi: EnsApiPublicConfig;
1911
1667
  /**
1912
- * The distance between `projectedAt` and `snapshot.slowestChainIndexingCursor`.
1913
- *
1914
- * This is "worst-case" because it assumes all of the following:
1915
- * - the `snapshot` (which may have `snapshot.snapshotTime < projectedAt`) is still the
1916
- * latest snapshot and no indexing progress has been made since `snapshotTime`.
1917
- * - each indexed chain has added a new block as of `projectedAt`.
1668
+ * ENSDb Public Config
1918
1669
  */
1919
- worstCaseDistance: Duration;
1670
+ ensDb: EnsDbPublicConfig;
1920
1671
  /**
1921
- * The {@link CrossChainIndexingStatusSnapshot} that this projection is based on.
1672
+ * ENSIndexer Public Config
1922
1673
  */
1923
- snapshot: CrossChainIndexingStatusSnapshot;
1924
- };
1674
+ ensIndexer: EnsIndexerPublicConfig;
1675
+ /**
1676
+ * ENSRainbow Public Config
1677
+ *
1678
+ * If undefined, represents that ENSRainbow is currently undergoing
1679
+ * a cold start and may take up to an hour to become ready.
1680
+ */
1681
+ ensRainbow?: EnsRainbowPublicConfig;
1682
+ }
1925
1683
  /**
1926
- * Create realtime indexing status projection from
1927
- * a {@link CrossChainIndexingStatusSnapshot}.
1684
+ * Build a complete {@link EnsNodeStackInfo} object from
1685
+ * the given public configs of ENSApi and ENSDb.
1928
1686
  */
1929
- declare function createRealtimeIndexingStatusProjection(snapshot: CrossChainIndexingStatusSnapshot, now: UnixTimestamp): RealtimeIndexingStatusProjection;
1687
+ declare function buildEnsNodeStackInfo(ensApiPublicConfig: EnsApiPublicConfig, ensDbPublicConfig: EnsDbPublicConfig): EnsNodeStackInfo;
1930
1688
 
1931
1689
  /**
1932
1690
  * A status code for indexing status responses.
@@ -1972,6 +1730,7 @@ type IndexingStatusResponseCode = EnsApiIndexingStatusResponseCode;
1972
1730
  type EnsApiIndexingStatusResponseOk = {
1973
1731
  responseCode: typeof EnsApiIndexingStatusResponseCodes.Ok;
1974
1732
  realtimeProjection: RealtimeIndexingStatusProjection;
1733
+ stackInfo: EnsNodeStackInfo;
1975
1734
  };
1976
1735
  /**
1977
1736
  * An indexing status response when the indexing status is available.
@@ -2006,97 +1765,18 @@ type EnsApiIndexingStatusResponse = EnsApiIndexingStatusResponseOk | EnsApiIndex
2006
1765
  type IndexingStatusResponse = EnsApiIndexingStatusResponse;
2007
1766
 
2008
1767
  /**
2009
- * Serialized representation of {@link ChainId}.
2010
- **/
2011
- type ChainIdString = string;
2012
- /**
2013
- * Datetime value following the ISO 8601 standard.
2014
- *
2015
- * @see https://www.iso.org/iso-8601-date-and-time-format.html
2016
- */
2017
- type DatetimeISO8601 = string;
2018
- /**
2019
- * Serialized representation of a {@link URL}.
2020
- */
2021
- type UrlString = string;
2022
- /**
2023
- * String representation of {@link AccountId}.
2024
- *
2025
- * Formatted as a fully lowercase CAIP-10 AccountId.
2026
- *
2027
- * @see https://chainagnostic.org/CAIPs/caip-10
2028
- */
2029
- type AccountIdString = string;
2030
- /**
2031
- * String representation of {@link AssetId}.
2032
- *
2033
- * Formatted as a fully lowercase CAIP-19 AssetId.
2034
- *
2035
- * @see https://chainagnostic.org/CAIPs/caip-19
2036
- * @example "eip155:1/erc721:0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc"
2037
- * for vitalik.eth in the eth base registrar on mainnet.
2038
- */
2039
- type AssetIdString = string;
2040
-
2041
- /**
2042
- * Serialized representation of {@link OmnichainIndexingStatusSnapshotUnstarted}
2043
- */
2044
- interface SerializedOmnichainIndexingStatusSnapshotUnstarted extends Omit<OmnichainIndexingStatusSnapshotUnstarted, "chains"> {
2045
- chains: Record<ChainIdString, ChainIndexingStatusSnapshotQueued>;
2046
- }
2047
- /**
2048
- * Serialized representation of {@link OmnichainIndexingStatusSnapshotBackfill}
2049
- */
2050
- interface SerializedOmnichainIndexingStatusSnapshotBackfill extends Omit<OmnichainIndexingStatusSnapshotBackfill, "chains"> {
2051
- chains: Record<ChainIdString, ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill>;
2052
- }
2053
- /**
2054
- * Serialized representation of {@link OmnichainIndexingStatusSnapshotCompleted}
2055
- */
2056
- interface SerializedOmnichainIndexingStatusSnapshotCompleted extends Omit<OmnichainIndexingStatusSnapshotCompleted, "chains"> {
2057
- chains: Record<ChainIdString, ChainIndexingStatusSnapshotCompleted>;
2058
- }
2059
- /**
2060
- * Serialized representation of {@link OmnichainIndexingStatusSnapshotFollowing}
2061
- */
2062
- interface SerializedOmnichainIndexingStatusSnapshotFollowing extends Omit<OmnichainIndexingStatusSnapshotFollowing, "chains"> {
2063
- chains: Record<ChainIdString, ChainIndexingStatusSnapshot>;
2064
- }
2065
- /**
2066
- * Serialized representation of {@link OmnichainIndexingStatusSnapshot}
2067
- */
2068
- type SerializedOmnichainIndexingStatusSnapshot = SerializedOmnichainIndexingStatusSnapshotUnstarted | SerializedOmnichainIndexingStatusSnapshotBackfill | SerializedOmnichainIndexingStatusSnapshotCompleted | SerializedOmnichainIndexingStatusSnapshotFollowing;
2069
- /**
2070
- * Serialize a {@link OmnichainIndexingStatusSnapshot} object.
2071
- */
2072
- declare function serializeOmnichainIndexingStatusSnapshot(indexingStatus: OmnichainIndexingStatusSnapshot): SerializedOmnichainIndexingStatusSnapshot;
2073
-
2074
- /**
2075
- * Serialized representation of {@link CrossChainIndexingStatusSnapshotOmnichain}
2076
- */
2077
- interface SerializedCrossChainIndexingStatusSnapshotOmnichain extends Omit<CrossChainIndexingStatusSnapshotOmnichain, "omnichainSnapshot"> {
2078
- omnichainSnapshot: SerializedOmnichainIndexingStatusSnapshot;
2079
- }
2080
- /**
2081
- * Serialized representation of {@link CrossChainIndexingStatusSnapshot}
2082
- */
2083
- type SerializedCrossChainIndexingStatusSnapshot = SerializedCrossChainIndexingStatusSnapshotOmnichain;
2084
- declare function serializeCrossChainIndexingStatusSnapshotOmnichain({ strategy, slowestChainIndexingCursor, snapshotTime, omnichainSnapshot, }: CrossChainIndexingStatusSnapshotOmnichain): SerializedCrossChainIndexingStatusSnapshotOmnichain;
2085
- declare function serializeCrossChainIndexingStatusSnapshot(snapshot: CrossChainIndexingStatusSnapshot): SerializedCrossChainIndexingStatusSnapshot;
2086
-
2087
- /**
2088
- * Serialized representation of {@link RealtimeIndexingStatusProjection}
1768
+ * Serialized representation of {@link EnsNodeStackInfo}.
2089
1769
  */
2090
- interface SerializedCurrentIndexingProjectionOmnichain extends Omit<RealtimeIndexingStatusProjection, "snapshot"> {
2091
- snapshot: SerializedOmnichainIndexingStatusSnapshot;
1770
+ interface SerializedEnsNodeStackInfo {
1771
+ ensApi: SerializedEnsApiPublicConfig;
1772
+ ensDb: SerializedEnsDbPublicConfig;
1773
+ ensIndexer: SerializedEnsIndexerPublicConfig;
1774
+ ensRainbow?: SerializedEnsRainbowPublicConfig;
2092
1775
  }
2093
1776
  /**
2094
- * Serialized representation of {@link RealtimeIndexingStatusProjection}
1777
+ * Serialize a {@link EnsNodeStackInfo} object.
2095
1778
  */
2096
- interface SerializedRealtimeIndexingStatusProjection extends Omit<RealtimeIndexingStatusProjection, "snapshot"> {
2097
- snapshot: SerializedCrossChainIndexingStatusSnapshot;
2098
- }
2099
- declare function serializeRealtimeIndexingStatusProjection(indexingProjection: RealtimeIndexingStatusProjection): SerializedRealtimeIndexingStatusProjection;
1779
+ declare function serializeEnsNodeStackInfo(stackInfo: EnsNodeStackInfo): SerializedEnsNodeStackInfo;
2100
1780
 
2101
1781
  /**
2102
1782
  * Serialized representation of {@link EnsApiIndexingStatusResponseError}.
@@ -2111,8 +1791,9 @@ type SerializedIndexingStatusResponseError = SerializedEnsApiIndexingStatusRespo
2111
1791
  /**
2112
1792
  * Serialized representation of {@link EnsApiIndexingStatusResponseOk}.
2113
1793
  */
2114
- interface SerializedEnsApiIndexingStatusResponseOk extends Omit<EnsApiIndexingStatusResponseOk, "realtimeProjection"> {
1794
+ interface SerializedEnsApiIndexingStatusResponseOk extends Omit<EnsApiIndexingStatusResponseOk, "realtimeProjection" | "stackInfo"> {
2115
1795
  realtimeProjection: SerializedRealtimeIndexingStatusProjection;
1796
+ stackInfo: SerializedEnsNodeStackInfo;
2116
1797
  }
2117
1798
  /**
2118
1799
  * Serialized representation of {@link EnsApiIndexingStatusResponseOk}.
@@ -2134,6 +1815,8 @@ type SerializedIndexingStatusResponse = SerializedEnsApiIndexingStatusResponse;
2134
1815
  /**
2135
1816
  * Deserialize a {@link EnsApiIndexingStatusResponse} object.
2136
1817
  */
1818
+ declare function deserializeEnsApiIndexingStatusResponse(maybeResponse: Unvalidated<SerializedEnsApiIndexingStatusResponseOk>): EnsApiIndexingStatusResponseOk;
1819
+ declare function deserializeEnsApiIndexingStatusResponse(maybeResponse: Unvalidated<SerializedEnsApiIndexingStatusResponseError>): EnsApiIndexingStatusResponseError;
2137
1820
  declare function deserializeEnsApiIndexingStatusResponse(maybeResponse: Unvalidated<SerializedEnsApiIndexingStatusResponse>): EnsApiIndexingStatusResponse;
2138
1821
  /**
2139
1822
  * Deserialize a {@link EnsApiIndexingStatusResponse} object.
@@ -2535,7 +2218,7 @@ declare function getNameTokenOwnership(namespaceId: ENSNamespaceId, name: Interp
2535
2218
  /**
2536
2219
  * Schema for {@link ErrorResponse}.
2537
2220
  */
2538
- declare const ErrorResponseSchema: z.ZodObject<{
2221
+ declare const makeErrorResponseSchema: () => z.ZodObject<{
2539
2222
  message: z.ZodString;
2540
2223
  details: z.ZodOptional<z.ZodUnknown>;
2541
2224
  }, z.core.$strip>;
@@ -2543,7 +2226,7 @@ declare const ErrorResponseSchema: z.ZodObject<{
2543
2226
  /**
2544
2227
  * API Error Response Type
2545
2228
  */
2546
- type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
2229
+ type ErrorResponse = z.infer<ReturnType<typeof makeErrorResponseSchema>>;
2547
2230
 
2548
2231
  /**
2549
2232
  * Deserialize a {@link ErrorResponse} object.
@@ -2746,7 +2429,8 @@ interface SerializedNameTokensResponseOk extends Omit<NameTokensResponseOk, "reg
2746
2429
  type SerializedNameTokensResponse = SerializedNameTokensResponseOk | SerializedNameTokensResponseError;
2747
2430
 
2748
2431
  declare function serializeRegisteredNameTokens({ domainId, name, tokens, expiresAt, accurateAsOf, }: RegisteredNameTokens): SerializedRegisteredNameTokens;
2749
- declare function serializeNameTokensResponse(response: NameTokensResponse): SerializedNameTokensResponse;
2432
+ declare function serializeNameTokensResponse(response: NameTokensResponseOk): SerializedNameTokensResponseOk;
2433
+ declare function serializeNameTokensResponse<T extends NameTokensResponseError>(response: T): T;
2750
2434
 
2751
2435
  /**
2752
2436
  * Encoded Referrer
@@ -2785,21 +2469,21 @@ declare const EXPECTED_ENCODED_REFERRER_PADDING: Hex;
2785
2469
  */
2786
2470
  declare const ZERO_ENCODED_REFERRER: EncodedReferrer;
2787
2471
  /**
2788
- * Build an {@link EncodedReferrer} value for the given {@link Address}
2472
+ * Build an {@link EncodedReferrer} value for the given {@link NormalizedAddress}
2789
2473
  * according to the referrer encoding with left-zero-padding.
2790
2474
  */
2791
- declare function buildEncodedReferrer(address: Address): EncodedReferrer;
2475
+ declare function buildEncodedReferrer(address: NormalizedAddress): EncodedReferrer;
2792
2476
  /**
2793
- * Decode an {@link EncodedReferrer} value into a checksummed {@link Address}
2477
+ * Decode an {@link EncodedReferrer} value into a {@link NormalizedAddress}
2794
2478
  * according to the referrer encoding with left-zero-padding.
2795
2479
  *
2796
2480
  * @param encodedReferrer - The "raw" {@link EncodedReferrer} value to decode.
2797
- * @returns The decoded referrer checksummed address.
2481
+ * @returns The decoded referrer address.
2798
2482
  * @throws when encodedReferrer value is not represented by
2799
2483
  * {@link ENCODED_REFERRER_BYTE_LENGTH} bytes.
2800
2484
  * @throws when decodedReferrer is not a valid EVM address.
2801
2485
  */
2802
- declare function decodeEncodedReferrer(encodedReferrer: EncodedReferrer): Address;
2486
+ declare function decodeEncodedReferrer(encodedReferrer: EncodedReferrer): NormalizedAddress;
2803
2487
 
2804
2488
  /**
2805
2489
  * Identifiers for supported currencies.
@@ -3406,11 +3090,11 @@ interface ResponsePageContextWithNoRecords extends Required<RequestPageParams> {
3406
3090
  /**
3407
3091
  * The start index of the records on the page (0-indexed)
3408
3092
  */
3409
- startIndex: undefined;
3093
+ startIndex?: undefined;
3410
3094
  /**
3411
3095
  * The end index of the records on the page (0-indexed)
3412
3096
  */
3413
- endIndex: undefined;
3097
+ endIndex?: undefined;
3414
3098
  }
3415
3099
  interface ResponsePageContextWithRecords extends Required<RequestPageParams> {
3416
3100
  /**
@@ -3498,15 +3182,11 @@ type RegistrarActionsResponseOk = {
3498
3182
  * The {@link UnixTimestamp} of when the data used to build the list of {@link NamedRegistrarAction} was accurate as of.
3499
3183
  *
3500
3184
  * @remarks
3501
- * **Note:** This value represents the `slowestChainIndexingCursor` from the latest omnichain indexing status
3185
+ * **Note:** This value represents the `omnichainIndexingCursor` from the latest omnichain indexing status
3502
3186
  * snapshot captured by ENSApi. The state returned in the response is guaranteed to be accurate as of this
3503
3187
  * timestamp but may be from a timestamp higher than this value.
3504
- *
3505
- * **Temporary:** This field is currently optional to maintain backward compatibility with ENS Awards
3506
- * using older snapshot NPM packages. This will be changed to required in a future release.
3507
- * See: https://github.com/namehash/ensnode/issues/1497
3508
3188
  */
3509
- accurateAsOf?: UnixTimestamp;
3189
+ accurateAsOf: UnixTimestamp;
3510
3190
  };
3511
3191
  /**
3512
3192
  * A response when Registrar Actions are unavailable.
@@ -3663,7 +3343,8 @@ declare function hasRegistrarActionsConfigSupport(config: EnsIndexerPublicConfig
3663
3343
  declare function hasRegistrarActionsIndexingStatusSupport(omnichainIndexingStatusId: OmnichainIndexingStatusId): PrerequisiteResult;
3664
3344
 
3665
3345
  declare function serializeNamedRegistrarAction({ action, name, }: NamedRegistrarAction): SerializedNamedRegistrarAction;
3666
- declare function serializeRegistrarActionsResponse(response: RegistrarActionsResponse): SerializedRegistrarActionsResponse;
3346
+ declare function serializeRegistrarActionsResponse(response: RegistrarActionsResponseOk): SerializedRegistrarActionsResponseOk;
3347
+ declare function serializeRegistrarActionsResponse(response: RegistrarActionsResponseError): SerializedRegistrarActionsResponseError;
3667
3348
 
3668
3349
  /**
3669
3350
  * The resolution status for an `Identity`.
@@ -3855,6 +3536,31 @@ interface ResolverRecordsSelection {
3855
3536
  * Which keys to fetch text records for.
3856
3537
  */
3857
3538
  texts?: string[];
3539
+ /**
3540
+ * Whether to fetch the ENSIP-7 contenthash record.
3541
+ */
3542
+ contenthash?: boolean;
3543
+ /**
3544
+ * Whether to fetch the PubkeyResolver (x, y) pair.
3545
+ */
3546
+ pubkey?: boolean;
3547
+ /**
3548
+ * Which ABI content-type bitmask to fetch. The resolver returns the first stored ABI whose
3549
+ * bit is present in the mask (lowest bit first).
3550
+ */
3551
+ abi?: ContentType;
3552
+ /**
3553
+ * Which ERC-165 interface implementers to fetch, keyed by InterfaceId.
3554
+ */
3555
+ interfaces?: InterfaceId[];
3556
+ /**
3557
+ * Whether to fetch the IDNSZoneResolver zonehash record.
3558
+ */
3559
+ dnszonehash?: boolean;
3560
+ /**
3561
+ * Whether to fetch the IVersionableResolver version.
3562
+ */
3563
+ version?: boolean;
3858
3564
  }
3859
3565
  declare const isSelectionEmpty: (selection: ResolverRecordsSelection) => boolean;
3860
3566
 
@@ -3883,6 +3589,41 @@ type ResolverRecordsResponseBase = {
3883
3589
  * Value is null if no record for the specified key is set.
3884
3590
  */
3885
3591
  texts: Record<string, string | null>;
3592
+ /**
3593
+ * The ENSIP-7 contenthash record raw bytes, or null if not set.
3594
+ */
3595
+ contenthash: Hex | null;
3596
+ /**
3597
+ * The PubkeyResolver (x, y) pair, or null if not set.
3598
+ */
3599
+ pubkey: {
3600
+ x: Hex;
3601
+ y: Hex;
3602
+ } | null;
3603
+ /**
3604
+ * The first stored ABI matching the requested content-type bitmask, or null if no ABI is set
3605
+ * for any matching content type.
3606
+ */
3607
+ abi: {
3608
+ contentType: ContentType;
3609
+ data: Hex;
3610
+ } | null;
3611
+ /**
3612
+ * Interface implementers keyed by InterfaceId.
3613
+ * Value is null if no implementer is set for the given InterfaceId.
3614
+ */
3615
+ interfaces: Record<InterfaceId, Address | null>;
3616
+ /**
3617
+ * The IDNSZoneResolver zonehash raw bytes, or null if not set.
3618
+ */
3619
+ dnszonehash: Hex | null;
3620
+ /**
3621
+ * The IVersionableResolver version. Null when we don't have a value — the resolver may not
3622
+ * implement `IVersionableResolver` (RPC revert), or (on the accelerated path) no
3623
+ * `VersionChanged` event has ever been seen for this node. `0n` is only returned when the
3624
+ * resolver explicitly emitted `VersionChanged(node, 0)`.
3625
+ */
3626
+ version: RecordVersion | null;
3886
3627
  };
3887
3628
  /**
3888
3629
  * Represents the strongly-typed set of records based on the provided SELECTION
@@ -3906,7 +3647,7 @@ type ResolverRecordsResponseBase = {
3906
3647
  * ```
3907
3648
  */
3908
3649
  type ResolverRecordsResponse<T extends ResolverRecordsSelection = ResolverRecordsSelection> = {
3909
- [K in keyof T as T[K] extends true | any[] ? K : never]: K extends "addresses" ? Record<`${T["addresses"] extends readonly CoinType[] ? T["addresses"][number] : never}`, string | null> : K extends "texts" ? Record<T["texts"] extends readonly string[] ? T["texts"][number] : never, string | null> : ResolverRecordsResponseBase[K & keyof ResolverRecordsResponseBase];
3650
+ [K in keyof T as T[K] extends true | readonly any[] | bigint ? K : never]: K extends "addresses" ? Record<`${T["addresses"] extends readonly CoinType[] ? T["addresses"][number] : never}`, string | null> : K extends "texts" ? Record<T["texts"] extends readonly string[] ? T["texts"][number] : never, string | null> : K extends "interfaces" ? Record<T["interfaces"] extends readonly InterfaceId[] ? T["interfaces"][number] : never, Address | null> : ResolverRecordsResponseBase[K & keyof ResolverRecordsResponseBase];
3910
3651
  };
3911
3652
 
3912
3653
  /**
@@ -4051,34 +3792,27 @@ interface ResolvePrimaryNamesResponse extends AcceleratableResponse, TraceableRe
4051
3792
  }
4052
3793
 
4053
3794
  /**
4054
- * Configuration options for ENSNode API client
3795
+ * Configuration options for an ENSNode client
4055
3796
  */
4056
- interface EnsApiClientOptions {
4057
- /** The ENSNode API URL */
3797
+ interface EnsNodeClientOptions {
3798
+ /** The ENSNode URL */
4058
3799
  url: URL;
4059
3800
  }
4060
3801
  /**
4061
- * Configuration options for ENSNode API client
4062
- *
4063
- * @deprecated Use {@link EnsApiClientOptions} instead.
4064
- */
4065
- type ClientOptions = EnsApiClientOptions;
4066
- /**
4067
- * EnsApi Client
3802
+ * ENSNode Client
4068
3803
  *
4069
3804
  * Provides access to the following ENSNode APIs:
4070
3805
  * - Resolution API
4071
- * - Configuration API
4072
3806
  * - Indexing Status API
4073
3807
  * - Registrar Actions API
4074
3808
  * - Name Tokens API
4075
3809
  *
4076
3810
  * @example
4077
3811
  * ```typescript
4078
- * import { EnsApiClient } from "@ensnode/ensnode-sdk";
3812
+ * import { EnsNodeClient } from "@ensnode/ensnode-sdk";
4079
3813
  *
4080
3814
  * // Create client with default options
4081
- * const client = new EnsApiClient();
3815
+ * const client = new EnsNodeClient();
4082
3816
  *
4083
3817
  * // Use resolution methods
4084
3818
  * const { records } = await client.resolveRecords("jesse.base.eth", {
@@ -4089,39 +3823,39 @@ type ClientOptions = EnsApiClientOptions;
4089
3823
  *
4090
3824
  * @example
4091
3825
  * ```typescript
4092
- * import { ENSNamespaceIds, EnsApiClient, getDefaultEnsNodeUrl } from "@ensnode/ensnode-sdk";
3826
+ * import { ENSNamespaceIds, EnsNodeClient, getDefaultEnsNodeUrl } from "@ensnode/ensnode-sdk";
4093
3827
  *
4094
- * // Use default ENSNode API URL for Mainnet
4095
- * const client = new EnsApiClient({
3828
+ * // Use default ENSNode URL for Mainnet
3829
+ * const client = new EnsNodeClient({
4096
3830
  * url: getDefaultEnsNodeUrl(ENSNamespaceIds.Mainnet),
4097
3831
  * });
4098
3832
  * ```
4099
3833
  *
4100
3834
  * @example
4101
3835
  * ```typescript
4102
- * import { ENSNamespaceIds, EnsApiClient, getDefaultEnsNodeUrl } from "@ensnode/ensnode-sdk";
3836
+ * import { ENSNamespaceIds, EnsNodeClient, getDefaultEnsNodeUrl } from "@ensnode/ensnode-sdk";
4103
3837
  *
4104
- * // Use default ENSNode API URL for Sepolia
4105
- * const client = new EnsApiClient({
3838
+ * // Use default ENSNode URL for Sepolia
3839
+ * const client = new EnsNodeClient({
4106
3840
  * url: getDefaultEnsNodeUrl(ENSNamespaceIds.Sepolia),
4107
3841
  * });
4108
3842
  * ```
4109
3843
  *
4110
3844
  * @example
4111
3845
  * ```typescript
4112
- * import { EnsApiClient } from "@ensnode/ensnode-sdk";
3846
+ * import { EnsNodeClient } from "@ensnode/ensnode-sdk";
4113
3847
  *
4114
3848
  * // Custom configuration
4115
- * const client = new EnsApiClient({
3849
+ * const client = new EnsNodeClient({
4116
3850
  * url: new URL("https://my-ensnode-instance.com"),
4117
3851
  * });
4118
3852
  * ```
4119
3853
  */
4120
- declare class EnsApiClient {
3854
+ declare class EnsNodeClient {
4121
3855
  private readonly options;
4122
- static defaultOptions(): EnsApiClientOptions;
4123
- constructor(options?: Partial<EnsApiClientOptions>);
4124
- getOptions(): Readonly<EnsApiClientOptions>;
3856
+ static defaultOptions(): EnsNodeClientOptions;
3857
+ constructor(options?: Partial<EnsNodeClientOptions>);
3858
+ getOptions(): Readonly<EnsNodeClientOptions>;
4125
3859
  /**
4126
3860
  * Resolves records for an ENS name (Forward Resolution).
4127
3861
  *
@@ -4239,19 +3973,7 @@ declare class EnsApiClient {
4239
3973
  */
4240
3974
  resolvePrimaryNames(address: ResolvePrimaryNamesRequest["address"], options?: Omit<ResolvePrimaryNamesRequest, "address">): Promise<ResolvePrimaryNamesResponse>;
4241
3975
  /**
4242
- * Fetch ENSApi Config
4243
- *
4244
- * Fetch the ENSApi's configuration.
4245
- *
4246
- * @returns {EnsApiConfigResponse}
4247
- *
4248
- * @throws if the ENSApi request fails
4249
- * @throws if the ENSApi returns a non-ok response
4250
- * @throws if the ENSApi response breaks required invariants
4251
- */
4252
- config(): Promise<EnsApiConfigResponse>;
4253
- /**
4254
- * Fetch ENSApi Indexing Status
3976
+ * Fetch ENSApi Indexing Status
4255
3977
  *
4256
3978
  * @returns {EnsApiIndexingStatusResponse}
4257
3979
  *
@@ -4280,11 +4002,13 @@ declare class EnsApiClient {
4280
4002
  * ```ts
4281
4003
  * import {
4282
4004
  * registrarActionsFilter,
4283
- * EnsApiClient,
4005
+ * EnsNodeClient,
4284
4006
  * } from "@ensnode/ensnode-sdk";
4285
- * import { namehash } from "viem/ens";
4007
+ * import { ETH_NODE, namehashInterpretedName, asInterpretedName } from "enssdk";
4286
4008
  *
4287
- * const client: EnsApiClient;
4009
+ * const BASE_NODE = namehashInterpretedName(asInterpretedName("base.eth"));
4010
+ *
4011
+ * const client: EnsNodeClient;
4288
4012
  *
4289
4013
  * // Get first page with default page size (10 records)
4290
4014
  * const response = await client.registrarActions();
@@ -4295,494 +4019,116 @@ declare class EnsApiClient {
4295
4019
  * console.log(`Accurate as of: ${response.accurateAsOf}`);
4296
4020
  * }
4297
4021
  *
4298
- * // Get second page with 25 records per page
4299
- * const response = await client.registrarActions({
4300
- * page: 2,
4301
- * recordsPerPage: 25,
4302
- * });
4303
- *
4304
- * // get latest registrar action records associated with
4305
- * // subregistry managing `eth` name
4306
- * await client.registrarActions({
4307
- * filters: [registrarActionsFilter.byParentNode(namehash('eth'))],
4308
- * });
4309
- *
4310
- * // get latest registrar action records which include referral info
4311
- * await client.registrarActions({
4312
- * filters: [registrarActionsFilter.withReferral(true)],
4313
- * });
4314
- *
4315
- * // get latest registrar action records for a specific decoded referrer
4316
- * await client.registrarActions({
4317
- * filters: [registrarActionsFilter.byDecodedReferrer("0x1234567890123456789012345678901234567890")],
4318
- * });
4319
- *
4320
- * // get latest 10 registrar action records associated with
4321
- * // subregistry managing `base.eth` name
4322
- * await client.registrarActions({
4323
- * filters: [registrarActionsFilter.byParentNode(namehash('base.eth'))],
4324
- * recordsPerPage: 10
4325
- * });
4326
- *
4327
- * // get registrar actions within a specific time range
4328
- * const beginTimestamp = 1764547200; // Dec 1, 2025, 00:00:00 UTC
4329
- * const endTimestamp = 1767225600; // Jan 1, 2026, 00:00:00 UTC
4330
- * await client.registrarActions({
4331
- * filters: [
4332
- * registrarActionsFilter.beginTimestamp(beginTimestamp),
4333
- * registrarActionsFilter.endTimestamp(endTimestamp),
4334
- * ],
4335
- * });
4336
- *
4337
- * // get registrar actions from a specific timestamp onwards
4338
- * await client.registrarActions({
4339
- * filters: [registrarActionsFilter.beginTimestamp(1764547200)],
4340
- * });
4341
- *
4342
- * // get registrar actions up to a specific timestamp
4343
- * await client.registrarActions({
4344
- * filters: [registrarActionsFilter.endTimestamp(1767225600)],
4345
- * });
4346
- * ```
4347
- */
4348
- registrarActions(request?: RegistrarActionsRequest): Promise<RegistrarActionsResponse>;
4349
- /**
4350
- * Fetch Name Tokens for requested name.
4351
- *
4352
- * @param request.name - Name for which Name Tokens will be fetched.
4353
- * @returns {NameTokensResponse}
4354
- *
4355
- * @throws if the ENSNode request fails
4356
- * @throws if the ENSNode API returns an error response
4357
- * @throws if the ENSNode response breaks required invariants
4358
- *
4359
- * @example
4360
- * ```ts
4361
- * import {
4362
- * EnsApiClient,
4363
- * } from "@ensnode/ensnode-sdk";
4364
- * import { namehash } from "viem/ens";
4365
- *
4366
- * const client: EnsApiClient;
4367
- *
4368
- * // get latest name token records from the indexed subregistry based on the requested name
4369
- * const response = await client.nameTokens({
4370
- * name: "vitalik.eth"
4371
- * });
4372
- *
4373
- * const response = await client.nameTokens({
4374
- * domainId: "0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835" // namehash('vitalik.eth')
4375
- * })
4376
- * ```
4377
- */
4378
- nameTokens(request: NameTokensRequest): Promise<NameTokensResponse>;
4379
- }
4380
- /**
4381
- * ENSNode Client
4382
- *
4383
- * @deprecated use {@link EnsApiClient} instead
4384
- */
4385
- declare class ENSNodeClient extends EnsApiClient {
4386
- }
4387
-
4388
- declare class ClientError extends Error {
4389
- details?: unknown;
4390
- constructor(message: string, details?: unknown);
4391
- static fromErrorResponse({ message, details }: ErrorResponse): ClientError;
4392
- }
4393
-
4394
- /**
4395
- * Deserialize value into {@link EnsApiPublicConfig} object.
4396
- */
4397
- declare function deserializeEnsApiPublicConfig(maybePublicConfig: Unvalidated<SerializedEnsApiPublicConfig>, valueLabel?: string): EnsApiPublicConfig;
4398
- /**
4399
- * Deserialize a {@link EnsApiPublicConfig} object.
4400
- *
4401
- * @deprecated Use {@link deserializeEnsApiPublicConfig} instead.
4402
- */
4403
- declare const deserializeENSApiPublicConfig: typeof deserializeEnsApiPublicConfig;
4404
-
4405
- /**
4406
- * Serialize a {@link EnsApiPublicConfig} object.
4407
- */
4408
- declare function serializeEnsApiPublicConfig(config: EnsApiPublicConfig): SerializedEnsApiPublicConfig;
4409
- /**
4410
- * Serialize a {@link EnsApiPublicConfig} object.
4411
- *
4412
- * @deprecated Use {@link serializeEnsApiPublicConfig} instead.
4413
- */
4414
- declare const serializeENSApiPublicConfig: typeof serializeEnsApiPublicConfig;
4415
-
4416
- /**
4417
- * Create a Zod schema for validating ENSApiPublicConfig.
4418
- *
4419
- * @param valueLabel - Optional label for the value being validated (used in error messages)
4420
- */
4421
- declare function makeEnsApiPublicConfigSchema(valueLabel?: string): z.ZodObject<{
4422
- version: z.ZodString;
4423
- theGraphFallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
4424
- canFallback: z.ZodLiteral<true>;
4425
- url: z.ZodString;
4426
- }, z.core.$strict>, z.ZodObject<{
4427
- canFallback: z.ZodLiteral<false>;
4428
- reason: z.ZodEnum<{
4429
- readonly NotSubgraphCompatible: "not-subgraph-compatible";
4430
- readonly NoApiKey: "no-api-key";
4431
- readonly NoSubgraphUrl: "no-subgraph-url";
4432
- }>;
4433
- }, z.core.$strict>], "canFallback">;
4434
- ensIndexerPublicConfig: z.ZodObject<{
4435
- databaseSchemaName: z.ZodString;
4436
- ensRainbowPublicConfig: z.ZodObject<{
4437
- version: z.ZodString;
4438
- labelSet: z.ZodObject<{
4439
- labelSetId: z.ZodString;
4440
- highestLabelSetVersion: z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodInt>;
4441
- }, z.core.$strip>;
4442
- recordsCount: z.ZodInt;
4443
- }, z.core.$strip>;
4444
- indexedChainIds: z.ZodSet<z.ZodPipe<z.ZodInt, z.ZodTransform<number, number>>>;
4445
- isSubgraphCompatible: z.ZodBoolean;
4446
- labelSet: z.ZodObject<{
4447
- labelSetId: z.ZodString;
4448
- labelSetVersion: z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodInt>;
4449
- }, z.core.$strip>;
4450
- namespace: z.ZodEnum<{
4451
- readonly Mainnet: "mainnet";
4452
- readonly Sepolia: "sepolia";
4453
- readonly SepoliaV2: "sepolia-v2";
4454
- readonly EnsTestEnv: "ens-test-env";
4455
- }>;
4456
- plugins: z.ZodArray<z.ZodString>;
4457
- versionInfo: z.ZodObject<{
4458
- nodejs: z.ZodString;
4459
- ponder: z.ZodString;
4460
- ensDb: z.ZodString;
4461
- ensIndexer: z.ZodString;
4462
- ensNormalize: z.ZodString;
4463
- }, z.core.$strip>;
4464
- }, z.core.$strip>;
4465
- }, z.core.$strip>;
4466
- /**
4467
- * Create a Zod schema for validating a serialized ENSApiPublicConfig.
4468
- *
4469
- * @deprecated Use {@link makeEnsApiPublicConfigSchema} instead.
4470
- */
4471
- declare const makeENSApiPublicConfigSchema: typeof makeEnsApiPublicConfigSchema;
4472
- declare function makeSerializedEnsApiPublicConfigSchema(valueLabel?: string): z.ZodObject<{
4473
- version: z.ZodString;
4474
- theGraphFallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
4475
- canFallback: z.ZodLiteral<true>;
4476
- url: z.ZodString;
4477
- }, z.core.$strict>, z.ZodObject<{
4478
- canFallback: z.ZodLiteral<false>;
4479
- reason: z.ZodEnum<{
4480
- readonly NotSubgraphCompatible: "not-subgraph-compatible";
4481
- readonly NoApiKey: "no-api-key";
4482
- readonly NoSubgraphUrl: "no-subgraph-url";
4483
- }>;
4484
- }, z.core.$strict>], "canFallback">;
4485
- ensIndexerPublicConfig: z.ZodObject<{
4486
- databaseSchemaName: z.ZodString;
4487
- ensRainbowPublicConfig: z.ZodObject<{
4488
- version: z.ZodString;
4489
- labelSet: z.ZodObject<{
4490
- labelSetId: z.ZodString;
4491
- highestLabelSetVersion: z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodInt>;
4492
- }, z.core.$strip>;
4493
- recordsCount: z.ZodInt;
4494
- }, z.core.$strip>;
4495
- indexedChainIds: z.ZodArray<z.ZodPipe<z.ZodInt, z.ZodTransform<number, number>>>;
4496
- isSubgraphCompatible: z.ZodBoolean;
4497
- labelSet: z.ZodObject<{
4498
- labelSetId: z.ZodString;
4499
- labelSetVersion: z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodInt>;
4500
- }, z.core.$strip>;
4501
- namespace: z.ZodEnum<{
4502
- readonly Mainnet: "mainnet";
4503
- readonly Sepolia: "sepolia";
4504
- readonly SepoliaV2: "sepolia-v2";
4505
- readonly EnsTestEnv: "ens-test-env";
4506
- }>;
4507
- plugins: z.ZodArray<z.ZodString>;
4508
- versionInfo: z.ZodObject<{
4509
- nodejs: z.ZodString;
4510
- ponder: z.ZodString;
4511
- ensDb: z.ZodString;
4512
- ensIndexer: z.ZodString;
4513
- ensNormalize: z.ZodString;
4514
- }, z.core.$strip>;
4515
- }, z.core.$strip>;
4516
- }, z.core.$strip>;
4517
-
4518
- /**
4519
- * Default ENSNode API endpoint URL for Mainnet
4520
- */
4521
- declare const DEFAULT_ENSNODE_API_URL_MAINNET: "https://api.alpha.ensnode.io";
4522
- /**
4523
- * Default ENSNode API endpoint URL for Sepolia
4524
- */
4525
- declare const DEFAULT_ENSNODE_API_URL_SEPOLIA: "https://api.alpha-sepolia.ensnode.io";
4526
- /**
4527
- * Gets the default ENSNode URL for the provided ENSNamespaceId.
4528
- *
4529
- * @param namespace - Optional. The ENSNamespaceId to get the default ENSNode URL for. If not
4530
- * provided, defaults to Mainnet.
4531
- * @returns The default ENSNode URL for the provided ENSNamespaceId, or for Mainnet if no
4532
- * namespace is provided.
4533
- * @throws If the provided ENSNamespaceId does not have a default ENSNode URL defined
4534
- */
4535
- declare const getDefaultEnsNodeUrl: (namespace?: ENSNamespaceId) => URL;
4536
-
4537
- /**
4538
- * ENSIndexer Public Config Response
4539
- */
4540
- type EnsIndexerConfigResponse = EnsIndexerPublicConfig;
4541
-
4542
- type SerializedEnsIndexerConfigResponse = SerializedEnsIndexerPublicConfig;
4543
-
4544
- /**
4545
- * Deserialize value into {@link EnsIndexerConfigResponse} object.
4546
- */
4547
- declare function deserializeEnsIndexerConfigResponse(maybeResponse: Unvalidated<SerializedEnsIndexerConfigResponse>): EnsIndexerConfigResponse;
4548
-
4549
- declare function serializeEnsIndexerConfigResponse(response: EnsIndexerConfigResponse): SerializedEnsIndexerConfigResponse;
4550
-
4551
- /**
4552
- * A status code for ENSIndexer indexing status responses.
4553
- */
4554
- declare const EnsIndexerIndexingStatusResponseCodes: {
4555
- /**
4556
- * Represents that the indexing status is available.
4557
- */
4558
- readonly Ok: "ok";
4559
- /**
4560
- * Represents that the indexing status is unavailable.
4561
- */
4562
- readonly Error: "error";
4563
- };
4564
- /**
4565
- * The derived string union of possible {@link EnsIndexerIndexingStatusResponseCodes}.
4566
- */
4567
- type EnsIndexerIndexingStatusResponseCode = (typeof EnsIndexerIndexingStatusResponseCodes)[keyof typeof EnsIndexerIndexingStatusResponseCodes];
4568
- /**
4569
- * An ENSIndexer indexing status response when the indexing status is available.
4570
- */
4571
- type EnsIndexerIndexingStatusResponseOk = {
4572
- responseCode: typeof EnsIndexerIndexingStatusResponseCodes.Ok;
4573
- realtimeProjection: RealtimeIndexingStatusProjection;
4574
- };
4575
- /**
4576
- * An ENSIndexer indexing status response when the indexing status is unavailable.
4577
- */
4578
- type EnsIndexerIndexingStatusResponseError = {
4579
- responseCode: typeof EnsIndexerIndexingStatusResponseCodes.Error;
4580
- };
4581
- /**
4582
- * ENSIndexer indexing status response.
4583
- *
4584
- * Use the `responseCode` field to determine the specific type interpretation
4585
- * at runtime.
4586
- */
4587
- type EnsIndexerIndexingStatusResponse = EnsIndexerIndexingStatusResponseOk | EnsIndexerIndexingStatusResponseError;
4588
-
4589
- /**
4590
- * Serialized representation of {@link EnsIndexerIndexingStatusResponseError}.
4591
- */
4592
- type SerializedEnsIndexerIndexingStatusResponseError = EnsIndexerIndexingStatusResponseError;
4593
- /**
4594
- * Serialized representation of {@link EnsIndexerIndexingStatusResponseOk}.
4595
- */
4596
- interface SerializedEnsIndexerIndexingStatusResponseOk extends Omit<EnsIndexerIndexingStatusResponseOk, "realtimeProjection"> {
4597
- realtimeProjection: SerializedRealtimeIndexingStatusProjection;
4598
- }
4599
- /**
4600
- * Serialized representation of {@link EnsIndexerIndexingStatusResponse}.
4601
- */
4602
- type SerializedEnsIndexerIndexingStatusResponse = SerializedEnsIndexerIndexingStatusResponseOk | SerializedEnsIndexerIndexingStatusResponseError;
4603
-
4604
- /**
4605
- * Deserialize a {@link EnsIndexerIndexingStatusResponse} object.
4606
- */
4607
- declare function deserializeEnsIndexerIndexingStatusResponse(maybeResponse: Unvalidated<SerializedEnsIndexerIndexingStatusResponse>): EnsIndexerIndexingStatusResponse;
4608
-
4609
- /**
4610
- * Represents a request to ENSIndexer Indexing Status API.
4611
- */
4612
- type EnsIndexerIndexingStatusRequest = {};
4613
-
4614
- declare function serializeEnsIndexerIndexingStatusResponse(response: EnsIndexerIndexingStatusResponse): SerializedEnsIndexerIndexingStatusResponse;
4615
-
4616
- /**
4617
- * Configuration options for ENSIndexer API client
4618
- */
4619
- interface EnsIndexerClientOptions {
4620
- /** The ENSIndexer API URL */
4621
- url: URL;
4622
- }
4623
- /**
4624
- * ENSIndexer API Client
4625
- *
4626
- * Provides access to the following ENSIndexer APIs:
4627
- * - Configuration API
4628
- * - Indexing Status API
4629
- *
4630
- * @example
4631
- * ```typescript
4632
- * import { EnsIndexerClient } from "@ensnode/ensnode-sdk";
4633
- *
4634
- * // Custom configuration
4635
- * const client = new EnsIndexerClient({
4636
- * url: new URL("https://my-ENSIndexer-instance.com"),
4637
- * });
4638
- * ```
4639
- */
4640
- declare class EnsIndexerClient {
4641
- private readonly options;
4642
- constructor(options: EnsIndexerClientOptions);
4643
- getOptions(): Readonly<EnsIndexerClientOptions>;
4644
- /**
4645
- * Fetch ENSIndexer Config
4022
+ * // Get second page with 25 records per page
4023
+ * const response = await client.registrarActions({
4024
+ * page: 2,
4025
+ * recordsPerPage: 25,
4026
+ * });
4646
4027
  *
4647
- * Fetch the ENSIndexer's configuration.
4028
+ * // get latest registrar action records associated with
4029
+ * // subregistry managing `eth` name
4030
+ * await client.registrarActions({
4031
+ * filters: [registrarActionsFilter.byParentNode(ETH_NODE)],
4032
+ * });
4648
4033
  *
4649
- * @returns {EnsIndexerConfigResponse}
4034
+ * // get latest registrar action records which include referral info
4035
+ * await client.registrarActions({
4036
+ * filters: [registrarActionsFilter.withReferral(true)],
4037
+ * });
4650
4038
  *
4651
- * @throws if the ENSIndexer request fails
4652
- * @throws if the ENSIndexer returns a non-ok response
4653
- * @throws if the ENSIndexer response breaks required invariants
4039
+ * // get latest registrar action records for a specific decoded referrer
4040
+ * await client.registrarActions({
4041
+ * filters: [registrarActionsFilter.byDecodedReferrer("0x1234567890123456789012345678901234567890")],
4042
+ * });
4043
+ *
4044
+ * // get latest 10 registrar action records associated with
4045
+ * // subregistry managing `base.eth` name
4046
+ * await client.registrarActions({
4047
+ * filters: [registrarActionsFilter.byParentNode(BASE_NODE)],
4048
+ * recordsPerPage: 10
4049
+ * });
4050
+ *
4051
+ * // get registrar actions within a specific time range
4052
+ * const beginTimestamp = 1764547200; // Dec 1, 2025, 00:00:00 UTC
4053
+ * const endTimestamp = 1767225600; // Jan 1, 2026, 00:00:00 UTC
4054
+ * await client.registrarActions({
4055
+ * filters: [
4056
+ * registrarActionsFilter.beginTimestamp(beginTimestamp),
4057
+ * registrarActionsFilter.endTimestamp(endTimestamp),
4058
+ * ],
4059
+ * });
4060
+ *
4061
+ * // get registrar actions from a specific timestamp onwards
4062
+ * await client.registrarActions({
4063
+ * filters: [registrarActionsFilter.beginTimestamp(1764547200)],
4064
+ * });
4065
+ *
4066
+ * // get registrar actions up to a specific timestamp
4067
+ * await client.registrarActions({
4068
+ * filters: [registrarActionsFilter.endTimestamp(1767225600)],
4069
+ * });
4070
+ * ```
4654
4071
  */
4655
- config(): Promise<EnsIndexerConfigResponse>;
4072
+ registrarActions(request?: RegistrarActionsRequest): Promise<RegistrarActionsResponse>;
4656
4073
  /**
4657
- * Fetch ENSIndexer Indexing Status
4074
+ * Fetch Name Tokens for requested name.
4658
4075
  *
4659
- * @returns {EnsIndexerIndexingStatusResponse}
4076
+ * @param request.name - Name for which Name Tokens will be fetched.
4077
+ * @returns {NameTokensResponse}
4660
4078
  *
4661
- * @throws if the ENSIndexer request fails
4662
- * @throws if the ENSIndexer returns a non-ok response
4663
- * @throws if the ENSIndexer response breaks required invariants
4079
+ * @throws if the ENSNode request fails
4080
+ * @throws if the ENSNode API returns an error response
4081
+ * @throws if the ENSNode response breaks required invariants
4082
+ *
4083
+ * @example
4084
+ * ```ts
4085
+ * import {
4086
+ * EnsNodeClient,
4087
+ * } from "@ensnode/ensnode-sdk";
4088
+ * import { namehashInterpretedName, asInterpretedName } from "enssdk";
4089
+ *
4090
+ * const VITALIK_NAME = asInterpretedName("vitalik.eth");
4091
+ * const VITALIK_DOMAIN_ID = namehashInterpretedName(VITALIK_NAME);
4092
+ *
4093
+ * const client: EnsNodeClient;
4094
+ *
4095
+ * // get latest name token records from the indexed subregistry based on the requested name
4096
+ * const response = await client.nameTokens({
4097
+ * name: VITALIK_NAME,
4098
+ * });
4099
+ *
4100
+ * const response = await client.nameTokens({
4101
+ * domainId: VITALIK_DOMAIN_ID,
4102
+ * })
4103
+ * ```
4664
4104
  */
4665
- indexingStatus(): Promise<EnsIndexerIndexingStatusResponse>;
4105
+ nameTokens(request: NameTokensRequest): Promise<NameTokensResponse>;
4666
4106
  }
4667
4107
 
4668
- type EnsIndexerPublicConfigCompatibilityCheck = Omit<EnsIndexerPublicConfig, "databaseSchemaName" | "ensRainbowPublicConfig" | "versionInfo">;
4669
- /**
4670
- * Validate if `configB` is compatible with `configA`, such that `configA` equals to `configB`.
4671
- *
4672
- * @throws error if configs are incompatible.
4673
- */
4674
- declare function validateEnsIndexerPublicConfigCompatibility(configA: EnsIndexerPublicConfigCompatibilityCheck, configB: EnsIndexerPublicConfigCompatibilityCheck): void;
4675
-
4676
- /**
4677
- * Builds an unvalidated {@link EnsIndexerPublicConfig} object to be
4678
- * validated with {@link makeEnsIndexerPublicConfigSchema}.
4679
- *
4680
- * @param serializedPublicConfig - The serialized public config to build from.
4681
- * @return An unvalidated {@link EnsIndexerPublicConfig} object.
4682
- */
4683
- declare function buildUnvalidatedEnsIndexerPublicConfig(serializedPublicConfig: SerializedEnsIndexerPublicConfig): Unvalidated<EnsIndexerPublicConfig>;
4684
- /**
4685
- * Deserialize value into {@link EnsIndexerPublicConfig} object.
4686
- */
4687
- declare function deserializeEnsIndexerPublicConfig(maybePublicConfig: Unvalidated<SerializedEnsIndexerPublicConfig>, valueLabel?: string): EnsIndexerPublicConfig;
4688
- /**
4689
- * Deserialize object into a {@link EnsIndexerPublicConfig} object.
4690
- *
4691
- * @deprecated Use {@link deserializeEnsIndexerPublicConfig} instead.
4692
- */
4693
- declare const deserializeENSIndexerPublicConfig: typeof deserializeEnsIndexerPublicConfig;
4694
-
4695
- /**
4696
- * Determines if the provided `config` results in indexing behavior compatible with the legacy ENS
4697
- * Subgraph.
4698
- *
4699
- * @see https://ensnode.io/docs/concepts/what-is-the-ens-subgraph
4700
- */
4701
- declare function isSubgraphCompatible(config: Pick<EnsIndexerPublicConfig, "namespace" | "plugins" | "labelSet">): boolean;
4702
-
4703
- /**
4704
- * Converts a Labelhash to bytes, with validation
4705
- * @param labelHash The Labelhash to convert
4706
- * @returns A ByteArray containing the bytes
4707
- * @throws Error if `labelHash` is not a valid 32-byte hex string
4708
- */
4709
- declare function labelHashToBytes(labelHash: LabelHash): ByteArray;
4710
-
4711
- /**
4712
- * Builds a valid LabelSetId from a string.
4713
- * @param maybeLabelSetId - The string to validate and convert to a LabelSetId.
4714
- * @returns A valid LabelSetId.
4715
- * @throws If the input string is not a valid LabelSetId.
4716
- */
4717
- declare function buildLabelSetId(maybeLabelSetId: string): LabelSetId;
4718
- /**
4719
- * Builds a valid LabelSetVersion from a number or string.
4720
- * @param maybeLabelSetVersion - The number or string to validate and convert to a LabelSetVersion.
4721
- * @returns A valid LabelSetVersion.
4722
- * @throws If the input is not a valid LabelSetVersion.
4723
- */
4724
- declare function buildLabelSetVersion(maybeLabelSetVersion: number | string): LabelSetVersion;
4725
- /**
4726
- * Builds an EnsRainbowClientLabelSet.
4727
- * @param labelSetId - The label set ID.
4728
- * @param labelSetVersion - The label set version.
4729
- * @returns A valid EnsRainbowClientLabelSet object.
4730
- * @throws If `labelSetVersion` is defined without `labelSetId`.
4731
- */
4732
- declare function buildEnsRainbowClientLabelSet(labelSetId?: LabelSetId, labelSetVersion?: LabelSetVersion): EnsRainbowClientLabelSet;
4733
- /**
4734
- * Validates that the server's label set is compatible with the client's requested label set.
4735
- * @param serverSet - The label set provided by the server.
4736
- * @param clientSet - The label set requested by the client.
4737
- * @throws If the server set is not compatible with the client set.
4738
- */
4739
- declare function validateSupportedLabelSetAndVersion(serverSet: EnsRainbowServerLabelSet, clientSet: EnsRainbowClientLabelSet): void;
4740
-
4741
- /**
4742
- * Parses a string into a non-negative integer.
4743
- * @param input The string to parse
4744
- * @returns The parsed non-negative integer
4745
- * @throws Error if the input is not a valid non-negative integer
4746
- */
4747
- declare function parseNonNegativeInteger(maybeNumber: string): number;
4108
+ declare class ClientError extends Error {
4109
+ details?: unknown;
4110
+ constructor(message: string, details?: unknown);
4111
+ static fromErrorResponse({ message, details }: ErrorResponse): ClientError;
4112
+ }
4748
4113
 
4749
4114
  /**
4750
- * Serializes a {@link ChainConfig} object.
4751
- */
4752
- declare function serializeIndexedChainIds(indexedChainIds: Set<ChainId>): SerializedIndexedChainIds;
4753
- /**
4754
- * Serialize a {@link EnsIndexerPublicConfig} object.
4755
- */
4756
- declare function serializeEnsIndexerPublicConfig(config: EnsIndexerPublicConfig): SerializedEnsIndexerPublicConfig;
4757
- /**
4758
- * Serialize a {@link EnsIndexerPublicConfig} object.
4759
- *
4760
- * @deprecated Use {@link serializeEnsIndexerPublicConfig} instead.
4115
+ * Default ENSNode URL for Mainnet
4761
4116
  */
4762
- declare const serializeENSIndexerPublicConfig: typeof serializeEnsIndexerPublicConfig;
4763
-
4117
+ declare const DEFAULT_ENSNODE_URL_MAINNET: "https://api.alpha.ensnode.io";
4764
4118
  /**
4765
- * Validates an unvalidated representation of
4766
- * {@link EnsIndexerPublicConfig} object.
4767
- *
4768
- * @throws Error if the provided object is not
4769
- * a valid {@link EnsIndexerPublicConfig}.
4119
+ * Default ENSNode URL for Sepolia
4770
4120
  */
4771
- declare function validateEnsIndexerPublicConfig(unvalidatedConfig: Unvalidated<EnsIndexerPublicConfig>): EnsIndexerPublicConfig;
4772
-
4121
+ declare const DEFAULT_ENSNODE_URL_SEPOLIA: "https://api.alpha-sepolia.ensnode.io";
4773
4122
  /**
4774
- * Validates an unvalidated representation of
4775
- * {@link EnsIndexerVersionInfo} object.
4123
+ * Gets the default ENSNode URL for the provided ENSNamespaceId.
4776
4124
  *
4777
- * @throws Error if the provided object is not
4778
- * a valid {@link EnsIndexerVersionInfo}.
4779
- */
4780
- declare function validateEnsIndexerVersionInfo(unvalidatedVersionInfo: Unvalidated<EnsIndexerVersionInfo>): EnsIndexerVersionInfo;
4781
-
4782
- /**
4783
- * Check if provided EnsIndexerPublicConfig supports the ENSNode GraphQL API.
4125
+ * @param namespace - Optional. The ENSNamespaceId to get the default ENSNode URL for. If not
4126
+ * provided, defaults to Mainnet.
4127
+ * @returns The default ENSNode URL for the provided ENSNamespaceId, or for Mainnet if no
4128
+ * namespace is provided.
4129
+ * @throws If the provided ENSNamespaceId does not have a default ENSNode URL defined
4784
4130
  */
4785
- declare function hasGraphqlApiConfigSupport(config: EnsIndexerPublicConfig): PrerequisiteResult;
4131
+ declare const getDefaultEnsNodeUrl: (namespace?: ENSNamespaceId) => URL;
4786
4132
 
4787
4133
  /**
4788
4134
  * Serialized representation of {@link ChainIndexingStatusSnapshot}
@@ -4881,6 +4227,11 @@ declare function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot: Un
4881
4227
  */
4882
4228
  declare function validateRealtimeIndexingStatusProjection(unvalidatedProjection: Unvalidated<RealtimeIndexingStatusProjection>, valueLabel?: string): RealtimeIndexingStatusProjection;
4883
4229
 
4230
+ /**
4231
+ * Check if provided EnsIndexerPublicConfig supports the ENSNode Omnigraph API.
4232
+ */
4233
+ declare function hasOmnigraphApiConfigSupport(config: EnsIndexerPublicConfig): PrerequisiteResult;
4234
+
4884
4235
  /**
4885
4236
  * Gets the SubregistryId (an AccountId) of the Basenames Subregistry contract (this is the
4886
4237
  * "BaseRegistrar" contract for Basenames) for the provided namespace.
@@ -4897,7 +4248,7 @@ declare function getBasenamesSubregistryId(namespace: ENSNamespaceId): AccountId
4897
4248
  * @returns registrar managed name
4898
4249
  * @throws an error when no registrar managed name could be returned
4899
4250
  */
4900
- declare function getBasenamesSubregistryManagedName(namespaceId: ENSNamespaceId): Name;
4251
+ declare function getBasenamesSubregistryManagedName(namespaceId: ENSNamespaceId): InterpretedName;
4901
4252
 
4902
4253
  /**
4903
4254
  * Gets the SubregistryId (an AccountId) of the Ethnames Subregistry contract (this is the
@@ -4914,7 +4265,7 @@ declare function getEthnamesSubregistryId(namespace: ENSNamespaceId): AccountId;
4914
4265
  * @param namespaceId
4915
4266
  * @returns registrar managed name
4916
4267
  */
4917
- declare function getEthnamesSubregistryManagedName(namespaceId: ENSNamespaceId): Name;
4268
+ declare function getEthnamesSubregistryManagedName(namespaceId: ENSNamespaceId): InterpretedName;
4918
4269
 
4919
4270
  /**
4920
4271
  * Gets the SubregistryId (an AccountId) of the Lineanames Subregistry contract (this is the
@@ -4932,7 +4283,7 @@ declare function getLineanamesSubregistryId(namespace: ENSNamespaceId): AccountI
4932
4283
  * @returns registrar managed name
4933
4284
  * @throws an error when no registrar managed name could be returned
4934
4285
  */
4935
- declare function getLineanamesSubregistryManagedName(namespaceId: ENSNamespaceId): Name;
4286
+ declare function getLineanamesSubregistryManagedName(namespaceId: ENSNamespaceId): InterpretedName;
4936
4287
 
4937
4288
  interface RegistrationExpiryInfo {
4938
4289
  expiry: bigint | null;
@@ -4958,14 +4309,6 @@ declare function isRegistrationInGracePeriod(info: RegistrationExpiryInfo, now:
4958
4309
  */
4959
4310
  declare const accountIdEqual: (a: AccountId, b: AccountId) => boolean;
4960
4311
 
4961
- /**
4962
- * Converts an EVM address to its lowercase representation.
4963
- *
4964
- * @param address - EVM address to convert.
4965
- * @returns The lowercase representation of the EVM address.
4966
- */
4967
- declare function asLowerCaseAddress(address: Address): Address;
4968
-
4969
4312
  /**
4970
4313
  * Cache that maps from string -> ValueType.
4971
4314
  */
@@ -5242,18 +4585,18 @@ declare const interpretAddress: (owner: Address) => `0x${string}` | null;
5242
4585
  * Interprets a name record value string and returns null if the value is interpreted as a deletion.
5243
4586
  *
5244
4587
  * The interpreted record value is either:
5245
- * a) null, representing a non-existant or deletion of the record, or
5246
- * b) a normalized, non-empty-string Name.
4588
+ * a) null, representing a non-existent or deletion of the record, or
4589
+ * b) an {@link InterpretedName}.
5247
4590
  *
5248
4591
  * @param value - The name record value string to interpret.
5249
4592
  * @returns The interpreted name string, or null if deleted.
5250
4593
  */
5251
- declare function interpretNameRecordValue(value: string): NormalizedName | null;
4594
+ declare function interpretNameRecordValue(value: LiteralName): InterpretedName | null;
5252
4595
  /**
5253
4596
  * Interprets an address record value string and returns null if the value is interpreted as a deletion.
5254
4597
  *
5255
4598
  * The interpreted record value is either:
5256
- * a) null, representing a non-existant or deletion of the record, or
4599
+ * a) null, representing a non-existent or deletion of the record, or
5257
4600
  * i. contains null bytes
5258
4601
  * ii. empty string
5259
4602
  * iii. empty hex (0x)
@@ -5284,7 +4627,7 @@ declare function interpretTextRecordKey(key: string): string | null;
5284
4627
  * Interprets a text record value string and returns null if the value is interpreted as a deletion.
5285
4628
  *
5286
4629
  * The interpreted record value is either:
5287
- * a) null, representing a non-existant or deletion of the record, or
4630
+ * a) null, representing a non-existent or deletion of the record, or
5288
4631
  * i. contains null bytes
5289
4632
  * ii. empty string
5290
4633
  * b) a text record value that
@@ -5296,125 +4639,22 @@ declare function interpretTextRecordKey(key: string): string | null;
5296
4639
  declare function interpretTextRecordValue(value: string): string | null;
5297
4640
 
5298
4641
  /**
5299
- * Decodes a uint256-encoded-LabelHash (eg. from a tokenId) into a {@link LabelHash}.
5300
- *
5301
- * Remember that contracts that operate in the context of a Managed Name frequently store and operate
5302
- * over _LabelHashes_ that represent a direct subname of a Managed Name. These contracts also frequently
5303
- * implement ERC721 or ERC1155 to represent ownership of these Names. As such, to construct the
5304
- * ERC721/ERC1155 tokenId, they may encode the direct subnames's LabelHash as a uint256.
5305
- *
5306
- * This is true for the ENSv1 BaseRegistrar, RegistrarControllers, as well as any
5307
- * contracts forked from it (which includes Basenames' and Lineanames' implementations).
5308
- *
5309
- * So, in order to turn the tokenId into a LabelHash, we perform the opposite operation, decoding
5310
- * from a uint256 into a Hex (of size 32) and cast it as our semantic {@link LabelHash} type.
5311
- *
5312
- * @see https://github.com/ensdomains/ens-contracts/blob/db613bc/contracts/ethregistrar/ETHRegistrarController.sol#L215
5313
- * @see https://github.com/base/basenames/blob/1b5c1ad/src/L2/RegistrarController.sol#L488
5314
- * @see https://github.com/Consensys/linea-ens/blob/3a4f02f/packages/linea-ens-contracts/contracts/ethregistrar/ETHRegistrarController.sol#L447
5315
- */
5316
- declare const interpretTokenIdAsLabelHash: (tokenId: bigint) => LabelHash;
5317
- /**
5318
- * Decodes a uint256-encoded-Node (eg. from a tokenId) into a {@link Node}.
5319
- *
5320
- * Contracts in the ENSv1 ecosystem frequently implement ERC721 or ERC1155 to represent
5321
- * ownership of a Domain. As such, to construct the ERC721/ERC1155 tokenId, they may encode the
5322
- * domain's {@link Node} as a uint256.
5323
- *
5324
- * This is true for the ENSv1 NameWrapper, as well as any contracts forked from it (which includes
5325
- * Lineanames' implementation).
5326
- *
5327
- * So, in order to turn the tokenId into a Node, we perform the opposite operation, decoding
5328
- * from a uint256 into a Hex (of size 32) and cast it as our semantic {@link Node} type.
5329
- *
5330
- * @see https://github.com/ensdomains/ens-contracts/blob/db613bc/contracts/wrapper/ERC1155Fuse.sol#L262
5331
- */
5332
- declare const interpretTokenIdAsNode: (tokenId: bigint) => Node;
5333
-
5334
- /**
5335
- * Interprets a Literal Label, producing an Interpreted Label.
5336
- *
5337
- * @see https://ensnode.io/docs/reference/terminology#literal-label
5338
- * @see https://ensnode.io/docs/reference/terminology#interpreted-label
5339
- *
5340
- * @param label - The Literal Label string to interpret
5341
- * @returns The provided label if it is a normalized label, else the EncodedLabelHash of the label
5342
- */
5343
- declare function literalLabelToInterpretedLabel(label: LiteralLabel): InterpretedLabel;
5344
- /**
5345
- * Interprets an ordered list of Literal Labels, producing an Interpreted Name.
5346
- *
5347
- * Note that it's important that the Literal Labels are provided as an array, otherwise it's
5348
- * impossible to differentiate between 'a.label.eth' being ['a.label', 'eth'] or ['a', 'label', 'eth'].
5349
- *
5350
- * Note that the input is an ordered list of _Literal_ Labels: in this context, any literal label
5351
- * that is formatted as an Encoded LabelHash will NOT be interpreted as such. Instead it will be
5352
- * interpreted into an Encoded LabelHash that encodes the literal labelhash of the Literal Label.
5353
- *
5354
- * @param labels An ordered list of 0 or more Literal Labels
5355
- * @returns An InterpretedName
5356
- */
5357
- declare function literalLabelsToInterpretedName(labels: LiteralLabel[]): InterpretedName;
5358
- /**
5359
- * Joins the list of Interpreted Labels with '.' to form an Interpreted Name.
5360
- *
5361
- * @param labels An ordered list of 0 or more Interpreted Labels
5362
- * @returns An InterpretedName
5363
- */
5364
- declare function interpretedLabelsToInterpretedName(labels: InterpretedLabel[]): InterpretedName;
5365
- /**
5366
- * Joins the list of Literal Labels with '.' to form a Literal Name.
5367
- *
5368
- * Note: LiteralLabel values may contain '.' characters, which will be preserved
5369
- * in the resulting LiteralName. Therefore, the number of labels in the returned
5370
- * LiteralName may be greater than the number of LiteralLabels in the input array.
5371
- *
5372
- * @param labels An ordered list of 0 or more Literal Labels
5373
- * @returns An LiteralName
5374
- */
5375
- declare function literalLabelsToLiteralName(labels: LiteralLabel[]): LiteralName;
5376
- /**
5377
- * Converts an Interpreted Name into a list of Interpreted Labels.
5378
- */
5379
- declare function interpretedNameToInterpretedLabels(name: InterpretedName): InterpretedLabel[];
5380
- declare function encodedLabelToLabelhash(label: string): LabelHash | null;
5381
- declare function isInterpetedLabel(label: Label): label is InterpretedLabel;
5382
- declare function isInterpretedName(name: Name): name is InterpretedName;
5383
- /**
5384
- * Converts InterpretedLabels into a LabelHashPath.
5385
- */
5386
- declare function interpretedLabelsToLabelHashPath(labels: InterpretedLabel[]): LabelHashPath;
5387
- /**
5388
- * Constructs a new InterpretedName from an InterpretedLabel (child) and InterpretedName (parent).
5389
- *
5390
- * If no parent is available the InterpretedLabel is cast to an InterpretedName and returned.
5391
- *
5392
- * @dev the following is safe due to InterpretedLabel/InterpretedName semantics, see above.
5393
- */
5394
- declare function constructSubInterpretedName(label: InterpretedLabel, name: InterpretedName | undefined): InterpretedName;
5395
- /**
5396
- * Given a `labelHash` and optionally its healed InterpretedLabel, return an InterpretedLabel.
4642
+ * Interprets an ENSIP-7 contenthash value. Empty bytes are interpreted as deletion.
5397
4643
  */
5398
- declare function ensureInterpretedLabel(labelHash: LabelHash, label: InterpretedLabel | undefined): InterpretedLabel;
4644
+ declare function interpretContenthashValue(value: Hex): Hex | null;
5399
4645
  /**
5400
- * Parses a Partial InterpretedName into concrete InterpretedLabels and the partial Label.
4646
+ * Interprets a PubkeyResolver (x, y) pair. A (zeroHash, zeroHash) pair is interpreted as deletion.
5401
4647
  *
5402
- * @throws if the provided `partialInterpretedName` is not composed of concrete InterpretedLabels.
4648
+ * Invariant: both null together, or both set together.
5403
4649
  */
5404
- declare function parsePartialInterpretedName(partialInterpretedName: Name): {
5405
- concrete: InterpretedLabel[];
5406
- partial: string;
5407
- };
5408
-
4650
+ declare function interpretPubkeyValue(x: Hex, y: Hex): {
4651
+ x: Hex;
4652
+ y: Hex;
4653
+ } | null;
5409
4654
  /**
5410
- * Implements the ENS `labelhash` function for Literal Labels.
5411
- * @see https://docs.ens.domains/ensip/1
5412
- *
5413
- * @param label the Literal Label to hash
5414
- * @returns the hash of the provided label
5415
- * @dev This function is viem/ens#labelhash but without the special-case handling of Encoded LabelHashes.
4655
+ * Interprets an IDNSZoneResolver zonehash value. Empty bytes are interpreted as deletion.
5416
4656
  */
5417
- declare const labelhashLiteralLabel: (label: LiteralLabel) => LabelHash;
4657
+ declare function interpretDnszonehashValue(value: Hex): Hex | null;
5418
4658
 
5419
4659
  /**
5420
4660
  * A value that varies by ENS namespace, with a required default.
@@ -5498,7 +4738,7 @@ declare const getENSv2RootRegistry: (namespace: ENSNamespaceId) => AccountId;
5498
4738
  *
5499
4739
  * @throws if the ENSv2Root Datasource or the RootRegistry contract are not defined
5500
4740
  */
5501
- declare const getENSv2RootRegistryId: (namespace: ENSNamespaceId) => RegistryId;
4741
+ declare const getENSv2RootRegistryId: (namespace: ENSNamespaceId) => enssdk.RegistryId;
5502
4742
  /**
5503
4743
  * Determines whether `contract` is the ENSv2 Root Registry in `namespace`.
5504
4744
  *
@@ -5518,7 +4758,7 @@ declare const maybeGetENSv2RootRegistry: (namespace: ENSNamespaceId) => AccountI
5518
4758
  *
5519
4759
  * TODO: remove this function and its usage after all namespaces define ENSv2Root
5520
4760
  */
5521
- declare const maybeGetENSv2RootRegistryId: (namespace: ENSNamespaceId) => RegistryId | undefined;
4761
+ declare const maybeGetENSv2RootRegistryId: (namespace: ENSNamespaceId) => enssdk.RegistryId | undefined;
5522
4762
 
5523
4763
  /**
5524
4764
  * Serializes a {@link ChainId} value into its string representation.
@@ -5548,29 +4788,26 @@ declare function serializePriceUsdc(price: PriceUsdc): SerializedPriceUsdc;
5548
4788
  * Serializes a {@link PriceDai} object.
5549
4789
  */
5550
4790
  declare function serializePriceDai(price: PriceDai): SerializedPriceDai;
4791
+
4792
+ declare function isHttpProtocol(url: URL): boolean;
4793
+ declare function isWebSocketProtocol(url: URL): boolean;
4794
+
5551
4795
  /**
5552
- * Format {@link AccountId} object as a string.
4796
+ * Builds an unvalidated {@link EnsNodeStackInfo} object to be
4797
+ * validated with {@link makeEnsNodeStackInfoSchema}.
5553
4798
  *
5554
- * Formatted as a fully lowercase CAIP-10 AccountId.
5555
- *
5556
- * @see https://chainagnostic.org/CAIPs/caip-10
4799
+ * @param serializedStackInfo - The serialized stack info to build from.
4800
+ * @return An unvalidated {@link EnsNodeStackInfo} object.
5557
4801
  */
5558
- declare function formatAccountId(accountId: AccountId): AccountIdString;
4802
+ declare function buildUnvalidatedEnsNodeStackInfo(serializedStackInfo: SerializedEnsNodeStackInfo): Unvalidated<EnsNodeStackInfo>;
5559
4803
  /**
5560
- * Format {@link AssetId} object as a string.
5561
- *
5562
- * Formatted as a fully lowercase CAIP-19 AssetId.
5563
- *
5564
- * @see https://chainagnostic.org/CAIPs/caip-19
4804
+ * Deserialize value into {@link EnsNodeStackInfo} object.
5565
4805
  */
5566
- declare function formatAssetId({ assetNamespace, contract: { chainId, address }, tokenId, }: AssetId): AssetIdString;
5567
-
5568
- declare function isHttpProtocol(url: URL): boolean;
5569
- declare function isWebSocketProtocol(url: URL): boolean;
4806
+ declare function deserializeEnsNodeStackInfo(maybeStackInfo: Unvalidated<SerializedEnsNodeStackInfo>, valueLabel?: string): EnsNodeStackInfo;
5570
4807
 
5571
4808
  /**
5572
4809
  * Check if provided EnsIndexerPublicConfig supports the Subgraph API.
5573
4810
  */
5574
4811
  declare function hasSubgraphApiConfigSupport(config: EnsIndexerPublicConfig): PrerequisiteResult;
5575
4812
 
5576
- export { ADDR_REVERSE_NODE, ATTR_PROTOCOL_NAME, ATTR_PROTOCOL_STEP, ATTR_PROTOCOL_STEP_RESULT, type AcceleratableRequest, type AcceleratableResponse, type AccountId, type AccountIdString, type AssetId, type AssetIdString, type AssetNamespace, AssetNamespaces, BASENAMES_NODE, type BlockNumber, type BlockNumberRange, type BlockNumberRangeBounded, type BlockNumberRangeLeftBounded, type BlockNumberRangeRightBounded, type BlockNumberRangeUnbounded, type BlockNumberRangeWithStartBlock, type BlockRef, type BlockRefRange, type BlockRefRangeBounded, type BlockRefRangeLeftBounded, type BlockRefRangeRightBounded, type BlockRefRangeUnbounded, type BlockRefRangeWithStartBlock, type Cache, type CachedResult, type CanonicalId, type CanonicalPath, type ChainId, type ChainIdString, type ChainIndexingStatusId, ChainIndexingStatusIds, type ChainIndexingStatusSnapshot, type ChainIndexingStatusSnapshotBackfill, type ChainIndexingStatusSnapshotCompleted, type ChainIndexingStatusSnapshotFollowing, type ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill, type ChainIndexingStatusSnapshotQueued, ClientError, type ClientOptions, type ConfigResponse, type CrossChainIndexingStatusSnapshot, type CrossChainIndexingStatusSnapshotOmnichain, type CrossChainIndexingStrategyId, CrossChainIndexingStrategyIds, type CurrencyAmount, type CurrencyId, CurrencyIds, type CurrencyInfo, DEFAULT_ENSNODE_API_URL_MAINNET, DEFAULT_ENSNODE_API_URL_SEPOLIA, DEFAULT_EVM_CHAIN_ID, DEFAULT_EVM_COIN_TYPE, type DNSEncodedLiteralName, type DNSEncodedName, type DNSEncodedPartiallyInterpretedName, type Datetime, type DatetimeISO8601, type DeepPartial, type DefaultableChainId, type DomainAssetId, type DomainId, type Duration, ENCODED_REFERRER_BYTE_LENGTH, ENCODED_REFERRER_BYTE_OFFSET, type ENSApiPublicConfig, type ENSIndexerPublicConfig, type ENSIndexerVersionInfo, ENSNodeClient, ENS_ROOT, type ENSv1DomainId, type ENSv2DomainId, ETH_COIN_TYPE, ETH_NODE, EXPECTED_ENCODED_REFERRER_PADDING, type EncodedLabelHash, type EncodedReferrer, EnsApiClient, type EnsApiClientOptions, type EnsApiConfigResponse, type EnsApiIndexingStatusRequest, type EnsApiIndexingStatusResponse, type EnsApiIndexingStatusResponseCode, EnsApiIndexingStatusResponseCodes, type EnsApiIndexingStatusResponseError, type EnsApiIndexingStatusResponseOk, type EnsApiPublicConfig, EnsIndexerClient, type EnsIndexerClientOptions, type EnsIndexerConfigResponse, type EnsIndexerIndexingStatusRequest, type EnsIndexerIndexingStatusResponse, type EnsIndexerIndexingStatusResponseCode, EnsIndexerIndexingStatusResponseCodes, type EnsIndexerIndexingStatusResponseError, type EnsIndexerIndexingStatusResponseOk, type EnsIndexerPublicConfig, type EnsIndexerPublicConfigCompatibilityCheck, type EnsIndexerVersionInfo, type EnsRainbowClientLabelSet, type EnsRainbowPublicConfig, type EnsRainbowServerLabelSet, type ErrorResponse, type ForwardResolutionArgs, ForwardResolutionProtocolStep, type ForwardResolutionResult, type Identity, type IndexingStatusRequest, type IndexingStatusResponse, type IndexingStatusResponseCode, IndexingStatusResponseCodes, type IndexingStatusResponseError, type IndexingStatusResponseOk, type InterpretedLabel, type InterpretedName, LINEANAMES_NODE, type Label, type LabelHash, type LabelHashPath, type LabelSetId, type LabelSetVersion, type LiteralLabel, type LiteralName, LruCache, type MultichainPrimaryNameResolutionArgs, type MultichainPrimaryNameResolutionResult, type NFTMintStatus, NFTMintStatuses, type NFTTransferEventMetadata, type NFTTransferType, NFTTransferTypes, NODE_ANY, type Name, type NameToken, type NameTokenOwnership, type NameTokenOwnershipBurned, type NameTokenOwnershipFullyOnchain, type NameTokenOwnershipNameWrapper, type NameTokenOwnershipType, NameTokenOwnershipTypes, type NameTokenOwnershipUnknown, type NameTokensRequest, type NameTokensResponse, type NameTokensResponseCode, NameTokensResponseCodes, type NameTokensResponseError, type NameTokensResponseErrorCode, NameTokensResponseErrorCodes, type NameTokensResponseErrorEnsIndexerConfigUnsupported, type NameTokensResponseErrorIndexingStatusUnsupported, type NameTokensResponseErrorNameTokensNotIndexed, type NameTokensResponseOk, type NamedIdentity, type NamedRegistrarAction, type NamespaceSpecificValue, type Node, type NormalizedName, type OmnichainIndexingStatusId, OmnichainIndexingStatusIds, type OmnichainIndexingStatusSnapshot, type OmnichainIndexingStatusSnapshotBackfill, type OmnichainIndexingStatusSnapshotCompleted, type OmnichainIndexingStatusSnapshotFollowing, type OmnichainIndexingStatusSnapshotUnstarted, PROTOCOL_ATTRIBUTE_PREFIX, type PermissionsId, type PermissionsResourceId, type PermissionsUserId, PluginName, type PrerequisiteResult, type Price, type PriceDai, type PriceEth, type PriceUsdc, RECORDS_PER_PAGE_DEFAULT, RECORDS_PER_PAGE_MAX, ROOT_NODE, ROOT_RESOURCE, type RangeType, RangeTypeIds, type RealtimeIndexingStatusProjection, type RegisteredNameTokens, type RegistrarAction, type RegistrarActionEventId, type RegistrarActionPricing, type RegistrarActionPricingAvailable, type RegistrarActionPricingUnknown, type RegistrarActionReferral, type RegistrarActionReferralAvailable, type RegistrarActionReferralNotApplicable, type RegistrarActionType, RegistrarActionTypes, type RegistrarActionsFilter, type RegistrarActionsFilterBeginTimestamp, type RegistrarActionsFilterByDecodedReferrer, type RegistrarActionsFilterBySubregistryNode, type RegistrarActionsFilterEndTimestamp, type RegistrarActionsFilterType, RegistrarActionsFilterTypes, type RegistrarActionsFilterWithEncodedReferral, type RegistrarActionsOrder, RegistrarActionsOrders, type RegistrarActionsRequest, type RegistrarActionsResponse, type RegistrarActionsResponseCode, RegistrarActionsResponseCodes, type RegistrarActionsResponseError, type RegistrarActionsResponseOk, type RegistrationExpiryInfo, type RegistrationId, type RegistrationLifecycle, type RegistrationLifecycleStage, type RegistryId, type RenewalId, type RequestPageParams, type RequiredAndNotNull, type ResolutionStatusId, ResolutionStatusIds, type ResolvePrimaryNameRequest, type ResolvePrimaryNameResponse, type ResolvePrimaryNamesRequest, type ResolvePrimaryNamesResponse, type ResolveRecordsRequest, type ResolveRecordsResponse, type ResolvedIdentity, type ResolverId, type ResolverRecordsId, type ResolverRecordsResponse, type ResolverRecordsResponseBase, type ResolverRecordsSelection, type ResponsePageContext, type ResponsePageContextWithNoRecords, type ResponsePageContextWithRecords, type ReverseResolutionArgs, ReverseResolutionProtocolStep, type ReverseResolutionResult, type RpcUrl, SWRCache, type SWRCacheOptions, type SerializedAssetId, type SerializedChainIndexingStatusSnapshot, type SerializedChainIndexingStatusSnapshotBackfill, type SerializedChainIndexingStatusSnapshotCompleted, type SerializedChainIndexingStatusSnapshotFollowing, type SerializedChainIndexingStatusSnapshotQueued, type SerializedConfigResponse, type SerializedCrossChainIndexingStatusSnapshot, type SerializedCrossChainIndexingStatusSnapshotOmnichain, type SerializedCurrencyAmount, type SerializedCurrentIndexingProjectionOmnichain, type SerializedDomainAssetId, type SerializedENSApiPublicConfig, type SerializedENSIndexerPublicConfig, type SerializedENSIndexerVersionInfo, type SerializedEnsApiConfigResponse, type SerializedEnsApiIndexingStatusResponse, type SerializedEnsApiIndexingStatusResponseError, type SerializedEnsApiIndexingStatusResponseOk, type SerializedEnsApiPublicConfig, type SerializedEnsIndexerConfigResponse, type SerializedEnsIndexerIndexingStatusResponse, type SerializedEnsIndexerIndexingStatusResponseError, type SerializedEnsIndexerIndexingStatusResponseOk, type SerializedEnsIndexerPublicConfig, type SerializedEnsIndexerVersionInfo, type SerializedIndexedChainIds, type SerializedIndexingStatusResponse, type SerializedIndexingStatusResponseError, type SerializedIndexingStatusResponseOk, type SerializedNameToken, type SerializedNameTokensResponse, type SerializedNameTokensResponseError, type SerializedNameTokensResponseOk, type SerializedNamedRegistrarAction, type SerializedOmnichainIndexingStatusSnapshot, type SerializedOmnichainIndexingStatusSnapshotBackfill, type SerializedOmnichainIndexingStatusSnapshotCompleted, type SerializedOmnichainIndexingStatusSnapshotFollowing, type SerializedOmnichainIndexingStatusSnapshotUnstarted, type SerializedPrice, type SerializedPriceDai, type SerializedPriceEth, type SerializedPriceUsdc, type SerializedRealtimeIndexingStatusProjection, type SerializedRegisteredNameTokens, type SerializedRegistrarAction, type SerializedRegistrarActionPricing, type SerializedRegistrarActionPricingAvailable, type SerializedRegistrarActionPricingUnknown, type SerializedRegistrarActionsResponse, type SerializedRegistrarActionsResponseError, type SerializedRegistrarActionsResponseOk, type SerializedTokenId, type SubgraphInterpretedLabel, type SubgraphInterpretedName, type Subregistry, type TheGraphCannotFallbackReason, TheGraphCannotFallbackReasonSchema, type TheGraphFallback, TheGraphFallbackSchema, type TokenId, TraceableENSProtocol, type TraceableRequest, type TraceableResponse, type TracingNode, type TracingSpan, type TracingTrace, TtlCache, type UnixTimestamp, type UnknownIdentity, type UnnamedIdentity, type UnresolvedIdentity, type Unvalidated, type UrlString, ZERO_ENCODED_REFERRER, accountIdEqual, addDuration, addPrices, addrReverseLabel, asLowerCaseAddress, beautifyName, bigIntToNumber, bigintToCoinType, buildAssetId, buildBlockNumberRange, buildBlockRefRange, buildCrossChainIndexingStatusSnapshotOmnichain, buildEncodedReferrer, buildEnsRainbowClientLabelSet, buildIndexedBlockranges, buildLabelSetId, buildLabelSetVersion, buildOmnichainIndexingStatusSnapshot, buildPageContext, buildUnresolvedIdentity, buildUnvalidatedCrossChainIndexingStatusSnapshot, buildUnvalidatedEnsIndexerPublicConfig, buildUnvalidatedOmnichainIndexingStatusSnapshot, buildUnvalidatedRealtimeIndexingStatusProjection, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted, coinTypeReverseLabel, coinTypeToEvmChainId, constructSubInterpretedName, createRealtimeIndexingStatusProjection, decodeDNSEncodedLiteralName, decodeDNSEncodedName, decodeEncodedReferrer, deserializeAssetId, deserializeBlockNumber, deserializeBlockRef, deserializeChainId, deserializeChainIndexingStatusSnapshot, deserializeConfigResponse, deserializeCrossChainIndexingStatusSnapshot, deserializeDatetime, deserializeDuration, deserializeENSApiPublicConfig, deserializeENSIndexerPublicConfig, deserializeEnsApiConfigResponse, deserializeEnsApiIndexingStatusResponse, deserializeEnsApiPublicConfig, deserializeEnsIndexerConfigResponse, deserializeEnsIndexerIndexingStatusResponse, deserializeEnsIndexerPublicConfig, deserializeErrorResponse, deserializeIndexingStatusResponse, deserializeOmnichainIndexingStatusSnapshot, deserializePriceDai, deserializePriceEth, deserializePriceUsdc, deserializeRealtimeIndexingStatusProjection, deserializeRegistrarActionsResponse, deserializeUnixTimestamp, deserializeUrl, deserializedNameTokensResponse, durationBetween, encodeLabelHash, encodedLabelToLabelhash, ensureInterpretedLabel, evmChainIdToCoinType, formatAccountId, formatAssetId, formatNFTTransferEventMetadata, getBasenamesSubregistryId, getBasenamesSubregistryManagedName, getCanonicalId, getCurrencyInfo, getDatasourceContract, getDefaultEnsNodeUrl, getENSv1Registry, getENSv2RootRegistry, getENSv2RootRegistryId, getEthnamesSubregistryId, getEthnamesSubregistryManagedName, getHighestKnownBlockTimestamp, getLatestIndexedBlockRef, getLineanamesSubregistryId, getLineanamesSubregistryManagedName, getNFTTransferType, getNameHierarchy, getNameTokenOwnership, getNameWrapperAccounts, getNamespaceSpecificValue, getOmnichainIndexingCursor, getOmnichainIndexingStatus, getParentNameFQDN, getResolvePrimaryNameChainIdParam, getTimestampForHighestOmnichainKnownBlock, getTimestampForLowestOmnichainStartBlock, hasGraphqlApiConfigSupport, hasNullByte, hasRegistrarActionsConfigSupport, hasRegistrarActionsIndexingStatusSupport, hasSubgraphApiConfigSupport, interpretAddress, interpretAddressRecordValue, interpretNameRecordValue, interpretTextRecordKey, interpretTextRecordValue, interpretTokenIdAsLabelHash, interpretTokenIdAsNode, interpretedLabelsToInterpretedName, interpretedLabelsToLabelHashPath, interpretedNameToInterpretedLabels, isENSv1Registry, isENSv2RootRegistry, isEncodedLabelHash, isHttpProtocol, isInterpetedLabel, isInterpretedName, isLabelHash, isNormalizedLabel, isNormalizedName, isPccFuseSet, isPriceCurrencyEqual, isPriceEqual, isRegistrarActionPricingAvailable, isRegistrarActionReferralAvailable, isRegistrationExpired, isRegistrationFullyExpired, isRegistrationInGracePeriod, isResolvedIdentity, isSelectionEmpty, isSubgraphCompatible, isWebSocketProtocol, labelHashToBytes, labelhashLiteralLabel, literalLabelToInterpretedLabel, literalLabelsToInterpretedName, literalLabelsToLiteralName, makeContractMatcher, makeENSApiPublicConfigSchema, makeENSv1DomainId, makeENSv2DomainId, makeEnsApiPublicConfigSchema, makePermissionsId, makePermissionsResourceId, makePermissionsUserId, makeRegistrationId, makeRegistryId, makeRenewalId, makeResolverId, makeResolverRecordsId, makeSerializedEnsApiPublicConfigSchema, makeSubdomainNode, maybeGetDatasourceContract, maybeGetENSv2RootRegistry, maybeGetENSv2RootRegistryId, mergeBlockNumberRanges, nameTokensPrerequisites, parseAccountId, parseAssetId, parseDai, parseEncodedLabelHash, parseEth, parseLabelHash, parseLabelHashOrEncodedLabelHash, parseNonNegativeInteger, parsePartialInterpretedName, parseReverseName, parseTimestamp, parseUsdc, priceDai, priceEth, priceUsdc, registrarActionsFilter, reverseName, scaleBigintByNumber, scalePrice, serializeAssetId, serializeChainId, serializeChainIndexingSnapshots, serializeConfigResponse, serializeCrossChainIndexingStatusSnapshot, serializeCrossChainIndexingStatusSnapshotOmnichain, serializeDatetime, serializeDomainAssetId, serializeENSApiPublicConfig, serializeENSIndexerPublicConfig, serializeEnsApiConfigResponse, serializeEnsApiIndexingStatusResponse, serializeEnsApiPublicConfig, serializeEnsIndexerConfigResponse, serializeEnsIndexerIndexingStatusResponse, serializeEnsIndexerPublicConfig, serializeIndexedChainIds, serializeIndexingStatusResponse, serializeNameToken, serializeNameTokensResponse, serializeNamedRegistrarAction, serializeOmnichainIndexingStatusSnapshot, serializePrice, serializePriceDai, serializePriceEth, serializePriceUsdc, serializeRealtimeIndexingStatusProjection, serializeRegisteredNameTokens, serializeRegistrarAction, serializeRegistrarActionPricing, serializeRegistrarActionsResponse, serializeUrl, sortChainStatusesByStartBlockAsc, stripNullBytes, translateDefaultableChainIdToChainId, uint256ToHex32, uniq, validateChainIndexingStatusSnapshot, validateCrossChainIndexingStatusSnapshot, validateEnsIndexerPublicConfig, validateEnsIndexerPublicConfigCompatibility, validateEnsIndexerVersionInfo, validateOmnichainIndexingStatusSnapshot, validateRealtimeIndexingStatusProjection, validateSupportedLabelSetAndVersion };
4813
+ export { ATTR_PROTOCOL_NAME, ATTR_PROTOCOL_STEP, ATTR_PROTOCOL_STEP_RESULT, type AcceleratableRequest, type AcceleratableResponse, type BlockNumber, type BlockNumberRange, type BlockNumberRangeBounded, type BlockNumberRangeLeftBounded, type BlockNumberRangeRightBounded, type BlockNumberRangeUnbounded, type BlockNumberRangeWithStartBlock, type BlockRef, type BlockRefRange, type BlockRefRangeBounded, type BlockRefRangeLeftBounded, type BlockRefRangeRightBounded, type BlockRefRangeUnbounded, type BlockRefRangeWithStartBlock, type Cache, type CachedResult, type ChainIndexingStatusId, ChainIndexingStatusIds, type ChainIndexingStatusSnapshot, type ChainIndexingStatusSnapshotBackfill, type ChainIndexingStatusSnapshotCompleted, type ChainIndexingStatusSnapshotFollowing, type ChainIndexingStatusSnapshotForOmnichainIndexingStatusSnapshotBackfill, type ChainIndexingStatusSnapshotQueued, ClientError, type CrossChainIndexingStatusSnapshot, type CrossChainIndexingStatusSnapshotOmnichain, type CrossChainIndexingStrategyId, CrossChainIndexingStrategyIds, type CurrencyAmount, type CurrencyId, CurrencyIds, type CurrencyInfo, DEFAULT_ENSNODE_URL_MAINNET, DEFAULT_ENSNODE_URL_SEPOLIA, type Datetime, type DeepPartial, type DomainAssetId, ENCODED_REFERRER_BYTE_LENGTH, ENCODED_REFERRER_BYTE_OFFSET, type ENSApiPublicConfig, type ENSIndexerPublicConfig, type ENSIndexerVersionInfo, EXPECTED_ENCODED_REFERRER_PADDING, type EncodedReferrer, type EnsApiIndexingStatusRequest, type EnsApiIndexingStatusResponse, type EnsApiIndexingStatusResponseCode, EnsApiIndexingStatusResponseCodes, type EnsApiIndexingStatusResponseError, type EnsApiIndexingStatusResponseOk, type EnsApiPublicConfig, type EnsApiVersionInfo, type EnsDbPublicConfig, type EnsDbVersionInfo, EnsIndexerClient, type EnsIndexerClientOptions, type EnsIndexerConfigResponse, type EnsIndexerIndexingStatusRequest, type EnsIndexerIndexingStatusResponse, type EnsIndexerIndexingStatusResponseCode, EnsIndexerIndexingStatusResponseCodes, type EnsIndexerIndexingStatusResponseError, type EnsIndexerIndexingStatusResponseOk, type EnsIndexerPublicConfig, type EnsIndexerPublicConfigCompatibilityCheck, type EnsIndexerVersionInfo, EnsNodeClient, type EnsNodeClientOptions, type EnsNodeStackInfo, type EnsRainbowClientLabelSet, type EnsRainbowPublicConfig, type EnsRainbowServerLabelSet, type ErrorResponse, type ForwardResolutionArgs, ForwardResolutionProtocolStep, type ForwardResolutionResult, type Identity, type IndexingStatusRequest, type IndexingStatusResponse, type IndexingStatusResponseCode, IndexingStatusResponseCodes, type IndexingStatusResponseError, type IndexingStatusResponseOk, type LabelSetId, type LabelSetVersion, LruCache, type MultichainPrimaryNameResolutionArgs, type MultichainPrimaryNameResolutionResult, type NFTMintStatus, NFTMintStatuses, type NFTTransferEventMetadata, type NFTTransferType, NFTTransferTypes, type NameToken, type NameTokenOwnership, type NameTokenOwnershipBurned, type NameTokenOwnershipFullyOnchain, type NameTokenOwnershipNameWrapper, type NameTokenOwnershipType, NameTokenOwnershipTypes, type NameTokenOwnershipUnknown, type NameTokensRequest, type NameTokensResponse, type NameTokensResponseCode, NameTokensResponseCodes, type NameTokensResponseError, type NameTokensResponseErrorCode, NameTokensResponseErrorCodes, type NameTokensResponseErrorEnsIndexerConfigUnsupported, type NameTokensResponseErrorIndexingStatusUnsupported, type NameTokensResponseErrorNameTokensNotIndexed, type NameTokensResponseOk, type NamedIdentity, type NamedRegistrarAction, type NamespaceSpecificValue, type OmnichainIndexingStatusId, OmnichainIndexingStatusIds, type OmnichainIndexingStatusSnapshot, type OmnichainIndexingStatusSnapshotBackfill, type OmnichainIndexingStatusSnapshotCompleted, type OmnichainIndexingStatusSnapshotFollowing, type OmnichainIndexingStatusSnapshotUnstarted, PROTOCOL_ATTRIBUTE_PREFIX, PluginName, type PrerequisiteResult, type Price, type PriceDai, type PriceEth, type PriceUsdc, RECORDS_PER_PAGE_DEFAULT, RECORDS_PER_PAGE_MAX, type RangeType, RangeTypeIds, type RealtimeIndexingStatusProjection, type RegisteredNameTokens, type RegistrarAction, type RegistrarActionEventId, type RegistrarActionPricing, type RegistrarActionPricingAvailable, type RegistrarActionPricingUnknown, type RegistrarActionReferral, type RegistrarActionReferralAvailable, type RegistrarActionReferralNotApplicable, type RegistrarActionType, RegistrarActionTypes, type RegistrarActionsFilter, type RegistrarActionsFilterBeginTimestamp, type RegistrarActionsFilterByDecodedReferrer, type RegistrarActionsFilterBySubregistryNode, type RegistrarActionsFilterEndTimestamp, type RegistrarActionsFilterType, RegistrarActionsFilterTypes, type RegistrarActionsFilterWithEncodedReferral, type RegistrarActionsOrder, RegistrarActionsOrders, type RegistrarActionsRequest, type RegistrarActionsResponse, type RegistrarActionsResponseCode, RegistrarActionsResponseCodes, type RegistrarActionsResponseError, type RegistrarActionsResponseOk, type RegistrationExpiryInfo, type RegistrationLifecycle, type RegistrationLifecycleStage, type RequestPageParams, type RequiredAndNotNull, type ResolutionStatusId, ResolutionStatusIds, type ResolvePrimaryNameRequest, type ResolvePrimaryNameResponse, type ResolvePrimaryNamesRequest, type ResolvePrimaryNamesResponse, type ResolveRecordsRequest, type ResolveRecordsResponse, type ResolvedIdentity, type ResolverRecordsResponse, type ResolverRecordsResponseBase, type ResolverRecordsSelection, type ResponsePageContext, type ResponsePageContextWithNoRecords, type ResponsePageContextWithRecords, type ReverseResolutionArgs, ReverseResolutionProtocolStep, type ReverseResolutionResult, type RpcUrl, SWRCache, type SWRCacheOptions, type SerializedAssetId, type SerializedChainIndexingStatusSnapshot, type SerializedChainIndexingStatusSnapshotBackfill, type SerializedChainIndexingStatusSnapshotCompleted, type SerializedChainIndexingStatusSnapshotFollowing, type SerializedChainIndexingStatusSnapshotQueued, type SerializedCrossChainIndexingStatusSnapshot, type SerializedCrossChainIndexingStatusSnapshotOmnichain, type SerializedCurrencyAmount, type SerializedCurrentIndexingProjectionOmnichain, type SerializedDomainAssetId, type SerializedENSApiPublicConfig, type SerializedENSIndexerPublicConfig, type SerializedENSIndexerVersionInfo, type SerializedEnsApiIndexingStatusResponse, type SerializedEnsApiIndexingStatusResponseError, type SerializedEnsApiIndexingStatusResponseOk, type SerializedEnsApiPublicConfig, type SerializedEnsDbPublicConfig, type SerializedEnsIndexerConfigResponse, type SerializedEnsIndexerIndexingStatusResponse, type SerializedEnsIndexerIndexingStatusResponseError, type SerializedEnsIndexerIndexingStatusResponseOk, type SerializedEnsIndexerPublicConfig, type SerializedEnsIndexerVersionInfo, type SerializedEnsNodeStackInfo, type SerializedEnsRainbowPublicConfig, type SerializedIndexedChainIds, type SerializedIndexingStatusResponse, type SerializedIndexingStatusResponseError, type SerializedIndexingStatusResponseOk, type SerializedNameToken, type SerializedNameTokensResponse, type SerializedNameTokensResponseError, type SerializedNameTokensResponseOk, type SerializedNamedRegistrarAction, type SerializedOmnichainIndexingStatusSnapshot, type SerializedOmnichainIndexingStatusSnapshotBackfill, type SerializedOmnichainIndexingStatusSnapshotCompleted, type SerializedOmnichainIndexingStatusSnapshotFollowing, type SerializedOmnichainIndexingStatusSnapshotUnstarted, type SerializedPrice, type SerializedPriceDai, type SerializedPriceEth, type SerializedPriceUsdc, type SerializedRealtimeIndexingStatusProjection, type SerializedRegisteredNameTokens, type SerializedRegistrarAction, type SerializedRegistrarActionPricing, type SerializedRegistrarActionPricingAvailable, type SerializedRegistrarActionPricingUnknown, type SerializedRegistrarActionsResponse, type SerializedRegistrarActionsResponseError, type SerializedRegistrarActionsResponseOk, type SerializedTokenId, type Subregistry, type TheGraphCannotFallbackReason, TheGraphCannotFallbackReasonSchema, type TheGraphFallback, TheGraphFallbackSchema, TraceableENSProtocol, type TraceableRequest, type TraceableResponse, type TracingNode, type TracingSpan, type TracingTrace, TtlCache, type UnknownIdentity, type UnnamedIdentity, type UnresolvedIdentity, type Unvalidated, ZERO_ENCODED_REFERRER, accountIdEqual, addDuration, addPrices, bigIntToNumber, buildAssetId, buildBlockNumberRange, buildBlockRefRange, buildCrossChainIndexingStatusSnapshotOmnichain, buildEncodedReferrer, buildEnsNodeStackInfo, buildEnsRainbowClientLabelSet, buildIndexedBlockranges, buildLabelSetId, buildLabelSetVersion, buildOmnichainIndexingStatusSnapshot, buildPageContext, buildUnresolvedIdentity, buildUnvalidatedCrossChainIndexingStatusSnapshot, buildUnvalidatedEnsApiPublicConfig, buildUnvalidatedEnsIndexerPublicConfig, buildUnvalidatedEnsNodeStackInfo, buildUnvalidatedOmnichainIndexingStatusSnapshot, buildUnvalidatedRealtimeIndexingStatusProjection, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted, createRealtimeIndexingStatusProjection, decodeEncodedReferrer, deserializeAssetId, deserializeBlockNumber, deserializeBlockRef, deserializeChainId, deserializeChainIndexingStatusSnapshot, deserializeCrossChainIndexingStatusSnapshot, deserializeDatetime, deserializeDuration, deserializeENSApiPublicConfig, deserializeENSIndexerPublicConfig, deserializeEnsApiIndexingStatusResponse, deserializeEnsApiPublicConfig, deserializeEnsIndexerConfigResponse, deserializeEnsIndexerIndexingStatusResponse, deserializeEnsIndexerPublicConfig, deserializeEnsNodeStackInfo, deserializeErrorResponse, deserializeIndexingStatusResponse, deserializeOmnichainIndexingStatusSnapshot, deserializePriceDai, deserializePriceEth, deserializePriceUsdc, deserializeRealtimeIndexingStatusProjection, deserializeRegistrarActionsResponse, deserializeUnixTimestamp, deserializeUrl, deserializedNameTokensResponse, durationBetween, formatNFTTransferEventMetadata, getBasenamesSubregistryId, getBasenamesSubregistryManagedName, getCurrencyInfo, getDatasourceContract, getDefaultEnsNodeUrl, getENSv1Registry, getENSv2RootRegistry, getENSv2RootRegistryId, getEthnamesSubregistryId, getEthnamesSubregistryManagedName, getHighestKnownBlockTimestamp, getLatestIndexedBlockRef, getLineanamesSubregistryId, getLineanamesSubregistryManagedName, getNFTTransferType, getNameTokenOwnership, getNameWrapperAccounts, getNamespaceSpecificValue, getOmnichainIndexingCursor, getOmnichainIndexingStatus, getResolvePrimaryNameChainIdParam, getTimestampForHighestOmnichainKnownBlock, getTimestampForLowestOmnichainStartBlock, hasNullByte, hasOmnigraphApiConfigSupport, hasRegistrarActionsConfigSupport, hasRegistrarActionsIndexingStatusSupport, hasSubgraphApiConfigSupport, interpretAddress, interpretAddressRecordValue, interpretContenthashValue, interpretDnszonehashValue, interpretNameRecordValue, interpretPubkeyValue, interpretTextRecordKey, interpretTextRecordValue, isENSv1Registry, isENSv2RootRegistry, isHttpProtocol, isPccFuseSet, isPriceCurrencyEqual, isPriceEqual, isRegistrarActionPricingAvailable, isRegistrarActionReferralAvailable, isRegistrationExpired, isRegistrationFullyExpired, isRegistrationInGracePeriod, isResolvedIdentity, isSelectionEmpty, isSubgraphCompatible, isWebSocketProtocol, labelHashToBytes, makeContractMatcher, makeENSApiPublicConfigSchema, makeEnsApiPublicConfigSchema, makeSerializedEnsApiPublicConfigSchema, maybeGetDatasourceContract, maybeGetENSv2RootRegistry, maybeGetENSv2RootRegistryId, mergeBlockNumberRanges, nameTokensPrerequisites, parseAccountId, parseAssetId, parseDai, parseEth, parseNonNegativeInteger, parseTimestamp, parseUsdc, priceDai, priceEth, priceUsdc, registrarActionsFilter, scaleBigintByNumber, scalePrice, serializeAssetId, serializeChainId, serializeChainIndexingSnapshots, serializeCrossChainIndexingStatusSnapshot, serializeCrossChainIndexingStatusSnapshotOmnichain, serializeDatetime, serializeDomainAssetId, serializeENSApiPublicConfig, serializeENSIndexerPublicConfig, serializeEnsApiIndexingStatusResponse, serializeEnsApiPublicConfig, serializeEnsIndexerConfigResponse, serializeEnsIndexerIndexingStatusResponse, serializeEnsIndexerPublicConfig, serializeEnsNodeStackInfo, serializeIndexedChainIds, serializeIndexingStatusResponse, serializeNameToken, serializeNameTokensResponse, serializeNamedRegistrarAction, serializeOmnichainIndexingStatusSnapshot, serializePrice, serializePriceDai, serializePriceEth, serializePriceUsdc, serializeRealtimeIndexingStatusProjection, serializeRegisteredNameTokens, serializeRegistrarAction, serializeRegistrarActionPricing, serializeRegistrarActionsResponse, serializeUrl, sortChainStatusesByStartBlockAsc, stripNullBytes, translateDefaultableChainIdToChainId, uniq, validateChainIndexingStatusSnapshot, validateCrossChainIndexingStatusSnapshot, validateEnsIndexerPublicConfig, validateEnsIndexerPublicConfigCompatibility, validateEnsIndexerVersionInfo, validateOmnichainIndexingStatusSnapshot, validateRealtimeIndexingStatusProjection, validateSupportedLabelSetAndVersion };