@ensnode/ensnode-sdk 1.16.0 → 1.17.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 +17 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +46 -8
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +46 -8
- package/dist/internal.js.map +1 -1
- package/dist/{namespace-specific-value-BBZET9O0.d.cts → namespace-specific-value-C9XIUp1F.d.cts} +15 -2
- package/dist/{namespace-specific-value-BBZET9O0.d.ts → namespace-specific-value-C9XIUp1F.d.ts} +15 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -173,6 +173,7 @@ __export(index_exports, {
|
|
|
173
173
|
interpretAddressRecordValue: () => interpretAddressRecordValue,
|
|
174
174
|
interpretContenthashValue: () => interpretContenthashValue,
|
|
175
175
|
interpretDnszonehashValue: () => interpretDnszonehashValue,
|
|
176
|
+
interpretMetadataKey: () => interpretMetadataKey,
|
|
176
177
|
interpretNameRecordValue: () => interpretNameRecordValue,
|
|
177
178
|
interpretPubkeyValue: () => interpretPubkeyValue,
|
|
178
179
|
interpretTextRecordKey: () => interpretTextRecordKey,
|
|
@@ -641,6 +642,7 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
|
641
642
|
PluginName2["TokenScope"] = "tokenscope";
|
|
642
643
|
PluginName2["ENSv2"] = "ensv2";
|
|
643
644
|
PluginName2["Unigraph"] = "unigraph";
|
|
645
|
+
PluginName2["EFP"] = "efp";
|
|
644
646
|
return PluginName2;
|
|
645
647
|
})(PluginName || {});
|
|
646
648
|
|
|
@@ -4428,11 +4430,11 @@ function hasBackfillCompleted(indexingStatus) {
|
|
|
4428
4430
|
|
|
4429
4431
|
// src/omnigraph-api/prerequisites.ts
|
|
4430
4432
|
function hasOmnigraphApiConfigSupport(config) {
|
|
4431
|
-
const supported = config.plugins.includes("unigraph" /* Unigraph */) || config.plugins.includes("ensv2" /* ENSv2 */);
|
|
4433
|
+
const supported = config.plugins.includes("unigraph" /* Unigraph */) || config.plugins.includes("ensv2" /* ENSv2 */) || config.plugins.includes("efp" /* EFP */);
|
|
4432
4434
|
if (supported) return { supported };
|
|
4433
4435
|
return {
|
|
4434
4436
|
supported: false,
|
|
4435
|
-
reason: `The connected ENSNode's Config must have the '${"unigraph" /* Unigraph */}'
|
|
4437
|
+
reason: `The connected ENSNode's Config must have one of the '${"unigraph" /* Unigraph */}', '${"ensv2" /* ENSv2 */}', or '${"efp" /* EFP */}' plugins enabled.`
|
|
4436
4438
|
};
|
|
4437
4439
|
}
|
|
4438
4440
|
function hasOmnigraphApiIndexingStatusSupport(indexingStatus) {
|
|
@@ -4446,7 +4448,7 @@ function isRegistrationExpired(info, now) {
|
|
|
4446
4448
|
}
|
|
4447
4449
|
function isRegistrationFullyExpired(info, now) {
|
|
4448
4450
|
if (info.expiry == null) return false;
|
|
4449
|
-
return now
|
|
4451
|
+
return now > info.expiry + (info.gracePeriod ?? 0n);
|
|
4450
4452
|
}
|
|
4451
4453
|
function isRegistrationInGracePeriod(info, now) {
|
|
4452
4454
|
if (info.expiry == null) return false;
|
|
@@ -4820,7 +4822,7 @@ var TtlCache = class {
|
|
|
4820
4822
|
|
|
4821
4823
|
// src/shared/config/indexed-blockranges.ts
|
|
4822
4824
|
var import_datasources8 = require("@ensnode/datasources");
|
|
4823
|
-
function buildIndexedBlockranges(namespace,
|
|
4825
|
+
function buildIndexedBlockranges(namespace, chainEndBlocks, pluginsDatasourceNames) {
|
|
4824
4826
|
const indexedBlockranges = /* @__PURE__ */ new Map();
|
|
4825
4827
|
for (const [, datasourceNames] of pluginsDatasourceNames) {
|
|
4826
4828
|
for (const datasourceName of datasourceNames) {
|
|
@@ -4828,14 +4830,19 @@ function buildIndexedBlockranges(namespace, globalBlockrangeEndBlock, pluginsDat
|
|
|
4828
4830
|
if (!datasource) continue;
|
|
4829
4831
|
const datasourceChainId = datasource.chain.id;
|
|
4830
4832
|
const datasourceContracts = Object.values(datasource.contracts);
|
|
4833
|
+
const chainEndBlock = chainEndBlocks.get(datasourceChainId);
|
|
4831
4834
|
for (const datasourceContract of datasourceContracts) {
|
|
4832
4835
|
const currentChainIndexedBlockrange = indexedBlockranges.get(datasourceChainId);
|
|
4833
|
-
if (typeof
|
|
4836
|
+
if (typeof chainEndBlock === "number" && datasourceContract.startBlock > chainEndBlock) {
|
|
4834
4837
|
continue;
|
|
4835
4838
|
}
|
|
4839
|
+
const effectiveEndBlock = Math.min(
|
|
4840
|
+
datasourceContract.endBlock ?? Infinity,
|
|
4841
|
+
chainEndBlock ?? Infinity
|
|
4842
|
+
);
|
|
4836
4843
|
const contractIndexedBlockrange = buildBlockNumberRange(
|
|
4837
4844
|
datasourceContract.startBlock,
|
|
4838
|
-
|
|
4845
|
+
Number.isFinite(effectiveEndBlock) ? effectiveEndBlock : void 0
|
|
4839
4846
|
);
|
|
4840
4847
|
const indexedBlockrange = currentChainIndexedBlockrange ? mergeBlockNumberRanges(currentChainIndexedBlockrange, contractIndexedBlockrange) : contractIndexedBlockrange;
|
|
4841
4848
|
if (indexedBlockrange.rangeType !== RangeTypeIds.LeftBounded && indexedBlockrange.rangeType !== RangeTypeIds.Bounded) {
|
|
@@ -4880,6 +4887,10 @@ function interpretTextRecordKey(key) {
|
|
|
4880
4887
|
if (key === "") return null;
|
|
4881
4888
|
return key;
|
|
4882
4889
|
}
|
|
4890
|
+
function interpretMetadataKey(key) {
|
|
4891
|
+
if (hasNullByte(key)) return null;
|
|
4892
|
+
return key;
|
|
4893
|
+
}
|
|
4883
4894
|
function interpretTextRecordValue(value) {
|
|
4884
4895
|
if (hasNullByte(value)) return null;
|
|
4885
4896
|
if (value === "") return null;
|