@ensnode/ensdb-sdk 0.0.0-next-20260519084124 → 0.0.0-next-20260520174742

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,4 @@
1
- export { b as account, c as account_relations, d as domain, e as domainEvent, f as domainResolverRelation, g as domainResolverRelation_relations, h as domainType, i as event, j as internal_registrarActionMetadata, k as internal_registrarActionMetadataType, l as label, m as label_relations, n as latestRegistrationIndex, o as latestRegistrationIndex_relations, p as latestRenewalIndex, q as latestRenewalIndex_relations, r as migratedNodeByNode, s as migratedNodeByParent, t as nameSales, u as nameTokens, v as permissions, w as permissionsEvent, x as permissionsResource, y as permissionsUser, z as permissionsUserEvent, A as registrarActionRelations, B as registrarActionType, C as registrarActions, D as registration, E as registrationLifecycleRelations, F as registrationLifecycles, G as registrationType, H as registration_relations, I as registry, J as registryType, K as relations_domain, L as relations_permissions, M as relations_permissionsResource, N as relations_permissionsUser, O as relations_registry, P as renewal, Q as renewal_relations, R as resolver, S as resolverAddressRecord, T as resolverAddressRecordRelations, U as resolverEvent, V as resolverRecords, W as resolverRecords_relations, X as resolverTextRecord, Y as resolverTextRecordRelations, Z as resolver_relations, _ as reverseNameRecord, $ as subgraph_abiChanged, a0 as subgraph_abiChangedRelations, a1 as subgraph_account, a2 as subgraph_accountRelations, a3 as subgraph_addrChanged, a4 as subgraph_addrChangedRelations, a5 as subgraph_authorisationChanged, a6 as subgraph_authorisationChangedRelations, a7 as subgraph_contenthashChanged, a8 as subgraph_contenthashChangedRelations, a9 as subgraph_domain, aa as subgraph_domainRelations, ab as subgraph_expiryExtended, ac as subgraph_expiryExtendedRelations, ad as subgraph_fusesSet, ae as subgraph_fusesSetRelations, af as subgraph_interfaceChanged, ag as subgraph_interfaceChangedRelations, ah as subgraph_multicoinAddrChanged, ai as subgraph_multicoinAddrChangedRelations, aj as subgraph_nameChanged, ak as subgraph_nameChangedRelations, al as subgraph_nameRegistered, am as subgraph_nameRegisteredRelations, an as subgraph_nameRenewed, ao as subgraph_nameRenewedRelations, ap as subgraph_nameTransferred, aq as subgraph_nameTransferredRelations, ar as subgraph_nameUnwrapped, as as subgraph_nameUnwrappedRelations, at as subgraph_nameWrapped, au as subgraph_nameWrappedRelations, av as subgraph_newOwner, aw as subgraph_newOwnerRelations, ax as subgraph_newResolver, ay as subgraph_newResolverRelations, az as subgraph_newTTL, aA as subgraph_newTTLRelations, aB as subgraph_pubkeyChanged, aC as subgraph_pubkeyChangedRelations, aD as subgraph_registration, aE as subgraph_registrationRelations, aF as subgraph_resolver, aG as subgraph_resolverRelations, aH as subgraph_textChanged, aI as subgraph_textChangedRelations, aJ as subgraph_transfer, aK as subgraph_transferRelations, aL as subgraph_versionChanged, aM as subgraph_versionChangedRelations, aN as subgraph_wrappedDomain, aO as subgraph_wrappedDomainRelations, aP as subgraph_wrappedTransfer, aQ as subgraph_wrappedTransferRelations, aR as subregistries, aS as subregistryRelations } from '../index-DdrIzPaZ.js';
1
+ export { b as account, c as account_relations, d as domain, e as domainEvent, f as domainResolverRelation, g as domainResolverRelation_relations, h as domainType, i as event, j as internal_registrarActionMetadata, k as internal_registrarActionMetadataType, l as label, m as label_relations, n as latestRegistrationIndex, o as latestRegistrationIndex_relations, p as latestRenewalIndex, q as latestRenewalIndex_relations, r as migratedNodeByNode, s as migratedNodeByParent, t as nameSales, u as nameTokens, v as permissions, w as permissionsEvent, x as permissionsResource, y as permissionsUser, z as permissionsUserEvent, A as registrarActionRelations, B as registrarActionType, C as registrarActions, D as registration, E as registrationLifecycleRelations, F as registrationLifecycles, G as registrationType, H as registration_relations, I as registry, J as registryType, K as relations_domain, L as relations_permissions, M as relations_permissionsResource, N as relations_permissionsUser, O as relations_registry, P as renewal, Q as renewal_relations, R as resolver, S as resolverAddressRecord, T as resolverAddressRecordRelations, U as resolverEvent, V as resolverRecords, W as resolverRecords_relations, X as resolverTextRecord, Y as resolverTextRecordRelations, Z as resolver_relations, _ as reverseNameRecord, $ as subgraph_abiChanged, a0 as subgraph_abiChangedRelations, a1 as subgraph_account, a2 as subgraph_accountRelations, a3 as subgraph_addrChanged, a4 as subgraph_addrChangedRelations, a5 as subgraph_authorisationChanged, a6 as subgraph_authorisationChangedRelations, a7 as subgraph_contenthashChanged, a8 as subgraph_contenthashChangedRelations, a9 as subgraph_domain, aa as subgraph_domainRelations, ab as subgraph_expiryExtended, ac as subgraph_expiryExtendedRelations, ad as subgraph_fusesSet, ae as subgraph_fusesSetRelations, af as subgraph_interfaceChanged, ag as subgraph_interfaceChangedRelations, ah as subgraph_multicoinAddrChanged, ai as subgraph_multicoinAddrChangedRelations, aj as subgraph_nameChanged, ak as subgraph_nameChangedRelations, al as subgraph_nameRegistered, am as subgraph_nameRegisteredRelations, an as subgraph_nameRenewed, ao as subgraph_nameRenewedRelations, ap as subgraph_nameTransferred, aq as subgraph_nameTransferredRelations, ar as subgraph_nameUnwrapped, as as subgraph_nameUnwrappedRelations, at as subgraph_nameWrapped, au as subgraph_nameWrappedRelations, av as subgraph_newOwner, aw as subgraph_newOwnerRelations, ax as subgraph_newResolver, ay as subgraph_newResolverRelations, az as subgraph_newTTL, aA as subgraph_newTTLRelations, aB as subgraph_pubkeyChanged, aC as subgraph_pubkeyChangedRelations, aD as subgraph_registration, aE as subgraph_registrationRelations, aF as subgraph_resolver, aG as subgraph_resolverRelations, aH as subgraph_textChanged, aI as subgraph_textChangedRelations, aJ as subgraph_transfer, aK as subgraph_transferRelations, aL as subgraph_versionChanged, aM as subgraph_versionChangedRelations, aN as subgraph_wrappedDomain, aO as subgraph_wrappedDomainRelations, aP as subgraph_wrappedTransfer, aQ as subgraph_wrappedTransferRelations, aR as subregistries, aS as subregistryRelations } from '../index-JfTOvlTx.js';
2
2
  import 'drizzle-orm/pg-core';
3
3
  import 'drizzle-orm';
4
4
  import 'ponder';
@@ -186,10 +186,25 @@ var domain = onchainTable(
186
186
  }),
187
187
  (t) => ({
188
188
  byType: index().on(t.type),
189
- byRegistry: index().on(t.registryId),
190
189
  bySubregistry: index().on(t.subregistryId).where(sql`${t.subregistryId} IS NOT NULL`),
191
190
  byOwner: index().on(t.ownerId),
192
191
  byLabelHash: index().on(t.labelHash),
192
+ // Composite for `(registry_id, label_hash)` lookups (namegraph walk in
193
+ // get-domain-by-interpreted-name.ts). The leading `registry_id` column also serves
194
+ // `WHERE registry_id = X` lookups via prefix scan.
195
+ byRegistryAndLabelHash: index().on(t.registryId, t.labelHash),
196
+ // composite for `WHERE registry_id = X ORDER BY canonical_name LIMIT N` (Domain.subdomains
197
+ // and other find-domains queries when ordering by NAME). Uses `left(canonical_name, 256)`
198
+ // to bound the index tuple under btree's per-tuple max (~2712 bytes): 256 chars × max 4-byte
199
+ // UTF-8 = 1024 bytes, leaving ample room for the registry_id and id columns. Names beyond
200
+ // 256 chars (currently <0.0001% of mainnet) collide on the truncated prefix and tie-break by
201
+ // id; this is acceptable since such names are invariably spam. Callers MUST sort by the same
202
+ // expression for the planner to use this index for ordered scan.
203
+ byRegistryAndCanonicalNameLeft: index().on(
204
+ t.registryId,
205
+ sql`left(${t.canonicalName}, 256)`,
206
+ t.id
207
+ ),
193
208
  // hash index avoids the btree 8191-byte row-size hazard for spam names
194
209
  byCanonicalNameExact: index().using("hash", t.canonicalName),
195
210
  // GIN trigram index for substring / similarity queries (inline `gin_trgm_ops` via `sql`
@@ -478,7 +493,7 @@ var migratedNodeByNode = onchainTable2("migrated_nodes_by_node", (t) => ({
478
493
  }));
479
494
 
480
495
  // src/ensindexer-abstract/protocol-acceleration.schema.ts
481
- import { onchainTable as onchainTable3, primaryKey as primaryKey3, relations as relations2, uniqueIndex as uniqueIndex2 } from "ponder";
496
+ import { index as index2, onchainTable as onchainTable3, primaryKey as primaryKey3, relations as relations2, uniqueIndex as uniqueIndex2 } from "ponder";
482
497
  var reverseNameRecord = onchainTable3(
483
498
  "reverse_name_records",
484
499
  (t) => ({
@@ -508,7 +523,8 @@ var domainResolverRelation = onchainTable3(
508
523
  resolver: t.hex().notNull().$type()
509
524
  }),
510
525
  (t) => ({
511
- pk: primaryKey3({ columns: [t.chainId, t.address, t.domainId] })
526
+ pk: primaryKey3({ columns: [t.chainId, t.address, t.domainId] }),
527
+ byDomain: index2().on(t.domainId)
512
528
  })
513
529
  );
514
530
  var domainResolverRelation_relations = relations2(domainResolverRelation, ({ one }) => ({
@@ -645,7 +661,7 @@ var resolverTextRecordRelations = relations2(resolverTextRecord, ({ one }) => ({
645
661
  }));
646
662
 
647
663
  // src/ensindexer-abstract/registrars.schema.ts
648
- import { index as index2, onchainEnum as onchainEnum2, onchainTable as onchainTable4, relations as relations3, uniqueIndex as uniqueIndex3 } from "ponder";
664
+ import { index as index3, onchainEnum as onchainEnum2, onchainTable as onchainTable4, relations as relations3, uniqueIndex as uniqueIndex3 } from "ponder";
649
665
  var subregistries = onchainTable4(
650
666
  "subregistries",
651
667
  (t) => ({
@@ -709,7 +725,7 @@ var registrationLifecycles = onchainTable4(
709
725
  expiresAt: t.bigint().notNull()
710
726
  }),
711
727
  (t) => ({
712
- bySubregistry: index2().on(t.subregistryId)
728
+ bySubregistry: index3().on(t.subregistryId)
713
729
  })
714
730
  );
715
731
  var registrarActionType = onchainEnum2("registrar_action_type", [
@@ -965,8 +981,8 @@ var registrarActions = onchainTable4(
965
981
  eventIds: t.text().array().notNull()
966
982
  }),
967
983
  (t) => ({
968
- byDecodedReferrer: index2().on(t.decodedReferrer),
969
- byTimestamp: index2().on(t.timestamp)
984
+ byDecodedReferrer: index3().on(t.decodedReferrer),
985
+ byTimestamp: index3().on(t.timestamp)
970
986
  })
971
987
  );
972
988
  var internal_registrarActionMetadataType = onchainEnum2(
@@ -1022,7 +1038,7 @@ var registrarActionRelations = relations3(registrarActions, ({ one }) => ({
1022
1038
  }));
1023
1039
 
1024
1040
  // src/ensindexer-abstract/subgraph.schema.ts
1025
- import { index as index3, onchainTable as onchainTable5, relations as relations4, sql as sql2 } from "ponder";
1041
+ import { index as index4, onchainTable as onchainTable5, relations as relations4, sql as sql2 } from "ponder";
1026
1042
 
1027
1043
  // src/lib/collate.ts
1028
1044
  function monkeypatchCollate(col, collation) {
@@ -1103,17 +1119,17 @@ var subgraph_domain = onchainTable5(
1103
1119
  }),
1104
1120
  (t) => ({
1105
1121
  // uses a hash index because some name values exceed the btree max row size (8191 bytes)
1106
- byExactName: index3().using("hash", t.name),
1122
+ byExactName: index4().using("hash", t.name),
1107
1123
  // GIN trigram index for partial-match filters (_contains, _starts_with, _ends_with).
1108
1124
  // (inline `gin_trgm_ops` via `sql` because passing it through `.op()` gets dropped by Ponder,
1109
1125
  // producing `USING gin (name)` with no opclass)
1110
- byFuzzyName: index3().using("gin", sql2`${t.name} gin_trgm_ops`),
1111
- byLabelhash: index3().on(t.labelhash),
1112
- byParentId: index3().on(t.parentId),
1113
- byOwnerId: index3().on(t.ownerId),
1114
- byRegistrantId: index3().on(t.registrantId),
1115
- byWrappedOwnerId: index3().on(t.wrappedOwnerId),
1116
- byResolvedAddressId: index3().on(t.resolvedAddressId)
1126
+ byFuzzyName: index4().using("gin", sql2`${t.name} gin_trgm_ops`),
1127
+ byLabelhash: index4().on(t.labelhash),
1128
+ byParentId: index4().on(t.parentId),
1129
+ byOwnerId: index4().on(t.ownerId),
1130
+ byRegistrantId: index4().on(t.registrantId),
1131
+ byWrappedOwnerId: index4().on(t.wrappedOwnerId),
1132
+ byResolvedAddressId: index4().on(t.resolvedAddressId)
1117
1133
  })
1118
1134
  );
1119
1135
  monkeypatchCollate(subgraph_domain.name, '"C"');
@@ -1192,7 +1208,7 @@ var subgraph_resolver = onchainTable5(
1192
1208
  coinTypes: t.bigint().array()
1193
1209
  }),
1194
1210
  (t) => ({
1195
- byDomainId: index3().on(t.domainId)
1211
+ byDomainId: index4().on(t.domainId)
1196
1212
  })
1197
1213
  );
1198
1214
  var subgraph_resolverRelations = relations4(subgraph_resolver, ({ one, many }) => ({
@@ -1253,9 +1269,9 @@ var subgraph_registration = onchainTable5(
1253
1269
  labelName: t.text()
1254
1270
  }),
1255
1271
  (t) => ({
1256
- byDomainId: index3().on(t.domainId),
1257
- byRegistrationDate: index3().on(t.registrationDate),
1258
- byExpiryDate: index3().on(t.expiryDate)
1272
+ byDomainId: index4().on(t.domainId),
1273
+ byRegistrationDate: index4().on(t.registrationDate),
1274
+ byExpiryDate: index4().on(t.expiryDate)
1259
1275
  })
1260
1276
  );
1261
1277
  var subgraph_registrationRelations = relations4(subgraph_registration, ({ one, many }) => ({
@@ -1304,7 +1320,7 @@ var subgraph_wrappedDomain = onchainTable5(
1304
1320
  name: t.text()
1305
1321
  }),
1306
1322
  (t) => ({
1307
- byDomainId: index3().on(t.domainId)
1323
+ byDomainId: index4().on(t.domainId)
1308
1324
  })
1309
1325
  );
1310
1326
  var subgraph_wrappedDomainRelations = relations4(subgraph_wrappedDomain, ({ one }) => ({
@@ -1328,9 +1344,9 @@ var domainEvent2 = (t) => ({
1328
1344
  });
1329
1345
  var domainEventIndex = (t) => ({
1330
1346
  // primary reverse lookup
1331
- idx: index3().on(t.domainId),
1347
+ idx: index4().on(t.domainId),
1332
1348
  // sorting index
1333
- idx_compound: index3().on(t.domainId, t.id)
1349
+ idx_compound: index4().on(t.domainId, t.id)
1334
1350
  });
1335
1351
  var subgraph_transfer = onchainTable5(
1336
1352
  "subgraph_transfers",
@@ -1414,9 +1430,9 @@ var registrationEvent = (t) => ({
1414
1430
  });
1415
1431
  var registrationEventIndex = (t) => ({
1416
1432
  // primary reverse lookup
1417
- idx: index3().on(t.registrationId),
1433
+ idx: index4().on(t.registrationId),
1418
1434
  // sorting index
1419
- idx_compound: index3().on(t.registrationId, t.id)
1435
+ idx_compound: index4().on(t.registrationId, t.id)
1420
1436
  });
1421
1437
  var subgraph_nameRegistered = onchainTable5(
1422
1438
  "subgraph_name_registered",
@@ -1449,9 +1465,9 @@ var resolverEvent2 = (t) => ({
1449
1465
  });
1450
1466
  var resolverEventIndex = (t) => ({
1451
1467
  // primary reverse lookup
1452
- idx: index3().on(t.resolverId),
1468
+ idx: index4().on(t.resolverId),
1453
1469
  // sorting index
1454
- idx_compound: index3().on(t.resolverId, t.id)
1470
+ idx_compound: index4().on(t.resolverId, t.id)
1455
1471
  });
1456
1472
  var subgraph_addrChanged = onchainTable5(
1457
1473
  "subgraph_addr_changed",
@@ -1725,7 +1741,7 @@ var subgraph_versionChangedRelations = relations4(subgraph_versionChanged, ({ on
1725
1741
  }));
1726
1742
 
1727
1743
  // src/ensindexer-abstract/tokenscope.schema.ts
1728
- import { index as index4, onchainTable as onchainTable6 } from "ponder";
1744
+ import { index as index5, onchainTable as onchainTable6 } from "ponder";
1729
1745
  var nameSales = onchainTable6(
1730
1746
  "name_sales",
1731
1747
  (t) => ({
@@ -1815,11 +1831,11 @@ var nameSales = onchainTable6(
1815
1831
  timestamp: t.bigint().notNull()
1816
1832
  }),
1817
1833
  (t) => ({
1818
- idx_domainId: index4().on(t.domainId),
1819
- idx_assetId: index4().on(t.assetId),
1820
- idx_buyer: index4().on(t.buyer),
1821
- idx_seller: index4().on(t.seller),
1822
- idx_timestamp: index4().on(t.timestamp)
1834
+ idx_domainId: index5().on(t.domainId),
1835
+ idx_assetId: index5().on(t.assetId),
1836
+ idx_buyer: index5().on(t.buyer),
1837
+ idx_seller: index5().on(t.seller),
1838
+ idx_timestamp: index5().on(t.timestamp)
1823
1839
  })
1824
1840
  );
1825
1841
  var nameTokens = onchainTable6(
@@ -1902,8 +1918,8 @@ var nameTokens = onchainTable6(
1902
1918
  mintStatus: t.text().notNull()
1903
1919
  }),
1904
1920
  (t) => ({
1905
- idx_domainId: index4().on(t.domainId),
1906
- idx_owner: index4().on(t.owner)
1921
+ idx_domainId: index5().on(t.domainId),
1922
+ idx_owner: index5().on(t.owner)
1907
1923
  })
1908
1924
  );
1909
1925
  export {