@ensnode/ensnode-sdk 0.0.0-next-20260421175626 → 0.0.0-next-20260421205557
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 +33 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -3
- package/dist/index.d.ts +81 -3
- package/dist/index.js +33 -4
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -162,7 +162,10 @@ __export(index_exports, {
|
|
|
162
162
|
hasSubgraphApiConfigSupport: () => hasSubgraphApiConfigSupport,
|
|
163
163
|
interpretAddress: () => interpretAddress,
|
|
164
164
|
interpretAddressRecordValue: () => interpretAddressRecordValue,
|
|
165
|
+
interpretContenthashValue: () => interpretContenthashValue,
|
|
166
|
+
interpretDnszonehashValue: () => interpretDnszonehashValue,
|
|
165
167
|
interpretNameRecordValue: () => interpretNameRecordValue,
|
|
168
|
+
interpretPubkeyValue: () => interpretPubkeyValue,
|
|
166
169
|
interpretTextRecordKey: () => interpretTextRecordKey,
|
|
167
170
|
interpretTextRecordValue: () => interpretTextRecordValue,
|
|
168
171
|
isENSv1Registry: () => isENSv1Registry,
|
|
@@ -3551,15 +3554,21 @@ var EnsNodeClient = class _EnsNodeClient {
|
|
|
3551
3554
|
*/
|
|
3552
3555
|
async resolveRecords(name, selection, options) {
|
|
3553
3556
|
const url = new URL(`/api/resolve/records/${encodeURIComponent(name)}`, this.options.url);
|
|
3554
|
-
if (selection.name)
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
+
if (selection.name) url.searchParams.set("name", "true");
|
|
3558
|
+
if (selection.contenthash) url.searchParams.set("contenthash", "true");
|
|
3559
|
+
if (selection.pubkey) url.searchParams.set("pubkey", "true");
|
|
3560
|
+
if (selection.dnszonehash) url.searchParams.set("dnszonehash", "true");
|
|
3561
|
+
if (selection.version) url.searchParams.set("version", "true");
|
|
3562
|
+
if (selection.abi !== void 0) url.searchParams.set("abi", selection.abi.toString());
|
|
3557
3563
|
if (selection.addresses && selection.addresses.length > 0) {
|
|
3558
3564
|
url.searchParams.set("addresses", selection.addresses.join(","));
|
|
3559
3565
|
}
|
|
3560
3566
|
if (selection.texts && selection.texts.length > 0) {
|
|
3561
3567
|
url.searchParams.set("texts", selection.texts.join(","));
|
|
3562
3568
|
}
|
|
3569
|
+
if (selection.interfaces && selection.interfaces.length > 0) {
|
|
3570
|
+
url.searchParams.set("interfaces", selection.interfaces.join(","));
|
|
3571
|
+
}
|
|
3563
3572
|
if (options?.trace) url.searchParams.set("trace", "true");
|
|
3564
3573
|
if (options?.accelerate) url.searchParams.set("accelerate", "true");
|
|
3565
3574
|
const response = await fetch(url);
|
|
@@ -3568,6 +3577,11 @@ var EnsNodeClient = class _EnsNodeClient {
|
|
|
3568
3577
|
throw ClientError.fromErrorResponse(error);
|
|
3569
3578
|
}
|
|
3570
3579
|
const data = await response.json();
|
|
3580
|
+
const records = data.records;
|
|
3581
|
+
if (typeof records.version === "string") records.version = BigInt(records.version);
|
|
3582
|
+
if (records.abi && typeof records.abi.contentType === "string") {
|
|
3583
|
+
records.abi.contentType = BigInt(records.abi.contentType);
|
|
3584
|
+
}
|
|
3571
3585
|
return data;
|
|
3572
3586
|
}
|
|
3573
3587
|
/**
|
|
@@ -4149,7 +4163,7 @@ var translateDefaultableChainIdToChainId = (chainId, namespaceId) => {
|
|
|
4149
4163
|
};
|
|
4150
4164
|
|
|
4151
4165
|
// src/resolution/resolver-records-selection.ts
|
|
4152
|
-
var isSelectionEmpty = (selection) => !selection.name && !selection.addresses?.length && !selection.texts?.length;
|
|
4166
|
+
var isSelectionEmpty = (selection) => !selection.name && !selection.addresses?.length && !selection.texts?.length && !selection.contenthash && !selection.pubkey && !selection.dnszonehash && selection.abi === void 0 && !selection.interfaces?.length && !selection.version;
|
|
4153
4167
|
|
|
4154
4168
|
// src/shared/cache/lru-cache.ts
|
|
4155
4169
|
var LruCache = class {
|
|
@@ -4531,6 +4545,21 @@ function interpretTextRecordValue(value) {
|
|
|
4531
4545
|
return value;
|
|
4532
4546
|
}
|
|
4533
4547
|
|
|
4548
|
+
// src/shared/interpretation/interpret-resolver-values.ts
|
|
4549
|
+
var import_viem11 = require("viem");
|
|
4550
|
+
function interpretContenthashValue(value) {
|
|
4551
|
+
if ((0, import_viem11.size)(value) === 0) return null;
|
|
4552
|
+
return value;
|
|
4553
|
+
}
|
|
4554
|
+
function interpretPubkeyValue(x, y) {
|
|
4555
|
+
if (x === import_viem11.zeroHash && y === import_viem11.zeroHash) return null;
|
|
4556
|
+
return { x, y };
|
|
4557
|
+
}
|
|
4558
|
+
function interpretDnszonehashValue(value) {
|
|
4559
|
+
if ((0, import_viem11.size)(value) === 0) return null;
|
|
4560
|
+
return value;
|
|
4561
|
+
}
|
|
4562
|
+
|
|
4534
4563
|
// src/shared/namespace-specific-value.ts
|
|
4535
4564
|
function getNamespaceSpecificValue(namespace, value) {
|
|
4536
4565
|
return value[namespace] ?? value.default;
|