@ensnode/ensnode-sdk 1.14.0 → 1.15.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 +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +133 -13
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +21 -1
- package/dist/internal.d.ts +21 -1
- package/dist/internal.js +133 -13
- package/dist/internal.js.map +1 -1
- package/package.json +4 -4
package/dist/internal.cjs
CHANGED
|
@@ -70,7 +70,9 @@ __export(internal_exports, {
|
|
|
70
70
|
invariant_rpcConfigsSpecifiedForRootChain: () => invariant_rpcConfigsSpecifiedForRootChain,
|
|
71
71
|
invariant_rpcEndpointConfigIncludesAtLeastOneHTTPProtocolURL: () => invariant_rpcEndpointConfigIncludesAtLeastOneHTTPProtocolURL,
|
|
72
72
|
invariant_rpcEndpointConfigIncludesAtMostOneWebSocketsProtocolURL: () => invariant_rpcEndpointConfigIncludesAtMostOneWebSocketsProtocolURL,
|
|
73
|
+
isBridgedOriginDomain: () => isBridgedOriginDomain,
|
|
73
74
|
isBridgedResolver: () => isBridgedResolver,
|
|
75
|
+
isBridgedTargetRegistry: () => isBridgedTargetRegistry,
|
|
74
76
|
isConfigTemplateSubgraphCompatible: () => isConfigTemplateSubgraphCompatible,
|
|
75
77
|
isExtendedResolver: () => isExtendedResolver,
|
|
76
78
|
isKnownENSIP19ReverseResolver: () => isKnownENSIP19ReverseResolver,
|
|
@@ -2150,22 +2152,22 @@ var errorResponseInternalServerErrorExample = {
|
|
|
2150
2152
|
var import_enssdk8 = require("enssdk");
|
|
2151
2153
|
var import_datasources5 = require("@ensnode/datasources");
|
|
2152
2154
|
var import_devnet = require("@ensnode/datasources/devnet");
|
|
2153
|
-
var SEPOLIA_V2_V2_ETH_REGISTRY =
|
|
2155
|
+
var SEPOLIA_V2_V2_ETH_REGISTRY = getDatasourceContract(
|
|
2154
2156
|
import_datasources5.ENSNamespaceIds.SepoliaV2,
|
|
2155
2157
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2156
2158
|
"ETHRegistry"
|
|
2157
2159
|
);
|
|
2158
|
-
var SEPOLIA_V2_V2_ETH_REGISTRAR =
|
|
2160
|
+
var SEPOLIA_V2_V2_ETH_REGISTRAR = getDatasourceContract(
|
|
2159
2161
|
import_datasources5.ENSNamespaceIds.SepoliaV2,
|
|
2160
2162
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2161
2163
|
"ETHRegistrar"
|
|
2162
2164
|
);
|
|
2163
|
-
var ENS_TEST_ENV_V2_ETH_REGISTRY =
|
|
2165
|
+
var ENS_TEST_ENV_V2_ETH_REGISTRY = getDatasourceContract(
|
|
2164
2166
|
import_datasources5.ENSNamespaceIds.EnsTestEnv,
|
|
2165
2167
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2166
2168
|
"ETHRegistry"
|
|
2167
2169
|
);
|
|
2168
|
-
var ENS_TEST_ENV_V2_ETH_REGISTRAR =
|
|
2170
|
+
var ENS_TEST_ENV_V2_ETH_REGISTRAR = getDatasourceContract(
|
|
2169
2171
|
import_datasources5.ENSNamespaceIds.EnsTestEnv,
|
|
2170
2172
|
import_datasources5.DatasourceNames.ENSv2Root,
|
|
2171
2173
|
"ETHRegistrar"
|
|
@@ -2178,6 +2180,16 @@ var SEPOLIA_V2_ADDRESS_WITH_LOT_OF_NAMES = (0, import_enssdk8.toNormalizedAddres
|
|
|
2178
2180
|
var DEVNET_NAME_WITH_OWNED_RESOLVER = (0, import_enssdk8.asInterpretedName)("example.eth");
|
|
2179
2181
|
var SEPOLIA_V2_NAME_WITH_OWNED_RESOLVER = (0, import_enssdk8.asInterpretedName)("sfmonicdebmig.eth");
|
|
2180
2182
|
var SEPOLIA_V2_TEST_NAME = (0, import_enssdk8.asInterpretedName)("test-name.eth");
|
|
2183
|
+
var MAINNET_PUBLIC_RESOLVER = getDatasourceContract(
|
|
2184
|
+
import_datasources5.ENSNamespaceIds.Mainnet,
|
|
2185
|
+
import_datasources5.DatasourceNames.ReverseResolverRoot,
|
|
2186
|
+
"DefaultPublicResolver5"
|
|
2187
|
+
);
|
|
2188
|
+
var SEPOLIA_V2_PUBLIC_RESOLVER = getDatasourceContract(
|
|
2189
|
+
import_datasources5.ENSNamespaceIds.SepoliaV2,
|
|
2190
|
+
import_datasources5.DatasourceNames.ReverseResolverRoot,
|
|
2191
|
+
"DefaultPublicResolver5"
|
|
2192
|
+
);
|
|
2181
2193
|
function getGraphqlApiExampleQueryById(id) {
|
|
2182
2194
|
const found = graphqlApiExampleQueryById.get(id);
|
|
2183
2195
|
if (!found) {
|
|
@@ -2200,7 +2212,7 @@ var GRAPHQL_API_EXAMPLE_QUERIES = [
|
|
|
2200
2212
|
#
|
|
2201
2213
|
# There are also example queries in the tabs above \u261D\uFE0F
|
|
2202
2214
|
query HelloWorld {
|
|
2203
|
-
domain(by: { name: "eth" }) { canonical { name { interpreted } } owner { address } }
|
|
2215
|
+
domain(by: { name: "eth" }) { canonical { name { interpreted beautified } } owner { address } }
|
|
2204
2216
|
}`,
|
|
2205
2217
|
variables: { default: {} }
|
|
2206
2218
|
},
|
|
@@ -2224,7 +2236,7 @@ query FindDomains(
|
|
|
2224
2236
|
__typename
|
|
2225
2237
|
id
|
|
2226
2238
|
label { interpreted hash }
|
|
2227
|
-
canonical { name { interpreted } }
|
|
2239
|
+
canonical { name { interpreted beautified } }
|
|
2228
2240
|
|
|
2229
2241
|
registration { expiry event { timestamp } }
|
|
2230
2242
|
}
|
|
@@ -2268,6 +2280,51 @@ query DomainByName($name: InterpretedName!) {
|
|
|
2268
2280
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_TEST_NAME }
|
|
2269
2281
|
}
|
|
2270
2282
|
},
|
|
2283
|
+
///////////////////////
|
|
2284
|
+
// Domain Registration
|
|
2285
|
+
///////////////////////
|
|
2286
|
+
{
|
|
2287
|
+
id: "domain-registration",
|
|
2288
|
+
query: `
|
|
2289
|
+
query DomainRegistration($name: InterpretedName!) {
|
|
2290
|
+
domain(by: { name: $name }) {
|
|
2291
|
+
canonical { name { interpreted } }
|
|
2292
|
+
|
|
2293
|
+
registration {
|
|
2294
|
+
__typename
|
|
2295
|
+
id
|
|
2296
|
+
start
|
|
2297
|
+
expiry
|
|
2298
|
+
expired
|
|
2299
|
+
referrer
|
|
2300
|
+
registrar { chainId address }
|
|
2301
|
+
registrant { address }
|
|
2302
|
+
renewals(first: 5) {
|
|
2303
|
+
totalCount
|
|
2304
|
+
edges { node { duration base premium referrer } }
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
# ENSv1 .eth registrations (also Basenames & Lineanames)
|
|
2308
|
+
... on BaseRegistrarRegistration {
|
|
2309
|
+
baseCost
|
|
2310
|
+
premium
|
|
2311
|
+
isInGracePeriod
|
|
2312
|
+
# present when the .eth name is wrapped by the NameWrapper
|
|
2313
|
+
wrapped { fuses tokenId }
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
# names held natively in the NameWrapper
|
|
2317
|
+
... on NameWrapperRegistration {
|
|
2318
|
+
fuses
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
}`,
|
|
2323
|
+
variables: {
|
|
2324
|
+
default: { name: "vitalik.eth" },
|
|
2325
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME_WITH_OWNED_RESOLVER }
|
|
2326
|
+
}
|
|
2327
|
+
},
|
|
2271
2328
|
//////////////////////
|
|
2272
2329
|
// Domain Subdomains
|
|
2273
2330
|
//////////////////////
|
|
@@ -2276,11 +2333,11 @@ query DomainByName($name: InterpretedName!) {
|
|
|
2276
2333
|
query: `
|
|
2277
2334
|
query DomainSubdomains($name: InterpretedName!) {
|
|
2278
2335
|
domain(by: {name: $name}) {
|
|
2279
|
-
canonical { name { interpreted } }
|
|
2336
|
+
canonical { name { interpreted beautified } }
|
|
2280
2337
|
subdomains(first: 10) {
|
|
2281
2338
|
edges {
|
|
2282
2339
|
node {
|
|
2283
|
-
canonical { name { interpreted } }
|
|
2340
|
+
canonical { name { interpreted beautified } }
|
|
2284
2341
|
}
|
|
2285
2342
|
}
|
|
2286
2343
|
}
|
|
@@ -2288,6 +2345,31 @@ query DomainSubdomains($name: InterpretedName!) {
|
|
|
2288
2345
|
}`,
|
|
2289
2346
|
variables: { default: { name: "eth" } }
|
|
2290
2347
|
},
|
|
2348
|
+
////////////////////////
|
|
2349
|
+
// Subdomains Pagination
|
|
2350
|
+
////////////////////////
|
|
2351
|
+
{
|
|
2352
|
+
id: "subdomains-pagination",
|
|
2353
|
+
query: `
|
|
2354
|
+
query SubdomainsPagination($first: Int!, $after: String) {
|
|
2355
|
+
domain(by: { name: "eth" }) {
|
|
2356
|
+
canonical { name { interpreted } }
|
|
2357
|
+
|
|
2358
|
+
# paginate child names: pass pageInfo.endCursor back as $after for the next page
|
|
2359
|
+
subdomains(first: $first, after: $after) {
|
|
2360
|
+
totalCount
|
|
2361
|
+
pageInfo { hasNextPage endCursor }
|
|
2362
|
+
edges {
|
|
2363
|
+
cursor
|
|
2364
|
+
node {
|
|
2365
|
+
canonical { name { interpreted } }
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
}`,
|
|
2371
|
+
variables: { default: { first: 10, after: null } }
|
|
2372
|
+
},
|
|
2291
2373
|
/////////////////
|
|
2292
2374
|
// Domain Events
|
|
2293
2375
|
/////////////////
|
|
@@ -2330,7 +2412,7 @@ query AccountDomains(
|
|
|
2330
2412
|
edges {
|
|
2331
2413
|
node {
|
|
2332
2414
|
label { interpreted }
|
|
2333
|
-
canonical { name { interpreted } }
|
|
2415
|
+
canonical { name { interpreted beautified } }
|
|
2334
2416
|
}
|
|
2335
2417
|
}
|
|
2336
2418
|
}
|
|
@@ -2375,7 +2457,7 @@ query RegistryDomains(
|
|
|
2375
2457
|
edges {
|
|
2376
2458
|
node {
|
|
2377
2459
|
label { interpreted }
|
|
2378
|
-
canonical { name { interpreted } }
|
|
2460
|
+
canonical { name { interpreted beautified } }
|
|
2379
2461
|
}
|
|
2380
2462
|
}
|
|
2381
2463
|
}
|
|
@@ -2496,6 +2578,38 @@ query DomainResolver($name: InterpretedName!) {
|
|
|
2496
2578
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME_WITH_OWNED_RESOLVER }
|
|
2497
2579
|
}
|
|
2498
2580
|
},
|
|
2581
|
+
////////////////////////
|
|
2582
|
+
// Resolver By Address
|
|
2583
|
+
////////////////////////
|
|
2584
|
+
{
|
|
2585
|
+
id: "resolver-by-address",
|
|
2586
|
+
query: `
|
|
2587
|
+
query ResolverByAddress($contract: AccountIdInput!) {
|
|
2588
|
+
resolver(by: { contract: $contract }) {
|
|
2589
|
+
id
|
|
2590
|
+
contract { chainId address }
|
|
2591
|
+
|
|
2592
|
+
# records this resolver stores, keyed by node
|
|
2593
|
+
records(first: 5) {
|
|
2594
|
+
totalCount
|
|
2595
|
+
edges {
|
|
2596
|
+
node {
|
|
2597
|
+
node
|
|
2598
|
+
name
|
|
2599
|
+
keys
|
|
2600
|
+
coinTypes
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
events { totalCount edges { node { topics data timestamp } } }
|
|
2606
|
+
}
|
|
2607
|
+
}`,
|
|
2608
|
+
variables: {
|
|
2609
|
+
default: { contract: MAINNET_PUBLIC_RESOLVER },
|
|
2610
|
+
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { contract: SEPOLIA_V2_PUBLIC_RESOLVER }
|
|
2611
|
+
}
|
|
2612
|
+
},
|
|
2499
2613
|
//////////////
|
|
2500
2614
|
// Namegraph
|
|
2501
2615
|
//////////////
|
|
@@ -2508,17 +2622,17 @@ query Namegraph {
|
|
|
2508
2622
|
domains {
|
|
2509
2623
|
edges {
|
|
2510
2624
|
node {
|
|
2511
|
-
canonical { name { interpreted } }
|
|
2625
|
+
canonical { name { interpreted beautified } }
|
|
2512
2626
|
|
|
2513
2627
|
subdomains {
|
|
2514
2628
|
edges {
|
|
2515
2629
|
node {
|
|
2516
|
-
canonical { name { interpreted } }
|
|
2630
|
+
canonical { name { interpreted beautified } }
|
|
2517
2631
|
|
|
2518
2632
|
subdomains {
|
|
2519
2633
|
edges {
|
|
2520
2634
|
node {
|
|
2521
|
-
canonical { name { interpreted } }
|
|
2635
|
+
canonical { name { interpreted beautified } }
|
|
2522
2636
|
}
|
|
2523
2637
|
}
|
|
2524
2638
|
}
|
|
@@ -3208,6 +3322,12 @@ function isBridgedResolver(namespace, resolver) {
|
|
|
3208
3322
|
(config) => accountIdEqual(config.resolver, resolver)
|
|
3209
3323
|
) ?? null;
|
|
3210
3324
|
}
|
|
3325
|
+
function isBridgedOriginDomain(namespace, domainId) {
|
|
3326
|
+
return getBridgedResolverConfigs(namespace).find((config) => config.originDomainId === domainId) ?? null;
|
|
3327
|
+
}
|
|
3328
|
+
function isBridgedTargetRegistry(namespace, registryId) {
|
|
3329
|
+
return getBridgedResolverConfigs(namespace).find((config) => config.targetRegistryId === registryId) ?? null;
|
|
3330
|
+
}
|
|
3211
3331
|
|
|
3212
3332
|
// src/shared/protocol-acceleration/is-ensip-19-reverse-resolver.ts
|
|
3213
3333
|
var import_datasources15 = require("@ensnode/datasources");
|