@ensnode/ensnode-schema 0.35.0 → 1.0.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,130 +1,627 @@
1
- // src/subgraph.schema.ts
2
- import { index, onchainTable, relations } from "ponder";
1
+ // src/schemas/protocol-acceleration.schema.ts
2
+ import { onchainTable, primaryKey, relations } from "ponder";
3
+ var reverseNameRecord = onchainTable(
4
+ "reverse_name_records",
5
+ (t) => ({
6
+ // keyed by (address, coinType)
7
+ address: t.hex().notNull(),
8
+ coinType: t.bigint().notNull(),
9
+ /**
10
+ * Represents the ENSIP-19 Reverse Name Record for a given (address, coinType).
11
+ *
12
+ * The value of this field is guaranteed to be a non-empty-string normalized ENS name (see
13
+ * `interpretNameRecordValue` for additional context and specific guarantees). Unnormalized
14
+ * names and empty string values are interpreted as a deletion of the associated Reverse Name
15
+ * Record entity (represented in the schema as the _absence_ of a relevant Reverse Name Record
16
+ * entity).
17
+ */
18
+ value: t.text().notNull()
19
+ }),
20
+ (t) => ({
21
+ pk: primaryKey({ columns: [t.address, t.coinType] })
22
+ })
23
+ );
24
+ var nodeResolverRelation = onchainTable(
25
+ "node_resolver_relations",
26
+ (t) => ({
27
+ // keyed by (chainId, registry, node)
28
+ chainId: t.integer().notNull(),
29
+ registry: t.hex().notNull(),
30
+ node: t.hex().notNull(),
31
+ /**
32
+ * The Address of the Resolver contract this `node` has set (via Registry#NewResolver) within
33
+ * the Registry on `chainId`.
34
+ */
35
+ resolver: t.hex().notNull()
36
+ }),
37
+ (t) => ({
38
+ pk: primaryKey({ columns: [t.chainId, t.registry, t.node] })
39
+ })
40
+ );
41
+ var resolverRecords = onchainTable(
42
+ "resolver_records",
43
+ (t) => ({
44
+ // keyed by (chainId, resolver, node)
45
+ chainId: t.integer().notNull(),
46
+ resolver: t.hex().notNull(),
47
+ node: t.hex().notNull(),
48
+ /**
49
+ * Represents the value of the reverse-resolution (ENSIP-3) name() record, used for Reverse Resolution.
50
+ *
51
+ * The emitted record values are interpreted according to `interpretNameRecordValue` — unnormalized
52
+ * names and empty string values are interpreted as a deletion of the associated record (represented
53
+ * here as `null`).
54
+ *
55
+ * If set, the value of this field is guaranteed to be a non-empty-string normalized ENS name
56
+ * (see `interpretNameRecordValue` for additional context and specific guarantees).
57
+ */
58
+ name: t.text()
59
+ }),
60
+ (t) => ({
61
+ pk: primaryKey({ columns: [t.chainId, t.resolver, t.node] })
62
+ })
63
+ );
64
+ var resolverRecords_relations = relations(resolverRecords, ({ many }) => ({
65
+ // resolverRecord has many address records
66
+ addressRecords: many(resolverAddressRecord),
67
+ // resolverRecord has many text records
68
+ textRecords: many(resolverTextRecord)
69
+ }));
70
+ var resolverAddressRecord = onchainTable(
71
+ "resolver_address_records",
72
+ (t) => ({
73
+ // keyed by ((chainId, resolver, node), coinType)
74
+ chainId: t.integer().notNull(),
75
+ resolver: t.hex().notNull(),
76
+ node: t.hex().notNull(),
77
+ coinType: t.bigint().notNull(),
78
+ /**
79
+ * Represents the value of the Addresss Record specified by ((chainId, resolver, node), coinType).
80
+ *
81
+ * The value of this field is interpreted by `interpretAddressRecordValue` — see its implementation
82
+ * for additional context and specific guarantees.
83
+ */
84
+ address: t.text().notNull()
85
+ }),
86
+ (t) => ({
87
+ pk: primaryKey({ columns: [t.chainId, t.resolver, t.node, t.coinType] })
88
+ })
89
+ );
90
+ var resolverAddressRecordRelations = relations(resolverAddressRecord, ({ one }) => ({
91
+ // belongs to resolverRecord
92
+ resolver: one(resolverRecords, {
93
+ fields: [
94
+ resolverAddressRecord.chainId,
95
+ resolverAddressRecord.resolver,
96
+ resolverAddressRecord.node
97
+ ],
98
+ references: [resolverRecords.chainId, resolverRecords.resolver, resolverRecords.node]
99
+ })
100
+ }));
101
+ var resolverTextRecord = onchainTable(
102
+ "resolver_trecords",
103
+ (t) => ({
104
+ // keyed by ((chainId, resolver, node), key)
105
+ chainId: t.integer().notNull(),
106
+ resolver: t.hex().notNull(),
107
+ node: t.hex().notNull(),
108
+ key: t.text().notNull(),
109
+ /**
110
+ * Represents the value of the Text Record specified by ((chainId, resolver, node), key).
111
+ *
112
+ * The value of this field is interpreted by `interpretTextRecordValue` — see its implementation
113
+ * for additional context and specific guarantees.
114
+ */
115
+ value: t.text().notNull()
116
+ }),
117
+ (t) => ({
118
+ pk: primaryKey({ columns: [t.chainId, t.resolver, t.node, t.key] })
119
+ })
120
+ );
121
+ var resolverTextRecordRelations = relations(resolverTextRecord, ({ one }) => ({
122
+ // belongs to resolverRecord
123
+ resolver: one(resolverRecords, {
124
+ fields: [resolverTextRecord.chainId, resolverTextRecord.resolver, resolverTextRecord.node],
125
+ references: [resolverRecords.chainId, resolverRecords.resolver, resolverRecords.node]
126
+ })
127
+ }));
128
+ var migratedNode = onchainTable("migrated_nodes", (t) => ({
129
+ node: t.hex().primaryKey()
130
+ }));
3
131
 
4
- // src/collate.ts
132
+ // src/schemas/registrars.schema.ts
133
+ import { index, onchainEnum, onchainTable as onchainTable2, relations as relations2, uniqueIndex } from "ponder";
134
+ var subregistries = onchainTable2(
135
+ "subregistries",
136
+ (t) => ({
137
+ /**
138
+ * Subregistry ID
139
+ *
140
+ * Identifies the chainId and address of the smart contract associated
141
+ * with the subregistry.
142
+ *
143
+ * Guaranteed to be a fully lowercase string formatted according to
144
+ * the CAIP-10 standard.
145
+ *
146
+ * @see https://chainagnostic.org/CAIPs/caip-10
147
+ */
148
+ subregistryId: t.text().primaryKey(),
149
+ /**
150
+ * The node (namehash) of the name the subregistry manages subnames of.
151
+ * Example subregistry managed names:
152
+ * - `eth`
153
+ * - `base.eth`
154
+ * - `linea.eth`
155
+ *
156
+ * Guaranteed to be a fully lowercase hex string representation of 32-bytes.
157
+ */
158
+ node: t.hex().notNull()
159
+ }),
160
+ (t) => ({
161
+ uniqueNode: uniqueIndex().on(t.node)
162
+ })
163
+ );
164
+ var registrationLifecycles = onchainTable2(
165
+ "registration_lifecycles",
166
+ (t) => ({
167
+ /**
168
+ * The node (namehash) of the FQDN of the domain the registration lifecycle
169
+ * is associated with.
170
+ *
171
+ * Guaranteed to be a subname of the node (namehash) of the subregistry
172
+ * identified by `subregistryId`.
173
+ *
174
+ * Guaranteed to be a fully lowercase hex string representation of 32-bytes.
175
+ */
176
+ node: t.hex().primaryKey(),
177
+ /**
178
+ * Subregistry ID
179
+ *
180
+ * Identifies the chainId and address of the subregistry smart contract
181
+ * that manages the registration lifecycle.
182
+ *
183
+ * Guaranteed to be a fully lowercase string formatted according to
184
+ * the CAIP-10 standard.
185
+ *
186
+ * @see https://chainagnostic.org/CAIPs/caip-10
187
+ */
188
+ subregistryId: t.text().notNull(),
189
+ /**
190
+ * Expires at
191
+ *
192
+ * Unix timestamp when the Registration Lifecycle is scheduled to expire.
193
+ */
194
+ expiresAt: t.bigint().notNull()
195
+ }),
196
+ (t) => ({
197
+ bySubregistry: index().on(t.subregistryId)
198
+ })
199
+ );
200
+ var registrarActionType = onchainEnum("registrar_action_type", [
201
+ "registration",
202
+ "renewal"
203
+ ]);
204
+ var registrarActions = onchainTable2(
205
+ "registrar_actions",
206
+ (t) => ({
207
+ /**
208
+ * "Logical registrar action" ID
209
+ *
210
+ * The `id` value is a deterministic and globally unique identifier for
211
+ * the "logical registrar action".
212
+ *
213
+ * The `id` value represents the *initial* onchain event associated with
214
+ * the "logical registrar action", but the full state of
215
+ * the "logical registrar action" is an aggregate across each of
216
+ * the onchain events referenced in the `eventIds` field.
217
+ *
218
+ * Guaranteed to be the very first element in `eventIds` array.
219
+ */
220
+ id: t.text().primaryKey(),
221
+ /**
222
+ * The type of the "logical registrar action".
223
+ */
224
+ type: registrarActionType().notNull(),
225
+ /**
226
+ * Subregistry ID
227
+ *
228
+ * The ID of the subregistry the "logical registrar action" was taken on.
229
+ *
230
+ * Identifies the chainId and address of the associated subregistry smart
231
+ * contract.
232
+ *
233
+ * Guaranteed to be a fully lowercase string formatted according to
234
+ * the CAIP-10 standard.
235
+ *
236
+ * @see https://chainagnostic.org/CAIPs/caip-10
237
+ */
238
+ subregistryId: t.text().notNull(),
239
+ /**
240
+ * The node (namehash) of the FQDN of the domain associated with
241
+ * the "logical registrar action".
242
+ *
243
+ * Guaranteed to be a fully lowercase hex string representation of 32-bytes.
244
+ */
245
+ node: t.hex().notNull(),
246
+ /**
247
+ * Incremental Duration
248
+ *
249
+ * If `type` is "registration":
250
+ * - Represents the duration between `blockTimestamp` and
251
+ * the initial `expiresAt` value that the associated
252
+ * "registration lifecycle" will be initialized with.
253
+ * If `type` is "renewal":
254
+ * - Represents the incremental increase in duration made to
255
+ * the `expiresAt` value in the associated "registration lifecycle".
256
+ *
257
+ * A "registration lifecycle" may be extended via renewal even after it
258
+ * expires if it is still within its grace period.
259
+ *
260
+ * Consider the following scenario:
261
+ *
262
+ * The "registration lifecycle" of a direct subname of .eth is scheduled to
263
+ * expire on Jan 1, midnight UTC. It is currently 30 days after this
264
+ * expiration time. Therefore, there are currently another 60 days of grace
265
+ * period remaining for this name. Anyone can still make a renewal to
266
+ * extend the "registration lifecycle" of this name.
267
+ *
268
+ * Given this scenario, consider the following examples:
269
+ *
270
+ * 1. If a renewal is made with 10 days incremental duration,
271
+ * the "registration lifecycle" for this name will remain in
272
+ * an "expired" state, but it will now have another 70 days of
273
+ * grace period remaining.
274
+ *
275
+ * 2. If a renewal is made with 50 days incremental duration,
276
+ * the "registration lifecycle" for this name will no longer be
277
+ * "expired" and will become "active", but the "registration lifecycle"
278
+ * will now be scheduled to expire again in 20 days.
279
+ *
280
+ * After the "registration lifecycle" for a name becomes expired by more
281
+ * than its grace period, it can no longer be renewed by anyone and is
282
+ * considered "released". The name must first be registered again, starting
283
+ * a new "registration lifecycle" of
284
+ * active / expired / grace period / released.
285
+ *
286
+ * May be 0.
287
+ *
288
+ * Guaranteed to be a non-negative bigint value.
289
+ */
290
+ incrementalDuration: t.bigint().notNull(),
291
+ /**
292
+ * Base cost
293
+ *
294
+ * Base cost (before any `premium`) of Ether measured in units of Wei
295
+ * paid to execute the "logical registrar action".
296
+ *
297
+ * May be 0.
298
+ *
299
+ * Guaranteed to be:
300
+ * 1) null if and only if `total` is null.
301
+ * 2) Otherwise, a non-negative bigint value.
302
+ */
303
+ baseCost: t.bigint(),
304
+ /**
305
+ * Premium
306
+ *
307
+ * "premium" cost (in excesses of the `baseCost`) of Ether measured in
308
+ * units of Wei paid to execute the "logical registrar action".
309
+ *
310
+ * May be 0.
311
+ *
312
+ * Guaranteed to be:
313
+ * 1) null if and only if `total` is null.
314
+ * 2) Otherwise, zero when `type` is `renewal`.
315
+ * 3) Otherwise, a non-negative bigint value.
316
+ */
317
+ premium: t.bigint(),
318
+ /**
319
+ * Total
320
+ *
321
+ * Total cost of Ether measured in units of Wei paid to execute
322
+ * the "logical registrar action".
323
+ *
324
+ * May be 0.
325
+ *
326
+ * Guaranteed to be:
327
+ * 1) null if and only if both `baseCost` and `premium` are null.
328
+ * 2) Otherwise, a non-negative bigint value, equal to the sum of
329
+ * `baseCost` and `premium`.
330
+ */
331
+ total: t.bigint(),
332
+ /**
333
+ * Registrant
334
+ *
335
+ * Identifies the address that initiated the "logical registrar action" and
336
+ * is paying the `total` cost (if applicable).
337
+ *
338
+ * It may not be the owner of the name:
339
+ * 1. When a name is registered, the initial owner of the name may be
340
+ * distinct from the registrant.
341
+ * 2. There are no restrictions on who may renew a name.
342
+ * Therefore the owner of the name may be distinct from the registrant.
343
+ *
344
+ *
345
+ * The "chainId" of this address is the same as is referenced in `subregistryId`.
346
+ *
347
+ * Guaranteed to be a fully lowercase address
348
+ */
349
+ registrant: t.hex().notNull(),
350
+ /**
351
+ * Encoded Referrer
352
+ *
353
+ * Represents the "raw" 32-byte "referrer" value emitted onchain in
354
+ * association with the registrar action.
355
+ *
356
+ * Guaranteed to be:
357
+ * 1) null if the emitted `eventIds` contain no information about a referrer.
358
+ * 2) Otherwise, a fully lowercase hex string representation of 32-bytes.
359
+ */
360
+ encodedReferrer: t.hex(),
361
+ /**
362
+ * Decoded referrer
363
+ *
364
+ * Decoded referrer according to the subjective interpretation of
365
+ * `encodedReferrer` defined for ENS Holiday Awards.
366
+ *
367
+ * Identifies the interpreted address of the referrer.
368
+ * The "chainId" of this address is the same as is referenced in
369
+ * `subregistryId`.
370
+ *
371
+ * Guaranteed to be:
372
+ * 1) null if `encodedReferrer` is null.
373
+ * 2) Otherwise, a fully lowercase address.
374
+ * 3) May be the "zero address" to represent that an `encodedReferrer` is
375
+ * defined but that it is interpreted as no referrer.
376
+ */
377
+ decodedReferrer: t.hex(),
378
+ /**
379
+ * Number of the block that includes the "logical registrar action".
380
+ *
381
+ * The "chainId" of this block is the same as is referenced in
382
+ * `subregistryId`.
383
+ *
384
+ * Guaranteed to be a non-negative bigint value.
385
+ */
386
+ blockNumber: t.bigint().notNull(),
387
+ /**
388
+ * Unix timestamp of the block referenced by `blockNumber` that includes
389
+ * the "logical registrar action".
390
+ */
391
+ timestamp: t.bigint().notNull(),
392
+ /**
393
+ * Transaction hash of the transaction associated with
394
+ * the "logical registrar action".
395
+ *
396
+ * The "chainId" of this transaction is the same as is referenced in
397
+ * `subregistryId`.
398
+ *
399
+ * Note that a single transaction may be associated with any number of
400
+ * "logical registrar actions".
401
+ *
402
+ * Guaranteed to be a fully lowercase hex string representation of 32-bytes.
403
+ */
404
+ transactionHash: t.hex().notNull(),
405
+ /**
406
+ * Event IDs
407
+ *
408
+ * Array of the eventIds that have contributed to the state of
409
+ * the "logical registrar action" record.
410
+ *
411
+ * Each eventId is a deterministic and globally unique onchain event
412
+ * identifier.
413
+ *
414
+ * Guarantees:
415
+ * - Each eventId is of events that occurred within the block
416
+ * referenced by `blockNumber`.
417
+ * - At least 1 eventId.
418
+ * - Ordered chronologically (ascending) by logIndex within `blockNumber`.
419
+ * - The first element in the array is equal to the `id` of
420
+ * the overall "logical registrar action" record.
421
+ *
422
+ * The following ideas are not generalized for ENS overall but happen to
423
+ * be a characteristic of the scope of our current indexing logic:
424
+ * 1. These id's always reference events emitted by
425
+ * a related "BaseRegistrar" contract.
426
+ * 2. These id's optionally reference events emitted by
427
+ * a related "Registrar Controller" contract. This is because our
428
+ * current indexing logic doesn't guarantee to index
429
+ * all "Registrar Controller" contracts.
430
+ */
431
+ eventIds: t.text().array().notNull()
432
+ }),
433
+ (t) => ({
434
+ byDecodedReferrer: index().on(t.decodedReferrer),
435
+ byTimestamp: index().on(t.timestamp)
436
+ })
437
+ );
438
+ var internal_registrarActionMetadata = onchainTable2(
439
+ "_ensindexer_registrar_action_metadata",
440
+ (t) => ({
441
+ /**
442
+ * Logical Event Key
443
+ *
444
+ * A fully lowercase string formatted as:
445
+ * `{chainId}:{subregistryAddress}:{node}:{transactionHash}`
446
+ */
447
+ logicalEventKey: t.text().primaryKey(),
448
+ /**
449
+ * Logical Event ID
450
+ *
451
+ * A string holding the `id` value of the existing "logical registrar action"
452
+ * record that is currently being built as an aggregation of onchain events.
453
+ *
454
+ * May be used by subsequent event handlers to identify which
455
+ * "logical registrar action" to aggregate additional indexed state into.
456
+ */
457
+ logicalEventId: t.text().notNull()
458
+ })
459
+ );
460
+ var subregistryRelations = relations2(subregistries, ({ many }) => ({
461
+ registrationLifecycle: many(registrationLifecycles)
462
+ }));
463
+ var registrationLifecycleRelations = relations2(
464
+ registrationLifecycles,
465
+ ({ one, many }) => ({
466
+ subregistry: one(subregistries, {
467
+ fields: [registrationLifecycles.subregistryId],
468
+ references: [subregistries.subregistryId]
469
+ }),
470
+ registrarAction: many(registrarActions)
471
+ })
472
+ );
473
+ var registrarActionRelations = relations2(registrarActions, ({ one }) => ({
474
+ registrationLifecycle: one(registrationLifecycles, {
475
+ fields: [registrarActions.node],
476
+ references: [registrationLifecycles.node]
477
+ })
478
+ }));
479
+
480
+ // src/schemas/subgraph.schema.ts
481
+ import { index as index2, onchainTable as onchainTable3, relations as relations3 } from "ponder";
482
+
483
+ // src/lib/collate.ts
5
484
  function monkeypatchCollate(col, collation) {
6
485
  col.getSQLType = function() {
7
- return Object.getPrototypeOf(this).getSQLType.call(this) + " COLLATE " + collation;
486
+ return `${Object.getPrototypeOf(this).getSQLType.call(this)} COLLATE ${collation}`;
8
487
  };
9
488
  return col;
10
489
  }
11
490
 
12
- // src/subgraph.schema.ts
13
- var domain = onchainTable("domains", (t) => ({
14
- // The namehash of the name
15
- id: t.hex().primaryKey(),
16
- /**
17
- * The human readable name that this Domain represents.
18
- *
19
- * If REPLACE_UNNORMALIZED is true, this value is guaranteed to be an Interpreted Name, which is either:
20
- * a) a normalized Name, or
21
- * b) a Name entirely consisting of Interpreted Labels.
22
- *
23
- * Note that the type of the column will remain string | null, for legacy subgraph compatibility,
24
- * but in practice will never be null. The Root node's name will be '' (empty string).
25
- *
26
- * @see https://ensnode.io/docs/reference/terminology#interpreted-name
27
- *
28
- * If REPLACE_UNNORMALIZED is false, this value may contain:
29
- * a) null (in the case of the root node), or
30
- * b) a Literal Name that may or may not be normalized and may or may not contain Encoded LabelHashes.
31
- *
32
- * @see https://ensnode.io/docs/reference/terminology#literal-name
33
- */
34
- name: t.text(),
35
- /**
36
- * The Label associated with the Domain.
37
- *
38
- * If REPLACE_UNNORMALIZED is true, this value is guaranteed to be an Interpreted Label which is either:
39
- * a) null, exclusively in the case of the root Node,
40
- * b) a normalized Label, or
41
- * c) an Encoded LabelHash of the Literal Label value found onchain.
42
- *
43
- * @see https://ensnode.io/docs/reference/terminology#interpreted-label
44
- *
45
- * If REPLACE_UNNORMALIZED is false, this value my contain:
46
- * a) null, exclusively in the case of the root Node, or
47
- * b) a Literal Label that may or may not be normalized and may or may not be an Encoded LabelHash.
48
- *
49
- * @see https://ensnode.io/docs/reference/terminology#literal-label
50
- */
51
- labelName: t.text(),
52
- // keccak256(labelName)
53
- labelhash: t.hex(),
54
- // The namehash (id) of the parent name
55
- parentId: t.hex(),
56
- // The number of subdomains
57
- subdomainCount: t.integer().notNull().default(0),
58
- // Address logged from current resolver, if any
59
- resolvedAddressId: t.hex(),
60
- // The resolver that controls the domain's settings
61
- resolverId: t.text(),
62
- // The time-to-live (TTL) value of the domain's records
63
- ttl: t.bigint(),
64
- // Indicates whether the domain has been migrated to a new registrar
65
- isMigrated: t.boolean().notNull().default(false),
66
- // The time when the domain was created
67
- createdAt: t.bigint().notNull(),
68
- // The account that owns the domain
69
- ownerId: t.hex().notNull(),
70
- // The account that owns the ERC721 NFT for the domain
71
- registrantId: t.hex(),
72
- // The account that owns the wrapped domain
73
- wrappedOwnerId: t.hex(),
74
- // The expiry date for the domain, from either the registration, or the wrapped domain if PCC is burned
75
- expiryDate: t.bigint()
76
- }));
77
- monkeypatchCollate(domain.name, '"C"');
78
- monkeypatchCollate(domain.labelName, '"C"');
79
- var domainRelations = relations(domain, ({ one, many }) => ({
80
- resolvedAddress: one(account, {
81
- fields: [domain.resolvedAddressId],
82
- references: [account.id]
491
+ // src/schemas/subgraph.schema.ts
492
+ var subgraph_domain = onchainTable3(
493
+ "subgraph_domains",
494
+ (t) => ({
495
+ // The namehash of the name
496
+ id: t.hex().primaryKey(),
497
+ /**
498
+ * The ENS Name that this Domain represents.
499
+ *
500
+ * If {@link ENSIndexerConfig#isSubgraphCompatible}, this value is guaranteed to be either:
501
+ * a) null (in the case of the root node), or
502
+ * b) a Subgraph Interpreted Name.
503
+ *
504
+ * @see https://ensnode.io/docs/reference/terminology#subgraph-indexability--labelname-interpretation
505
+ *
506
+ * Otherwise, this value is guaranteed to be an Interpreted Name, which is either:
507
+ * a) a normalized Name, or
508
+ * b) a Name entirely consisting of Interpreted Labels.
509
+ *
510
+ * Note that the type of the column will remain string | null, for legacy subgraph compatibility,
511
+ * but in practice will never be null. The Root node's name will be '' (empty string).
512
+ *
513
+ * @see https://ensnode.io/docs/reference/terminology#interpreted-name
514
+ */
515
+ name: t.text(),
516
+ /**
517
+ * The Label associated with the Domain.
518
+ *
519
+ * If {@link ENSIndexerConfig#isSubgraphCompatible}, this value is guaranteed to be either:
520
+ * a) null, in the case of the root Node or a name whose childmost label is subgraph-unindexable, or
521
+ * b) a subgraph-indexable Subgraph Interpreted Label (i.e. a Literal Label of undefined normalization).
522
+ *
523
+ * @see https://ensnode.io/docs/reference/terminology#subgraph-indexability--labelname-interpretation
524
+ *
525
+ * Otherwise, this value is guaranteed to be an Interpreted Label which is either:
526
+ * a) null, exclusively in the case of the root Node,
527
+ * b) a normalized Label, or
528
+ * c) an Encoded LabelHash, which encodes either
529
+ * i. in the case of an Unknown Label, the LabelHash emitted onchain, or
530
+ * ii. in the case of an Unnormalized Label, the LabelHash of the Literal Label value found onchain.
531
+ *
532
+ * @see https://ensnode.io/docs/reference/terminology#interpreted-label
533
+ */
534
+ labelName: t.text(),
535
+ // keccak256(labelName)
536
+ labelhash: t.hex(),
537
+ // The namehash (id) of the parent name
538
+ parentId: t.hex(),
539
+ // The number of subdomains
540
+ subdomainCount: t.integer().notNull().default(0),
541
+ // Address logged from current resolver, if any
542
+ resolvedAddressId: t.hex(),
543
+ // The resolver that controls the domain's settings
544
+ resolverId: t.text(),
545
+ // The time-to-live (TTL) value of the domain's records
546
+ ttl: t.bigint(),
547
+ // Indicates whether the domain has been migrated to a new registrar
548
+ isMigrated: t.boolean().notNull().default(false),
549
+ // The time when the domain was created
550
+ createdAt: t.bigint().notNull(),
551
+ // The account that owns the domain
552
+ ownerId: t.hex().notNull(),
553
+ // The account that owns the ERC721 NFT for the domain
554
+ registrantId: t.hex(),
555
+ // The account that owns the wrapped domain
556
+ wrappedOwnerId: t.hex(),
557
+ // The expiry date for the domain, from either the registration, or the wrapped domain if PCC is burned
558
+ expiryDate: t.bigint()
559
+ }),
560
+ (t) => ({
561
+ byLabelhash: index2().on(t.labelhash),
562
+ byParentId: index2().on(t.parentId),
563
+ byOwnerId: index2().on(t.ownerId),
564
+ byRegistrantId: index2().on(t.registrantId),
565
+ byWrappedOwnerId: index2().on(t.wrappedOwnerId)
566
+ })
567
+ );
568
+ monkeypatchCollate(subgraph_domain.name, '"C"');
569
+ monkeypatchCollate(subgraph_domain.labelName, '"C"');
570
+ var subgraph_domainRelations = relations3(subgraph_domain, ({ one, many }) => ({
571
+ resolvedAddress: one(subgraph_account, {
572
+ fields: [subgraph_domain.resolvedAddressId],
573
+ references: [subgraph_account.id]
83
574
  }),
84
- owner: one(account, { fields: [domain.ownerId], references: [account.id] }),
85
- parent: one(domain, { fields: [domain.parentId], references: [domain.id] }),
86
- resolver: one(resolver, {
87
- fields: [domain.resolverId],
88
- references: [resolver.id]
575
+ owner: one(subgraph_account, {
576
+ fields: [subgraph_domain.ownerId],
577
+ references: [subgraph_account.id]
89
578
  }),
90
- subdomains: many(domain, { relationName: "parent" }),
91
- registrant: one(account, {
92
- fields: [domain.registrantId],
93
- references: [account.id]
579
+ parent: one(subgraph_domain, {
580
+ fields: [subgraph_domain.parentId],
581
+ references: [subgraph_domain.id]
94
582
  }),
95
- wrappedOwner: one(account, {
96
- fields: [domain.wrappedOwnerId],
97
- references: [account.id]
583
+ resolver: one(subgraph_resolver, {
584
+ fields: [subgraph_domain.resolverId],
585
+ references: [subgraph_resolver.id]
98
586
  }),
99
- wrappedDomain: one(wrappedDomain, {
100
- fields: [domain.id],
101
- references: [wrappedDomain.domainId]
587
+ subdomains: many(subgraph_domain, { relationName: "parent" }),
588
+ registrant: one(subgraph_account, {
589
+ fields: [subgraph_domain.registrantId],
590
+ references: [subgraph_account.id]
102
591
  }),
103
- registration: one(registration, {
104
- fields: [domain.id],
105
- references: [registration.domainId]
592
+ wrappedOwner: one(subgraph_account, {
593
+ fields: [subgraph_domain.wrappedOwnerId],
594
+ references: [subgraph_account.id]
595
+ }),
596
+ wrappedDomain: one(subgraph_wrappedDomain, {
597
+ fields: [subgraph_domain.id],
598
+ references: [subgraph_wrappedDomain.domainId]
599
+ }),
600
+ registration: one(subgraph_registration, {
601
+ fields: [subgraph_domain.id],
602
+ references: [subgraph_registration.domainId]
106
603
  }),
107
604
  // event relations
108
- transfers: many(transfer),
109
- newOwners: many(newOwner),
110
- newResolvers: many(newResolver),
111
- newTTLs: many(newTTL),
112
- wrappedTransfers: many(wrappedTransfer),
113
- nameWrappeds: many(nameWrapped),
114
- nameUnwrappeds: many(nameUnwrapped),
115
- fusesSets: many(fusesSet),
116
- expiryExtendeds: many(expiryExtended)
605
+ transfers: many(subgraph_transfer),
606
+ newOwners: many(subgraph_newOwner),
607
+ newResolvers: many(subgraph_newResolver),
608
+ newTTLs: many(subgraph_newTTL),
609
+ wrappedTransfers: many(subgraph_wrappedTransfer),
610
+ nameWrappeds: many(subgraph_nameWrapped),
611
+ nameUnwrappeds: many(subgraph_nameUnwrapped),
612
+ fusesSets: many(subgraph_fusesSet),
613
+ expiryExtendeds: many(subgraph_expiryExtended)
117
614
  }));
118
- var account = onchainTable("accounts", (t) => ({
615
+ var subgraph_account = onchainTable3("subgraph_accounts", (t) => ({
119
616
  id: t.hex().primaryKey()
120
617
  }));
121
- var accountRelations = relations(account, ({ many }) => ({
122
- domains: many(domain),
123
- wrappedDomains: many(wrappedDomain),
124
- registrations: many(registration)
618
+ var subgraph_accountRelations = relations3(subgraph_account, ({ many }) => ({
619
+ domains: many(subgraph_domain),
620
+ wrappedDomains: many(subgraph_wrappedDomain),
621
+ registrations: many(subgraph_registration)
125
622
  }));
126
- var resolver = onchainTable(
127
- "resolvers",
623
+ var subgraph_resolver = onchainTable3(
624
+ "subgraph_resolvers",
128
625
  (t) => ({
129
626
  // The unique identifier for this resolver, which is a concatenation of the domain namehash and the resolver address
130
627
  id: t.text().primaryKey(),
@@ -141,43 +638,35 @@ var resolver = onchainTable(
141
638
  texts: t.text().array(),
142
639
  // The set of observed SLIP-44 coin types for this resolver
143
640
  // NOTE: we avoid .notNull.default([]) to match subgraph behavior
144
- coinTypes: t.bigint().array(),
145
- /**
146
- * Represents the value of the reverse-resolution (ENSIP-3) name() record.
147
- *
148
- * The emitted record values are interpreted according to `interpretNameRecordValue` — unnormalized
149
- * names and empty string values are interpreted as a deletion of the associated record (represented
150
- * here as `null`).
151
- *
152
- * If set, the value of this field is guaranteed to be a non-empty-string normalized ENS name
153
- * (see `interpretNameRecordValue` for guarantees).
154
- *
155
- * Note that this is an extension to the original subgraph schema and legacy subgraph compatibility
156
- * is not relevant.
157
- */
158
- name: t.text()
641
+ coinTypes: t.bigint().array()
159
642
  }),
160
643
  (t) => ({
161
- idx: index().on(t.domainId)
644
+ byDomainId: index2().on(t.domainId)
162
645
  })
163
646
  );
164
- var resolverRelations = relations(resolver, ({ one, many }) => ({
165
- addr: one(account, { fields: [resolver.addrId], references: [account.id] }),
166
- domain: one(domain, { fields: [resolver.domainId], references: [domain.id] }),
647
+ var subgraph_resolverRelations = relations3(subgraph_resolver, ({ one, many }) => ({
648
+ addr: one(subgraph_account, {
649
+ fields: [subgraph_resolver.addrId],
650
+ references: [subgraph_account.id]
651
+ }),
652
+ domain: one(subgraph_domain, {
653
+ fields: [subgraph_resolver.domainId],
654
+ references: [subgraph_domain.id]
655
+ }),
167
656
  // event relations
168
- addrChangeds: many(addrChanged),
169
- multicoinAddrChangeds: many(multicoinAddrChanged),
170
- nameChangeds: many(nameChanged),
171
- abiChangeds: many(abiChanged),
172
- pubkeyChangeds: many(pubkeyChanged),
173
- textChangeds: many(textChanged),
174
- contenthashChangeds: many(contenthashChanged),
175
- interfaceChangeds: many(interfaceChanged),
176
- authorisationChangeds: many(authorisationChanged),
177
- versionChangeds: many(versionChanged)
657
+ addrChangeds: many(subgraph_addrChanged),
658
+ multicoinAddrChangeds: many(subgraph_multicoinAddrChanged),
659
+ nameChangeds: many(subgraph_nameChanged),
660
+ abiChangeds: many(subgraph_abiChanged),
661
+ pubkeyChangeds: many(subgraph_pubkeyChanged),
662
+ textChangeds: many(subgraph_textChanged),
663
+ contenthashChangeds: many(subgraph_contenthashChanged),
664
+ interfaceChangeds: many(subgraph_interfaceChanged),
665
+ authorisationChangeds: many(subgraph_authorisationChanged),
666
+ versionChangeds: many(subgraph_versionChanged)
178
667
  }));
179
- var registration = onchainTable(
180
- "registrations",
668
+ var subgraph_registration = onchainTable3(
669
+ "subgraph_registrations",
181
670
  (t) => ({
182
671
  // The unique identifier of the registration
183
672
  id: t.hex().primaryKey(),
@@ -194,44 +683,45 @@ var registration = onchainTable(
194
683
  /**
195
684
  * The Label associated with the domain registration.
196
685
  *
197
- * If REPLACE_UNNORMALIZED is true, this value is guaranteed to be an Interpreted Label which is either:
686
+ * If {@link ENSIndexerConfig#isSubgraphCompatible}, this value is guaranteed to be either:
687
+ * a) null, in the case of the root Node or a Domain whose label is subgraph-unindexable, or
688
+ * b) a subgraph-indexable Subgraph Interpreted Label (i.e. a Literal Label of undefined normalization).
689
+ *
690
+ * @see https://ensnode.io/docs/reference/terminology#subgraph-indexability--labelname-interpretation
691
+ *
692
+ * Otherwise, this value is guaranteed to be an Interpreted Label which is either:
198
693
  * a) a normalized Label, or
199
- * b) an Encoded LabelHash of the Literal Label value found onchain.
694
+ * b) in the case of an Unnormalized Label, an Encoded LabelHash of the Literal Label value found onchain.
200
695
  *
201
696
  * Note that the type of the column will remain string | null, for legacy subgraph compatibility.
202
- * In practice however, when REPLACE_UNNORMALIZED is true, because there is no Registration entity
203
- * for the root Node—the only Node with a null labelNamethis field will never be null.
697
+ * In practice however, because there is no Registration entity for the root Node (the only Node
698
+ * with a null labelName) this field will never be null.
204
699
  *
205
700
  * @see https://ensnode.io/docs/reference/terminology#interpreted-label
206
- *
207
- * If REPLACE_UNNORMALIZED is false, this value may contain:
208
- * a) null, or
209
- * b) a Literal Label that may or may not be normalized and may or may not be an Encoded LabelHash.
210
- *
211
- * @see https://ensnode.io/docs/reference/terminology#literal-label
212
701
  */
213
702
  labelName: t.text()
214
703
  }),
215
704
  (t) => ({
216
- idx: index().on(t.domainId)
705
+ byDomainId: index2().on(t.domainId),
706
+ byRegistrationDate: index2().on(t.registrationDate)
217
707
  })
218
708
  );
219
- var registrationRelations = relations(registration, ({ one, many }) => ({
220
- domain: one(domain, {
221
- fields: [registration.domainId],
222
- references: [domain.id]
709
+ var subgraph_registrationRelations = relations3(subgraph_registration, ({ one, many }) => ({
710
+ domain: one(subgraph_domain, {
711
+ fields: [subgraph_registration.domainId],
712
+ references: [subgraph_domain.id]
223
713
  }),
224
- registrant: one(account, {
225
- fields: [registration.registrantId],
226
- references: [account.id]
714
+ registrant: one(subgraph_account, {
715
+ fields: [subgraph_registration.registrantId],
716
+ references: [subgraph_account.id]
227
717
  }),
228
718
  // event relations
229
- nameRegistereds: many(nameRegistered),
230
- nameReneweds: many(nameRenewed),
231
- nameTransferreds: many(nameTransferred)
719
+ nameRegistereds: many(subgraph_nameRegistered),
720
+ nameReneweds: many(subgraph_nameRenewed),
721
+ nameTransferreds: many(subgraph_nameTransferred)
232
722
  }));
233
- var wrappedDomain = onchainTable(
234
- "wrapped_domains",
723
+ var subgraph_wrappedDomain = onchainTable3(
724
+ "subgraph_wrapped_domains",
235
725
  (t) => ({
236
726
  // The unique identifier for each instance of the WrappedDomain entity
237
727
  id: t.hex().primaryKey(),
@@ -244,37 +734,35 @@ var wrappedDomain = onchainTable(
244
734
  // The account that owns this WrappedDomain
245
735
  ownerId: t.hex().notNull(),
246
736
  /**
247
- * The Name that this WrappedDomain represents.
248
- *
249
- * If REPLACE_UNNORMALIZED is true, this value is guaranteed to be an Interpreted Name, which is either:
250
- * a) a normalized Name, or
251
- * b) a Name entirely consisting of Interpreted Labels.
737
+ * The Name that this WrappedDomain represents. Names are emitted by the NameWrapper contract as
738
+ * DNS-Encoded Names which may be malformed, which will result in this field being `null`.
252
739
  *
253
- * Note that the type of the column will remain string | null, for legacy subgraph compatibility,
254
- * but in practice will never be null.
740
+ * If {@link ENSIndexerConfig#isSubgraphCompatible}, this value is guaranteed to be either:
741
+ * a) null (in the case of a DNS-Encoded Name that is malformed or contains subgraph-unindexable labels), or
742
+ * b) a subgraph-indexable Subgraph Interpreted Label (i.e. a Literal Label of undefined normalization).
255
743
  *
256
- * @see https://ensnode.io/docs/reference/terminology#interpreted-name
744
+ * @see https://ensnode.io/docs/reference/terminology#subgraph-indexability--labelname-interpretation
257
745
  *
258
- * If REPLACE_UNNORMALIZED is false, this value may contain:
259
- * a) null (in the case of the root node or invalid Name), or
260
- * b) a Literal Name that may or may not be normalized and may or may not contain Encoded LabelHashes.
746
+ * Otherwise, this value is guaranteed to be either:
747
+ * a) null (in the case of a malformed DNS-Encoded Name),
748
+ * b) an Interpreted Name.
261
749
  *
262
- * @see https://ensnode.io/docs/reference/terminology#literal-name
750
+ * @see https://ensnode.io/docs/reference/terminology#interpreted-name
263
751
  */
264
752
  name: t.text()
265
753
  }),
266
754
  (t) => ({
267
- idx: index().on(t.domainId)
755
+ byDomainId: index2().on(t.domainId)
268
756
  })
269
757
  );
270
- var wrappedDomainRelations = relations(wrappedDomain, ({ one }) => ({
271
- domain: one(domain, {
272
- fields: [wrappedDomain.domainId],
273
- references: [domain.id]
758
+ var subgraph_wrappedDomainRelations = relations3(subgraph_wrappedDomain, ({ one }) => ({
759
+ domain: one(subgraph_domain, {
760
+ fields: [subgraph_wrappedDomain.domainId],
761
+ references: [subgraph_domain.id]
274
762
  }),
275
- owner: one(account, {
276
- fields: [wrappedDomain.ownerId],
277
- references: [account.id]
763
+ owner: one(subgraph_account, {
764
+ fields: [subgraph_wrappedDomain.ownerId],
765
+ references: [subgraph_account.id]
278
766
  })
279
767
  }));
280
768
  var sharedEventColumns = (t) => ({
@@ -288,20 +776,20 @@ var domainEvent = (t) => ({
288
776
  });
289
777
  var domainEventIndex = (t) => ({
290
778
  // primary reverse lookup
291
- idx: index().on(t.domainId),
779
+ idx: index2().on(t.domainId),
292
780
  // sorting index
293
- idx_compound: index().on(t.domainId, t.id)
781
+ idx_compound: index2().on(t.domainId, t.id)
294
782
  });
295
- var transfer = onchainTable(
296
- "transfers",
783
+ var subgraph_transfer = onchainTable3(
784
+ "subgraph_transfers",
297
785
  (t) => ({
298
786
  ...domainEvent(t),
299
787
  ownerId: t.hex().notNull()
300
788
  }),
301
789
  domainEventIndex
302
790
  );
303
- var newOwner = onchainTable(
304
- "new_owners",
791
+ var subgraph_newOwner = onchainTable3(
792
+ "subgraph_new_owners",
305
793
  (t) => ({
306
794
  ...domainEvent(t),
307
795
  ownerId: t.hex().notNull(),
@@ -309,32 +797,32 @@ var newOwner = onchainTable(
309
797
  }),
310
798
  domainEventIndex
311
799
  );
312
- var newResolver = onchainTable(
313
- "new_resolvers",
800
+ var subgraph_newResolver = onchainTable3(
801
+ "subgraph_new_resolvers",
314
802
  (t) => ({
315
803
  ...domainEvent(t),
316
804
  resolverId: t.text().notNull()
317
805
  }),
318
806
  domainEventIndex
319
807
  );
320
- var newTTL = onchainTable(
321
- "new_ttls",
808
+ var subgraph_newTTL = onchainTable3(
809
+ "subgraph_new_ttls",
322
810
  (t) => ({
323
811
  ...domainEvent(t),
324
812
  ttl: t.bigint().notNull()
325
813
  }),
326
814
  domainEventIndex
327
815
  );
328
- var wrappedTransfer = onchainTable(
329
- "wrapped_transfers",
816
+ var subgraph_wrappedTransfer = onchainTable3(
817
+ "subgraph_wrapped_transfers",
330
818
  (t) => ({
331
819
  ...domainEvent(t),
332
820
  ownerId: t.hex().notNull()
333
821
  }),
334
822
  domainEventIndex
335
823
  );
336
- var nameWrapped = onchainTable(
337
- "name_wrapped",
824
+ var subgraph_nameWrapped = onchainTable3(
825
+ "subgraph_name_wrapped",
338
826
  (t) => ({
339
827
  ...domainEvent(t),
340
828
  name: t.text(),
@@ -344,24 +832,24 @@ var nameWrapped = onchainTable(
344
832
  }),
345
833
  domainEventIndex
346
834
  );
347
- var nameUnwrapped = onchainTable(
348
- "name_unwrapped",
835
+ var subgraph_nameUnwrapped = onchainTable3(
836
+ "subgraph_name_unwrapped",
349
837
  (t) => ({
350
838
  ...domainEvent(t),
351
839
  ownerId: t.hex().notNull()
352
840
  }),
353
841
  domainEventIndex
354
842
  );
355
- var fusesSet = onchainTable(
356
- "fuses_set",
843
+ var subgraph_fusesSet = onchainTable3(
844
+ "subgraph_fuses_set",
357
845
  (t) => ({
358
846
  ...domainEvent(t),
359
847
  fuses: t.integer().notNull()
360
848
  }),
361
849
  domainEventIndex
362
850
  );
363
- var expiryExtended = onchainTable(
364
- "expiry_extended",
851
+ var subgraph_expiryExtended = onchainTable3(
852
+ "subgraph_expiry_extended",
365
853
  (t) => ({
366
854
  ...domainEvent(t),
367
855
  expiryDate: t.bigint().notNull()
@@ -374,12 +862,12 @@ var registrationEvent = (t) => ({
374
862
  });
375
863
  var registrationEventIndex = (t) => ({
376
864
  // primary reverse lookup
377
- idx: index().on(t.registrationId),
865
+ idx: index2().on(t.registrationId),
378
866
  // sorting index
379
- idx_compound: index().on(t.registrationId, t.id)
867
+ idx_compound: index2().on(t.registrationId, t.id)
380
868
  });
381
- var nameRegistered = onchainTable(
382
- "name_registered",
869
+ var subgraph_nameRegistered = onchainTable3(
870
+ "subgraph_name_registered",
383
871
  (t) => ({
384
872
  ...registrationEvent(t),
385
873
  registrantId: t.hex().notNull(),
@@ -387,16 +875,16 @@ var nameRegistered = onchainTable(
387
875
  }),
388
876
  registrationEventIndex
389
877
  );
390
- var nameRenewed = onchainTable(
391
- "name_renewed",
878
+ var subgraph_nameRenewed = onchainTable3(
879
+ "subgraph_name_renewed",
392
880
  (t) => ({
393
881
  ...registrationEvent(t),
394
882
  expiryDate: t.bigint().notNull()
395
883
  }),
396
884
  registrationEventIndex
397
885
  );
398
- var nameTransferred = onchainTable(
399
- "name_transferred",
886
+ var subgraph_nameTransferred = onchainTable3(
887
+ "subgraph_name_transferred",
400
888
  (t) => ({
401
889
  ...registrationEvent(t),
402
890
  newOwnerId: t.hex().notNull()
@@ -409,20 +897,20 @@ var resolverEvent = (t) => ({
409
897
  });
410
898
  var resolverEventIndex = (t) => ({
411
899
  // primary reverse lookup
412
- idx: index().on(t.resolverId),
900
+ idx: index2().on(t.resolverId),
413
901
  // sorting index
414
- idx_compound: index().on(t.resolverId, t.id)
902
+ idx_compound: index2().on(t.resolverId, t.id)
415
903
  });
416
- var addrChanged = onchainTable(
417
- "addr_changed",
904
+ var subgraph_addrChanged = onchainTable3(
905
+ "subgraph_addr_changed",
418
906
  (t) => ({
419
907
  ...resolverEvent(t),
420
908
  addrId: t.hex().notNull()
421
909
  }),
422
910
  resolverEventIndex
423
911
  );
424
- var multicoinAddrChanged = onchainTable(
425
- "multicoin_addr_changed",
912
+ var subgraph_multicoinAddrChanged = onchainTable3(
913
+ "subgraph_multicoin_addr_changed",
426
914
  (t) => ({
427
915
  ...resolverEvent(t),
428
916
  coinType: t.bigint().notNull(),
@@ -430,24 +918,24 @@ var multicoinAddrChanged = onchainTable(
430
918
  }),
431
919
  resolverEventIndex
432
920
  );
433
- var nameChanged = onchainTable(
434
- "name_changed",
921
+ var subgraph_nameChanged = onchainTable3(
922
+ "subgraph_name_changed",
435
923
  (t) => ({
436
924
  ...resolverEvent(t),
437
925
  name: t.text().notNull()
438
926
  }),
439
927
  resolverEventIndex
440
928
  );
441
- var abiChanged = onchainTable(
442
- "abi_changed",
929
+ var subgraph_abiChanged = onchainTable3(
930
+ "subgraph_abi_changed",
443
931
  (t) => ({
444
932
  ...resolverEvent(t),
445
933
  contentType: t.bigint().notNull()
446
934
  }),
447
935
  resolverEventIndex
448
936
  );
449
- var pubkeyChanged = onchainTable(
450
- "pubkey_changed",
937
+ var subgraph_pubkeyChanged = onchainTable3(
938
+ "subgraph_pubkey_changed",
451
939
  (t) => ({
452
940
  ...resolverEvent(t),
453
941
  x: t.hex().notNull(),
@@ -455,8 +943,8 @@ var pubkeyChanged = onchainTable(
455
943
  }),
456
944
  resolverEventIndex
457
945
  );
458
- var textChanged = onchainTable(
459
- "text_changed",
946
+ var subgraph_textChanged = onchainTable3(
947
+ "subgraph_text_changed",
460
948
  (t) => ({
461
949
  ...resolverEvent(t),
462
950
  key: t.text().notNull(),
@@ -464,16 +952,16 @@ var textChanged = onchainTable(
464
952
  }),
465
953
  resolverEventIndex
466
954
  );
467
- var contenthashChanged = onchainTable(
468
- "contenthash_changed",
955
+ var subgraph_contenthashChanged = onchainTable3(
956
+ "subgraph_contenthash_changed",
469
957
  (t) => ({
470
958
  ...resolverEvent(t),
471
959
  hash: t.hex().notNull()
472
960
  }),
473
961
  resolverEventIndex
474
962
  );
475
- var interfaceChanged = onchainTable(
476
- "interface_changed",
963
+ var subgraph_interfaceChanged = onchainTable3(
964
+ "subgraph_interface_changed",
477
965
  (t) => ({
478
966
  ...resolverEvent(t),
479
967
  interfaceID: t.hex().notNull(),
@@ -481,8 +969,8 @@ var interfaceChanged = onchainTable(
481
969
  }),
482
970
  resolverEventIndex
483
971
  );
484
- var authorisationChanged = onchainTable(
485
- "authorisation_changed",
972
+ var subgraph_authorisationChanged = onchainTable3(
973
+ "subgraph_authorisation_changed",
486
974
  (t) => ({
487
975
  ...resolverEvent(t),
488
976
  owner: t.hex().notNull(),
@@ -491,229 +979,203 @@ var authorisationChanged = onchainTable(
491
979
  }),
492
980
  resolverEventIndex
493
981
  );
494
- var versionChanged = onchainTable(
495
- "version_changed",
982
+ var subgraph_versionChanged = onchainTable3(
983
+ "subgraph_version_changed",
496
984
  (t) => ({
497
985
  ...resolverEvent(t),
498
986
  version: t.bigint().notNull()
499
987
  }),
500
988
  resolverEventIndex
501
989
  );
502
- var transferRelations = relations(transfer, ({ one }) => ({
503
- domain: one(domain, { fields: [transfer.domainId], references: [domain.id] }),
504
- owner: one(account, { fields: [transfer.ownerId], references: [account.id] })
505
- }));
506
- var newOwnerRelations = relations(newOwner, ({ one }) => ({
507
- domain: one(domain, { fields: [newOwner.domainId], references: [domain.id] }),
508
- owner: one(account, { fields: [newOwner.ownerId], references: [account.id] }),
509
- parentDomain: one(domain, {
510
- fields: [newOwner.parentDomainId],
511
- references: [domain.id]
512
- })
513
- }));
514
- var newResolverRelations = relations(newResolver, ({ one }) => ({
515
- domain: one(domain, {
516
- fields: [newResolver.domainId],
517
- references: [domain.id]
990
+ var subgraph_transferRelations = relations3(subgraph_transfer, ({ one }) => ({
991
+ domain: one(subgraph_domain, {
992
+ fields: [subgraph_transfer.domainId],
993
+ references: [subgraph_domain.id]
518
994
  }),
519
- resolver: one(resolver, {
520
- fields: [newResolver.resolverId],
521
- references: [resolver.id]
995
+ owner: one(subgraph_account, {
996
+ fields: [subgraph_transfer.ownerId],
997
+ references: [subgraph_account.id]
522
998
  })
523
999
  }));
524
- var newTTLRelations = relations(newTTL, ({ one }) => ({
525
- domain: one(domain, { fields: [newTTL.domainId], references: [domain.id] })
526
- }));
527
- var wrappedTransferRelations = relations(wrappedTransfer, ({ one }) => ({
528
- domain: one(domain, {
529
- fields: [wrappedTransfer.domainId],
530
- references: [domain.id]
1000
+ var subgraph_newOwnerRelations = relations3(subgraph_newOwner, ({ one }) => ({
1001
+ domain: one(subgraph_domain, {
1002
+ fields: [subgraph_newOwner.domainId],
1003
+ references: [subgraph_domain.id]
531
1004
  }),
532
- owner: one(account, {
533
- fields: [wrappedTransfer.ownerId],
534
- references: [account.id]
535
- })
536
- }));
537
- var nameWrappedRelations = relations(nameWrapped, ({ one }) => ({
538
- domain: one(domain, {
539
- fields: [nameWrapped.domainId],
540
- references: [domain.id]
1005
+ owner: one(subgraph_account, {
1006
+ fields: [subgraph_newOwner.ownerId],
1007
+ references: [subgraph_account.id]
541
1008
  }),
542
- owner: one(account, {
543
- fields: [nameWrapped.ownerId],
544
- references: [account.id]
1009
+ parentDomain: one(subgraph_domain, {
1010
+ fields: [subgraph_newOwner.parentDomainId],
1011
+ references: [subgraph_domain.id]
545
1012
  })
546
1013
  }));
547
- var nameUnwrappedRelations = relations(nameUnwrapped, ({ one }) => ({
548
- domain: one(domain, {
549
- fields: [nameUnwrapped.domainId],
550
- references: [domain.id]
1014
+ var subgraph_newResolverRelations = relations3(subgraph_newResolver, ({ one }) => ({
1015
+ domain: one(subgraph_domain, {
1016
+ fields: [subgraph_newResolver.domainId],
1017
+ references: [subgraph_domain.id]
551
1018
  }),
552
- owner: one(account, {
553
- fields: [nameUnwrapped.ownerId],
554
- references: [account.id]
1019
+ resolver: one(subgraph_resolver, {
1020
+ fields: [subgraph_newResolver.resolverId],
1021
+ references: [subgraph_resolver.id]
555
1022
  })
556
1023
  }));
557
- var fusesSetRelations = relations(fusesSet, ({ one }) => ({
558
- domain: one(domain, { fields: [fusesSet.domainId], references: [domain.id] })
559
- }));
560
- var expiryExtendedRelations = relations(expiryExtended, ({ one }) => ({
561
- domain: one(domain, {
562
- fields: [expiryExtended.domainId],
563
- references: [domain.id]
1024
+ var subgraph_newTTLRelations = relations3(subgraph_newTTL, ({ one }) => ({
1025
+ domain: one(subgraph_domain, {
1026
+ fields: [subgraph_newTTL.domainId],
1027
+ references: [subgraph_domain.id]
564
1028
  })
565
1029
  }));
566
- var nameRegisteredRelations = relations(nameRegistered, ({ one }) => ({
567
- registration: one(registration, {
568
- fields: [nameRegistered.registrationId],
569
- references: [registration.id]
1030
+ var subgraph_wrappedTransferRelations = relations3(subgraph_wrappedTransfer, ({ one }) => ({
1031
+ domain: one(subgraph_domain, {
1032
+ fields: [subgraph_wrappedTransfer.domainId],
1033
+ references: [subgraph_domain.id]
570
1034
  }),
571
- registrant: one(account, {
572
- fields: [nameRegistered.registrantId],
573
- references: [account.id]
574
- })
575
- }));
576
- var nameRenewedRelations = relations(nameRenewed, ({ one }) => ({
577
- registration: one(registration, {
578
- fields: [nameRenewed.registrationId],
579
- references: [registration.id]
1035
+ owner: one(subgraph_account, {
1036
+ fields: [subgraph_wrappedTransfer.ownerId],
1037
+ references: [subgraph_account.id]
580
1038
  })
581
1039
  }));
582
- var nameTransferredRelations = relations(nameTransferred, ({ one }) => ({
583
- registration: one(registration, {
584
- fields: [nameTransferred.registrationId],
585
- references: [registration.id]
1040
+ var subgraph_nameWrappedRelations = relations3(subgraph_nameWrapped, ({ one }) => ({
1041
+ domain: one(subgraph_domain, {
1042
+ fields: [subgraph_nameWrapped.domainId],
1043
+ references: [subgraph_domain.id]
586
1044
  }),
587
- newOwner: one(account, {
588
- fields: [nameTransferred.newOwnerId],
589
- references: [account.id]
1045
+ owner: one(subgraph_account, {
1046
+ fields: [subgraph_nameWrapped.ownerId],
1047
+ references: [subgraph_account.id]
590
1048
  })
591
1049
  }));
592
- var addrChangedRelations = relations(addrChanged, ({ one }) => ({
593
- resolver: one(resolver, {
594
- fields: [addrChanged.resolverId],
595
- references: [resolver.id]
1050
+ var subgraph_nameUnwrappedRelations = relations3(subgraph_nameUnwrapped, ({ one }) => ({
1051
+ domain: one(subgraph_domain, {
1052
+ fields: [subgraph_nameUnwrapped.domainId],
1053
+ references: [subgraph_domain.id]
596
1054
  }),
597
- addr: one(account, {
598
- fields: [addrChanged.addrId],
599
- references: [account.id]
1055
+ owner: one(subgraph_account, {
1056
+ fields: [subgraph_nameUnwrapped.ownerId],
1057
+ references: [subgraph_account.id]
600
1058
  })
601
1059
  }));
602
- var multicoinAddrChangedRelations = relations(multicoinAddrChanged, ({ one }) => ({
603
- resolver: one(resolver, {
604
- fields: [multicoinAddrChanged.resolverId],
605
- references: [resolver.id]
1060
+ var subgraph_fusesSetRelations = relations3(subgraph_fusesSet, ({ one }) => ({
1061
+ domain: one(subgraph_domain, {
1062
+ fields: [subgraph_fusesSet.domainId],
1063
+ references: [subgraph_domain.id]
606
1064
  })
607
1065
  }));
608
- var nameChangedRelations = relations(nameChanged, ({ one }) => ({
609
- resolver: one(resolver, {
610
- fields: [nameChanged.resolverId],
611
- references: [resolver.id]
1066
+ var subgraph_expiryExtendedRelations = relations3(subgraph_expiryExtended, ({ one }) => ({
1067
+ domain: one(subgraph_domain, {
1068
+ fields: [subgraph_expiryExtended.domainId],
1069
+ references: [subgraph_domain.id]
612
1070
  })
613
1071
  }));
614
- var abiChangedRelations = relations(abiChanged, ({ one }) => ({
615
- resolver: one(resolver, {
616
- fields: [abiChanged.resolverId],
617
- references: [resolver.id]
1072
+ var subgraph_nameRegisteredRelations = relations3(subgraph_nameRegistered, ({ one }) => ({
1073
+ registration: one(subgraph_registration, {
1074
+ fields: [subgraph_nameRegistered.registrationId],
1075
+ references: [subgraph_registration.id]
1076
+ }),
1077
+ registrant: one(subgraph_account, {
1078
+ fields: [subgraph_nameRegistered.registrantId],
1079
+ references: [subgraph_account.id]
618
1080
  })
619
1081
  }));
620
- var pubkeyChangedRelations = relations(pubkeyChanged, ({ one }) => ({
621
- resolver: one(resolver, {
622
- fields: [pubkeyChanged.resolverId],
623
- references: [resolver.id]
1082
+ var subgraph_nameRenewedRelations = relations3(subgraph_nameRenewed, ({ one }) => ({
1083
+ registration: one(subgraph_registration, {
1084
+ fields: [subgraph_nameRenewed.registrationId],
1085
+ references: [subgraph_registration.id]
624
1086
  })
625
1087
  }));
626
- var textChangedRelations = relations(textChanged, ({ one }) => ({
627
- resolver: one(resolver, {
628
- fields: [textChanged.resolverId],
629
- references: [resolver.id]
1088
+ var subgraph_nameTransferredRelations = relations3(subgraph_nameTransferred, ({ one }) => ({
1089
+ registration: one(subgraph_registration, {
1090
+ fields: [subgraph_nameTransferred.registrationId],
1091
+ references: [subgraph_registration.id]
1092
+ }),
1093
+ newOwner: one(subgraph_account, {
1094
+ fields: [subgraph_nameTransferred.newOwnerId],
1095
+ references: [subgraph_account.id]
630
1096
  })
631
1097
  }));
632
- var contenthashChangedRelations = relations(contenthashChanged, ({ one }) => ({
633
- resolver: one(resolver, {
634
- fields: [contenthashChanged.resolverId],
635
- references: [resolver.id]
1098
+ var subgraph_addrChangedRelations = relations3(subgraph_addrChanged, ({ one }) => ({
1099
+ resolver: one(subgraph_resolver, {
1100
+ fields: [subgraph_addrChanged.resolverId],
1101
+ references: [subgraph_resolver.id]
1102
+ }),
1103
+ addr: one(subgraph_account, {
1104
+ fields: [subgraph_addrChanged.addrId],
1105
+ references: [subgraph_account.id]
636
1106
  })
637
1107
  }));
638
- var interfaceChangedRelations = relations(interfaceChanged, ({ one }) => ({
639
- resolver: one(resolver, {
640
- fields: [interfaceChanged.resolverId],
641
- references: [resolver.id]
1108
+ var subgraph_multicoinAddrChangedRelations = relations3(
1109
+ subgraph_multicoinAddrChanged,
1110
+ ({ one }) => ({
1111
+ resolver: one(subgraph_resolver, {
1112
+ fields: [subgraph_multicoinAddrChanged.resolverId],
1113
+ references: [subgraph_resolver.id]
1114
+ })
642
1115
  })
643
- }));
644
- var authorisationChangedRelations = relations(authorisationChanged, ({ one }) => ({
645
- resolver: one(resolver, {
646
- fields: [authorisationChanged.resolverId],
647
- references: [resolver.id]
1116
+ );
1117
+ var subgraph_nameChangedRelations = relations3(subgraph_nameChanged, ({ one }) => ({
1118
+ resolver: one(subgraph_resolver, {
1119
+ fields: [subgraph_nameChanged.resolverId],
1120
+ references: [subgraph_resolver.id]
648
1121
  })
649
1122
  }));
650
- var versionChangedRelations = relations(versionChanged, ({ one }) => ({
651
- resolver: one(resolver, {
652
- fields: [versionChanged.resolverId],
653
- references: [resolver.id]
1123
+ var subgraph_abiChangedRelations = relations3(subgraph_abiChanged, ({ one }) => ({
1124
+ resolver: one(subgraph_resolver, {
1125
+ fields: [subgraph_abiChanged.resolverId],
1126
+ references: [subgraph_resolver.id]
654
1127
  })
655
1128
  }));
656
-
657
- // src/resolver-records.schema.ts
658
- import { onchainTable as onchainTable2, relations as relations2, uniqueIndex } from "ponder";
659
- var ext_resolverRecords_resolver_relations = relations2(resolver, ({ one, many }) => ({
660
- // resolver has many address records
661
- addressRecords: many(ext_resolverAddressRecords),
662
- // resolver has many text records
663
- // NOTE: can't use `texts` because Resolver.texts is used by subgraph schema
664
- textRecords: many(ext_resolverTextRecords)
1129
+ var subgraph_pubkeyChangedRelations = relations3(subgraph_pubkeyChanged, ({ one }) => ({
1130
+ resolver: one(subgraph_resolver, {
1131
+ fields: [subgraph_pubkeyChanged.resolverId],
1132
+ references: [subgraph_resolver.id]
1133
+ })
665
1134
  }));
666
- var ext_resolverAddressRecords = onchainTable2(
667
- "ext_resolver_address_records",
668
- (t) => ({
669
- // keyed by (resolverId, coinType)
670
- id: t.text().primaryKey(),
671
- resolverId: t.text().notNull(),
672
- coinType: t.bigint().notNull(),
673
- address: t.text().notNull()
674
- }),
675
- (t) => ({
676
- byResolverIdAndCoinType: uniqueIndex().on(t.resolverId, t.coinType)
1135
+ var subgraph_textChangedRelations = relations3(subgraph_textChanged, ({ one }) => ({
1136
+ resolver: one(subgraph_resolver, {
1137
+ fields: [subgraph_textChanged.resolverId],
1138
+ references: [subgraph_resolver.id]
677
1139
  })
678
- );
679
- var ext_resolverAddressRecordsRelations = relations2(
680
- ext_resolverAddressRecords,
681
- ({ one, many }) => ({
682
- // belongs to resolver
683
- resolver: one(resolver, {
684
- fields: [ext_resolverAddressRecords.resolverId],
685
- references: [resolver.id]
1140
+ }));
1141
+ var subgraph_contenthashChangedRelations = relations3(
1142
+ subgraph_contenthashChanged,
1143
+ ({ one }) => ({
1144
+ resolver: one(subgraph_resolver, {
1145
+ fields: [subgraph_contenthashChanged.resolverId],
1146
+ references: [subgraph_resolver.id]
686
1147
  })
687
1148
  })
688
1149
  );
689
- var ext_resolverTextRecords = onchainTable2(
690
- "ext_resolver_text_records",
691
- (t) => ({
692
- // keyed by (resolverId, key)
693
- id: t.text().primaryKey(),
694
- resolverId: t.text().notNull(),
695
- key: t.text().notNull(),
696
- value: t.text().notNull()
697
- }),
698
- (t) => ({
699
- byResolverIdAndKey: uniqueIndex().on(t.resolverId, t.key)
1150
+ var subgraph_interfaceChangedRelations = relations3(
1151
+ subgraph_interfaceChanged,
1152
+ ({ one }) => ({
1153
+ resolver: one(subgraph_resolver, {
1154
+ fields: [subgraph_interfaceChanged.resolverId],
1155
+ references: [subgraph_resolver.id]
1156
+ })
700
1157
  })
701
1158
  );
702
- var ext_resolverTextRecordsRelations = relations2(
703
- ext_resolverTextRecords,
704
- ({ one, many }) => ({
705
- // belongs to resolver
706
- resolver: one(resolver, {
707
- fields: [ext_resolverTextRecords.resolverId],
708
- references: [resolver.id]
1159
+ var subgraph_authorisationChangedRelations = relations3(
1160
+ subgraph_authorisationChanged,
1161
+ ({ one }) => ({
1162
+ resolver: one(subgraph_resolver, {
1163
+ fields: [subgraph_authorisationChanged.resolverId],
1164
+ references: [subgraph_resolver.id]
709
1165
  })
710
1166
  })
711
1167
  );
1168
+ var subgraph_versionChangedRelations = relations3(subgraph_versionChanged, ({ one }) => ({
1169
+ resolver: one(subgraph_resolver, {
1170
+ fields: [subgraph_versionChanged.resolverId],
1171
+ references: [subgraph_resolver.id]
1172
+ })
1173
+ }));
712
1174
 
713
- // src/tokenscope.schema.ts
714
- import { index as index2, onchainTable as onchainTable3 } from "ponder";
715
- var ext_nameSales = onchainTable3(
716
- "ext_name_sales",
1175
+ // src/schemas/tokenscope.schema.ts
1176
+ import { index as index3, onchainTable as onchainTable4 } from "ponder";
1177
+ var nameSales = onchainTable4(
1178
+ "name_sales",
717
1179
  (t) => ({
718
1180
  /**
719
1181
  * Unique and deterministic identifier of the onchain event associated with the sale.
@@ -801,15 +1263,15 @@ var ext_nameSales = onchainTable3(
801
1263
  timestamp: t.bigint().notNull()
802
1264
  }),
803
1265
  (t) => ({
804
- idx_domainId: index2().on(t.domainId),
805
- idx_assetId: index2().on(t.assetId),
806
- idx_buyer: index2().on(t.buyer),
807
- idx_seller: index2().on(t.seller),
808
- idx_timestamp: index2().on(t.timestamp)
1266
+ idx_domainId: index3().on(t.domainId),
1267
+ idx_assetId: index3().on(t.assetId),
1268
+ idx_buyer: index3().on(t.buyer),
1269
+ idx_seller: index3().on(t.seller),
1270
+ idx_timestamp: index3().on(t.timestamp)
809
1271
  })
810
1272
  );
811
- var ext_nameTokens = onchainTable3(
812
- "ext_name_tokens",
1273
+ var nameTokens = onchainTable4(
1274
+ "name_tokens",
813
1275
  (t) => ({
814
1276
  /**
815
1277
  * The CAIP-19 Asset ID of the token.
@@ -888,261 +1350,83 @@ var ext_nameTokens = onchainTable3(
888
1350
  mintStatus: t.text().notNull()
889
1351
  }),
890
1352
  (t) => ({
891
- idx_domainId: index2().on(t.domainId),
892
- idx_owner: index2().on(t.owner)
893
- })
894
- );
895
-
896
- // src/resolver-relations.schema.ts
897
- import { onchainTable as onchainTable4, relations as relations3, uniqueIndex as uniqueIndex2 } from "ponder";
898
- var ext_resolverRelations_domain_relations = relations3(domain, ({ one, many }) => ({
899
- // domain has many resolver relations (i.e. one per chain, see above)
900
- resolverRelations: many(ext_domainResolverRelation)
901
- }));
902
- var ext_resolverRelations_resolver_relations = relations3(resolver, ({ one, many }) => ({
903
- // resolver has many domain relations
904
- domainRelations: many(ext_domainResolverRelation)
905
- }));
906
- var ext_domainResolverRelation = onchainTable4(
907
- "ext_domain_resolver_relations",
908
- (t) => ({
909
- // keyed by (chainId, domainId)
910
- id: t.text().primaryKey(),
911
- chainId: t.integer().notNull(),
912
- domainId: t.text().notNull(),
913
- resolverId: t.text().notNull()
914
- }),
915
- (t) => ({
916
- byChainIdAndDomain: uniqueIndex2().on(t.chainId, t.domainId)
917
- })
918
- );
919
- var ext_domainResolverRelationsRelations = relations3(
920
- ext_domainResolverRelation,
921
- ({ one, many }) => ({
922
- // belongs to domain
923
- domain: one(domain, {
924
- fields: [ext_domainResolverRelation.domainId],
925
- references: [domain.id]
926
- }),
927
- // belongs to resolver
928
- resolver: one(resolver, {
929
- fields: [ext_domainResolverRelation.resolverId],
930
- references: [resolver.id]
931
- })
1353
+ idx_domainId: index3().on(t.domainId),
1354
+ idx_owner: index3().on(t.owner)
932
1355
  })
933
1356
  );
934
-
935
- // src/referrals.schema.ts
936
- import { index as index3, onchainTable as onchainTable5, relations as relations4 } from "ponder";
937
- var ext_registrationReferral = onchainTable5(
938
- "ext_registration_referral",
939
- (t) => ({
940
- // keyed by any arbitrary unique id, usually `event.id`
941
- id: t.text().primaryKey(),
942
- referrerId: t.hex().notNull(),
943
- domainId: t.text().notNull(),
944
- refereeId: t.hex().notNull(),
945
- baseCost: t.bigint().notNull(),
946
- premium: t.bigint().notNull(),
947
- total: t.bigint().notNull(),
948
- // chainId the transaction occurred on
949
- chainId: t.integer().notNull(),
950
- // transaction's hash
951
- transactionHash: t.hex().notNull(),
952
- // block's Unix timestamp in seconds
953
- timestamp: t.bigint().notNull()
954
- }),
955
- (t) => ({
956
- byRefereeId: index3().on(t.refereeId),
957
- byReferrerId: index3().on(t.referrerId)
958
- })
959
- );
960
- var ext_registrationReferral_relations = relations4(
961
- ext_registrationReferral,
962
- ({ one, many }) => ({
963
- // RegistrationReferral references one Referrer
964
- referrer: one(ext_referrer, {
965
- fields: [ext_registrationReferral.referrerId],
966
- references: [ext_referrer.id]
967
- }),
968
- // RegistrationReferral references one Account (as referee)
969
- referee: one(account, {
970
- fields: [ext_registrationReferral.refereeId],
971
- references: [account.id]
972
- }),
973
- // RegistrationReferral references one Domain
974
- domain: one(domain, {
975
- fields: [ext_registrationReferral.domainId],
976
- references: [domain.id]
977
- })
978
- })
979
- );
980
- var ext_renewalReferral = onchainTable5(
981
- "ext_renewal_referral",
982
- (t) => ({
983
- // keyed by any arbitrary unique id, usually `event.id`
984
- id: t.text().primaryKey(),
985
- referrerId: t.hex().notNull(),
986
- refereeId: t.hex().notNull(),
987
- domainId: t.text().notNull(),
988
- cost: t.bigint().notNull(),
989
- // chainId the transaction occurred on
990
- chainId: t.integer().notNull(),
991
- // transaction's hash
992
- transactionHash: t.hex().notNull(),
993
- // Block's Unix timestamp in seconds
994
- timestamp: t.bigint().notNull()
995
- }),
996
- (t) => ({
997
- byRefereeId: index3().on(t.refereeId),
998
- byReferrerId: index3().on(t.referrerId)
999
- })
1000
- );
1001
- var ext_renewalReferral_relations = relations4(ext_renewalReferral, ({ one, many }) => ({
1002
- // RenewalReferral references one Referrer
1003
- referrer: one(ext_referrer, {
1004
- fields: [ext_renewalReferral.referrerId],
1005
- references: [ext_referrer.id]
1006
- }),
1007
- // RenewalReferral references one Account (as referee)
1008
- referee: one(account, {
1009
- fields: [ext_renewalReferral.refereeId],
1010
- references: [account.id]
1011
- }),
1012
- // RenewalReferral references one Domain
1013
- domain: one(domain, {
1014
- fields: [ext_renewalReferral.domainId],
1015
- references: [domain.id]
1016
- })
1017
- }));
1018
- var ext_referrals_domain_relations = relations4(domain, ({ one, many }) => ({
1019
- // Domain has many RegistrationReferrals
1020
- registrationReferrals: many(ext_registrationReferral),
1021
- // Domain has many RenewalReferrals
1022
- renewalReferrals: many(ext_renewalReferral)
1023
- }));
1024
- var ext_referrer = onchainTable5(
1025
- "ext_referral_totals",
1026
- (t) => ({
1027
- // keyed by Referrer's id (bytes32 hex)
1028
- id: t.hex().primaryKey(),
1029
- valueWei: t.bigint().notNull()
1030
- }),
1031
- (t) => ({})
1032
- );
1033
- var ext_referrer_relations = relations4(ext_referrer, ({ one, many }) => ({
1034
- // Referrer has many RegistrationReferrals
1035
- registrationReferrals: many(ext_registrationReferral),
1036
- // Referrer has many RenewalReferrals
1037
- renewalReferrals: many(ext_renewalReferral)
1038
- }));
1039
-
1040
- // src/primary-names.schema.ts
1041
- import { onchainTable as onchainTable6, relations as relations5, uniqueIndex as uniqueIndex3 } from "ponder";
1042
- var ext_primaryNames_domain_relations = relations5(account, ({ one, many }) => ({
1043
- // account has many primary names
1044
- primaryNames: many(ext_primaryName)
1045
- }));
1046
- var ext_primaryName = onchainTable6(
1047
- "ext_primary_names",
1048
- (t) => ({
1049
- // keyed by (address, coinType)
1050
- id: t.text().primaryKey(),
1051
- address: t.hex().notNull(),
1052
- coinType: t.bigint().notNull(),
1053
- /**
1054
- * Represents the ENSIP-19 Primary Name value for a given (address, coinType).
1055
- *
1056
- * The value of this field is guaranteed to be a non-empty-string normalized ENS name.
1057
- */
1058
- name: t.text().notNull()
1059
- }),
1060
- (t) => ({
1061
- byAddressAndCoinType: uniqueIndex3().on(t.address, t.coinType)
1062
- })
1063
- );
1064
- var ext_primaryNameRelations = relations5(ext_primaryName, ({ one, many }) => ({
1065
- // belongs to account
1066
- account: one(account, {
1067
- fields: [ext_primaryName.address],
1068
- references: [account.id]
1069
- })
1070
- }));
1071
1357
  export {
1072
- abiChanged,
1073
- abiChangedRelations,
1074
- account,
1075
- accountRelations,
1076
- addrChanged,
1077
- addrChangedRelations,
1078
- authorisationChanged,
1079
- authorisationChangedRelations,
1080
- contenthashChanged,
1081
- contenthashChangedRelations,
1082
- domain,
1083
- domainRelations,
1084
- expiryExtended,
1085
- expiryExtendedRelations,
1086
- ext_domainResolverRelation,
1087
- ext_domainResolverRelationsRelations,
1088
- ext_nameSales,
1089
- ext_nameTokens,
1090
- ext_primaryName,
1091
- ext_primaryNameRelations,
1092
- ext_primaryNames_domain_relations,
1093
- ext_referrals_domain_relations,
1094
- ext_referrer,
1095
- ext_referrer_relations,
1096
- ext_registrationReferral,
1097
- ext_registrationReferral_relations,
1098
- ext_renewalReferral,
1099
- ext_renewalReferral_relations,
1100
- ext_resolverAddressRecords,
1101
- ext_resolverAddressRecordsRelations,
1102
- ext_resolverRecords_resolver_relations,
1103
- ext_resolverRelations_domain_relations,
1104
- ext_resolverRelations_resolver_relations,
1105
- ext_resolverTextRecords,
1106
- ext_resolverTextRecordsRelations,
1107
- fusesSet,
1108
- fusesSetRelations,
1109
- interfaceChanged,
1110
- interfaceChangedRelations,
1111
- multicoinAddrChanged,
1112
- multicoinAddrChangedRelations,
1113
- nameChanged,
1114
- nameChangedRelations,
1115
- nameRegistered,
1116
- nameRegisteredRelations,
1117
- nameRenewed,
1118
- nameRenewedRelations,
1119
- nameTransferred,
1120
- nameTransferredRelations,
1121
- nameUnwrapped,
1122
- nameUnwrappedRelations,
1123
- nameWrapped,
1124
- nameWrappedRelations,
1125
- newOwner,
1126
- newOwnerRelations,
1127
- newResolver,
1128
- newResolverRelations,
1129
- newTTL,
1130
- newTTLRelations,
1131
- pubkeyChanged,
1132
- pubkeyChangedRelations,
1133
- registration,
1134
- registrationRelations,
1135
- resolver,
1136
- resolverRelations,
1137
- textChanged,
1138
- textChangedRelations,
1139
- transfer,
1140
- transferRelations,
1141
- versionChanged,
1142
- versionChangedRelations,
1143
- wrappedDomain,
1144
- wrappedDomainRelations,
1145
- wrappedTransfer,
1146
- wrappedTransferRelations
1358
+ internal_registrarActionMetadata,
1359
+ migratedNode,
1360
+ nameSales,
1361
+ nameTokens,
1362
+ nodeResolverRelation,
1363
+ registrarActionRelations,
1364
+ registrarActionType,
1365
+ registrarActions,
1366
+ registrationLifecycleRelations,
1367
+ registrationLifecycles,
1368
+ resolverAddressRecord,
1369
+ resolverAddressRecordRelations,
1370
+ resolverRecords,
1371
+ resolverRecords_relations,
1372
+ resolverTextRecord,
1373
+ resolverTextRecordRelations,
1374
+ reverseNameRecord,
1375
+ subgraph_abiChanged,
1376
+ subgraph_abiChangedRelations,
1377
+ subgraph_account,
1378
+ subgraph_accountRelations,
1379
+ subgraph_addrChanged,
1380
+ subgraph_addrChangedRelations,
1381
+ subgraph_authorisationChanged,
1382
+ subgraph_authorisationChangedRelations,
1383
+ subgraph_contenthashChanged,
1384
+ subgraph_contenthashChangedRelations,
1385
+ subgraph_domain,
1386
+ subgraph_domainRelations,
1387
+ subgraph_expiryExtended,
1388
+ subgraph_expiryExtendedRelations,
1389
+ subgraph_fusesSet,
1390
+ subgraph_fusesSetRelations,
1391
+ subgraph_interfaceChanged,
1392
+ subgraph_interfaceChangedRelations,
1393
+ subgraph_multicoinAddrChanged,
1394
+ subgraph_multicoinAddrChangedRelations,
1395
+ subgraph_nameChanged,
1396
+ subgraph_nameChangedRelations,
1397
+ subgraph_nameRegistered,
1398
+ subgraph_nameRegisteredRelations,
1399
+ subgraph_nameRenewed,
1400
+ subgraph_nameRenewedRelations,
1401
+ subgraph_nameTransferred,
1402
+ subgraph_nameTransferredRelations,
1403
+ subgraph_nameUnwrapped,
1404
+ subgraph_nameUnwrappedRelations,
1405
+ subgraph_nameWrapped,
1406
+ subgraph_nameWrappedRelations,
1407
+ subgraph_newOwner,
1408
+ subgraph_newOwnerRelations,
1409
+ subgraph_newResolver,
1410
+ subgraph_newResolverRelations,
1411
+ subgraph_newTTL,
1412
+ subgraph_newTTLRelations,
1413
+ subgraph_pubkeyChanged,
1414
+ subgraph_pubkeyChangedRelations,
1415
+ subgraph_registration,
1416
+ subgraph_registrationRelations,
1417
+ subgraph_resolver,
1418
+ subgraph_resolverRelations,
1419
+ subgraph_textChanged,
1420
+ subgraph_textChangedRelations,
1421
+ subgraph_transfer,
1422
+ subgraph_transferRelations,
1423
+ subgraph_versionChanged,
1424
+ subgraph_versionChangedRelations,
1425
+ subgraph_wrappedDomain,
1426
+ subgraph_wrappedDomainRelations,
1427
+ subgraph_wrappedTransfer,
1428
+ subgraph_wrappedTransferRelations,
1429
+ subregistries,
1430
+ subregistryRelations
1147
1431
  };
1148
1432
  //# sourceMappingURL=ponder.schema.js.map