enssdk 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.
@@ -1,4 +1,5 @@
1
- import { Hex as Hex$1, Address as Address$1 } from 'viem';
1
+ import { Hex } from 'viem';
2
+ import { H as Hex$1 } from './evm-D-quiIO8.js';
2
3
 
3
4
  /**
4
5
  * Base58Check-encoded Bitcoin address (SLIP-44 coin type 0).
@@ -57,7 +58,7 @@ type Email = string;
57
58
  * @see https://docs.ens.domains/ensip/1#namehash-algorithm
58
59
  * @see https://ensnode.io/docs/reference/terminology#name-node-namehash
59
60
  */
60
- type Node = Hex$1;
61
+ type Node = Hex;
61
62
  /**
62
63
  * An ENS Name that may or may not be normalized.
63
64
  *
@@ -78,7 +79,7 @@ type Name = string;
78
79
  * @see https://ensnode.io/docs/reference/terminology#labels-labelhashes-labelhash-function
79
80
  * @see https://ensnode.io/ensrainbow/concepts/glossary#labelhash
80
81
  */
81
- type LabelHash = Hex$1;
82
+ type LabelHash = Hex;
82
83
  /**
83
84
  * A LabelHashPath is an ordered list of LabelHashes that uniquely identify an ENS Name.
84
85
  * It is ordered in namegraph TRAVERSAL order (i.e. the opposite order of an ENS Name's labels).
@@ -290,7 +291,7 @@ type SubgraphInterpretedName = Name & {
290
291
  * cast the type of the event argument to a _nominally_ typed DNSEncodedName like {@link DNSEncodedLiteralName}
291
292
  * or {@link DNSEncodedPartiallyInterpretedName} depending on the context.
292
293
  */
293
- type DNSEncodedName = Hex$1;
294
+ type DNSEncodedName = Hex;
294
295
  /**
295
296
  * A DNSEncodedName that encodes a name containing 0 or more {@link LiteralLabel}s.
296
297
  *
@@ -467,100 +468,6 @@ type RenewalId = string & {
467
468
  */
468
469
  type CanonicalPath = DomainId[];
469
470
 
470
- /**
471
- * Represents a Hex string, in the format `0x{string}`.
472
- */
473
- type Hex = Hex$1;
474
- /**
475
- * Represents an EVM Address, in the format `0x{string}`, which may or may not be checksummed.
476
- */
477
- type Address = Address$1;
478
- /**
479
- * Represents a normalized (non-checksummed) EVM Address, in the format `0x{string}`, where all
480
- * characters are lowercase and length is exactly 42.
481
- *
482
- * @dev because the Address type is so widely used, nominally typing it would involve a _ton_ of
483
- * asNormalizedAddress() casts across the codebase. By avoiding the __brand, we can easily use
484
- * EventWithArgs<{ address: NormalizedAddress }> in all of the Ponder event handler args to
485
- * declare that the incoming event.args.address is a NormalizedAddress.
486
- */
487
- type NormalizedAddress = Address;
488
- /**
489
- * Unix timestamp value as bigint.
490
- *
491
- * Represents the number of seconds that have elapsed
492
- * since January 1, 1970 (midnight UTC/GMT).
493
- *
494
- * Guaranteed to be an integer. May be zero or negative to represent a time at or
495
- * before Jan 1, 1970.
496
- */
497
- type UnixTimestampBigInt = bigint;
498
- /**
499
- * Duration value as bigint.
500
- *
501
- * Representing a duration in seconds.
502
- *
503
- * Guaranteed to be a non-negative integer.
504
- */
505
- type DurationBigInt = bigint;
506
- /**
507
- * A value denominated in wei, the smallest unit of Ether (1 ETH = 10^18 wei).
508
- */
509
- type Wei = bigint;
510
- /**
511
- * Chain ID
512
- *
513
- * Represents a unique identifier for a chain.
514
- * Guaranteed to be a positive integer.
515
- *
516
- * Chain id standards are organized by the Ethereum Community @ https://github.com/ethereum-lists/chains
517
- **/
518
- type ChainId = number;
519
- /**
520
- * Defaultable Chain ID
521
- *
522
- * Represents a unique identifier for a chain, or
523
- * the default chain as defined by ENSIP-19.
524
- *
525
- * @see https://docs.ens.domains/ensip/19/#annex-supported-chains
526
- *
527
- * Guaranteed to be a non-negative integer.
528
- **/
529
- type DefaultableChainId = 0 | ChainId;
530
- /**
531
- * Represents an account (contract or EOA) at `address` on chain `chainId`.
532
- *
533
- * @see https://chainagnostic.org/CAIPs/caip-10
534
- */
535
- interface AccountId {
536
- chainId: ChainId;
537
- address: NormalizedAddress;
538
- }
539
- /**
540
- * An enum representing the possible CAIP-19 Asset Namespace values.
541
- *
542
- * @see https://chainagnostic.org/CAIPs/caip-19
543
- */
544
- declare const AssetNamespaces: {
545
- readonly ERC721: "erc721";
546
- readonly ERC1155: "erc1155";
547
- };
548
- type AssetNamespace = (typeof AssetNamespaces)[keyof typeof AssetNamespaces];
549
- /**
550
- * A uint256 value that identifies a specific NFT within a NFT contract.
551
- */
552
- type TokenId = bigint;
553
- /**
554
- * Represents an Asset in `assetNamespace` by `tokenId` in `contract`.
555
- *
556
- * @see https://chainagnostic.org/CAIPs/caip-19
557
- */
558
- interface AssetId {
559
- assetNamespace: AssetNamespace;
560
- contract: AccountId;
561
- tokenId: TokenId;
562
- }
563
-
564
471
  /**
565
472
  * ABI content type per ENSIP-4.
566
473
  *
@@ -578,7 +485,7 @@ type ContentType = bigint;
578
485
  *
579
486
  * @see https://github.com/ensdomains/ens-contracts/blob/91c966febd7b55494269df830fc6775f040b927b/contracts/resolvers/profiles/InterfaceResolver.sol
580
487
  */
581
- type InterfaceId = Hex;
488
+ type InterfaceId = Hex$1;
582
489
  /**
583
490
  * IVersionableResolver record version. Bumped by `VersionChanged`, which invalidates all prior
584
491
  * records for the node.
@@ -644,4 +551,4 @@ type AccountIdString = string;
644
551
  */
645
552
  type AssetIdString = string;
646
553
 
647
- export { type Email as $, type Address as A, type BeautifiedLabel as B, type ChainId as C, type DNSEncodedLiteralName as D, type ENSv1RegistryId as E, type AssetNamespace as F, AssetNamespaces as G, type BinanceAddress as H, type InterpretedLabel as I, type BitcoinAddress as J, type BitcoinCashAddress as K, type LiteralLabel as L, type CanonicalPath as M, type NormalizedAddress as N, type ChainIdString as O, type PermissionsId as P, type ContentType as Q, type RegistrationId as R, type StorageId as S, type TokenId as T, type UnindexedDomainId as U, type DNSEncodedPartiallyInterpretedName as V, type DatetimeISO8601 as W, type DefaultableChainId as X, type DogecoinAddress as Y, type Duration as Z, type DurationBigInt as _, type InterpretedName as a, type Hex as a0, type JsonValue as a1, type LitecoinAddress as a2, type MonacoinAddress as a3, type RecordVersion as a4, type RippleAddress as a5, type RootstockAddress as a6, type SolanaAddress as a7, type SubgraphInterpretedLabel as a8, type SubgraphInterpretedName as a9, type UnixTimestamp as aa, type UnixTimestampBigInt as ab, type UrlString as ac, type Wei as ad, type BeautifiedName as b, type AccountId as c, type AccountIdString as d, type AssetId as e, type AssetIdString as f, type Node as g, type DNSEncodedName as h, type Name as i, type ENSv2RegistryId as j, type ENSv1DomainId as k, type ENSv1VirtualRegistryId as l, type ENSv2DomainId as m, type PermissionsResourceId as n, type PermissionsUserId as o, type DomainId as p, type RenewalId as q, type ResolverId as r, type ResolverRecordsId as s, type LabelHash as t, type RegistryId as u, type InterfaceId as v, type Label as w, type LiteralName as x, type LabelHashPath as y, type EncodedLabelHash as z };
554
+ export type { UnixTimestamp as $, AccountIdString as A, BeautifiedLabel as B, CanonicalPath as C, DNSEncodedLiteralName as D, ENSv1RegistryId as E, ContentType as F, DNSEncodedPartiallyInterpretedName as G, DatetimeISO8601 as H, InterpretedLabel as I, DogecoinAddress as J, Duration as K, LiteralLabel as L, Email as M, Node as N, JsonValue as O, PermissionsId as P, LitecoinAddress as Q, RegistrationId as R, StorageId as S, MonacoinAddress as T, UnindexedDomainId as U, RecordVersion as V, RippleAddress as W, RootstockAddress as X, SolanaAddress as Y, SubgraphInterpretedLabel as Z, SubgraphInterpretedName as _, InterpretedName as a, UrlString as a0, BeautifiedName as b, AssetIdString as c, DNSEncodedName as d, Name as e, ENSv2RegistryId as f, ENSv1DomainId as g, ENSv1VirtualRegistryId as h, ENSv2DomainId as i, PermissionsResourceId as j, PermissionsUserId as k, DomainId as l, RenewalId as m, ResolverId as n, ResolverRecordsId as o, LabelHash as p, RegistryId as q, InterfaceId as r, Label as s, LiteralName as t, LabelHashPath as u, EncodedLabelHash as v, BinanceAddress as w, BitcoinAddress as x, BitcoinCashAddress as y, ChainIdString as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enssdk",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "type": "module",
5
5
  "description": "The foundational ENS development library",
6
6
  "license": "MIT",
@@ -28,6 +28,10 @@
28
28
  "types": "./dist/core/index.d.ts",
29
29
  "default": "./dist/core/index.js"
30
30
  },
31
+ "./efp": {
32
+ "types": "./dist/efp/index.d.ts",
33
+ "default": "./dist/efp/index.js"
34
+ },
31
35
  "./omnigraph": {
32
36
  "types": "./dist/omnigraph/index.d.ts",
33
37
  "default": "./dist/omnigraph/index.js"
@@ -56,7 +60,7 @@
56
60
  "typescript": "^5.7.3",
57
61
  "viem": "^2.50.3",
58
62
  "vitest": "^4.1.0",
59
- "@ensnode/shared-configs": "1.16.0"
63
+ "@ensnode/shared-configs": "1.17.0"
60
64
  },
61
65
  "scripts": {
62
66
  "prepublish": "tsup",
@@ -17,6 +17,11 @@ type Account {
17
17
  """
18
18
  domains(after: String, before: String, first: Int, last: Int, order: DomainsOrderInput, where: AccountDomainsWhereInput): AccountDomainsConnection
19
19
 
20
+ """
21
+ This Account's Ethereum Follow Protocol (EFP) presence: its lists, validated primary list, and account metadata. Null when the connected ENSIndexer does not have the `efp` plugin enabled.
22
+ """
23
+ efp: AccountEfp
24
+
20
25
  """
21
26
  All Events for which this Account is the HCA-aware `sender` (i.e. `Event.sender`).
22
27
  """
@@ -84,6 +89,81 @@ input AccountDomainsWhereInput {
84
89
  version: ENSProtocolVersion
85
90
  }
86
91
 
92
+ """An account's Ethereum Follow Protocol (EFP) presence."""
93
+ type AccountEfp {
94
+ """
95
+ The accounts that follow this account: those whose validated primary EFP list holds this account as a non-`block`/`mute` record.
96
+ """
97
+ followers(after: String, before: String, first: Int, last: Int): AccountEfpFollowersConnection
98
+
99
+ """
100
+ The accounts this account follows: the address records in its validated primary EFP list, excluding `block`/`mute`-tagged records. Empty when the account has no validated primary list.
101
+ """
102
+ following(after: String, before: String, first: Int, last: Int): AccountEfpFollowingConnection
103
+
104
+ """
105
+ The EFP lists this account is the `user` of (the lists representing it).
106
+ """
107
+ lists(after: String, before: String, first: Int, last: Int): AccountEfpListsConnection
108
+
109
+ """
110
+ Get one of this account's EFP account-metadata values by key (e.g. "primary-list").
111
+ """
112
+ metadata(key: String!): EfpAccountMetadata
113
+
114
+ """All of this account's EFP account-metadata entries."""
115
+ metadatas(after: String, before: String, first: Int, last: Int): AccountEfpMetadatasConnection
116
+
117
+ """
118
+ The account's validated primary EFP list: the list named by its `primary-list` metadata, returned only if that list's `user` role matches the account (the EFP two-step Primary List validation). Null if unset or unvalidated.
119
+ """
120
+ primaryList: EfpList
121
+ }
122
+
123
+ type AccountEfpFollowersConnection {
124
+ edges: [AccountEfpFollowersConnectionEdge!]!
125
+ pageInfo: PageInfo!
126
+ totalCount: Int!
127
+ }
128
+
129
+ type AccountEfpFollowersConnectionEdge {
130
+ cursor: String!
131
+ node: Account!
132
+ }
133
+
134
+ type AccountEfpFollowingConnection {
135
+ edges: [AccountEfpFollowingConnectionEdge!]!
136
+ pageInfo: PageInfo!
137
+ totalCount: Int!
138
+ }
139
+
140
+ type AccountEfpFollowingConnectionEdge {
141
+ cursor: String!
142
+ node: Account!
143
+ }
144
+
145
+ type AccountEfpListsConnection {
146
+ edges: [AccountEfpListsConnectionEdge!]!
147
+ pageInfo: PageInfo!
148
+ totalCount: Int!
149
+ }
150
+
151
+ type AccountEfpListsConnectionEdge {
152
+ cursor: String!
153
+ node: EfpList!
154
+ }
155
+
156
+ type AccountEfpMetadatasConnection {
157
+ edges: [AccountEfpMetadatasConnectionEdge!]!
158
+ pageInfo: PageInfo!
159
+ totalCount: Int!
160
+ }
161
+
162
+ type AccountEfpMetadatasConnectionEdge {
163
+ cursor: String!
164
+ node: EfpAccountMetadata!
165
+ }
166
+
87
167
  type AccountEventsConnection {
88
168
  edges: [AccountEventsConnectionEdge!]!
89
169
  pageInfo: PageInfo!
@@ -911,6 +991,191 @@ type ENSv2RegistryReservation implements Registration {
911
991
  unregistrant: Account
912
992
  }
913
993
 
994
+ """
995
+ An EFP `(address, key) -> value` account-metadata entry (e.g. "primary-list").
996
+ """
997
+ type EfpAccountMetadata {
998
+ """The account this metadata belongs to."""
999
+ address: Address!
1000
+
1001
+ """The CAIP-10 account id of the AccountMetadata contract."""
1002
+ contract: AccountId!
1003
+
1004
+ """When this metadata entry was first indexed (Unix timestamp, seconds)."""
1005
+ createdAt: BigInt!
1006
+ id: ID!
1007
+
1008
+ """The metadata key (UTF-8 string)."""
1009
+ key: String!
1010
+
1011
+ """When this metadata entry was last updated (Unix timestamp, seconds)."""
1012
+ updatedAt: BigInt!
1013
+
1014
+ """The metadata value (raw bytes)."""
1015
+ value: Hex!
1016
+ }
1017
+
1018
+ """An EFP list NFT (a ListRegistry token) and the records it holds."""
1019
+ type EfpList {
1020
+ """When this list was first indexed (Unix timestamp, seconds)."""
1021
+ createdAt: BigInt!
1022
+
1023
+ """The address allowed to administer this list."""
1024
+ manager: Address
1025
+
1026
+ """The list NFT's AccountId."""
1027
+ nft: AccountId!
1028
+
1029
+ """The current ERC-721 owner of the list NFT."""
1030
+ owner: Address!
1031
+
1032
+ """The records currently in this list (the addresses it follows)."""
1033
+ records(after: String, before: String, first: Int, last: Int): EfpListRecordsConnection
1034
+
1035
+ """
1036
+ The decoded onchain location of this list's records, or null if not known.
1037
+ """
1038
+ storageLocation: EfpListStorageLocation
1039
+
1040
+ """The ERC-721 TokenId of the list NFT."""
1041
+ tokenId: TokenId!
1042
+
1043
+ """When this list was last updated (Unix timestamp, seconds)."""
1044
+ updatedAt: BigInt!
1045
+
1046
+ """The address allowed to post records to this list."""
1047
+ user: Address
1048
+ }
1049
+
1050
+ """Identify an EFP list by its NFT token id."""
1051
+ input EfpListByInput {
1052
+ """The ERC-721 token id of the list NFT."""
1053
+ tokenId: TokenId!
1054
+ }
1055
+
1056
+ """
1057
+ A single record within an EFP list (an address it follows), with its tags.
1058
+ """
1059
+ type EfpListRecord {
1060
+ """
1061
+ The Account this record points to (its `recordData`). Always resolvable: an Account exists for any address (see `query.account`), so a record's target can always be walked into its ENS names and own EFP presence.
1062
+ """
1063
+ account: Account!
1064
+
1065
+ """
1066
+ The CAIP-10 account id of the ListRecords contract holding this record.
1067
+ """
1068
+ contract: AccountId!
1069
+
1070
+ """When this record was first indexed (Unix timestamp, seconds)."""
1071
+ createdAt: BigInt!
1072
+ id: ID!
1073
+
1074
+ """The EFP list this record belongs to."""
1075
+ list: EfpList
1076
+
1077
+ """
1078
+ Canonical record bytes (version | type | address), 0x-prefixed (exactly 22 bytes), with any trailing junk after the 20-byte address truncated.
1079
+ """
1080
+ record: Hex!
1081
+
1082
+ """
1083
+ The followed/target address (the record's 20-byte payload). EFP indexes only address records (recordType 1).
1084
+ """
1085
+ recordData: Address!
1086
+
1087
+ """The EFP record type (1 = address)."""
1088
+ recordType: Int!
1089
+
1090
+ """The list's storage slot (bytes32) within the ListRecords contract."""
1091
+ slot: Hex!
1092
+
1093
+ """UTF-8 tags attached to this record (e.g. "close-friend", "block")."""
1094
+ tags: [String!]!
1095
+ }
1096
+
1097
+ type EfpListRecordsConnection {
1098
+ edges: [EfpListRecordsConnectionEdge!]!
1099
+ pageInfo: PageInfo!
1100
+ totalCount: Int!
1101
+ }
1102
+
1103
+ type EfpListRecordsConnectionEdge {
1104
+ cursor: String!
1105
+ node: EfpListRecord!
1106
+ }
1107
+
1108
+ """Filter EFP list records."""
1109
+ input EfpListRecordsWhereInput {
1110
+ """
1111
+ The target address of an address record (recordType 1). Filtering by this answers 'which lists follow this address?'.
1112
+ """
1113
+ recordData: Address
1114
+
1115
+ """The EFP record type (1 = address)."""
1116
+ recordType: Int
1117
+ }
1118
+
1119
+ """
1120
+ The decoded onchain location of a list's records: a (chainId, ListRecords contract address, slot) tuple.
1121
+ """
1122
+ type EfpListStorageLocation {
1123
+ """The ListRecords contract address holding the list's records."""
1124
+ address: Address!
1125
+ chainId: ChainId!
1126
+
1127
+ """The list's storage slot (bytes32) within the ListRecords contract."""
1128
+ slot: Hex!
1129
+ }
1130
+
1131
+ """Filter EFP lists by their owner, user, or manager address."""
1132
+ input EfpListsWhereInput {
1133
+ """The address allowed to administer the list."""
1134
+ manager: Address
1135
+
1136
+ """The ERC-721 owner of the list NFT."""
1137
+ owner: Address
1138
+
1139
+ """The address allowed to post records."""
1140
+ user: Address
1141
+ }
1142
+
1143
+ """Queries for Ethereum Follow Protocol (EFP) data."""
1144
+ type EfpQuery {
1145
+ """Get an EFP list by its NFT token id."""
1146
+ list(by: EfpListByInput!): EfpList
1147
+
1148
+ """
1149
+ Find EFP list records. Filter by `recordData` to answer 'which lists follow this address?'.
1150
+ """
1151
+ listRecords(after: String, before: String, first: Int, last: Int, where: EfpListRecordsWhereInput): EfpQueryListRecordsConnection
1152
+
1153
+ """Find EFP lists, optionally filtered by owner / user / manager."""
1154
+ lists(after: String, before: String, first: Int, last: Int, where: EfpListsWhereInput): EfpQueryListsConnection
1155
+ }
1156
+
1157
+ type EfpQueryListRecordsConnection {
1158
+ edges: [EfpQueryListRecordsConnectionEdge!]!
1159
+ pageInfo: PageInfo!
1160
+ totalCount: Int!
1161
+ }
1162
+
1163
+ type EfpQueryListRecordsConnectionEdge {
1164
+ cursor: String!
1165
+ node: EfpListRecord!
1166
+ }
1167
+
1168
+ type EfpQueryListsConnection {
1169
+ edges: [EfpQueryListsConnectionEdge!]!
1170
+ pageInfo: PageInfo!
1171
+ totalCount: Int!
1172
+ }
1173
+
1174
+ type EfpQueryListsConnectionEdge {
1175
+ cursor: String!
1176
+ node: EfpList!
1177
+ }
1178
+
914
1179
  """Email represents a validated contact email address."""
915
1180
  scalar Email
916
1181
 
@@ -1520,6 +1785,11 @@ type Query {
1520
1785
  """
1521
1786
  domains(after: String, before: String, first: Int, last: Int, order: DomainsOrderInput, where: DomainsWhereInput!): QueryDomainsConnection
1522
1787
 
1788
+ """
1789
+ Ethereum Follow Protocol (EFP) queries. Null when the connected ENSIndexer does not have the `efp` plugin enabled.
1790
+ """
1791
+ efp: EfpQuery
1792
+
1523
1793
  """Identify Permissions by ID or AccountId."""
1524
1794
  permissions(by: PermissionsIdInput!): Permissions
1525
1795
 
@@ -2001,6 +2271,9 @@ type ThreeDNSRegistration implements Registration {
2001
2271
  unregistrant: Account
2002
2272
  }
2003
2273
 
2274
+ """TokenId represents an enssdk#TokenId."""
2275
+ scalar TokenId
2276
+
2004
2277
  """
2005
2278
  A resolvable-but-unindexed Domain: not present in the index, but resolvable because an ancestor in its namegraph path has an ENSIP-10 wildcard Resolver (e.g. off-chain / CCIP-Read names, unindexed 3DNS names, wildcard subnames).
2006
2279
  """