@ensnode/ensdb-sdk 1.15.2 → 1.16.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.
@@ -703,6 +703,7 @@ declare const resolverAddressRecord: ponder.OnchainTable<{
703
703
  };
704
704
  extra: {
705
705
  pk: ponder.PrimaryKeyBuilder<"chainId" | "address" | "node" | "coinType">;
706
+ byValueAndCoinType: drizzle_orm_pg_core.IndexBuilder;
706
707
  };
707
708
  dialect: "pg";
708
709
  }>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { EnsDbPublicConfig, IndexingMetadataContext, IndexingMetadataContextInitialized, Unvalidated } from '@ensnode/ensnode-sdk';
2
2
  export { IndexingMetadataContext, IndexingMetadataContextInitialized, IndexingMetadataContextStatusCodes, IndexingMetadataContextUninitialized } from '@ensnode/ensnode-sdk';
3
3
  import { NodePgDatabase } from 'drizzle-orm/node-postgres';
4
- import { a as abstractEnsIndexerSchema } from './index-DH9e7wPl.js';
4
+ import { a as abstractEnsIndexerSchema } from './index-D36RM4zS.js';
5
5
  import { e as ensNodeSchema } from './index-BHoa233Z.js';
6
6
  import 'ponder';
7
7
  import 'drizzle-orm';
package/dist/index.js CHANGED
@@ -144,6 +144,8 @@ var reverseNameRecord = onchainTable2(
144
144
  (t) => ({
145
145
  // keyed by (address, coinType)
146
146
  address: t.hex().notNull().$type(),
147
+ // @TODO(cointype-bigint): store as `t.int8({ mode: "number" }).$type<CoinType>()` (like chainId
148
+ // elsewhere) so reads/writes use CoinType directly without bigint round-trips. See #2293.
147
149
  coinType: t.bigint().notNull(),
148
150
  /**
149
151
  * Represents the ENSIP-19 Reverse Name Record for a given (address, coinType).
@@ -259,6 +261,8 @@ var resolverAddressRecord = onchainTable2(
259
261
  node: t.hex().notNull().$type(),
260
262
  // NOTE: all well-known CoinTypes fit into javascript number but NOT postgres .integer, must be
261
263
  // stored as BigInt
264
+ // @TODO(cointype-bigint): use `t.int8({ mode: "number" }).$type<CoinType>()` like `chainId` above
265
+ // to drop bigint round-trips at every read/write boundary. See #2293.
262
266
  coinType: t.bigint().notNull(),
263
267
  /**
264
268
  * Represents the value of the Address Record specified by ((chainId, resolver, node), coinType).
@@ -269,7 +273,10 @@ var resolverAddressRecord = onchainTable2(
269
273
  value: t.hex().notNull()
270
274
  }),
271
275
  (t) => ({
272
- pk: primaryKey2({ columns: [t.chainId, t.address, t.node, t.coinType] })
276
+ pk: primaryKey2({ columns: [t.chainId, t.address, t.node, t.coinType] }),
277
+ // supports the reverse lookup powering `Account.nameReferences`:
278
+ // `WHERE value = <address> [AND coin_type = <coinType>]`
279
+ byValueAndCoinType: index().on(t.value, t.coinType)
273
280
  })
274
281
  );
275
282
  var resolverAddressRecordRelations = relations(resolverAddressRecord, ({ one }) => ({