@ensnode/ensdb-sdk 1.9.0 → 1.10.1

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,5 +1,5 @@
1
- export { b as account, c as account_relations, d as domainEvent, e as domainResolverRelation, f as domainResolverRelation_relations, g as event, i as internal_registrarActionMetadata, h as internal_registrarActionMetadataType, l as label, j as label_relations, k as latestRegistrationIndex, m as latestRenewalIndex, n as migratedNode, o as nameSales, p as nameTokens, q as permissions, r as permissionsEvent, s as permissionsResource, t as permissionsUser, u as registrarActionRelations, v as registrarActionType, w as registrarActions, x as registration, y as registrationLifecycleRelations, z as registrationLifecycles, A as registrationType, B as registration_relations, C as registry, D as registryCanonicalDomain, E as relations_permissions, F as relations_permissionsResource, G as relations_permissionsUser, H as relations_registry, I as relations_v1Domain, J as relations_v2Domain, K as renewal, L as renewal_relations, M as resolver, N as resolverAddressRecord, O as resolverAddressRecordRelations, P as resolverEvent, Q as resolverRecords, R as resolverRecords_relations, S as resolverTextRecord, T as resolverTextRecordRelations, U as resolver_relations, V as reverseNameRecord, W as subgraph_abiChanged, X as subgraph_abiChangedRelations, Y as subgraph_account, Z as subgraph_accountRelations, _ as subgraph_addrChanged, $ as subgraph_addrChangedRelations, a0 as subgraph_authorisationChanged, a1 as subgraph_authorisationChangedRelations, a2 as subgraph_contenthashChanged, a3 as subgraph_contenthashChangedRelations, a4 as subgraph_domain, a5 as subgraph_domainRelations, a6 as subgraph_expiryExtended, a7 as subgraph_expiryExtendedRelations, a8 as subgraph_fusesSet, a9 as subgraph_fusesSetRelations, aa as subgraph_interfaceChanged, ab as subgraph_interfaceChangedRelations, ac as subgraph_multicoinAddrChanged, ad as subgraph_multicoinAddrChangedRelations, ae as subgraph_nameChanged, af as subgraph_nameChangedRelations, ag as subgraph_nameRegistered, ah as subgraph_nameRegisteredRelations, ai as subgraph_nameRenewed, aj as subgraph_nameRenewedRelations, ak as subgraph_nameTransferred, al as subgraph_nameTransferredRelations, am as subgraph_nameUnwrapped, an as subgraph_nameUnwrappedRelations, ao as subgraph_nameWrapped, ap as subgraph_nameWrappedRelations, aq as subgraph_newOwner, ar as subgraph_newOwnerRelations, as as subgraph_newResolver, at as subgraph_newResolverRelations, au as subgraph_newTTL, av as subgraph_newTTLRelations, aw as subgraph_pubkeyChanged, ax as subgraph_pubkeyChangedRelations, ay as subgraph_registration, az as subgraph_registrationRelations, aA as subgraph_resolver, aB as subgraph_resolverRelations, aC as subgraph_textChanged, aD as subgraph_textChangedRelations, aE as subgraph_transfer, aF as subgraph_transferRelations, aG as subgraph_versionChanged, aH as subgraph_versionChangedRelations, aI as subgraph_wrappedDomain, aJ as subgraph_wrappedDomainRelations, aK as subgraph_wrappedTransfer, aL as subgraph_wrappedTransferRelations, aM as subregistries, aN as subregistryRelations, aO as v1Domain, aP as v2Domain } from '../index-CUYtpVSw.js';
1
+ export { b as account, c as account_relations, d as domainEvent, e as domainResolverRelation, f as domainResolverRelation_relations, g as event, i as internal_registrarActionMetadata, h as internal_registrarActionMetadataType, l as label, j as label_relations, k as latestRegistrationIndex, m as latestRenewalIndex, n as migratedNode, o as nameSales, p as nameTokens, q as permissions, r as permissionsEvent, s as permissionsResource, t as permissionsUser, u as registrarActionRelations, v as registrarActionType, w as registrarActions, x as registration, y as registrationLifecycleRelations, z as registrationLifecycles, A as registrationType, B as registration_relations, C as registry, D as registryCanonicalDomain, E as relations_permissions, F as relations_permissionsResource, G as relations_permissionsUser, H as relations_registry, I as relations_v1Domain, J as relations_v2Domain, K as renewal, L as renewal_relations, M as resolver, N as resolverAddressRecord, O as resolverAddressRecordRelations, P as resolverEvent, Q as resolverRecords, R as resolverRecords_relations, S as resolverTextRecord, T as resolverTextRecordRelations, U as resolver_relations, V as reverseNameRecord, W as subgraph_abiChanged, X as subgraph_abiChangedRelations, Y as subgraph_account, Z as subgraph_accountRelations, _ as subgraph_addrChanged, $ as subgraph_addrChangedRelations, a0 as subgraph_authorisationChanged, a1 as subgraph_authorisationChangedRelations, a2 as subgraph_contenthashChanged, a3 as subgraph_contenthashChangedRelations, a4 as subgraph_domain, a5 as subgraph_domainRelations, a6 as subgraph_expiryExtended, a7 as subgraph_expiryExtendedRelations, a8 as subgraph_fusesSet, a9 as subgraph_fusesSetRelations, aa as subgraph_interfaceChanged, ab as subgraph_interfaceChangedRelations, ac as subgraph_multicoinAddrChanged, ad as subgraph_multicoinAddrChangedRelations, ae as subgraph_nameChanged, af as subgraph_nameChangedRelations, ag as subgraph_nameRegistered, ah as subgraph_nameRegisteredRelations, ai as subgraph_nameRenewed, aj as subgraph_nameRenewedRelations, ak as subgraph_nameTransferred, al as subgraph_nameTransferredRelations, am as subgraph_nameUnwrapped, an as subgraph_nameUnwrappedRelations, ao as subgraph_nameWrapped, ap as subgraph_nameWrappedRelations, aq as subgraph_newOwner, ar as subgraph_newOwnerRelations, as as subgraph_newResolver, at as subgraph_newResolverRelations, au as subgraph_newTTL, av as subgraph_newTTLRelations, aw as subgraph_pubkeyChanged, ax as subgraph_pubkeyChangedRelations, ay as subgraph_registration, az as subgraph_registrationRelations, aA as subgraph_resolver, aB as subgraph_resolverRelations, aC as subgraph_textChanged, aD as subgraph_textChangedRelations, aE as subgraph_transfer, aF as subgraph_transferRelations, aG as subgraph_versionChanged, aH as subgraph_versionChangedRelations, aI as subgraph_wrappedDomain, aJ as subgraph_wrappedDomainRelations, aK as subgraph_wrappedTransfer, aL as subgraph_wrappedTransferRelations, aM as subregistries, aN as subregistryRelations, aO as v1Domain, aP as v2Domain } from '../index-DN0SGSyd.js';
2
2
  import 'drizzle-orm/pg-core';
3
3
  import 'drizzle-orm';
4
4
  import 'ponder';
5
- import '@ensnode/ensnode-sdk';
5
+ import 'enssdk';
@@ -188,15 +188,16 @@ var registrationType = onchainEnum("RegistrationType", [
188
188
  "NameWrapper",
189
189
  "BaseRegistrar",
190
190
  "ThreeDNS",
191
- "ENSv2Registry"
191
+ "ENSv2RegistryRegistration",
192
+ "ENSv2RegistryReservation"
192
193
  ]);
193
194
  var registration = onchainTable(
194
195
  "registrations",
195
196
  (t) => ({
196
- // keyed by (domainId, index)
197
+ // keyed by (domainId, registrationIndex)
197
198
  id: t.text().primaryKey().$type(),
198
199
  domainId: t.text().notNull().$type(),
199
- index: t.integer().notNull(),
200
+ registrationIndex: t.integer().notNull(),
200
201
  // has a type
201
202
  type: registrationType().notNull(),
202
203
  // has a start
@@ -208,9 +209,11 @@ var registration = onchainTable(
208
209
  // registrar AccountId
209
210
  registrarChainId: t.integer().notNull().$type(),
210
211
  registrarAddress: t.hex().notNull().$type(),
211
- // references registrant
212
+ // may reference a registrant
212
213
  registrantId: t.hex().$type(),
213
- // may have a referrer
214
+ // may reference an unregistrant
215
+ unregistrantId: t.hex().$type(),
216
+ // may have referrer data
214
217
  referrer: t.hex().$type(),
215
218
  // may have fuses (NameWrapper, Wrapped BaseRegistrar)
216
219
  fuses: t.integer(),
@@ -225,12 +228,12 @@ var registration = onchainTable(
225
228
  eventId: t.text().notNull()
226
229
  }),
227
230
  (t) => ({
228
- byId: uniqueIndex().on(t.domainId, t.index)
231
+ byId: uniqueIndex().on(t.domainId, t.registrationIndex)
229
232
  })
230
233
  );
231
234
  var latestRegistrationIndex = onchainTable("latest_registration_indexes", (t) => ({
232
235
  domainId: t.text().primaryKey().$type(),
233
- index: t.integer().notNull()
236
+ registrationIndex: t.integer().notNull()
234
237
  }));
235
238
  var registration_relations = relations(registration, ({ one, many }) => ({
236
239
  // belongs to either v1Domain or v2Domain
@@ -248,6 +251,12 @@ var registration_relations = relations(registration, ({ one, many }) => ({
248
251
  references: [account.id],
249
252
  relationName: "registrant"
250
253
  }),
254
+ // has one unregistrant
255
+ unregistrant: one(account, {
256
+ fields: [registration.unregistrantId],
257
+ references: [account.id],
258
+ relationName: "unregistrant"
259
+ }),
251
260
  // has many renewals
252
261
  renewals: many(renewal),
253
262
  // has an event
@@ -263,7 +272,7 @@ var renewal = onchainTable(
263
272
  id: t.text().primaryKey().$type(),
264
273
  domainId: t.text().notNull().$type(),
265
274
  registrationIndex: t.integer().notNull(),
266
- index: t.integer().notNull(),
275
+ renewalIndex: t.integer().notNull(),
267
276
  // all renewals have a duration
268
277
  duration: t.bigint().notNull(),
269
278
  // may have a referrer
@@ -277,14 +286,14 @@ var renewal = onchainTable(
277
286
  eventId: t.text().notNull()
278
287
  }),
279
288
  (t) => ({
280
- byId: uniqueIndex().on(t.domainId, t.registrationIndex, t.index)
289
+ byId: uniqueIndex().on(t.domainId, t.registrationIndex, t.renewalIndex)
281
290
  })
282
291
  );
283
292
  var renewal_relations = relations(renewal, ({ one }) => ({
284
293
  // belongs to registration
285
294
  registration: one(registration, {
286
295
  fields: [renewal.domainId, renewal.registrationIndex],
287
- references: [registration.domainId, registration.index]
296
+ references: [registration.domainId, registration.registrationIndex]
288
297
  }),
289
298
  // has an event
290
299
  event: one(event, {
@@ -297,7 +306,7 @@ var latestRenewalIndex = onchainTable(
297
306
  (t) => ({
298
307
  domainId: t.text().notNull().$type(),
299
308
  registrationIndex: t.integer().notNull(),
300
- index: t.integer().notNull()
309
+ renewalIndex: t.integer().notNull()
301
310
  }),
302
311
  (t) => ({ pk: primaryKey({ columns: [t.domainId, t.registrationIndex] }) })
303
312
  );
@@ -396,13 +405,9 @@ var reverseNameRecord = onchainTable2(
396
405
  /**
397
406
  * Represents the ENSIP-19 Reverse Name Record for a given (address, coinType).
398
407
  *
399
- * The value of this field is guaranteed to be a non-empty-string normalized ENS name (see
400
- * `interpretNameRecordValue` for additional context and specific guarantees). Unnormalized
401
- * names and empty string values are interpreted as a deletion of the associated Reverse Name
402
- * Record entity (represented in the schema as the _absence_ of a relevant Reverse Name Record
403
- * entity).
408
+ * The value of this field is guaranteed to be a non-empty {@link InterpretedName}.
404
409
  */
405
- value: t.text().notNull()
410
+ value: t.text().notNull().$type()
406
411
  }),
407
412
  (t) => ({
408
413
  pk: primaryKey2({ columns: [t.address, t.coinType] })
@@ -455,14 +460,30 @@ var resolverRecords = onchainTable2(
455
460
  /**
456
461
  * Represents the value of the reverse-resolution (ENSIP-3) name() record, used for Reverse Resolution.
457
462
  *
458
- * The emitted record values are interpreted according to `interpretNameRecordValue` unnormalized
459
- * names and empty string values are interpreted as a deletion of the associated record (represented
460
- * here as `null`).
463
+ * If present, the value of this field is guaranteed to be a non-empty {@link InterpretedName}.
464
+ */
465
+ name: t.text().$type(),
466
+ /**
467
+ * ENSIP-7 contenthash raw bytes or null if not set.
468
+ */
469
+ contenthash: t.hex(),
470
+ /**
471
+ * PubkeyResolver (x, y) pair, or null if not set.
461
472
  *
462
- * If set, the value of this field is guaranteed to be a non-empty-string normalized ENS name
463
- * (see `interpretNameRecordValue` for additional context and specific guarantees).
473
+ * Invariant: both null together, or both set together.
464
474
  */
465
- name: t.text()
475
+ pubkeyX: t.hex(),
476
+ pubkeyY: t.hex(),
477
+ /**
478
+ * IDNSZoneResolver zonehash or null if not set.
479
+ */
480
+ dnszonehash: t.hex(),
481
+ /**
482
+ * IVersionableResolver version. Null when no `VersionChanged` event has been seen for this
483
+ * (chainId, address, node) — the resolver may not implement `IVersionableResolver`, or simply
484
+ * may never have been version-bumped. Consumers should treat null as "unknown" rather than 0.
485
+ */
486
+ version: t.bigint().$type()
466
487
  }),
467
488
  (t) => ({
468
489
  byId: uniqueIndex2().on(t.chainId, t.address, t.node)
@@ -540,7 +561,7 @@ var resolverTextRecordRelations = relations2(resolverTextRecord, ({ one }) => ({
540
561
  })
541
562
  }));
542
563
  var migratedNode = onchainTable2("migrated_nodes", (t) => ({
543
- node: t.hex().primaryKey()
564
+ node: t.hex().primaryKey().$type()
544
565
  }));
545
566
 
546
567
  // src/ensindexer-abstract/registrars.schema.ts
@@ -807,7 +828,7 @@ var registrarActions = onchainTable3(
807
828
  * 3) May be the "zero address" to represent that an `encodedReferrer` is
808
829
  * defined but that it is interpreted as no referrer.
809
830
  */
810
- decodedReferrer: t.hex(),
831
+ decodedReferrer: t.hex().$type(),
811
832
  /**
812
833
  * Number of the block that includes the "logical registrar action".
813
834
  *
@@ -921,7 +942,7 @@ var registrarActionRelations = relations3(registrarActions, ({ one }) => ({
921
942
  }));
922
943
 
923
944
  // src/ensindexer-abstract/subgraph.schema.ts
924
- import { index as index3, onchainTable as onchainTable4, relations as relations4 } from "ponder";
945
+ import { index as index3, onchainTable as onchainTable4, relations as relations4, sql as sql2 } from "ponder";
925
946
 
926
947
  // src/lib/collate.ts
927
948
  function monkeypatchCollate(col, collation) {
@@ -1001,9 +1022,12 @@ var subgraph_domain = onchainTable4(
1001
1022
  expiryDate: t.bigint()
1002
1023
  }),
1003
1024
  (t) => ({
1004
- // Temporarily disable the `byName` index to avoid index creation issues.
1005
- // For more details, see: https://github.com/namehash/ensnode/issues/1819
1006
- // byName: index().on(t.name),
1025
+ // uses a hash index because some name values exceed the btree max row size (8191 bytes)
1026
+ byExactName: index3().using("hash", t.name),
1027
+ // GIN trigram index for partial-match filters (_contains, _starts_with, _ends_with).
1028
+ // (inline `gin_trgm_ops` via `sql` because passing it through `.op()` gets dropped by Ponder,
1029
+ // producing `USING gin (name)` with no opclass)
1030
+ byFuzzyName: index3().using("gin", sql2`${t.name} gin_trgm_ops`),
1007
1031
  byLabelhash: index3().on(t.labelhash),
1008
1032
  byParentId: index3().on(t.parentId),
1009
1033
  byOwnerId: index3().on(t.ownerId),