@ensnode/ensnode-sdk 1.1.0 → 1.3.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.cjs +2298 -1238
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1924 -933
- package/dist/index.d.ts +1924 -933
- package/dist/index.js +2307 -1252
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,56 @@
|
|
|
1
|
+
import z$1, { z } from 'zod/v4';
|
|
2
|
+
import { ENSNamespaceId, DatasourceName } from '@ensnode/datasources';
|
|
3
|
+
export { ENSNamespaceId, ENSNamespaceIds, getENSRootChainId } from '@ensnode/datasources';
|
|
1
4
|
import { Hex, Address, ByteArray, Hash } from 'viem';
|
|
2
5
|
import { CoinType, EvmCoinType } from '@ensdomains/address-encoder';
|
|
3
6
|
export { CoinType, EvmCoinType } from '@ensdomains/address-encoder';
|
|
4
|
-
import { EncodedReferrer,
|
|
7
|
+
import { UnixTimestamp as UnixTimestamp$1, EncodedReferrer, ReferrerLeaderboardPageParams, ReferrerLeaderboardPage, ReferrerDetail } from '@namehash/ens-referrals';
|
|
5
8
|
export { EncodedReferrer, ZERO_ENCODED_REFERRER, decodeEncodedReferrer } from '@namehash/ens-referrals';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The ETH coinType.
|
|
12
|
+
*
|
|
13
|
+
* @see https://docs.ens.domains/ensip/9
|
|
14
|
+
*/
|
|
15
|
+
declare const ETH_COIN_TYPE: CoinType;
|
|
16
|
+
/**
|
|
17
|
+
* The 'default' chainId corresponding to the below {@link DEFAULT_EVM_COIN_TYPE} in the context of
|
|
18
|
+
* ENSIP-19.
|
|
19
|
+
*
|
|
20
|
+
* @see https://docs.ens.domains/ensip/19
|
|
21
|
+
*/
|
|
22
|
+
declare const DEFAULT_EVM_CHAIN_ID = 0;
|
|
23
|
+
/**
|
|
24
|
+
* ENSIP-19 EVM CoinType representing the 'default' coinType for EVM chains in ENS.
|
|
25
|
+
*
|
|
26
|
+
* @see https://docs.ens.domains/ensip/19/#reverse-resolution
|
|
27
|
+
*/
|
|
28
|
+
declare const DEFAULT_EVM_COIN_TYPE: EvmCoinType;
|
|
29
|
+
/**
|
|
30
|
+
* Converts a CoinType to an EVM Chain Id.
|
|
31
|
+
*
|
|
32
|
+
* NOTE: for whatever reason @ensdomains/address-encoder#coinTypeToEvmChainId doesn't handle the
|
|
33
|
+
* mainnet case so we implement that here
|
|
34
|
+
*
|
|
35
|
+
* @see https://docs.ens.domains/ensip/11/
|
|
36
|
+
*/
|
|
37
|
+
declare const coinTypeToEvmChainId: (coinType: CoinType) => ChainId;
|
|
38
|
+
/**
|
|
39
|
+
* Converts an EVM Chain Id to a CoinType.
|
|
40
|
+
*
|
|
41
|
+
* NOTE: for whatever reason @ensdomains/address-encoder#evmChainIdToCoinType doesn't handle the
|
|
42
|
+
* mainnet case so we implement that here
|
|
43
|
+
*/
|
|
44
|
+
declare const evmChainIdToCoinType: (chainId: ChainId) => CoinType;
|
|
45
|
+
/**
|
|
46
|
+
* Converts a bigint value representing a CoinType into a valid CoinType.
|
|
47
|
+
*
|
|
48
|
+
* This is useful when onchain events emit coinTypes as bigint but we want to constrain them to
|
|
49
|
+
* the CoinType type.
|
|
50
|
+
*
|
|
51
|
+
* @throws if `value` is too large to fit in Number.MAX_SAFE_INTEGER
|
|
52
|
+
*/
|
|
53
|
+
declare const bigintToCoinType: (value: bigint) => CoinType;
|
|
9
54
|
|
|
10
55
|
/**
|
|
11
56
|
* A hash value that uniquely identifies a single ENS name.
|
|
@@ -253,66 +298,6 @@ type DNSEncodedPartiallyInterpretedName = DNSEncodedName & {
|
|
|
253
298
|
__brand: "DNSEncodedPartiallyInterpretedName";
|
|
254
299
|
};
|
|
255
300
|
|
|
256
|
-
/**
|
|
257
|
-
* Determines whether the Name is normalized.
|
|
258
|
-
*
|
|
259
|
-
* @param name - The Name to check for normalization
|
|
260
|
-
* @returns True if the name is normalized according to ENS normalization rules, false otherwise
|
|
261
|
-
*/
|
|
262
|
-
declare function isNormalizedName(name: Name): name is NormalizedName;
|
|
263
|
-
/**
|
|
264
|
-
* Determines whether the Label is normalized.
|
|
265
|
-
*
|
|
266
|
-
* @param label - The Label to check for normalization
|
|
267
|
-
* @returns True if the label is normalized according to ENS normalization rules, false otherwise
|
|
268
|
-
*/
|
|
269
|
-
declare function isNormalizedLabel(label: Label): boolean;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* The ETH coinType.
|
|
273
|
-
*
|
|
274
|
-
* @see https://docs.ens.domains/ensip/9
|
|
275
|
-
*/
|
|
276
|
-
declare const ETH_COIN_TYPE: CoinType;
|
|
277
|
-
/**
|
|
278
|
-
* The 'default' chainId corresponding to the below {@link DEFAULT_EVM_COIN_TYPE} in the context of
|
|
279
|
-
* ENSIP-19.
|
|
280
|
-
*
|
|
281
|
-
* @see https://docs.ens.domains/ensip/19
|
|
282
|
-
*/
|
|
283
|
-
declare const DEFAULT_EVM_CHAIN_ID = 0;
|
|
284
|
-
/**
|
|
285
|
-
* ENSIP-19 EVM CoinType representing the 'default' coinType for EVM chains in ENS.
|
|
286
|
-
*
|
|
287
|
-
* @see https://docs.ens.domains/ensip/19/#reverse-resolution
|
|
288
|
-
*/
|
|
289
|
-
declare const DEFAULT_EVM_COIN_TYPE: EvmCoinType;
|
|
290
|
-
/**
|
|
291
|
-
* Converts a CoinType to an EVM Chain Id.
|
|
292
|
-
*
|
|
293
|
-
* NOTE: for whatever reason @ensdomains/address-encoder#coinTypeToEvmChainId doesn't handle the
|
|
294
|
-
* mainnet case so we implement that here
|
|
295
|
-
*
|
|
296
|
-
* @see https://docs.ens.domains/ensip/11/
|
|
297
|
-
*/
|
|
298
|
-
declare const coinTypeToEvmChainId: (coinType: CoinType) => ChainId;
|
|
299
|
-
/**
|
|
300
|
-
* Converts an EVM Chain Id to a CoinType.
|
|
301
|
-
*
|
|
302
|
-
* NOTE: for whatever reason @ensdomains/address-encoder#evmChainIdToCoinType doesn't handle the
|
|
303
|
-
* mainnet case so we implement that here
|
|
304
|
-
*/
|
|
305
|
-
declare const evmChainIdToCoinType: (chainId: ChainId) => CoinType;
|
|
306
|
-
/**
|
|
307
|
-
* Converts a bigint value representing a CoinType into a valid CoinType.
|
|
308
|
-
*
|
|
309
|
-
* This is useful when onchain events emit coinTypes as bigint but we want to constrain them to
|
|
310
|
-
* the CoinType type.
|
|
311
|
-
*
|
|
312
|
-
* @throws if `value` is too large to fit in Number.MAX_SAFE_INTEGER
|
|
313
|
-
*/
|
|
314
|
-
declare const bigintToCoinType: (value: bigint) => CoinType;
|
|
315
|
-
|
|
316
301
|
declare const ROOT_NODE: Node;
|
|
317
302
|
declare const ETH_NODE: Node;
|
|
318
303
|
declare const BASENAMES_NODE: Node;
|
|
@@ -362,6 +347,21 @@ declare const encodeLabelHash: (labelHash: LabelHash) => EncodedLabelHash;
|
|
|
362
347
|
*/
|
|
363
348
|
declare function isEncodedLabelHash(maybeEncodedLabelHash: string): maybeEncodedLabelHash is EncodedLabelHash;
|
|
364
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Determines whether the Name is normalized.
|
|
352
|
+
*
|
|
353
|
+
* @param name - The Name to check for normalization
|
|
354
|
+
* @returns True if the name is normalized according to ENS normalization rules, false otherwise
|
|
355
|
+
*/
|
|
356
|
+
declare function isNormalizedName(name: Name): name is NormalizedName;
|
|
357
|
+
/**
|
|
358
|
+
* Determines whether the Label is normalized.
|
|
359
|
+
*
|
|
360
|
+
* @param label - The Label to check for normalization
|
|
361
|
+
* @returns True if the label is normalized according to ENS normalization rules, false otherwise
|
|
362
|
+
*/
|
|
363
|
+
declare function isNormalizedLabel(label: Label): boolean;
|
|
364
|
+
|
|
365
365
|
/**
|
|
366
366
|
* Checks if the input is a {@link LabelHash}.
|
|
367
367
|
*
|
|
@@ -369,6 +369,10 @@ declare function isEncodedLabelHash(maybeEncodedLabelHash: string): maybeEncoded
|
|
|
369
369
|
*/
|
|
370
370
|
declare function isLabelHash(maybeLabelHash: string): maybeLabelHash is LabelHash;
|
|
371
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Name for the ENS Root
|
|
374
|
+
*/
|
|
375
|
+
declare const ENS_ROOT: Name;
|
|
372
376
|
/**
|
|
373
377
|
* Constructs a name hierarchy from a given NormalizedName.
|
|
374
378
|
*
|
|
@@ -381,6 +385,10 @@ declare function isLabelHash(maybeLabelHash: string): maybeLabelHash is LabelHas
|
|
|
381
385
|
* on '.' and receive NormalizedNames as a result
|
|
382
386
|
*/
|
|
383
387
|
declare const getNameHierarchy: (name: NormalizedName) => NormalizedName[];
|
|
388
|
+
/**
|
|
389
|
+
* Get FQDN of parent for a name.
|
|
390
|
+
*/
|
|
391
|
+
declare const getParentNameFQDN: (name: Name) => Name;
|
|
384
392
|
/**
|
|
385
393
|
* Beautifies a name by converting each normalized label in the provided name to
|
|
386
394
|
* its "beautified" form. Labels that are not normalized retain their original value.
|
|
@@ -913,6 +921,35 @@ declare function isPriceEqual(priceA: Price, priceB: Price): boolean;
|
|
|
913
921
|
*/
|
|
914
922
|
declare function addPrices<const PriceType extends Price = Price>(...prices: [PriceType, PriceType, ...PriceType[]]): PriceType;
|
|
915
923
|
|
|
924
|
+
/**
|
|
925
|
+
* Gets the AccountId for the contract in the specified namespace, datasource, and
|
|
926
|
+
* contract name, or undefined if it is not defined or is not a single AccountId.
|
|
927
|
+
*
|
|
928
|
+
* This is useful when you want to retrieve the AccountId for a contract by its name
|
|
929
|
+
* where it may or may not actually be defined for the given namespace and datasource.
|
|
930
|
+
*
|
|
931
|
+
* @param namespaceId - The ENSNamespace identifier (e.g. 'mainnet', 'sepolia', 'holesky',
|
|
932
|
+
* 'ens-test-env')
|
|
933
|
+
* @param datasourceName - The name of the Datasource to search for contractName in
|
|
934
|
+
* @param contractName - The name of the contract to retrieve
|
|
935
|
+
* @returns The AccountId of the contract with the given namespace, datasource,
|
|
936
|
+
* and contract name, or undefined if it is not found or is not a single AccountId
|
|
937
|
+
*/
|
|
938
|
+
declare const maybeGetDatasourceContract: (namespaceId: ENSNamespaceId, datasourceName: DatasourceName, contractName: string) => AccountId | undefined;
|
|
939
|
+
/**
|
|
940
|
+
* Gets the AccountId for the contract in the specified namespace, datasource, and
|
|
941
|
+
* contract name, or throws an error if it is not defined or is not a single AccountId.
|
|
942
|
+
*
|
|
943
|
+
* @param namespaceId - The ENSNamespace identifier (e.g. 'mainnet', 'sepolia', 'holesky',
|
|
944
|
+
* 'ens-test-env')
|
|
945
|
+
* @param datasourceName - The name of the Datasource to search for contractName in
|
|
946
|
+
* @param contractName - The name of the contract to retrieve
|
|
947
|
+
* @returns The AccountId of the contract with the given namespace, datasource,
|
|
948
|
+
* and contract name
|
|
949
|
+
* @throws Error if the contract is not found or is not a single AccountId
|
|
950
|
+
*/
|
|
951
|
+
declare const getDatasourceContract: (namespaceId: ENSNamespaceId, datasourceName: DatasourceName, contractName: string) => AccountId;
|
|
952
|
+
|
|
916
953
|
/**
|
|
917
954
|
* Duration between two moments in time.
|
|
918
955
|
*/
|
|
@@ -937,13 +974,13 @@ type DatetimeISO8601 = string;
|
|
|
937
974
|
*/
|
|
938
975
|
type UrlString = string;
|
|
939
976
|
/**
|
|
940
|
-
*
|
|
977
|
+
* String representation of {@link AccountId}.
|
|
941
978
|
*
|
|
942
979
|
* Formatted as a fully lowercase CAIP-10 AccountId.
|
|
943
980
|
*
|
|
944
981
|
* @see https://chainagnostic.org/CAIPs/caip-10
|
|
945
982
|
*/
|
|
946
|
-
type
|
|
983
|
+
type AccountIdString = string;
|
|
947
984
|
|
|
948
985
|
declare function deserializeChainId(maybeChainId: ChainIdString, valueLabel?: string): ChainId;
|
|
949
986
|
declare function deserializeDatetime(maybeDatetime: string, valueLabel?: string): Datetime;
|
|
@@ -956,7 +993,7 @@ declare function deserializeBlockrange(maybeBlockrange: Partial<Blockrange>, val
|
|
|
956
993
|
};
|
|
957
994
|
declare function deserializeBlockRef(maybeBlockRef: Partial<BlockRef>, valueLabel?: string): BlockRef;
|
|
958
995
|
declare function deserializeDuration(maybeDuration: unknown, valueLabel?: string): Duration;
|
|
959
|
-
declare function
|
|
996
|
+
declare function parseAccountId(maybeAccountId: unknown, valueLabel?: string): AccountId;
|
|
960
997
|
|
|
961
998
|
/**
|
|
962
999
|
* Interprets a Literal Label, producing an Interpreted Label.
|
|
@@ -1043,13 +1080,13 @@ declare function serializePrice(price: Price): SerializedPrice;
|
|
|
1043
1080
|
*/
|
|
1044
1081
|
declare function serializePriceEth(price: PriceEth): SerializedPriceEth;
|
|
1045
1082
|
/**
|
|
1046
|
-
*
|
|
1083
|
+
* Format {@link AccountId} object as a string.
|
|
1047
1084
|
*
|
|
1048
1085
|
* Formatted as a fully lowercase CAIP-10 AccountId.
|
|
1049
1086
|
*
|
|
1050
1087
|
* @see https://chainagnostic.org/CAIPs/caip-10
|
|
1051
1088
|
*/
|
|
1052
|
-
declare function
|
|
1089
|
+
declare function formatAccountId(accountId: AccountId): AccountIdString;
|
|
1053
1090
|
|
|
1054
1091
|
declare function isHttpProtocol(url: URL): boolean;
|
|
1055
1092
|
declare function isWebSocketProtocol(url: URL): boolean;
|
|
@@ -2055,1147 +2092,1902 @@ declare function serializeChainIndexingSnapshots<ChainIndexingStatusSnapshotType
|
|
|
2055
2092
|
*/
|
|
2056
2093
|
declare function serializeOmnichainIndexingStatusSnapshot(indexingStatus: OmnichainIndexingStatusSnapshot): SerializedOmnichainIndexingStatusSnapshot;
|
|
2057
2094
|
|
|
2095
|
+
declare const TheGraphCannotFallbackReasonSchema: z.ZodEnum<{
|
|
2096
|
+
readonly NotSubgraphCompatible: "not-subgraph-compatible";
|
|
2097
|
+
readonly NoApiKey: "no-api-key";
|
|
2098
|
+
readonly NoSubgraphUrl: "no-subgraph-url";
|
|
2099
|
+
}>;
|
|
2100
|
+
declare const TheGraphFallbackSchema: z.ZodObject<{
|
|
2101
|
+
canFallback: z.ZodBoolean;
|
|
2102
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
2103
|
+
readonly NotSubgraphCompatible: "not-subgraph-compatible";
|
|
2104
|
+
readonly NoApiKey: "no-api-key";
|
|
2105
|
+
readonly NoSubgraphUrl: "no-subgraph-url";
|
|
2106
|
+
}>>;
|
|
2107
|
+
}, z.core.$strict>;
|
|
2058
2108
|
/**
|
|
2059
|
-
*
|
|
2060
|
-
* "BaseRegistrar" contract for direct subnames of .eth) for the provided namespace.
|
|
2109
|
+
* Create a Zod schema for validating a serialized ENSApiPublicConfig.
|
|
2061
2110
|
*
|
|
2062
|
-
* @param
|
|
2063
|
-
* @returns The AccountId for the Ethnames Subregistry contract for the provided namespace.
|
|
2064
|
-
* @throws Error if the contract is not found for the given namespace.
|
|
2111
|
+
* @param valueLabel - Optional label for the value being validated (used in error messages)
|
|
2065
2112
|
*/
|
|
2066
|
-
declare function
|
|
2113
|
+
declare function makeENSApiPublicConfigSchema(valueLabel?: string): z.ZodObject<{
|
|
2114
|
+
version: z.ZodString;
|
|
2115
|
+
theGraphFallback: z.ZodObject<{
|
|
2116
|
+
canFallback: z.ZodBoolean;
|
|
2117
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
2118
|
+
readonly NotSubgraphCompatible: "not-subgraph-compatible";
|
|
2119
|
+
readonly NoApiKey: "no-api-key";
|
|
2120
|
+
readonly NoSubgraphUrl: "no-subgraph-url";
|
|
2121
|
+
}>>;
|
|
2122
|
+
}, z.core.$strict>;
|
|
2123
|
+
ensIndexerPublicConfig: z.ZodObject<{
|
|
2124
|
+
labelSet: z.ZodObject<{
|
|
2125
|
+
labelSetId: z.ZodString;
|
|
2126
|
+
labelSetVersion: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
2127
|
+
}, z.core.$strip>;
|
|
2128
|
+
indexedChainIds: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodInt, z.ZodTransform<number, number>>>, z.ZodTransform<Set<number>, number[]>>;
|
|
2129
|
+
isSubgraphCompatible: z.ZodBoolean;
|
|
2130
|
+
namespace: z.ZodEnum<{
|
|
2131
|
+
readonly Mainnet: "mainnet";
|
|
2132
|
+
readonly Sepolia: "sepolia";
|
|
2133
|
+
readonly Holesky: "holesky";
|
|
2134
|
+
readonly EnsTestEnv: "ens-test-env";
|
|
2135
|
+
}>;
|
|
2136
|
+
plugins: z.ZodArray<z.ZodString>;
|
|
2137
|
+
databaseSchemaName: z.ZodString;
|
|
2138
|
+
versionInfo: z.ZodObject<{
|
|
2139
|
+
nodejs: z.ZodString;
|
|
2140
|
+
ponder: z.ZodString;
|
|
2141
|
+
ensDb: z.ZodString;
|
|
2142
|
+
ensIndexer: z.ZodString;
|
|
2143
|
+
ensNormalize: z.ZodString;
|
|
2144
|
+
ensRainbow: z.ZodString;
|
|
2145
|
+
ensRainbowSchema: z.ZodInt;
|
|
2146
|
+
}, z.core.$strict>;
|
|
2147
|
+
}, z.core.$strip>;
|
|
2148
|
+
}, z.core.$strict>;
|
|
2067
2149
|
|
|
2150
|
+
type TheGraphCannotFallbackReason = z.infer<typeof TheGraphCannotFallbackReasonSchema>;
|
|
2151
|
+
type TheGraphFallback = z.infer<typeof TheGraphFallbackSchema>;
|
|
2068
2152
|
/**
|
|
2069
|
-
*
|
|
2153
|
+
* Complete public configuration object for ENSApi.
|
|
2154
|
+
*
|
|
2155
|
+
* Contains ENSApi-specific configuration at the top level and
|
|
2156
|
+
* embeds the complete ENSIndexer public configuration.
|
|
2070
2157
|
*/
|
|
2071
|
-
interface
|
|
2158
|
+
interface ENSApiPublicConfig {
|
|
2072
2159
|
/**
|
|
2073
|
-
*
|
|
2074
|
-
*
|
|
2075
|
-
* The ID of the subregistry the "logical registrar action" was taken on.
|
|
2160
|
+
* ENSApi service version
|
|
2076
2161
|
*
|
|
2077
|
-
*
|
|
2078
|
-
* contract.
|
|
2162
|
+
* @see https://ghcr.io/namehash/ensnode/ensapi
|
|
2079
2163
|
*/
|
|
2080
|
-
|
|
2164
|
+
version: string;
|
|
2081
2165
|
/**
|
|
2082
|
-
* The
|
|
2083
|
-
* Example subregistry managed names:
|
|
2084
|
-
* - `eth`
|
|
2085
|
-
* - `base.eth`
|
|
2086
|
-
* - `linea.eth`
|
|
2166
|
+
* The Graph Fallback-related info.
|
|
2087
2167
|
*/
|
|
2088
|
-
|
|
2168
|
+
theGraphFallback: TheGraphFallback;
|
|
2169
|
+
/**
|
|
2170
|
+
* Complete ENSIndexer public configuration
|
|
2171
|
+
*
|
|
2172
|
+
* Contains all ENSIndexer public configuration including
|
|
2173
|
+
* namespace, plugins, version info, etc.
|
|
2174
|
+
*/
|
|
2175
|
+
ensIndexerPublicConfig: ENSIndexerPublicConfig;
|
|
2089
2176
|
}
|
|
2177
|
+
|
|
2090
2178
|
/**
|
|
2091
|
-
* Serialized representation of {@link
|
|
2179
|
+
* Serialized representation of {@link ENSApiPublicConfig}
|
|
2092
2180
|
*/
|
|
2093
|
-
interface
|
|
2094
|
-
|
|
2181
|
+
interface SerializedENSApiPublicConfig extends Omit<ENSApiPublicConfig, "ensIndexerPublicConfig"> {
|
|
2182
|
+
/**
|
|
2183
|
+
* Serialized representation of {@link ENSApiPublicConfig.ensIndexerPublicConfig}.
|
|
2184
|
+
*/
|
|
2185
|
+
ensIndexerPublicConfig: SerializedENSIndexerPublicConfig;
|
|
2095
2186
|
}
|
|
2096
|
-
declare function serializeSubregistry(subregistry: Subregistry): SerializedSubregistry;
|
|
2097
2187
|
|
|
2098
2188
|
/**
|
|
2099
|
-
*
|
|
2100
|
-
*
|
|
2101
|
-
* Important: this definition should not be used anywhere.
|
|
2102
|
-
* It's only here to capture some ideas that were shared in the team.
|
|
2189
|
+
* Deserialize a {@link ENSApiPublicConfig} object.
|
|
2103
2190
|
*/
|
|
2104
|
-
declare
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2191
|
+
declare function deserializeENSApiPublicConfig(maybeConfig: SerializedENSApiPublicConfig, valueLabel?: string): ENSApiPublicConfig;
|
|
2192
|
+
|
|
2193
|
+
/**
|
|
2194
|
+
* Serialize a {@link ENSApiPublicConfig} object.
|
|
2195
|
+
*/
|
|
2196
|
+
declare function serializeENSApiPublicConfig(config: ENSApiPublicConfig): SerializedENSApiPublicConfig;
|
|
2197
|
+
|
|
2198
|
+
/**
|
|
2199
|
+
* ENSApi Public Config Response
|
|
2200
|
+
*/
|
|
2201
|
+
type ConfigResponse = ENSApiPublicConfig;
|
|
2202
|
+
|
|
2203
|
+
type SerializedConfigResponse = SerializedENSApiPublicConfig;
|
|
2204
|
+
|
|
2205
|
+
/**
|
|
2206
|
+
* Deserialize a {@link ConfigResponse} object.
|
|
2207
|
+
*/
|
|
2208
|
+
declare function deserializeConfigResponse(serializedResponse: SerializedConfigResponse): ConfigResponse;
|
|
2209
|
+
|
|
2210
|
+
declare function serializeConfigResponse(response: ConfigResponse): SerializedConfigResponse;
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* A status code for indexing status responses.
|
|
2214
|
+
*/
|
|
2215
|
+
declare const IndexingStatusResponseCodes: {
|
|
2216
|
+
/**
|
|
2217
|
+
* Represents that the indexing status is available.
|
|
2124
2218
|
*/
|
|
2125
|
-
readonly
|
|
2219
|
+
readonly Ok: "ok";
|
|
2126
2220
|
/**
|
|
2127
|
-
*
|
|
2128
|
-
*
|
|
2129
|
-
* Happens when
|
|
2130
|
-
* ` expiry + 120 days < the current timestamp`.
|
|
2221
|
+
* Represents that the indexing status is unavailable.
|
|
2131
2222
|
*/
|
|
2132
|
-
readonly
|
|
2223
|
+
readonly Error: "error";
|
|
2133
2224
|
};
|
|
2134
|
-
type RegistrationLifecycleStage = (typeof RegistrationLifecycleStages)[keyof typeof RegistrationLifecycleStages];
|
|
2135
2225
|
/**
|
|
2136
|
-
*
|
|
2226
|
+
* The derived string union of possible {@link IndexingStatusResponseCodes}.
|
|
2137
2227
|
*/
|
|
2138
|
-
|
|
2228
|
+
type IndexingStatusResponseCode = (typeof IndexingStatusResponseCodes)[keyof typeof IndexingStatusResponseCodes];
|
|
2229
|
+
/**
|
|
2230
|
+
* An indexing status response when the indexing status is available.
|
|
2231
|
+
*/
|
|
2232
|
+
type IndexingStatusResponseOk = {
|
|
2233
|
+
responseCode: typeof IndexingStatusResponseCodes.Ok;
|
|
2234
|
+
realtimeProjection: RealtimeIndexingStatusProjection;
|
|
2235
|
+
};
|
|
2236
|
+
/**
|
|
2237
|
+
* An indexing status response when the indexing status is unavailable.
|
|
2238
|
+
*/
|
|
2239
|
+
type IndexingStatusResponseError = {
|
|
2240
|
+
responseCode: typeof IndexingStatusResponseCodes.Error;
|
|
2241
|
+
};
|
|
2242
|
+
/**
|
|
2243
|
+
* Indexing status response.
|
|
2244
|
+
*
|
|
2245
|
+
* Use the `responseCode` field to determine the specific type interpretation
|
|
2246
|
+
* at runtime.
|
|
2247
|
+
*/
|
|
2248
|
+
type IndexingStatusResponse = IndexingStatusResponseOk | IndexingStatusResponseError;
|
|
2249
|
+
|
|
2250
|
+
/**
|
|
2251
|
+
* Serialized representation of {@link IndexingStatusResponseError}.
|
|
2252
|
+
*/
|
|
2253
|
+
type SerializedIndexingStatusResponseError = IndexingStatusResponseError;
|
|
2254
|
+
/**
|
|
2255
|
+
* Serialized representation of {@link IndexingStatusResponseOk}.
|
|
2256
|
+
*/
|
|
2257
|
+
interface SerializedIndexingStatusResponseOk extends Omit<IndexingStatusResponseOk, "realtimeProjection"> {
|
|
2258
|
+
realtimeProjection: SerializedRealtimeIndexingStatusProjection;
|
|
2259
|
+
}
|
|
2260
|
+
/**
|
|
2261
|
+
* Serialized representation of {@link IndexingStatusResponse}.
|
|
2262
|
+
*/
|
|
2263
|
+
type SerializedIndexingStatusResponse = SerializedIndexingStatusResponseOk | SerializedIndexingStatusResponseError;
|
|
2264
|
+
|
|
2265
|
+
/**
|
|
2266
|
+
* Deserialize a {@link IndexingStatusResponse} object.
|
|
2267
|
+
*/
|
|
2268
|
+
declare function deserializeIndexingStatusResponse(maybeResponse: SerializedIndexingStatusResponse): IndexingStatusResponse;
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* Represents a request to Indexing Status API.
|
|
2272
|
+
*/
|
|
2273
|
+
type IndexingStatusRequest = {};
|
|
2274
|
+
|
|
2275
|
+
declare function serializeIndexingStatusResponse(response: IndexingStatusResponse): SerializedIndexingStatusResponse;
|
|
2276
|
+
|
|
2277
|
+
/**
|
|
2278
|
+
* Deserialize a {@link NameTokensResponse} object.
|
|
2279
|
+
*/
|
|
2280
|
+
declare function deserializedNameTokensResponse(maybeResponse: SerializedNameTokensResponse): NameTokensResponse;
|
|
2281
|
+
|
|
2282
|
+
declare const nameTokensPrerequisites: Readonly<{
|
|
2139
2283
|
/**
|
|
2140
|
-
*
|
|
2284
|
+
* Required plugins to enable Name Tokens API routes.
|
|
2285
|
+
*
|
|
2286
|
+
* 1. `registrars` plugin is required so that data in the `registrationLifecycles`
|
|
2287
|
+
* table is populated.
|
|
2288
|
+
* 2. `tokenscope` plugin is required so that data in the `nameTokens`
|
|
2289
|
+
* table is populated.
|
|
2141
2290
|
*/
|
|
2142
|
-
|
|
2291
|
+
requiredPlugins: readonly [PluginName.Registrars, PluginName.TokenScope];
|
|
2143
2292
|
/**
|
|
2144
|
-
*
|
|
2145
|
-
* is associated with.
|
|
2146
|
-
*
|
|
2147
|
-
* Guaranteed to be a subname of the node (namehash) of the subregistry
|
|
2148
|
-
* identified by `subregistryId.subregistryId`.
|
|
2293
|
+
* Check if provided ENSApiPublicConfig supports the Name Tokens API.
|
|
2149
2294
|
*/
|
|
2150
|
-
|
|
2295
|
+
hasEnsIndexerConfigSupport(config: ENSIndexerPublicConfig): boolean;
|
|
2151
2296
|
/**
|
|
2152
|
-
*
|
|
2297
|
+
* Required Indexing Status IDs
|
|
2153
2298
|
*
|
|
2154
|
-
*
|
|
2299
|
+
* Database indexes are created by the time the omnichain indexing status
|
|
2300
|
+
* is either `completed` or `following`.
|
|
2155
2301
|
*/
|
|
2156
|
-
|
|
2302
|
+
supportedIndexingStatusIds: ("omnichain-following" | "omnichain-completed")[];
|
|
2303
|
+
/**
|
|
2304
|
+
* Check if provided indexing status supports the Name Tokens API.
|
|
2305
|
+
*/
|
|
2306
|
+
hasIndexingStatusSupport(omnichainIndexingStatusId: OmnichainIndexingStatusId): boolean;
|
|
2307
|
+
}>;
|
|
2308
|
+
|
|
2309
|
+
/**
|
|
2310
|
+
* Represents request to Name Tokens API.
|
|
2311
|
+
*/
|
|
2312
|
+
interface NameTokensRequestByDomainId {
|
|
2313
|
+
domainId: Node;
|
|
2314
|
+
/**
|
|
2315
|
+
* Name for which name tokens were requested.
|
|
2316
|
+
*/
|
|
2317
|
+
name?: undefined;
|
|
2157
2318
|
}
|
|
2158
2319
|
/**
|
|
2159
|
-
*
|
|
2320
|
+
* Represents request to Name Tokens API.
|
|
2160
2321
|
*/
|
|
2161
|
-
interface
|
|
2162
|
-
|
|
2322
|
+
interface NameTokensRequestByName {
|
|
2323
|
+
domainId?: undefined;
|
|
2324
|
+
/**
|
|
2325
|
+
* Name for which name tokens were requested.
|
|
2326
|
+
*/
|
|
2327
|
+
name: Name;
|
|
2163
2328
|
}
|
|
2164
|
-
|
|
2329
|
+
type NameTokensRequest = NameTokensRequestByDomainId | NameTokensRequestByName;
|
|
2165
2330
|
|
|
2166
2331
|
/**
|
|
2167
|
-
*
|
|
2168
|
-
* associated with the "logical registrar action".
|
|
2332
|
+
* An enum representing the possible CAIP-19 Asset Namespace values.
|
|
2169
2333
|
*/
|
|
2170
|
-
|
|
2334
|
+
declare const AssetNamespaces: {
|
|
2335
|
+
readonly ERC721: "erc721";
|
|
2336
|
+
readonly ERC1155: "erc1155";
|
|
2337
|
+
};
|
|
2338
|
+
type AssetNamespace = (typeof AssetNamespaces)[keyof typeof AssetNamespaces];
|
|
2171
2339
|
/**
|
|
2172
|
-
*
|
|
2340
|
+
* A uint256 value that identifies a specific NFT within a NFT contract.
|
|
2173
2341
|
*/
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2342
|
+
type TokenId = bigint;
|
|
2343
|
+
/**
|
|
2344
|
+
* Serialized representation of {@link TokenId}.
|
|
2345
|
+
*/
|
|
2346
|
+
type SerializedTokenId = string;
|
|
2347
|
+
/**
|
|
2348
|
+
* A globally unique reference to an NFT.
|
|
2349
|
+
*/
|
|
2350
|
+
interface AssetId {
|
|
2351
|
+
assetNamespace: AssetNamespace;
|
|
2352
|
+
contract: AccountId;
|
|
2353
|
+
tokenId: TokenId;
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* Serialized representation of {@link AssetId}.
|
|
2357
|
+
*/
|
|
2358
|
+
interface SerializedAssetId extends Omit<AssetId, "tokenId"> {
|
|
2359
|
+
tokenId: SerializedTokenId;
|
|
2360
|
+
}
|
|
2361
|
+
/**
|
|
2362
|
+
* String representation of an {@link AssetId}.
|
|
2363
|
+
*
|
|
2364
|
+
* Formatted as a fully lowercase CAIP-19 AssetId.
|
|
2365
|
+
*
|
|
2366
|
+
* @see https://chainagnostic.org/CAIPs/caip-19
|
|
2367
|
+
* @example "eip155:1/erc721:0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc"
|
|
2368
|
+
* for vitalik.eth in the eth base registrar on mainnet.
|
|
2369
|
+
*/
|
|
2370
|
+
type AssetIdString = string;
|
|
2371
|
+
/**
|
|
2372
|
+
* Serializes {@link AssetId} object.
|
|
2373
|
+
*/
|
|
2374
|
+
declare function serializeAssetId(assetId: AssetId): SerializedAssetId;
|
|
2375
|
+
/**
|
|
2376
|
+
* Deserialize a {@link AssetId} object.
|
|
2377
|
+
*/
|
|
2378
|
+
declare function deserializeAssetId(maybeAssetId: unknown, valueLabel?: string): AssetId;
|
|
2379
|
+
/**
|
|
2380
|
+
* Format {@link AssetId} object as a string.
|
|
2381
|
+
*/
|
|
2382
|
+
declare function formatAssetId(assetId: AssetId): AssetIdString;
|
|
2383
|
+
/**
|
|
2384
|
+
* Parse a stringified representation of {@link AssetId} object.
|
|
2385
|
+
*/
|
|
2386
|
+
declare function parseAssetId(maybeAssetId: AssetIdString, valueLabel?: string): AssetId;
|
|
2387
|
+
/**
|
|
2388
|
+
* Builds an AssetId for the NFT represented by the given contract,
|
|
2389
|
+
* tokenId, and assetNamespace.
|
|
2390
|
+
*
|
|
2391
|
+
* @param contract - The contract that manages the NFT
|
|
2392
|
+
* @param tokenId - The tokenId of the NFT
|
|
2393
|
+
* @param assetNamespace - The assetNamespace of the NFT
|
|
2394
|
+
* @returns The AssetId for the NFT represented by the given contract,
|
|
2395
|
+
* tokenId, and assetNamespace
|
|
2396
|
+
*/
|
|
2397
|
+
declare const buildAssetId: (contract: AccountId, tokenId: TokenId, assetNamespace: AssetNamespace) => AssetId;
|
|
2398
|
+
/**
|
|
2399
|
+
* A globally unique reference to an NFT tokenizing the ownership of a domain.
|
|
2400
|
+
*/
|
|
2401
|
+
interface DomainAssetId extends AssetId {
|
|
2402
|
+
/**
|
|
2403
|
+
* The namehash (node) of the domain who's ownership is tokenized by
|
|
2404
|
+
* this `AssetId`.
|
|
2405
|
+
*/
|
|
2406
|
+
domainId: Node;
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
* Serialized representation of {@link DomainAssetId}.
|
|
2410
|
+
*/
|
|
2411
|
+
interface SerializedDomainAssetId extends SerializedAssetId {
|
|
2412
|
+
domainId: Node;
|
|
2413
|
+
}
|
|
2414
|
+
declare function serializeDomainAssetId(domainAsset: DomainAssetId): SerializedDomainAssetId;
|
|
2415
|
+
/**
|
|
2416
|
+
* An enum representing the mint status of a DomainAssetId.
|
|
2417
|
+
*
|
|
2418
|
+
* After we index a NFT we never delete it from our index. Instead, when an
|
|
2419
|
+
* indexed NFT is burned onchain we retain its record and update its mint
|
|
2420
|
+
* status as `burned`. If a NFT is minted again after it is burned its mint
|
|
2421
|
+
* status is updated to `minted`.
|
|
2422
|
+
*/
|
|
2423
|
+
declare const NFTMintStatuses: {
|
|
2424
|
+
readonly Minted: "minted";
|
|
2425
|
+
readonly Burned: "burned";
|
|
2177
2426
|
};
|
|
2178
|
-
type
|
|
2427
|
+
type NFTMintStatus = (typeof NFTMintStatuses)[keyof typeof NFTMintStatuses];
|
|
2179
2428
|
/**
|
|
2180
|
-
*
|
|
2429
|
+
* Metadata about a NFT transfer event.
|
|
2430
|
+
*
|
|
2431
|
+
* This metadata can be used for building more helpful messages when processing
|
|
2432
|
+
* NFT transfer events.
|
|
2181
2433
|
*/
|
|
2182
|
-
interface
|
|
2434
|
+
interface NFTTransferEventMetadata {
|
|
2435
|
+
chainId: ChainId;
|
|
2436
|
+
blockNumber: bigint;
|
|
2437
|
+
transactionHash: Hex;
|
|
2438
|
+
eventHandlerName: string;
|
|
2439
|
+
nft: DomainAssetId;
|
|
2440
|
+
}
|
|
2441
|
+
declare const formatNFTTransferEventMetadata: (metadata: NFTTransferEventMetadata) => string;
|
|
2442
|
+
/**
|
|
2443
|
+
* An enum representing the type of transfer that has occurred to a DomainAssetId.
|
|
2444
|
+
*/
|
|
2445
|
+
declare const NFTTransferTypes: {
|
|
2183
2446
|
/**
|
|
2184
|
-
*
|
|
2185
|
-
*
|
|
2186
|
-
* Base cost (before any `premium`) of Ether measured in units of Wei
|
|
2187
|
-
* paid to execute the "logical registrar action".
|
|
2447
|
+
* Initial transfer from zeroAddress to a non-zeroAddress
|
|
2448
|
+
* Can happen at most once to a NFT AssetId
|
|
2188
2449
|
*
|
|
2189
|
-
*
|
|
2450
|
+
* Invariants:
|
|
2451
|
+
* - NFT is not indexed and therefore has no previous mint status or owner
|
|
2452
|
+
* - new NFT mint status is `minted`
|
|
2453
|
+
* - new NFT owner is a non-zeroAddress
|
|
2190
2454
|
*/
|
|
2191
|
-
|
|
2455
|
+
readonly Mint: "mint";
|
|
2192
2456
|
/**
|
|
2193
|
-
*
|
|
2194
|
-
*
|
|
2195
|
-
*
|
|
2196
|
-
* units of Wei paid to execute the "logical registrar action".
|
|
2457
|
+
* Subsequent transfer from zeroAddress to a non-zeroAddress
|
|
2458
|
+
* Can happen any number of times to a NFT AssetId as it passes in a cycle from
|
|
2459
|
+
* mint -> burn -> remint -> burn -> remint -> ...
|
|
2197
2460
|
*
|
|
2198
|
-
*
|
|
2461
|
+
* Invariants:
|
|
2462
|
+
* - NFT is indexed
|
|
2463
|
+
* - previous NFT mint status was `burned`
|
|
2464
|
+
* - previous NFT owner is the zeroAddress
|
|
2465
|
+
* - new NFT mint status is `minted`
|
|
2466
|
+
* - new NFT owner is a non-zeroAddress
|
|
2199
2467
|
*/
|
|
2200
|
-
|
|
2468
|
+
readonly Remint: "remint";
|
|
2201
2469
|
/**
|
|
2202
|
-
*
|
|
2470
|
+
* Special transfer type for improperly implemented NFT contracts that allow a NFT
|
|
2471
|
+
* that is currently minted to be reminted before an intermediate burn.
|
|
2203
2472
|
*
|
|
2204
|
-
*
|
|
2205
|
-
*
|
|
2473
|
+
* Transfer from zeroAddress to non-zeroAddress for an indexed NFT where the
|
|
2474
|
+
* previously indexed nft had status `minted` with a non-zeroAddress owner.
|
|
2206
2475
|
*
|
|
2207
|
-
*
|
|
2476
|
+
* Invariants:
|
|
2477
|
+
* - NFT is indexed
|
|
2478
|
+
* - previous NFT mint status was `minted`
|
|
2479
|
+
* - previous NFT owner was a non-zeroAddress
|
|
2480
|
+
* - new NFT mint status is `minted`
|
|
2481
|
+
* - new NFT owner is a non-zeroAddress
|
|
2208
2482
|
*/
|
|
2209
|
-
|
|
2210
|
-
}
|
|
2211
|
-
/**
|
|
2212
|
-
* Pricing information for a "logical registrar action" when
|
|
2213
|
-
* there is no known pricing data.
|
|
2214
|
-
*/
|
|
2215
|
-
interface RegistrarActionPricingUnknown {
|
|
2483
|
+
readonly MintedRemint: "minted-remint";
|
|
2216
2484
|
/**
|
|
2217
|
-
*
|
|
2485
|
+
* Transfer from a non-zeroAddress to zeroAddress
|
|
2218
2486
|
*
|
|
2219
|
-
*
|
|
2220
|
-
*
|
|
2487
|
+
* Invariants:
|
|
2488
|
+
* - NFT is indexed
|
|
2489
|
+
* - previous NFT mint status was `minted`
|
|
2490
|
+
* - previous NFT owner is a non-zeroAddress
|
|
2491
|
+
* - new NFT mint status is `burned`
|
|
2492
|
+
* - new NFT owner is the zeroAddress
|
|
2221
2493
|
*/
|
|
2222
|
-
|
|
2494
|
+
readonly Burn: "burn";
|
|
2223
2495
|
/**
|
|
2224
|
-
*
|
|
2496
|
+
* Transfer from a non-zeroAddress to a distinct non-zeroAddress
|
|
2225
2497
|
*
|
|
2226
|
-
*
|
|
2227
|
-
*
|
|
2498
|
+
* Invariants:
|
|
2499
|
+
* - NFT is indexed
|
|
2500
|
+
* - previous and new NFT mint status is `minted`
|
|
2501
|
+
* - previous and new NFT owner are distinct non-zeroAddress
|
|
2228
2502
|
*/
|
|
2229
|
-
|
|
2503
|
+
readonly Transfer: "transfer";
|
|
2230
2504
|
/**
|
|
2231
|
-
*
|
|
2505
|
+
* Transfer from a non-zeroAddress to the same non-zeroAddress
|
|
2232
2506
|
*
|
|
2233
|
-
*
|
|
2234
|
-
*
|
|
2507
|
+
* Invariants:
|
|
2508
|
+
* - NFT is indexed
|
|
2509
|
+
* - previous and new NFT mint status is `minted`
|
|
2510
|
+
* - previous and new NFT owner are equivalent non-zeroAddress
|
|
2235
2511
|
*/
|
|
2236
|
-
|
|
2237
|
-
}
|
|
2238
|
-
type RegistrarActionPricing = RegistrarActionPricingAvailable | RegistrarActionPricingUnknown;
|
|
2239
|
-
declare function isRegistrarActionPricingAvailable(registrarActionPricing: RegistrarActionPricing): registrarActionPricing is RegistrarActionPricingAvailable;
|
|
2240
|
-
/**
|
|
2241
|
-
* * Referral information for performing a "logical registrar action".
|
|
2242
|
-
*/
|
|
2243
|
-
interface RegistrarActionReferralAvailable {
|
|
2512
|
+
readonly SelfTransfer: "self-transfer";
|
|
2244
2513
|
/**
|
|
2245
|
-
*
|
|
2514
|
+
* Transfer from zeroAddress to zeroAddress for an indexed NFT
|
|
2246
2515
|
*
|
|
2247
|
-
*
|
|
2248
|
-
*
|
|
2516
|
+
* Invariants:
|
|
2517
|
+
* - NFT is indexed
|
|
2518
|
+
* - previous and new NFT mint status is `burned`
|
|
2519
|
+
* - previous and new NFT owner are zeroAddress
|
|
2249
2520
|
*/
|
|
2250
|
-
|
|
2521
|
+
readonly RemintBurn: "remint-burn";
|
|
2251
2522
|
/**
|
|
2252
|
-
*
|
|
2523
|
+
* Special transfer type for improperly implemented NFT contracts that allow a NFT
|
|
2524
|
+
* that is currently minted to be reminted again before an intermediate burn.
|
|
2253
2525
|
*
|
|
2254
|
-
*
|
|
2255
|
-
* `
|
|
2526
|
+
* Transfer from zeroAddress to zeroAddress for an indexed NFT where the
|
|
2527
|
+
* previously indexed nft had status `minted` with a non-zeroAddress owner.
|
|
2256
2528
|
*
|
|
2257
|
-
*
|
|
2258
|
-
*
|
|
2259
|
-
* `
|
|
2529
|
+
* Invariants:
|
|
2530
|
+
* - NFT is indexed
|
|
2531
|
+
* - previous NFT mint status was `minted`
|
|
2532
|
+
* - previous NFT owner was a non-zeroAddress
|
|
2533
|
+
* - new NFT mint status is `burned`
|
|
2534
|
+
* - new NFT owner is the zeroAddress
|
|
2535
|
+
*/
|
|
2536
|
+
readonly MintedRemintBurn: "minted-remint-burn";
|
|
2537
|
+
/**
|
|
2538
|
+
* Transfer from zeroAddress to zeroAddress for an unindexed NFT
|
|
2260
2539
|
*
|
|
2261
|
-
*
|
|
2262
|
-
*
|
|
2540
|
+
* Invariants:
|
|
2541
|
+
* - NFT is not indexed and therefore has no previous mint status or owner
|
|
2542
|
+
* - NFT should remain unindexed and without any mint status or owner
|
|
2263
2543
|
*/
|
|
2264
|
-
|
|
2265
|
-
}
|
|
2544
|
+
readonly MintBurn: "mint-burn";
|
|
2545
|
+
};
|
|
2546
|
+
type NFTTransferType = (typeof NFTTransferTypes)[keyof typeof NFTTransferTypes];
|
|
2547
|
+
declare const getNFTTransferType: (from: Address, to: Address, allowMintedRemint: boolean, metadata: NFTTransferEventMetadata, currentlyIndexedOwner?: Address) => NFTTransferType;
|
|
2548
|
+
|
|
2266
2549
|
/**
|
|
2267
|
-
*
|
|
2268
|
-
* registrar controller does not implement referrals.
|
|
2550
|
+
* An enum representing the possible Name Token Ownership types.
|
|
2269
2551
|
*/
|
|
2270
|
-
|
|
2552
|
+
declare const NameTokenOwnershipTypes: {
|
|
2271
2553
|
/**
|
|
2272
|
-
*
|
|
2273
|
-
*
|
|
2274
|
-
* Represents the "raw" 32-byte "referrer" value emitted onchain in
|
|
2275
|
-
* association with the registrar action.
|
|
2554
|
+
* Name Token is owned by NameWrapper account.
|
|
2276
2555
|
*/
|
|
2277
|
-
|
|
2556
|
+
readonly NameWrapper: "namewrapper";
|
|
2278
2557
|
/**
|
|
2279
|
-
*
|
|
2280
|
-
*
|
|
2281
|
-
* Decoded referrer according to the subjective interpretation of
|
|
2282
|
-
* `encodedReferrer` defined for ENS Holiday Awards.
|
|
2558
|
+
* Name Token is owned fully onchain.
|
|
2283
2559
|
*
|
|
2560
|
+
* This ownership type can only apply to direct subnames of `.eth`
|
|
2284
2561
|
*/
|
|
2285
|
-
|
|
2286
|
-
}
|
|
2287
|
-
type RegistrarActionReferral = RegistrarActionReferralAvailable | RegistrarActionReferralNotApplicable;
|
|
2288
|
-
declare function isRegistrarActionReferralAvailable(registrarActionReferral: RegistrarActionReferral): registrarActionReferral is RegistrarActionReferralAvailable;
|
|
2289
|
-
/**
|
|
2290
|
-
* "Logical registrar action"
|
|
2291
|
-
*
|
|
2292
|
-
* Represents a state of "logical registrar action". May be built using data
|
|
2293
|
-
* from multiple events within the same "logical" registration / renewal action.
|
|
2294
|
-
*/
|
|
2295
|
-
interface RegistrarAction {
|
|
2562
|
+
readonly FullyOnchain: "fully-onchain";
|
|
2296
2563
|
/**
|
|
2297
|
-
*
|
|
2298
|
-
*
|
|
2299
|
-
* The `id` value is a deterministic and globally unique identifier for
|
|
2300
|
-
* the "logical registrar action".
|
|
2301
|
-
*
|
|
2302
|
-
* The `id` value represents the *initial* onchain event associated with
|
|
2303
|
-
* the "logical registrar action", but the full state of
|
|
2304
|
-
* the "logical registrar action" is an aggregate across each of
|
|
2305
|
-
* the onchain events referenced in the `eventIds` field.
|
|
2306
|
-
*
|
|
2307
|
-
* Guaranteed to be the very first element in `eventIds` array.
|
|
2564
|
+
* Name Token ownership has been transferred to the null address.
|
|
2308
2565
|
*/
|
|
2309
|
-
|
|
2566
|
+
readonly Burned: "burned";
|
|
2310
2567
|
/**
|
|
2311
|
-
*
|
|
2568
|
+
* Name Token ownership is unknown.
|
|
2312
2569
|
*/
|
|
2313
|
-
|
|
2570
|
+
readonly Unknown: "unknown";
|
|
2571
|
+
};
|
|
2572
|
+
type NameTokenOwnershipType = (typeof NameTokenOwnershipTypes)[keyof typeof NameTokenOwnershipTypes];
|
|
2573
|
+
interface NameTokenOwnershipNameWrapper {
|
|
2574
|
+
ownershipType: typeof NameTokenOwnershipTypes.NameWrapper;
|
|
2314
2575
|
/**
|
|
2576
|
+
* Owner
|
|
2315
2577
|
*
|
|
2316
|
-
*
|
|
2317
|
-
*
|
|
2318
|
-
*
|
|
2319
|
-
*
|
|
2320
|
-
* the initial `registrationLifecycle.expiresAt` value that the associated
|
|
2321
|
-
* "registration lifecycle" will be initialized with.
|
|
2322
|
-
* If `type` is "renewal":
|
|
2323
|
-
* - Represents the incremental increase in duration made to
|
|
2324
|
-
* the `registrationLifecycle.expiresAt` value in the associated
|
|
2325
|
-
* "registration lifecycle".
|
|
2326
|
-
*
|
|
2327
|
-
* A "registration lifecycle" may be extended via renewal even after it
|
|
2328
|
-
* expires if it is still within its grace period.
|
|
2329
|
-
*
|
|
2330
|
-
* Consider the following scenario:
|
|
2331
|
-
*
|
|
2332
|
-
* The "registration lifecycle" of a direct subname of .eth is scheduled to
|
|
2333
|
-
* expire on Jan 1, midnight UTC. It is currently 30 days after this
|
|
2334
|
-
* expiration time. Therefore, there are currently another 60 days of grace
|
|
2335
|
-
* period remaining for this name. Anyone can still make a renewal to
|
|
2336
|
-
* extend the "registration lifecycle" of this name.
|
|
2337
|
-
*
|
|
2338
|
-
* Given this scenario, consider the following examples:
|
|
2339
|
-
*
|
|
2340
|
-
* 1. If a renewal is made with 10 days incremental duration,
|
|
2341
|
-
* the "registration lifecycle" for this name will remain in
|
|
2342
|
-
* an "expired" state, but it will now have another 70 days of
|
|
2343
|
-
* grace period remaining.
|
|
2344
|
-
*
|
|
2345
|
-
* 2. If a renewal is made with 50 days incremental duration,
|
|
2346
|
-
* the "registration lifecycle" for this name will no longer be
|
|
2347
|
-
* "expired" and will become "active", but the "registration lifecycle"
|
|
2348
|
-
* will now be scheduled to expire again in 20 days.
|
|
2349
|
-
*
|
|
2350
|
-
* After the "registration lifecycle" for a name becomes expired by more
|
|
2351
|
-
* than its grace period, it can no longer be renewed by anyone and is
|
|
2352
|
-
* considered "released". The name must first be registered again, starting
|
|
2353
|
-
* a new "registration lifecycle" of
|
|
2354
|
-
* active / expired / grace period / released.
|
|
2355
|
-
*
|
|
2356
|
-
* May be 0.
|
|
2357
|
-
*
|
|
2358
|
-
* Guaranteed to be a non-negative bigint value.
|
|
2578
|
+
* Guarantees:
|
|
2579
|
+
* - `owner.address` is not the zero address.
|
|
2580
|
+
* - `owner.chainId` is same as the chainId of the associated NFT,
|
|
2581
|
+
* even if that NFT has been burned.
|
|
2359
2582
|
*/
|
|
2360
|
-
|
|
2583
|
+
owner: AccountId;
|
|
2584
|
+
}
|
|
2585
|
+
interface NameTokenOwnershipFullyOnchain {
|
|
2586
|
+
ownershipType: typeof NameTokenOwnershipTypes.FullyOnchain;
|
|
2361
2587
|
/**
|
|
2362
|
-
*
|
|
2363
|
-
*
|
|
2364
|
-
* Identifies the address that initiated the "logical registrar action" and
|
|
2365
|
-
* is paying the `pricing.total` cost (if applicable).
|
|
2366
|
-
*
|
|
2367
|
-
* It may not be the owner of the name:
|
|
2368
|
-
* 1. When a name is registered, the initial owner of the name may be
|
|
2369
|
-
* distinct from the registrant.
|
|
2370
|
-
* 2. There are no restrictions on who may renew a name.
|
|
2371
|
-
* Therefore the owner of the name may be distinct from the registrant.
|
|
2588
|
+
* Owner
|
|
2372
2589
|
*
|
|
2373
|
-
*
|
|
2374
|
-
* `
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
/**
|
|
2378
|
-
* Registration Lifecycle associated with this "logical registrar action".
|
|
2590
|
+
* Guarantees:
|
|
2591
|
+
* - `owner.address` is not the zero address.
|
|
2592
|
+
* - `owner.chainId` is same as the chainId of the associated NFT,
|
|
2593
|
+
* even if that NFT has been burned.
|
|
2379
2594
|
*/
|
|
2380
|
-
|
|
2595
|
+
owner: AccountId;
|
|
2596
|
+
}
|
|
2597
|
+
interface NameTokenOwnershipBurned {
|
|
2598
|
+
ownershipType: typeof NameTokenOwnershipTypes.Burned;
|
|
2381
2599
|
/**
|
|
2382
|
-
*
|
|
2600
|
+
* Owner
|
|
2601
|
+
*
|
|
2602
|
+
* Guarantees:
|
|
2603
|
+
* - `owner.address` is the zero address.
|
|
2604
|
+
* - `owner.chainId` is same as the chainId of the associated NFT,
|
|
2605
|
+
* even if that NFT has been burned.
|
|
2383
2606
|
*/
|
|
2384
|
-
|
|
2607
|
+
owner: AccountId;
|
|
2608
|
+
}
|
|
2609
|
+
interface NameTokenOwnershipUnknown {
|
|
2610
|
+
ownershipType: typeof NameTokenOwnershipTypes.Unknown;
|
|
2385
2611
|
/**
|
|
2386
|
-
*
|
|
2612
|
+
* Owner
|
|
2613
|
+
*
|
|
2614
|
+
* Guarantees:
|
|
2615
|
+
* - `owner.address` is the zero address.
|
|
2616
|
+
* - `owner.chainId` is same as the chainId of the associated NFT,
|
|
2617
|
+
* even if that NFT has been burned.
|
|
2387
2618
|
*/
|
|
2388
|
-
|
|
2619
|
+
owner: AccountId;
|
|
2620
|
+
}
|
|
2621
|
+
type NameTokenOwnership = NameTokenOwnershipNameWrapper | NameTokenOwnershipFullyOnchain | NameTokenOwnershipBurned | NameTokenOwnershipUnknown;
|
|
2622
|
+
interface NameToken {
|
|
2389
2623
|
/**
|
|
2390
|
-
*
|
|
2391
|
-
*
|
|
2392
|
-
* References the block where the "logical registrar action" was executed.
|
|
2624
|
+
* Token
|
|
2393
2625
|
*
|
|
2394
|
-
*
|
|
2395
|
-
* `
|
|
2626
|
+
* References the NFT that currently or previously tokenized ownership of
|
|
2627
|
+
* `name`.
|
|
2396
2628
|
*/
|
|
2397
|
-
|
|
2629
|
+
token: AssetId;
|
|
2398
2630
|
/**
|
|
2399
|
-
*
|
|
2400
|
-
*
|
|
2401
|
-
* Transaction hash of the transaction associated with
|
|
2402
|
-
* the "logical registrar action".
|
|
2631
|
+
* Owner
|
|
2403
2632
|
*
|
|
2404
|
-
*
|
|
2405
|
-
* `registrationLifecycle.subregistry.subregistryId`.
|
|
2633
|
+
* Identifies the ownership state of the token.
|
|
2406
2634
|
*
|
|
2407
|
-
*
|
|
2408
|
-
*
|
|
2635
|
+
* Guarantees:
|
|
2636
|
+
* - The `ownership.owner.chainId` of this address is the same as is referenced
|
|
2637
|
+
* in `domainAsset.contract.chainId`.
|
|
2409
2638
|
*/
|
|
2410
|
-
|
|
2639
|
+
ownership: NameTokenOwnership;
|
|
2411
2640
|
/**
|
|
2412
|
-
*
|
|
2641
|
+
* The mint status of the token.
|
|
2413
2642
|
*
|
|
2414
|
-
*
|
|
2415
|
-
* the
|
|
2643
|
+
* After ENSNode indexes the token for a name, even if that token is burned,
|
|
2644
|
+
* ENSNode will never forget how the token once represented the name.
|
|
2645
|
+
* When the token for a name is burned, ENSNode remembers this token but
|
|
2646
|
+
* updates its `mintStatus` to `burned`. If this token becomes minted again
|
|
2647
|
+
* after it was burned, its `mintStatus` is updated to `minted` again.
|
|
2416
2648
|
*
|
|
2417
|
-
*
|
|
2418
|
-
*
|
|
2649
|
+
* NOTE: Tokens managed by the .eth BaseRegistrar for
|
|
2650
|
+
* direct subnames of .eth can only be burned when undergoing
|
|
2651
|
+
* a state transition of `minted` -> `burned` -> `minted` all within
|
|
2652
|
+
* the same registrar action for the case that a direct subname of .eth
|
|
2653
|
+
* has expired and has been fully released and is now being registered again.
|
|
2654
|
+
* Since all of those mint status state transitions are processed within
|
|
2655
|
+
* a single block, once the token managed by the .eth BaseRegistrar for
|
|
2656
|
+
* a direct subname of .eth has been minted, our state model will forever
|
|
2657
|
+
* represent it as `minted`.
|
|
2419
2658
|
*
|
|
2420
2659
|
* Guarantees:
|
|
2421
|
-
* -
|
|
2422
|
-
*
|
|
2423
|
-
* - At least 1 eventId.
|
|
2424
|
-
* - Ordered chronologically (ascending) by logIndex within `block.number`.
|
|
2425
|
-
* - The first element in the array is equal to the `id` of
|
|
2426
|
-
* the overall "logical registrar action" record.
|
|
2427
|
-
*
|
|
2428
|
-
* The following ideas are not generalized for ENS overall but happen to
|
|
2429
|
-
* be a characteristic of the scope of our current indexing logic:
|
|
2430
|
-
* 1. These id's always reference events emitted by
|
|
2431
|
-
* a related "BaseRegistrar" contract.
|
|
2432
|
-
* 2. These id's optionally reference events emitted by
|
|
2433
|
-
* a related "Registrar Controller" contract. This is because our
|
|
2434
|
-
* current indexing logic doesn't guarantee to index
|
|
2435
|
-
* all "Registrar Controller" contracts.
|
|
2660
|
+
* - The `mintStatus` will be burned if and only
|
|
2661
|
+
* if `ownership.ownershipType` is `NameTokenOwnershipTypes.Burned`.
|
|
2436
2662
|
*/
|
|
2437
|
-
|
|
2663
|
+
mintStatus: NFTMintStatus;
|
|
2438
2664
|
}
|
|
2439
2665
|
/**
|
|
2440
|
-
* Serialized representation of {@link
|
|
2666
|
+
* Serialized representation of {@link NameToken}.
|
|
2441
2667
|
*/
|
|
2442
|
-
|
|
2668
|
+
interface SerializedNameToken extends Omit<NameToken, "token"> {
|
|
2669
|
+
token: SerializedAssetId;
|
|
2670
|
+
}
|
|
2671
|
+
declare function serializeNameToken(nameToken: NameToken): SerializedNameToken;
|
|
2443
2672
|
/**
|
|
2444
|
-
*
|
|
2673
|
+
* Get all NameWrapper accounts within provided ENS Namespace.
|
|
2674
|
+
*
|
|
2675
|
+
* Guaranteed to return at least one account for ENSRoot Datasource.
|
|
2445
2676
|
*/
|
|
2446
|
-
|
|
2447
|
-
baseCost: SerializedPriceEth;
|
|
2448
|
-
premium: SerializedPriceEth;
|
|
2449
|
-
total: SerializedPriceEth;
|
|
2450
|
-
}
|
|
2677
|
+
declare function getNameWrapperAccounts(namespaceId: ENSNamespaceId): [AccountId, ...AccountId[]];
|
|
2451
2678
|
/**
|
|
2452
|
-
*
|
|
2679
|
+
* Get name token ownership for provided owner account within selected ENS Namespace.
|
|
2453
2680
|
*/
|
|
2454
|
-
|
|
2681
|
+
declare function getNameTokenOwnership(namespaceId: ENSNamespaceId, name: InterpretedName, owner: AccountId): NameTokenOwnership;
|
|
2682
|
+
|
|
2455
2683
|
/**
|
|
2456
|
-
*
|
|
2684
|
+
* Schema for {@link ErrorResponse}.
|
|
2457
2685
|
*/
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
}
|
|
2462
|
-
declare function serializeRegistrarActionPricing(pricing: RegistrarActionPricing): SerializedRegistrarActionPricing;
|
|
2463
|
-
declare function serializeRegistrarAction(registrarAction: RegistrarAction): SerializedRegistrarAction;
|
|
2686
|
+
declare const ErrorResponseSchema: z$1.ZodObject<{
|
|
2687
|
+
message: z$1.ZodString;
|
|
2688
|
+
details: z$1.ZodOptional<z$1.ZodUnknown>;
|
|
2689
|
+
}, z$1.core.$strip>;
|
|
2464
2690
|
|
|
2465
|
-
declare const TheGraphCannotFallbackReasonSchema: z.ZodEnum<{
|
|
2466
|
-
readonly NotSubgraphCompatible: "not-subgraph-compatible";
|
|
2467
|
-
readonly NoApiKey: "no-api-key";
|
|
2468
|
-
readonly NoSubgraphUrl: "no-subgraph-url";
|
|
2469
|
-
}>;
|
|
2470
|
-
declare const TheGraphFallbackSchema: z.ZodObject<{
|
|
2471
|
-
canFallback: z.ZodBoolean;
|
|
2472
|
-
reason: z.ZodNullable<z.ZodEnum<{
|
|
2473
|
-
readonly NotSubgraphCompatible: "not-subgraph-compatible";
|
|
2474
|
-
readonly NoApiKey: "no-api-key";
|
|
2475
|
-
readonly NoSubgraphUrl: "no-subgraph-url";
|
|
2476
|
-
}>>;
|
|
2477
|
-
}, z.core.$strict>;
|
|
2478
2691
|
/**
|
|
2479
|
-
*
|
|
2480
|
-
*
|
|
2481
|
-
* @param valueLabel - Optional label for the value being validated (used in error messages)
|
|
2692
|
+
* API Error Response Type
|
|
2482
2693
|
*/
|
|
2483
|
-
|
|
2484
|
-
version: z.ZodString;
|
|
2485
|
-
theGraphFallback: z.ZodObject<{
|
|
2486
|
-
canFallback: z.ZodBoolean;
|
|
2487
|
-
reason: z.ZodNullable<z.ZodEnum<{
|
|
2488
|
-
readonly NotSubgraphCompatible: "not-subgraph-compatible";
|
|
2489
|
-
readonly NoApiKey: "no-api-key";
|
|
2490
|
-
readonly NoSubgraphUrl: "no-subgraph-url";
|
|
2491
|
-
}>>;
|
|
2492
|
-
}, z.core.$strict>;
|
|
2493
|
-
ensIndexerPublicConfig: z.ZodObject<{
|
|
2494
|
-
labelSet: z.ZodObject<{
|
|
2495
|
-
labelSetId: z.ZodString;
|
|
2496
|
-
labelSetVersion: z.ZodPipe<z.ZodCoercedNumber<unknown>, z.ZodInt>;
|
|
2497
|
-
}, z.core.$strip>;
|
|
2498
|
-
indexedChainIds: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodInt, z.ZodTransform<number, number>>>, z.ZodTransform<Set<number>, number[]>>;
|
|
2499
|
-
isSubgraphCompatible: z.ZodBoolean;
|
|
2500
|
-
namespace: z.ZodEnum<{
|
|
2501
|
-
readonly Mainnet: "mainnet";
|
|
2502
|
-
readonly Sepolia: "sepolia";
|
|
2503
|
-
readonly Holesky: "holesky";
|
|
2504
|
-
readonly EnsTestEnv: "ens-test-env";
|
|
2505
|
-
}>;
|
|
2506
|
-
plugins: z.ZodArray<z.ZodString>;
|
|
2507
|
-
databaseSchemaName: z.ZodString;
|
|
2508
|
-
versionInfo: z.ZodObject<{
|
|
2509
|
-
nodejs: z.ZodString;
|
|
2510
|
-
ponder: z.ZodString;
|
|
2511
|
-
ensDb: z.ZodString;
|
|
2512
|
-
ensIndexer: z.ZodString;
|
|
2513
|
-
ensNormalize: z.ZodString;
|
|
2514
|
-
ensRainbow: z.ZodString;
|
|
2515
|
-
ensRainbowSchema: z.ZodInt;
|
|
2516
|
-
}, z.core.$strict>;
|
|
2517
|
-
}, z.core.$strip>;
|
|
2518
|
-
}, z.core.$strict>;
|
|
2694
|
+
type ErrorResponse = z$1.infer<typeof ErrorResponseSchema>;
|
|
2519
2695
|
|
|
2520
|
-
type TheGraphCannotFallbackReason = z.infer<typeof TheGraphCannotFallbackReasonSchema>;
|
|
2521
|
-
type TheGraphFallback = z.infer<typeof TheGraphFallbackSchema>;
|
|
2522
2696
|
/**
|
|
2523
|
-
*
|
|
2524
|
-
*
|
|
2525
|
-
* Contains ENSApi-specific configuration at the top level and
|
|
2526
|
-
* embeds the complete ENSIndexer public configuration.
|
|
2697
|
+
* Deserialize a {@link ErrorResponse} object.
|
|
2527
2698
|
*/
|
|
2528
|
-
|
|
2699
|
+
declare function deserializeErrorResponse(maybeErrorResponse: unknown): ErrorResponse;
|
|
2700
|
+
|
|
2701
|
+
/**
|
|
2702
|
+
* A status code for Name Tokens API responses.
|
|
2703
|
+
*/
|
|
2704
|
+
declare const NameTokensResponseCodes: {
|
|
2529
2705
|
/**
|
|
2530
|
-
*
|
|
2531
|
-
*
|
|
2532
|
-
* @see https://ghcr.io/namehash/ensnode/ensapi
|
|
2706
|
+
* Represents a response when Name Tokens API can respond with requested data.
|
|
2533
2707
|
*/
|
|
2534
|
-
|
|
2708
|
+
readonly Ok: "ok";
|
|
2535
2709
|
/**
|
|
2536
|
-
*
|
|
2710
|
+
* Represents a response when Name Tokens API could not respond with requested data.
|
|
2537
2711
|
*/
|
|
2538
|
-
|
|
2712
|
+
readonly Error: "error";
|
|
2713
|
+
};
|
|
2714
|
+
/**
|
|
2715
|
+
* The derived string union of possible {@link NameTokensResponseCodes}.
|
|
2716
|
+
*/
|
|
2717
|
+
type NameTokensResponseCode = (typeof NameTokensResponseCodes)[keyof typeof NameTokensResponseCodes];
|
|
2718
|
+
/**
|
|
2719
|
+
* Error codes for Name Tokens API responses with 'error' response code.
|
|
2720
|
+
*/
|
|
2721
|
+
declare const NameTokensResponseErrorCodes: {
|
|
2539
2722
|
/**
|
|
2540
|
-
*
|
|
2723
|
+
* Name tokens not indexed
|
|
2541
2724
|
*
|
|
2542
|
-
*
|
|
2543
|
-
*
|
|
2725
|
+
* Represents an error when tokens for the requested name are not indexed by
|
|
2726
|
+
* the ENSNode instance's configuration.
|
|
2544
2727
|
*/
|
|
2545
|
-
|
|
2546
|
-
}
|
|
2547
|
-
|
|
2548
|
-
/**
|
|
2549
|
-
* Serialized representation of {@link ENSApiPublicConfig}
|
|
2550
|
-
*/
|
|
2551
|
-
interface SerializedENSApiPublicConfig extends Omit<ENSApiPublicConfig, "ensIndexerPublicConfig"> {
|
|
2728
|
+
readonly NameTokensNotIndexed: "name-tokens-not-indexed";
|
|
2552
2729
|
/**
|
|
2553
|
-
*
|
|
2730
|
+
* Unsupported ENSIndexer Config
|
|
2731
|
+
*
|
|
2732
|
+
* Represents a prerequisites error when connected ENSIndexer config lacks
|
|
2733
|
+
* params required to enable Name Tokens API.
|
|
2554
2734
|
*/
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2735
|
+
readonly EnsIndexerConfigUnsupported: "unsupported-ensindexer-config";
|
|
2736
|
+
/**
|
|
2737
|
+
* Unsupported Indexing Status
|
|
2738
|
+
*
|
|
2739
|
+
* Represents a prerequisites error when Indexing Status has not yet reached
|
|
2740
|
+
* status required to enable Name Tokens API.
|
|
2741
|
+
*/
|
|
2742
|
+
readonly IndexingStatusUnsupported: "unsupported-indexing-status";
|
|
2743
|
+
};
|
|
2558
2744
|
/**
|
|
2559
|
-
*
|
|
2745
|
+
* The derived string union of possible {@link NameTokensResponseErrorCodes}.
|
|
2560
2746
|
*/
|
|
2561
|
-
|
|
2562
|
-
|
|
2747
|
+
type NameTokensResponseErrorCode = (typeof NameTokensResponseErrorCodes)[keyof typeof NameTokensResponseErrorCodes];
|
|
2563
2748
|
/**
|
|
2564
|
-
*
|
|
2749
|
+
* Name Tokens for a name who's tokens are configured to
|
|
2750
|
+
* be indexed by the ENSNode instance's configuration.
|
|
2565
2751
|
*/
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
/**
|
|
2569
|
-
* The resolution status for an `Identity`.
|
|
2570
|
-
*/
|
|
2571
|
-
declare const ResolutionStatusIds: {
|
|
2752
|
+
interface RegisteredNameTokens {
|
|
2572
2753
|
/**
|
|
2573
|
-
*
|
|
2754
|
+
* Domain ID
|
|
2574
2755
|
*/
|
|
2575
|
-
|
|
2756
|
+
domainId: Node;
|
|
2576
2757
|
/**
|
|
2577
|
-
*
|
|
2758
|
+
* Name
|
|
2759
|
+
*
|
|
2760
|
+
* FQDN of the name associated with `domainId`.
|
|
2761
|
+
*
|
|
2762
|
+
* Guarantees:
|
|
2763
|
+
* - `namehash(name)` is always `domainId`.
|
|
2578
2764
|
*/
|
|
2579
|
-
|
|
2765
|
+
name: InterpretedName;
|
|
2580
2766
|
/**
|
|
2581
|
-
*
|
|
2582
|
-
|
|
2583
|
-
|
|
2767
|
+
* Name Tokens associated with the `domainId`.
|
|
2768
|
+
*
|
|
2769
|
+
* It contains every tokenized representation of `name` that
|
|
2770
|
+
* has ever been indexed for the given name as of `accurateAsOf`,
|
|
2771
|
+
* even if the given token has been burned or expired.
|
|
2772
|
+
*
|
|
2773
|
+
* Guarantees:
|
|
2774
|
+
* - Always includes at least one name token.
|
|
2775
|
+
* - When it includes more than one name token, it means that:
|
|
2776
|
+
* 1) More than 1 distinct tokenized representation of the ownership of
|
|
2777
|
+
* the `name` has been indexed as of `accurateAsOf`.
|
|
2778
|
+
* 2) All possible permutations of mint statuses of these tokens are
|
|
2779
|
+
* possible:
|
|
2780
|
+
* a) Multiple could be actively minted.
|
|
2781
|
+
* b) Multiple could be burned.
|
|
2782
|
+
* c) Some could be burned, others could be minted.
|
|
2783
|
+
* - Order of name tokens follows the order of onchain events that were
|
|
2784
|
+
* indexed when a token was minted, or burned.
|
|
2785
|
+
* - Each name token has a distinct `token` value which references
|
|
2786
|
+
* the NFT that currently or previously tokenized ownership of `name`.
|
|
2787
|
+
* - Each name token has ownership type (`ownership.ownershipType`) assigned:
|
|
2788
|
+
* - If there's a name token with ownership type
|
|
2789
|
+
* {@link NameTokenOwnershipTypes.NameWrapper}, it means that there must be also
|
|
2790
|
+
* another name token with ownership type either
|
|
2791
|
+
* {@link NameTokenOwnershipTypes.FullyOnchain}, or
|
|
2792
|
+
* {@link NameTokenOwnershipTypes.Unknown}.
|
|
2793
|
+
* - There can be at most one name token with ownership type
|
|
2794
|
+
* {@link NameTokenOwnershipTypes.FullyOnchain}.
|
|
2795
|
+
* - There can be any number of name tokens with ownership type
|
|
2796
|
+
* {@link NameTokenOwnershipTypes.Burned}.
|
|
2797
|
+
*
|
|
2798
|
+
* NOTE: It can be useful to get tokenized representations of the name that
|
|
2799
|
+
* are now burned: This can be helpful for looking up historical activity for
|
|
2800
|
+
* the name, including past buy orders, sell orders, and sales.
|
|
2801
|
+
*
|
|
2802
|
+
* How will the direct subnames of .eth that are wrapped by the NameWrapper
|
|
2803
|
+
* be represented?
|
|
2804
|
+
* 1) A direct subname of .eth that has been registered but
|
|
2805
|
+
* has never been wrapped by the NameWrapper, and:
|
|
2806
|
+
* a) Is still actively minted (independent of its expiry state).
|
|
2807
|
+
* b) Has been burned by sending it to the null address.
|
|
2808
|
+
* 2) A direct subname of .eth that has been registered and
|
|
2809
|
+
* has been wrapped by the NameWrapper, and:
|
|
2810
|
+
* a) Is still actively wrapped by the NameWrapper (independent of its
|
|
2811
|
+
* expiry state).
|
|
2812
|
+
* b) Is no longer wrapped by the NameWrapper, but is still actively
|
|
2813
|
+
* minted by the BaseRegistrar (independent of its expiry state).
|
|
2814
|
+
* c) Is no longer wrapped by the NameWrapper, and is also no longer
|
|
2815
|
+
* minted by the BaseRegistrar (both tokens now burned by sending to
|
|
2816
|
+
* the null address).
|
|
2817
|
+
*/
|
|
2818
|
+
tokens: NameToken[];
|
|
2819
|
+
/**
|
|
2820
|
+
* Expiry date for the Registration Lifecycle
|
|
2821
|
+
*
|
|
2822
|
+
* The latest Registration Lifecycle for a node referenced in `domainId`.
|
|
2823
|
+
*/
|
|
2824
|
+
expiresAt: UnixTimestamp$1;
|
|
2825
|
+
/**
|
|
2826
|
+
* The {@link UnixTimestamp} of when the data used to build the {@link NameTokensResponseOk.nameTokens} was accurate as of.
|
|
2827
|
+
*/
|
|
2828
|
+
accurateAsOf: UnixTimestamp$1;
|
|
2829
|
+
}
|
|
2830
|
+
/**
|
|
2831
|
+
* A response when Name Tokens API can respond with requested data.
|
|
2832
|
+
*/
|
|
2833
|
+
type NameTokensResponseOk = {
|
|
2834
|
+
responseCode: typeof NameTokensResponseCodes.Ok;
|
|
2584
2835
|
/**
|
|
2585
|
-
*
|
|
2586
|
-
* and therefore it is unknown if the `Identity` resolves to a named or unnamed identity.
|
|
2836
|
+
* Name Tokens for the requested name.
|
|
2587
2837
|
*/
|
|
2588
|
-
|
|
2838
|
+
registeredNameTokens: RegisteredNameTokens;
|
|
2589
2839
|
};
|
|
2590
2840
|
/**
|
|
2591
|
-
*
|
|
2841
|
+
* Represents an error response when requested name was not indexed by ENSNode.
|
|
2592
2842
|
*/
|
|
2593
|
-
|
|
2843
|
+
interface NameTokensResponseErrorNameTokensNotIndexed {
|
|
2844
|
+
responseCode: typeof NameTokensResponseCodes.Error;
|
|
2845
|
+
errorCode: typeof NameTokensResponseErrorCodes.NameTokensNotIndexed;
|
|
2846
|
+
error: ErrorResponse;
|
|
2847
|
+
}
|
|
2594
2848
|
/**
|
|
2595
|
-
* Represents an
|
|
2596
|
-
*
|
|
2597
|
-
* Invariants:
|
|
2598
|
-
* - `resolutionStatus` is always {@link ResolutionStatusIds.Unresolved}.
|
|
2849
|
+
* Represents an error response when connected ENSIndexer config lacks
|
|
2850
|
+
* params required to enable Name Tokens API.
|
|
2599
2851
|
*/
|
|
2600
|
-
interface
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
* identity associated with `address`.
|
|
2605
|
-
*/
|
|
2606
|
-
chainId: DefaultableChainId;
|
|
2607
|
-
/**
|
|
2608
|
-
* The {@link Address} of the identity.
|
|
2609
|
-
*/
|
|
2610
|
-
address: Address;
|
|
2852
|
+
interface NameTokensResponseErrorEnsIndexerConfigUnsupported {
|
|
2853
|
+
responseCode: typeof NameTokensResponseCodes.Error;
|
|
2854
|
+
errorCode: typeof NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported;
|
|
2855
|
+
error: ErrorResponse;
|
|
2611
2856
|
}
|
|
2612
2857
|
/**
|
|
2613
|
-
* Represents an
|
|
2614
|
-
*
|
|
2615
|
-
* Invariants:
|
|
2616
|
-
* - `resolutionStatus` is always {@link ResolutionStatusIds.Named}.
|
|
2858
|
+
* Represents an error response when Indexing Status has not yet reached
|
|
2859
|
+
* status required to enable Name Tokens API.
|
|
2617
2860
|
*/
|
|
2618
|
-
interface
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
* identity associated with `address`.
|
|
2623
|
-
*/
|
|
2624
|
-
chainId: DefaultableChainId;
|
|
2625
|
-
/**
|
|
2626
|
-
* The address of the identity.
|
|
2627
|
-
*/
|
|
2628
|
-
address: Address;
|
|
2629
|
-
/**
|
|
2630
|
-
* The ENSIP-19 primary name lookup result of `address` on `chainId`.
|
|
2631
|
-
*/
|
|
2632
|
-
name: Name;
|
|
2861
|
+
interface NameTokensResponseErrorIndexingStatusUnsupported {
|
|
2862
|
+
responseCode: typeof NameTokensResponseCodes.Error;
|
|
2863
|
+
errorCode: typeof NameTokensResponseErrorCodes.IndexingStatusUnsupported;
|
|
2864
|
+
error: ErrorResponse;
|
|
2633
2865
|
}
|
|
2866
|
+
type NameTokensResponseError = NameTokensResponseErrorNameTokensNotIndexed | NameTokensResponseErrorEnsIndexerConfigUnsupported | NameTokensResponseErrorIndexingStatusUnsupported;
|
|
2634
2867
|
/**
|
|
2635
|
-
*
|
|
2868
|
+
* Name Tokens response.
|
|
2636
2869
|
*
|
|
2637
|
-
*
|
|
2638
|
-
*
|
|
2639
|
-
* - `name` is always `null`.
|
|
2870
|
+
* Use the `responseCode` field to determine the specific type interpretation
|
|
2871
|
+
* at runtime.
|
|
2640
2872
|
*/
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
/**
|
|
2653
|
-
* The ENSIP-19 primary name lookup result of `address` on `chainId`.
|
|
2654
|
-
*/
|
|
2655
|
-
name: null;
|
|
2873
|
+
type NameTokensResponse = NameTokensResponseOk | NameTokensResponseError;
|
|
2874
|
+
|
|
2875
|
+
/**
|
|
2876
|
+
* Serialized representation of {@link NameTokensResponseError}.
|
|
2877
|
+
*/
|
|
2878
|
+
type SerializedNameTokensResponseError = NameTokensResponseError;
|
|
2879
|
+
/**
|
|
2880
|
+
* Serialized representation of {@link RegisteredNameToken}.
|
|
2881
|
+
*/
|
|
2882
|
+
interface SerializedRegisteredNameTokens extends Omit<RegisteredNameTokens, "tokens"> {
|
|
2883
|
+
tokens: SerializedNameToken[];
|
|
2656
2884
|
}
|
|
2657
2885
|
/**
|
|
2658
|
-
*
|
|
2659
|
-
* resulted in an error and therefore it is unknown if the `Identity` resolves to a named
|
|
2660
|
-
* or unnamed identity.
|
|
2661
|
-
*
|
|
2662
|
-
* Invariants:
|
|
2663
|
-
* - `resolutionStatus` is always {@link ResolutionStatusIds.Unknown}.
|
|
2886
|
+
* Serialized representation of {@link NameTokensResponseOk}.
|
|
2664
2887
|
*/
|
|
2665
|
-
interface
|
|
2666
|
-
|
|
2667
|
-
/**
|
|
2668
|
-
* The {@link DefaultableChainId} for an ENSIP-19 primary name lookup of the
|
|
2669
|
-
* identity associated with `address`.
|
|
2670
|
-
*/
|
|
2671
|
-
chainId: DefaultableChainId;
|
|
2672
|
-
/**
|
|
2673
|
-
* The address of the identity.
|
|
2674
|
-
*/
|
|
2675
|
-
address: Address;
|
|
2888
|
+
interface SerializedNameTokensResponseOk extends Omit<NameTokensResponseOk, "registeredNameTokens"> {
|
|
2889
|
+
registeredNameTokens: SerializedRegisteredNameTokens;
|
|
2676
2890
|
}
|
|
2677
2891
|
/**
|
|
2678
|
-
*
|
|
2892
|
+
* Serialized representation of {@link NameTokensResponse}.
|
|
2893
|
+
*/
|
|
2894
|
+
type SerializedNameTokensResponse = SerializedNameTokensResponseOk | SerializedNameTokensResponseError;
|
|
2895
|
+
|
|
2896
|
+
declare function serializeRegisteredNameTokens({ domainId, name, tokens, expiresAt, accurateAsOf, }: RegisteredNameTokens): SerializedRegisteredNameTokens;
|
|
2897
|
+
declare function serializeNameTokensResponse(response: NameTokensResponse): SerializedNameTokensResponse;
|
|
2898
|
+
|
|
2899
|
+
/**
|
|
2900
|
+
* Gets the SubregistryId (an AccountId) of the Basenames Subregistry contract (this is the
|
|
2901
|
+
* "BaseRegistrar" contract for Basenames) for the provided namespace.
|
|
2679
2902
|
*
|
|
2680
|
-
*
|
|
2681
|
-
*
|
|
2903
|
+
* @param namespace The ENS namespace to get the Basenames Subregistry ID for
|
|
2904
|
+
* @returns The AccountId for the Basenames Subregistry contract for the provided namespace.
|
|
2905
|
+
* @throws Error if the contract is not found for the given namespace.
|
|
2682
2906
|
*/
|
|
2683
|
-
|
|
2907
|
+
declare function getBasenamesSubregistryId(namespace: ENSNamespaceId): AccountId;
|
|
2684
2908
|
/**
|
|
2685
|
-
*
|
|
2686
|
-
* resolved to a result yet).
|
|
2909
|
+
* Get the managed name for the Basenames subregistry for the selected ENS namespace.
|
|
2687
2910
|
*
|
|
2688
|
-
*
|
|
2689
|
-
*
|
|
2911
|
+
* @param namespaceId
|
|
2912
|
+
* @returns registrar managed name
|
|
2913
|
+
* @throws an error when no registrar managed name could be returned
|
|
2690
2914
|
*/
|
|
2691
|
-
|
|
2915
|
+
declare function getBasenamesSubregistryManagedName(namespaceId: ENSNamespaceId): Name;
|
|
2692
2916
|
|
|
2693
2917
|
/**
|
|
2694
|
-
*
|
|
2695
|
-
*
|
|
2918
|
+
* Gets the SubregistryId (an AccountId) of the Ethnames Subregistry contract (this is the
|
|
2919
|
+
* "BaseRegistrar" contract for direct subnames of .eth) for the provided namespace.
|
|
2696
2920
|
*
|
|
2697
|
-
*
|
|
2698
|
-
*
|
|
2921
|
+
* @param namespace The ENS namespace to get the Ethnames Subregistry ID for
|
|
2922
|
+
* @returns The AccountId for the Ethnames Subregistry contract for the provided namespace.
|
|
2923
|
+
* @throws Error if the contract is not found for the given namespace.
|
|
2699
2924
|
*/
|
|
2700
|
-
declare function
|
|
2925
|
+
declare function getEthnamesSubregistryId(namespace: ENSNamespaceId): AccountId;
|
|
2701
2926
|
/**
|
|
2702
|
-
*
|
|
2927
|
+
* Get the managed name for the Ethnames subregistry for the selected ENS namespace.
|
|
2703
2928
|
*
|
|
2704
|
-
* @param
|
|
2705
|
-
* @returns
|
|
2929
|
+
* @param namespaceId
|
|
2930
|
+
* @returns registrar managed name
|
|
2706
2931
|
*/
|
|
2707
|
-
declare function
|
|
2932
|
+
declare function getEthnamesSubregistryManagedName(namespaceId: ENSNamespaceId): Name;
|
|
2708
2933
|
|
|
2709
2934
|
/**
|
|
2710
|
-
* Gets the
|
|
2711
|
-
*
|
|
2712
|
-
*
|
|
2713
|
-
* ENSIP-19 defines special rules for the "chainId param" used
|
|
2714
|
-
* in primary name resolutions for the case that the `chainId` is the
|
|
2715
|
-
* ENS Root Chain Id for the provided `namespaceId`.
|
|
2716
|
-
*
|
|
2717
|
-
* Whenever this case happens, ENSIP-19 requires that the
|
|
2718
|
-
* "chainId param" is always set to chainId: 1 (mainnet), even if the
|
|
2719
|
-
* `chainId` where the primary name lookup is actually happening
|
|
2720
|
-
* on a non-mainnet ENS Root Chain, such as on a testnet or
|
|
2721
|
-
* the ens-test-env.
|
|
2935
|
+
* Gets the SubregistryId (an AccountId) of the Lineanames Subregistry contract (this is the
|
|
2936
|
+
* "BaseRegistrar" contract for Lineanames) for the provided namespace.
|
|
2722
2937
|
*
|
|
2723
|
-
* @param
|
|
2724
|
-
* @
|
|
2725
|
-
* @
|
|
2938
|
+
* @param namespace The ENS namespace to get the Lineanames Subregistry ID for
|
|
2939
|
+
* @returns The AccountId for the Lineanames Subregistry contract for the provided namespace.
|
|
2940
|
+
* @throws Error if the contract is not found for the given namespace.
|
|
2726
2941
|
*/
|
|
2727
|
-
declare
|
|
2942
|
+
declare function getLineanamesSubregistryId(namespace: ENSNamespaceId): AccountId;
|
|
2728
2943
|
/**
|
|
2729
|
-
*
|
|
2730
|
-
* such that if the provided `chainId` is `DEFAULT_EVM_CHAIN_ID`,
|
|
2731
|
-
* the `ChainId` of the ENS Root Chain for the provided `namespaceId` is returned.
|
|
2944
|
+
* Get the managed name for the Lineanames subregistry for the selected ENS namespace.
|
|
2732
2945
|
*
|
|
2733
|
-
* @param
|
|
2734
|
-
* @
|
|
2735
|
-
* @
|
|
2946
|
+
* @param namespaceId
|
|
2947
|
+
* @returns registrar managed name
|
|
2948
|
+
* @throws an error when no registrar managed name could be returned
|
|
2736
2949
|
*/
|
|
2737
|
-
declare
|
|
2950
|
+
declare function getLineanamesSubregistryManagedName(namespaceId: ENSNamespaceId): Name;
|
|
2738
2951
|
|
|
2739
2952
|
/**
|
|
2740
|
-
*
|
|
2953
|
+
* Subregistry
|
|
2741
2954
|
*/
|
|
2742
|
-
interface
|
|
2955
|
+
interface Subregistry {
|
|
2743
2956
|
/**
|
|
2744
|
-
*
|
|
2745
|
-
* Reverse Resolution.
|
|
2957
|
+
* Subregistry ID
|
|
2746
2958
|
*
|
|
2747
|
-
*
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
* Which coinTypes to fetch address records for.
|
|
2959
|
+
* The ID of the subregistry the "logical registrar action" was taken on.
|
|
2960
|
+
*
|
|
2961
|
+
* Identifies the chainId and address of the associated subregistry smart
|
|
2962
|
+
* contract.
|
|
2752
2963
|
*/
|
|
2753
|
-
|
|
2964
|
+
subregistryId: AccountId;
|
|
2754
2965
|
/**
|
|
2755
|
-
*
|
|
2966
|
+
* The node (namehash) of the name the subregistry manages subnames of.
|
|
2967
|
+
* Example subregistry managed names:
|
|
2968
|
+
* - `eth`
|
|
2969
|
+
* - `base.eth`
|
|
2970
|
+
* - `linea.eth`
|
|
2756
2971
|
*/
|
|
2757
|
-
|
|
2972
|
+
node: Node;
|
|
2758
2973
|
}
|
|
2759
|
-
declare const isSelectionEmpty: (selection: ResolverRecordsSelection) => boolean;
|
|
2760
2974
|
|
|
2761
2975
|
/**
|
|
2762
|
-
*
|
|
2763
|
-
*
|
|
2764
|
-
*
|
|
2976
|
+
* Registration Lifecycle Stages
|
|
2977
|
+
*
|
|
2978
|
+
* Important: this definition should not be used anywhere.
|
|
2979
|
+
* It's only here to capture some ideas that were shared in the team.
|
|
2765
2980
|
*/
|
|
2766
|
-
|
|
2981
|
+
declare const RegistrationLifecycleStages: {
|
|
2767
2982
|
/**
|
|
2768
|
-
*
|
|
2769
|
-
*
|
|
2983
|
+
* Active
|
|
2984
|
+
*
|
|
2985
|
+
* Happens when
|
|
2986
|
+
* the current timestamp <= expiry.
|
|
2770
2987
|
*/
|
|
2771
|
-
|
|
2988
|
+
readonly Active: "registrationLifecycle_active";
|
|
2772
2989
|
/**
|
|
2773
|
-
*
|
|
2774
|
-
* Value is null if no record for the specified CoinType is set.
|
|
2990
|
+
* Grace Period
|
|
2775
2991
|
*
|
|
2776
|
-
*
|
|
2777
|
-
*
|
|
2778
|
-
* the format your application expects.
|
|
2992
|
+
* Happens when
|
|
2993
|
+
* `expiry < the current timestamp <= expiry + 90 days`.
|
|
2779
2994
|
*/
|
|
2780
|
-
|
|
2995
|
+
readonly GracePeriod: "registrationLifecycle_gracePeriod";
|
|
2781
2996
|
/**
|
|
2782
|
-
*
|
|
2783
|
-
*
|
|
2997
|
+
* Released with Temporary Premium Price
|
|
2998
|
+
*
|
|
2999
|
+
* Happens when
|
|
3000
|
+
* `expiry + 90 days < the current timestamp <= expiry + 120 days`.
|
|
2784
3001
|
*/
|
|
2785
|
-
|
|
3002
|
+
readonly ReleasedWithTempPrice: "registrationLifecycle_releasedWithTempPrice";
|
|
3003
|
+
/**
|
|
3004
|
+
* Fully Released (Regular Price)
|
|
3005
|
+
*
|
|
3006
|
+
* Happens when
|
|
3007
|
+
* ` expiry + 120 days < the current timestamp`.
|
|
3008
|
+
*/
|
|
3009
|
+
readonly FullyReleased: "registrationLifecycle_fullyReleased";
|
|
2786
3010
|
};
|
|
3011
|
+
type RegistrationLifecycleStage = (typeof RegistrationLifecycleStages)[keyof typeof RegistrationLifecycleStages];
|
|
2787
3012
|
/**
|
|
2788
|
-
*
|
|
2789
|
-
*
|
|
2790
|
-
* @example
|
|
2791
|
-
* ```typescript
|
|
2792
|
-
* const selection = {
|
|
2793
|
-
* name: true,
|
|
2794
|
-
* addresses: [60],
|
|
2795
|
-
* texts: ["com.twitter", "avatar"],
|
|
2796
|
-
* } as const satisfies ResolverRecordsSelection;
|
|
2797
|
-
*
|
|
2798
|
-
* type Response = ResolverRecordsResponse<typeof selection>;
|
|
2799
|
-
*
|
|
2800
|
-
* // results in the following type
|
|
2801
|
-
* type Response = {
|
|
2802
|
-
* readonly name: Name | null;
|
|
2803
|
-
* readonly addresses: Record<"60", string | null>;
|
|
2804
|
-
* readonly texts: Record<"avatar" | "com.twitter", string | null>;
|
|
2805
|
-
* }
|
|
2806
|
-
* ```
|
|
3013
|
+
* Registration Lifecycle
|
|
2807
3014
|
*/
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
3015
|
+
interface RegistrationLifecycle {
|
|
3016
|
+
/**
|
|
3017
|
+
* Subregistry that manages this Registration Lifecycle.
|
|
3018
|
+
*/
|
|
3019
|
+
subregistry: Subregistry;
|
|
3020
|
+
/**
|
|
3021
|
+
* The node (namehash) of the FQDN of the domain the registration lifecycle
|
|
3022
|
+
* is associated with.
|
|
3023
|
+
*
|
|
3024
|
+
* Guaranteed to be a subname of the node (namehash) of the subregistry
|
|
3025
|
+
* identified by `subregistryId.subregistryId`.
|
|
3026
|
+
*/
|
|
3027
|
+
node: Node;
|
|
3028
|
+
/**
|
|
3029
|
+
* Expires at
|
|
3030
|
+
*
|
|
3031
|
+
* Identifies when the Registration Lifecycle is scheduled to expire.
|
|
3032
|
+
*/
|
|
3033
|
+
expiresAt: UnixTimestamp;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
/**
|
|
3037
|
+
* Globally unique, deterministic ID of an indexed onchain event
|
|
3038
|
+
* associated with the "logical registrar action".
|
|
3039
|
+
*/
|
|
3040
|
+
type RegistrarActionEventId = string;
|
|
3041
|
+
/**
|
|
3042
|
+
* Types of "logical registrar action".
|
|
3043
|
+
*/
|
|
3044
|
+
declare const RegistrarActionTypes: {
|
|
3045
|
+
readonly Registration: "registration";
|
|
3046
|
+
readonly Renewal: "renewal";
|
|
3047
|
+
};
|
|
3048
|
+
type RegistrarActionType = (typeof RegistrarActionTypes)[keyof typeof RegistrarActionTypes];
|
|
3049
|
+
/**
|
|
3050
|
+
* Pricing information for a "logical registrar action".
|
|
3051
|
+
*/
|
|
3052
|
+
interface RegistrarActionPricingAvailable {
|
|
3053
|
+
/**
|
|
3054
|
+
* Base cost
|
|
3055
|
+
*
|
|
3056
|
+
* Base cost (before any `premium`) of Ether measured in units of Wei
|
|
3057
|
+
* paid to execute the "logical registrar action".
|
|
3058
|
+
*
|
|
3059
|
+
* May be 0.
|
|
3060
|
+
*/
|
|
3061
|
+
baseCost: PriceEth;
|
|
3062
|
+
/**
|
|
3063
|
+
* Premium
|
|
3064
|
+
*
|
|
3065
|
+
* "premium" cost (in excesses of the `baseCost`) of Ether measured in
|
|
3066
|
+
* units of Wei paid to execute the "logical registrar action".
|
|
3067
|
+
*
|
|
3068
|
+
* May be 0.
|
|
3069
|
+
*/
|
|
3070
|
+
premium: PriceEth;
|
|
3071
|
+
/**
|
|
3072
|
+
* Total
|
|
3073
|
+
*
|
|
3074
|
+
* Total cost of Ether measured in units of Wei paid to execute
|
|
3075
|
+
* the "logical registrar action".
|
|
3076
|
+
*
|
|
3077
|
+
* May be 0.
|
|
3078
|
+
*/
|
|
3079
|
+
total: PriceEth;
|
|
3080
|
+
}
|
|
3081
|
+
/**
|
|
3082
|
+
* Pricing information for a "logical registrar action" when
|
|
3083
|
+
* there is no known pricing data.
|
|
3084
|
+
*/
|
|
3085
|
+
interface RegistrarActionPricingUnknown {
|
|
3086
|
+
/**
|
|
3087
|
+
* Base cost
|
|
3088
|
+
*
|
|
3089
|
+
* Base cost (before any `premium`) of Ether measured in units of Wei
|
|
3090
|
+
* paid to execute the "logical registrar action".
|
|
3091
|
+
*/
|
|
3092
|
+
baseCost: null;
|
|
3093
|
+
/**
|
|
3094
|
+
* Premium
|
|
3095
|
+
*
|
|
3096
|
+
* "premium" cost (in excesses of the `baseCost`) of Ether measured in
|
|
3097
|
+
* units of Wei paid to execute the "logical registrar action".
|
|
3098
|
+
*/
|
|
3099
|
+
premium: null;
|
|
3100
|
+
/**
|
|
3101
|
+
* Total
|
|
3102
|
+
*
|
|
3103
|
+
* Total cost of Ether measured in units of Wei paid to execute
|
|
3104
|
+
* the "logical registrar action".
|
|
3105
|
+
*/
|
|
3106
|
+
total: null;
|
|
3107
|
+
}
|
|
3108
|
+
type RegistrarActionPricing = RegistrarActionPricingAvailable | RegistrarActionPricingUnknown;
|
|
3109
|
+
declare function isRegistrarActionPricingAvailable(registrarActionPricing: RegistrarActionPricing): registrarActionPricing is RegistrarActionPricingAvailable;
|
|
3110
|
+
/**
|
|
3111
|
+
* * Referral information for performing a "logical registrar action".
|
|
3112
|
+
*/
|
|
3113
|
+
interface RegistrarActionReferralAvailable {
|
|
3114
|
+
/**
|
|
3115
|
+
* Encoded Referrer
|
|
3116
|
+
*
|
|
3117
|
+
* Represents the "raw" 32-byte "referrer" value emitted onchain in
|
|
3118
|
+
* association with the registrar action.
|
|
3119
|
+
*/
|
|
3120
|
+
encodedReferrer: EncodedReferrer;
|
|
3121
|
+
/**
|
|
3122
|
+
* Decoded Referrer
|
|
3123
|
+
*
|
|
3124
|
+
* Decoded referrer according to the subjective interpretation of
|
|
3125
|
+
* `encodedReferrer` defined for ENS Holiday Awards.
|
|
3126
|
+
*
|
|
3127
|
+
* Identifies the interpreted address of the referrer.
|
|
3128
|
+
* The "chainId" of this address is the same as is referenced in
|
|
3129
|
+
* `subregistryId`.
|
|
3130
|
+
*
|
|
3131
|
+
* May be the "zero address" to represent that an `encodedReferrer` is
|
|
3132
|
+
* defined but that it is interpreted as no referrer.
|
|
3133
|
+
*/
|
|
3134
|
+
decodedReferrer: Address;
|
|
3135
|
+
}
|
|
3136
|
+
/**
|
|
3137
|
+
* Referral information for performing a "logical registrar action" when
|
|
3138
|
+
* registrar controller does not implement referrals.
|
|
3139
|
+
*/
|
|
3140
|
+
interface RegistrarActionReferralNotApplicable {
|
|
3141
|
+
/**
|
|
3142
|
+
* Encoded Referrer
|
|
3143
|
+
*
|
|
3144
|
+
* Represents the "raw" 32-byte "referrer" value emitted onchain in
|
|
3145
|
+
* association with the registrar action.
|
|
3146
|
+
*/
|
|
3147
|
+
encodedReferrer: null;
|
|
3148
|
+
/**
|
|
3149
|
+
* Decoded Referrer
|
|
3150
|
+
*
|
|
3151
|
+
* Decoded referrer according to the subjective interpretation of
|
|
3152
|
+
* `encodedReferrer` defined for ENS Holiday Awards.
|
|
3153
|
+
*
|
|
3154
|
+
*/
|
|
3155
|
+
decodedReferrer: null;
|
|
3156
|
+
}
|
|
3157
|
+
type RegistrarActionReferral = RegistrarActionReferralAvailable | RegistrarActionReferralNotApplicable;
|
|
3158
|
+
declare function isRegistrarActionReferralAvailable(registrarActionReferral: RegistrarActionReferral): registrarActionReferral is RegistrarActionReferralAvailable;
|
|
3159
|
+
/**
|
|
3160
|
+
* "Logical registrar action"
|
|
3161
|
+
*
|
|
3162
|
+
* Represents a state of "logical registrar action". May be built using data
|
|
3163
|
+
* from multiple events within the same "logical" registration / renewal action.
|
|
3164
|
+
*/
|
|
3165
|
+
interface RegistrarAction {
|
|
3166
|
+
/**
|
|
3167
|
+
* "Logical registrar action" ID
|
|
3168
|
+
*
|
|
3169
|
+
* The `id` value is a deterministic and globally unique identifier for
|
|
3170
|
+
* the "logical registrar action".
|
|
3171
|
+
*
|
|
3172
|
+
* The `id` value represents the *initial* onchain event associated with
|
|
3173
|
+
* the "logical registrar action", but the full state of
|
|
3174
|
+
* the "logical registrar action" is an aggregate across each of
|
|
3175
|
+
* the onchain events referenced in the `eventIds` field.
|
|
3176
|
+
*
|
|
3177
|
+
* Guaranteed to be the very first element in `eventIds` array.
|
|
3178
|
+
*/
|
|
3179
|
+
id: RegistrarActionEventId;
|
|
3180
|
+
/**
|
|
3181
|
+
* The type of the "logical registrar action".
|
|
3182
|
+
*/
|
|
3183
|
+
type: RegistrarActionType;
|
|
3184
|
+
/**
|
|
3185
|
+
*
|
|
3186
|
+
* Incremental Duration
|
|
3187
|
+
*
|
|
3188
|
+
* If `type` is "registration":
|
|
3189
|
+
* - Represents the duration between `block.timestamp` and
|
|
3190
|
+
* the initial `registrationLifecycle.expiresAt` value that the associated
|
|
3191
|
+
* "registration lifecycle" will be initialized with.
|
|
3192
|
+
* If `type` is "renewal":
|
|
3193
|
+
* - Represents the incremental increase in duration made to
|
|
3194
|
+
* the `registrationLifecycle.expiresAt` value in the associated
|
|
3195
|
+
* "registration lifecycle".
|
|
3196
|
+
*
|
|
3197
|
+
* A "registration lifecycle" may be extended via renewal even after it
|
|
3198
|
+
* expires if it is still within its grace period.
|
|
3199
|
+
*
|
|
3200
|
+
* Consider the following scenario:
|
|
3201
|
+
*
|
|
3202
|
+
* The "registration lifecycle" of a direct subname of .eth is scheduled to
|
|
3203
|
+
* expire on Jan 1, midnight UTC. It is currently 30 days after this
|
|
3204
|
+
* expiration time. Therefore, there are currently another 60 days of grace
|
|
3205
|
+
* period remaining for this name. Anyone can still make a renewal to
|
|
3206
|
+
* extend the "registration lifecycle" of this name.
|
|
3207
|
+
*
|
|
3208
|
+
* Given this scenario, consider the following examples:
|
|
3209
|
+
*
|
|
3210
|
+
* 1. If a renewal is made with 10 days incremental duration,
|
|
3211
|
+
* the "registration lifecycle" for this name will remain in
|
|
3212
|
+
* an "expired" state, but it will now have another 70 days of
|
|
3213
|
+
* grace period remaining.
|
|
3214
|
+
*
|
|
3215
|
+
* 2. If a renewal is made with 50 days incremental duration,
|
|
3216
|
+
* the "registration lifecycle" for this name will no longer be
|
|
3217
|
+
* "expired" and will become "active", but the "registration lifecycle"
|
|
3218
|
+
* will now be scheduled to expire again in 20 days.
|
|
3219
|
+
*
|
|
3220
|
+
* After the "registration lifecycle" for a name becomes expired by more
|
|
3221
|
+
* than its grace period, it can no longer be renewed by anyone and is
|
|
3222
|
+
* considered "released". The name must first be registered again, starting
|
|
3223
|
+
* a new "registration lifecycle" of
|
|
3224
|
+
* active / expired / grace period / released.
|
|
3225
|
+
*
|
|
3226
|
+
* May be 0.
|
|
3227
|
+
*
|
|
3228
|
+
* Guaranteed to be a non-negative bigint value.
|
|
3229
|
+
*/
|
|
3230
|
+
incrementalDuration: Duration;
|
|
3231
|
+
/**
|
|
3232
|
+
* Registrant
|
|
3233
|
+
*
|
|
3234
|
+
* Identifies the address that initiated the "logical registrar action" and
|
|
3235
|
+
* is paying the `pricing.total` cost (if applicable).
|
|
3236
|
+
*
|
|
3237
|
+
* It may not be the owner of the name:
|
|
3238
|
+
* 1. When a name is registered, the initial owner of the name may be
|
|
3239
|
+
* distinct from the registrant.
|
|
3240
|
+
* 2. There are no restrictions on who may renew a name.
|
|
3241
|
+
* Therefore the owner of the name may be distinct from the registrant.
|
|
3242
|
+
*
|
|
3243
|
+
* The "chainId" of this address is the same as is referenced in
|
|
3244
|
+
* `registrationLifecycle.subregistry.subregistryId`.
|
|
3245
|
+
*/
|
|
3246
|
+
registrant: Address;
|
|
3247
|
+
/**
|
|
3248
|
+
* Registration Lifecycle associated with this "logical registrar action".
|
|
3249
|
+
*/
|
|
3250
|
+
registrationLifecycle: RegistrationLifecycle;
|
|
3251
|
+
/**
|
|
3252
|
+
* Pricing information associated with this "logical registrar action".
|
|
3253
|
+
*/
|
|
3254
|
+
pricing: RegistrarActionPricing;
|
|
3255
|
+
/**
|
|
3256
|
+
* Referral information associated with this "logical registrar action".
|
|
3257
|
+
*/
|
|
3258
|
+
referral: RegistrarActionReferral;
|
|
3259
|
+
/**
|
|
3260
|
+
* Block ref
|
|
3261
|
+
*
|
|
3262
|
+
* References the block where the "logical registrar action" was executed.
|
|
3263
|
+
*
|
|
3264
|
+
* The "chainId" of this block is the same as is referenced in
|
|
3265
|
+
* `registrationLifecycle.subregistry.subregistryId`.
|
|
3266
|
+
*/
|
|
3267
|
+
block: BlockRef;
|
|
3268
|
+
/**
|
|
3269
|
+
* Transaction hash
|
|
3270
|
+
*
|
|
3271
|
+
* Transaction hash of the transaction associated with
|
|
3272
|
+
* the "logical registrar action".
|
|
3273
|
+
*
|
|
3274
|
+
* The "chainId" of this transaction is the same as is referenced in
|
|
3275
|
+
* `registrationLifecycle.subregistry.subregistryId`.
|
|
3276
|
+
*
|
|
3277
|
+
* Note that a single transaction may be associated with any number of
|
|
3278
|
+
* "logical registrar actions".
|
|
3279
|
+
*/
|
|
3280
|
+
transactionHash: Hash;
|
|
3281
|
+
/**
|
|
3282
|
+
* Event IDs
|
|
3283
|
+
*
|
|
3284
|
+
* Array of the eventIds that have contributed to the state of
|
|
3285
|
+
* the "logical registrar action" record.
|
|
3286
|
+
*
|
|
3287
|
+
* Each eventId is a deterministic and globally unique onchain event
|
|
3288
|
+
* identifier.
|
|
3289
|
+
*
|
|
3290
|
+
* Guarantees:
|
|
3291
|
+
* - Each eventId is of events that occurred within the block
|
|
3292
|
+
* referenced by `block.number`.
|
|
3293
|
+
* - At least 1 eventId.
|
|
3294
|
+
* - Ordered chronologically (ascending) by logIndex within `block.number`.
|
|
3295
|
+
* - The first element in the array is equal to the `id` of
|
|
3296
|
+
* the overall "logical registrar action" record.
|
|
3297
|
+
*
|
|
3298
|
+
* The following ideas are not generalized for ENS overall but happen to
|
|
3299
|
+
* be a characteristic of the scope of our current indexing logic:
|
|
3300
|
+
* 1. These id's always reference events emitted by
|
|
3301
|
+
* a related "BaseRegistrar" contract.
|
|
3302
|
+
* 2. These id's optionally reference events emitted by
|
|
3303
|
+
* a related "Registrar Controller" contract. This is because our
|
|
3304
|
+
* current indexing logic doesn't guarantee to index
|
|
3305
|
+
* all "Registrar Controller" contracts.
|
|
3306
|
+
*/
|
|
3307
|
+
eventIds: [RegistrarActionEventId, ...RegistrarActionEventId[]];
|
|
3308
|
+
}
|
|
3309
|
+
/**
|
|
3310
|
+
* Serialized representation of {@link RegistrarActionPricingUnknown}.
|
|
3311
|
+
*/
|
|
3312
|
+
type SerializedRegistrarActionPricingUnknown = RegistrarActionPricingUnknown;
|
|
3313
|
+
/**
|
|
3314
|
+
* Serialized representation of {@link RegistrarActionPricingAvailable}.
|
|
3315
|
+
*/
|
|
3316
|
+
interface SerializedRegistrarActionPricingAvailable {
|
|
3317
|
+
baseCost: SerializedPriceEth;
|
|
3318
|
+
premium: SerializedPriceEth;
|
|
3319
|
+
total: SerializedPriceEth;
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* Serialized representation of {@link RegistrarActionPricing}.
|
|
3323
|
+
*/
|
|
3324
|
+
type SerializedRegistrarActionPricing = SerializedRegistrarActionPricingAvailable | SerializedRegistrarActionPricingUnknown;
|
|
3325
|
+
/**
|
|
3326
|
+
* Serialized representation of {@link RegistrarAction}.
|
|
3327
|
+
*/
|
|
3328
|
+
interface SerializedRegistrarAction extends Omit<RegistrarAction, "pricing"> {
|
|
3329
|
+
pricing: SerializedRegistrarActionPricing;
|
|
3330
|
+
}
|
|
3331
|
+
declare function serializeRegistrarActionPricing(pricing: RegistrarActionPricing): SerializedRegistrarActionPricing;
|
|
3332
|
+
declare function serializeRegistrarAction(registrarAction: RegistrarAction): SerializedRegistrarAction;
|
|
3333
|
+
|
|
3334
|
+
declare const RECORDS_PER_PAGE_DEFAULT = 10;
|
|
3335
|
+
declare const RECORDS_PER_PAGE_MAX = 100;
|
|
3336
|
+
/**
|
|
3337
|
+
* Request page params.
|
|
3338
|
+
*/
|
|
3339
|
+
interface RequestPageParams {
|
|
3340
|
+
/**
|
|
3341
|
+
* Requested page number (1-indexed)
|
|
3342
|
+
* @invariant Must be a positive integer (>= 1)
|
|
3343
|
+
* @default 1
|
|
3344
|
+
*/
|
|
3345
|
+
page?: number;
|
|
3346
|
+
/**
|
|
3347
|
+
* Maximum number of records to return per page
|
|
3348
|
+
* @invariant Must be a positive integer (>= 1) and less than or equal to {@link RECORDS_PER_PAGE_MAX}
|
|
3349
|
+
* @default {@link RECORDS_PER_PAGE_DEFAULT}
|
|
3350
|
+
*/
|
|
3351
|
+
recordsPerPage?: number;
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
interface ResponsePageContextWithNoRecords extends Required<RequestPageParams> {
|
|
3355
|
+
/**
|
|
3356
|
+
* Total number of records across all pages
|
|
3357
|
+
*/
|
|
3358
|
+
totalRecords: 0;
|
|
3359
|
+
/**
|
|
3360
|
+
* Total number of pages
|
|
3361
|
+
*/
|
|
3362
|
+
totalPages: 1;
|
|
3363
|
+
/**
|
|
3364
|
+
* Indicates if there is a next page available
|
|
3365
|
+
*/
|
|
3366
|
+
hasNext: false;
|
|
3367
|
+
/**
|
|
3368
|
+
* Indicates if there is a previous page available
|
|
3369
|
+
*/
|
|
3370
|
+
hasPrev: false;
|
|
3371
|
+
/**
|
|
3372
|
+
* The start index of the records on the page (0-indexed)
|
|
3373
|
+
*/
|
|
3374
|
+
startIndex: undefined;
|
|
3375
|
+
/**
|
|
3376
|
+
* The end index of the records on the page (0-indexed)
|
|
3377
|
+
*/
|
|
3378
|
+
endIndex: undefined;
|
|
3379
|
+
}
|
|
3380
|
+
interface ResponsePageContextWithRecords extends Required<RequestPageParams> {
|
|
3381
|
+
/**
|
|
3382
|
+
* Total number of records across all pages
|
|
3383
|
+
* @invariant Guaranteed to be a positive integer (>= 1)
|
|
3384
|
+
*/
|
|
3385
|
+
totalRecords: number;
|
|
3386
|
+
/**
|
|
3387
|
+
* Total number of pages
|
|
3388
|
+
* @invariant Guaranteed to be a positive integer (>= 1)
|
|
3389
|
+
*/
|
|
3390
|
+
totalPages: number;
|
|
3391
|
+
/**
|
|
3392
|
+
* Indicates if there is a next page available
|
|
3393
|
+
* @invariant true if and only if (`page` * `recordsPerPage` < `totalRecords`)
|
|
3394
|
+
*/
|
|
3395
|
+
hasNext: boolean;
|
|
3396
|
+
/**
|
|
3397
|
+
* Indicates if there is a previous page available
|
|
3398
|
+
* @invariant true if and only if (`page` > 1)
|
|
3399
|
+
*/
|
|
3400
|
+
hasPrev: boolean;
|
|
3401
|
+
/**
|
|
3402
|
+
* The start index of the records on the page (0-indexed)
|
|
3403
|
+
*
|
|
3404
|
+
* @invariant Guaranteed to be a non-negative integer (>= 0)
|
|
3405
|
+
*/
|
|
3406
|
+
startIndex: number;
|
|
3407
|
+
/**
|
|
3408
|
+
* The end index of the records on the page (0-indexed)
|
|
3409
|
+
*
|
|
3410
|
+
* @invariant Guaranteed to be a non-negative integer (>= 0)
|
|
3411
|
+
* @invariant Guaranteed to be greater than or equal to `startIndex`.
|
|
3412
|
+
* @invariant Guaranteed to be less than `totalRecords`.
|
|
3413
|
+
*/
|
|
3414
|
+
endIndex: number;
|
|
3415
|
+
}
|
|
3416
|
+
type ResponsePageContext = ResponsePageContextWithNoRecords | ResponsePageContextWithRecords;
|
|
3417
|
+
|
|
3418
|
+
/**
|
|
3419
|
+
* Build page context from request params and total records count.
|
|
3420
|
+
*/
|
|
3421
|
+
declare function buildPageContext(page: number, recordsPerPage: number, totalRecords: number): ResponsePageContext;
|
|
3422
|
+
|
|
3423
|
+
/**
|
|
3424
|
+
* A status code for Registrar Actions API responses.
|
|
3425
|
+
*/
|
|
3426
|
+
declare const RegistrarActionsResponseCodes: {
|
|
3427
|
+
/**
|
|
3428
|
+
* Represents that Registrar Actions are available.
|
|
3429
|
+
*/
|
|
3430
|
+
readonly Ok: "ok";
|
|
3431
|
+
/**
|
|
3432
|
+
* Represents that Registrar Actions are unavailable.
|
|
3433
|
+
*/
|
|
3434
|
+
readonly Error: "error";
|
|
3435
|
+
};
|
|
3436
|
+
/**
|
|
3437
|
+
* The derived string union of possible {@link RegistrarActionsResponseCodes}.
|
|
3438
|
+
*/
|
|
3439
|
+
type RegistrarActionsResponseCode = (typeof RegistrarActionsResponseCodes)[keyof typeof RegistrarActionsResponseCodes];
|
|
3440
|
+
/**
|
|
3441
|
+
* "Logical registrar action" with its associated name.
|
|
3442
|
+
*/
|
|
3443
|
+
interface NamedRegistrarAction {
|
|
3444
|
+
action: RegistrarAction;
|
|
3445
|
+
/**
|
|
3446
|
+
* Name
|
|
3447
|
+
*
|
|
3448
|
+
* FQDN of the name associated with `action`.
|
|
3449
|
+
*
|
|
3450
|
+
* Guarantees:
|
|
3451
|
+
* - `namehash(name)` is always `action.registrationLifecycle.node`.
|
|
3452
|
+
*/
|
|
3453
|
+
name: InterpretedName;
|
|
3454
|
+
}
|
|
3455
|
+
/**
|
|
3456
|
+
* A response when Registrar Actions are available.
|
|
3457
|
+
*/
|
|
3458
|
+
type RegistrarActionsResponseOk = {
|
|
3459
|
+
responseCode: typeof RegistrarActionsResponseCodes.Ok;
|
|
3460
|
+
registrarActions: NamedRegistrarAction[];
|
|
3461
|
+
pageContext: ResponsePageContext;
|
|
3462
|
+
};
|
|
3463
|
+
/**
|
|
3464
|
+
* A response when Registrar Actions are unavailable.
|
|
3465
|
+
*/
|
|
3466
|
+
interface RegistrarActionsResponseError {
|
|
3467
|
+
responseCode: typeof IndexingStatusResponseCodes.Error;
|
|
3468
|
+
error: ErrorResponse;
|
|
3469
|
+
}
|
|
3470
|
+
/**
|
|
3471
|
+
* Registrar Actions response.
|
|
3472
|
+
*
|
|
3473
|
+
* Use the `responseCode` field to determine the specific type interpretation
|
|
3474
|
+
* at runtime.
|
|
3475
|
+
*/
|
|
3476
|
+
type RegistrarActionsResponse = RegistrarActionsResponseOk | RegistrarActionsResponseError;
|
|
2811
3477
|
|
|
2812
3478
|
/**
|
|
2813
|
-
*
|
|
3479
|
+
* Serialized representation of {@link RegistrarActionsResponseError}.
|
|
3480
|
+
*/
|
|
3481
|
+
type SerializedRegistrarActionsResponseError = RegistrarActionsResponseError;
|
|
3482
|
+
/**
|
|
3483
|
+
* Serialized representation of {@link NamedRegistrarAction}.
|
|
3484
|
+
*/
|
|
3485
|
+
interface SerializedNamedRegistrarAction extends Omit<NamedRegistrarAction, "action"> {
|
|
3486
|
+
action: SerializedRegistrarAction;
|
|
3487
|
+
}
|
|
3488
|
+
/**
|
|
3489
|
+
* Serialized representation of {@link RegistrarActionsResponseOk}.
|
|
2814
3490
|
*/
|
|
2815
|
-
interface
|
|
2816
|
-
|
|
2817
|
-
selection: SELECTION;
|
|
3491
|
+
interface SerializedRegistrarActionsResponseOk extends Omit<RegistrarActionsResponseOk, "registrarActions"> {
|
|
3492
|
+
registrarActions: SerializedNamedRegistrarAction[];
|
|
2818
3493
|
}
|
|
2819
3494
|
/**
|
|
2820
|
-
*
|
|
3495
|
+
* Serialized representation of {@link SerializedRegistrarActionsResponse}.
|
|
2821
3496
|
*/
|
|
2822
|
-
type
|
|
3497
|
+
type SerializedRegistrarActionsResponse = SerializedRegistrarActionsResponseOk | SerializedRegistrarActionsResponseError;
|
|
3498
|
+
|
|
2823
3499
|
/**
|
|
2824
|
-
*
|
|
3500
|
+
* Deserialize a {@link RegistrarActionsResponse} object.
|
|
2825
3501
|
*/
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
chainId: ChainId;
|
|
2829
|
-
}
|
|
3502
|
+
declare function deserializeRegistrarActionsResponse(maybeResponse: SerializedRegistrarActionsResponse): RegistrarActionsResponse;
|
|
3503
|
+
|
|
2830
3504
|
/**
|
|
2831
|
-
*
|
|
3505
|
+
* Records Filters: Filter Types
|
|
2832
3506
|
*/
|
|
2833
|
-
|
|
3507
|
+
declare const RegistrarActionsFilterTypes: {
|
|
3508
|
+
readonly BySubregistryNode: "bySubregistryNode";
|
|
3509
|
+
readonly WithEncodedReferral: "withEncodedReferral";
|
|
3510
|
+
readonly ByDecodedReferrer: "byDecodedReferrer";
|
|
3511
|
+
};
|
|
3512
|
+
type RegistrarActionsFilterType = (typeof RegistrarActionsFilterTypes)[keyof typeof RegistrarActionsFilterTypes];
|
|
3513
|
+
type RegistrarActionsFilterBySubregistryNode = {
|
|
3514
|
+
filterType: typeof RegistrarActionsFilterTypes.BySubregistryNode;
|
|
3515
|
+
value: Node;
|
|
3516
|
+
};
|
|
3517
|
+
type RegistrarActionsFilterWithEncodedReferral = {
|
|
3518
|
+
filterType: typeof RegistrarActionsFilterTypes.WithEncodedReferral;
|
|
3519
|
+
};
|
|
3520
|
+
type RegistrarActionsFilterByDecodedReferrer = {
|
|
3521
|
+
filterType: typeof RegistrarActionsFilterTypes.ByDecodedReferrer;
|
|
3522
|
+
value: Address;
|
|
3523
|
+
};
|
|
3524
|
+
type RegistrarActionsFilter = RegistrarActionsFilterBySubregistryNode | RegistrarActionsFilterWithEncodedReferral | RegistrarActionsFilterByDecodedReferrer;
|
|
2834
3525
|
/**
|
|
2835
|
-
*
|
|
3526
|
+
* Records Orders
|
|
2836
3527
|
*/
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
3528
|
+
declare const RegistrarActionsOrders: {
|
|
3529
|
+
readonly LatestRegistrarActions: "orderBy[timestamp]=desc";
|
|
3530
|
+
};
|
|
3531
|
+
type RegistrarActionsOrder = (typeof RegistrarActionsOrders)[keyof typeof RegistrarActionsOrders];
|
|
2841
3532
|
/**
|
|
2842
|
-
*
|
|
3533
|
+
* Represents a request to Registrar Actions API.
|
|
2843
3534
|
*/
|
|
2844
|
-
|
|
3535
|
+
interface RegistrarActionsRequest extends RequestPageParams {
|
|
3536
|
+
/**
|
|
3537
|
+
* Filters to be applied while generating results.
|
|
3538
|
+
*/
|
|
3539
|
+
filters?: RegistrarActionsFilter[];
|
|
3540
|
+
/**
|
|
3541
|
+
* Order applied while generating results.
|
|
3542
|
+
*/
|
|
3543
|
+
order?: RegistrarActionsOrder;
|
|
3544
|
+
}
|
|
2845
3545
|
|
|
2846
3546
|
/**
|
|
2847
|
-
*
|
|
3547
|
+
* Build a "parent node" filter object for Registrar Actions query.
|
|
2848
3548
|
*/
|
|
2849
|
-
declare
|
|
2850
|
-
|
|
2851
|
-
ReverseResolution = "reverse-resolution"
|
|
2852
|
-
}
|
|
3549
|
+
declare function byParentNode(parentNode: Node): RegistrarActionsFilter;
|
|
3550
|
+
declare function byParentNode(parentNode: undefined): undefined;
|
|
2853
3551
|
/**
|
|
2854
|
-
*
|
|
3552
|
+
* Build a "with referral" filter object for Registrar Actions query.
|
|
2855
3553
|
*/
|
|
2856
|
-
declare
|
|
2857
|
-
|
|
2858
|
-
FindResolver = "find-resolver",
|
|
2859
|
-
ActiveResolverExists = "active-resolver-exists",
|
|
2860
|
-
AccelerateENSIP19ReverseResolver = "accelerate-ensip-19-reverse-resolver",
|
|
2861
|
-
AccelerateKnownOffchainLookupResolver = "accelerate-known-offchain-lookup-resolver",
|
|
2862
|
-
AccelerateKnownOnchainStaticResolver = "accelerate-known-onchain-static-resolver",
|
|
2863
|
-
RequireResolver = "require-resolver",
|
|
2864
|
-
ExecuteResolveCalls = "execute-resolve-calls"
|
|
2865
|
-
}
|
|
3554
|
+
declare function withReferral(withReferral: true): RegistrarActionsFilter;
|
|
3555
|
+
declare function withReferral(withReferral: false | undefined): undefined;
|
|
2866
3556
|
/**
|
|
2867
|
-
*
|
|
3557
|
+
* Build a "decoded referrer" filter object for Registrar Actions query.
|
|
2868
3558
|
*/
|
|
2869
|
-
declare
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
}
|
|
2876
|
-
declare const PROTOCOL_ATTRIBUTE_PREFIX = "ens";
|
|
2877
|
-
declare const ATTR_PROTOCOL_NAME = "ens.protocol";
|
|
2878
|
-
declare const ATTR_PROTOCOL_STEP = "ens.protocol.step";
|
|
2879
|
-
declare const ATTR_PROTOCOL_STEP_RESULT = "ens.protocol.step.result";
|
|
2880
|
-
interface SpanAttributes {
|
|
2881
|
-
[key: string]: unknown;
|
|
2882
|
-
}
|
|
2883
|
-
interface SpanEvent {
|
|
2884
|
-
name: string;
|
|
2885
|
-
attributes: SpanAttributes;
|
|
2886
|
-
time: number;
|
|
2887
|
-
}
|
|
2888
|
-
interface ProtocolSpan {
|
|
2889
|
-
scope: string;
|
|
2890
|
-
id: string;
|
|
2891
|
-
traceId: string;
|
|
2892
|
-
parentSpanContext: {
|
|
2893
|
-
traceId: string;
|
|
2894
|
-
spanId: string;
|
|
2895
|
-
} | undefined;
|
|
2896
|
-
name: string;
|
|
2897
|
-
timestamp: number;
|
|
2898
|
-
duration: number;
|
|
2899
|
-
attributes: SpanAttributes;
|
|
2900
|
-
status: {
|
|
2901
|
-
code: number;
|
|
2902
|
-
message?: string;
|
|
2903
|
-
};
|
|
2904
|
-
events: SpanEvent[];
|
|
2905
|
-
}
|
|
2906
|
-
type ProtocolSpanTreeNode = ProtocolSpan & {
|
|
2907
|
-
children: ProtocolSpanTreeNode[];
|
|
3559
|
+
declare function byDecodedReferrer(decodedReferrer: Address): RegistrarActionsFilter;
|
|
3560
|
+
declare function byDecodedReferrer(decodedReferrer: undefined): undefined;
|
|
3561
|
+
declare const registrarActionsFilter: {
|
|
3562
|
+
byParentNode: typeof byParentNode;
|
|
3563
|
+
withReferral: typeof withReferral;
|
|
3564
|
+
byDecodedReferrer: typeof byDecodedReferrer;
|
|
2908
3565
|
};
|
|
2909
|
-
type ProtocolTrace = ProtocolSpanTreeNode[];
|
|
2910
3566
|
|
|
2911
|
-
declare const
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
3567
|
+
declare const registrarActionsPrerequisites: Readonly<{
|
|
3568
|
+
/**
|
|
3569
|
+
* Required plugins to enable Registrar Actions API routes.
|
|
3570
|
+
*
|
|
3571
|
+
* 1. `registrars` plugin is required so that data in the `registrarActions`
|
|
3572
|
+
* table is populated.
|
|
3573
|
+
* 2. `subgraph`, `basenames`, and `lineanames` are required to get the data
|
|
3574
|
+
* for the name associated with each registrar action.
|
|
3575
|
+
* 3. In theory not all of `subgraph`, `basenames`, and `lineanames` plugins
|
|
3576
|
+
* might be required. Ex: At least one, but the current logic in
|
|
3577
|
+
* the `registrars` plugin always indexes registrar actions across
|
|
3578
|
+
* Ethnames (subgraph), Basenames, and Lineanames and therefore we need to
|
|
3579
|
+
* ensure each value in the registrar actions table has
|
|
3580
|
+
* an associated record in the domains table.
|
|
3581
|
+
*/
|
|
3582
|
+
requiredPlugins: readonly [PluginName.Subgraph, PluginName.Basenames, PluginName.Lineanames, PluginName.Registrars];
|
|
3583
|
+
/**
|
|
3584
|
+
* Check if provided ENSApiPublicConfig supports the Registrar Actions API.
|
|
3585
|
+
*/
|
|
3586
|
+
hasEnsIndexerConfigSupport(config: ENSIndexerPublicConfig): boolean;
|
|
3587
|
+
/**
|
|
3588
|
+
* Required Indexing Status IDs
|
|
3589
|
+
*
|
|
3590
|
+
* Database indexes are created by the time the omnichain indexing status
|
|
3591
|
+
* is either `completed` or `following`.
|
|
3592
|
+
*/
|
|
3593
|
+
supportedIndexingStatusIds: ("omnichain-following" | "omnichain-completed")[];
|
|
3594
|
+
/**
|
|
3595
|
+
* Check if provided indexing status supports the Registrar Actions API.
|
|
3596
|
+
*/
|
|
3597
|
+
hasIndexingStatusSupport(omnichainIndexingStatusId: OmnichainIndexingStatusId): boolean;
|
|
3598
|
+
}>;
|
|
3599
|
+
|
|
3600
|
+
declare function serializeNamedRegistrarAction({ action, name, }: NamedRegistrarAction): SerializedNamedRegistrarAction;
|
|
3601
|
+
declare function serializeRegistrarActionsResponse(response: RegistrarActionsResponse): SerializedRegistrarActionsResponse;
|
|
2915
3602
|
|
|
2916
3603
|
/**
|
|
2917
|
-
*
|
|
2918
|
-
*/
|
|
2919
|
-
type ErrorResponse = z$1.infer<typeof ErrorResponseSchema>;
|
|
2920
|
-
interface TraceableRequest {
|
|
2921
|
-
trace?: boolean;
|
|
2922
|
-
}
|
|
2923
|
-
interface TraceableResponse {
|
|
2924
|
-
trace?: ProtocolTrace;
|
|
2925
|
-
}
|
|
2926
|
-
interface AcceleratableRequest {
|
|
2927
|
-
accelerate?: boolean;
|
|
2928
|
-
}
|
|
2929
|
-
interface AcceleratableResponse {
|
|
2930
|
-
accelerationRequested: boolean;
|
|
2931
|
-
accelerationAttempted: boolean;
|
|
2932
|
-
}
|
|
2933
|
-
/**
|
|
2934
|
-
* Resolve Records Request Type
|
|
3604
|
+
* The resolution status for an `Identity`.
|
|
2935
3605
|
*/
|
|
2936
|
-
|
|
2937
|
-
|
|
3606
|
+
declare const ResolutionStatusIds: {
|
|
3607
|
+
/**
|
|
3608
|
+
* Represents that the `Identity` is not resolved yet.
|
|
3609
|
+
*/
|
|
3610
|
+
readonly Unresolved: "unresolved";
|
|
3611
|
+
/**
|
|
3612
|
+
* Represents that resolution of the `Identity` resulted in a named identity.
|
|
3613
|
+
*/
|
|
3614
|
+
readonly Named: "named";
|
|
3615
|
+
/**
|
|
3616
|
+
* Represents that resolution of the `Identity` resulted in an unnamed identity.
|
|
3617
|
+
*/
|
|
3618
|
+
readonly Unnamed: "unnamed";
|
|
3619
|
+
/**
|
|
3620
|
+
* Represents that attempted resolution of the `Identity` resulted in an error
|
|
3621
|
+
* and therefore it is unknown if the `Identity` resolves to a named or unnamed identity.
|
|
3622
|
+
*/
|
|
3623
|
+
readonly Unknown: "unknown";
|
|
3624
|
+
};
|
|
2938
3625
|
/**
|
|
2939
|
-
*
|
|
3626
|
+
* The derived string union of possible {@link ResolutionStatusIds}.
|
|
2940
3627
|
*/
|
|
2941
|
-
|
|
2942
|
-
records: ResolverRecordsResponse<SELECTION>;
|
|
2943
|
-
}
|
|
3628
|
+
type ResolutionStatusId = (typeof ResolutionStatusIds)[keyof typeof ResolutionStatusIds];
|
|
2944
3629
|
/**
|
|
2945
|
-
*
|
|
3630
|
+
* Represents an {@link Identity} that has not become a {@link ResolvedIdentity} yet.
|
|
3631
|
+
*
|
|
3632
|
+
* Invariants:
|
|
3633
|
+
* - `resolutionStatus` is always {@link ResolutionStatusIds.Unresolved}.
|
|
2946
3634
|
*/
|
|
2947
|
-
interface
|
|
3635
|
+
interface UnresolvedIdentity {
|
|
3636
|
+
resolutionStatus: typeof ResolutionStatusIds.Unresolved;
|
|
3637
|
+
/**
|
|
3638
|
+
* The {@link DefaultableChainId} for an ENSIP-19 primary name lookup of the
|
|
3639
|
+
* identity associated with `address`.
|
|
3640
|
+
*/
|
|
3641
|
+
chainId: DefaultableChainId;
|
|
3642
|
+
/**
|
|
3643
|
+
* The {@link Address} of the identity.
|
|
3644
|
+
*/
|
|
3645
|
+
address: Address;
|
|
2948
3646
|
}
|
|
2949
3647
|
/**
|
|
2950
|
-
*
|
|
3648
|
+
* Represents an `Identity` that resolved to a primary name.
|
|
3649
|
+
*
|
|
3650
|
+
* Invariants:
|
|
3651
|
+
* - `resolutionStatus` is always {@link ResolutionStatusIds.Named}.
|
|
2951
3652
|
*/
|
|
2952
|
-
interface
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
3653
|
+
interface NamedIdentity {
|
|
3654
|
+
resolutionStatus: typeof ResolutionStatusIds.Named;
|
|
3655
|
+
/**
|
|
3656
|
+
* The {@link DefaultableChainId} for an ENSIP-19 primary name lookup of the
|
|
3657
|
+
* identity associated with `address`.
|
|
3658
|
+
*/
|
|
3659
|
+
chainId: DefaultableChainId;
|
|
3660
|
+
/**
|
|
3661
|
+
* The address of the identity.
|
|
3662
|
+
*/
|
|
3663
|
+
address: Address;
|
|
3664
|
+
/**
|
|
3665
|
+
* The ENSIP-19 primary name lookup result of `address` on `chainId`.
|
|
3666
|
+
*/
|
|
3667
|
+
name: Name;
|
|
2959
3668
|
}
|
|
2960
3669
|
/**
|
|
2961
|
-
*
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
*
|
|
2966
|
-
*/
|
|
2967
|
-
type IndexingStatusRequest = {};
|
|
2968
|
-
/**
|
|
2969
|
-
* A status code for indexing status responses.
|
|
3670
|
+
* Represents an `Identity` that did not resolve to a primary name.
|
|
3671
|
+
*
|
|
3672
|
+
* Invariants:
|
|
3673
|
+
* - `resolutionStatus` is always {@link ResolutionStatusIds.Unnamed}.
|
|
3674
|
+
* - `name` is always `null`.
|
|
2970
3675
|
*/
|
|
2971
|
-
|
|
3676
|
+
interface UnnamedIdentity {
|
|
3677
|
+
resolutionStatus: typeof ResolutionStatusIds.Unnamed;
|
|
2972
3678
|
/**
|
|
2973
|
-
*
|
|
3679
|
+
* The {@link DefaultableChainId} for an ENSIP-19 primary name lookup of the
|
|
3680
|
+
* identity associated with `address`.
|
|
2974
3681
|
*/
|
|
2975
|
-
|
|
3682
|
+
chainId: DefaultableChainId;
|
|
2976
3683
|
/**
|
|
2977
|
-
*
|
|
3684
|
+
* The address of the identity.
|
|
2978
3685
|
*/
|
|
2979
|
-
|
|
2980
|
-
|
|
3686
|
+
address: Address;
|
|
3687
|
+
/**
|
|
3688
|
+
* The ENSIP-19 primary name lookup result of `address` on `chainId`.
|
|
3689
|
+
*/
|
|
3690
|
+
name: null;
|
|
3691
|
+
}
|
|
2981
3692
|
/**
|
|
2982
|
-
*
|
|
3693
|
+
* Represents an `Identity` that was attempted to be resolved but the resolution attempt
|
|
3694
|
+
* resulted in an error and therefore it is unknown if the `Identity` resolves to a named
|
|
3695
|
+
* or unnamed identity.
|
|
3696
|
+
*
|
|
3697
|
+
* Invariants:
|
|
3698
|
+
* - `resolutionStatus` is always {@link ResolutionStatusIds.Unknown}.
|
|
2983
3699
|
*/
|
|
2984
|
-
|
|
3700
|
+
interface UnknownIdentity {
|
|
3701
|
+
resolutionStatus: typeof ResolutionStatusIds.Unknown;
|
|
3702
|
+
/**
|
|
3703
|
+
* The {@link DefaultableChainId} for an ENSIP-19 primary name lookup of the
|
|
3704
|
+
* identity associated with `address`.
|
|
3705
|
+
*/
|
|
3706
|
+
chainId: DefaultableChainId;
|
|
3707
|
+
/**
|
|
3708
|
+
* The address of the identity.
|
|
3709
|
+
*/
|
|
3710
|
+
address: Address;
|
|
3711
|
+
}
|
|
2985
3712
|
/**
|
|
2986
|
-
*
|
|
3713
|
+
* Represents an ENSIP-19 identity resolution result.
|
|
3714
|
+
*
|
|
3715
|
+
* Use the `resolutionStatus` field to determine the specific type interpretation
|
|
3716
|
+
* at runtime.
|
|
2987
3717
|
*/
|
|
2988
|
-
type
|
|
2989
|
-
responseCode: typeof IndexingStatusResponseCodes.Ok;
|
|
2990
|
-
realtimeProjection: RealtimeIndexingStatusProjection;
|
|
2991
|
-
};
|
|
3718
|
+
type ResolvedIdentity = NamedIdentity | UnnamedIdentity | UnknownIdentity;
|
|
2992
3719
|
/**
|
|
2993
|
-
*
|
|
3720
|
+
* Represents an ENSIP-19 identity resolution (which may or not have been
|
|
3721
|
+
* resolved to a result yet).
|
|
3722
|
+
*
|
|
3723
|
+
* Use the `resolutionStatus` field to determine the specific type interpretation
|
|
3724
|
+
* at runtime.
|
|
2994
3725
|
*/
|
|
2995
|
-
type
|
|
2996
|
-
|
|
2997
|
-
};
|
|
3726
|
+
type Identity = UnresolvedIdentity | ResolvedIdentity;
|
|
3727
|
+
|
|
2998
3728
|
/**
|
|
2999
|
-
*
|
|
3729
|
+
* Builds an {@link UnresolvedIdentity} for the provided {@link Address},
|
|
3730
|
+
* {@link DefaultableChainId} and {@link ENSNamespaceId}.
|
|
3000
3731
|
*
|
|
3001
|
-
*
|
|
3002
|
-
*
|
|
3732
|
+
* If no `chainId` is provided, uses the ENS Root Chain Id for the provided
|
|
3733
|
+
* `namespaceId`.
|
|
3003
3734
|
*/
|
|
3004
|
-
|
|
3735
|
+
declare function buildUnresolvedIdentity(address: Address, namespaceId: ENSNamespaceId, chainId?: DefaultableChainId): UnresolvedIdentity;
|
|
3005
3736
|
/**
|
|
3006
|
-
*
|
|
3737
|
+
* Returns whether the provided {@link Identity} is a {@link ResolvedIdentity}.
|
|
3738
|
+
*
|
|
3739
|
+
* @param identity - The {@link Identity} to check.
|
|
3740
|
+
* @returns Whether the provided {@link Identity} is a {@link ResolvedIdentity}.
|
|
3007
3741
|
*/
|
|
3742
|
+
declare function isResolvedIdentity(identity: Identity): identity is ResolvedIdentity;
|
|
3743
|
+
|
|
3008
3744
|
/**
|
|
3009
|
-
*
|
|
3745
|
+
* Gets the "chainId param" that should be used for a primary name resolution
|
|
3746
|
+
* request.
|
|
3747
|
+
*
|
|
3748
|
+
* ENSIP-19 defines special rules for the "chainId param" used
|
|
3749
|
+
* in primary name resolutions for the case that the `chainId` is the
|
|
3750
|
+
* ENS Root Chain Id for the provided `namespaceId`.
|
|
3751
|
+
*
|
|
3752
|
+
* Whenever this case happens, ENSIP-19 requires that the
|
|
3753
|
+
* "chainId param" is always set to chainId: 1 (mainnet), even if the
|
|
3754
|
+
* `chainId` where the primary name lookup is actually happening
|
|
3755
|
+
* on a non-mainnet ENS Root Chain, such as on a testnet or
|
|
3756
|
+
* the ens-test-env.
|
|
3757
|
+
*
|
|
3758
|
+
* @param namespaceId The namespace id for the primary name lookup.
|
|
3759
|
+
* @param chainId The chain id where the primary name lookup will actually happen.
|
|
3760
|
+
* @returns The "chainId param" that should be used for the primary name lookup.
|
|
3010
3761
|
*/
|
|
3011
|
-
declare const
|
|
3012
|
-
readonly BySubregistryNode: "bySubregistryNode";
|
|
3013
|
-
readonly WithEncodedReferral: "withEncodedReferral";
|
|
3014
|
-
};
|
|
3015
|
-
type RegistrarActionsFilterType = (typeof RegistrarActionsFilterTypes)[keyof typeof RegistrarActionsFilterTypes];
|
|
3016
|
-
type RegistrarActionsFilterBySubregistryNode = {
|
|
3017
|
-
filterType: typeof RegistrarActionsFilterTypes.BySubregistryNode;
|
|
3018
|
-
value: Node;
|
|
3019
|
-
};
|
|
3020
|
-
type RegistrarActionsFilterWithEncodedReferral = {
|
|
3021
|
-
filterType: typeof RegistrarActionsFilterTypes.WithEncodedReferral;
|
|
3022
|
-
};
|
|
3023
|
-
type RegistrarActionsFilter = RegistrarActionsFilterBySubregistryNode | RegistrarActionsFilterWithEncodedReferral;
|
|
3762
|
+
declare const getResolvePrimaryNameChainIdParam: (chainId: DefaultableChainId, namespaceId: ENSNamespaceId) => DefaultableChainId;
|
|
3024
3763
|
/**
|
|
3025
|
-
*
|
|
3764
|
+
* Translates a `DefaultableChainId` a `ChainId`
|
|
3765
|
+
* such that if the provided `chainId` is `DEFAULT_EVM_CHAIN_ID`,
|
|
3766
|
+
* the `ChainId` of the ENS Root Chain for the provided `namespaceId` is returned.
|
|
3767
|
+
*
|
|
3768
|
+
* @param chainId The `DefaultableChainId` to translate.
|
|
3769
|
+
* @param namespaceId The namespace id for the translation.
|
|
3770
|
+
* @returns the translated `ChainId`.
|
|
3026
3771
|
*/
|
|
3027
|
-
declare const
|
|
3028
|
-
|
|
3029
|
-
};
|
|
3030
|
-
type RegistrarActionsOrder = (typeof RegistrarActionsOrders)[keyof typeof RegistrarActionsOrders];
|
|
3772
|
+
declare const translateDefaultableChainIdToChainId: (chainId: DefaultableChainId, namespaceId: ENSNamespaceId) => ChainId;
|
|
3773
|
+
|
|
3031
3774
|
/**
|
|
3032
|
-
*
|
|
3775
|
+
* Encodes a selection of Resolver records in the context of a specific Name.
|
|
3033
3776
|
*/
|
|
3034
|
-
|
|
3777
|
+
interface ResolverRecordsSelection {
|
|
3035
3778
|
/**
|
|
3036
|
-
*
|
|
3779
|
+
* Whether to fetch the name's `name` record. This value is primarily used in the context of
|
|
3780
|
+
* Reverse Resolution.
|
|
3781
|
+
*
|
|
3782
|
+
* @see https://docs.ens.domains/ensip/19/#reverse-resolution
|
|
3037
3783
|
*/
|
|
3038
|
-
|
|
3784
|
+
name?: boolean;
|
|
3039
3785
|
/**
|
|
3040
|
-
*
|
|
3786
|
+
* Which coinTypes to fetch address records for.
|
|
3041
3787
|
*/
|
|
3042
|
-
|
|
3788
|
+
addresses?: CoinType[];
|
|
3043
3789
|
/**
|
|
3044
|
-
*
|
|
3045
|
-
*
|
|
3046
|
-
* Guaranteed to be a positive integer (if defined).
|
|
3790
|
+
* Which keys to fetch text records for.
|
|
3047
3791
|
*/
|
|
3048
|
-
|
|
3049
|
-
}
|
|
3792
|
+
texts?: string[];
|
|
3793
|
+
}
|
|
3794
|
+
declare const isSelectionEmpty: (selection: ResolverRecordsSelection) => boolean;
|
|
3795
|
+
|
|
3050
3796
|
/**
|
|
3051
|
-
*
|
|
3797
|
+
* An internal type representing a non-inferred ResolverRecordsResponse, used in situations where
|
|
3798
|
+
* access to the more specific inferred type (ResolverRecordsResponse<SELECTION>) is difficult or
|
|
3799
|
+
* unnecessary.
|
|
3052
3800
|
*/
|
|
3053
|
-
|
|
3801
|
+
type ResolverRecordsResponseBase = {
|
|
3054
3802
|
/**
|
|
3055
|
-
*
|
|
3803
|
+
* The name record, relevant in the context of Reverse Resolution.
|
|
3804
|
+
* Null if no name record is set.
|
|
3056
3805
|
*/
|
|
3057
|
-
|
|
3806
|
+
name: Name | null;
|
|
3058
3807
|
/**
|
|
3059
|
-
*
|
|
3808
|
+
* Address records, keyed by CoinType.
|
|
3809
|
+
* Value is null if no record for the specified CoinType is set.
|
|
3810
|
+
*
|
|
3811
|
+
* NOTE: ENS resolver address records can store arbitrary string values,
|
|
3812
|
+
* including non-EVM addresses — always validate the record value against
|
|
3813
|
+
* the format your application expects.
|
|
3060
3814
|
*/
|
|
3061
|
-
|
|
3815
|
+
addresses: Record<CoinType, string | null>;
|
|
3816
|
+
/**
|
|
3817
|
+
* Text records, keyed by key.
|
|
3818
|
+
* Value is null if no record for the specified key is set.
|
|
3819
|
+
*/
|
|
3820
|
+
texts: Record<string, string | null>;
|
|
3062
3821
|
};
|
|
3063
3822
|
/**
|
|
3064
|
-
*
|
|
3823
|
+
* Represents the strongly-typed set of records based on the provided SELECTION
|
|
3824
|
+
*
|
|
3825
|
+
* @example
|
|
3826
|
+
* ```typescript
|
|
3827
|
+
* const selection = {
|
|
3828
|
+
* name: true,
|
|
3829
|
+
* addresses: [60],
|
|
3830
|
+
* texts: ["com.twitter", "avatar"],
|
|
3831
|
+
* } as const satisfies ResolverRecordsSelection;
|
|
3832
|
+
*
|
|
3833
|
+
* type Response = ResolverRecordsResponse<typeof selection>;
|
|
3834
|
+
*
|
|
3835
|
+
* // results in the following type
|
|
3836
|
+
* type Response = {
|
|
3837
|
+
* readonly name: Name | null;
|
|
3838
|
+
* readonly addresses: Record<"60", string | null>;
|
|
3839
|
+
* readonly texts: Record<"avatar" | "com.twitter", string | null>;
|
|
3840
|
+
* }
|
|
3841
|
+
* ```
|
|
3065
3842
|
*/
|
|
3066
|
-
type
|
|
3843
|
+
type ResolverRecordsResponse<T extends ResolverRecordsSelection = ResolverRecordsSelection> = {
|
|
3844
|
+
[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];
|
|
3845
|
+
};
|
|
3846
|
+
|
|
3067
3847
|
/**
|
|
3068
|
-
*
|
|
3848
|
+
* Arguments required to perform Forward Resolution
|
|
3069
3849
|
*/
|
|
3070
|
-
interface
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
* Name
|
|
3074
|
-
*
|
|
3075
|
-
* FQDN of the name associated with `action`.
|
|
3076
|
-
*
|
|
3077
|
-
* Guarantees:
|
|
3078
|
-
* - `namehash(name)` is always `action.registrationLifecycle.node`.
|
|
3079
|
-
*/
|
|
3080
|
-
name: InterpretedName;
|
|
3850
|
+
interface ForwardResolutionArgs<SELECTION extends ResolverRecordsSelection> {
|
|
3851
|
+
name: Name;
|
|
3852
|
+
selection: SELECTION;
|
|
3081
3853
|
}
|
|
3082
3854
|
/**
|
|
3083
|
-
*
|
|
3855
|
+
* The result of performing ForwardResolution
|
|
3084
3856
|
*/
|
|
3085
|
-
type
|
|
3086
|
-
responseCode: typeof RegistrarActionsResponseCodes.Ok;
|
|
3087
|
-
registrarActions: NamedRegistrarAction[];
|
|
3088
|
-
};
|
|
3857
|
+
type ForwardResolutionResult<SELECTION extends ResolverRecordsSelection> = ResolverRecordsResponse<SELECTION>;
|
|
3089
3858
|
/**
|
|
3090
|
-
*
|
|
3859
|
+
* Arguments required to perform Reverse Resolution
|
|
3091
3860
|
*/
|
|
3092
|
-
interface
|
|
3093
|
-
|
|
3094
|
-
|
|
3861
|
+
interface ReverseResolutionArgs {
|
|
3862
|
+
address: Address;
|
|
3863
|
+
chainId: ChainId;
|
|
3095
3864
|
}
|
|
3096
3865
|
/**
|
|
3097
|
-
*
|
|
3098
|
-
*
|
|
3099
|
-
* Use the `responseCode` field to determine the specific type interpretation
|
|
3100
|
-
* at runtime.
|
|
3866
|
+
* The result of performing ReverseResolution
|
|
3101
3867
|
*/
|
|
3102
|
-
type
|
|
3103
|
-
|
|
3868
|
+
type ReverseResolutionResult = Name | null;
|
|
3104
3869
|
/**
|
|
3105
|
-
*
|
|
3870
|
+
* Arguments required to perform Multichain Primary Name Resolution
|
|
3106
3871
|
*/
|
|
3107
|
-
|
|
3872
|
+
interface MultichainPrimaryNameResolutionArgs {
|
|
3873
|
+
address: Address;
|
|
3874
|
+
chainIds?: ChainId[];
|
|
3875
|
+
}
|
|
3108
3876
|
/**
|
|
3109
|
-
*
|
|
3877
|
+
* The result of performing MultichainPrimaryNameResolution
|
|
3110
3878
|
*/
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
}
|
|
3879
|
+
type MultichainPrimaryNameResolutionResult = Record<ChainId, Name | null>;
|
|
3880
|
+
|
|
3114
3881
|
/**
|
|
3115
|
-
*
|
|
3882
|
+
* Identifiers for each traceable ENS protocol.
|
|
3116
3883
|
*/
|
|
3117
|
-
|
|
3884
|
+
declare enum TraceableENSProtocol {
|
|
3885
|
+
ForwardResolution = "forward-resolution",
|
|
3886
|
+
ReverseResolution = "reverse-resolution"
|
|
3887
|
+
}
|
|
3118
3888
|
/**
|
|
3119
|
-
*
|
|
3889
|
+
* Encodes the set of well-known steps in the ENS Forward Resolution protocol.
|
|
3120
3890
|
*/
|
|
3121
|
-
|
|
3891
|
+
declare enum ForwardResolutionProtocolStep {
|
|
3892
|
+
Operation = "forward-resolution",
|
|
3893
|
+
FindResolver = "find-resolver",
|
|
3894
|
+
ActiveResolverExists = "active-resolver-exists",
|
|
3895
|
+
AccelerateENSIP19ReverseResolver = "accelerate-ensip-19-reverse-resolver",
|
|
3896
|
+
AccelerateKnownOffchainLookupResolver = "accelerate-known-offchain-lookup-resolver",
|
|
3897
|
+
AccelerateKnownOnchainStaticResolver = "accelerate-known-onchain-static-resolver",
|
|
3898
|
+
RequireResolver = "require-resolver",
|
|
3899
|
+
ExecuteResolveCalls = "execute-resolve-calls"
|
|
3900
|
+
}
|
|
3122
3901
|
/**
|
|
3123
|
-
*
|
|
3902
|
+
* Encodes the set of well-known steps in the ENS Reverse Resolution protocol.
|
|
3124
3903
|
*/
|
|
3125
|
-
|
|
3126
|
-
|
|
3904
|
+
declare enum ReverseResolutionProtocolStep {
|
|
3905
|
+
Operation = "reverse-resolution",
|
|
3906
|
+
ResolveReverseName = "resolve-reverse-name",
|
|
3907
|
+
NameRecordExists = "name-record-exists-check",
|
|
3908
|
+
ForwardResolveAddressRecord = "forward-resolve-address-record",
|
|
3909
|
+
VerifyResolvedAddressMatchesAddress = "verify-resolved-address-matches-address"
|
|
3910
|
+
}
|
|
3911
|
+
declare const PROTOCOL_ATTRIBUTE_PREFIX = "ens";
|
|
3912
|
+
declare const ATTR_PROTOCOL_NAME = "ens.protocol";
|
|
3913
|
+
declare const ATTR_PROTOCOL_STEP = "ens.protocol.step";
|
|
3914
|
+
declare const ATTR_PROTOCOL_STEP_RESULT = "ens.protocol.step.result";
|
|
3915
|
+
interface SpanAttributes {
|
|
3916
|
+
[key: string]: unknown;
|
|
3917
|
+
}
|
|
3918
|
+
interface SpanEvent {
|
|
3919
|
+
name: string;
|
|
3920
|
+
attributes: SpanAttributes;
|
|
3921
|
+
time: number;
|
|
3922
|
+
}
|
|
3923
|
+
interface ProtocolSpan {
|
|
3924
|
+
scope: string;
|
|
3925
|
+
id: string;
|
|
3926
|
+
traceId: string;
|
|
3927
|
+
parentSpanContext: {
|
|
3928
|
+
traceId: string;
|
|
3929
|
+
spanId: string;
|
|
3930
|
+
} | undefined;
|
|
3931
|
+
name: string;
|
|
3932
|
+
timestamp: number;
|
|
3933
|
+
duration: number;
|
|
3934
|
+
attributes: SpanAttributes;
|
|
3935
|
+
status: {
|
|
3936
|
+
code: number;
|
|
3937
|
+
message?: string;
|
|
3938
|
+
};
|
|
3939
|
+
events: SpanEvent[];
|
|
3940
|
+
}
|
|
3941
|
+
type ProtocolSpanTreeNode = ProtocolSpan & {
|
|
3942
|
+
children: ProtocolSpanTreeNode[];
|
|
3943
|
+
};
|
|
3944
|
+
type ProtocolTrace = ProtocolSpanTreeNode[];
|
|
3945
|
+
|
|
3946
|
+
interface TraceableRequest {
|
|
3947
|
+
trace?: boolean;
|
|
3948
|
+
}
|
|
3949
|
+
interface TraceableResponse {
|
|
3950
|
+
trace?: ProtocolTrace;
|
|
3951
|
+
}
|
|
3952
|
+
interface AcceleratableRequest {
|
|
3953
|
+
accelerate?: boolean;
|
|
3954
|
+
}
|
|
3955
|
+
interface AcceleratableResponse {
|
|
3956
|
+
accelerationRequested: boolean;
|
|
3957
|
+
accelerationAttempted: boolean;
|
|
3127
3958
|
}
|
|
3128
3959
|
/**
|
|
3129
|
-
*
|
|
3960
|
+
* Resolve Records Request Type
|
|
3130
3961
|
*/
|
|
3131
|
-
interface
|
|
3132
|
-
registrarActions: SerializedNamedRegistrarAction[];
|
|
3962
|
+
interface ResolveRecordsRequest<SELECTION extends ResolverRecordsSelection> extends ForwardResolutionArgs<SELECTION>, AcceleratableRequest, TraceableRequest {
|
|
3133
3963
|
}
|
|
3134
3964
|
/**
|
|
3135
|
-
*
|
|
3965
|
+
* Resolve Records Response Type
|
|
3136
3966
|
*/
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
declare function deserializeIndexingStatusResponse(maybeResponse: SerializedIndexingStatusResponse): IndexingStatusResponse;
|
|
3141
|
-
declare function deserializeRegistrarActionsResponse(maybeResponse: SerializedRegistrarActionsResponse): RegistrarActionsResponse;
|
|
3142
|
-
|
|
3967
|
+
interface ResolveRecordsResponse<SELECTION extends ResolverRecordsSelection> extends AcceleratableResponse, TraceableResponse {
|
|
3968
|
+
records: ResolverRecordsResponse<SELECTION>;
|
|
3969
|
+
}
|
|
3143
3970
|
/**
|
|
3144
|
-
*
|
|
3971
|
+
* Resolve Primary Name Request Type
|
|
3145
3972
|
*/
|
|
3146
|
-
|
|
3147
|
-
|
|
3973
|
+
interface ResolvePrimaryNameRequest extends ReverseResolutionArgs, AcceleratableRequest, TraceableRequest {
|
|
3974
|
+
}
|
|
3148
3975
|
/**
|
|
3149
|
-
*
|
|
3976
|
+
* Resolve Primary Name Response Type
|
|
3150
3977
|
*/
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
/**
|
|
3160
|
-
* Required plugins to enable Registrar Actions API routes.
|
|
3161
|
-
*
|
|
3162
|
-
* 1. `registrars` plugin is required so that data in the `registrarActions`
|
|
3163
|
-
* table is populated.
|
|
3164
|
-
* 2. `subgraph`, `basenames`, and `lineanames` are required to get the data
|
|
3165
|
-
* for the name associated with each registrar action.
|
|
3166
|
-
* 3. In theory not all of `subgraph`, `basenames`, and `lineanames` plugins
|
|
3167
|
-
* might be required. Ex: At least one, but the current logic in
|
|
3168
|
-
* the `registrars` plugin always indexes registrar actions across
|
|
3169
|
-
* Ethnames (subgraph), Basenames, and Lineanames and therefore we need to
|
|
3170
|
-
* ensure each value in the registrar actions table has
|
|
3171
|
-
* an associated record in the domains table.
|
|
3172
|
-
*/
|
|
3173
|
-
requiredPlugins: readonly [PluginName.Subgraph, PluginName.Basenames, PluginName.Lineanames, PluginName.Registrars];
|
|
3174
|
-
/**
|
|
3175
|
-
* Check if provided ENSApiPublicConfig supports the Registrar Actions API.
|
|
3176
|
-
*/
|
|
3177
|
-
hasEnsIndexerConfigSupport(config: ENSIndexerPublicConfig): boolean;
|
|
3178
|
-
/**
|
|
3179
|
-
* Required Indexing Status IDs
|
|
3180
|
-
*
|
|
3181
|
-
* Database indexes are created by the time the omnichain indexing status
|
|
3182
|
-
* is either `completed` or `following`.
|
|
3183
|
-
*/
|
|
3184
|
-
supportedIndexingStatusIds: ("omnichain-following" | "omnichain-completed")[];
|
|
3185
|
-
/**
|
|
3186
|
-
* Check if provided indexing status supports the Registrar Actions API.
|
|
3187
|
-
*/
|
|
3188
|
-
hasIndexingStatusSupport(omnichainIndexingStatusId: OmnichainIndexingStatusId): boolean;
|
|
3189
|
-
}>;
|
|
3190
|
-
|
|
3191
|
-
declare function serializeIndexingStatusResponse(response: IndexingStatusResponse): SerializedIndexingStatusResponse;
|
|
3192
|
-
declare function serializeNamedRegistrarAction({ action, name, }: NamedRegistrarAction): SerializedNamedRegistrarAction;
|
|
3193
|
-
declare function serializeRegistrarActionsResponse(response: RegistrarActionsResponse): SerializedRegistrarActionsResponse;
|
|
3978
|
+
interface ResolvePrimaryNameResponse extends AcceleratableResponse, TraceableResponse {
|
|
3979
|
+
name: ReverseResolutionResult;
|
|
3980
|
+
}
|
|
3981
|
+
interface ResolvePrimaryNamesRequest extends MultichainPrimaryNameResolutionArgs, AcceleratableRequest, TraceableRequest {
|
|
3982
|
+
}
|
|
3983
|
+
interface ResolvePrimaryNamesResponse extends AcceleratableResponse, TraceableResponse {
|
|
3984
|
+
names: MultichainPrimaryNameResolutionResult;
|
|
3985
|
+
}
|
|
3194
3986
|
|
|
3195
3987
|
/**
|
|
3196
3988
|
* Request parameters for a referrer leaderboard page query.
|
|
3197
3989
|
*/
|
|
3198
|
-
interface
|
|
3990
|
+
interface ReferrerLeaderboardPageRequest extends ReferrerLeaderboardPageParams {
|
|
3199
3991
|
}
|
|
3200
3992
|
/**
|
|
3201
3993
|
* A status code for a referrer leaderboard page API response.
|
|
@@ -3236,6 +4028,52 @@ type ReferrerLeaderboardPageResponseError = {
|
|
|
3236
4028
|
* at runtime.
|
|
3237
4029
|
*/
|
|
3238
4030
|
type ReferrerLeaderboardPageResponse = ReferrerLeaderboardPageResponseOk | ReferrerLeaderboardPageResponseError;
|
|
4031
|
+
/**
|
|
4032
|
+
* Request parameters for referrer detail query.
|
|
4033
|
+
*/
|
|
4034
|
+
interface ReferrerDetailRequest {
|
|
4035
|
+
/** The Ethereum address of the referrer to query */
|
|
4036
|
+
referrer: Address;
|
|
4037
|
+
}
|
|
4038
|
+
/**
|
|
4039
|
+
* A status code for referrer detail API responses.
|
|
4040
|
+
*/
|
|
4041
|
+
declare const ReferrerDetailResponseCodes: {
|
|
4042
|
+
/**
|
|
4043
|
+
* Represents that the referrer detail data is available.
|
|
4044
|
+
*/
|
|
4045
|
+
readonly Ok: "ok";
|
|
4046
|
+
/**
|
|
4047
|
+
* Represents that an error occurred while fetching the data.
|
|
4048
|
+
*/
|
|
4049
|
+
readonly Error: "error";
|
|
4050
|
+
};
|
|
4051
|
+
/**
|
|
4052
|
+
* The derived string union of possible {@link ReferrerDetailResponseCodes}.
|
|
4053
|
+
*/
|
|
4054
|
+
type ReferrerDetailResponseCode = (typeof ReferrerDetailResponseCodes)[keyof typeof ReferrerDetailResponseCodes];
|
|
4055
|
+
/**
|
|
4056
|
+
* A referrer detail response when the data is available for a referrer on the leaderboard.
|
|
4057
|
+
*/
|
|
4058
|
+
type ReferrerDetailResponseOk = {
|
|
4059
|
+
responseCode: typeof ReferrerDetailResponseCodes.Ok;
|
|
4060
|
+
data: ReferrerDetail;
|
|
4061
|
+
};
|
|
4062
|
+
/**
|
|
4063
|
+
* A referrer detail response when an error occurs.
|
|
4064
|
+
*/
|
|
4065
|
+
type ReferrerDetailResponseError = {
|
|
4066
|
+
responseCode: typeof ReferrerDetailResponseCodes.Error;
|
|
4067
|
+
error: string;
|
|
4068
|
+
errorMessage: string;
|
|
4069
|
+
};
|
|
4070
|
+
/**
|
|
4071
|
+
* A referrer detail API response.
|
|
4072
|
+
*
|
|
4073
|
+
* Use the `responseCode` field to determine the specific type interpretation
|
|
4074
|
+
* at runtime.
|
|
4075
|
+
*/
|
|
4076
|
+
type ReferrerDetailResponse = ReferrerDetailResponseOk | ReferrerDetailResponseError;
|
|
3239
4077
|
|
|
3240
4078
|
/**
|
|
3241
4079
|
* Serialized representation of {@link ReferrerLeaderboardPageResponseError}.
|
|
@@ -3253,6 +4091,24 @@ type SerializedReferrerLeaderboardPageResponseOk = ReferrerLeaderboardPageRespon
|
|
|
3253
4091
|
* Serialized representation of {@link ReferrerLeaderboardPageResponse}.
|
|
3254
4092
|
*/
|
|
3255
4093
|
type SerializedReferrerLeaderboardPageResponse = SerializedReferrerLeaderboardPageResponseOk | SerializedReferrerLeaderboardPageResponseError;
|
|
4094
|
+
/**
|
|
4095
|
+
* Serialized representation of {@link ReferrerDetailResponseOk}.
|
|
4096
|
+
*
|
|
4097
|
+
* Note: All fields in ReferrerDetailRanked and ReferrerDetailUnranked
|
|
4098
|
+
* (rules, referrer metrics, aggregatedMetrics, and timestamp) are already serializable primitives.
|
|
4099
|
+
* The rank field can be either a number or null, both of which are valid JSON primitives.
|
|
4100
|
+
*/
|
|
4101
|
+
type SerializedReferrerDetailResponseOk = ReferrerDetailResponseOk;
|
|
4102
|
+
/**
|
|
4103
|
+
* Serialized representation of {@link ReferrerDetailResponseError}.
|
|
4104
|
+
*
|
|
4105
|
+
* Note: All fields are already serializable, so this type is identical to the source type.
|
|
4106
|
+
*/
|
|
4107
|
+
type SerializedReferrerDetailResponseError = ReferrerDetailResponseError;
|
|
4108
|
+
/**
|
|
4109
|
+
* Serialized representation of {@link ReferrerDetailResponse}.
|
|
4110
|
+
*/
|
|
4111
|
+
type SerializedReferrerDetailResponse = SerializedReferrerDetailResponseOk | SerializedReferrerDetailResponseError;
|
|
3256
4112
|
|
|
3257
4113
|
/**
|
|
3258
4114
|
* Deserialize a {@link ReferrerLeaderboardPageResponse} object.
|
|
@@ -3263,6 +4119,15 @@ type SerializedReferrerLeaderboardPageResponse = SerializedReferrerLeaderboardPa
|
|
|
3263
4119
|
* responses from the API.
|
|
3264
4120
|
*/
|
|
3265
4121
|
declare function deserializeReferrerLeaderboardPageResponse(maybeResponse: SerializedReferrerLeaderboardPageResponse, valueLabel?: string): ReferrerLeaderboardPageResponse;
|
|
4122
|
+
/**
|
|
4123
|
+
* Deserialize a {@link ReferrerDetailResponse} object.
|
|
4124
|
+
*
|
|
4125
|
+
* Note: While the serialized and deserialized types are identical (all fields
|
|
4126
|
+
* are primitives), this function performs critical validation using Zod schemas
|
|
4127
|
+
* to enforce invariants on the data. This ensures data integrity when receiving
|
|
4128
|
+
* responses from the API.
|
|
4129
|
+
*/
|
|
4130
|
+
declare function deserializeReferrerDetailResponse(maybeResponse: SerializedReferrerDetailResponse, valueLabel?: string): ReferrerDetailResponse;
|
|
3266
4131
|
|
|
3267
4132
|
/**
|
|
3268
4133
|
* Serialize a {@link ReferrerLeaderboardPageResponse} object.
|
|
@@ -3273,6 +4138,16 @@ declare function deserializeReferrerLeaderboardPageResponse(maybeResponse: Seria
|
|
|
3273
4138
|
* throughout the codebase.
|
|
3274
4139
|
*/
|
|
3275
4140
|
declare function serializeReferrerLeaderboardPageResponse(response: ReferrerLeaderboardPageResponse): SerializedReferrerLeaderboardPageResponse;
|
|
4141
|
+
/**
|
|
4142
|
+
* Serialize a {@link ReferrerDetailResponse} object.
|
|
4143
|
+
*
|
|
4144
|
+
* Note: Since all fields in ReferrerDetailRanked and ReferrerDetailUnranked
|
|
4145
|
+
* (rules, referrer metrics, aggregatedMetrics, and timestamp) are already
|
|
4146
|
+
* serializable primitives, this function performs an identity transformation.
|
|
4147
|
+
* The rank field can be either a number or null, both of which are valid JSON primitives.
|
|
4148
|
+
* It exists to maintain consistency with the serialization pattern used throughout the codebase.
|
|
4149
|
+
*/
|
|
4150
|
+
declare function serializeReferrerDetailResponse(response: ReferrerDetailResponse): SerializedReferrerDetailResponse;
|
|
3276
4151
|
|
|
3277
4152
|
/**
|
|
3278
4153
|
* Configuration options for ENSNode API client
|
|
@@ -3461,7 +4336,7 @@ declare class ENSNodeClient {
|
|
|
3461
4336
|
*
|
|
3462
4337
|
* @param request - Pagination parameters
|
|
3463
4338
|
* @param request.page - The page number to retrieve (1-indexed, default: 1)
|
|
3464
|
-
* @param request.
|
|
4339
|
+
* @param request.recordsPerPage - Number of records per page (default: 25, max: 100)
|
|
3465
4340
|
* @returns {ReferrerLeaderboardPageResponse}
|
|
3466
4341
|
*
|
|
3467
4342
|
* @throws if the ENSNode request fails
|
|
@@ -3470,34 +4345,34 @@ declare class ENSNodeClient {
|
|
|
3470
4345
|
*
|
|
3471
4346
|
* @example
|
|
3472
4347
|
* ```typescript
|
|
3473
|
-
* // Get first page with default page size (25
|
|
3474
|
-
* const response = await client.
|
|
4348
|
+
* // Get first page with default page size (25 records)
|
|
4349
|
+
* const response = await client.getReferrerLeaderboardPage();
|
|
3475
4350
|
* if (response.responseCode === ReferrerLeaderboardPageResponseCodes.Ok) {
|
|
3476
4351
|
* const {
|
|
3477
4352
|
* aggregatedMetrics,
|
|
3478
4353
|
* referrers,
|
|
3479
4354
|
* rules,
|
|
3480
|
-
*
|
|
4355
|
+
* pageContext,
|
|
3481
4356
|
* updatedAt
|
|
3482
4357
|
* } = response.data;
|
|
3483
4358
|
* console.log(aggregatedMetrics);
|
|
3484
4359
|
* console.log(referrers);
|
|
3485
4360
|
* console.log(rules);
|
|
3486
4361
|
* console.log(updatedAt);
|
|
3487
|
-
* console.log(`Page ${
|
|
4362
|
+
* console.log(`Page ${pageContext.page} of ${pageContext.totalPages}`);
|
|
3488
4363
|
* }
|
|
3489
4364
|
* ```
|
|
3490
4365
|
*
|
|
3491
4366
|
* @example
|
|
3492
4367
|
* ```typescript
|
|
3493
|
-
* // Get second page with 50
|
|
3494
|
-
* const response = await client.
|
|
4368
|
+
* // Get second page with 50 records per page
|
|
4369
|
+
* const response = await client.getReferrerLeaderboardPage({ page: 2, recordsPerPage: 50 });
|
|
3495
4370
|
* ```
|
|
3496
4371
|
*
|
|
3497
4372
|
* @example
|
|
3498
4373
|
* ```typescript
|
|
3499
4374
|
* // Handle error response, ie. when Referrer Leaderboard is not currently available.
|
|
3500
|
-
* const response = await client.
|
|
4375
|
+
* const response = await client.getReferrerLeaderboardPage();
|
|
3501
4376
|
*
|
|
3502
4377
|
* if (response.responseCode === ReferrerLeaderboardPageResponseCodes.Error) {
|
|
3503
4378
|
* console.error(response.error);
|
|
@@ -3505,15 +4380,94 @@ declare class ENSNodeClient {
|
|
|
3505
4380
|
* }
|
|
3506
4381
|
* ```
|
|
3507
4382
|
*/
|
|
3508
|
-
|
|
4383
|
+
getReferrerLeaderboardPage(request?: ReferrerLeaderboardPageRequest): Promise<ReferrerLeaderboardPageResponse>;
|
|
4384
|
+
/**
|
|
4385
|
+
* Fetch Referrer Detail
|
|
4386
|
+
*
|
|
4387
|
+
* Retrieves detailed information about a specific referrer, whether they are on the
|
|
4388
|
+
* leaderboard or not.
|
|
4389
|
+
*
|
|
4390
|
+
* The response data is a discriminated union type with a `type` field:
|
|
4391
|
+
*
|
|
4392
|
+
* **For referrers on the leaderboard** (`ReferrerDetailRanked`):
|
|
4393
|
+
* - `type`: {@link ReferrerDetailTypeIds.Ranked}
|
|
4394
|
+
* - `referrer`: The `AwardedReferrerMetrics` from @namehash/ens-referrals
|
|
4395
|
+
* - `rules`: The referral program rules
|
|
4396
|
+
* - `aggregatedMetrics`: Aggregated metrics for all referrers on the leaderboard
|
|
4397
|
+
* - `accurateAsOf`: Unix timestamp indicating when the data was last updated
|
|
4398
|
+
*
|
|
4399
|
+
* **For referrers NOT on the leaderboard** (`ReferrerDetailUnranked`):
|
|
4400
|
+
* - `type`: {@link ReferrerDetailTypeIds.Unranked}
|
|
4401
|
+
* - `referrer`: The `UnrankedReferrerMetrics` from @namehash/ens-referrals
|
|
4402
|
+
* - `rules`: The referral program rules
|
|
4403
|
+
* - `aggregatedMetrics`: Aggregated metrics for all referrers on the leaderboard
|
|
4404
|
+
* - `accurateAsOf`: Unix timestamp indicating when the data was last updated
|
|
4405
|
+
*
|
|
4406
|
+
* @see {@link https://www.npmjs.com/package/@namehash/ens-referrals|@namehash/ens-referrals} for calculation details
|
|
4407
|
+
*
|
|
4408
|
+
* @param request The referrer address to query
|
|
4409
|
+
* @returns {ReferrerDetailResponse} Returns the referrer detail response
|
|
4410
|
+
*
|
|
4411
|
+
* @throws if the ENSNode request fails
|
|
4412
|
+
* @throws if the response data is malformed
|
|
4413
|
+
*
|
|
4414
|
+
* @example
|
|
4415
|
+
* ```typescript
|
|
4416
|
+
* // Get referrer detail for a specific address
|
|
4417
|
+
* const response = await client.getReferrerDetail({
|
|
4418
|
+
* referrer: "0x1234567890123456789012345678901234567890"
|
|
4419
|
+
* });
|
|
4420
|
+
* if (response.responseCode === ReferrerDetailResponseCodes.Ok) {
|
|
4421
|
+
* const { type, referrer, rules, aggregatedMetrics, accurateAsOf } = response.data;
|
|
4422
|
+
* console.log(type); // ReferrerDetailTypeIds.Ranked or ReferrerDetailTypeIds.Unranked
|
|
4423
|
+
* console.log(referrer);
|
|
4424
|
+
* console.log(accurateAsOf);
|
|
4425
|
+
* }
|
|
4426
|
+
* ```
|
|
4427
|
+
*
|
|
4428
|
+
* @example
|
|
4429
|
+
* ```typescript
|
|
4430
|
+
* // Use discriminated union to check if referrer is ranked
|
|
4431
|
+
* const response = await client.getReferrerDetail({
|
|
4432
|
+
* referrer: "0x1234567890123456789012345678901234567890"
|
|
4433
|
+
* });
|
|
4434
|
+
* if (response.responseCode === ReferrerDetailResponseCodes.Ok) {
|
|
4435
|
+
* if (response.data.type === ReferrerDetailTypeIds.Ranked) {
|
|
4436
|
+
* // TypeScript knows this is ReferrerDetailRanked
|
|
4437
|
+
* console.log(`Rank: ${response.data.referrer.rank}`);
|
|
4438
|
+
* console.log(`Qualified: ${response.data.referrer.isQualified}`);
|
|
4439
|
+
* console.log(`Award Pool Share: ${response.data.referrer.awardPoolShare * 100}%`);
|
|
4440
|
+
* } else {
|
|
4441
|
+
* // TypeScript knows this is ReferrerDetailUnranked
|
|
4442
|
+
* console.log("Referrer is not on the leaderboard (no referrals yet)");
|
|
4443
|
+
* }
|
|
4444
|
+
* }
|
|
4445
|
+
* ```
|
|
4446
|
+
*
|
|
4447
|
+
* @example
|
|
4448
|
+
* ```typescript
|
|
4449
|
+
* // Handle error response, ie. when Referrer Detail is not currently available.
|
|
4450
|
+
* const response = await client.getReferrerDetail({
|
|
4451
|
+
* referrer: "0x1234567890123456789012345678901234567890"
|
|
4452
|
+
* });
|
|
4453
|
+
*
|
|
4454
|
+
* if (response.responseCode === ReferrerDetailResponseCodes.Error) {
|
|
4455
|
+
* console.error(response.error);
|
|
4456
|
+
* console.error(response.errorMessage);
|
|
4457
|
+
* }
|
|
4458
|
+
* ```
|
|
4459
|
+
*/
|
|
4460
|
+
getReferrerDetail(request: ReferrerDetailRequest): Promise<ReferrerDetailResponse>;
|
|
3509
4461
|
/**
|
|
3510
4462
|
* Fetch ENSNode Registrar Actions
|
|
3511
4463
|
*
|
|
3512
|
-
*
|
|
3513
|
-
*
|
|
3514
|
-
* @param
|
|
3515
|
-
* @param
|
|
3516
|
-
*
|
|
4464
|
+
* Retrieves a paginated list of registrar actions with optional filters.
|
|
4465
|
+
*
|
|
4466
|
+
* @param request is a request configuration.
|
|
4467
|
+
* @param request.page sets the page number to retrieve (1-indexed, default: 1)
|
|
4468
|
+
* @param request.recordsPerPage sets the number of records per page (default: 10, max: 100)
|
|
4469
|
+
* @param request.filters is an optional request filter configuration.
|
|
4470
|
+
* @param request.order sets the order of results in the response by field and direction.
|
|
3517
4471
|
* @returns {RegistrarActionsResponse}
|
|
3518
4472
|
*
|
|
3519
4473
|
* @throws if the ENSNode request fails
|
|
@@ -3523,23 +4477,25 @@ declare class ENSNodeClient {
|
|
|
3523
4477
|
* @example
|
|
3524
4478
|
* ```ts
|
|
3525
4479
|
* import {
|
|
3526
|
-
* registrarActionsFilter
|
|
4480
|
+
* registrarActionsFilter,
|
|
3527
4481
|
* ENSNodeClient,
|
|
3528
4482
|
* } from "@ensnode/ensnode-sdk";
|
|
3529
4483
|
* import { namehash } from "viem/ens";
|
|
3530
4484
|
*
|
|
3531
4485
|
* const client: ENSNodeClient;
|
|
3532
4486
|
*
|
|
3533
|
-
* //
|
|
3534
|
-
*
|
|
3535
|
-
*
|
|
3536
|
-
*
|
|
4487
|
+
* // Get first page with default page size (10 records)
|
|
4488
|
+
* const response = await client.registrarActions();
|
|
4489
|
+
* if (response.responseCode === RegistrarActionsResponseCodes.Ok) {
|
|
4490
|
+
* const { registrarActions, pageContext } = response;
|
|
4491
|
+
* console.log(registrarActions);
|
|
4492
|
+
* console.log(`Page ${pageContext.page} of ${pageContext.totalPages}`);
|
|
4493
|
+
* }
|
|
3537
4494
|
*
|
|
3538
|
-
* //
|
|
3539
|
-
*
|
|
3540
|
-
*
|
|
3541
|
-
*
|
|
3542
|
-
* limit: 5,
|
|
4495
|
+
* // Get second page with 25 records per page
|
|
4496
|
+
* const response = await client.registrarActions({
|
|
4497
|
+
* page: 2,
|
|
4498
|
+
* recordsPerPage: 25,
|
|
3543
4499
|
* });
|
|
3544
4500
|
*
|
|
3545
4501
|
* // get latest registrar action records associated with
|
|
@@ -3553,15 +4509,50 @@ declare class ENSNodeClient {
|
|
|
3553
4509
|
* filters: [registrarActionsFilter.withReferral(true)],
|
|
3554
4510
|
* });
|
|
3555
4511
|
*
|
|
4512
|
+
* // get latest registrar action records for a specific decoded referrer
|
|
4513
|
+
* await client.registrarActions({
|
|
4514
|
+
* filters: [registrarActionsFilter.byDecodedReferrer("0x1234567890123456789012345678901234567890")],
|
|
4515
|
+
* });
|
|
4516
|
+
*
|
|
3556
4517
|
* // get latest 10 registrar action records associated with
|
|
3557
4518
|
* // subregistry managing `base.eth` name
|
|
3558
4519
|
* await client.registrarActions({
|
|
3559
4520
|
* filters: [registrarActionsFilter.byParentNode(namehash('base.eth'))],
|
|
3560
|
-
*
|
|
4521
|
+
* recordsPerPage: 10
|
|
3561
4522
|
* });
|
|
3562
4523
|
* ```
|
|
3563
4524
|
*/
|
|
3564
4525
|
registrarActions(request?: RegistrarActionsRequest): Promise<RegistrarActionsResponse>;
|
|
4526
|
+
/**
|
|
4527
|
+
* Fetch Name Tokens for requested name.
|
|
4528
|
+
*
|
|
4529
|
+
* @param request.name - Name for which Name Tokens will be fetched.
|
|
4530
|
+
* @returns {NameTokensResponse}
|
|
4531
|
+
*
|
|
4532
|
+
* @throws if the ENSNode request fails
|
|
4533
|
+
* @throws if the ENSNode API returns an error response
|
|
4534
|
+
* @throws if the ENSNode response breaks required invariants
|
|
4535
|
+
*
|
|
4536
|
+
* @example
|
|
4537
|
+
* ```ts
|
|
4538
|
+
* import {
|
|
4539
|
+
* ENSNodeClient,
|
|
4540
|
+
* } from "@ensnode/ensnode-sdk";
|
|
4541
|
+
* import { namehash } from "viem/ens";
|
|
4542
|
+
*
|
|
4543
|
+
* const client: ENSNodeClient;
|
|
4544
|
+
*
|
|
4545
|
+
* // get latest name token records from the indexed subregistry based on the requested name
|
|
4546
|
+
* const response = await client.nameTokens({
|
|
4547
|
+
* name: "vitalik.eth"
|
|
4548
|
+
* });
|
|
4549
|
+
*
|
|
4550
|
+
* const response = await client.nameTokens({
|
|
4551
|
+
* domainId: "0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835" // namehash('vitalik.eth')
|
|
4552
|
+
* })
|
|
4553
|
+
* ```
|
|
4554
|
+
*/
|
|
4555
|
+
nameTokens(request: NameTokensRequest): Promise<NameTokensResponse>;
|
|
3565
4556
|
}
|
|
3566
4557
|
|
|
3567
4558
|
declare class ClientError extends Error {
|
|
@@ -3570,4 +4561,4 @@ declare class ClientError extends Error {
|
|
|
3570
4561
|
static fromErrorResponse({ message, details }: ErrorResponse): ClientError;
|
|
3571
4562
|
}
|
|
3572
4563
|
|
|
3573
|
-
export { ADDR_REVERSE_NODE, 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 CachedValue, type ChainId, type ChainIdString, type ChainIndexingConfig, type ChainIndexingConfigDefinite, type ChainIndexingConfigIndefinite, type ChainIndexingConfigTypeId, ChainIndexingConfigTypeIds, 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_EVM_CHAIN_ID, DEFAULT_EVM_COIN_TYPE, type DNSEncodedLiteralName, type DNSEncodedName, type DNSEncodedPartiallyInterpretedName, type Datetime, type DatetimeISO8601, type DeepPartial, type DefaultableChainId, type Duration, type ENSApiPublicConfig, type ENSIndexerPublicConfig, type ENSIndexerVersionInfo, ENSNodeClient, ETH_COIN_TYPE, ETH_NODE, type EncodedLabelHash, type EnsRainbowClientLabelSet, 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 LabelSetId, type LabelSetVersion, type LiteralLabel, type LiteralName, LruCache, type MultichainPrimaryNameResolutionArgs, type MultichainPrimaryNameResolutionResult, type Name, type NamedIdentity, type NamedRegistrarAction, type Node, type NormalizedName, type OmnichainIndexingStatusId, OmnichainIndexingStatusIds, type OmnichainIndexingStatusSnapshot, type OmnichainIndexingStatusSnapshotBackfill, type OmnichainIndexingStatusSnapshotCompleted, type OmnichainIndexingStatusSnapshotFollowing, type OmnichainIndexingStatusSnapshotUnstarted, PROTOCOL_ATTRIBUTE_PREFIX, PluginName, type Price, type PriceDai, type PriceEth, type PriceUsdc, type ProtocolSpan, type ProtocolSpanTreeNode, type ProtocolTrace, ROOT_NODE, type RealtimeIndexingStatusProjection, type ReferrerLeaderboardPageResponse, type ReferrerLeaderboardPageResponseCode, ReferrerLeaderboardPageResponseCodes, type ReferrerLeaderboardPageResponseError, type ReferrerLeaderboardPageResponseOk, type ReferrerLeaderboardPaginationRequest, type RegistrarAction, type RegistrarActionEventId, type RegistrarActionPricing, type RegistrarActionPricingAvailable, type RegistrarActionPricingUnknown, type RegistrarActionReferral, type RegistrarActionReferralAvailable, type RegistrarActionReferralNotApplicable, type RegistrarActionType, RegistrarActionTypes, type RegistrarActionsFilter, type RegistrarActionsFilterBySubregistryNode, type RegistrarActionsFilterType, RegistrarActionsFilterTypes, type RegistrarActionsFilterWithEncodedReferral, type RegistrarActionsOrder, RegistrarActionsOrders, type RegistrarActionsRequest, type RegistrarActionsResponse, type RegistrarActionsResponseCode, RegistrarActionsResponseCodes, type RegistrarActionsResponseError, type RegistrarActionsResponseOk, type RegistrationLifecycle, type RegistrationLifecycleStage, type ResolutionStatusId, ResolutionStatusIds, type ResolvePrimaryNameRequest, type ResolvePrimaryNameResponse, type ResolvePrimaryNamesRequest, type ResolvePrimaryNamesResponse, type ResolveRecordsRequest, type ResolveRecordsResponse, type ResolvedIdentity, type ResolverRecordsResponse, type ResolverRecordsResponseBase, type ResolverRecordsSelection, type ReverseResolutionArgs, ReverseResolutionProtocolStep, type ReverseResolutionResult, type RpcUrl, SWRCache, type SWRCacheOptions, type SerializedAccountId, type SerializedChainIndexingStatusSnapshot, type SerializedChainIndexingStatusSnapshotBackfill, type SerializedChainIndexingStatusSnapshotCompleted, type SerializedChainIndexingStatusSnapshotFollowing, type SerializedChainIndexingStatusSnapshotQueued, type SerializedCrossChainIndexingStatusSnapshot, type SerializedCrossChainIndexingStatusSnapshotOmnichain, type SerializedCurrencyAmount, type SerializedCurrentIndexingProjectionOmnichain, type SerializedENSApiPublicConfig, type SerializedENSIndexerPublicConfig, type SerializedENSIndexerVersionInfo, type SerializedIndexedChainIds, type SerializedIndexingStatusResponse, type SerializedIndexingStatusResponseError, type SerializedIndexingStatusResponseOk, type SerializedNamedRegistrarAction, type SerializedOmnichainIndexingStatusSnapshot, type SerializedOmnichainIndexingStatusSnapshotBackfill, type SerializedOmnichainIndexingStatusSnapshotCompleted, type SerializedOmnichainIndexingStatusSnapshotFollowing, type SerializedOmnichainIndexingStatusSnapshotUnstarted, type SerializedPrice, type SerializedPriceDai, type SerializedPriceEth, type SerializedPriceUsdc, type SerializedRealtimeIndexingStatusProjection, type SerializedReferrerLeaderboardPageResponse, type SerializedReferrerLeaderboardPageResponseError, type SerializedReferrerLeaderboardPageResponseOk, type SerializedRegistrarAction, type SerializedRegistrarActionPricing, type SerializedRegistrarActionPricingAvailable, type SerializedRegistrarActionPricingUnknown, type SerializedRegistrarActionsResponse, type SerializedRegistrarActionsResponseError, type SerializedRegistrarActionsResponseOk, type SerializedRegistrationLifecycle, type SerializedSubregistry, type SubgraphInterpretedLabel, type SubgraphInterpretedName, type Subregistry, type TheGraphCannotFallbackReason, TheGraphCannotFallbackReasonSchema, type TheGraphFallback, TheGraphFallbackSchema, TraceableENSProtocol, type TraceableRequest, type TraceableResponse, TtlCache, type UnixTimestamp, type UnknownIdentity, type UnnamedIdentity, type UnresolvedIdentity, type UrlString, accountIdEqual, addDuration, addPrices, addrReverseLabel, asLowerCaseAddress, beautifyName, bigIntToNumber, bigintToCoinType, buildEnsRainbowClientLabelSet, buildLabelSetId, buildLabelSetVersion, buildUnresolvedIdentity, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted, coinTypeReverseLabel, coinTypeToEvmChainId, createIndexingConfig, createRealtimeIndexingStatusProjection, decodeDNSEncodedLiteralName, decodeDNSEncodedName, deserializeAccountId, deserializeBlockNumber, deserializeBlockRef, deserializeBlockrange, deserializeChainId, deserializeChainIndexingStatusSnapshot, deserializeCrossChainIndexingStatusSnapshot, deserializeDatetime, deserializeDuration, deserializeENSApiPublicConfig, deserializeENSIndexerPublicConfig, deserializeErrorResponse, deserializeIndexingStatusResponse, deserializeOmnichainIndexingStatusSnapshot, deserializeRealtimeIndexingStatusProjection, deserializeReferrerLeaderboardPageResponse, deserializeRegistrarActionsResponse, deserializeUnixTimestamp, deserializeUrl, durationBetween, encodeLabelHash, evmChainIdToCoinType, getCurrencyInfo, getEthnamesSubregistryId, getLatestIndexedBlockRef, getNameHierarchy, getOmnichainIndexingCursor, getOmnichainIndexingStatus, getResolvePrimaryNameChainIdParam, getTimestampForHighestOmnichainKnownBlock, getTimestampForLowestOmnichainStartBlock, hasNullByte, interpretedLabelsToInterpretedName, isEncodedLabelHash, isHttpProtocol, isLabelHash, isNormalizedLabel, isNormalizedName, isPriceCurrencyEqual, isPriceEqual, isRegistrarActionPricingAvailable, isRegistrarActionReferralAvailable, isResolvedIdentity, isSelectionEmpty, isSubgraphCompatible, isWebSocketProtocol, labelHashToBytes, labelhashLiteralLabel, literalLabelToInterpretedLabel, literalLabelsToInterpretedName, literalLabelsToLiteralName, makeENSApiPublicConfigSchema, makeSubdomainNode, parseNonNegativeInteger, parseReverseName, priceDai, priceEth, priceUsdc, registrarActionsFilter, registrarActionsPrerequisites, reverseName, serializeAccountId, serializeChainId, serializeChainIndexingSnapshots, serializeCrossChainIndexingStatusSnapshotOmnichain, serializeDatetime, serializeENSApiPublicConfig, serializeENSIndexerPublicConfig, serializeIndexedChainIds, serializeIndexingStatusResponse, serializeNamedRegistrarAction, serializeOmnichainIndexingStatusSnapshot, serializePrice, serializePriceEth, serializeRealtimeIndexingStatusProjection, serializeReferrerLeaderboardPageResponse, serializeRegistrarAction, serializeRegistrarActionPricing, serializeRegistrarActionsResponse, serializeRegistrationLifecycle, serializeSubregistry, serializeUrl, sortChainStatusesByStartBlockAsc, stripNullBytes, translateDefaultableChainIdToChainId, uint256ToHex32, uniq, validateSupportedLabelSetAndVersion };
|
|
4564
|
+
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 BlockRef, type Blockrange, type Cache, type CachedValue, type ChainId, type ChainIdString, type ChainIndexingConfig, type ChainIndexingConfigDefinite, type ChainIndexingConfigIndefinite, type ChainIndexingConfigTypeId, ChainIndexingConfigTypeIds, 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_EVM_CHAIN_ID, DEFAULT_EVM_COIN_TYPE, type DNSEncodedLiteralName, type DNSEncodedName, type DNSEncodedPartiallyInterpretedName, type Datetime, type DatetimeISO8601, type DeepPartial, type DefaultableChainId, type DomainAssetId, type Duration, type ENSApiPublicConfig, type ENSIndexerPublicConfig, type ENSIndexerVersionInfo, ENSNodeClient, ENS_ROOT, ETH_COIN_TYPE, ETH_NODE, type EncodedLabelHash, type EnsRainbowClientLabelSet, 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 LabelSetId, type LabelSetVersion, type LiteralLabel, type LiteralName, LruCache, type MultichainPrimaryNameResolutionArgs, type MultichainPrimaryNameResolutionResult, type NFTMintStatus, NFTMintStatuses, type NFTTransferEventMetadata, type NFTTransferType, NFTTransferTypes, type Name, type NameToken, type NameTokenOwnership, type NameTokenOwnershipBurned, type NameTokenOwnershipFullyOnchain, type NameTokenOwnershipNameWrapper, type NameTokenOwnershipType, NameTokenOwnershipTypes, type NameTokenOwnershipUnknown, type NameTokensRequest, type NameTokensRequestByDomainId, type NameTokensRequestByName, type NameTokensResponse, type NameTokensResponseCode, NameTokensResponseCodes, type NameTokensResponseError, type NameTokensResponseErrorCode, NameTokensResponseErrorCodes, type NameTokensResponseErrorEnsIndexerConfigUnsupported, type NameTokensResponseErrorIndexingStatusUnsupported, type NameTokensResponseErrorNameTokensNotIndexed, type NameTokensResponseOk, type NamedIdentity, type NamedRegistrarAction, type Node, type NormalizedName, type OmnichainIndexingStatusId, OmnichainIndexingStatusIds, type OmnichainIndexingStatusSnapshot, type OmnichainIndexingStatusSnapshotBackfill, type OmnichainIndexingStatusSnapshotCompleted, type OmnichainIndexingStatusSnapshotFollowing, type OmnichainIndexingStatusSnapshotUnstarted, PROTOCOL_ATTRIBUTE_PREFIX, PluginName, type Price, type PriceDai, type PriceEth, type PriceUsdc, type ProtocolSpan, type ProtocolSpanTreeNode, type ProtocolTrace, RECORDS_PER_PAGE_DEFAULT, RECORDS_PER_PAGE_MAX, ROOT_NODE, type RealtimeIndexingStatusProjection, type ReferrerDetailRequest, type ReferrerDetailResponse, type ReferrerDetailResponseCode, ReferrerDetailResponseCodes, type ReferrerDetailResponseError, type ReferrerDetailResponseOk, type ReferrerLeaderboardPageRequest, type ReferrerLeaderboardPageResponse, type ReferrerLeaderboardPageResponseCode, ReferrerLeaderboardPageResponseCodes, type ReferrerLeaderboardPageResponseError, type ReferrerLeaderboardPageResponseOk, type RegisteredNameTokens, type RegistrarAction, type RegistrarActionEventId, type RegistrarActionPricing, type RegistrarActionPricingAvailable, type RegistrarActionPricingUnknown, type RegistrarActionReferral, type RegistrarActionReferralAvailable, type RegistrarActionReferralNotApplicable, type RegistrarActionType, RegistrarActionTypes, type RegistrarActionsFilter, type RegistrarActionsFilterByDecodedReferrer, type RegistrarActionsFilterBySubregistryNode, type RegistrarActionsFilterType, RegistrarActionsFilterTypes, type RegistrarActionsFilterWithEncodedReferral, type RegistrarActionsOrder, RegistrarActionsOrders, type RegistrarActionsRequest, type RegistrarActionsResponse, type RegistrarActionsResponseCode, RegistrarActionsResponseCodes, type RegistrarActionsResponseError, type RegistrarActionsResponseOk, type RegistrationLifecycle, type RegistrationLifecycleStage, type RequestPageParams, 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 SerializedConfigResponse, type SerializedCrossChainIndexingStatusSnapshot, type SerializedCrossChainIndexingStatusSnapshotOmnichain, type SerializedCurrencyAmount, type SerializedCurrentIndexingProjectionOmnichain, type SerializedDomainAssetId, type SerializedENSApiPublicConfig, 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 SerializedReferrerDetailResponse, type SerializedReferrerDetailResponseError, type SerializedReferrerDetailResponseOk, type SerializedReferrerLeaderboardPageResponse, type SerializedReferrerLeaderboardPageResponseError, type SerializedReferrerLeaderboardPageResponseOk, 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, TtlCache, type UnixTimestamp, type UnknownIdentity, type UnnamedIdentity, type UnresolvedIdentity, type UrlString, accountIdEqual, addDuration, addPrices, addrReverseLabel, asLowerCaseAddress, beautifyName, bigIntToNumber, bigintToCoinType, buildAssetId, buildEnsRainbowClientLabelSet, buildLabelSetId, buildLabelSetVersion, buildPageContext, buildUnresolvedIdentity, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing, checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted, coinTypeReverseLabel, coinTypeToEvmChainId, createIndexingConfig, createRealtimeIndexingStatusProjection, decodeDNSEncodedLiteralName, decodeDNSEncodedName, deserializeAssetId, deserializeBlockNumber, deserializeBlockRef, deserializeBlockrange, deserializeChainId, deserializeChainIndexingStatusSnapshot, deserializeConfigResponse, deserializeCrossChainIndexingStatusSnapshot, deserializeDatetime, deserializeDuration, deserializeENSApiPublicConfig, deserializeENSIndexerPublicConfig, deserializeErrorResponse, deserializeIndexingStatusResponse, deserializeOmnichainIndexingStatusSnapshot, deserializeRealtimeIndexingStatusProjection, deserializeReferrerDetailResponse, deserializeReferrerLeaderboardPageResponse, deserializeRegistrarActionsResponse, deserializeUnixTimestamp, deserializeUrl, deserializedNameTokensResponse, durationBetween, encodeLabelHash, evmChainIdToCoinType, formatAccountId, formatAssetId, formatNFTTransferEventMetadata, getBasenamesSubregistryId, getBasenamesSubregistryManagedName, getCurrencyInfo, getDatasourceContract, getEthnamesSubregistryId, getEthnamesSubregistryManagedName, getLatestIndexedBlockRef, getLineanamesSubregistryId, getLineanamesSubregistryManagedName, getNFTTransferType, getNameHierarchy, getNameTokenOwnership, getNameWrapperAccounts, getOmnichainIndexingCursor, getOmnichainIndexingStatus, getParentNameFQDN, getResolvePrimaryNameChainIdParam, getTimestampForHighestOmnichainKnownBlock, getTimestampForLowestOmnichainStartBlock, hasNullByte, interpretedLabelsToInterpretedName, isEncodedLabelHash, isHttpProtocol, isLabelHash, isNormalizedLabel, isNormalizedName, isPriceCurrencyEqual, isPriceEqual, isRegistrarActionPricingAvailable, isRegistrarActionReferralAvailable, isResolvedIdentity, isSelectionEmpty, isSubgraphCompatible, isWebSocketProtocol, labelHashToBytes, labelhashLiteralLabel, literalLabelToInterpretedLabel, literalLabelsToInterpretedName, literalLabelsToLiteralName, makeENSApiPublicConfigSchema, makeSubdomainNode, maybeGetDatasourceContract, nameTokensPrerequisites, parseAccountId, parseAssetId, parseNonNegativeInteger, parseReverseName, priceDai, priceEth, priceUsdc, registrarActionsFilter, registrarActionsPrerequisites, reverseName, serializeAssetId, serializeChainId, serializeChainIndexingSnapshots, serializeConfigResponse, serializeCrossChainIndexingStatusSnapshotOmnichain, serializeDatetime, serializeDomainAssetId, serializeENSApiPublicConfig, serializeENSIndexerPublicConfig, serializeIndexedChainIds, serializeIndexingStatusResponse, serializeNameToken, serializeNameTokensResponse, serializeNamedRegistrarAction, serializeOmnichainIndexingStatusSnapshot, serializePrice, serializePriceEth, serializeRealtimeIndexingStatusProjection, serializeReferrerDetailResponse, serializeReferrerLeaderboardPageResponse, serializeRegisteredNameTokens, serializeRegistrarAction, serializeRegistrarActionPricing, serializeRegistrarActionsResponse, serializeUrl, sortChainStatusesByStartBlockAsc, stripNullBytes, translateDefaultableChainIdToChainId, uint256ToHex32, uniq, validateSupportedLabelSetAndVersion };
|