@ensnode/ensnode-sdk 1.15.0 → 1.15.2
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/LICENSE +1 -1
- package/README.md +21 -9
- package/dist/index.cjs +11 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -9
- package/dist/index.d.ts +18 -9
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +397 -96
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +11 -5
- package/dist/internal.d.ts +11 -5
- package/dist/internal.js +386 -81
- package/dist/internal.js.map +1 -1
- package/dist/{namespace-specific-value-CPvcFpGI.d.cts → namespace-specific-value-BBZET9O0.d.cts} +7 -10
- package/dist/{namespace-specific-value-CPvcFpGI.d.ts → namespace-specific-value-BBZET9O0.d.ts} +7 -10
- package/package.json +6 -5
package/dist/internal.cjs
CHANGED
|
@@ -99,6 +99,7 @@ __export(internal_exports, {
|
|
|
99
99
|
makeENSIndexerPublicConfigSchema: () => makeENSIndexerPublicConfigSchema,
|
|
100
100
|
makeENSIndexerVersionInfoSchema: () => makeENSIndexerVersionInfoSchema,
|
|
101
101
|
makeENSNamespaceIdSchema: () => makeENSNamespaceIdSchema,
|
|
102
|
+
makeEmailSchema: () => makeEmailSchema,
|
|
102
103
|
makeEnsApiIndexingStatusResponseErrorSchema: () => makeEnsApiIndexingStatusResponseErrorSchema,
|
|
103
104
|
makeEnsApiIndexingStatusResponseOkSchema: () => makeEnsApiIndexingStatusResponseOkSchema,
|
|
104
105
|
makeEnsApiIndexingStatusResponseSchema: () => makeEnsApiIndexingStatusResponseSchema,
|
|
@@ -291,6 +292,7 @@ var makeDefaultableChainIdSchema = (valueLabel = "Defaultable Chain ID") => make
|
|
|
291
292
|
var makeDefaultableChainIdStringSchema = (valueLabel = "Defaultable Chain ID String") => import_v4.z.string({ error: `${valueLabel} must be a string representing a chain ID.` }).pipe(import_v4.z.coerce.number({ error: `${valueLabel} must represent a non-negative integer (>=0).` })).pipe(makeDefaultableChainIdSchema(`The numeric value represented by ${valueLabel}`));
|
|
292
293
|
var makeCoinTypeSchema = (valueLabel = "Coin Type") => import_v4.z.number({ error: `${valueLabel} must be a number.` }).int({ error: `${valueLabel} must be an integer.` }).nonnegative({ error: `${valueLabel} must be a non-negative integer (>=0).` }).transform((val) => val);
|
|
293
294
|
var makeCoinTypeStringSchema = (valueLabel = "Coin Type String") => import_v4.z.string({ error: `${valueLabel} must be a string representing a coin type.` }).pipe(import_v4.z.coerce.number({ error: `${valueLabel} must represent a non-negative integer (>=0).` })).pipe(makeCoinTypeSchema(`The numeric value represented by ${valueLabel}`));
|
|
295
|
+
var makeEmailSchema = (valueLabel = "Email") => import_v4.z.string({ error: `${valueLabel} must be a string.` }).trim().pipe(import_v4.z.email({ error: `${valueLabel} must be a valid email address.` })).transform((value) => value);
|
|
294
296
|
var makeNormalizedAddressSchema = (valueLabel = "EVM address") => import_v4.z.string().check((ctx) => {
|
|
295
297
|
if (!(0, import_viem2.isAddress)(ctx.value, { strict: false })) {
|
|
296
298
|
ctx.issues.push({
|
|
@@ -2149,19 +2151,76 @@ var errorResponseInternalServerErrorExample = {
|
|
|
2149
2151
|
};
|
|
2150
2152
|
|
|
2151
2153
|
// src/omnigraph-api/example-queries.ts
|
|
2152
|
-
var
|
|
2154
|
+
var import_enssdk9 = require("enssdk");
|
|
2153
2155
|
var import_datasources5 = require("@ensnode/datasources");
|
|
2154
|
-
|
|
2156
|
+
|
|
2157
|
+
// ../integration-test-env/src/devnet/fixtures.ts
|
|
2158
|
+
var import_address_encoder = require("@ensdomains/address-encoder");
|
|
2159
|
+
var import_utils = require("@ensdomains/address-encoder/utils");
|
|
2160
|
+
var import_enssdk8 = require("enssdk");
|
|
2161
|
+
var import_accounts = require("viem/accounts");
|
|
2162
|
+
var mnemonic = "test test test test test test test test test test test junk";
|
|
2163
|
+
function createAccount(addressIndex, resolver) {
|
|
2164
|
+
const account = (0, import_accounts.mnemonicToAccount)(mnemonic, { addressIndex });
|
|
2165
|
+
return {
|
|
2166
|
+
...account,
|
|
2167
|
+
address: (0, import_enssdk8.toNormalizedAddress)(account.address),
|
|
2168
|
+
resolver
|
|
2169
|
+
};
|
|
2170
|
+
}
|
|
2171
|
+
var accounts = {
|
|
2172
|
+
deployer: createAccount(0, (0, import_enssdk8.asNormalizedAddress)("0x9c97ec2d79944fa55aa2eb6385bc8711cacf18d2")),
|
|
2173
|
+
owner: createAccount(1, (0, import_enssdk8.asNormalizedAddress)("0x8550d35164e7f86bb6adf4cedb3f012913c9d563")),
|
|
2174
|
+
user: createAccount(2, (0, import_enssdk8.asNormalizedAddress)("0x98a84b915ffe27241033ac8f29c6b7849a0fb6e4")),
|
|
2175
|
+
user2: createAccount(3, (0, import_enssdk8.asNormalizedAddress)("0xd04f8f3726a417cfadeea604fc94cf66112b9af6"))
|
|
2176
|
+
};
|
|
2177
|
+
var addresses = {
|
|
2178
|
+
one: (0, import_enssdk8.asNormalizedAddress)(`0x${"1".repeat(40)}`)
|
|
2179
|
+
};
|
|
2180
|
+
var getRawAddress = (coinName, address) => {
|
|
2181
|
+
const coder = (0, import_address_encoder.getCoderByCoinName)(coinName);
|
|
2182
|
+
return {
|
|
2183
|
+
coinType: coder.coinType,
|
|
2184
|
+
raw: (0, import_utils.bytesToHex)(coder.decode(address)),
|
|
2185
|
+
address
|
|
2186
|
+
};
|
|
2187
|
+
};
|
|
2188
|
+
var testEthTextRecords = {
|
|
2189
|
+
avatar: { key: "avatar", value: "https://example.com/avatar.png" },
|
|
2190
|
+
twitter: { key: "com.twitter", value: "ensdomains" },
|
|
2191
|
+
github: { key: "com.github", value: "@ensdomains" },
|
|
2192
|
+
x: { key: "com.x", value: "this_is_real_ensdomains_not_twitter_but_x_haha" },
|
|
2193
|
+
telegram: { key: "org.telegram", value: "t.me/ensdomains" },
|
|
2194
|
+
url: { key: "url", value: "https://ens.domains" },
|
|
2195
|
+
email: { key: "email", value: "test@ens.domains" },
|
|
2196
|
+
description: { key: "description", value: "test.eth" },
|
|
2197
|
+
header: { key: "header", value: "https://example.com/header.png" }
|
|
2198
|
+
};
|
|
2199
|
+
var rawAddresses = {
|
|
2200
|
+
bitcoin: getRawAddress("btc", "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"),
|
|
2201
|
+
litecoin: getRawAddress("ltc", "LaMT348PWRnrqeeWArpwQPbuanpXDZGEUz"),
|
|
2202
|
+
dogecoin: getRawAddress("doge", "DBXu2kgc3xtvCUWFcxFE3r9hEYgmuaaCyD"),
|
|
2203
|
+
monacoin: getRawAddress("mona", "MHxgS2XMXjeJ4if2PRRbWYcdwZPWfdwaDT"),
|
|
2204
|
+
rootstock: getRawAddress("rbtc", "0x5aaEB6053f3e94c9b9a09f33669435E7ef1bEAeD"),
|
|
2205
|
+
binance: getRawAddress("bnb", "bnb1grpf0955h0ykzq3ar5nmum7y6gdfl6lxfn46h2"),
|
|
2206
|
+
solana: getRawAddress("sol", "FncazAs6omJJjtLVzquzT9KoyXn6tFixr9kGjr42ktLj")
|
|
2207
|
+
};
|
|
2208
|
+
var fixtures = {
|
|
2209
|
+
abiBytes: `0x${"01".repeat(32)}`,
|
|
2210
|
+
fourBytesInterface: "0x11100111",
|
|
2211
|
+
publicKeyX: `0x${"02".repeat(32)}`,
|
|
2212
|
+
publicKeyY: `0x${"03".repeat(32)}`,
|
|
2213
|
+
contenthash: `0x${"04".repeat(32)}`,
|
|
2214
|
+
rawAddresses,
|
|
2215
|
+
textRecords: testEthTextRecords
|
|
2216
|
+
};
|
|
2217
|
+
|
|
2218
|
+
// src/omnigraph-api/example-queries.ts
|
|
2155
2219
|
var SEPOLIA_V2_V2_ETH_REGISTRY = getDatasourceContract(
|
|
2156
2220
|
import_datasources5.ENSNamespaceIds.SepoliaV2,
|
|
2157
2221
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2158
2222
|
"ETHRegistry"
|
|
2159
2223
|
);
|
|
2160
|
-
var SEPOLIA_V2_V2_ETH_REGISTRAR = getDatasourceContract(
|
|
2161
|
-
import_datasources5.ENSNamespaceIds.SepoliaV2,
|
|
2162
|
-
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2163
|
-
"ETHRegistrar"
|
|
2164
|
-
);
|
|
2165
2224
|
var ENS_TEST_ENV_V2_ETH_REGISTRY = getDatasourceContract(
|
|
2166
2225
|
import_datasources5.ENSNamespaceIds.EnsTestEnv,
|
|
2167
2226
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
@@ -2172,24 +2231,24 @@ var ENS_TEST_ENV_V2_ETH_REGISTRAR = getDatasourceContract(
|
|
|
2172
2231
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2173
2232
|
"ETHRegistrar"
|
|
2174
2233
|
);
|
|
2175
|
-
var VITALIK_ADDRESS = (0,
|
|
2176
|
-
var
|
|
2177
|
-
var
|
|
2178
|
-
"
|
|
2234
|
+
var VITALIK_ADDRESS = (0, import_enssdk9.toNormalizedAddress)("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");
|
|
2235
|
+
var SEPOLIA_V2_ACCOUNT = (0, import_enssdk9.toNormalizedAddress)("0x801d2e48d378f161dba7ad7ad002ad557714c191");
|
|
2236
|
+
var SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 = (0, import_enssdk9.toNormalizedAddress)(
|
|
2237
|
+
"0xffffffffff52d316b7bd028358089bc8066b8f80"
|
|
2179
2238
|
);
|
|
2180
|
-
var DEVNET_NAME_WITH_OWNED_RESOLVER = (0,
|
|
2181
|
-
var
|
|
2182
|
-
var
|
|
2239
|
+
var DEVNET_NAME_WITH_OWNED_RESOLVER = (0, import_enssdk9.asInterpretedName)("example.eth");
|
|
2240
|
+
var SEPOLIA_V2_NAME = (0, import_enssdk9.asInterpretedName)("roppp.eth");
|
|
2241
|
+
var VITALIK_NAME = (0, import_enssdk9.asInterpretedName)("vitalik.eth");
|
|
2242
|
+
var GREG_NAME = (0, import_enssdk9.asInterpretedName)("gregskril.eth");
|
|
2183
2243
|
var MAINNET_PUBLIC_RESOLVER = getDatasourceContract(
|
|
2184
2244
|
import_datasources5.ENSNamespaceIds.Mainnet,
|
|
2185
2245
|
import_datasources5.DatasourceNames.ReverseResolverRoot,
|
|
2186
2246
|
"DefaultPublicResolver5"
|
|
2187
2247
|
);
|
|
2188
|
-
var
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
);
|
|
2248
|
+
var SEPOLIA_V2_RESOLVER_WITH_RECORDS = {
|
|
2249
|
+
chainId: 11155111,
|
|
2250
|
+
address: (0, import_enssdk9.toNormalizedAddress)("0x8fade66b79cc9f707ab26799354482eb93a5b7dd")
|
|
2251
|
+
};
|
|
2193
2252
|
function getGraphqlApiExampleQueryById(id) {
|
|
2194
2253
|
const found = graphqlApiExampleQueryById.get(id);
|
|
2195
2254
|
if (!found) {
|
|
@@ -2203,18 +2262,44 @@ var GRAPHQL_API_EXAMPLE_QUERIES = [
|
|
|
2203
2262
|
////////////////
|
|
2204
2263
|
{
|
|
2205
2264
|
id: "hello-world",
|
|
2206
|
-
query:
|
|
2207
|
-
#
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
#
|
|
2211
|
-
#
|
|
2212
|
-
|
|
2213
|
-
#
|
|
2214
|
-
|
|
2215
|
-
|
|
2265
|
+
query: `query HelloWorld($address: Address!) {
|
|
2266
|
+
# Lookup an Account by address.
|
|
2267
|
+
account(by: { address: $address }) {
|
|
2268
|
+
resolve {
|
|
2269
|
+
# Reverse resolve the ENS primary name of the account
|
|
2270
|
+
# using a convenient ETHEREUM alias for mainnet.
|
|
2271
|
+
primaryName(by: { chainName: ETHEREUM }) {
|
|
2272
|
+
# Get the regular interpreted variant of the primary name
|
|
2273
|
+
# and also the special beautified variant that optimizes names
|
|
2274
|
+
# containing special characters such as emojis for proper display in interfaces.
|
|
2275
|
+
name { interpreted beautified }
|
|
2276
|
+
resolve {
|
|
2277
|
+
# If the account has a primary name on Ethereum (mainnet),
|
|
2278
|
+
# forward resolve the interpreted ENS profile of that name in the same query!.
|
|
2279
|
+
profile {
|
|
2280
|
+
description
|
|
2281
|
+
avatar { httpUrl }
|
|
2282
|
+
addresses { ethereum bitcoin }
|
|
2283
|
+
socials {
|
|
2284
|
+
twitter { handle httpUrl }
|
|
2285
|
+
github { handle httpUrl }
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
# Also load the count of ENSv1 and ENSv2 domains owned by the account
|
|
2293
|
+
# to see if they have domains they should upgrade to ENSv2
|
|
2294
|
+
v1DomainsCount: domains(where: { version: ENSv1 }) { totalCount }
|
|
2295
|
+
v2DomainsCount: domains(where: { version: ENSv2 }) { totalCount }
|
|
2296
|
+
}
|
|
2216
2297
|
}`,
|
|
2217
|
-
variables: {
|
|
2298
|
+
variables: {
|
|
2299
|
+
default: { address: VITALIK_ADDRESS },
|
|
2300
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.owner.address },
|
|
2301
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 }
|
|
2302
|
+
}
|
|
2218
2303
|
},
|
|
2219
2304
|
/////////////////
|
|
2220
2305
|
// Find Domains
|
|
@@ -2250,17 +2335,40 @@ query FindDomains(
|
|
|
2250
2335
|
order: { by: "NAME", dir: "DESC" }
|
|
2251
2336
|
},
|
|
2252
2337
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: {
|
|
2253
|
-
name: { starts_with: "
|
|
2338
|
+
name: { starts_with: "sf" },
|
|
2254
2339
|
order: { by: "NAME", dir: "DESC" }
|
|
2255
2340
|
}
|
|
2256
2341
|
}
|
|
2257
2342
|
},
|
|
2258
|
-
///////////////////
|
|
2259
|
-
// Domain By Name
|
|
2260
|
-
///////////////////
|
|
2261
2343
|
{
|
|
2262
2344
|
id: "domain-by-name",
|
|
2263
2345
|
query: `
|
|
2346
|
+
query DomainByName($name: InterpretedName!) {
|
|
2347
|
+
domain(by: { name: $name }) {
|
|
2348
|
+
canonical { name { beautified } }
|
|
2349
|
+
owner { address }
|
|
2350
|
+
resolve {
|
|
2351
|
+
profile {
|
|
2352
|
+
description
|
|
2353
|
+
addresses {
|
|
2354
|
+
ethereum
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
}`,
|
|
2360
|
+
variables: {
|
|
2361
|
+
default: { name: "eth" },
|
|
2362
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME },
|
|
2363
|
+
[import_datasources5.ENSNamespaceIds.Mainnet]: { name: VITALIK_NAME }
|
|
2364
|
+
}
|
|
2365
|
+
},
|
|
2366
|
+
////////////////////////////////
|
|
2367
|
+
// Domain By Name Type Condition
|
|
2368
|
+
////////////////////////////////
|
|
2369
|
+
{
|
|
2370
|
+
id: "domain-by-name-type-condition",
|
|
2371
|
+
query: `
|
|
2264
2372
|
query DomainByName($name: InterpretedName!) {
|
|
2265
2373
|
domain(by: {name: $name}) {
|
|
2266
2374
|
__typename
|
|
@@ -2277,7 +2385,7 @@ query DomainByName($name: InterpretedName!) {
|
|
|
2277
2385
|
}`,
|
|
2278
2386
|
variables: {
|
|
2279
2387
|
default: { name: "eth" },
|
|
2280
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2388
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2281
2389
|
}
|
|
2282
2390
|
},
|
|
2283
2391
|
///////////////////////
|
|
@@ -2321,10 +2429,88 @@ query DomainRegistration($name: InterpretedName!) {
|
|
|
2321
2429
|
}
|
|
2322
2430
|
}`,
|
|
2323
2431
|
variables: {
|
|
2324
|
-
default: { name:
|
|
2325
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2432
|
+
default: { name: VITALIK_NAME },
|
|
2433
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2326
2434
|
}
|
|
2327
2435
|
},
|
|
2436
|
+
////////////////////
|
|
2437
|
+
// Domain Records
|
|
2438
|
+
////////////////////
|
|
2439
|
+
{
|
|
2440
|
+
id: "domain-records",
|
|
2441
|
+
query: `
|
|
2442
|
+
query DomainRecords($name: InterpretedName!) {
|
|
2443
|
+
domain(by: {name: $name}) {
|
|
2444
|
+
canonical {
|
|
2445
|
+
name {
|
|
2446
|
+
interpreted
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
resolve {
|
|
2450
|
+
records {
|
|
2451
|
+
addresses(coinTypes: [60, 2147483658, 501]) {
|
|
2452
|
+
coinType
|
|
2453
|
+
address
|
|
2454
|
+
}
|
|
2455
|
+
texts(keys: ["description", "avatar", "url", "com.github", "com.twitter"]) {
|
|
2456
|
+
key
|
|
2457
|
+
value
|
|
2458
|
+
}
|
|
2459
|
+
contenthash
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
}`,
|
|
2464
|
+
variables: {
|
|
2465
|
+
default: { name: GREG_NAME },
|
|
2466
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: {
|
|
2467
|
+
name: DEVNET_NAME_WITH_OWNED_RESOLVER
|
|
2468
|
+
},
|
|
2469
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: {
|
|
2470
|
+
name: SEPOLIA_V2_NAME
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2474
|
+
{
|
|
2475
|
+
id: "domain-profile",
|
|
2476
|
+
query: `
|
|
2477
|
+
query DomainProfile($name: InterpretedName!) {
|
|
2478
|
+
domain(by: {name: $name}) {
|
|
2479
|
+
resolve {
|
|
2480
|
+
profile {
|
|
2481
|
+
description
|
|
2482
|
+
avatar {
|
|
2483
|
+
httpUrl
|
|
2484
|
+
}
|
|
2485
|
+
addresses {
|
|
2486
|
+
ethereum
|
|
2487
|
+
base
|
|
2488
|
+
solana
|
|
2489
|
+
bitcoin
|
|
2490
|
+
rootstock
|
|
2491
|
+
}
|
|
2492
|
+
socials {
|
|
2493
|
+
github {
|
|
2494
|
+
handle
|
|
2495
|
+
httpUrl
|
|
2496
|
+
}
|
|
2497
|
+
twitter {
|
|
2498
|
+
handle
|
|
2499
|
+
httpUrl
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
website {
|
|
2503
|
+
httpUrl
|
|
2504
|
+
}
|
|
2505
|
+
header {
|
|
2506
|
+
httpUrl
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
}`,
|
|
2512
|
+
variables: { default: { name: GREG_NAME } }
|
|
2513
|
+
},
|
|
2328
2514
|
//////////////////////
|
|
2329
2515
|
// Domain Subdomains
|
|
2330
2516
|
//////////////////////
|
|
@@ -2334,7 +2520,34 @@ query DomainRegistration($name: InterpretedName!) {
|
|
|
2334
2520
|
query DomainSubdomains($name: InterpretedName!) {
|
|
2335
2521
|
domain(by: {name: $name}) {
|
|
2336
2522
|
canonical { name { interpreted beautified } }
|
|
2337
|
-
subdomains(first: 10
|
|
2523
|
+
subdomains(first: 10, order: {
|
|
2524
|
+
by: NAME,
|
|
2525
|
+
dir: ASC
|
|
2526
|
+
}) {
|
|
2527
|
+
edges {
|
|
2528
|
+
node {
|
|
2529
|
+
canonical { name { interpreted beautified } }
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
}`,
|
|
2535
|
+
variables: {
|
|
2536
|
+
default: { name: "eth" },
|
|
2537
|
+
// in mainnet there is too many subdomains of eth
|
|
2538
|
+
[import_datasources5.ENSNamespaceIds.Mainnet]: { name: "base.eth" }
|
|
2539
|
+
}
|
|
2540
|
+
},
|
|
2541
|
+
////////////////////////////////////
|
|
2542
|
+
// Most Recently Registered Subdomains
|
|
2543
|
+
////////////////////////////////////
|
|
2544
|
+
{
|
|
2545
|
+
id: "domain-subdomains-recently-registered",
|
|
2546
|
+
query: `
|
|
2547
|
+
query RecentlyRegisteredSubdomains($name: InterpretedName!) {
|
|
2548
|
+
domain(by: {name: $name}) {
|
|
2549
|
+
canonical { name { interpreted beautified } }
|
|
2550
|
+
subdomains(first: 10, order: {by: REGISTRATION_TIMESTAMP, dir: DESC}) {
|
|
2338
2551
|
edges {
|
|
2339
2552
|
node {
|
|
2340
2553
|
canonical { name { interpreted beautified } }
|
|
@@ -2395,7 +2608,7 @@ query DomainEvents($name: InterpretedName!) {
|
|
|
2395
2608
|
}`,
|
|
2396
2609
|
variables: {
|
|
2397
2610
|
default: { name: "newowner.eth" },
|
|
2398
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2611
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2399
2612
|
}
|
|
2400
2613
|
},
|
|
2401
2614
|
////////////////////
|
|
@@ -2420,8 +2633,40 @@ query AccountDomains(
|
|
|
2420
2633
|
}`,
|
|
2421
2634
|
variables: {
|
|
2422
2635
|
default: { address: VITALIK_ADDRESS },
|
|
2423
|
-
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address:
|
|
2424
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address:
|
|
2636
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.owner.address },
|
|
2637
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2638
|
+
}
|
|
2639
|
+
},
|
|
2640
|
+
/////////////////////////
|
|
2641
|
+
// Account Primary Names
|
|
2642
|
+
/////////////////////////
|
|
2643
|
+
{
|
|
2644
|
+
id: "account-primary-name",
|
|
2645
|
+
query: `
|
|
2646
|
+
query AccountPrimaryName($address: Address!) {
|
|
2647
|
+
account(by: { address: $address }) {
|
|
2648
|
+
address
|
|
2649
|
+
resolve {
|
|
2650
|
+
primaryName(by: { chainName: ETHEREUM }) {
|
|
2651
|
+
name { interpreted beautified }
|
|
2652
|
+
resolve {
|
|
2653
|
+
profile {
|
|
2654
|
+
description
|
|
2655
|
+
socials {
|
|
2656
|
+
twitter {
|
|
2657
|
+
httpUrl
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
}`,
|
|
2666
|
+
variables: {
|
|
2667
|
+
default: { address: VITALIK_ADDRESS },
|
|
2668
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.owner.address },
|
|
2669
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2425
2670
|
}
|
|
2426
2671
|
},
|
|
2427
2672
|
////////////////////
|
|
@@ -2439,8 +2684,8 @@ query AccountEvents(
|
|
|
2439
2684
|
}`,
|
|
2440
2685
|
variables: {
|
|
2441
2686
|
default: { address: VITALIK_ADDRESS },
|
|
2442
|
-
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address:
|
|
2443
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address:
|
|
2687
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.deployer.address },
|
|
2688
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2444
2689
|
}
|
|
2445
2690
|
},
|
|
2446
2691
|
/////////////////////
|
|
@@ -2501,8 +2746,8 @@ query PermissionsByContract(
|
|
|
2501
2746
|
variables: {
|
|
2502
2747
|
// TODO: same as above
|
|
2503
2748
|
default: { contract: ENS_TEST_ENV_V2_ETH_REGISTRAR },
|
|
2504
|
-
//
|
|
2505
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { contract:
|
|
2749
|
+
// the ETHRegistrar holds no EAC permissions on sepolia-v2; the ETHRegistry does
|
|
2750
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { contract: SEPOLIA_V2_V2_ETH_REGISTRY }
|
|
2506
2751
|
}
|
|
2507
2752
|
},
|
|
2508
2753
|
////////////////////////
|
|
@@ -2524,9 +2769,8 @@ query PermissionsByUser($address: Address!) {
|
|
|
2524
2769
|
}
|
|
2525
2770
|
}`,
|
|
2526
2771
|
variables: {
|
|
2527
|
-
default: { address:
|
|
2528
|
-
|
|
2529
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ADDRESS_WITH_LOT_OF_NAMES }
|
|
2772
|
+
default: { address: accounts.deployer.address },
|
|
2773
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2530
2774
|
}
|
|
2531
2775
|
},
|
|
2532
2776
|
//////////////////////////////////
|
|
@@ -2551,8 +2795,8 @@ query AccountResolverPermissions($address: Address!) {
|
|
|
2551
2795
|
}
|
|
2552
2796
|
}`,
|
|
2553
2797
|
variables: {
|
|
2554
|
-
default: { address:
|
|
2555
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address:
|
|
2798
|
+
default: { address: accounts.deployer.address },
|
|
2799
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2556
2800
|
}
|
|
2557
2801
|
},
|
|
2558
2802
|
//////////////////////////////
|
|
@@ -2565,17 +2809,20 @@ query DomainResolver($name: InterpretedName!) {
|
|
|
2565
2809
|
domain(by: { name: $name }) {
|
|
2566
2810
|
resolver {
|
|
2567
2811
|
assigned {
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2812
|
+
contract {
|
|
2813
|
+
address
|
|
2814
|
+
}
|
|
2815
|
+
events(first: 5) {
|
|
2816
|
+
edges { node { topics data timestamp } }
|
|
2817
|
+
}
|
|
2571
2818
|
}
|
|
2572
2819
|
}
|
|
2573
2820
|
}
|
|
2574
2821
|
}`,
|
|
2575
2822
|
variables: {
|
|
2576
|
-
default: { name:
|
|
2823
|
+
default: { name: VITALIK_NAME },
|
|
2577
2824
|
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { name: DEVNET_NAME_WITH_OWNED_RESOLVER },
|
|
2578
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2825
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2579
2826
|
}
|
|
2580
2827
|
},
|
|
2581
2828
|
////////////////////////
|
|
@@ -2607,7 +2854,7 @@ query ResolverByAddress($contract: AccountIdInput!) {
|
|
|
2607
2854
|
}`,
|
|
2608
2855
|
variables: {
|
|
2609
2856
|
default: { contract: MAINNET_PUBLIC_RESOLVER },
|
|
2610
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { contract:
|
|
2857
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { contract: SEPOLIA_V2_RESOLVER_WITH_RECORDS }
|
|
2611
2858
|
}
|
|
2612
2859
|
},
|
|
2613
2860
|
//////////////
|
|
@@ -2617,34 +2864,88 @@ query ResolverByAddress($contract: AccountIdInput!) {
|
|
|
2617
2864
|
id: "namegraph",
|
|
2618
2865
|
query: `
|
|
2619
2866
|
query Namegraph {
|
|
2620
|
-
|
|
2621
|
-
id
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
edges {
|
|
2629
|
-
node {
|
|
2630
|
-
canonical { name { interpreted beautified } }
|
|
2631
|
-
|
|
2632
|
-
subdomains {
|
|
2633
|
-
edges {
|
|
2634
|
-
node {
|
|
2635
|
-
canonical { name { interpreted beautified } }
|
|
2636
|
-
}
|
|
2637
|
-
}
|
|
2638
|
-
}
|
|
2639
|
-
}
|
|
2640
|
-
}
|
|
2867
|
+
domain(by: { name: "eth" }) {
|
|
2868
|
+
registry { id contract { chainId address } }
|
|
2869
|
+
parent { id }
|
|
2870
|
+
subregistry {
|
|
2871
|
+
domains {
|
|
2872
|
+
edges {
|
|
2873
|
+
node {
|
|
2874
|
+
canonical { name { beautified } }
|
|
2641
2875
|
}
|
|
2642
2876
|
}
|
|
2643
2877
|
}
|
|
2644
2878
|
}
|
|
2879
|
+
subdomains { edges { node { canonical { name { beautified } } } } }
|
|
2645
2880
|
}
|
|
2646
2881
|
}`,
|
|
2647
2882
|
variables: { default: {} }
|
|
2883
|
+
},
|
|
2884
|
+
/////////////////////////////
|
|
2885
|
+
// ENSv1 → ENSv2 Migration
|
|
2886
|
+
/////////////////////////////
|
|
2887
|
+
{
|
|
2888
|
+
id: "account-migrated-names",
|
|
2889
|
+
query: `
|
|
2890
|
+
query AccountMigratedNames($address: Address!) {
|
|
2891
|
+
account(by: { address: $address }) {
|
|
2892
|
+
v1DomainsCount: domains(where: { version: ENSv1 }) { totalCount }
|
|
2893
|
+
v2DomainsCount: domains(where: { version: ENSv2 }) { totalCount }
|
|
2894
|
+
}
|
|
2895
|
+
}`,
|
|
2896
|
+
variables: {
|
|
2897
|
+
default: { address: VITALIK_ADDRESS },
|
|
2898
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 }
|
|
2899
|
+
}
|
|
2900
|
+
},
|
|
2901
|
+
{
|
|
2902
|
+
id: "eth-by-version",
|
|
2903
|
+
query: `
|
|
2904
|
+
query GetEthDomains {
|
|
2905
|
+
domains(where: { name: { eq: "eth" } }) {
|
|
2906
|
+
edges {
|
|
2907
|
+
node {
|
|
2908
|
+
__typename
|
|
2909
|
+
id
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
}`,
|
|
2914
|
+
variables: { default: {} }
|
|
2915
|
+
},
|
|
2916
|
+
{
|
|
2917
|
+
id: "accelerate-resolve",
|
|
2918
|
+
query: `
|
|
2919
|
+
query AccelerateResolve($address: Address!) {
|
|
2920
|
+
account(by: { address: $address }) {
|
|
2921
|
+
address
|
|
2922
|
+
resolve(accelerate: true) {
|
|
2923
|
+
trace
|
|
2924
|
+
acceleration {
|
|
2925
|
+
requested
|
|
2926
|
+
attempted
|
|
2927
|
+
}
|
|
2928
|
+
primaryName(by: { chainName: ETHEREUM }) {
|
|
2929
|
+
name { interpreted beautified }
|
|
2930
|
+
resolve {
|
|
2931
|
+
trace
|
|
2932
|
+
acceleration {
|
|
2933
|
+
requested
|
|
2934
|
+
attempted
|
|
2935
|
+
}
|
|
2936
|
+
profile {
|
|
2937
|
+
description
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
}`,
|
|
2944
|
+
variables: {
|
|
2945
|
+
default: { address: VITALIK_ADDRESS },
|
|
2946
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.owner.address },
|
|
2947
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 }
|
|
2948
|
+
}
|
|
2648
2949
|
}
|
|
2649
2950
|
];
|
|
2650
2951
|
var graphqlApiExampleQueryById = new Map(
|
|
@@ -2683,7 +2984,8 @@ async function supportsInterface({
|
|
|
2683
2984
|
abi: EIP_165_ABI,
|
|
2684
2985
|
functionName: "supportsInterface",
|
|
2685
2986
|
address,
|
|
2686
|
-
args: [selector]
|
|
2987
|
+
args: [selector],
|
|
2988
|
+
retryEmptyResponse: false
|
|
2687
2989
|
});
|
|
2688
2990
|
} catch {
|
|
2689
2991
|
return false;
|
|
@@ -3070,7 +3372,7 @@ var import_viem8 = require("viem");
|
|
|
3070
3372
|
var interpretAddress = (owner) => (0, import_viem8.isAddressEqual)(import_viem8.zeroAddress, owner) ? null : owner;
|
|
3071
3373
|
|
|
3072
3374
|
// src/shared/interpretation/interpret-record-values.ts
|
|
3073
|
-
var
|
|
3375
|
+
var import_enssdk10 = require("enssdk");
|
|
3074
3376
|
var import_viem9 = require("viem");
|
|
3075
3377
|
|
|
3076
3378
|
// src/shared/null-bytes.ts
|
|
@@ -3079,16 +3381,15 @@ var hasNullByte = (value) => value.indexOf("\0") !== -1;
|
|
|
3079
3381
|
// src/shared/interpretation/interpret-record-values.ts
|
|
3080
3382
|
function interpretNameRecordValue(value) {
|
|
3081
3383
|
if (value === "") return null;
|
|
3082
|
-
if (!(0,
|
|
3384
|
+
if (!(0, import_enssdk10.isInterpretedName)(value)) return null;
|
|
3083
3385
|
return value;
|
|
3084
3386
|
}
|
|
3085
3387
|
function interpretAddressRecordValue(value) {
|
|
3086
|
-
if (hasNullByte(value)) return null;
|
|
3087
|
-
if (value === "") return null;
|
|
3088
3388
|
if (value === "0x") return null;
|
|
3089
|
-
if (!(0, import_viem9.
|
|
3090
|
-
|
|
3091
|
-
|
|
3389
|
+
if (!(0, import_viem9.isHex)(value, { strict: true })) return null;
|
|
3390
|
+
const normalized = value.toLowerCase();
|
|
3391
|
+
if (normalized === import_viem9.zeroAddress) return null;
|
|
3392
|
+
return normalized;
|
|
3092
3393
|
}
|
|
3093
3394
|
function interpretTextRecordKey(key) {
|
|
3094
3395
|
if (hasNullByte(key)) return null;
|
|
@@ -3131,11 +3432,11 @@ function getLogLevelFromEnv(env, defaultLogLevel) {
|
|
|
3131
3432
|
}
|
|
3132
3433
|
|
|
3133
3434
|
// src/shared/protocol-acceleration/is-bridged-resolver.ts
|
|
3134
|
-
var
|
|
3435
|
+
var import_enssdk13 = require("enssdk");
|
|
3135
3436
|
var import_datasources14 = require("@ensnode/datasources");
|
|
3136
3437
|
|
|
3137
3438
|
// src/shared/managed-names.ts
|
|
3138
|
-
var
|
|
3439
|
+
var import_enssdk11 = require("enssdk");
|
|
3139
3440
|
var import_datasources12 = require("@ensnode/datasources");
|
|
3140
3441
|
|
|
3141
3442
|
// src/shared/to-json.ts
|
|
@@ -3184,7 +3485,7 @@ var getContractsByManagedName = (namespace) => {
|
|
|
3184
3485
|
"NameWrapper"
|
|
3185
3486
|
);
|
|
3186
3487
|
return {
|
|
3187
|
-
[
|
|
3488
|
+
[import_enssdk11.ENS_ROOT_NAME]: {
|
|
3188
3489
|
registry: ensRootRegistry,
|
|
3189
3490
|
contracts: [ensRootRegistry, ensRootRegistryOld]
|
|
3190
3491
|
},
|
|
@@ -3250,7 +3551,7 @@ var getContractsByManagedName = (namespace) => {
|
|
|
3250
3551
|
};
|
|
3251
3552
|
var cache = /* @__PURE__ */ new Map();
|
|
3252
3553
|
var getManagedName = (namespace, contract) => {
|
|
3253
|
-
const cacheKey = `${namespace}:${(0,
|
|
3554
|
+
const cacheKey = `${namespace}:${(0, import_enssdk11.stringifyAccountId)(contract)}`;
|
|
3254
3555
|
const cached = cache.get(cacheKey);
|
|
3255
3556
|
if (cached !== void 0) return cached;
|
|
3256
3557
|
for (const [managedName, group] of Object.entries(getContractsByManagedName(namespace))) {
|
|
@@ -3259,8 +3560,8 @@ var getManagedName = (namespace, contract) => {
|
|
|
3259
3560
|
);
|
|
3260
3561
|
if (isAnyOfTheContracts) {
|
|
3261
3562
|
const namespaceSpecific = MANAGED_NAME_BY_NAMESPACE[namespace]?.[managedName];
|
|
3262
|
-
const name = (0,
|
|
3263
|
-
const node = (0,
|
|
3563
|
+
const name = (0, import_enssdk11.asInterpretedName)(namespaceSpecific ?? managedName);
|
|
3564
|
+
const node = (0, import_enssdk11.namehashInterpretedName)(name);
|
|
3264
3565
|
const result = { name, node, registry: group.registry };
|
|
3265
3566
|
cache.set(cacheKey, result);
|
|
3266
3567
|
return result;
|
|
@@ -3272,7 +3573,7 @@ var getManagedName = (namespace, contract) => {
|
|
|
3272
3573
|
};
|
|
3273
3574
|
|
|
3274
3575
|
// src/shared/root-registry.ts
|
|
3275
|
-
var
|
|
3576
|
+
var import_enssdk12 = require("enssdk");
|
|
3276
3577
|
var import_datasources13 = require("@ensnode/datasources");
|
|
3277
3578
|
var getENSv1RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
3278
3579
|
|
|
@@ -3293,9 +3594,9 @@ var getBridgedResolverConfigs = (namespace) => {
|
|
|
3293
3594
|
const { node } = getManagedName(namespace, registry);
|
|
3294
3595
|
configs.push({
|
|
3295
3596
|
resolver,
|
|
3296
|
-
originDomainId: (0,
|
|
3597
|
+
originDomainId: (0, import_enssdk13.makeENSv1DomainId)(getENSv1RootRegistry(namespace), node),
|
|
3297
3598
|
targetRegistry: registry,
|
|
3298
|
-
targetRegistryId: (0,
|
|
3599
|
+
targetRegistryId: (0, import_enssdk13.makeENSv1VirtualRegistryId)(registry, node)
|
|
3299
3600
|
});
|
|
3300
3601
|
}
|
|
3301
3602
|
const lineanames = (0, import_datasources14.maybeGetDatasource)(namespace, import_datasources14.DatasourceNames.Lineanames);
|
|
@@ -3309,9 +3610,9 @@ var getBridgedResolverConfigs = (namespace) => {
|
|
|
3309
3610
|
const { node } = getManagedName(namespace, registry);
|
|
3310
3611
|
configs.push({
|
|
3311
3612
|
resolver,
|
|
3312
|
-
originDomainId: (0,
|
|
3613
|
+
originDomainId: (0, import_enssdk13.makeENSv1DomainId)(getENSv1RootRegistry(namespace), node),
|
|
3313
3614
|
targetRegistry: registry,
|
|
3314
|
-
targetRegistryId: (0,
|
|
3615
|
+
targetRegistryId: (0, import_enssdk13.makeENSv1VirtualRegistryId)(registry, node)
|
|
3315
3616
|
});
|
|
3316
3617
|
}
|
|
3317
3618
|
cache2.set(namespace, configs);
|