@ensnode/ensnode-sdk 0.0.0-next-20260603070418 → 0.0.0-next-20260603155437
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.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +109 -26
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +5 -1
- package/dist/internal.d.ts +5 -1
- package/dist/internal.js +89 -6
- package/dist/internal.js.map +1 -1
- package/package.json +5 -4
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,13 +2231,13 @@ 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 SEPOLIA_V2_ACCOUNT = (0,
|
|
2172
|
-
var SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 = (0,
|
|
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)(
|
|
2173
2237
|
"0xffffffffff52d316b7bd028358089bc8066b8f80"
|
|
2174
2238
|
);
|
|
2175
|
-
var DEVNET_NAME_WITH_OWNED_RESOLVER = (0,
|
|
2176
|
-
var SEPOLIA_V2_NAME = (0,
|
|
2239
|
+
var DEVNET_NAME_WITH_OWNED_RESOLVER = (0, import_enssdk9.asInterpretedName)("example.eth");
|
|
2240
|
+
var SEPOLIA_V2_NAME = (0, import_enssdk9.asInterpretedName)("roppp.eth");
|
|
2177
2241
|
var MAINNET_PUBLIC_RESOLVER = getDatasourceContract(
|
|
2178
2242
|
import_datasources5.ENSNamespaceIds.Mainnet,
|
|
2179
2243
|
import_datasources5.DatasourceNames.ReverseResolverRoot,
|
|
@@ -2181,7 +2245,7 @@ var MAINNET_PUBLIC_RESOLVER = getDatasourceContract(
|
|
|
2181
2245
|
);
|
|
2182
2246
|
var SEPOLIA_V2_RESOLVER_WITH_RECORDS = {
|
|
2183
2247
|
chainId: 11155111,
|
|
2184
|
-
address: (0,
|
|
2248
|
+
address: (0, import_enssdk9.toNormalizedAddress)("0x8fade66b79cc9f707ab26799354482eb93a5b7dd")
|
|
2185
2249
|
};
|
|
2186
2250
|
function getGraphqlApiExampleQueryById(id) {
|
|
2187
2251
|
const found = graphqlApiExampleQueryById.get(id);
|
|
@@ -2442,7 +2506,7 @@ query AccountDomains(
|
|
|
2442
2506
|
}`,
|
|
2443
2507
|
variables: {
|
|
2444
2508
|
default: { address: VITALIK_ADDRESS },
|
|
2445
|
-
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address:
|
|
2509
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.owner.address },
|
|
2446
2510
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2447
2511
|
}
|
|
2448
2512
|
},
|
|
@@ -2474,7 +2538,7 @@ query AccountPrimaryNames($address: Address!) {
|
|
|
2474
2538
|
}`,
|
|
2475
2539
|
variables: {
|
|
2476
2540
|
default: { address: VITALIK_ADDRESS },
|
|
2477
|
-
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address:
|
|
2541
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.owner.address },
|
|
2478
2542
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2479
2543
|
}
|
|
2480
2544
|
},
|
|
@@ -2493,7 +2557,7 @@ query AccountEvents(
|
|
|
2493
2557
|
}`,
|
|
2494
2558
|
variables: {
|
|
2495
2559
|
default: { address: VITALIK_ADDRESS },
|
|
2496
|
-
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address:
|
|
2560
|
+
[import_datasources5.ENSNamespaceIds.EnsTestEnv]: { address: accounts.deployer.address },
|
|
2497
2561
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2498
2562
|
}
|
|
2499
2563
|
},
|
|
@@ -2578,7 +2642,7 @@ query PermissionsByUser($address: Address!) {
|
|
|
2578
2642
|
}
|
|
2579
2643
|
}`,
|
|
2580
2644
|
variables: {
|
|
2581
|
-
default: { address:
|
|
2645
|
+
default: { address: accounts.deployer.address },
|
|
2582
2646
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2583
2647
|
}
|
|
2584
2648
|
},
|
|
@@ -2604,7 +2668,7 @@ query AccountResolverPermissions($address: Address!) {
|
|
|
2604
2668
|
}
|
|
2605
2669
|
}`,
|
|
2606
2670
|
variables: {
|
|
2607
|
-
default: { address:
|
|
2671
|
+
default: { address: accounts.deployer.address },
|
|
2608
2672
|
[import_datasources5.ENSNamespaceIds.SepoliaV2]: { address: SEPOLIA_V2_ACCOUNT }
|
|
2609
2673
|
}
|
|
2610
2674
|
},
|
|
@@ -2730,6 +2794,25 @@ query GetEthDomains {
|
|
|
2730
2794
|
}
|
|
2731
2795
|
}`,
|
|
2732
2796
|
variables: { default: {} }
|
|
2797
|
+
},
|
|
2798
|
+
{
|
|
2799
|
+
id: "domain-profile",
|
|
2800
|
+
query: `
|
|
2801
|
+
query DomainProfile($name: InterpretedName!) {
|
|
2802
|
+
domain(by: { name: $name }) {
|
|
2803
|
+
resolve {
|
|
2804
|
+
profile {
|
|
2805
|
+
description
|
|
2806
|
+
avatar { httpUrl }
|
|
2807
|
+
addresses { ethereum }
|
|
2808
|
+
socials { github { handle httpUrl } }
|
|
2809
|
+
website { httpUrl }
|
|
2810
|
+
email
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
}
|
|
2814
|
+
}`,
|
|
2815
|
+
variables: { default: { name: "vitalik.eth" } }
|
|
2733
2816
|
}
|
|
2734
2817
|
];
|
|
2735
2818
|
var graphqlApiExampleQueryById = new Map(
|
|
@@ -3155,7 +3238,7 @@ var import_viem8 = require("viem");
|
|
|
3155
3238
|
var interpretAddress = (owner) => (0, import_viem8.isAddressEqual)(import_viem8.zeroAddress, owner) ? null : owner;
|
|
3156
3239
|
|
|
3157
3240
|
// src/shared/interpretation/interpret-record-values.ts
|
|
3158
|
-
var
|
|
3241
|
+
var import_enssdk10 = require("enssdk");
|
|
3159
3242
|
var import_viem9 = require("viem");
|
|
3160
3243
|
|
|
3161
3244
|
// src/shared/null-bytes.ts
|
|
@@ -3164,7 +3247,7 @@ var hasNullByte = (value) => value.indexOf("\0") !== -1;
|
|
|
3164
3247
|
// src/shared/interpretation/interpret-record-values.ts
|
|
3165
3248
|
function interpretNameRecordValue(value) {
|
|
3166
3249
|
if (value === "") return null;
|
|
3167
|
-
if (!(0,
|
|
3250
|
+
if (!(0, import_enssdk10.isInterpretedName)(value)) return null;
|
|
3168
3251
|
return value;
|
|
3169
3252
|
}
|
|
3170
3253
|
function interpretAddressRecordValue(value) {
|
|
@@ -3215,11 +3298,11 @@ function getLogLevelFromEnv(env, defaultLogLevel) {
|
|
|
3215
3298
|
}
|
|
3216
3299
|
|
|
3217
3300
|
// src/shared/protocol-acceleration/is-bridged-resolver.ts
|
|
3218
|
-
var
|
|
3301
|
+
var import_enssdk13 = require("enssdk");
|
|
3219
3302
|
var import_datasources14 = require("@ensnode/datasources");
|
|
3220
3303
|
|
|
3221
3304
|
// src/shared/managed-names.ts
|
|
3222
|
-
var
|
|
3305
|
+
var import_enssdk11 = require("enssdk");
|
|
3223
3306
|
var import_datasources12 = require("@ensnode/datasources");
|
|
3224
3307
|
|
|
3225
3308
|
// src/shared/to-json.ts
|
|
@@ -3268,7 +3351,7 @@ var getContractsByManagedName = (namespace) => {
|
|
|
3268
3351
|
"NameWrapper"
|
|
3269
3352
|
);
|
|
3270
3353
|
return {
|
|
3271
|
-
[
|
|
3354
|
+
[import_enssdk11.ENS_ROOT_NAME]: {
|
|
3272
3355
|
registry: ensRootRegistry,
|
|
3273
3356
|
contracts: [ensRootRegistry, ensRootRegistryOld]
|
|
3274
3357
|
},
|
|
@@ -3334,7 +3417,7 @@ var getContractsByManagedName = (namespace) => {
|
|
|
3334
3417
|
};
|
|
3335
3418
|
var cache = /* @__PURE__ */ new Map();
|
|
3336
3419
|
var getManagedName = (namespace, contract) => {
|
|
3337
|
-
const cacheKey = `${namespace}:${(0,
|
|
3420
|
+
const cacheKey = `${namespace}:${(0, import_enssdk11.stringifyAccountId)(contract)}`;
|
|
3338
3421
|
const cached = cache.get(cacheKey);
|
|
3339
3422
|
if (cached !== void 0) return cached;
|
|
3340
3423
|
for (const [managedName, group] of Object.entries(getContractsByManagedName(namespace))) {
|
|
@@ -3343,8 +3426,8 @@ var getManagedName = (namespace, contract) => {
|
|
|
3343
3426
|
);
|
|
3344
3427
|
if (isAnyOfTheContracts) {
|
|
3345
3428
|
const namespaceSpecific = MANAGED_NAME_BY_NAMESPACE[namespace]?.[managedName];
|
|
3346
|
-
const name = (0,
|
|
3347
|
-
const node = (0,
|
|
3429
|
+
const name = (0, import_enssdk11.asInterpretedName)(namespaceSpecific ?? managedName);
|
|
3430
|
+
const node = (0, import_enssdk11.namehashInterpretedName)(name);
|
|
3348
3431
|
const result = { name, node, registry: group.registry };
|
|
3349
3432
|
cache.set(cacheKey, result);
|
|
3350
3433
|
return result;
|
|
@@ -3356,7 +3439,7 @@ var getManagedName = (namespace, contract) => {
|
|
|
3356
3439
|
};
|
|
3357
3440
|
|
|
3358
3441
|
// src/shared/root-registry.ts
|
|
3359
|
-
var
|
|
3442
|
+
var import_enssdk12 = require("enssdk");
|
|
3360
3443
|
var import_datasources13 = require("@ensnode/datasources");
|
|
3361
3444
|
var getENSv1RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
3362
3445
|
|
|
@@ -3377,9 +3460,9 @@ var getBridgedResolverConfigs = (namespace) => {
|
|
|
3377
3460
|
const { node } = getManagedName(namespace, registry);
|
|
3378
3461
|
configs.push({
|
|
3379
3462
|
resolver,
|
|
3380
|
-
originDomainId: (0,
|
|
3463
|
+
originDomainId: (0, import_enssdk13.makeENSv1DomainId)(getENSv1RootRegistry(namespace), node),
|
|
3381
3464
|
targetRegistry: registry,
|
|
3382
|
-
targetRegistryId: (0,
|
|
3465
|
+
targetRegistryId: (0, import_enssdk13.makeENSv1VirtualRegistryId)(registry, node)
|
|
3383
3466
|
});
|
|
3384
3467
|
}
|
|
3385
3468
|
const lineanames = (0, import_datasources14.maybeGetDatasource)(namespace, import_datasources14.DatasourceNames.Lineanames);
|
|
@@ -3393,9 +3476,9 @@ var getBridgedResolverConfigs = (namespace) => {
|
|
|
3393
3476
|
const { node } = getManagedName(namespace, registry);
|
|
3394
3477
|
configs.push({
|
|
3395
3478
|
resolver,
|
|
3396
|
-
originDomainId: (0,
|
|
3479
|
+
originDomainId: (0, import_enssdk13.makeENSv1DomainId)(getENSv1RootRegistry(namespace), node),
|
|
3397
3480
|
targetRegistry: registry,
|
|
3398
|
-
targetRegistryId: (0,
|
|
3481
|
+
targetRegistryId: (0, import_enssdk13.makeENSv1VirtualRegistryId)(registry, node)
|
|
3399
3482
|
});
|
|
3400
3483
|
}
|
|
3401
3484
|
cache2.set(namespace, configs);
|