@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.js
CHANGED
|
@@ -102,6 +102,7 @@ var makeDefaultableChainIdSchema = (valueLabel = "Defaultable Chain ID") => make
|
|
|
102
102
|
var makeDefaultableChainIdStringSchema = (valueLabel = "Defaultable Chain ID String") => z.string({ error: `${valueLabel} must be a string representing a chain ID.` }).pipe(z.coerce.number({ error: `${valueLabel} must represent a non-negative integer (>=0).` })).pipe(makeDefaultableChainIdSchema(`The numeric value represented by ${valueLabel}`));
|
|
103
103
|
var makeCoinTypeSchema = (valueLabel = "Coin Type") => 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);
|
|
104
104
|
var makeCoinTypeStringSchema = (valueLabel = "Coin Type String") => z.string({ error: `${valueLabel} must be a string representing a coin type.` }).pipe(z.coerce.number({ error: `${valueLabel} must represent a non-negative integer (>=0).` })).pipe(makeCoinTypeSchema(`The numeric value represented by ${valueLabel}`));
|
|
105
|
+
var makeEmailSchema = (valueLabel = "Email") => z.string({ error: `${valueLabel} must be a string.` }).trim().pipe(z.email({ error: `${valueLabel} must be a valid email address.` })).transform((value) => value);
|
|
105
106
|
var makeNormalizedAddressSchema = (valueLabel = "EVM address") => z.string().check((ctx) => {
|
|
106
107
|
if (!isAddress(ctx.value, { strict: false })) {
|
|
107
108
|
ctx.issues.push({
|
|
@@ -1964,9 +1965,71 @@ var errorResponseInternalServerErrorExample = {
|
|
|
1964
1965
|
};
|
|
1965
1966
|
|
|
1966
1967
|
// src/omnigraph-api/example-queries.ts
|
|
1967
|
-
import { asInterpretedName, toNormalizedAddress as
|
|
1968
|
+
import { asInterpretedName, toNormalizedAddress as toNormalizedAddress4 } from "enssdk";
|
|
1968
1969
|
import { DatasourceNames as DatasourceNames2, ENSNamespaceIds as ENSNamespaceIds3 } from "@ensnode/datasources";
|
|
1969
|
-
|
|
1970
|
+
|
|
1971
|
+
// ../integration-test-env/src/devnet/fixtures.ts
|
|
1972
|
+
import { getCoderByCoinName } from "@ensdomains/address-encoder";
|
|
1973
|
+
import { bytesToHex } from "@ensdomains/address-encoder/utils";
|
|
1974
|
+
import { asNormalizedAddress, toNormalizedAddress as toNormalizedAddress3 } from "enssdk";
|
|
1975
|
+
import { mnemonicToAccount } from "viem/accounts";
|
|
1976
|
+
var mnemonic = "test test test test test test test test test test test junk";
|
|
1977
|
+
function createAccount(addressIndex, resolver) {
|
|
1978
|
+
const account = mnemonicToAccount(mnemonic, { addressIndex });
|
|
1979
|
+
return {
|
|
1980
|
+
...account,
|
|
1981
|
+
address: toNormalizedAddress3(account.address),
|
|
1982
|
+
resolver
|
|
1983
|
+
};
|
|
1984
|
+
}
|
|
1985
|
+
var accounts = {
|
|
1986
|
+
deployer: createAccount(0, asNormalizedAddress("0x9c97ec2d79944fa55aa2eb6385bc8711cacf18d2")),
|
|
1987
|
+
owner: createAccount(1, asNormalizedAddress("0x8550d35164e7f86bb6adf4cedb3f012913c9d563")),
|
|
1988
|
+
user: createAccount(2, asNormalizedAddress("0x98a84b915ffe27241033ac8f29c6b7849a0fb6e4")),
|
|
1989
|
+
user2: createAccount(3, asNormalizedAddress("0xd04f8f3726a417cfadeea604fc94cf66112b9af6"))
|
|
1990
|
+
};
|
|
1991
|
+
var addresses = {
|
|
1992
|
+
one: asNormalizedAddress(`0x${"1".repeat(40)}`)
|
|
1993
|
+
};
|
|
1994
|
+
var getRawAddress = (coinName, address) => {
|
|
1995
|
+
const coder = getCoderByCoinName(coinName);
|
|
1996
|
+
return {
|
|
1997
|
+
coinType: coder.coinType,
|
|
1998
|
+
raw: bytesToHex(coder.decode(address)),
|
|
1999
|
+
address
|
|
2000
|
+
};
|
|
2001
|
+
};
|
|
2002
|
+
var testEthTextRecords = {
|
|
2003
|
+
avatar: { key: "avatar", value: "https://example.com/avatar.png" },
|
|
2004
|
+
twitter: { key: "com.twitter", value: "ensdomains" },
|
|
2005
|
+
github: { key: "com.github", value: "@ensdomains" },
|
|
2006
|
+
x: { key: "com.x", value: "this_is_real_ensdomains_not_twitter_but_x_haha" },
|
|
2007
|
+
telegram: { key: "org.telegram", value: "t.me/ensdomains" },
|
|
2008
|
+
url: { key: "url", value: "https://ens.domains" },
|
|
2009
|
+
email: { key: "email", value: "test@ens.domains" },
|
|
2010
|
+
description: { key: "description", value: "test.eth" },
|
|
2011
|
+
header: { key: "header", value: "https://example.com/header.png" }
|
|
2012
|
+
};
|
|
2013
|
+
var rawAddresses = {
|
|
2014
|
+
bitcoin: getRawAddress("btc", "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"),
|
|
2015
|
+
litecoin: getRawAddress("ltc", "LaMT348PWRnrqeeWArpwQPbuanpXDZGEUz"),
|
|
2016
|
+
dogecoin: getRawAddress("doge", "DBXu2kgc3xtvCUWFcxFE3r9hEYgmuaaCyD"),
|
|
2017
|
+
monacoin: getRawAddress("mona", "MHxgS2XMXjeJ4if2PRRbWYcdwZPWfdwaDT"),
|
|
2018
|
+
rootstock: getRawAddress("rbtc", "0x5aaEB6053f3e94c9b9a09f33669435E7ef1bEAeD"),
|
|
2019
|
+
binance: getRawAddress("bnb", "bnb1grpf0955h0ykzq3ar5nmum7y6gdfl6lxfn46h2"),
|
|
2020
|
+
solana: getRawAddress("sol", "FncazAs6omJJjtLVzquzT9KoyXn6tFixr9kGjr42ktLj")
|
|
2021
|
+
};
|
|
2022
|
+
var fixtures = {
|
|
2023
|
+
abiBytes: `0x${"01".repeat(32)}`,
|
|
2024
|
+
fourBytesInterface: "0x11100111",
|
|
2025
|
+
publicKeyX: `0x${"02".repeat(32)}`,
|
|
2026
|
+
publicKeyY: `0x${"03".repeat(32)}`,
|
|
2027
|
+
contenthash: `0x${"04".repeat(32)}`,
|
|
2028
|
+
rawAddresses,
|
|
2029
|
+
textRecords: testEthTextRecords
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
// src/omnigraph-api/example-queries.ts
|
|
1970
2033
|
var SEPOLIA_V2_V2_ETH_REGISTRY = getDatasourceContract(
|
|
1971
2034
|
ENSNamespaceIds3.SepoliaV2,
|
|
1972
2035
|
DatasourceNames2.ENSv2Root,
|
|
@@ -1982,25 +2045,24 @@ var ENS_TEST_ENV_V2_ETH_REGISTRAR = getDatasourceContract(
|
|
|
1982
2045
|
DatasourceNames2.ENSv2Root,
|
|
1983
2046
|
"ETHRegistrar"
|
|
1984
2047
|
);
|
|
1985
|
-
var VITALIK_ADDRESS =
|
|
1986
|
-
var
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
var SEPOLIA_V2_ADDRESS_WITH_PERMISSIONS = toNormalizedAddress3(
|
|
1990
|
-
"0x4c65a1c8d330ce1c3f60e00cd55709ba5fe2e090"
|
|
2048
|
+
var VITALIK_ADDRESS = toNormalizedAddress4("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");
|
|
2049
|
+
var SEPOLIA_V2_ACCOUNT = toNormalizedAddress4("0x801d2e48d378f161dba7ad7ad002ad557714c191");
|
|
2050
|
+
var SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 = toNormalizedAddress4(
|
|
2051
|
+
"0xffffffffff52d316b7bd028358089bc8066b8f80"
|
|
1991
2052
|
);
|
|
1992
2053
|
var DEVNET_NAME_WITH_OWNED_RESOLVER = asInterpretedName("example.eth");
|
|
1993
|
-
var
|
|
2054
|
+
var SEPOLIA_V2_NAME = asInterpretedName("roppp.eth");
|
|
2055
|
+
var VITALIK_NAME = asInterpretedName("vitalik.eth");
|
|
2056
|
+
var GREG_NAME = asInterpretedName("gregskril.eth");
|
|
1994
2057
|
var MAINNET_PUBLIC_RESOLVER = getDatasourceContract(
|
|
1995
2058
|
ENSNamespaceIds3.Mainnet,
|
|
1996
2059
|
DatasourceNames2.ReverseResolverRoot,
|
|
1997
2060
|
"DefaultPublicResolver5"
|
|
1998
2061
|
);
|
|
1999
|
-
var
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
);
|
|
2062
|
+
var SEPOLIA_V2_RESOLVER_WITH_RECORDS = {
|
|
2063
|
+
chainId: 11155111,
|
|
2064
|
+
address: toNormalizedAddress4("0x8fade66b79cc9f707ab26799354482eb93a5b7dd")
|
|
2065
|
+
};
|
|
2004
2066
|
function getGraphqlApiExampleQueryById(id) {
|
|
2005
2067
|
const found = graphqlApiExampleQueryById.get(id);
|
|
2006
2068
|
if (!found) {
|
|
@@ -2014,18 +2076,44 @@ var GRAPHQL_API_EXAMPLE_QUERIES = [
|
|
|
2014
2076
|
////////////////
|
|
2015
2077
|
{
|
|
2016
2078
|
id: "hello-world",
|
|
2017
|
-
query:
|
|
2018
|
-
#
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
#
|
|
2022
|
-
#
|
|
2023
|
-
|
|
2024
|
-
#
|
|
2025
|
-
|
|
2026
|
-
|
|
2079
|
+
query: `query HelloWorld($address: Address!) {
|
|
2080
|
+
# Lookup an Account by address.
|
|
2081
|
+
account(by: { address: $address }) {
|
|
2082
|
+
resolve {
|
|
2083
|
+
# Reverse resolve the ENS primary name of the account
|
|
2084
|
+
# using a convenient ETHEREUM alias for mainnet.
|
|
2085
|
+
primaryName(by: { chainName: ETHEREUM }) {
|
|
2086
|
+
# Get the regular interpreted variant of the primary name
|
|
2087
|
+
# and also the special beautified variant that optimizes names
|
|
2088
|
+
# containing special characters such as emojis for proper display in interfaces.
|
|
2089
|
+
name { interpreted beautified }
|
|
2090
|
+
resolve {
|
|
2091
|
+
# If the account has a primary name on Ethereum (mainnet),
|
|
2092
|
+
# forward resolve the interpreted ENS profile of that name in the same query!.
|
|
2093
|
+
profile {
|
|
2094
|
+
description
|
|
2095
|
+
avatar { httpUrl }
|
|
2096
|
+
addresses { ethereum bitcoin }
|
|
2097
|
+
socials {
|
|
2098
|
+
twitter { handle httpUrl }
|
|
2099
|
+
github { handle httpUrl }
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
# Also load the count of ENSv1 and ENSv2 domains owned by the account
|
|
2107
|
+
# to see if they have domains they should upgrade to ENSv2
|
|
2108
|
+
v1DomainsCount: domains(where: { version: ENSv1 }) { totalCount }
|
|
2109
|
+
v2DomainsCount: domains(where: { version: ENSv2 }) { totalCount }
|
|
2110
|
+
}
|
|
2027
2111
|
}`,
|
|
2028
|
-
variables: {
|
|
2112
|
+
variables: {
|
|
2113
|
+
default: { address: VITALIK_ADDRESS },
|
|
2114
|
+
[ENSNamespaceIds3.EnsTestEnv]: { address: accounts.owner.address },
|
|
2115
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 }
|
|
2116
|
+
}
|
|
2029
2117
|
},
|
|
2030
2118
|
/////////////////
|
|
2031
2119
|
// Find Domains
|
|
@@ -2061,17 +2149,40 @@ query FindDomains(
|
|
|
2061
2149
|
order: { by: "NAME", dir: "DESC" }
|
|
2062
2150
|
},
|
|
2063
2151
|
[ENSNamespaceIds3.SepoliaV2]: {
|
|
2064
|
-
name: { starts_with: "
|
|
2152
|
+
name: { starts_with: "sf" },
|
|
2065
2153
|
order: { by: "NAME", dir: "DESC" }
|
|
2066
2154
|
}
|
|
2067
2155
|
}
|
|
2068
2156
|
},
|
|
2069
|
-
///////////////////
|
|
2070
|
-
// Domain By Name
|
|
2071
|
-
///////////////////
|
|
2072
2157
|
{
|
|
2073
2158
|
id: "domain-by-name",
|
|
2074
2159
|
query: `
|
|
2160
|
+
query DomainByName($name: InterpretedName!) {
|
|
2161
|
+
domain(by: { name: $name }) {
|
|
2162
|
+
canonical { name { beautified } }
|
|
2163
|
+
owner { address }
|
|
2164
|
+
resolve {
|
|
2165
|
+
profile {
|
|
2166
|
+
description
|
|
2167
|
+
addresses {
|
|
2168
|
+
ethereum
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
}`,
|
|
2174
|
+
variables: {
|
|
2175
|
+
default: { name: "eth" },
|
|
2176
|
+
[ENSNamespaceIds3.SepoliaV2]: { name: SEPOLIA_V2_NAME },
|
|
2177
|
+
[ENSNamespaceIds3.Mainnet]: { name: VITALIK_NAME }
|
|
2178
|
+
}
|
|
2179
|
+
},
|
|
2180
|
+
////////////////////////////////
|
|
2181
|
+
// Domain By Name Type Condition
|
|
2182
|
+
////////////////////////////////
|
|
2183
|
+
{
|
|
2184
|
+
id: "domain-by-name-type-condition",
|
|
2185
|
+
query: `
|
|
2075
2186
|
query DomainByName($name: InterpretedName!) {
|
|
2076
2187
|
domain(by: {name: $name}) {
|
|
2077
2188
|
__typename
|
|
@@ -2088,7 +2199,7 @@ query DomainByName($name: InterpretedName!) {
|
|
|
2088
2199
|
}`,
|
|
2089
2200
|
variables: {
|
|
2090
2201
|
default: { name: "eth" },
|
|
2091
|
-
[ENSNamespaceIds3.SepoliaV2]: { name:
|
|
2202
|
+
[ENSNamespaceIds3.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2092
2203
|
}
|
|
2093
2204
|
},
|
|
2094
2205
|
///////////////////////
|
|
@@ -2132,9 +2243,87 @@ query DomainRegistration($name: InterpretedName!) {
|
|
|
2132
2243
|
}
|
|
2133
2244
|
}`,
|
|
2134
2245
|
variables: {
|
|
2135
|
-
default: { name:
|
|
2136
|
-
[ENSNamespaceIds3.SepoliaV2]: { name:
|
|
2246
|
+
default: { name: VITALIK_NAME },
|
|
2247
|
+
[ENSNamespaceIds3.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2248
|
+
}
|
|
2249
|
+
},
|
|
2250
|
+
////////////////////
|
|
2251
|
+
// Domain Records
|
|
2252
|
+
////////////////////
|
|
2253
|
+
{
|
|
2254
|
+
id: "domain-records",
|
|
2255
|
+
query: `
|
|
2256
|
+
query DomainRecords($name: InterpretedName!) {
|
|
2257
|
+
domain(by: {name: $name}) {
|
|
2258
|
+
canonical {
|
|
2259
|
+
name {
|
|
2260
|
+
interpreted
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
resolve {
|
|
2264
|
+
records {
|
|
2265
|
+
addresses(coinTypes: [60, 2147483658, 501]) {
|
|
2266
|
+
coinType
|
|
2267
|
+
address
|
|
2268
|
+
}
|
|
2269
|
+
texts(keys: ["description", "avatar", "url", "com.github", "com.twitter"]) {
|
|
2270
|
+
key
|
|
2271
|
+
value
|
|
2272
|
+
}
|
|
2273
|
+
contenthash
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
}`,
|
|
2278
|
+
variables: {
|
|
2279
|
+
default: { name: GREG_NAME },
|
|
2280
|
+
[ENSNamespaceIds3.EnsTestEnv]: {
|
|
2281
|
+
name: DEVNET_NAME_WITH_OWNED_RESOLVER
|
|
2282
|
+
},
|
|
2283
|
+
[ENSNamespaceIds3.SepoliaV2]: {
|
|
2284
|
+
name: SEPOLIA_V2_NAME
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
},
|
|
2288
|
+
{
|
|
2289
|
+
id: "domain-profile",
|
|
2290
|
+
query: `
|
|
2291
|
+
query DomainProfile($name: InterpretedName!) {
|
|
2292
|
+
domain(by: {name: $name}) {
|
|
2293
|
+
resolve {
|
|
2294
|
+
profile {
|
|
2295
|
+
description
|
|
2296
|
+
avatar {
|
|
2297
|
+
httpUrl
|
|
2298
|
+
}
|
|
2299
|
+
addresses {
|
|
2300
|
+
ethereum
|
|
2301
|
+
base
|
|
2302
|
+
solana
|
|
2303
|
+
bitcoin
|
|
2304
|
+
rootstock
|
|
2305
|
+
}
|
|
2306
|
+
socials {
|
|
2307
|
+
github {
|
|
2308
|
+
handle
|
|
2309
|
+
httpUrl
|
|
2310
|
+
}
|
|
2311
|
+
twitter {
|
|
2312
|
+
handle
|
|
2313
|
+
httpUrl
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
website {
|
|
2317
|
+
httpUrl
|
|
2318
|
+
}
|
|
2319
|
+
header {
|
|
2320
|
+
httpUrl
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2137
2323
|
}
|
|
2324
|
+
}
|
|
2325
|
+
}`,
|
|
2326
|
+
variables: { default: { name: GREG_NAME } }
|
|
2138
2327
|
},
|
|
2139
2328
|
//////////////////////
|
|
2140
2329
|
// Domain Subdomains
|
|
@@ -2145,7 +2334,34 @@ query DomainRegistration($name: InterpretedName!) {
|
|
|
2145
2334
|
query DomainSubdomains($name: InterpretedName!) {
|
|
2146
2335
|
domain(by: {name: $name}) {
|
|
2147
2336
|
canonical { name { interpreted beautified } }
|
|
2148
|
-
subdomains(first: 10
|
|
2337
|
+
subdomains(first: 10, order: {
|
|
2338
|
+
by: NAME,
|
|
2339
|
+
dir: ASC
|
|
2340
|
+
}) {
|
|
2341
|
+
edges {
|
|
2342
|
+
node {
|
|
2343
|
+
canonical { name { interpreted beautified } }
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
}`,
|
|
2349
|
+
variables: {
|
|
2350
|
+
default: { name: "eth" },
|
|
2351
|
+
// in mainnet there is too many subdomains of eth
|
|
2352
|
+
[ENSNamespaceIds3.Mainnet]: { name: "base.eth" }
|
|
2353
|
+
}
|
|
2354
|
+
},
|
|
2355
|
+
////////////////////////////////////
|
|
2356
|
+
// Most Recently Registered Subdomains
|
|
2357
|
+
////////////////////////////////////
|
|
2358
|
+
{
|
|
2359
|
+
id: "domain-subdomains-recently-registered",
|
|
2360
|
+
query: `
|
|
2361
|
+
query RecentlyRegisteredSubdomains($name: InterpretedName!) {
|
|
2362
|
+
domain(by: {name: $name}) {
|
|
2363
|
+
canonical { name { interpreted beautified } }
|
|
2364
|
+
subdomains(first: 10, order: {by: REGISTRATION_TIMESTAMP, dir: DESC}) {
|
|
2149
2365
|
edges {
|
|
2150
2366
|
node {
|
|
2151
2367
|
canonical { name { interpreted beautified } }
|
|
@@ -2206,7 +2422,7 @@ query DomainEvents($name: InterpretedName!) {
|
|
|
2206
2422
|
}`,
|
|
2207
2423
|
variables: {
|
|
2208
2424
|
default: { name: "newowner.eth" },
|
|
2209
|
-
[ENSNamespaceIds3.SepoliaV2]: { name:
|
|
2425
|
+
[ENSNamespaceIds3.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2210
2426
|
}
|
|
2211
2427
|
},
|
|
2212
2428
|
////////////////////
|
|
@@ -2232,7 +2448,39 @@ query AccountDomains(
|
|
|
2232
2448
|
variables: {
|
|
2233
2449
|
default: { address: VITALIK_ADDRESS },
|
|
2234
2450
|
[ENSNamespaceIds3.EnsTestEnv]: { address: accounts.owner.address },
|
|
2235
|
-
[ENSNamespaceIds3.SepoliaV2]: { address:
|
|
2451
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2452
|
+
}
|
|
2453
|
+
},
|
|
2454
|
+
/////////////////////////
|
|
2455
|
+
// Account Primary Names
|
|
2456
|
+
/////////////////////////
|
|
2457
|
+
{
|
|
2458
|
+
id: "account-primary-name",
|
|
2459
|
+
query: `
|
|
2460
|
+
query AccountPrimaryName($address: Address!) {
|
|
2461
|
+
account(by: { address: $address }) {
|
|
2462
|
+
address
|
|
2463
|
+
resolve {
|
|
2464
|
+
primaryName(by: { chainName: ETHEREUM }) {
|
|
2465
|
+
name { interpreted beautified }
|
|
2466
|
+
resolve {
|
|
2467
|
+
profile {
|
|
2468
|
+
description
|
|
2469
|
+
socials {
|
|
2470
|
+
twitter {
|
|
2471
|
+
httpUrl
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
}`,
|
|
2480
|
+
variables: {
|
|
2481
|
+
default: { address: VITALIK_ADDRESS },
|
|
2482
|
+
[ENSNamespaceIds3.EnsTestEnv]: { address: accounts.owner.address },
|
|
2483
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2236
2484
|
}
|
|
2237
2485
|
},
|
|
2238
2486
|
////////////////////
|
|
@@ -2251,7 +2499,7 @@ query AccountEvents(
|
|
|
2251
2499
|
variables: {
|
|
2252
2500
|
default: { address: VITALIK_ADDRESS },
|
|
2253
2501
|
[ENSNamespaceIds3.EnsTestEnv]: { address: accounts.deployer.address },
|
|
2254
|
-
[ENSNamespaceIds3.SepoliaV2]: { address:
|
|
2502
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2255
2503
|
}
|
|
2256
2504
|
},
|
|
2257
2505
|
/////////////////////
|
|
@@ -2336,7 +2584,7 @@ query PermissionsByUser($address: Address!) {
|
|
|
2336
2584
|
}`,
|
|
2337
2585
|
variables: {
|
|
2338
2586
|
default: { address: accounts.deployer.address },
|
|
2339
|
-
[ENSNamespaceIds3.SepoliaV2]: { address:
|
|
2587
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2340
2588
|
}
|
|
2341
2589
|
},
|
|
2342
2590
|
//////////////////////////////////
|
|
@@ -2362,7 +2610,7 @@ query AccountResolverPermissions($address: Address!) {
|
|
|
2362
2610
|
}`,
|
|
2363
2611
|
variables: {
|
|
2364
2612
|
default: { address: accounts.deployer.address },
|
|
2365
|
-
[ENSNamespaceIds3.SepoliaV2]: { address:
|
|
2613
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2366
2614
|
}
|
|
2367
2615
|
},
|
|
2368
2616
|
//////////////////////////////
|
|
@@ -2375,17 +2623,20 @@ query DomainResolver($name: InterpretedName!) {
|
|
|
2375
2623
|
domain(by: { name: $name }) {
|
|
2376
2624
|
resolver {
|
|
2377
2625
|
assigned {
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2626
|
+
contract {
|
|
2627
|
+
address
|
|
2628
|
+
}
|
|
2629
|
+
events(first: 5) {
|
|
2630
|
+
edges { node { topics data timestamp } }
|
|
2631
|
+
}
|
|
2381
2632
|
}
|
|
2382
2633
|
}
|
|
2383
2634
|
}
|
|
2384
2635
|
}`,
|
|
2385
2636
|
variables: {
|
|
2386
|
-
default: { name:
|
|
2637
|
+
default: { name: VITALIK_NAME },
|
|
2387
2638
|
[ENSNamespaceIds3.EnsTestEnv]: { name: DEVNET_NAME_WITH_OWNED_RESOLVER },
|
|
2388
|
-
[ENSNamespaceIds3.SepoliaV2]: { name:
|
|
2639
|
+
[ENSNamespaceIds3.SepoliaV2]: { name: SEPOLIA_V2_NAME }
|
|
2389
2640
|
}
|
|
2390
2641
|
},
|
|
2391
2642
|
////////////////////////
|
|
@@ -2417,7 +2668,7 @@ query ResolverByAddress($contract: AccountIdInput!) {
|
|
|
2417
2668
|
}`,
|
|
2418
2669
|
variables: {
|
|
2419
2670
|
default: { contract: MAINNET_PUBLIC_RESOLVER },
|
|
2420
|
-
[ENSNamespaceIds3.SepoliaV2]: { contract:
|
|
2671
|
+
[ENSNamespaceIds3.SepoliaV2]: { contract: SEPOLIA_V2_RESOLVER_WITH_RECORDS }
|
|
2421
2672
|
}
|
|
2422
2673
|
},
|
|
2423
2674
|
//////////////
|
|
@@ -2427,31 +2678,19 @@ query ResolverByAddress($contract: AccountIdInput!) {
|
|
|
2427
2678
|
id: "namegraph",
|
|
2428
2679
|
query: `
|
|
2429
2680
|
query Namegraph {
|
|
2430
|
-
|
|
2431
|
-
id
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
edges {
|
|
2439
|
-
node {
|
|
2440
|
-
canonical { name { interpreted beautified } }
|
|
2441
|
-
|
|
2442
|
-
subdomains {
|
|
2443
|
-
edges {
|
|
2444
|
-
node {
|
|
2445
|
-
canonical { name { interpreted beautified } }
|
|
2446
|
-
}
|
|
2447
|
-
}
|
|
2448
|
-
}
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2681
|
+
domain(by: { name: "eth" }) {
|
|
2682
|
+
registry { id contract { chainId address } }
|
|
2683
|
+
parent { id }
|
|
2684
|
+
subregistry {
|
|
2685
|
+
domains {
|
|
2686
|
+
edges {
|
|
2687
|
+
node {
|
|
2688
|
+
canonical { name { beautified } }
|
|
2451
2689
|
}
|
|
2452
2690
|
}
|
|
2453
2691
|
}
|
|
2454
2692
|
}
|
|
2693
|
+
subdomains { edges { node { canonical { name { beautified } } } } }
|
|
2455
2694
|
}
|
|
2456
2695
|
}`,
|
|
2457
2696
|
variables: { default: {} }
|
|
@@ -2470,7 +2709,7 @@ query AccountMigratedNames($address: Address!) {
|
|
|
2470
2709
|
}`,
|
|
2471
2710
|
variables: {
|
|
2472
2711
|
default: { address: VITALIK_ADDRESS },
|
|
2473
|
-
[ENSNamespaceIds3.SepoliaV2]: { address:
|
|
2712
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 }
|
|
2474
2713
|
}
|
|
2475
2714
|
},
|
|
2476
2715
|
{
|
|
@@ -2487,6 +2726,40 @@ query GetEthDomains {
|
|
|
2487
2726
|
}
|
|
2488
2727
|
}`,
|
|
2489
2728
|
variables: { default: {} }
|
|
2729
|
+
},
|
|
2730
|
+
{
|
|
2731
|
+
id: "accelerate-resolve",
|
|
2732
|
+
query: `
|
|
2733
|
+
query AccelerateResolve($address: Address!) {
|
|
2734
|
+
account(by: { address: $address }) {
|
|
2735
|
+
address
|
|
2736
|
+
resolve(accelerate: true) {
|
|
2737
|
+
trace
|
|
2738
|
+
acceleration {
|
|
2739
|
+
requested
|
|
2740
|
+
attempted
|
|
2741
|
+
}
|
|
2742
|
+
primaryName(by: { chainName: ETHEREUM }) {
|
|
2743
|
+
name { interpreted beautified }
|
|
2744
|
+
resolve {
|
|
2745
|
+
trace
|
|
2746
|
+
acceleration {
|
|
2747
|
+
requested
|
|
2748
|
+
attempted
|
|
2749
|
+
}
|
|
2750
|
+
profile {
|
|
2751
|
+
description
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
}
|
|
2757
|
+
}`,
|
|
2758
|
+
variables: {
|
|
2759
|
+
default: { address: VITALIK_ADDRESS },
|
|
2760
|
+
[ENSNamespaceIds3.EnsTestEnv]: { address: accounts.owner.address },
|
|
2761
|
+
[ENSNamespaceIds3.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 }
|
|
2762
|
+
}
|
|
2490
2763
|
}
|
|
2491
2764
|
];
|
|
2492
2765
|
var graphqlApiExampleQueryById = new Map(
|
|
@@ -2525,7 +2798,8 @@ async function supportsInterface({
|
|
|
2525
2798
|
abi: EIP_165_ABI,
|
|
2526
2799
|
functionName: "supportsInterface",
|
|
2527
2800
|
address,
|
|
2528
|
-
args: [selector]
|
|
2801
|
+
args: [selector],
|
|
2802
|
+
retryEmptyResponse: false
|
|
2529
2803
|
});
|
|
2530
2804
|
} catch {
|
|
2531
2805
|
return false;
|
|
@@ -2934,8 +3208,8 @@ import { isAddressEqual as isAddressEqual4, zeroAddress as zeroAddress5 } from "
|
|
|
2934
3208
|
var interpretAddress = (owner) => isAddressEqual4(zeroAddress5, owner) ? null : owner;
|
|
2935
3209
|
|
|
2936
3210
|
// src/shared/interpretation/interpret-record-values.ts
|
|
2937
|
-
import { isInterpretedName
|
|
2938
|
-
import {
|
|
3211
|
+
import { isInterpretedName } from "enssdk";
|
|
3212
|
+
import { isHex as isHex2, zeroAddress as zeroAddress6 } from "viem";
|
|
2939
3213
|
|
|
2940
3214
|
// src/shared/null-bytes.ts
|
|
2941
3215
|
var hasNullByte = (value) => value.indexOf("\0") !== -1;
|
|
@@ -2947,12 +3221,11 @@ function interpretNameRecordValue(value) {
|
|
|
2947
3221
|
return value;
|
|
2948
3222
|
}
|
|
2949
3223
|
function interpretAddressRecordValue(value) {
|
|
2950
|
-
if (hasNullByte(value)) return null;
|
|
2951
|
-
if (value === "") return null;
|
|
2952
3224
|
if (value === "0x") return null;
|
|
2953
|
-
if (!
|
|
2954
|
-
|
|
2955
|
-
|
|
3225
|
+
if (!isHex2(value, { strict: true })) return null;
|
|
3226
|
+
const normalized = value.toLowerCase();
|
|
3227
|
+
if (normalized === zeroAddress6) return null;
|
|
3228
|
+
return normalized;
|
|
2956
3229
|
}
|
|
2957
3230
|
function interpretTextRecordKey(key) {
|
|
2958
3231
|
if (hasNullByte(key)) return null;
|
|
@@ -3144,7 +3417,11 @@ var getManagedName = (namespace, contract) => {
|
|
|
3144
3417
|
};
|
|
3145
3418
|
|
|
3146
3419
|
// src/shared/root-registry.ts
|
|
3147
|
-
import {
|
|
3420
|
+
import {
|
|
3421
|
+
makeConcreteRegistryId,
|
|
3422
|
+
makeENSv1RegistryId,
|
|
3423
|
+
makeENSv2RegistryId
|
|
3424
|
+
} from "enssdk";
|
|
3148
3425
|
import { DatasourceNames as DatasourceNames6 } from "@ensnode/datasources";
|
|
3149
3426
|
var getENSv1RootRegistry = (namespace) => getDatasourceContract(namespace, DatasourceNames6.ENSRoot, "ENSv1Registry");
|
|
3150
3427
|
|
|
@@ -3348,6 +3625,7 @@ export {
|
|
|
3348
3625
|
makeENSIndexerPublicConfigSchema,
|
|
3349
3626
|
makeENSIndexerVersionInfoSchema,
|
|
3350
3627
|
makeENSNamespaceIdSchema,
|
|
3628
|
+
makeEmailSchema,
|
|
3351
3629
|
makeEnsApiIndexingStatusResponseErrorSchema,
|
|
3352
3630
|
makeEnsApiIndexingStatusResponseOkSchema,
|
|
3353
3631
|
makeEnsApiIndexingStatusResponseSchema,
|