@ensnode/ensnode-sdk 0.0.0-next-20260427111730 → 0.0.0-next-20260428182432
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 +195 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -57
- package/dist/index.d.ts +59 -57
- package/dist/index.js +197 -116
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
DEFAULT_ENSNODE_URL_SEPOLIA: () => DEFAULT_ENSNODE_URL_SEPOLIA,
|
|
42
42
|
ENCODED_REFERRER_BYTE_LENGTH: () => ENCODED_REFERRER_BYTE_LENGTH,
|
|
43
43
|
ENCODED_REFERRER_BYTE_OFFSET: () => ENCODED_REFERRER_BYTE_OFFSET,
|
|
44
|
-
ENSNamespaceIds: () =>
|
|
44
|
+
ENSNamespaceIds: () => import_datasources11.ENSNamespaceIds,
|
|
45
45
|
EXPECTED_ENCODED_REFERRER_PADDING: () => EXPECTED_ENCODED_REFERRER_PADDING,
|
|
46
46
|
EnsApiIndexingStatusResponseCodes: () => EnsApiIndexingStatusResponseCodes,
|
|
47
47
|
EnsIndexerClient: () => EnsIndexerClient,
|
|
@@ -134,21 +134,17 @@ __export(index_exports, {
|
|
|
134
134
|
deserializedNameTokensResponse: () => deserializedNameTokensResponse,
|
|
135
135
|
durationBetween: () => durationBetween,
|
|
136
136
|
formatNFTTransferEventMetadata: () => formatNFTTransferEventMetadata,
|
|
137
|
-
getBasenamesSubregistryId: () => getBasenamesSubregistryId,
|
|
138
|
-
getBasenamesSubregistryManagedName: () => getBasenamesSubregistryManagedName,
|
|
139
137
|
getCurrencyInfo: () => getCurrencyInfo,
|
|
140
138
|
getDatasourceContract: () => getDatasourceContract,
|
|
141
139
|
getDefaultEnsNodeUrl: () => getDefaultEnsNodeUrl,
|
|
142
140
|
getENSRootChainId: () => import_datasources.getENSRootChainId,
|
|
143
141
|
getENSv1Registry: () => getENSv1Registry,
|
|
142
|
+
getENSv1RootRegistryId: () => getENSv1RootRegistryId,
|
|
144
143
|
getENSv2RootRegistry: () => getENSv2RootRegistry,
|
|
145
144
|
getENSv2RootRegistryId: () => getENSv2RootRegistryId,
|
|
146
|
-
getEthnamesSubregistryId: () => getEthnamesSubregistryId,
|
|
147
|
-
getEthnamesSubregistryManagedName: () => getEthnamesSubregistryManagedName,
|
|
148
145
|
getHighestKnownBlockTimestamp: () => getHighestKnownBlockTimestamp,
|
|
149
146
|
getLatestIndexedBlockRef: () => getLatestIndexedBlockRef,
|
|
150
|
-
|
|
151
|
-
getLineanamesSubregistryManagedName: () => getLineanamesSubregistryManagedName,
|
|
147
|
+
getManagedName: () => getManagedName,
|
|
152
148
|
getNFTTransferType: () => getNFTTransferType,
|
|
153
149
|
getNameTokenOwnership: () => getNameTokenOwnership,
|
|
154
150
|
getNameWrapperAccounts: () => getNameWrapperAccounts,
|
|
@@ -156,6 +152,8 @@ __export(index_exports, {
|
|
|
156
152
|
getOmnichainIndexingCursor: () => getOmnichainIndexingCursor,
|
|
157
153
|
getOmnichainIndexingStatus: () => getOmnichainIndexingStatus,
|
|
158
154
|
getResolvePrimaryNameChainIdParam: () => getResolvePrimaryNameChainIdParam,
|
|
155
|
+
getRootRegistryId: () => getRootRegistryId,
|
|
156
|
+
getRootRegistryIds: () => getRootRegistryIds,
|
|
159
157
|
getTimestampForHighestOmnichainKnownBlock: () => getTimestampForHighestOmnichainKnownBlock,
|
|
160
158
|
getTimestampForLowestOmnichainStartBlock: () => getTimestampForLowestOmnichainStartBlock,
|
|
161
159
|
hasNullByte: () => hasNullByte,
|
|
@@ -174,6 +172,7 @@ __export(index_exports, {
|
|
|
174
172
|
isENSv1Registry: () => isENSv1Registry,
|
|
175
173
|
isENSv2RootRegistry: () => isENSv2RootRegistry,
|
|
176
174
|
isHttpProtocol: () => isHttpProtocol,
|
|
175
|
+
isNameWrapper: () => isNameWrapper,
|
|
177
176
|
isPccFuseSet: () => isPccFuseSet,
|
|
178
177
|
isPriceCurrencyEqual: () => isPriceCurrencyEqual,
|
|
179
178
|
isPriceEqual: () => isPriceEqual,
|
|
@@ -262,7 +261,7 @@ __export(index_exports, {
|
|
|
262
261
|
validateSupportedLabelSetAndVersion: () => validateSupportedLabelSetAndVersion
|
|
263
262
|
});
|
|
264
263
|
module.exports = __toCommonJS(index_exports);
|
|
265
|
-
var
|
|
264
|
+
var import_datasources11 = require("@ensnode/datasources");
|
|
266
265
|
|
|
267
266
|
// src/ens/index.ts
|
|
268
267
|
var import_datasources = require("@ensnode/datasources");
|
|
@@ -4191,86 +4190,6 @@ function hasOmnigraphApiConfigSupport(config) {
|
|
|
4191
4190
|
};
|
|
4192
4191
|
}
|
|
4193
4192
|
|
|
4194
|
-
// src/registrars/basenames-subregistry.ts
|
|
4195
|
-
var import_enssdk8 = require("enssdk");
|
|
4196
|
-
var import_datasources7 = require("@ensnode/datasources");
|
|
4197
|
-
function getBasenamesSubregistryId(namespace) {
|
|
4198
|
-
const datasource = (0, import_datasources7.maybeGetDatasource)(namespace, import_datasources7.DatasourceNames.Basenames);
|
|
4199
|
-
if (!datasource) {
|
|
4200
|
-
throw new Error(`Datasource not found for ${namespace} ${import_datasources7.DatasourceNames.Basenames}`);
|
|
4201
|
-
}
|
|
4202
|
-
const address = datasource.contracts.BaseRegistrar?.address;
|
|
4203
|
-
if (address === void 0 || Array.isArray(address)) {
|
|
4204
|
-
throw new Error(`BaseRegistrar contract not found or has multiple addresses for ${namespace}`);
|
|
4205
|
-
}
|
|
4206
|
-
return { chainId: datasource.chain.id, address };
|
|
4207
|
-
}
|
|
4208
|
-
function getBasenamesSubregistryManagedName(namespaceId) {
|
|
4209
|
-
switch (namespaceId) {
|
|
4210
|
-
case import_datasources7.ENSNamespaceIds.Mainnet:
|
|
4211
|
-
return (0, import_enssdk8.asInterpretedName)("base.eth");
|
|
4212
|
-
case import_datasources7.ENSNamespaceIds.Sepolia:
|
|
4213
|
-
case import_datasources7.ENSNamespaceIds.SepoliaV2:
|
|
4214
|
-
return (0, import_enssdk8.asInterpretedName)("basetest.eth");
|
|
4215
|
-
case import_datasources7.ENSNamespaceIds.EnsTestEnv:
|
|
4216
|
-
throw new Error(
|
|
4217
|
-
`No registrar managed name is known for the 'basenames' subregistry within the "${namespaceId}" namespace.`
|
|
4218
|
-
);
|
|
4219
|
-
}
|
|
4220
|
-
}
|
|
4221
|
-
|
|
4222
|
-
// src/registrars/ethnames-subregistry.ts
|
|
4223
|
-
var import_enssdk9 = require("enssdk");
|
|
4224
|
-
var import_datasources8 = require("@ensnode/datasources");
|
|
4225
|
-
function getEthnamesSubregistryId(namespace) {
|
|
4226
|
-
const datasource = (0, import_datasources8.maybeGetDatasource)(namespace, import_datasources8.DatasourceNames.ENSRoot);
|
|
4227
|
-
if (!datasource) {
|
|
4228
|
-
throw new Error(`Datasource not found for ${namespace} ${import_datasources8.DatasourceNames.ENSRoot}`);
|
|
4229
|
-
}
|
|
4230
|
-
const address = datasource.contracts.BaseRegistrar?.address;
|
|
4231
|
-
if (address === void 0 || Array.isArray(address)) {
|
|
4232
|
-
throw new Error(`BaseRegistrar contract not found or has multiple addresses for ${namespace}`);
|
|
4233
|
-
}
|
|
4234
|
-
return { chainId: datasource.chain.id, address };
|
|
4235
|
-
}
|
|
4236
|
-
function getEthnamesSubregistryManagedName(namespaceId) {
|
|
4237
|
-
switch (namespaceId) {
|
|
4238
|
-
case import_datasources8.ENSNamespaceIds.Mainnet:
|
|
4239
|
-
case import_datasources8.ENSNamespaceIds.Sepolia:
|
|
4240
|
-
case import_datasources8.ENSNamespaceIds.SepoliaV2:
|
|
4241
|
-
case import_datasources8.ENSNamespaceIds.EnsTestEnv:
|
|
4242
|
-
return (0, import_enssdk9.asInterpretedName)("eth");
|
|
4243
|
-
}
|
|
4244
|
-
}
|
|
4245
|
-
|
|
4246
|
-
// src/registrars/lineanames-subregistry.ts
|
|
4247
|
-
var import_enssdk10 = require("enssdk");
|
|
4248
|
-
var import_datasources9 = require("@ensnode/datasources");
|
|
4249
|
-
function getLineanamesSubregistryId(namespace) {
|
|
4250
|
-
const datasource = (0, import_datasources9.maybeGetDatasource)(namespace, import_datasources9.DatasourceNames.Lineanames);
|
|
4251
|
-
if (!datasource) {
|
|
4252
|
-
throw new Error(`Datasource not found for ${namespace} ${import_datasources9.DatasourceNames.Lineanames}`);
|
|
4253
|
-
}
|
|
4254
|
-
const address = datasource.contracts.BaseRegistrar?.address;
|
|
4255
|
-
if (address === void 0 || Array.isArray(address)) {
|
|
4256
|
-
throw new Error(`BaseRegistrar contract not found or has multiple addresses for ${namespace}`);
|
|
4257
|
-
}
|
|
4258
|
-
return { chainId: datasource.chain.id, address };
|
|
4259
|
-
}
|
|
4260
|
-
function getLineanamesSubregistryManagedName(namespaceId) {
|
|
4261
|
-
switch (namespaceId) {
|
|
4262
|
-
case import_datasources9.ENSNamespaceIds.Mainnet:
|
|
4263
|
-
return (0, import_enssdk10.asInterpretedName)("linea.eth");
|
|
4264
|
-
case import_datasources9.ENSNamespaceIds.Sepolia:
|
|
4265
|
-
case import_datasources9.ENSNamespaceIds.SepoliaV2:
|
|
4266
|
-
return (0, import_enssdk10.asInterpretedName)("linea-sepolia.eth");
|
|
4267
|
-
case import_datasources9.ENSNamespaceIds.EnsTestEnv:
|
|
4268
|
-
throw new Error(
|
|
4269
|
-
`No registrar managed name is known for the 'Lineanames' subregistry within the "${namespaceId}" namespace.`
|
|
4270
|
-
);
|
|
4271
|
-
}
|
|
4272
|
-
}
|
|
4273
|
-
|
|
4274
4193
|
// src/registrars/registration-expiration.ts
|
|
4275
4194
|
function isRegistrationExpired(info, now) {
|
|
4276
4195
|
if (info.expiry == null) return false;
|
|
@@ -4287,15 +4206,15 @@ function isRegistrationInGracePeriod(info, now) {
|
|
|
4287
4206
|
}
|
|
4288
4207
|
|
|
4289
4208
|
// src/resolution/ensip19-chainid.ts
|
|
4290
|
-
var
|
|
4209
|
+
var import_enssdk8 = require("enssdk");
|
|
4291
4210
|
var import_chains = require("viem/chains");
|
|
4292
|
-
var
|
|
4211
|
+
var import_datasources7 = require("@ensnode/datasources");
|
|
4293
4212
|
var getResolvePrimaryNameChainIdParam = (chainId, namespaceId) => {
|
|
4294
|
-
const ensRootChainId = (0,
|
|
4213
|
+
const ensRootChainId = (0, import_datasources7.getENSRootChainId)(namespaceId);
|
|
4295
4214
|
return chainId === ensRootChainId ? import_chains.mainnet.id : chainId;
|
|
4296
4215
|
};
|
|
4297
4216
|
var translateDefaultableChainIdToChainId = (chainId, namespaceId) => {
|
|
4298
|
-
return chainId ===
|
|
4217
|
+
return chainId === import_enssdk8.DEFAULT_EVM_CHAIN_ID ? (0, import_datasources7.getENSRootChainId)(namespaceId) : chainId;
|
|
4299
4218
|
};
|
|
4300
4219
|
|
|
4301
4220
|
// src/resolution/resolver-records-selection.ts
|
|
@@ -4616,12 +4535,12 @@ var TtlCache = class {
|
|
|
4616
4535
|
};
|
|
4617
4536
|
|
|
4618
4537
|
// src/shared/config/indexed-blockranges.ts
|
|
4619
|
-
var
|
|
4538
|
+
var import_datasources8 = require("@ensnode/datasources");
|
|
4620
4539
|
function buildIndexedBlockranges(namespace, pluginsDatasourceNames) {
|
|
4621
4540
|
const indexedBlockranges = /* @__PURE__ */ new Map();
|
|
4622
4541
|
for (const [, datasourceNames] of pluginsDatasourceNames) {
|
|
4623
4542
|
for (const datasourceName of datasourceNames) {
|
|
4624
|
-
const datasource = (0,
|
|
4543
|
+
const datasource = (0, import_datasources8.maybeGetDatasource)(namespace, datasourceName);
|
|
4625
4544
|
if (!datasource) continue;
|
|
4626
4545
|
const datasourceChainId = datasource.chain.id;
|
|
4627
4546
|
const datasourceContracts = Object.values(datasource.contracts);
|
|
@@ -4649,7 +4568,7 @@ var import_viem9 = require("viem");
|
|
|
4649
4568
|
var interpretAddress = (owner) => (0, import_viem9.isAddressEqual)(import_viem9.zeroAddress, owner) ? null : owner;
|
|
4650
4569
|
|
|
4651
4570
|
// src/shared/interpretation/interpret-record-values.ts
|
|
4652
|
-
var
|
|
4571
|
+
var import_enssdk9 = require("enssdk");
|
|
4653
4572
|
var import_viem10 = require("viem");
|
|
4654
4573
|
|
|
4655
4574
|
// src/shared/null-bytes.ts
|
|
@@ -4659,7 +4578,7 @@ var stripNullBytes = (value) => value.replaceAll("\0", "");
|
|
|
4659
4578
|
// src/shared/interpretation/interpret-record-values.ts
|
|
4660
4579
|
function interpretNameRecordValue(value) {
|
|
4661
4580
|
if (value === "") return null;
|
|
4662
|
-
if (!(0,
|
|
4581
|
+
if (!(0, import_enssdk9.isInterpretedName)(value)) return null;
|
|
4663
4582
|
return value;
|
|
4664
4583
|
}
|
|
4665
4584
|
function interpretAddressRecordValue(value) {
|
|
@@ -4668,7 +4587,7 @@ function interpretAddressRecordValue(value) {
|
|
|
4668
4587
|
if (value === "0x") return null;
|
|
4669
4588
|
if (!(0, import_viem10.isAddress)(value, { strict: false })) return value;
|
|
4670
4589
|
if ((0, import_viem10.isAddressEqual)(value, import_viem10.zeroAddress)) return null;
|
|
4671
|
-
return (0,
|
|
4590
|
+
return (0, import_enssdk9.toNormalizedAddress)(value);
|
|
4672
4591
|
}
|
|
4673
4592
|
function interpretTextRecordKey(key) {
|
|
4674
4593
|
if (hasNullByte(key)) return null;
|
|
@@ -4696,6 +4615,150 @@ function interpretDnszonehashValue(value) {
|
|
|
4696
4615
|
return value;
|
|
4697
4616
|
}
|
|
4698
4617
|
|
|
4618
|
+
// src/shared/managed-names.ts
|
|
4619
|
+
var import_enssdk10 = require("enssdk");
|
|
4620
|
+
var import_datasources9 = require("@ensnode/datasources");
|
|
4621
|
+
|
|
4622
|
+
// src/shared/to-json.ts
|
|
4623
|
+
var toJson = (value, options) => JSON.stringify(
|
|
4624
|
+
value,
|
|
4625
|
+
(_key, val) => typeof val === "bigint" ? String(val) : val,
|
|
4626
|
+
options?.pretty ? 2 : void 0
|
|
4627
|
+
);
|
|
4628
|
+
|
|
4629
|
+
// src/shared/managed-names.ts
|
|
4630
|
+
var MANAGED_NAME_BY_NAMESPACE = {
|
|
4631
|
+
sepolia: {
|
|
4632
|
+
"base.eth": "basetest.eth",
|
|
4633
|
+
"linea.eth": "linea-sepolia.eth"
|
|
4634
|
+
}
|
|
4635
|
+
};
|
|
4636
|
+
var getContractsByManagedName = (namespace) => {
|
|
4637
|
+
const ensRootRegistry = getDatasourceContract(
|
|
4638
|
+
namespace,
|
|
4639
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4640
|
+
"ENSv1Registry"
|
|
4641
|
+
);
|
|
4642
|
+
const ensRootRegistryOld = getDatasourceContract(
|
|
4643
|
+
namespace,
|
|
4644
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4645
|
+
"ENSv1RegistryOld"
|
|
4646
|
+
);
|
|
4647
|
+
const ethnamesNameWrapper = getDatasourceContract(
|
|
4648
|
+
namespace,
|
|
4649
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4650
|
+
"NameWrapper"
|
|
4651
|
+
);
|
|
4652
|
+
const basenamesRegistry = maybeGetDatasourceContract(
|
|
4653
|
+
namespace,
|
|
4654
|
+
import_datasources9.DatasourceNames.Basenames,
|
|
4655
|
+
"Registry"
|
|
4656
|
+
);
|
|
4657
|
+
const lineanamesRegistry = maybeGetDatasourceContract(
|
|
4658
|
+
namespace,
|
|
4659
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4660
|
+
"Registry"
|
|
4661
|
+
);
|
|
4662
|
+
const lineanamesNameWrapper = maybeGetDatasourceContract(
|
|
4663
|
+
namespace,
|
|
4664
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4665
|
+
"NameWrapper"
|
|
4666
|
+
);
|
|
4667
|
+
return {
|
|
4668
|
+
[import_enssdk10.ENS_ROOT_NAME]: {
|
|
4669
|
+
registry: ensRootRegistry,
|
|
4670
|
+
contracts: [ensRootRegistry, ensRootRegistryOld]
|
|
4671
|
+
},
|
|
4672
|
+
eth: {
|
|
4673
|
+
registry: ensRootRegistry,
|
|
4674
|
+
contracts: [
|
|
4675
|
+
getDatasourceContract(namespace, import_datasources9.DatasourceNames.ENSRoot, "BaseRegistrar"),
|
|
4676
|
+
getDatasourceContract(namespace, import_datasources9.DatasourceNames.ENSRoot, "LegacyEthRegistrarController"),
|
|
4677
|
+
getDatasourceContract(namespace, import_datasources9.DatasourceNames.ENSRoot, "WrappedEthRegistrarController"),
|
|
4678
|
+
getDatasourceContract(
|
|
4679
|
+
namespace,
|
|
4680
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4681
|
+
"UnwrappedEthRegistrarController"
|
|
4682
|
+
),
|
|
4683
|
+
getDatasourceContract(
|
|
4684
|
+
namespace,
|
|
4685
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4686
|
+
"UniversalRegistrarRenewalWithReferrer"
|
|
4687
|
+
),
|
|
4688
|
+
ethnamesNameWrapper
|
|
4689
|
+
]
|
|
4690
|
+
},
|
|
4691
|
+
...basenamesRegistry && {
|
|
4692
|
+
"base.eth": {
|
|
4693
|
+
registry: basenamesRegistry,
|
|
4694
|
+
contracts: [
|
|
4695
|
+
basenamesRegistry,
|
|
4696
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Basenames, "BaseRegistrar"),
|
|
4697
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Basenames, "EARegistrarController"),
|
|
4698
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Basenames, "RegistrarController"),
|
|
4699
|
+
maybeGetDatasourceContract(
|
|
4700
|
+
namespace,
|
|
4701
|
+
import_datasources9.DatasourceNames.Basenames,
|
|
4702
|
+
"UpgradeableRegistrarController"
|
|
4703
|
+
)
|
|
4704
|
+
].filter((c) => !!c)
|
|
4705
|
+
}
|
|
4706
|
+
},
|
|
4707
|
+
...lineanamesRegistry && {
|
|
4708
|
+
"linea.eth": {
|
|
4709
|
+
registry: lineanamesRegistry,
|
|
4710
|
+
contracts: [
|
|
4711
|
+
lineanamesRegistry,
|
|
4712
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Lineanames, "BaseRegistrar"),
|
|
4713
|
+
maybeGetDatasourceContract(
|
|
4714
|
+
namespace,
|
|
4715
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4716
|
+
"EthRegistrarController"
|
|
4717
|
+
),
|
|
4718
|
+
lineanamesNameWrapper
|
|
4719
|
+
].filter((c) => !!c)
|
|
4720
|
+
}
|
|
4721
|
+
}
|
|
4722
|
+
};
|
|
4723
|
+
};
|
|
4724
|
+
var cache = /* @__PURE__ */ new Map();
|
|
4725
|
+
var getManagedName = (namespace, contract) => {
|
|
4726
|
+
const cacheKey = `${namespace}:${(0, import_enssdk10.stringifyAccountId)(contract)}`;
|
|
4727
|
+
const cached = cache.get(cacheKey);
|
|
4728
|
+
if (cached !== void 0) return cached;
|
|
4729
|
+
for (const [managedName, group] of Object.entries(getContractsByManagedName(namespace))) {
|
|
4730
|
+
const isAnyOfTheContracts = group.contracts.some(
|
|
4731
|
+
(_contract) => accountIdEqual(_contract, contract)
|
|
4732
|
+
);
|
|
4733
|
+
if (isAnyOfTheContracts) {
|
|
4734
|
+
const namespaceSpecific = MANAGED_NAME_BY_NAMESPACE[namespace]?.[managedName];
|
|
4735
|
+
const name = (0, import_enssdk10.asInterpretedName)(namespaceSpecific ?? managedName);
|
|
4736
|
+
const node = (0, import_enssdk10.namehashInterpretedName)(name);
|
|
4737
|
+
const result = { name, node, registry: group.registry };
|
|
4738
|
+
cache.set(cacheKey, result);
|
|
4739
|
+
return result;
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
throw new Error(
|
|
4743
|
+
`The following contract ${toJson(contract, { pretty: true })} does not have a configured Managed Name in namespace '${namespace}'.`
|
|
4744
|
+
);
|
|
4745
|
+
};
|
|
4746
|
+
var isNameWrapper = (namespace, contract) => {
|
|
4747
|
+
const ethnamesNameWrapper = getDatasourceContract(
|
|
4748
|
+
namespace,
|
|
4749
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4750
|
+
"NameWrapper"
|
|
4751
|
+
);
|
|
4752
|
+
if (accountIdEqual(ethnamesNameWrapper, contract)) return true;
|
|
4753
|
+
const lineanamesNameWrapper = maybeGetDatasourceContract(
|
|
4754
|
+
namespace,
|
|
4755
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4756
|
+
"NameWrapper"
|
|
4757
|
+
);
|
|
4758
|
+
if (lineanamesNameWrapper && accountIdEqual(lineanamesNameWrapper, contract)) return true;
|
|
4759
|
+
return false;
|
|
4760
|
+
};
|
|
4761
|
+
|
|
4699
4762
|
// src/shared/namespace-specific-value.ts
|
|
4700
4763
|
function getNamespaceSpecificValue(namespace, value) {
|
|
4701
4764
|
return value[namespace] ?? value.default;
|
|
@@ -4714,26 +4777,47 @@ var replaceBigInts = (obj, replacer) => {
|
|
|
4714
4777
|
};
|
|
4715
4778
|
|
|
4716
4779
|
// src/shared/root-registry.ts
|
|
4717
|
-
var
|
|
4718
|
-
var
|
|
4719
|
-
var getENSv1Registry = (namespace) => getDatasourceContract(namespace,
|
|
4780
|
+
var import_enssdk11 = require("enssdk");
|
|
4781
|
+
var import_datasources10 = require("@ensnode/datasources");
|
|
4782
|
+
var getENSv1Registry = (namespace) => getDatasourceContract(namespace, import_datasources10.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
4783
|
+
var getENSv1RootRegistryId = (namespace) => (0, import_enssdk11.makeENSv1RegistryId)(getENSv1Registry(namespace));
|
|
4720
4784
|
var isENSv1Registry = (namespace, contract) => accountIdEqual(getENSv1Registry(namespace), contract);
|
|
4721
|
-
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace,
|
|
4722
|
-
var getENSv2RootRegistryId = (namespace) => (0,
|
|
4785
|
+
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources10.DatasourceNames.ENSv2Root, "RootRegistry");
|
|
4786
|
+
var getENSv2RootRegistryId = (namespace) => (0, import_enssdk11.makeENSv2RegistryId)(getENSv2RootRegistry(namespace));
|
|
4723
4787
|
var isENSv2RootRegistry = (namespace, contract) => accountIdEqual(getENSv2RootRegistry(namespace), contract);
|
|
4724
|
-
var maybeGetENSv2RootRegistry = (namespace) => maybeGetDatasourceContract(namespace,
|
|
4788
|
+
var maybeGetENSv2RootRegistry = (namespace) => maybeGetDatasourceContract(namespace, import_datasources10.DatasourceNames.ENSv2Root, "RootRegistry");
|
|
4725
4789
|
var maybeGetENSv2RootRegistryId = (namespace) => {
|
|
4726
4790
|
const root = maybeGetENSv2RootRegistry(namespace);
|
|
4727
4791
|
if (!root) return void 0;
|
|
4728
|
-
return (0,
|
|
4792
|
+
return (0, import_enssdk11.makeENSv2RegistryId)(root);
|
|
4793
|
+
};
|
|
4794
|
+
var getRootRegistryId = (namespace) => maybeGetENSv2RootRegistryId(namespace) ?? getENSv1RootRegistryId(namespace);
|
|
4795
|
+
var getRootRegistryIds = (namespace) => {
|
|
4796
|
+
const v1RootRegistryId = getENSv1RootRegistryId(namespace);
|
|
4797
|
+
const v2RootRegistryId = maybeGetENSv2RootRegistryId(namespace);
|
|
4798
|
+
const basenamesRegistry = maybeGetDatasourceContract(
|
|
4799
|
+
namespace,
|
|
4800
|
+
import_datasources10.DatasourceNames.Basenames,
|
|
4801
|
+
"Registry"
|
|
4802
|
+
);
|
|
4803
|
+
const lineanamesRegistry = maybeGetDatasourceContract(
|
|
4804
|
+
namespace,
|
|
4805
|
+
import_datasources10.DatasourceNames.Lineanames,
|
|
4806
|
+
"Registry"
|
|
4807
|
+
);
|
|
4808
|
+
return [
|
|
4809
|
+
v1RootRegistryId,
|
|
4810
|
+
basenamesRegistry && (0, import_enssdk11.makeENSv1VirtualRegistryId)(
|
|
4811
|
+
basenamesRegistry,
|
|
4812
|
+
getManagedName(namespace, basenamesRegistry).node
|
|
4813
|
+
),
|
|
4814
|
+
lineanamesRegistry && (0, import_enssdk11.makeENSv1VirtualRegistryId)(
|
|
4815
|
+
lineanamesRegistry,
|
|
4816
|
+
getManagedName(namespace, lineanamesRegistry).node
|
|
4817
|
+
),
|
|
4818
|
+
v2RootRegistryId
|
|
4819
|
+
].filter((id) => !!id);
|
|
4729
4820
|
};
|
|
4730
|
-
|
|
4731
|
-
// src/shared/to-json.ts
|
|
4732
|
-
var toJson = (value, options) => JSON.stringify(
|
|
4733
|
-
value,
|
|
4734
|
-
(_key, val) => typeof val === "bigint" ? String(val) : val,
|
|
4735
|
-
options?.pretty ? 2 : void 0
|
|
4736
|
-
);
|
|
4737
4821
|
|
|
4738
4822
|
// src/shared/url.ts
|
|
4739
4823
|
function isHttpProtocol(url) {
|