@secondlayer/shared 6.0.0 → 6.2.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.
@@ -23,6 +23,7 @@ interface BlocksTable {
23
23
  hash: string;
24
24
  parent_hash: string;
25
25
  burn_block_height: number;
26
+ burn_block_hash: ColumnType<string | null, string | null | undefined, string | null>;
26
27
  timestamp: number;
27
28
  canonical: Generated<boolean>;
28
29
  created_at: Generated<Date>;
@@ -121,6 +122,8 @@ interface ApiKeysTable {
121
122
  rate_limit: Generated<number>;
122
123
  ip_address: string;
123
124
  account_id: string;
125
+ product: Generated<"account" | "streams" | "index">;
126
+ tier: "free" | "build" | "scale" | "enterprise" | null;
124
127
  last_used_at: Date | null;
125
128
  revoked_at: Date | null;
126
129
  created_at: Generated<Date>;
@@ -163,6 +166,8 @@ interface UsageDailyTable {
163
166
  date: string;
164
167
  api_requests: Generated<number>;
165
168
  deliveries: Generated<number>;
169
+ streams_events_returned: Generated<number>;
170
+ index_decoded_events_returned: Generated<number>;
166
171
  }
167
172
  interface UsageSnapshotsTable {
168
173
  id: Generated<string>;
@@ -291,6 +296,44 @@ interface ProcessedStripeEventsTable {
291
296
  event_type: string;
292
297
  processed_at: Generated<Date>;
293
298
  }
299
+ interface DecodedEventsTable {
300
+ cursor: string;
301
+ block_height: number;
302
+ tx_id: string;
303
+ tx_index: number;
304
+ event_index: number;
305
+ event_type: string;
306
+ microblock_hash: string | null;
307
+ canonical: Generated<boolean>;
308
+ contract_id: string | null;
309
+ sender: string | null;
310
+ recipient: string | null;
311
+ amount: string | null;
312
+ asset_identifier: string | null;
313
+ value: string | null;
314
+ memo: string | null;
315
+ source_cursor: string;
316
+ created_at: Generated<Date>;
317
+ }
318
+ interface L2DecoderCheckpointsTable {
319
+ decoder_name: string;
320
+ last_cursor: string | null;
321
+ updated_at: Generated<Date>;
322
+ }
323
+ interface ChainReorgsTable {
324
+ id: Generated<string>;
325
+ detected_at: Generated<Date>;
326
+ fork_point_height: number;
327
+ old_index_block_hash: string | null;
328
+ new_index_block_hash: string | null;
329
+ orphaned_from_height: number;
330
+ orphaned_from_event_index: number;
331
+ orphaned_to_height: number;
332
+ orphaned_to_event_index: number;
333
+ new_canonical_height: number;
334
+ new_canonical_event_index: number;
335
+ created_at: Generated<Date>;
336
+ }
294
337
  interface Database {
295
338
  blocks: BlocksTable;
296
339
  transactions: TransactionsTable;
@@ -326,6 +369,9 @@ interface Database {
326
369
  subscriptions: SubscriptionsTable;
327
370
  subscription_outbox: SubscriptionOutboxTable;
328
371
  subscription_deliveries: SubscriptionDeliveriesTable;
372
+ decoded_events: DecodedEventsTable;
373
+ l2_decoder_checkpoints: L2DecoderCheckpointsTable;
374
+ chain_reorgs: ChainReorgsTable;
329
375
  }
330
376
  type TenantStatus = "provisioning" | "active" | "limit_warning" | "paused_limit" | "suspended" | "error" | "deleted";
331
377
  interface TenantsTable {
@@ -562,4 +608,4 @@ declare function getDb(connectionString?: string): Kysely<Database>;
562
608
  declare function getRawClient(role?: "source" | "target"): ReturnType<typeof postgres>;
563
609
  /** Close all DB connection pools. Call in CLI commands to allow process exit. */
564
610
  declare function closeDb(): Promise<void>;
565
- export { sql, parseJsonb, jsonb, getTargetDb, getSourceDb, getRawClient, getDb, closeDb, WaitlistTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenantComputeAddon, UpdateTenant, UpdateSubscriptionOutbox, UpdateSubscription, UpdateSubgraphOperation, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, UpdateAccountSpendCap, TransactionsTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantStatus, TenantComputeAddonsTable, TenantComputeAddon, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubscriptionsTable, SubscriptionStatus, SubscriptionRuntime, SubscriptionOutboxTable, SubscriptionOutbox, SubscriptionFormat, SubscriptionDelivery, SubscriptionDeliveriesTable, Subscription, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphOperationsTable, SubgraphOperationStatus, SubgraphOperationKind, SubgraphOperation, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, SessionsTable, Session, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, ProcessedStripeEventsTable, OutboxStatus, MagicLinksTable, MagicLink, InsertTransaction, InsertTenantUsageMonthly, InsertTenantComputeAddon, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubscriptionOutbox, InsertSubscriptionDelivery, InsertSubscription, InsertSubgraphUsageDaily, InsertSubgraphOperation, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountSpendCap, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, Event, Database, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountSpendCapsTable, AccountSpendCap, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
611
+ export { sql, parseJsonb, jsonb, getTargetDb, getSourceDb, getRawClient, getDb, closeDb, WaitlistTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenantComputeAddon, UpdateTenant, UpdateSubscriptionOutbox, UpdateSubscription, UpdateSubgraphOperation, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, UpdateAccountSpendCap, TransactionsTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantStatus, TenantComputeAddonsTable, TenantComputeAddon, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubscriptionsTable, SubscriptionStatus, SubscriptionRuntime, SubscriptionOutboxTable, SubscriptionOutbox, SubscriptionFormat, SubscriptionDelivery, SubscriptionDeliveriesTable, Subscription, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphOperationsTable, SubgraphOperationStatus, SubgraphOperationKind, SubgraphOperation, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, SessionsTable, Session, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, ProcessedStripeEventsTable, OutboxStatus, MagicLinksTable, MagicLink, L2DecoderCheckpointsTable, InsertTransaction, InsertTenantUsageMonthly, InsertTenantComputeAddon, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubscriptionOutbox, InsertSubscriptionDelivery, InsertSubscription, InsertSubgraphUsageDaily, InsertSubgraphOperation, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountSpendCap, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, Event, DecodedEventsTable, Database, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, ChainReorgsTable, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountSpendCapsTable, AccountSpendCap, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
@@ -5,6 +5,7 @@ interface BlocksTable {
5
5
  hash: string;
6
6
  parent_hash: string;
7
7
  burn_block_height: number;
8
+ burn_block_hash: ColumnType<string | null, string | null | undefined, string | null>;
8
9
  timestamp: number;
9
10
  canonical: Generated<boolean>;
10
11
  created_at: Generated<Date>;
@@ -103,6 +104,8 @@ interface ApiKeysTable {
103
104
  rate_limit: Generated<number>;
104
105
  ip_address: string;
105
106
  account_id: string;
107
+ product: Generated<"account" | "streams" | "index">;
108
+ tier: "free" | "build" | "scale" | "enterprise" | null;
106
109
  last_used_at: Date | null;
107
110
  revoked_at: Date | null;
108
111
  created_at: Generated<Date>;
@@ -145,6 +148,8 @@ interface UsageDailyTable {
145
148
  date: string;
146
149
  api_requests: Generated<number>;
147
150
  deliveries: Generated<number>;
151
+ streams_events_returned: Generated<number>;
152
+ index_decoded_events_returned: Generated<number>;
148
153
  }
149
154
  interface UsageSnapshotsTable {
150
155
  id: Generated<string>;
@@ -273,6 +278,44 @@ interface ProcessedStripeEventsTable {
273
278
  event_type: string;
274
279
  processed_at: Generated<Date>;
275
280
  }
281
+ interface DecodedEventsTable {
282
+ cursor: string;
283
+ block_height: number;
284
+ tx_id: string;
285
+ tx_index: number;
286
+ event_index: number;
287
+ event_type: string;
288
+ microblock_hash: string | null;
289
+ canonical: Generated<boolean>;
290
+ contract_id: string | null;
291
+ sender: string | null;
292
+ recipient: string | null;
293
+ amount: string | null;
294
+ asset_identifier: string | null;
295
+ value: string | null;
296
+ memo: string | null;
297
+ source_cursor: string;
298
+ created_at: Generated<Date>;
299
+ }
300
+ interface L2DecoderCheckpointsTable {
301
+ decoder_name: string;
302
+ last_cursor: string | null;
303
+ updated_at: Generated<Date>;
304
+ }
305
+ interface ChainReorgsTable {
306
+ id: Generated<string>;
307
+ detected_at: Generated<Date>;
308
+ fork_point_height: number;
309
+ old_index_block_hash: string | null;
310
+ new_index_block_hash: string | null;
311
+ orphaned_from_height: number;
312
+ orphaned_from_event_index: number;
313
+ orphaned_to_height: number;
314
+ orphaned_to_event_index: number;
315
+ new_canonical_height: number;
316
+ new_canonical_event_index: number;
317
+ created_at: Generated<Date>;
318
+ }
276
319
  interface Database {
277
320
  blocks: BlocksTable;
278
321
  transactions: TransactionsTable;
@@ -308,6 +351,9 @@ interface Database {
308
351
  subscriptions: SubscriptionsTable;
309
352
  subscription_outbox: SubscriptionOutboxTable;
310
353
  subscription_deliveries: SubscriptionDeliveriesTable;
354
+ decoded_events: DecodedEventsTable;
355
+ l2_decoder_checkpoints: L2DecoderCheckpointsTable;
356
+ chain_reorgs: ChainReorgsTable;
311
357
  }
312
358
  type TenantStatus = "provisioning" | "active" | "limit_warning" | "paused_limit" | "suspended" | "error" | "deleted";
313
359
  interface TenantsTable {
@@ -5,6 +5,7 @@ interface BlocksTable {
5
5
  hash: string;
6
6
  parent_hash: string;
7
7
  burn_block_height: number;
8
+ burn_block_hash: ColumnType<string | null, string | null | undefined, string | null>;
8
9
  timestamp: number;
9
10
  canonical: Generated<boolean>;
10
11
  created_at: Generated<Date>;
@@ -103,6 +104,8 @@ interface ApiKeysTable {
103
104
  rate_limit: Generated<number>;
104
105
  ip_address: string;
105
106
  account_id: string;
107
+ product: Generated<"account" | "streams" | "index">;
108
+ tier: "free" | "build" | "scale" | "enterprise" | null;
106
109
  last_used_at: Date | null;
107
110
  revoked_at: Date | null;
108
111
  created_at: Generated<Date>;
@@ -145,6 +148,8 @@ interface UsageDailyTable {
145
148
  date: string;
146
149
  api_requests: Generated<number>;
147
150
  deliveries: Generated<number>;
151
+ streams_events_returned: Generated<number>;
152
+ index_decoded_events_returned: Generated<number>;
148
153
  }
149
154
  interface UsageSnapshotsTable {
150
155
  id: Generated<string>;
@@ -273,6 +278,44 @@ interface ProcessedStripeEventsTable {
273
278
  event_type: string;
274
279
  processed_at: Generated<Date>;
275
280
  }
281
+ interface DecodedEventsTable {
282
+ cursor: string;
283
+ block_height: number;
284
+ tx_id: string;
285
+ tx_index: number;
286
+ event_index: number;
287
+ event_type: string;
288
+ microblock_hash: string | null;
289
+ canonical: Generated<boolean>;
290
+ contract_id: string | null;
291
+ sender: string | null;
292
+ recipient: string | null;
293
+ amount: string | null;
294
+ asset_identifier: string | null;
295
+ value: string | null;
296
+ memo: string | null;
297
+ source_cursor: string;
298
+ created_at: Generated<Date>;
299
+ }
300
+ interface L2DecoderCheckpointsTable {
301
+ decoder_name: string;
302
+ last_cursor: string | null;
303
+ updated_at: Generated<Date>;
304
+ }
305
+ interface ChainReorgsTable {
306
+ id: Generated<string>;
307
+ detected_at: Generated<Date>;
308
+ fork_point_height: number;
309
+ old_index_block_hash: string | null;
310
+ new_index_block_hash: string | null;
311
+ orphaned_from_height: number;
312
+ orphaned_from_event_index: number;
313
+ orphaned_to_height: number;
314
+ orphaned_to_event_index: number;
315
+ new_canonical_height: number;
316
+ new_canonical_event_index: number;
317
+ created_at: Generated<Date>;
318
+ }
276
319
  interface Database {
277
320
  blocks: BlocksTable;
278
321
  transactions: TransactionsTable;
@@ -308,6 +351,9 @@ interface Database {
308
351
  subscriptions: SubscriptionsTable;
309
352
  subscription_outbox: SubscriptionOutboxTable;
310
353
  subscription_deliveries: SubscriptionDeliveriesTable;
354
+ decoded_events: DecodedEventsTable;
355
+ l2_decoder_checkpoints: L2DecoderCheckpointsTable;
356
+ chain_reorgs: ChainReorgsTable;
311
357
  }
312
358
  type TenantStatus = "provisioning" | "active" | "limit_warning" | "paused_limit" | "suspended" | "error" | "deleted";
313
359
  interface TenantsTable {
@@ -6,6 +6,7 @@ interface BlocksTable {
6
6
  hash: string;
7
7
  parent_hash: string;
8
8
  burn_block_height: number;
9
+ burn_block_hash: ColumnType<string | null, string | null | undefined, string | null>;
9
10
  timestamp: number;
10
11
  canonical: Generated<boolean>;
11
12
  created_at: Generated<Date>;
@@ -104,6 +105,8 @@ interface ApiKeysTable {
104
105
  rate_limit: Generated<number>;
105
106
  ip_address: string;
106
107
  account_id: string;
108
+ product: Generated<"account" | "streams" | "index">;
109
+ tier: "free" | "build" | "scale" | "enterprise" | null;
107
110
  last_used_at: Date | null;
108
111
  revoked_at: Date | null;
109
112
  created_at: Generated<Date>;
@@ -146,6 +149,8 @@ interface UsageDailyTable {
146
149
  date: string;
147
150
  api_requests: Generated<number>;
148
151
  deliveries: Generated<number>;
152
+ streams_events_returned: Generated<number>;
153
+ index_decoded_events_returned: Generated<number>;
149
154
  }
150
155
  interface UsageSnapshotsTable {
151
156
  id: Generated<string>;
@@ -274,6 +279,44 @@ interface ProcessedStripeEventsTable {
274
279
  event_type: string;
275
280
  processed_at: Generated<Date>;
276
281
  }
282
+ interface DecodedEventsTable {
283
+ cursor: string;
284
+ block_height: number;
285
+ tx_id: string;
286
+ tx_index: number;
287
+ event_index: number;
288
+ event_type: string;
289
+ microblock_hash: string | null;
290
+ canonical: Generated<boolean>;
291
+ contract_id: string | null;
292
+ sender: string | null;
293
+ recipient: string | null;
294
+ amount: string | null;
295
+ asset_identifier: string | null;
296
+ value: string | null;
297
+ memo: string | null;
298
+ source_cursor: string;
299
+ created_at: Generated<Date>;
300
+ }
301
+ interface L2DecoderCheckpointsTable {
302
+ decoder_name: string;
303
+ last_cursor: string | null;
304
+ updated_at: Generated<Date>;
305
+ }
306
+ interface ChainReorgsTable {
307
+ id: Generated<string>;
308
+ detected_at: Generated<Date>;
309
+ fork_point_height: number;
310
+ old_index_block_hash: string | null;
311
+ new_index_block_hash: string | null;
312
+ orphaned_from_height: number;
313
+ orphaned_from_event_index: number;
314
+ orphaned_to_height: number;
315
+ orphaned_to_event_index: number;
316
+ new_canonical_height: number;
317
+ new_canonical_event_index: number;
318
+ created_at: Generated<Date>;
319
+ }
277
320
  interface Database {
278
321
  blocks: BlocksTable;
279
322
  transactions: TransactionsTable;
@@ -309,6 +352,9 @@ interface Database {
309
352
  subscriptions: SubscriptionsTable;
310
353
  subscription_outbox: SubscriptionOutboxTable;
311
354
  subscription_deliveries: SubscriptionDeliveriesTable;
355
+ decoded_events: DecodedEventsTable;
356
+ l2_decoder_checkpoints: L2DecoderCheckpointsTable;
357
+ chain_reorgs: ChainReorgsTable;
312
358
  }
313
359
  type TenantStatus = "provisioning" | "active" | "limit_warning" | "paused_limit" | "suspended" | "error" | "deleted";
314
360
  interface TenantsTable {