@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/internal.cjs CHANGED
@@ -61,6 +61,7 @@ __export(internal_exports, {
61
61
  interpretAddressRecordValue: () => interpretAddressRecordValue,
62
62
  interpretContenthashValue: () => interpretContenthashValue,
63
63
  interpretDnszonehashValue: () => interpretDnszonehashValue,
64
+ interpretMetadataKey: () => interpretMetadataKey,
64
65
  interpretNameRecordValue: () => interpretNameRecordValue,
65
66
  interpretPubkeyValue: () => interpretPubkeyValue,
66
67
  interpretTextRecordKey: () => interpretTextRecordKey,
@@ -3214,6 +3215,27 @@ var fixtures = {
3214
3215
  rawAddresses,
3215
3216
  textRecords: testEthTextRecords
3216
3217
  };
3218
+ var efpSeedTargets = {
3219
+ /** ADD + ADD_TAG("block") + ADD_TAG("block") -> tags === ["block"] (dedup). */
3220
+ dedup: (0, import_enssdk8.asNormalizedAddress)(`0x${"d1".repeat(20)}`),
3221
+ /** ADD + ADD_TAG("vip") + REMOVE + ADD -> record present, tags === [] (embed cascade + fresh). */
3222
+ cascade: (0, import_enssdk8.asNormalizedAddress)(`0x${"ca".repeat(20)}`),
3223
+ /** ADD + REMOVE(target + junk) -> record gone (canonical 22-byte keying). */
3224
+ junk: (0, import_enssdk8.asNormalizedAddress)(`0x${"1c".repeat(20)}`),
3225
+ /** Anchors a list whose `user` role must survive a storage-location re-point away and back. */
3226
+ durable: (0, import_enssdk8.asNormalizedAddress)(`0x${"d0".repeat(20)}`),
3227
+ /** Followed plainly by the validated {@link efpFollowActorAddress} list — a real follow. */
3228
+ followPlain: (0, import_enssdk8.asNormalizedAddress)(`0x${"f0".repeat(20)}`),
3229
+ /** Followed but `block`-tagged by that list — excluded from `following` / `followers`. */
3230
+ followBlocked: (0, import_enssdk8.asNormalizedAddress)(`0x${"fb".repeat(20)}`)
3231
+ };
3232
+ var efpSeedRoleUser = (0, import_enssdk8.asNormalizedAddress)(`0x${"ab".repeat(20)}`);
3233
+ var efpSeedActorAddress = (0, import_enssdk8.asNormalizedAddress)(
3234
+ "0x976ea74026e726554db657fa54763abd0c3a0aa9"
3235
+ );
3236
+ var efpFollowActorAddress = (0, import_enssdk8.asNormalizedAddress)(
3237
+ "0x14dc79964da2c08b23698b3d3cc7ca32193d9955"
3238
+ );
3217
3239
  var contenthashFixtures = {
3218
3240
  // CIDv0 input — decodes back to CIDv1
3219
3241
  ipfs: getRawContenthash("ipfs", "QmRAQB6YaCyidP37UdDnjFY5vQuiBrcqdyoW1CuDgwxkD4"),
@@ -3263,6 +3285,7 @@ var SEPOLIA_V2_ACCOUNT_WITH_V1_AND_V2 = (0, import_enssdk9.toNormalizedAddress)(
3263
3285
  var DEVNET_NAME_WITH_OWNED_RESOLVER = (0, import_enssdk9.asInterpretedName)("example.eth");
3264
3286
  var SEPOLIA_V2_NAME = (0, import_enssdk9.asInterpretedName)("roppp.eth");
3265
3287
  var VITALIK_NAME = (0, import_enssdk9.asInterpretedName)("vitalik.eth");
3288
+ var DPERRI_DNS_NAME = (0, import_enssdk9.asInterpretedName)("dperri.com");
3266
3289
  var GREG_NAME = (0, import_enssdk9.asInterpretedName)("gregskril.eth");
3267
3290
  var GREG_ADDRESS = (0, import_enssdk9.toNormalizedAddress)("0x179a862703a4adfb29896552df9e307980d19285");
3268
3291
  var OFFCHAIN_NAME = (0, import_enssdk9.asInterpretedName)("patricio.onpoap.eth");
@@ -3316,7 +3339,9 @@ var GRAPHQL_API_EXAMPLE_QUERIES = [
3316
3339
  }
3317
3340
 
3318
3341
  # Also load the count of ENSv1 and ENSv2 domains owned by the account
3319
- # to see if they have domains they should upgrade to ENSv2
3342
+ # to see if they have domains they should upgrade to ENSv2.
3343
+ # For simplicity this example query doesn't include additional logic
3344
+ # to filter out domains that have expired.
3320
3345
  v1DomainsCount: domains(where: { version: ENSv1 }) { totalCount }
3321
3346
  v2DomainsCount: domains(where: { version: ENSv2 }) { totalCount }
3322
3347
  }
@@ -3745,11 +3770,16 @@ query AccountPrimaryNames($address: Address!) {
3745
3770
  account(by: { address: $address }) {
3746
3771
  address
3747
3772
  resolve {
3773
+ # Reverse resolution: given this address + a chain, get the primary
3774
+ # name the address has set for that chain.
3775
+ # primaryName returns the result for a single chain (here, Optimism).
3776
+ # (onePrimaryName / twoPrimaryNames are just GraphQL aliases.)
3748
3777
  onePrimaryName: primaryName(by: { chainName: OPTIMISM }) {
3749
3778
  chainName
3750
3779
  name { interpreted beautified }
3751
3780
  }
3752
3781
 
3782
+ # primaryNames returns one result per requested chain, in a single call.
3753
3783
  twoPrimaryNames: primaryNames(where: { chainNames: [ETHEREUM, BASE] }) {
3754
3784
  chainName
3755
3785
  name { interpreted beautified }
@@ -3931,19 +3961,20 @@ query AccountResolverPermissions($address: Address!) {
3931
3961
  query DomainResolver($name: InterpretedName!) {
3932
3962
  domain(by: { name: $name }) {
3933
3963
  resolver {
3964
+ # the Resolver explicitly assigned to this Domain
3934
3965
  assigned {
3935
- contract {
3936
- address
3937
- }
3938
- events(first: 5) {
3939
- edges { node { topics data timestamp } }
3940
- }
3966
+ contract { address }
3967
+ }
3968
+ # the Resolver that ENS Forward Resolution (ENSIP-10) actually lands
3969
+ # on for this Domain \u2014 i.e. its effective Resolver
3970
+ effective {
3971
+ contract { address }
3941
3972
  }
3942
3973
  }
3943
3974
  }
3944
3975
  }`,
3945
3976
  variables: {
3946
- default: { name: VITALIK_NAME },
3977
+ default: { name: DPERRI_DNS_NAME },
3947
3978
  [import_datasources5.ENSNamespaceIds.EnsTestEnv]: { name: DEVNET_NAME_WITH_OWNED_RESOLVER },
3948
3979
  [import_datasources5.ENSNamespaceIds.SepoliaV2]: { name: SEPOLIA_V2_NAME }
3949
3980
  }
@@ -4012,6 +4043,9 @@ query Namegraph {
4012
4043
  query: `
4013
4044
  query AccountMigratedNames($address: Address!) {
4014
4045
  account(by: { address: $address }) {
4046
+ # Count the ENSv1 and ENSv2 domains owned by the account.
4047
+ # For simplicity this example query doesn't include additional logic
4048
+ # to filter out domains that have expired.
4015
4049
  v1DomainsCount: domains(where: { version: ENSv1 }) { totalCount }
4016
4050
  v2DomainsCount: domains(where: { version: ENSv2 }) { totalCount }
4017
4051
  }
@@ -4510,6 +4544,10 @@ function interpretTextRecordKey(key) {
4510
4544
  if (key === "") return null;
4511
4545
  return key;
4512
4546
  }
4547
+ function interpretMetadataKey(key) {
4548
+ if (hasNullByte(key)) return null;
4549
+ return key;
4550
+ }
4513
4551
  function interpretTextRecordValue(value) {
4514
4552
  if (hasNullByte(value)) return null;
4515
4553
  if (value === "") return null;