@ensnode/ensnode-sdk 1.15.1 → 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 +364 -90
- 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 +353 -75
- 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,9 +2151,71 @@ 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,
|
|
@@ -2167,25 +2231,24 @@ var ENS_TEST_ENV_V2_ETH_REGISTRAR = getDatasourceContract(
|
|
|
2167
2231
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2168
2232
|
"ETHRegistrar"
|
|
2169
2233
|
);
|
|
2170
|
-
var VITALIK_ADDRESS = (0,
|
|
2171
|
-
var
|
|
2172
|
-
|
|
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"
|
|
2173
2238
|
);
|
|
2174
|
-
var
|
|
2175
|
-
|
|
2176
|
-
);
|
|
2177
|
-
var
|
|
2178
|
-
var SEPOLIA_V2_TEST_NAME = (0, import_enssdk8.asInterpretedName)("test-name.eth");
|
|
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");
|
|
2179
2243
|
var MAINNET_PUBLIC_RESOLVER = getDatasourceContract(
|
|
2180
2244
|
import_datasources5.ENSNamespaceIds.Mainnet,
|
|
2181
2245
|
import_datasources5.DatasourceNames.ReverseResolverRoot,
|
|
2182
2246
|
"DefaultPublicResolver5"
|
|
2183
2247
|
);
|
|
2184
|
-
var
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
);
|
|
2248
|
+
var SEPOLIA_V2_RESOLVER_WITH_RECORDS = {
|
|
2249
|
+
chainId: 11155111,
|
|
2250
|
+
address: (0, import_enssdk9.toNormalizedAddress)("0x8fade66b79cc9f707ab26799354482eb93a5b7dd")
|
|
2251
|
+
};
|
|
2189
2252
|
function getGraphqlApiExampleQueryById(id) {
|
|
2190
2253
|
const found = graphqlApiExampleQueryById.get(id);
|
|
2191
2254
|
if (!found) {
|
|
@@ -2199,18 +2262,44 @@ var GRAPHQL_API_EXAMPLE_QUERIES = [
|
|
|
2199
2262
|
////////////////
|
|
2200
2263
|
{
|
|
2201
2264
|
id: "hello-world",
|
|
2202
|
-
query:
|
|
2203
|
-
#
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
#
|
|
2207
|
-
#
|
|
2208
|
-
|
|
2209
|
-
#
|
|
2210
|
-
|
|
2211
|
-
|
|
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
|
+
}
|
|
2212
2297
|
}`,
|
|
2213
|
-
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
|
+
}
|
|
2214
2303
|
},
|
|
2215
2304
|
/////////////////
|
|
2216
2305
|
// Find Domains
|
|
@@ -2246,17 +2335,40 @@ query FindDomains(
|
|
|
2246
2335
|
order: { by: "NAME", dir: "DESC" }
|
|
2247
2336
|
},
|
|
2248
2337
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: {
|
|
2249
|
-
name: { starts_with: "
|
|
2338
|
+
name: { starts_with: "sf" },
|
|
2250
2339
|
order: { by: "NAME", dir: "DESC" }
|
|
2251
2340
|
}
|
|
2252
2341
|
}
|
|
2253
2342
|
},
|
|
2254
|
-
///////////////////
|
|
2255
|
-
// Domain By Name
|
|
2256
|
-
///////////////////
|
|
2257
2343
|
{
|
|
2258
2344
|
id: "domain-by-name",
|
|
2259
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: `
|
|
2260
2372
|
query DomainByName($name: InterpretedName!) {
|
|
2261
2373
|
domain(by: {name: $name}) {
|
|
2262
2374
|
__typename
|
|
@@ -2273,7 +2385,7 @@ query DomainByName($name: InterpretedName!) {
|
|
|
2273
2385
|
}`,
|
|
2274
2386
|
variables: {
|
|
2275
2387
|
default: { name: "eth" },
|
|
2276
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2388
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2277
2389
|
}
|
|
2278
2390
|
},
|
|
2279
2391
|
///////////////////////
|
|
@@ -2317,10 +2429,88 @@ query DomainRegistration($name: InterpretedName!) {
|
|
|
2317
2429
|
}
|
|
2318
2430
|
}`,
|
|
2319
2431
|
variables: {
|
|
2320
|
-
default: { name:
|
|
2321
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2432
|
+
default: { name: VITALIK_NAME },
|
|
2433
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2322
2434
|
}
|
|
2323
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
|
+
},
|
|
2324
2514
|
//////////////////////
|
|
2325
2515
|
// Domain Subdomains
|
|
2326
2516
|
//////////////////////
|
|
@@ -2330,7 +2520,34 @@ query DomainRegistration($name: InterpretedName!) {
|
|
|
2330
2520
|
query DomainSubdomains($name: InterpretedName!) {
|
|
2331
2521
|
domain(by: {name: $name}) {
|
|
2332
2522
|
canonical { name { interpreted beautified } }
|
|
2333
|
-
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}) {
|
|
2334
2551
|
edges {
|
|
2335
2552
|
node {
|
|
2336
2553
|
canonical { name { interpreted beautified } }
|
|
@@ -2391,7 +2608,7 @@ query DomainEvents($name: InterpretedName!) {
|
|
|
2391
2608
|
}`,
|
|
2392
2609
|
variables: {
|
|
2393
2610
|
default: { name: "newowner.eth" },
|
|
2394
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2611
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2395
2612
|
}
|
|
2396
2613
|
},
|
|
2397
2614
|
////////////////////
|
|
@@ -2416,8 +2633,40 @@ query AccountDomains(
|
|
|
2416
2633
|
}`,
|
|
2417
2634
|
variables: {
|
|
2418
2635
|
default: { address: VITALIK_ADDRESS },
|
|
2419
|
-
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address:
|
|
2420
|
-
[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 }
|
|
2421
2670
|
}
|
|
2422
2671
|
},
|
|
2423
2672
|
////////////////////
|
|
@@ -2435,8 +2684,8 @@ query AccountEvents(
|
|
|
2435
2684
|
}`,
|
|
2436
2685
|
variables: {
|
|
2437
2686
|
default: { address: VITALIK_ADDRESS },
|
|
2438
|
-
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address:
|
|
2439
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address:
|
|
2687
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.deployer.address },
|
|
2688
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2440
2689
|
}
|
|
2441
2690
|
},
|
|
2442
2691
|
/////////////////////
|
|
@@ -2520,8 +2769,8 @@ query PermissionsByUser($address: Address!) {
|
|
|
2520
2769
|
}
|
|
2521
2770
|
}`,
|
|
2522
2771
|
variables: {
|
|
2523
|
-
default: { address:
|
|
2524
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address:
|
|
2772
|
+
default: { address: accounts.deployer.address },
|
|
2773
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2525
2774
|
}
|
|
2526
2775
|
},
|
|
2527
2776
|
//////////////////////////////////
|
|
@@ -2546,8 +2795,8 @@ query AccountResolverPermissions($address: Address!) {
|
|
|
2546
2795
|
}
|
|
2547
2796
|
}`,
|
|
2548
2797
|
variables: {
|
|
2549
|
-
default: { address:
|
|
2550
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address:
|
|
2798
|
+
default: { address: accounts.deployer.address },
|
|
2799
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2551
2800
|
}
|
|
2552
2801
|
},
|
|
2553
2802
|
//////////////////////////////
|
|
@@ -2560,17 +2809,20 @@ query DomainResolver($name: InterpretedName!) {
|
|
|
2560
2809
|
domain(by: { name: $name }) {
|
|
2561
2810
|
resolver {
|
|
2562
2811
|
assigned {
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2812
|
+
contract {
|
|
2813
|
+
address
|
|
2814
|
+
}
|
|
2815
|
+
events(first: 5) {
|
|
2816
|
+
edges { node { topics data timestamp } }
|
|
2817
|
+
}
|
|
2566
2818
|
}
|
|
2567
2819
|
}
|
|
2568
2820
|
}
|
|
2569
2821
|
}`,
|
|
2570
2822
|
variables: {
|
|
2571
|
-
default: { name:
|
|
2823
|
+
default: { name: VITALIK_NAME },
|
|
2572
2824
|
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { name: DEVNET_NAME_WITH_OWNED_RESOLVER },
|
|
2573
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name:
|
|
2825
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2574
2826
|
}
|
|
2575
2827
|
},
|
|
2576
2828
|
////////////////////////
|
|
@@ -2602,7 +2854,7 @@ query ResolverByAddress($contract: AccountIdInput!) {
|
|
|
2602
2854
|
}`,
|
|
2603
2855
|
variables: {
|
|
2604
2856
|
default: { contract: MAINNET_PUBLIC_RESOLVER },
|
|
2605
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { contract:
|
|
2857
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { contract: SEPOLIA_V2_RESOLVER_WITH_RECORDS }
|
|
2606
2858
|
}
|
|
2607
2859
|
},
|
|
2608
2860
|
//////////////
|
|
@@ -2612,31 +2864,19 @@ query ResolverByAddress($contract: AccountIdInput!) {
|
|
|
2612
2864
|
id: "namegraph",
|
|
2613
2865
|
query: `
|
|
2614
2866
|
query Namegraph {
|
|
2615
|
-
|
|
2616
|
-
id
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
edges {
|
|
2624
|
-
node {
|
|
2625
|
-
canonical { name { interpreted beautified } }
|
|
2626
|
-
|
|
2627
|
-
subdomains {
|
|
2628
|
-
edges {
|
|
2629
|
-
node {
|
|
2630
|
-
canonical { name { interpreted beautified } }
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
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 } }
|
|
2636
2875
|
}
|
|
2637
2876
|
}
|
|
2638
2877
|
}
|
|
2639
2878
|
}
|
|
2879
|
+
subdomains { edges { node { canonical { name { beautified } } } } }
|
|
2640
2880
|
}
|
|
2641
2881
|
}`,
|
|
2642
2882
|
variables: { default: {} }
|
|
@@ -2655,7 +2895,7 @@ query AccountMigratedNames($address: Address!) {
|
|
|
2655
2895
|
}`,
|
|
2656
2896
|
variables: {
|
|
2657
2897
|
default: { address: VITALIK_ADDRESS },
|
|
2658
|
-
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address:
|
|
2898
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 }
|
|
2659
2899
|
}
|
|
2660
2900
|
},
|
|
2661
2901
|
{
|
|
@@ -2672,6 +2912,40 @@ query GetEthDomains {
|
|
|
2672
2912
|
}
|
|
2673
2913
|
}`,
|
|
2674
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
|
+
}
|
|
2675
2949
|
}
|
|
2676
2950
|
];
|
|
2677
2951
|
var graphqlApiExampleQueryById = new Map(
|
|
@@ -2710,7 +2984,8 @@ async function supportsInterface({
|
|
|
2710
2984
|
abi: EIP_165_ABI,
|
|
2711
2985
|
functionName: "supportsInterface",
|
|
2712
2986
|
address,
|
|
2713
|
-
args: [selector]
|
|
2987
|
+
args: [selector],
|
|
2988
|
+
retryEmptyResponse: false
|
|
2714
2989
|
});
|
|
2715
2990
|
} catch {
|
|
2716
2991
|
return false;
|
|
@@ -3097,7 +3372,7 @@ var import_viem8 = require("viem");
|
|
|
3097
3372
|
var interpretAddress = (owner) => (0, import_viem8.isAddressEqual)(import_viem8.zeroAddress, owner) ? null : owner;
|
|
3098
3373
|
|
|
3099
3374
|
// src/shared/interpretation/interpret-record-values.ts
|
|
3100
|
-
var
|
|
3375
|
+
var import_enssdk10 = require("enssdk");
|
|
3101
3376
|
var import_viem9 = require("viem");
|
|
3102
3377
|
|
|
3103
3378
|
// src/shared/null-bytes.ts
|
|
@@ -3106,16 +3381,15 @@ var hasNullByte = (value) => value.indexOf("\0") !== -1;
|
|
|
3106
3381
|
// src/shared/interpretation/interpret-record-values.ts
|
|
3107
3382
|
function interpretNameRecordValue(value) {
|
|
3108
3383
|
if (value === "") return null;
|
|
3109
|
-
if (!(0,
|
|
3384
|
+
if (!(0, import_enssdk10.isInterpretedName)(value)) return null;
|
|
3110
3385
|
return value;
|
|
3111
3386
|
}
|
|
3112
3387
|
function interpretAddressRecordValue(value) {
|
|
3113
|
-
if (hasNullByte(value)) return null;
|
|
3114
|
-
if (value === "") return null;
|
|
3115
3388
|
if (value === "0x") return null;
|
|
3116
|
-
if (!(0, import_viem9.
|
|
3117
|
-
|
|
3118
|
-
|
|
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;
|
|
3119
3393
|
}
|
|
3120
3394
|
function interpretTextRecordKey(key) {
|
|
3121
3395
|
if (hasNullByte(key)) return null;
|
|
@@ -3158,11 +3432,11 @@ function getLogLevelFromEnv(env, defaultLogLevel) {
|
|
|
3158
3432
|
}
|
|
3159
3433
|
|
|
3160
3434
|
// src/shared/protocol-acceleration/is-bridged-resolver.ts
|
|
3161
|
-
var
|
|
3435
|
+
var import_enssdk13 = require("enssdk");
|
|
3162
3436
|
var import_datasources14 = require("@ensnode/datasources");
|
|
3163
3437
|
|
|
3164
3438
|
// src/shared/managed-names.ts
|
|
3165
|
-
var
|
|
3439
|
+
var import_enssdk11 = require("enssdk");
|
|
3166
3440
|
var import_datasources12 = require("@ensnode/datasources");
|
|
3167
3441
|
|
|
3168
3442
|
// src/shared/to-json.ts
|
|
@@ -3211,7 +3485,7 @@ var getContractsByManagedName = (namespace) => {
|
|
|
3211
3485
|
"NameWrapper"
|
|
3212
3486
|
);
|
|
3213
3487
|
return {
|
|
3214
|
-
[
|
|
3488
|
+
[import_enssdk11.ENS_ROOT_NAME]: {
|
|
3215
3489
|
registry: ensRootRegistry,
|
|
3216
3490
|
contracts: [ensRootRegistry, ensRootRegistryOld]
|
|
3217
3491
|
},
|
|
@@ -3277,7 +3551,7 @@ var getContractsByManagedName = (namespace) => {
|
|
|
3277
3551
|
};
|
|
3278
3552
|
var cache = /* @__PURE__ */ new Map();
|
|
3279
3553
|
var getManagedName = (namespace, contract) => {
|
|
3280
|
-
const cacheKey = `${namespace}:${(0,
|
|
3554
|
+
const cacheKey = `${namespace}:${(0, import_enssdk11.stringifyAccountId)(contract)}`;
|
|
3281
3555
|
const cached = cache.get(cacheKey);
|
|
3282
3556
|
if (cached !== void 0) return cached;
|
|
3283
3557
|
for (const [managedName, group] of Object.entries(getContractsByManagedName(namespace))) {
|
|
@@ -3286,8 +3560,8 @@ var getManagedName = (namespace, contract) => {
|
|
|
3286
3560
|
);
|
|
3287
3561
|
if (isAnyOfTheContracts) {
|
|
3288
3562
|
const namespaceSpecific = MANAGED_NAME_BY_NAMESPACE[namespace]?.[managedName];
|
|
3289
|
-
const name = (0,
|
|
3290
|
-
const node = (0,
|
|
3563
|
+
const name = (0, import_enssdk11.asInterpretedName)(namespaceSpecific ?? managedName);
|
|
3564
|
+
const node = (0, import_enssdk11.namehashInterpretedName)(name);
|
|
3291
3565
|
const result = { name, node, registry: group.registry };
|
|
3292
3566
|
cache.set(cacheKey, result);
|
|
3293
3567
|
return result;
|
|
@@ -3299,7 +3573,7 @@ var getManagedName = (namespace, contract) => {
|
|
|
3299
3573
|
};
|
|
3300
3574
|
|
|
3301
3575
|
// src/shared/root-registry.ts
|
|
3302
|
-
var
|
|
3576
|
+
var import_enssdk12 = require("enssdk");
|
|
3303
3577
|
var import_datasources13 = require("@ensnode/datasources");
|
|
3304
3578
|
var getENSv1RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
3305
3579
|
|
|
@@ -3320,9 +3594,9 @@ var getBridgedResolverConfigs = (namespace) => {
|
|
|
3320
3594
|
const { node } = getManagedName(namespace, registry);
|
|
3321
3595
|
configs.push({
|
|
3322
3596
|
resolver,
|
|
3323
|
-
originDomainId: (0,
|
|
3597
|
+
originDomainId: (0, import_enssdk13.makeENSv1DomainId)(getENSv1RootRegistry(namespace), node),
|
|
3324
3598
|
targetRegistry: registry,
|
|
3325
|
-
targetRegistryId: (0,
|
|
3599
|
+
targetRegistryId: (0, import_enssdk13.makeENSv1VirtualRegistryId)(registry, node)
|
|
3326
3600
|
});
|
|
3327
3601
|
}
|
|
3328
3602
|
const lineanames = (0, import_datasources14.maybeGetDatasource)(namespace, import_datasources14.DatasourceNames.Lineanames);
|
|
@@ -3336,9 +3610,9 @@ var getBridgedResolverConfigs = (namespace) => {
|
|
|
3336
3610
|
const { node } = getManagedName(namespace, registry);
|
|
3337
3611
|
configs.push({
|
|
3338
3612
|
resolver,
|
|
3339
|
-
originDomainId: (0,
|
|
3613
|
+
originDomainId: (0, import_enssdk13.makeENSv1DomainId)(getENSv1RootRegistry(namespace), node),
|
|
3340
3614
|
targetRegistry: registry,
|
|
3341
|
-
targetRegistryId: (0,
|
|
3615
|
+
targetRegistryId: (0, import_enssdk13.makeENSv1VirtualRegistryId)(registry, node)
|
|
3342
3616
|
});
|
|
3343
3617
|
}
|
|
3344
3618
|
cache2.set(namespace, configs);
|