@ensnode/ensnode-sdk 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +385 -39
- package/dist/index.js +364 -46
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { Hex, Address } from 'viem';
|
|
1
|
+
import { Hex, Address, ByteArray } from 'viem';
|
|
2
|
+
import * as _ensdomains_address_encoder from '@ensdomains/address-encoder';
|
|
2
3
|
import { CoinType, EvmCoinType } from '@ensdomains/address-encoder';
|
|
3
4
|
export { CoinType, EvmCoinType } from '@ensdomains/address-encoder';
|
|
4
5
|
import { ENSNamespaceId } from '@ensnode/datasources';
|
|
5
6
|
export { ENSNamespaceId, ENSNamespaceIds } from '@ensnode/datasources';
|
|
7
|
+
import z from 'zod/v4';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* A hash value that uniquely identifies a single ENS name.
|
|
@@ -43,6 +45,9 @@ type Label = string;
|
|
|
43
45
|
type EncodedLabelHash = `[${string}]`;
|
|
44
46
|
|
|
45
47
|
declare const ROOT_NODE: Node;
|
|
48
|
+
declare const ETH_NODE: `0x${string}`;
|
|
49
|
+
declare const BASENAMES_NODE: `0x${string}`;
|
|
50
|
+
declare const LINEANAMES_NODE: `0x${string}`;
|
|
46
51
|
/**
|
|
47
52
|
* A set of nodes whose children are used for reverse resolution.
|
|
48
53
|
*
|
|
@@ -77,7 +82,7 @@ declare const maybeHealLabelByReverseAddress: ({ maybeReverseAddress, labelHash,
|
|
|
77
82
|
* into Node or LabelHash, which is a common behavior in the ENS ecosystem.
|
|
78
83
|
* (see NameWrapper, ETHRegistrarController)
|
|
79
84
|
*/
|
|
80
|
-
declare const uint256ToHex32: (num: bigint) =>
|
|
85
|
+
declare const uint256ToHex32: (num: bigint) => Hex;
|
|
81
86
|
/**
|
|
82
87
|
* Check if any characters in `label` are "unindexable".
|
|
83
88
|
*
|
|
@@ -158,6 +163,15 @@ declare const uniq: <T>(arr: T[]) => T[];
|
|
|
158
163
|
* Guaranteed to be a positive integer.
|
|
159
164
|
**/
|
|
160
165
|
type ChainId = number;
|
|
166
|
+
/**
|
|
167
|
+
* Represents an account (contract or EOA) at `address` on chain `chainId`.
|
|
168
|
+
*
|
|
169
|
+
* @see https://chainagnostic.org/CAIPs/caip-10
|
|
170
|
+
*/
|
|
171
|
+
interface AccountId {
|
|
172
|
+
chainId: ChainId;
|
|
173
|
+
address: Address;
|
|
174
|
+
}
|
|
161
175
|
/**
|
|
162
176
|
* Block Number
|
|
163
177
|
*
|
|
@@ -286,6 +300,11 @@ declare function deserializeDuration(maybeDuration: string, valueLabel?: string)
|
|
|
286
300
|
|
|
287
301
|
declare function isNormalized(name: Name): boolean;
|
|
288
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Determines where the provided AccountId values represent the same address on the same chain.
|
|
305
|
+
*/
|
|
306
|
+
declare const accountIdEqual: (a: AccountId, b: AccountId) => boolean;
|
|
307
|
+
|
|
289
308
|
/**
|
|
290
309
|
* The ETH coinType.
|
|
291
310
|
*
|
|
@@ -376,6 +395,57 @@ declare function parseReverseName(name: Name): {
|
|
|
376
395
|
coinType: CoinType;
|
|
377
396
|
} | null;
|
|
378
397
|
|
|
398
|
+
/**
|
|
399
|
+
* A label set ID identifies a set of labels that can be used for deterministic healing.
|
|
400
|
+
* A label set allows clients to deterministically heal their state against a server,
|
|
401
|
+
* ensuring that both are operating on the same version of data.
|
|
402
|
+
*
|
|
403
|
+
* It is guaranteed to be 1 to 50 characters long and contain only lowercase letters (a-z)
|
|
404
|
+
* and hyphens (-).
|
|
405
|
+
*/
|
|
406
|
+
type LabelSetId = string;
|
|
407
|
+
/**
|
|
408
|
+
* A label set version identifies a specific version of a label set. It allows clients to
|
|
409
|
+
* request data from a specific snapshot in time, ensuring deterministic results.
|
|
410
|
+
*
|
|
411
|
+
* It is guaranteed to be a non-negative integer.
|
|
412
|
+
*/
|
|
413
|
+
type LabelSetVersion = number;
|
|
414
|
+
/**
|
|
415
|
+
* The label set preferences of an ENSRainbow client.
|
|
416
|
+
*/
|
|
417
|
+
interface EnsRainbowClientLabelSet {
|
|
418
|
+
/**
|
|
419
|
+
* Optional label set ID that the ENSRainbow server is expected to use. If provided, heal
|
|
420
|
+
* operations will validate the ENSRainbow server is using this labelSetId.
|
|
421
|
+
* Required if `labelSetVersion` is defined.
|
|
422
|
+
*/
|
|
423
|
+
labelSetId?: LabelSetId;
|
|
424
|
+
/**
|
|
425
|
+
* Optional highest label set version of label set id to query. Enables deterministic heal
|
|
426
|
+
* results across time even if the ENSRainbow server ingests label sets with greater versions
|
|
427
|
+
* than this value. If provided, only labels from label sets with versions less than or equal to this
|
|
428
|
+
* value will be returned. If not provided, the server will use the latest available version.
|
|
429
|
+
* When `labelSetVersion` is defined, `labelSetId` must also be defined.
|
|
430
|
+
*/
|
|
431
|
+
labelSetVersion?: LabelSetVersion;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* The state of label sets managed by an ENSRainbow server.
|
|
435
|
+
*/
|
|
436
|
+
interface EnsRainbowServerLabelSet {
|
|
437
|
+
/**
|
|
438
|
+
* The LabelSetId managed by the ENSRainbow server.
|
|
439
|
+
*/
|
|
440
|
+
labelSetId: LabelSetId;
|
|
441
|
+
/**
|
|
442
|
+
* The highest label set version available on the ENSRainbow server for the current
|
|
443
|
+
* label set ID. This represents the most recent version of the label set that the
|
|
444
|
+
* server has ingested and can provide label healing results for.
|
|
445
|
+
*/
|
|
446
|
+
highestLabelSetVersion: LabelSetVersion;
|
|
447
|
+
}
|
|
448
|
+
|
|
379
449
|
/**
|
|
380
450
|
* A PluginName is a unique id for a 'plugin': we use the notion of
|
|
381
451
|
* 'plugins' to describe bundles of indexing logic.
|
|
@@ -386,7 +456,8 @@ declare enum PluginName {
|
|
|
386
456
|
Lineanames = "lineanames",
|
|
387
457
|
ThreeDNS = "threedns",
|
|
388
458
|
ReverseResolvers = "reverse-resolvers",
|
|
389
|
-
Referrals = "referrals"
|
|
459
|
+
Referrals = "referrals",
|
|
460
|
+
TokenScope = "tokenscope"
|
|
390
461
|
}
|
|
391
462
|
/**
|
|
392
463
|
* Information about ENSIndexer's dependencies.
|
|
@@ -432,6 +503,10 @@ interface ENSIndexerPublicConfig {
|
|
|
432
503
|
* state about the ENSNode instance.
|
|
433
504
|
*/
|
|
434
505
|
ensNodePublicUrl: URL;
|
|
506
|
+
/**
|
|
507
|
+
* 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.
|
|
508
|
+
*/
|
|
509
|
+
labelSet: Required<EnsRainbowClientLabelSet>;
|
|
435
510
|
/**
|
|
436
511
|
* A Postgres database schema name. This instance of ENSIndexer will write
|
|
437
512
|
* indexed data to the tables in this schema.
|
|
@@ -532,7 +607,7 @@ declare function deserializeENSIndexerPublicConfig(maybeConfig: SerializedENSInd
|
|
|
532
607
|
* Tells if indexer config guarantees data to be indexed while
|
|
533
608
|
* maintaining full subgraph-compatibility.
|
|
534
609
|
*/
|
|
535
|
-
declare function isSubgraphCompatible(config: Pick<ENSIndexerPublicConfig, "plugins" | "healReverseAddresses" | "indexAdditionalResolverRecords">): boolean;
|
|
610
|
+
declare function isSubgraphCompatible(config: Pick<ENSIndexerPublicConfig, "plugins" | "healReverseAddresses" | "indexAdditionalResolverRecords" | "labelSet">): boolean;
|
|
536
611
|
|
|
537
612
|
/**
|
|
538
613
|
* Serializes a {@link ChainConfig} object.
|
|
@@ -543,6 +618,159 @@ declare function serializeIndexedChainIds(indexedChainIds: Set<ChainId>): Serial
|
|
|
543
618
|
*/
|
|
544
619
|
declare function serializeENSIndexerPublicConfig(config: ENSIndexerPublicConfig): SerializedENSIndexerPublicConfig;
|
|
545
620
|
|
|
621
|
+
/**
|
|
622
|
+
* All zod schemas we define must remain internal implementation details.
|
|
623
|
+
* We want the freedom to move away from zod in the future without impacting
|
|
624
|
+
* any users of the ensnode-sdk package.
|
|
625
|
+
*
|
|
626
|
+
* The only way to share Zod schemas is to re-export them from
|
|
627
|
+
* `./src/internal.ts` file.
|
|
628
|
+
*/
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Zod `.check()` function input.
|
|
632
|
+
*/
|
|
633
|
+
type ZodCheckFnInput<T> = z.core.ParsePayload<T>;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* All zod schemas we define must remain internal implementation details.
|
|
637
|
+
* We want the freedom to move away from zod in the future without impacting
|
|
638
|
+
* any users of the ensnode-sdk package.
|
|
639
|
+
*
|
|
640
|
+
* The only way to share Zod schemas is to re-export them from
|
|
641
|
+
* `./src/internal.ts` file.
|
|
642
|
+
*/
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Makes a schema for parsing {@link IndexedChainIds}.
|
|
646
|
+
*/
|
|
647
|
+
declare const makeIndexedChainIdsSchema: (valueLabel?: string) => z.ZodPipe<z.ZodArray<z.ZodInt>, z.ZodTransform<Set<number>, number[]>>;
|
|
648
|
+
/**
|
|
649
|
+
* Makes a schema for parsing a list of {@link PluginName} items.
|
|
650
|
+
*
|
|
651
|
+
* The list is guaranteed to include at least one item exists, and no duplicates.
|
|
652
|
+
*/
|
|
653
|
+
declare const makePluginsListSchema: (valueLabel?: string) => z.ZodArray<z.ZodEnum<typeof PluginName>>;
|
|
654
|
+
/**
|
|
655
|
+
* Makes a schema for parsing a name for a database schema.
|
|
656
|
+
*
|
|
657
|
+
* The name is guaranteed to be a non-empty string.
|
|
658
|
+
*/
|
|
659
|
+
declare const makeDatabaseSchemaNameSchema: (valueLabel?: string) => z.ZodString;
|
|
660
|
+
/**
|
|
661
|
+
* Makes a schema for parsing a label set ID.
|
|
662
|
+
*
|
|
663
|
+
* The label set ID is guaranteed to be a string between 1-50 characters
|
|
664
|
+
* containing only lowercase letters (a-z) and hyphens (-).
|
|
665
|
+
*
|
|
666
|
+
* @param valueLabel - The label to use in error messages (e.g., "Label set ID", "LABEL_SET_ID")
|
|
667
|
+
*/
|
|
668
|
+
declare const makeLabelSetIdSchema: (valueLabel: string) => z.ZodString;
|
|
669
|
+
/**
|
|
670
|
+
* Makes a schema for parsing a label set version.
|
|
671
|
+
*
|
|
672
|
+
* The label set version is guaranteed to be a non-negative integer.
|
|
673
|
+
*
|
|
674
|
+
* @param valueLabel - The label to use in error messages (e.g., "Label set version", "LABEL_SET_VERSION")
|
|
675
|
+
|
|
676
|
+
*/
|
|
677
|
+
declare const makeLabelSetVersionSchema: (valueLabel: string) => z.ZodPipe<z.coerce.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
678
|
+
/**
|
|
679
|
+
* Makes a schema for parsing a label set where both label set ID and label set version are required.
|
|
680
|
+
*
|
|
681
|
+
* @param valueLabel - The label to use in error messages (e.g., "Label set", "LABEL_SET")
|
|
682
|
+
*/
|
|
683
|
+
declare const makeFullyPinnedLabelSetSchema: (valueLabel?: string) => z.ZodObject<{
|
|
684
|
+
labelSetId: z.ZodString;
|
|
685
|
+
labelSetVersion: z.ZodPipe<z.coerce.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
686
|
+
}, z.core.$strip>;
|
|
687
|
+
declare const makeDependencyInfoSchema: (valueLabel?: string) => z.ZodObject<{
|
|
688
|
+
nodejs: z.ZodString;
|
|
689
|
+
ponder: z.ZodString;
|
|
690
|
+
ensRainbow: z.ZodString;
|
|
691
|
+
ensRainbowSchema: z.ZodInt;
|
|
692
|
+
}, z.core.$strict>;
|
|
693
|
+
declare function invariant_reverseResolversPluginNeedsResolverRecords(ctx: ZodCheckFnInput<Pick<ENSIndexerPublicConfig, "plugins" | "indexAdditionalResolverRecords">>): void;
|
|
694
|
+
declare function invariant_isSubgraphCompatibleRequirements(ctx: ZodCheckFnInput<Pick<ENSIndexerPublicConfig, "plugins" | "isSubgraphCompatible" | "healReverseAddresses" | "indexAdditionalResolverRecords" | "labelSet">>): void;
|
|
695
|
+
/**
|
|
696
|
+
* ENSIndexer Public Config Schema
|
|
697
|
+
*
|
|
698
|
+
* Makes a Zod schema definition for validating all important settings used
|
|
699
|
+
* during runtime of the ENSIndexer instance.
|
|
700
|
+
*/
|
|
701
|
+
declare const makeENSIndexerPublicConfigSchema: (valueLabel?: string) => z.ZodObject<{
|
|
702
|
+
ensAdminUrl: z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>;
|
|
703
|
+
ensNodePublicUrl: z.ZodPipe<z.ZodURL, z.ZodTransform<URL, string>>;
|
|
704
|
+
labelSet: z.ZodObject<{
|
|
705
|
+
labelSetId: z.ZodString;
|
|
706
|
+
labelSetVersion: z.ZodPipe<z.coerce.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
707
|
+
}, z.core.$strip>;
|
|
708
|
+
healReverseAddresses: z.ZodBoolean;
|
|
709
|
+
indexAdditionalResolverRecords: z.ZodBoolean;
|
|
710
|
+
indexedChainIds: z.ZodPipe<z.ZodArray<z.ZodInt>, z.ZodTransform<Set<number>, number[]>>;
|
|
711
|
+
isSubgraphCompatible: z.ZodBoolean;
|
|
712
|
+
namespace: z.ZodEnum<{
|
|
713
|
+
readonly Mainnet: "mainnet";
|
|
714
|
+
readonly Sepolia: "sepolia";
|
|
715
|
+
readonly Holesky: "holesky";
|
|
716
|
+
readonly EnsTestEnv: "ens-test-env";
|
|
717
|
+
}>;
|
|
718
|
+
plugins: z.ZodArray<z.ZodEnum<typeof PluginName>>;
|
|
719
|
+
databaseSchemaName: z.ZodString;
|
|
720
|
+
dependencyInfo: z.ZodObject<{
|
|
721
|
+
nodejs: z.ZodString;
|
|
722
|
+
ponder: z.ZodString;
|
|
723
|
+
ensRainbow: z.ZodString;
|
|
724
|
+
ensRainbowSchema: z.ZodInt;
|
|
725
|
+
}, z.core.$strict>;
|
|
726
|
+
}, z.core.$strip>;
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Builds a valid LabelSetId from a string.
|
|
730
|
+
* @param maybeLabelSetId - The string to validate and convert to a LabelSetId.
|
|
731
|
+
* @returns A valid LabelSetId.
|
|
732
|
+
* @throws If the input string is not a valid LabelSetId.
|
|
733
|
+
*/
|
|
734
|
+
declare function buildLabelSetId(maybeLabelSetId: string): LabelSetId;
|
|
735
|
+
/**
|
|
736
|
+
* Builds a valid LabelSetVersion from a number or string.
|
|
737
|
+
* @param maybeLabelSetVersion - The number or string to validate and convert to a LabelSetVersion.
|
|
738
|
+
* @returns A valid LabelSetVersion.
|
|
739
|
+
* @throws If the input is not a valid LabelSetVersion.
|
|
740
|
+
*/
|
|
741
|
+
declare function buildLabelSetVersion(maybeLabelSetVersion: number | string): LabelSetVersion;
|
|
742
|
+
/**
|
|
743
|
+
* Builds an EnsRainbowClientLabelSet.
|
|
744
|
+
* @param labelSetId - The label set ID.
|
|
745
|
+
* @param labelSetVersion - The label set version.
|
|
746
|
+
* @returns A valid EnsRainbowClientLabelSet object.
|
|
747
|
+
* @throws If `labelSetVersion` is defined without `labelSetId`.
|
|
748
|
+
*/
|
|
749
|
+
declare function buildEnsRainbowClientLabelSet(labelSetId?: LabelSetId, labelSetVersion?: LabelSetVersion): EnsRainbowClientLabelSet;
|
|
750
|
+
/**
|
|
751
|
+
* Validates that the server's label set is compatible with the client's requested label set.
|
|
752
|
+
* @param serverSet - The label set provided by the server.
|
|
753
|
+
* @param clientSet - The label set requested by the client.
|
|
754
|
+
* @throws If the server set is not compatible with the client set.
|
|
755
|
+
*/
|
|
756
|
+
declare function validateSupportedLabelSetAndVersion(serverSet: EnsRainbowServerLabelSet, clientSet: EnsRainbowClientLabelSet): void;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Converts a Labelhash to bytes, with validation
|
|
760
|
+
* @param labelHash The Labelhash to convert
|
|
761
|
+
* @returns A ByteArray containing the bytes
|
|
762
|
+
* @throws Error if `labelHash` is not a valid 32-byte hex string
|
|
763
|
+
*/
|
|
764
|
+
declare function labelHashToBytes(labelHash: LabelHash): ByteArray;
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Parses a string into a non-negative integer.
|
|
768
|
+
* @param input The string to parse
|
|
769
|
+
* @returns The parsed non-negative integer
|
|
770
|
+
* @throws Error if the input is not a valid non-negative integer
|
|
771
|
+
*/
|
|
772
|
+
declare function parseNonNegativeInteger(maybeNumber: string): number;
|
|
773
|
+
|
|
546
774
|
declare const ChainIndexingStatusIds: {
|
|
547
775
|
readonly Unstarted: "unstarted";
|
|
548
776
|
readonly Backfill: "backfill";
|
|
@@ -658,7 +886,8 @@ interface ChainIndexingUnstartedStatus {
|
|
|
658
886
|
*
|
|
659
887
|
* Invariants:
|
|
660
888
|
* - `config.startBlock` is always before or the same as `latestIndexedBlock`
|
|
661
|
-
* - `latestIndexedBlock` is always before or the same as `
|
|
889
|
+
* - `latestIndexedBlock` is always before or the same as `latestSyncedBlock`
|
|
890
|
+
* - `latestSyncedBlock` is always before or the same as `backfillEndBlock`
|
|
662
891
|
* - `backfillEndBlock` is the same as `config.endBlock` if and only if
|
|
663
892
|
* the config is definite.
|
|
664
893
|
*/
|
|
@@ -669,6 +898,11 @@ interface ChainIndexingBackfillStatus {
|
|
|
669
898
|
* The block that was most recently indexed.
|
|
670
899
|
*/
|
|
671
900
|
latestIndexedBlock: BlockRef;
|
|
901
|
+
/**
|
|
902
|
+
* The "highest" block that has been synced into RPC cache. Backfill indexing
|
|
903
|
+
* is accelerated by cached RPC calls through this block height.
|
|
904
|
+
*/
|
|
905
|
+
latestSyncedBlock: BlockRef;
|
|
672
906
|
/**
|
|
673
907
|
* The block that is the target for finishing the backfill.
|
|
674
908
|
*/
|
|
@@ -935,6 +1169,16 @@ declare function getOverallIndexingStatus(chains: ChainIndexingStatus[]): Exclud
|
|
|
935
1169
|
* @throws an error if none of the indexed chains was in the 'following' status.
|
|
936
1170
|
*/
|
|
937
1171
|
declare function getOverallApproxRealtimeDistance(chains: ChainIndexingStatus[]): Duration;
|
|
1172
|
+
/**
|
|
1173
|
+
* Get lowest of the highest end block across all chains which status is
|
|
1174
|
+
* {@link ChainIndexingStatus}.
|
|
1175
|
+
*/
|
|
1176
|
+
declare function getTimestampForLowestOmnichainStartBlock(chains: ChainIndexingStatus[]): UnixTimestamp;
|
|
1177
|
+
/**
|
|
1178
|
+
* Get timestamp of the highest known block across all chains which status is
|
|
1179
|
+
* {@link ChainIndexingStatusForBackfillOverallStatus}.
|
|
1180
|
+
*/
|
|
1181
|
+
declare function getTimestampForHighestOmnichainKnownBlock(chains: ChainIndexingStatus[]): UnixTimestamp;
|
|
938
1182
|
/**
|
|
939
1183
|
* Get Omnichain Indexing Cursor across all chains which status is
|
|
940
1184
|
* {@link ChainIndexingActiveStatus}.
|
|
@@ -991,6 +1235,11 @@ declare function checkChainIndexingStatusesForCompletedOverallStatus(chains: Cha
|
|
|
991
1235
|
* - Any other chain can have any status.
|
|
992
1236
|
*/
|
|
993
1237
|
declare function checkChainIndexingStatusesForFollowingOverallStatus(chains: ChainIndexingStatus[]): chains is ChainIndexingStatus[];
|
|
1238
|
+
/**
|
|
1239
|
+
* Sort a list of [{@link ChainId}, {@link ChainIndexingStatus}] tuples
|
|
1240
|
+
* by the omnichain start block timestamp in ascending order.
|
|
1241
|
+
*/
|
|
1242
|
+
declare function sortAscChainStatusesByStartBlock<ChainStatusType extends ChainIndexingStatus>(chains: [ChainId, ChainStatusType][]): [ChainId, ChainStatusType][];
|
|
994
1243
|
|
|
995
1244
|
/**
|
|
996
1245
|
* Serialize chain indexing statuses.
|
|
@@ -1012,7 +1261,7 @@ declare enum TraceableENSProtocol {
|
|
|
1012
1261
|
* Encodes the set of well-known steps in the ENS Forward Resolution protocol.
|
|
1013
1262
|
*/
|
|
1014
1263
|
declare enum ForwardResolutionProtocolStep {
|
|
1015
|
-
Operation = "
|
|
1264
|
+
Operation = "forward-resolution",
|
|
1016
1265
|
FindResolver = "find-resolver",
|
|
1017
1266
|
ActiveResolverExists = "active-resolver-exists",
|
|
1018
1267
|
AccelerateENSIP19ReverseResolver = "accelerate-ensip-19-reverse-resolver",
|
|
@@ -1025,43 +1274,46 @@ declare enum ForwardResolutionProtocolStep {
|
|
|
1025
1274
|
* Encodes the set of well-known steps in the ENS Reverse Resolution protocol.
|
|
1026
1275
|
*/
|
|
1027
1276
|
declare enum ReverseResolutionProtocolStep {
|
|
1028
|
-
Operation = "
|
|
1277
|
+
Operation = "reverse-resolution",
|
|
1029
1278
|
ResolveReverseName = "resolve-reverse-name",
|
|
1030
1279
|
NameRecordExists = "name-record-exists-check",
|
|
1031
1280
|
ForwardResolveAddressRecord = "forward-resolve-address-record",
|
|
1032
1281
|
VerifyResolvedAddressMatchesAddress = "verify-resolved-address-matches-address"
|
|
1033
1282
|
}
|
|
1283
|
+
declare const PROTOCOL_ATTRIBUTE_PREFIX = "ens";
|
|
1034
1284
|
declare const ATTR_PROTOCOL_NAME = "ens.protocol";
|
|
1035
1285
|
declare const ATTR_PROTOCOL_STEP = "ens.protocol.step";
|
|
1036
1286
|
declare const ATTR_PROTOCOL_STEP_RESULT = "ens.protocol.step.result";
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
name: any;
|
|
1287
|
+
interface SpanAttributes {
|
|
1288
|
+
[key: string]: unknown;
|
|
1289
|
+
}
|
|
1290
|
+
interface SpanEvent {
|
|
1291
|
+
name: string;
|
|
1292
|
+
attributes: SpanAttributes;
|
|
1293
|
+
time: number;
|
|
1294
|
+
}
|
|
1295
|
+
interface ProtocolSpan {
|
|
1296
|
+
scope: string;
|
|
1297
|
+
id: string;
|
|
1298
|
+
traceId: string;
|
|
1299
|
+
parentSpanContext: {
|
|
1300
|
+
traceId: string;
|
|
1301
|
+
spanId: string;
|
|
1302
|
+
} | undefined;
|
|
1303
|
+
name: string;
|
|
1055
1304
|
timestamp: number;
|
|
1056
1305
|
duration: number;
|
|
1057
|
-
attributes:
|
|
1058
|
-
|
|
1306
|
+
attributes: SpanAttributes;
|
|
1307
|
+
status: {
|
|
1308
|
+
code: number;
|
|
1309
|
+
message?: string;
|
|
1059
1310
|
};
|
|
1060
|
-
|
|
1061
|
-
|
|
1311
|
+
events: SpanEvent[];
|
|
1312
|
+
}
|
|
1313
|
+
type ProtocolSpanTreeNode = ProtocolSpan & {
|
|
1314
|
+
children: ProtocolSpanTreeNode[];
|
|
1062
1315
|
};
|
|
1063
|
-
type
|
|
1064
|
-
type ProtocolTrace = ProtocolSpan[];
|
|
1316
|
+
type ProtocolTrace = ProtocolSpanTreeNode[];
|
|
1065
1317
|
|
|
1066
1318
|
/**
|
|
1067
1319
|
* Encodes a selection of Resolver records in the context of a specific Name.
|
|
@@ -1083,10 +1335,6 @@ interface ResolverRecordsSelection {
|
|
|
1083
1335
|
*/
|
|
1084
1336
|
texts?: string[];
|
|
1085
1337
|
}
|
|
1086
|
-
declare const DEFAULT_RECORDS_SELECTION: {
|
|
1087
|
-
readonly addresses: [CoinType];
|
|
1088
|
-
readonly texts: ["url", "avatar", "header", "description", "email", "com.twitter", "com.farcaster", "com.github"];
|
|
1089
|
-
};
|
|
1090
1338
|
declare const isSelectionEmpty: (selection: ResolverRecordsSelection) => boolean;
|
|
1091
1339
|
|
|
1092
1340
|
/**
|
|
@@ -1174,6 +1422,25 @@ interface MultichainPrimaryNameResolutionArgs {
|
|
|
1174
1422
|
*/
|
|
1175
1423
|
type MultichainPrimaryNameResolutionResult = Record<ChainId, Name | null>;
|
|
1176
1424
|
|
|
1425
|
+
declare const DefaultRecordsSelection: {
|
|
1426
|
+
readonly mainnet: {
|
|
1427
|
+
readonly addresses: [_ensdomains_address_encoder.CoinType, ..._ensdomains_address_encoder.CoinType[]];
|
|
1428
|
+
readonly texts: ["url", "avatar", "header", "description", "email", "com.twitter", "com.farcaster", "com.github"];
|
|
1429
|
+
};
|
|
1430
|
+
readonly sepolia: {
|
|
1431
|
+
readonly addresses: [_ensdomains_address_encoder.CoinType, ..._ensdomains_address_encoder.CoinType[]];
|
|
1432
|
+
readonly texts: ["url", "avatar", "header", "description", "email", "com.twitter", "com.farcaster", "com.github"];
|
|
1433
|
+
};
|
|
1434
|
+
readonly holesky: {
|
|
1435
|
+
readonly addresses: [_ensdomains_address_encoder.CoinType, ..._ensdomains_address_encoder.CoinType[]];
|
|
1436
|
+
readonly texts: ["url", "avatar", "header", "description", "email", "com.twitter", "com.farcaster", "com.github"];
|
|
1437
|
+
};
|
|
1438
|
+
readonly "ens-test-env": {
|
|
1439
|
+
readonly addresses: [_ensdomains_address_encoder.CoinType, ..._ensdomains_address_encoder.CoinType[]];
|
|
1440
|
+
readonly texts: ["url", "avatar", "header", "description", "email", "com.twitter", "com.farcaster", "com.github"];
|
|
1441
|
+
};
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1177
1444
|
/**
|
|
1178
1445
|
* API Error Response Type
|
|
1179
1446
|
*/
|
|
@@ -1190,6 +1457,9 @@ interface TraceableResponse {
|
|
|
1190
1457
|
interface AcceleratableRequest {
|
|
1191
1458
|
accelerate?: boolean;
|
|
1192
1459
|
}
|
|
1460
|
+
interface AcceleratableResponse {
|
|
1461
|
+
accelerationAttempted: boolean;
|
|
1462
|
+
}
|
|
1193
1463
|
/**
|
|
1194
1464
|
* Resolve Records Request Type
|
|
1195
1465
|
*/
|
|
@@ -1198,7 +1468,7 @@ interface ResolveRecordsRequest<SELECTION extends ResolverRecordsSelection> exte
|
|
|
1198
1468
|
/**
|
|
1199
1469
|
* Resolve Records Response Type
|
|
1200
1470
|
*/
|
|
1201
|
-
interface ResolveRecordsResponse<SELECTION extends ResolverRecordsSelection> extends TraceableResponse {
|
|
1471
|
+
interface ResolveRecordsResponse<SELECTION extends ResolverRecordsSelection> extends AcceleratableResponse, TraceableResponse {
|
|
1202
1472
|
records: ResolverRecordsResponse<SELECTION>;
|
|
1203
1473
|
}
|
|
1204
1474
|
/**
|
|
@@ -1209,14 +1479,49 @@ interface ResolvePrimaryNameRequest extends ReverseResolutionArgs, Acceleratable
|
|
|
1209
1479
|
/**
|
|
1210
1480
|
* Resolve Primary Name Response Type
|
|
1211
1481
|
*/
|
|
1212
|
-
interface ResolvePrimaryNameResponse extends TraceableResponse {
|
|
1482
|
+
interface ResolvePrimaryNameResponse extends AcceleratableResponse, TraceableResponse {
|
|
1213
1483
|
name: ReverseResolutionResult;
|
|
1214
1484
|
}
|
|
1215
1485
|
interface ResolvePrimaryNamesRequest extends MultichainPrimaryNameResolutionArgs, AcceleratableRequest, TraceableRequest {
|
|
1216
1486
|
}
|
|
1217
|
-
interface ResolvePrimaryNamesResponse extends TraceableResponse {
|
|
1487
|
+
interface ResolvePrimaryNamesResponse extends AcceleratableResponse, TraceableResponse {
|
|
1218
1488
|
names: MultichainPrimaryNameResolutionResult;
|
|
1219
1489
|
}
|
|
1490
|
+
/**
|
|
1491
|
+
* ENSIndexer Public Config Response
|
|
1492
|
+
*/
|
|
1493
|
+
type ConfigResponse = ENSIndexerPublicConfig;
|
|
1494
|
+
/**
|
|
1495
|
+
* ENSIndexer Overall Indexing Status Request
|
|
1496
|
+
*/
|
|
1497
|
+
interface IndexingStatusRequest {
|
|
1498
|
+
/**
|
|
1499
|
+
* Max Realtime Distance (optional)
|
|
1500
|
+
*
|
|
1501
|
+
* A duration value in seconds, representing the max allowed distance
|
|
1502
|
+
* between the latest indexed block of each chain and the “tip” of
|
|
1503
|
+
* all indexed chains. Setting this parameter influences the HTTP response
|
|
1504
|
+
* code as follows:
|
|
1505
|
+
* - Success (200 OK): The latest indexed block of each chain
|
|
1506
|
+
* is within the requested distance from realtime.
|
|
1507
|
+
* - Service Unavailable (503): The latest indexed block of each chain
|
|
1508
|
+
* is NOT within the requested distance from realtime.
|
|
1509
|
+
*/
|
|
1510
|
+
maxRealtimeDistance?: Duration;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* ENSIndexer Overall Indexing Status Response
|
|
1514
|
+
*/
|
|
1515
|
+
type IndexingStatusResponse = ENSIndexerOverallIndexingStatus;
|
|
1516
|
+
/**
|
|
1517
|
+
* ENSIndexer Overall Indexing Status Response Codes
|
|
1518
|
+
*
|
|
1519
|
+
* Define a custom response code for known responses.
|
|
1520
|
+
*/
|
|
1521
|
+
declare const IndexingStatusResponseCodes: {
|
|
1522
|
+
readonly IndexerError: 512;
|
|
1523
|
+
readonly RequestedDistanceNotAchievedError: 513;
|
|
1524
|
+
};
|
|
1220
1525
|
|
|
1221
1526
|
/**
|
|
1222
1527
|
* Default ENSNode API endpoint URL
|
|
@@ -1367,6 +1672,47 @@ declare class ENSNodeClient {
|
|
|
1367
1672
|
* ```
|
|
1368
1673
|
*/
|
|
1369
1674
|
resolvePrimaryNames(address: ResolvePrimaryNamesRequest["address"], options?: Omit<ResolvePrimaryNamesRequest, "address">): Promise<ResolvePrimaryNamesResponse>;
|
|
1675
|
+
/**
|
|
1676
|
+
* Fetch ENSNode Config
|
|
1677
|
+
*
|
|
1678
|
+
* Fetch the ENSNode's configuration.
|
|
1679
|
+
*
|
|
1680
|
+
* @returns {ConfigResponse}
|
|
1681
|
+
*
|
|
1682
|
+
* @throws if the ENSNode request fails
|
|
1683
|
+
* @throws if the ENSNode API returns an error response
|
|
1684
|
+
* @throws if the ENSNode response breaks required invariants
|
|
1685
|
+
*/
|
|
1686
|
+
config(): Promise<ConfigResponse>;
|
|
1687
|
+
/**
|
|
1688
|
+
* Fetch ENSNode Indexing Status
|
|
1689
|
+
*
|
|
1690
|
+
* Fetch the ENSNode's multichain indexing status.
|
|
1691
|
+
*
|
|
1692
|
+
* @param options additional options
|
|
1693
|
+
* @param options.maxRealtimeDistance the max allowed distance between the
|
|
1694
|
+
* latest indexed block of each chain and the "tip" of all indexed chains.
|
|
1695
|
+
* Setting this parameter influences the HTTP response code as follows:
|
|
1696
|
+
* - Success (200 OK): The latest indexed block of each chain is within the
|
|
1697
|
+
* requested distance from realtime.
|
|
1698
|
+
* - Service Unavailable (503): The latest indexed block of each chain is NOT
|
|
1699
|
+
* within the requested distance from realtime.
|
|
1700
|
+
*
|
|
1701
|
+
* @returns {IndexingStatusResponse}
|
|
1702
|
+
*
|
|
1703
|
+
* @throws if the ENSNode request fails
|
|
1704
|
+
* @throws if the ENSNode API returns an error response
|
|
1705
|
+
* @throws if the ENSNode response breaks required invariants
|
|
1706
|
+
*/
|
|
1707
|
+
indexingStatus(options?: IndexingStatusRequest): Promise<IndexingStatusResponse>;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
declare function deserializeErrorResponse(maybeErrorResponse: unknown): ErrorResponse;
|
|
1711
|
+
|
|
1712
|
+
declare class ClientError extends Error {
|
|
1713
|
+
details?: unknown;
|
|
1714
|
+
constructor(message: string, details?: unknown);
|
|
1715
|
+
static fromErrorResponse({ message, details }: ErrorResponse): ClientError;
|
|
1370
1716
|
}
|
|
1371
1717
|
|
|
1372
|
-
export { ATTR_PROTOCOL_NAME, ATTR_PROTOCOL_STEP, ATTR_PROTOCOL_STEP_RESULT, type AcceleratableRequest, type BlockNumber, type BlockRef, type Blockrange, type Cache, type ChainId, type ChainIdString, type ChainIndexingActiveStatus, type ChainIndexingBackfillStatus, type ChainIndexingCompletedStatus, type ChainIndexingConfig, type ChainIndexingDefiniteConfig, type ChainIndexingFollowingStatus, type ChainIndexingIndefiniteConfig, type ChainIndexingStandbyStatus, type ChainIndexingStatus, type ChainIndexingStatusForBackfillOverallStatus, type ChainIndexingStatusId, ChainIndexingStatusIds, type ChainIndexingStrategyId, ChainIndexingStrategyIds, type ChainIndexingUnstartedStatus, type ClientOptions, DEFAULT_ENSNODE_API_URL, DEFAULT_EVM_CHAIN_ID, DEFAULT_EVM_COIN_TYPE,
|
|
1718
|
+
export { ATTR_PROTOCOL_NAME, ATTR_PROTOCOL_STEP, ATTR_PROTOCOL_STEP_RESULT, type AcceleratableRequest, type AcceleratableResponse, type AccountId, BASENAMES_NODE, type BlockNumber, type BlockRef, type Blockrange, type Cache, type ChainId, type ChainIdString, type ChainIndexingActiveStatus, type ChainIndexingBackfillStatus, type ChainIndexingCompletedStatus, type ChainIndexingConfig, type ChainIndexingDefiniteConfig, type ChainIndexingFollowingStatus, type ChainIndexingIndefiniteConfig, type ChainIndexingStandbyStatus, type ChainIndexingStatus, type ChainIndexingStatusForBackfillOverallStatus, type ChainIndexingStatusId, ChainIndexingStatusIds, type ChainIndexingStrategyId, ChainIndexingStrategyIds, type ChainIndexingUnstartedStatus, ClientError, type ClientOptions, type ConfigResponse, DEFAULT_ENSNODE_API_URL, DEFAULT_EVM_CHAIN_ID, DEFAULT_EVM_COIN_TYPE, type Datetime, type DatetimeISO8601, type DeepPartial, DefaultRecordsSelection, type DependencyInfo, type Duration, type ENSIndexerOverallIndexingBackfillStatus, type ENSIndexerOverallIndexingCompletedStatus, type ENSIndexerOverallIndexingErrorStatus, type ENSIndexerOverallIndexingFollowingStatus, type ENSIndexerOverallIndexingStatus, type ENSIndexerOverallIndexingUnstartedStatus, type ENSIndexerPublicConfig, ENSNodeClient, ETH_COIN_TYPE, ETH_NODE, type EncodedLabelHash, type EnsRainbowClientLabelSet, type EnsRainbowServerLabelSet, type ErrorResponse, type ForwardResolutionArgs, ForwardResolutionProtocolStep, type ForwardResolutionResult, type IndexingStatusRequest, type IndexingStatusResponse, IndexingStatusResponseCodes, LINEANAMES_NODE, type Label, type LabelHash, type LabelSetId, type LabelSetVersion, LruCache, type MultichainPrimaryNameResolutionArgs, type MultichainPrimaryNameResolutionResult, type Name, type Node, type OverallIndexingStatusId, OverallIndexingStatusIds, PROTOCOL_ATTRIBUTE_PREFIX, PluginName, type ProtocolSpan, type ProtocolSpanTreeNode, type ProtocolTrace, REVERSE_ROOT_NODES, ROOT_NODE, type ResolvePrimaryNameRequest, type ResolvePrimaryNameResponse, type ResolvePrimaryNamesRequest, type ResolvePrimaryNamesResponse, type ResolveRecordsRequest, type ResolveRecordsResponse, type ResolverRecordsResponse, type ResolverRecordsResponseBase, type ResolverRecordsSelection, type ReverseResolutionArgs, ReverseResolutionProtocolStep, type ReverseResolutionResult, type RpcUrl, type SerializedENSIndexerOverallIndexingBackfillStatus, type SerializedENSIndexerOverallIndexingCompletedStatus, type SerializedENSIndexerOverallIndexingErrorStatus, type SerializedENSIndexerOverallIndexingFollowingStatus, type SerializedENSIndexerOverallIndexingStatus, type SerializedENSIndexerOverallIndexingUnstartedStatus, type SerializedENSIndexerPublicConfig, type SerializedIndexedChainIds, TraceableENSProtocol, type TraceableRequest, type TraceableResponse, type UnixTimestamp, type UrlString, accountIdEqual, addrReverseLabel, bigintToCoinType, buildEnsRainbowClientLabelSet, buildLabelSetId, buildLabelSetVersion, checkChainIndexingStatusesForBackfillOverallStatus, checkChainIndexingStatusesForCompletedOverallStatus, checkChainIndexingStatusesForFollowingOverallStatus, checkChainIndexingStatusesForUnstartedOverallStatus, coinTypeReverseLabel, coinTypeToEvmChainId, createIndexingConfig, deserializeBlockNumber, deserializeBlockRef, deserializeBlockrange, deserializeChainId, deserializeDatetime, deserializeDuration, deserializeENSIndexerIndexingStatus, deserializeENSIndexerPublicConfig, deserializeErrorResponse, deserializeUrl, evmChainIdToCoinType, getActiveChains, getNameHierarchy, getOmnichainIndexingCursor, getOverallApproxRealtimeDistance, getOverallIndexingStatus, getStandbyChains, getTimestampForHighestOmnichainKnownBlock, getTimestampForLowestOmnichainStartBlock, invariant_isSubgraphCompatibleRequirements, invariant_reverseResolversPluginNeedsResolverRecords, isLabelIndexable, isNormalized, isSelectionEmpty, isSubgraphCompatible, labelHashToBytes, makeDatabaseSchemaNameSchema, makeDependencyInfoSchema, makeENSIndexerPublicConfigSchema, makeFullyPinnedLabelSetSchema, makeIndexedChainIdsSchema, makeLabelSetIdSchema, makeLabelSetVersionSchema, makePluginsListSchema, makeSubdomainNode, maybeHealLabelByReverseAddress, parseNonNegativeInteger, parseReverseName, reverseName, serializeChainId, serializeChainIndexingStatuses, serializeDatetime, serializeENSIndexerIndexingStatus, serializeENSIndexerPublicConfig, serializeIndexedChainIds, serializeUrl, sortAscChainStatusesByStartBlock, uint256ToHex32, uniq, validateSupportedLabelSetAndVersion };
|