@secondlayer/shared 11.7.0 → 11.8.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.
Files changed (163) hide show
  1. package/dist/src/archive/copy-loader.d.ts +1 -1
  2. package/dist/src/archive/copy-loader.js +4 -20
  3. package/dist/src/archive/copy-loader.js.map +2 -2
  4. package/dist/src/archive/derived-stage-report.d.ts +1 -1
  5. package/dist/src/archive/derived-stage-report.js +3 -19
  6. package/dist/src/archive/derived-stage-report.js.map +2 -2
  7. package/dist/src/archive/disk-guard.d.ts +1 -1
  8. package/dist/src/archive/disk-guard.js +3 -19
  9. package/dist/src/archive/disk-guard.js.map +2 -2
  10. package/dist/src/archive/instance-diagnosis.d.ts +1 -1
  11. package/dist/src/archive/instance-diagnosis.js +6 -22
  12. package/dist/src/archive/instance-diagnosis.js.map +2 -2
  13. package/dist/src/archive/key-registry.d.ts +1 -1
  14. package/dist/src/archive/key-registry.js +12 -12
  15. package/dist/src/archive/key-registry.js.map +1 -1
  16. package/dist/src/archive/per-height-digest.d.ts +1 -1
  17. package/dist/src/archive/per-height-digest.js +3 -17
  18. package/dist/src/archive/per-height-digest.js.map +5 -5
  19. package/dist/src/archive/progress.d.ts +1 -1
  20. package/dist/src/archive/progress.js +4 -20
  21. package/dist/src/archive/progress.js.map +2 -2
  22. package/dist/src/archive/range-digest.d.ts +25 -30
  23. package/dist/src/archive/range-digest.js +4 -20
  24. package/dist/src/archive/range-digest.js.map +2 -2
  25. package/dist/src/archive/reference.d.ts +1 -1
  26. package/dist/src/archive/reference.js +14 -12
  27. package/dist/src/archive/reference.js.map +5 -5
  28. package/dist/src/archive/root-key.d.ts +1 -1
  29. package/dist/src/archive/root-key.js +3 -19
  30. package/dist/src/archive/root-key.js.map +2 -2
  31. package/dist/src/archive/semantic-digest-builder.d.ts +25 -30
  32. package/dist/src/archive/semantic-digest-builder.js +5 -19
  33. package/dist/src/archive/semantic-digest-builder.js.map +5 -5
  34. package/dist/src/archive/semantic-digest.d.ts +1 -1
  35. package/dist/src/archive/semantic-digest.js +4 -20
  36. package/dist/src/archive/semantic-digest.js.map +2 -2
  37. package/dist/src/archive/status.d.ts +1 -1
  38. package/dist/src/archive/status.js +4 -20
  39. package/dist/src/archive/status.js.map +2 -2
  40. package/dist/src/coverage/index.d.ts +24 -29
  41. package/dist/src/coverage/index.js +80 -96
  42. package/dist/src/coverage/index.js.map +2 -2
  43. package/dist/src/crypto/ed25519.d.ts +1 -1
  44. package/dist/src/crypto/ed25519.js +13 -13
  45. package/dist/src/crypto/ed25519.js.map +1 -1
  46. package/dist/src/crypto/hmac.d.ts +1 -1
  47. package/dist/src/crypto/hmac.js +9 -9
  48. package/dist/src/crypto/hmac.js.map +1 -1
  49. package/dist/src/crypto/secondlayer-webhook.d.ts +1 -1
  50. package/dist/src/crypto/secondlayer-webhook.js +14 -14
  51. package/dist/src/crypto/secondlayer-webhook.js.map +2 -2
  52. package/dist/src/crypto/secrets.d.ts +1 -1
  53. package/dist/src/crypto/secrets.js +15 -29
  54. package/dist/src/crypto/secrets.js.map +5 -5
  55. package/dist/src/crypto/standard-webhooks.d.ts +1 -1
  56. package/dist/src/crypto/standard-webhooks.js +3 -19
  57. package/dist/src/crypto/standard-webhooks.js.map +2 -2
  58. package/dist/src/db/index.d.ts +46 -57
  59. package/dist/src/db/index.js +42 -58
  60. package/dist/src/db/index.js.map +6 -6
  61. package/dist/src/db/jsonb.d.ts +1 -1
  62. package/dist/src/db/jsonb.js +3 -19
  63. package/dist/src/db/jsonb.js.map +2 -2
  64. package/dist/src/db/queries/chain-reorgs.d.ts +24 -29
  65. package/dist/src/db/queries/chain-reorgs.js +29 -45
  66. package/dist/src/db/queries/chain-reorgs.js.map +6 -6
  67. package/dist/src/db/queries/contracts.d.ts +24 -29
  68. package/dist/src/db/queries/contracts.js +9 -23
  69. package/dist/src/db/queries/contracts.js.map +5 -5
  70. package/dist/src/db/queries/instance.d.ts +24 -29
  71. package/dist/src/db/queries/instance.js +7 -23
  72. package/dist/src/db/queries/instance.js.map +2 -2
  73. package/dist/src/db/queries/integrity.d.ts +25 -30
  74. package/dist/src/db/queries/integrity.js +8 -23
  75. package/dist/src/db/queries/integrity.js.map +3 -3
  76. package/dist/src/db/queries/subgraph-gaps.d.ts +24 -29
  77. package/dist/src/db/queries/subgraph-gaps.js +5 -21
  78. package/dist/src/db/queries/subgraph-gaps.js.map +2 -2
  79. package/dist/src/db/queries/subgraph-operations.d.ts +24 -29
  80. package/dist/src/db/queries/subgraph-operations.js +17 -33
  81. package/dist/src/db/queries/subgraph-operations.js.map +2 -2
  82. package/dist/src/db/queries/subgraphs.d.ts +23 -44
  83. package/dist/src/db/queries/subgraphs.js +15 -46
  84. package/dist/src/db/queries/subgraphs.js.map +5 -5
  85. package/dist/src/db/queries/sync-scope.d.ts +24 -29
  86. package/dist/src/db/queries/sync-scope.js +6 -22
  87. package/dist/src/db/queries/sync-scope.js.map +2 -2
  88. package/dist/src/db/queries/webhooks.d.ts +24 -29
  89. package/dist/src/db/queries/webhooks.js +54 -50
  90. package/dist/src/db/queries/webhooks.js.map +5 -5
  91. package/dist/src/db/schema.d.ts +27 -37
  92. package/dist/src/env.d.ts +1 -1
  93. package/dist/src/env.js +7 -23
  94. package/dist/src/env.js.map +2 -2
  95. package/dist/src/errors.d.ts +1 -1
  96. package/dist/src/errors.js +15 -31
  97. package/dist/src/errors.js.map +2 -2
  98. package/dist/src/index-http.d.ts +1 -1
  99. package/dist/src/index-http.js +3 -19
  100. package/dist/src/index-http.js.map +2 -2
  101. package/dist/src/index-internal-auth.d.ts +1 -1
  102. package/dist/src/index-internal-auth.js +7 -23
  103. package/dist/src/index-internal-auth.js.map +2 -2
  104. package/dist/src/index.d.ts +164 -187
  105. package/dist/src/index.js +261 -316
  106. package/dist/src/index.js.map +13 -13
  107. package/dist/src/leader.d.ts +1 -1
  108. package/dist/src/leader.js +7 -21
  109. package/dist/src/leader.js.map +5 -5
  110. package/dist/src/logger.js +1 -17
  111. package/dist/src/logger.js.map +2 -2
  112. package/dist/src/mode.d.ts +1 -1
  113. package/dist/src/mode.js +5 -21
  114. package/dist/src/mode.js.map +2 -2
  115. package/dist/src/node/archive-client.d.ts +1 -1
  116. package/dist/src/node/archive-client.js +9 -23
  117. package/dist/src/node/archive-client.js.map +5 -5
  118. package/dist/src/node/client.d.ts +1 -1
  119. package/dist/src/node/client.js +4 -18
  120. package/dist/src/node/client.js.map +5 -5
  121. package/dist/src/node/consensus.d.ts +1 -1
  122. package/dist/src/node/consensus.js +5 -21
  123. package/dist/src/node/consensus.js.map +2 -2
  124. package/dist/src/node/hiro-client.d.ts +1 -1
  125. package/dist/src/node/hiro-client.js +1 -17
  126. package/dist/src/node/hiro-client.js.map +2 -2
  127. package/dist/src/node/hiro-pg-client.js +1 -17
  128. package/dist/src/node/hiro-pg-client.js.map +2 -2
  129. package/dist/src/node/local-client.d.ts +24 -29
  130. package/dist/src/node/local-client.js +3 -19
  131. package/dist/src/node/local-client.js.map +2 -2
  132. package/dist/src/node/nakamoto.d.ts +1 -1
  133. package/dist/src/node/nakamoto.js +12 -28
  134. package/dist/src/node/nakamoto.js.map +2 -2
  135. package/dist/src/queue/listener.d.ts +1 -1
  136. package/dist/src/queue/listener.js +4 -20
  137. package/dist/src/queue/listener.js.map +2 -2
  138. package/dist/src/runtime/index.d.ts +1 -1
  139. package/dist/src/runtime/index.js +51 -67
  140. package/dist/src/runtime/index.js.map +2 -2
  141. package/dist/src/schemas/index.d.ts +1 -4
  142. package/dist/src/schemas/index.js +19 -37
  143. package/dist/src/schemas/index.js.map +3 -3
  144. package/dist/src/schemas/subgraphs.d.ts +1 -4
  145. package/dist/src/schemas/subgraphs.js +1 -18
  146. package/dist/src/schemas/subgraphs.js.map +3 -3
  147. package/dist/src/schemas/webhooks.d.ts +1 -1
  148. package/dist/src/schemas/webhooks.js +21 -37
  149. package/dist/src/schemas/webhooks.js.map +2 -2
  150. package/dist/src/streams-bulk-manifest.d.ts +1 -1
  151. package/dist/src/streams-bulk-manifest.js +9 -9
  152. package/dist/src/streams-bulk-manifest.js.map +1 -1
  153. package/dist/src/streams-rows/index.d.ts +1 -1
  154. package/dist/src/streams-rows/index.js +32 -48
  155. package/dist/src/streams-rows/index.js.map +2 -2
  156. package/dist/src/subgraphs/spec.d.ts +1 -11
  157. package/dist/src/subgraphs/spec.js +27 -93
  158. package/dist/src/subgraphs/spec.js.map +3 -3
  159. package/dist/src/types.d.ts +1 -1
  160. package/migrations/0134_waitlists.ts +64 -0
  161. package/migrations/0135_drop_hosted_play_and_meters.ts +58 -0
  162. package/migrations/0136_drop_subgraph_visibility.ts +34 -0
  163. package/package.json +1 -1
@@ -152,7 +152,6 @@ interface SubgraphsTable {
152
152
  handler_code: string | null;
153
153
  source_code: string | null;
154
154
  project_id: string | null;
155
- visibility: Generated<string>;
156
155
  /** Paid (wallet-ghost) deploys expire unless renewed or claimed; NULL = no expiry. */
157
156
  expires_at: Date | null;
158
157
  /** (event type, contract) probe pairs persisted at deploy for weight classification. */
@@ -283,21 +282,6 @@ interface MagicLinksTable {
283
282
  failed_attempts: Generated<number>;
284
283
  created_at: Generated<Date>;
285
284
  }
286
- /** One-shot hashed tokens that attach a play ghost to an email at claim. */
287
- interface ClaimTokensTable {
288
- id: Generated<string>;
289
- account_id: string;
290
- token_hash: string;
291
- created_at: Generated<Date>;
292
- expires_at: Date;
293
- used_at: Date | null;
294
- }
295
- /** 3 play provisions per IP per UTC day. PK (ip_hash, day); `count` caps at 3. */
296
- interface PlayProvisionsTable {
297
- ip_hash: string;
298
- day: string;
299
- count: Generated<number>;
300
- }
301
285
  interface SubgraphProcessingStatsTable {
302
286
  id: Generated<string>;
303
287
  subgraph_name: string;
@@ -759,8 +743,6 @@ interface Database {
759
743
  accounts: AccountsTable;
760
744
  sessions: SessionsTable;
761
745
  magic_links: MagicLinksTable;
762
- claim_tokens: ClaimTokensTable;
763
- play_provisions: PlayProvisionsTable;
764
746
  subgraph_health_snapshots: SubgraphHealthSnapshotsTable;
765
747
  subgraph_processing_stats: SubgraphProcessingStatsTable;
766
748
  subgraph_gaps: SubgraphGapsTable;
@@ -769,7 +751,6 @@ interface Database {
769
751
  processed_stripe_events: ProcessedStripeEventsTable;
770
752
  account_spend_caps: AccountSpendCapsTable;
771
753
  account_credits: AccountCreditsTable;
772
- hosted_meter_days: HostedMeterDaysTable;
773
754
  webhooks: WebhooksTable;
774
755
  webhook_outbox: WebhookOutboxTable;
775
756
  webhook_deliveries: WebhookDeliveriesTable;
@@ -800,6 +781,8 @@ interface Database {
800
781
  coverage_segments: CoverageSegmentsTable;
801
782
  stage_failures: StageFailuresTable;
802
783
  archive_fetches: ArchiveFetchesTable;
784
+ waitlists: WaitlistsTable;
785
+ waitlist_signups: WaitlistSignupsTable;
803
786
  }
804
787
  interface ServiceHeartbeatsTable {
805
788
  name: string;
@@ -834,18 +817,6 @@ interface AccountCreditsTable {
834
817
  type AccountCredits = Selectable<AccountCreditsTable>;
835
818
  type InsertAccountCredits = Insertable<AccountCreditsTable>;
836
819
  type UpdateAccountCredits = Updateable<AccountCreditsTable>;
837
- /** Daily idempotency ledger for hosted subgraph running + storage meters. */
838
- interface HostedMeterDaysTable {
839
- day: string;
840
- account_id: string;
841
- subgraph_name: string;
842
- kind: string;
843
- usd_micros: string | number | bigint;
844
- billed_at: Generated<Date>;
845
- }
846
- type HostedMeterDay = Selectable<HostedMeterDaysTable>;
847
- type InsertHostedMeterDay = Insertable<HostedMeterDaysTable>;
848
- type UpdateHostedMeterDay = Updateable<HostedMeterDaysTable>;
849
820
  /**
850
821
  * Archive fetch charge log (design-f089 gate). Append-only: one row per
851
822
  * priced attempt to fetch a partition object. `usd_micros` is 0 for
@@ -896,11 +867,6 @@ type Account = Selectable<AccountsTable>;
896
867
  type InsertAccount = Insertable<AccountsTable>;
897
868
  type MagicLink = Selectable<MagicLinksTable>;
898
869
  type InsertMagicLink = Insertable<MagicLinksTable>;
899
- type ClaimToken = Selectable<ClaimTokensTable>;
900
- type InsertClaimToken = Insertable<ClaimTokensTable>;
901
- type UpdateClaimToken = Updateable<ClaimTokensTable>;
902
- type PlayProvision = Selectable<PlayProvisionsTable>;
903
- type InsertPlayProvision = Insertable<PlayProvisionsTable>;
904
870
  type Session = Selectable<SessionsTable>;
905
871
  type InsertSession = Insertable<SessionsTable>;
906
872
  type SubgraphHealthSnapshot = Selectable<SubgraphHealthSnapshotsTable>;
@@ -1004,6 +970,30 @@ interface TriggerEvaluatorStateTable {
1004
970
  updated_at: Generated<Date>;
1005
971
  }
1006
972
  type TriggerEvaluatorState = Selectable<TriggerEvaluatorStateTable>;
973
+ /** A public waitlist page: what it is for and whether it takes signups. */
974
+ interface WaitlistsTable {
975
+ slug: string;
976
+ title: string;
977
+ description: string;
978
+ url: string;
979
+ opened_at: Generated<Date>;
980
+ /** Null while the list is open. */
981
+ closed_at: Date | null;
982
+ }
983
+ /**
984
+ * One signup per (list, contact, token). `answers` holds the list's own
985
+ * questions, validated per list by the API before insert.
986
+ */
987
+ interface WaitlistSignupsTable {
988
+ id: Generated<string>;
989
+ list: string;
990
+ contact: string;
991
+ answers: Record<string, unknown>;
992
+ created_at: Generated<Date>;
993
+ }
994
+ type Waitlist = Selectable<WaitlistsTable>;
995
+ type WaitlistSignup = Selectable<WaitlistSignupsTable>;
996
+ type InsertWaitlistSignup = Insertable<WaitlistSignupsTable>;
1007
997
  interface EnvSchemaOutput {
1008
998
  DATABASE_URL?: string;
1009
999
  /**
@@ -1043,23 +1033,22 @@ declare function isPox5DecoderEnabled(env?: EnvMap): boolean;
1043
1033
  declare function isSbtcDecoderEnabled(env?: EnvMap): boolean;
1044
1034
  /** Default OFF. Opt in with `BNS_DECODER_ENABLED=true`. */
1045
1035
  declare function isBnsDecoderEnabled(env?: EnvMap): boolean;
1046
- import { RawBuilder } from "kysely";
1047
- /**
1048
- * Safely encode a JS value as a JSONB literal for Kysely inserts/updates.
1049
- * Kysely + postgres.js double-encodes JSON when using parameterized queries
1050
- * with ::jsonb casts. This uses sql.raw to inline a properly escaped literal.
1051
- *
1052
- * Generic parameter lets callers set the RawBuilder's output type so they
1053
- * don't need to cast at the insert site. Default is `unknown` — widen at
1054
- * the call site when the column type is narrower, e.g. `jsonb<MyShape>(...)`.
1055
- */
1056
- declare function jsonb<T = unknown>(value: T): RawBuilder<T>;
1057
- /**
1058
- * Safely parse a JSONB value from the database.
1059
- * Handles double-encoded strings where postgres.js returns a JSON string
1060
- * instead of a parsed object.
1061
- */
1062
- declare function parseJsonb<T = unknown>(value: unknown): T;
1036
+ import { DECODED_EVENT_TYPES, VM_NODE_TO_STORED_TYPE } from "@secondlayer/stacks/filters";
1037
+ import { DecodedEventType } from "@secondlayer/stacks/filters";
1038
+ import { DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2, VM_EVENT_TYPES, VM_NODE_TO_STORED_TYPE as VM_NODE_TO_STORED_TYPE2, DecodedEventType as DecodedEventType2, VmEventType, VmNodeEventType } from "@secondlayer/stacks/filters";
1039
+ type VmStoredToNode = { [K in keyof typeof VM_NODE_TO_STORED_TYPE as (typeof VM_NODE_TO_STORED_TYPE)[K]] : K };
1040
+ /** Inverse of {@link VM_NODE_TO_STORED_TYPE}. Replay reconstruction emits the
1041
+ * node-shaped `/new_block.vm_events` body, so ingest can re-parse it. */
1042
+ declare const VM_STORED_TO_NODE_TYPE: VmStoredToNode;
1043
+ /** Alias kept for the Streams surface (identical to {@link DECODED_EVENT_TYPES}).
1044
+ * Explicit type annotation required — isolatedDeclarations emits `unknown` for
1045
+ * a bare const-to-const alias. */
1046
+ declare const STREAMS_EVENT_TYPES: typeof DECODED_EVENT_TYPES;
1047
+ type StreamsEventType = DecodedEventType;
1048
+ declare const STREAMS_DB_EVENT_TYPES: readonly ["stx_transfer_event", "stx_mint_event", "stx_burn_event", "stx_lock_event", "ft_transfer_event", "ft_mint_event", "ft_burn_event", "nft_transfer_event", "nft_mint_event", "nft_burn_event", "smart_contract_event", "contract_event"];
1049
+ type StreamsDbEventType = (typeof STREAMS_DB_EVENT_TYPES)[number];
1050
+ declare const DB_TO_STREAMS_EVENT_TYPE: Record<StreamsDbEventType, StreamsEventType>;
1051
+ declare const STREAMS_TO_DB_EVENT_TYPES: Record<StreamsEventType, readonly StreamsDbEventType[]>;
1063
1052
  import { Kysely } from "kysely";
1064
1053
  import postgres from "postgres";
1065
1054
  import { sql } from "kysely";
@@ -1895,6 +1884,23 @@ declare const SOURCE_READ_PKS: {
1895
1884
  readonly events: readonly ["tx_id", "event_index"]
1896
1885
  readonly chain_reorgs: null
1897
1886
  };
1887
+ import { RawBuilder } from "kysely";
1888
+ /**
1889
+ * Safely encode a JS value as a JSONB literal for Kysely inserts/updates.
1890
+ * Kysely + postgres.js double-encodes JSON when using parameterized queries
1891
+ * with ::jsonb casts. This uses sql.raw to inline a properly escaped literal.
1892
+ *
1893
+ * Generic parameter lets callers set the RawBuilder's output type so they
1894
+ * don't need to cast at the insert site. Default is `unknown` — widen at
1895
+ * the call site when the column type is narrower, e.g. `jsonb<MyShape>(...)`.
1896
+ */
1897
+ declare function jsonb<T = unknown>(value: T): RawBuilder<T>;
1898
+ /**
1899
+ * Safely parse a JSONB value from the database.
1900
+ * Handles double-encoded strings where postgres.js returns a JSON string
1901
+ * instead of a parsed object.
1902
+ */
1903
+ declare function parseJsonb<T = unknown>(value: unknown): T;
1898
1904
  /**
1899
1905
  * Per-migration DB-plane gating for the source/target split.
1900
1906
  *
@@ -1985,8 +1991,6 @@ declare const TABLE_TO_DB: {
1985
1991
  api_keys: string
1986
1992
  sessions: string
1987
1993
  magic_links: string
1988
- claim_tokens: string
1989
- play_provisions: string
1990
1994
  account_spend_caps: string
1991
1995
  processed_stripe_events: string
1992
1996
  webhooks: string
@@ -2000,8 +2004,9 @@ declare const TABLE_TO_DB: {
2000
2004
  subgraph_violations: string
2001
2005
  subgraph_processing_stats: string
2002
2006
  account_credits: string
2003
- hosted_meter_days: string
2004
2007
  archive_fetches: string
2008
+ waitlists: string
2009
+ waitlist_signups: string
2005
2010
  service_heartbeats: string
2006
2011
  };
2007
2012
  /** OSS: one application URL. SOURCE_/TARGET_ are hosted split only. */
@@ -2152,6 +2157,56 @@ declare class TenantSuspendedError extends SecondLayerError {
2152
2157
  * (avoids cross-bundle instanceof failures from bunup class duplication). */
2153
2158
  declare const CODE_TO_STATUS: Record<string, 400 | 401 | 402 | 403 | 404 | 409 | 415 | 422 | 423 | 429 | 503>;
2154
2159
  declare function getErrorMessage(err: unknown): string;
2160
+ /**
2161
+ * Block finality, anchored to the burn (Bitcoin) chain.
2162
+ *
2163
+ * Post-Nakamoto, Stacks blocks arrive every few seconds, so a fixed count of
2164
+ * Stacks blocks is a poor finality proxy (e.g. 144 fast blocks ≈ 12 minutes).
2165
+ * A Stacks block is final once its anchoring burn block has enough Bitcoin
2166
+ * confirmations — so finality is expressed in burn-block confirmations and
2167
+ * mapped to a Stacks height via the burn_block_height carried on each block.
2168
+ */
2169
+ /** Bitcoin confirmations required before a block is treated as final. ~1 hour. */
2170
+ declare const DEFAULT_BTC_CONFIRMATIONS = 6;
2171
+ /**
2172
+ * Highest burn (Bitcoin) block height considered finalized given the current
2173
+ * burn tip. Stacks blocks whose `burn_block_height` is at or below the result
2174
+ * are final. Returns 0 when the chain is shorter than the confirmation window.
2175
+ */
2176
+ declare function finalizedBurnHeight(burnTipHeight: number, confirmations?: number): number;
2177
+ /**
2178
+ * Canonical Streams cursor codec, shared by every product (Streams, Index,
2179
+ * Datasets, bulk). A cursor is `"<block_height>:<event_index>"` — an opaque,
2180
+ * monotonic resume token. One implementation so encode/decode and the
2181
+ * empty-range sentinel can never drift between products.
2182
+ *
2183
+ * NOTE: this codec IS the shared piece worth centralizing. A broader "shared
2184
+ * canonical reader" across the ~10 raw-event query sites (streams-events,
2185
+ * streams-bulk/query, l2/storage) was deliberately NOT built: those sites split
2186
+ * into distinct query patterns and share only the row_number ordering *pattern*,
2187
+ * not an identical reader. The reorg-archive design (migration 0084) keeps the
2188
+ * main tables canonical-only, so each reader's `WHERE canonical` filter already
2189
+ * needs no dedup logic. Forcing one mega-reader was the wrong abstraction; this
2190
+ * codec captures the only part that actually drifts.
2191
+ */
2192
+ type StreamsCursor = {
2193
+ block_height: number
2194
+ event_index: number
2195
+ };
2196
+ /**
2197
+ * Event index used to advance a cursor past a fully-filtered range instead of
2198
+ * returning null. A filter that eliminates every event in a scanned range would
2199
+ * otherwise pin the consumer at the previous cursor and spin forever. Must fit
2200
+ * in Postgres int4 (the `stream_event_index` column type) — int4 max is plenty,
2201
+ * real blocks have far fewer than ~2.1B events.
2202
+ */
2203
+ declare const EMPTY_RANGE_EVENT_INDEX_SENTINEL = 2147483647;
2204
+ declare function encodeStreamsCursor(cursor: StreamsCursor): string;
2205
+ declare function decodeStreamsCursor(cursor: string): StreamsCursor;
2206
+ declare function compareStreamsCursor(a: StreamsCursor, b: StreamsCursor): number;
2207
+ declare function isEmptyRangeCursor(cursor: StreamsCursor): boolean;
2208
+ /** Exclusive end of every event that can live in `height`. */
2209
+ declare function blockEndCursor(height: number): StreamsCursor;
2155
2210
  declare class Logger {
2156
2211
  private _level?;
2157
2212
  private _isProduction?;
@@ -2170,7 +2225,6 @@ declare const logger: Logger;
2170
2225
  import { z as z2 } from "zod";
2171
2226
  interface DeploySubgraphRequest {
2172
2227
  name: string;
2173
- version?: string;
2174
2228
  description?: string;
2175
2229
  sources: Record<string, Record<string, unknown>>;
2176
2230
  schema: Record<string, unknown>;
@@ -2223,7 +2277,6 @@ interface SubgraphSummary {
2223
2277
  gapCount: number;
2224
2278
  /** history_filling = expected gaps while a tip-first backfill op runs. */
2225
2279
  integrity: "complete" | "gaps_detected" | "history_filling";
2226
- visibility?: "public" | "private";
2227
2280
  /** Most recent indexing error reason + when it occurred, if any. */
2228
2281
  lastError?: string | null;
2229
2282
  lastErrorAt?: string | null;
@@ -2280,7 +2333,6 @@ interface SubgraphDetail {
2280
2333
  version: string;
2281
2334
  schemaHash?: string;
2282
2335
  status: string;
2283
- visibility?: "public" | "private";
2284
2336
  lastProcessedBlock: number;
2285
2337
  description?: string;
2286
2338
  sources?: Record<string, unknown>;
@@ -2645,15 +2697,6 @@ type SubgraphSpecFormat = "openapi" | "agent" | "markdown";
2645
2697
  interface SubgraphSpecOptions {
2646
2698
  serverUrl?: string;
2647
2699
  generatedAt?: string;
2648
- /**
2649
- * Self-hosted instances ignore the `visibility` column when deciding
2650
- * whether a read needs a key (`/v1/subgraphs` auth is the loopback rule,
2651
- * not the flag) — but this generator still branched on it, so a spec built
2652
- * for a self-hosted deploy pointed readers at the authenticated `/api`
2653
- * path for a read that was actually open. Callers on that mode should set
2654
- * this so the generated URLs match the auth the API actually enforces.
2655
- */
2656
- forcePublicRead?: boolean;
2657
2700
  }
2658
2701
  interface SubgraphAgentSchema {
2659
2702
  name: string;
@@ -2692,124 +2735,6 @@ declare function generateSubgraphAgentSchema(detail: SubgraphDetail, options?: S
2692
2735
  declare function generateSubgraphOpenApi(detail: SubgraphDetail, options?: SubgraphSpecOptions): Record<string, unknown>;
2693
2736
  declare function generateSubgraphMarkdown(detail: SubgraphDetail, options?: SubgraphSpecOptions): string;
2694
2737
  declare function generateSubgraphSpec(detail: SubgraphDetail, format: SubgraphSpecFormat, options?: SubgraphSpecOptions): Record<string, unknown> | SubgraphAgentSchema | string;
2695
- declare namespace exports_hmac {
2696
- export { verifySignatureHeader, verifySignature, signPayload, generateSecret, createSignatureHeader };
2697
- }
2698
- /**
2699
- * Generate a random secret for delivery signing
2700
- * Returns 32 bytes as a 64-character hex string
2701
- */
2702
- declare function generateSecret(): string;
2703
- /**
2704
- * Sign a payload with HMAC-SHA256
2705
- * Returns the signature as a hex string
2706
- */
2707
- declare function signPayload(payload: string, secret: string): string;
2708
- /**
2709
- * Verify an HMAC signature
2710
- * Uses constant-time comparison to prevent timing attacks
2711
- */
2712
- declare function verifySignature(payload: string, signature: string, secret: string): boolean;
2713
- /**
2714
- * Create a Stripe-style signature header
2715
- * Format: t=timestamp,v1=signature
2716
- */
2717
- declare function createSignatureHeader(payload: string, secret: string, timestamp?: number): string;
2718
- /**
2719
- * Parse and verify a Stripe-style signature header
2720
- * Returns true if valid, false otherwise
2721
- */
2722
- declare function verifySignatureHeader(payload: string, header: string, secret: string, toleranceSeconds?: number): boolean;
2723
- declare namespace exports_ed25519 {
2724
- export { verifyEd25519, signEd25519, publicKeyPemFromPrivate, loadEd25519PublicKey, loadEd25519PrivateKey, generateEd25519KeyPair, ed25519KeyId };
2725
- }
2726
- import { KeyObject } from "node:crypto";
2727
- /**
2728
- * Asymmetric ed25519 signing for Streams response proofs.
2729
- *
2730
- * Asymmetric (not HMAC) so the proof is real: only the server holds the private
2731
- * key, and any consumer verifies with the published public key — no shared
2732
- * secret to leak. ed25519 uses node's `sign`/`verify` with a `null` algorithm.
2733
- * Keys are PEM (PKCS8 private / SPKI public) for env transport; load once and
2734
- * reuse the KeyObject on hot paths.
2735
- */
2736
- declare function generateEd25519KeyPair(): {
2737
- privateKeyPem: string
2738
- publicKeyPem: string
2739
- };
2740
- declare function loadEd25519PrivateKey(pem: string): KeyObject;
2741
- declare function loadEd25519PublicKey(pem: string): KeyObject;
2742
- declare function publicKeyPemFromPrivate(privateKeyPem: string): string;
2743
- /** Stable short id for a public key (rotation hint via X-Signature-KeyId). */
2744
- declare function ed25519KeyId(publicKeyPem: string): string;
2745
- declare function signEd25519(payload: string, privateKey: KeyObject): string;
2746
- declare function verifyEd25519(payload: string, signatureBase64: string, publicKey: KeyObject): boolean;
2747
- import { DECODED_EVENT_TYPES, VM_NODE_TO_STORED_TYPE } from "@secondlayer/stacks/filters";
2748
- import { DecodedEventType } from "@secondlayer/stacks/filters";
2749
- import { DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2, VM_EVENT_TYPES, VM_NODE_TO_STORED_TYPE as VM_NODE_TO_STORED_TYPE2, DecodedEventType as DecodedEventType2, VmEventType, VmNodeEventType } from "@secondlayer/stacks/filters";
2750
- type VmStoredToNode = { [K in keyof typeof VM_NODE_TO_STORED_TYPE as (typeof VM_NODE_TO_STORED_TYPE)[K]] : K };
2751
- /** Inverse of {@link VM_NODE_TO_STORED_TYPE}. Replay reconstruction emits the
2752
- * node-shaped `/new_block.vm_events` body, so ingest can re-parse it. */
2753
- declare const VM_STORED_TO_NODE_TYPE: VmStoredToNode;
2754
- /** Alias kept for the Streams surface (identical to {@link DECODED_EVENT_TYPES}).
2755
- * Explicit type annotation required — isolatedDeclarations emits `unknown` for
2756
- * a bare const-to-const alias. */
2757
- declare const STREAMS_EVENT_TYPES: typeof DECODED_EVENT_TYPES;
2758
- type StreamsEventType = DecodedEventType;
2759
- declare const STREAMS_DB_EVENT_TYPES: readonly ["stx_transfer_event", "stx_mint_event", "stx_burn_event", "stx_lock_event", "ft_transfer_event", "ft_mint_event", "ft_burn_event", "nft_transfer_event", "nft_mint_event", "nft_burn_event", "smart_contract_event", "contract_event"];
2760
- type StreamsDbEventType = (typeof STREAMS_DB_EVENT_TYPES)[number];
2761
- declare const DB_TO_STREAMS_EVENT_TYPE: Record<StreamsDbEventType, StreamsEventType>;
2762
- declare const STREAMS_TO_DB_EVENT_TYPES: Record<StreamsEventType, readonly StreamsDbEventType[]>;
2763
- /**
2764
- * Block finality, anchored to the burn (Bitcoin) chain.
2765
- *
2766
- * Post-Nakamoto, Stacks blocks arrive every few seconds, so a fixed count of
2767
- * Stacks blocks is a poor finality proxy (e.g. 144 fast blocks ≈ 12 minutes).
2768
- * A Stacks block is final once its anchoring burn block has enough Bitcoin
2769
- * confirmations — so finality is expressed in burn-block confirmations and
2770
- * mapped to a Stacks height via the burn_block_height carried on each block.
2771
- */
2772
- /** Bitcoin confirmations required before a block is treated as final. ~1 hour. */
2773
- declare const DEFAULT_BTC_CONFIRMATIONS = 6;
2774
- /**
2775
- * Highest burn (Bitcoin) block height considered finalized given the current
2776
- * burn tip. Stacks blocks whose `burn_block_height` is at or below the result
2777
- * are final. Returns 0 when the chain is shorter than the confirmation window.
2778
- */
2779
- declare function finalizedBurnHeight(burnTipHeight: number, confirmations?: number): number;
2780
- /**
2781
- * Canonical Streams cursor codec, shared by every product (Streams, Index,
2782
- * Datasets, bulk). A cursor is `"<block_height>:<event_index>"` — an opaque,
2783
- * monotonic resume token. One implementation so encode/decode and the
2784
- * empty-range sentinel can never drift between products.
2785
- *
2786
- * NOTE: this codec IS the shared piece worth centralizing. A broader "shared
2787
- * canonical reader" across the ~10 raw-event query sites (streams-events,
2788
- * streams-bulk/query, l2/storage) was deliberately NOT built: those sites split
2789
- * into distinct query patterns and share only the row_number ordering *pattern*,
2790
- * not an identical reader. The reorg-archive design (migration 0084) keeps the
2791
- * main tables canonical-only, so each reader's `WHERE canonical` filter already
2792
- * needs no dedup logic. Forcing one mega-reader was the wrong abstraction; this
2793
- * codec captures the only part that actually drifts.
2794
- */
2795
- type StreamsCursor = {
2796
- block_height: number
2797
- event_index: number
2798
- };
2799
- /**
2800
- * Event index used to advance a cursor past a fully-filtered range instead of
2801
- * returning null. A filter that eliminates every event in a scanned range would
2802
- * otherwise pin the consumer at the previous cursor and spin forever. Must fit
2803
- * in Postgres int4 (the `stream_event_index` column type) — int4 max is plenty,
2804
- * real blocks have far fewer than ~2.1B events.
2805
- */
2806
- declare const EMPTY_RANGE_EVENT_INDEX_SENTINEL = 2147483647;
2807
- declare function encodeStreamsCursor(cursor: StreamsCursor): string;
2808
- declare function decodeStreamsCursor(cursor: string): StreamsCursor;
2809
- declare function compareStreamsCursor(a: StreamsCursor, b: StreamsCursor): number;
2810
- declare function isEmptyRangeCursor(cursor: StreamsCursor): boolean;
2811
- /** Exclusive end of every event that can live in `height`. */
2812
- declare function blockEndCursor(height: number): StreamsCursor;
2813
2738
  /**
2814
2739
  * Payload for `sbtc_deposit` (topic: completed-deposit).
2815
2740
  * `sender` is the Stacks address that initiated the deposit and receives the sBTC.
@@ -3069,4 +2994,56 @@ interface ChainTestDelivery {
3069
2994
  * "Chain webhook webhook payloads" doc.
3070
2995
  */
3071
2996
  type ChainWebhookDelivery = ChainApplyDeliveryOf<"stx_transfer", ChainEventEnvelope<"stx_transfer_event", ChainStxTransferData>> | ChainApplyDeliveryOf<"stx_mint", ChainEventEnvelope<"stx_mint_event", ChainStxMintData>> | ChainApplyDeliveryOf<"stx_burn", ChainEventEnvelope<"stx_burn_event", ChainStxBurnData>> | ChainApplyDeliveryOf<"stx_lock", ChainEventEnvelope<"stx_lock_event", ChainStxLockData>> | ChainApplyDeliveryOf<"ft_transfer", ChainEventEnvelope<"ft_transfer_event", ChainFtTransferData>> | ChainApplyDeliveryOf<"ft_mint", ChainEventEnvelope<"ft_mint_event", ChainFtMintData>> | ChainApplyDeliveryOf<"ft_burn", ChainEventEnvelope<"ft_burn_event", ChainFtBurnData>> | ChainApplyDeliveryOf<"nft_transfer", ChainEventEnvelope<"nft_transfer_event", ChainNftTransferData>> | ChainApplyDeliveryOf<"nft_mint", ChainEventEnvelope<"nft_mint_event", ChainNftMintData>> | ChainApplyDeliveryOf<"nft_burn", ChainEventEnvelope<"nft_burn_event", ChainNftBurnData>> | ChainApplyDeliveryOf<"print_event", ChainEventEnvelope<"contract_event", ChainPrintEventData>> | ChainApplyDeliveryOf<"contract_call", ChainTxLevelEvent> | ChainApplyDeliveryOf<"contract_deploy", ChainTxLevelEvent> | ChainApplyDeliveryOf<"sbtc_deposit", SbtcDepositEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_create", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_accept", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_reject", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_swept_confirmed", SbtcWithdrawalSweptConfirmedEvent> | ChainReorgRollbackDelivery | ChainTestDelivery;
3072
- export { validateWebhookFilterForTable, sql, setMigrationRole, parseJsonb, onControlPlane, onChainPlane, logger, jsonb, isSbtcDecoderEnabled, isPox5DecoderEnabled, isPox4DecoderEnabled, isEmptyRangeCursor, isBnsDecoderEnabled, getTargetDb, getSourceDb, getRawClientFor, getRawClient, getMigrationRole, getErrorMessage, getEnv, getDbSplitStatus, getDb, generateSubgraphSpec, generateSubgraphOpenApi, generateSubgraphMarkdown, generateSubgraphAgentSchema, formatWebhookSchemaErrors, finalizedBurnHeight, encodeStreamsCursor, exports_ed25519 as ed25519, decodeStreamsCursor, exports_hmac as crypto, compareStreamsCursor, closeDb, blockEndCursor, assertDbSplit, applicationDatabaseUrl, WebhooksTable, WebhookSummary, WebhookStatusSchema, WebhookStatus, WebhookSchemaTables, WebhookSchemaTable, WebhookSchemaColumn, WebhookRuntimeSchema, WebhookRuntime, WebhookOutboxTable, WebhookOutbox, WebhookKind, WebhookFormatSchema, WebhookFormat, WebhookFilterSchema, WebhookFilterPrimitiveSchema, WebhookFilterPrimitive, WebhookFilterOperatorSchema, WebhookFilterOperator, WebhookFilterClauseSchema, WebhookFilterClause, WebhookFilter, WebhookDetail, WebhookDelivery, WebhookDeliveriesTable, Webhook, WEBHOOK_STATUSES, WEBHOOK_RUNTIMES, WEBHOOK_FORMATS, WEBHOOK_FILTER_OPERATORS, VmNodeEventType, VmEventsTable, VmEventsArchiveTable, VmEventType, VmEvent, VersionConflictError, ValidationError, VM_STORED_TO_NODE_TYPE, VM_NODE_TO_STORED_TYPE2 as VM_NODE_TO_STORED_TYPE, VM_EVENT_TYPES, UpdateWebhookRequestSchema, UpdateWebhookRequest, UpdateWebhookOutbox, UpdateWebhook, UpdateVmEvent, UpdateTransaction, UpdateSubgraphOperation, UpdateSubgraph, UpdateIndexProgress, UpdateHostedMeterDay, UpdateEvent, UpdateContract, UpdateClaimToken, UpdateBlock, UpdateArchiveFetch, UpdateApiKey, UpdateAccountSpendCap, UpdateAccountCredits, TriggerEvaluatorStateTable, TriggerEvaluatorState, TransactionsTable, TransactionsArchiveTable, Transaction, TenantSuspendedError, TABLE_TO_DB, SyncScopesTable, SubgraphsTable, SubgraphViolationsTable, SubgraphSyncInfo, SubgraphSummary, SubgraphSpecOptions, SubgraphSpecFormat, SubgraphQueryParams, SubgraphProcessingStatsTable, SubgraphOperationsTable, SubgraphOperationStatus, SubgraphOperationKind, SubgraphOperation, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGapsResponse, SubgraphGapRange, SubgraphGapEntry, SubgraphGap, SubgraphDetail, SubgraphAggregateResponse, SubgraphAggregateParams, SubgraphAgentSchema, Subgraph, StreamsEventType, StreamsDbEventType, StreamsCursor, StageRunsTable, StageRegistryTable, StageKind, StageFailuresTable, StageBlockReceiptsTable, SessionsTable, Session, ServiceHeartbeatsTable, SecondLayerError, SbtcWithdrawalSweptConfirmedEvent, SbtcWithdrawalEvent, SbtcTokenEventsTable, SbtcTokenEventType, SbtcSettlementsTable, SbtcEventsTable, SbtcEventTopic, SbtcDepositEvent, STREAMS_TO_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_DB_EVENT_TYPES, SOURCE_READ_TYPES, SOURCE_READ_PKS, SOURCE_READ_COLUMNS, RunStatus, RotateSecretResponse, RetryState, ReplayWebhookRequestSchema, ReplayWebhookRequest, ReplayResult, RepairMode, ReindexResponse, RateLimitError, ProcessedStripeEventsTable, Pox5EventsTable, Pox5EventTopic, Pox4FunctionName, Pox4CallsTable, PlayProvisionsTable, PlayProvision, PendingForkBlocksTable, PaymentRequiredError, ParsedUpdateWebhookRequest, ParsedReplayWebhookRequest, ParsedCreateWebhookRequest, OutboxStatus, ObserverJournalTable, ObserverJournalStatus, NumericAsText, NotFoundError, NativeClock, MigrationRole, MempoolTransactionsTable, MempoolTransaction, MagicLinksTable, MagicLink, KeyRotatedError, InstancesTable, InsertWebhookOutbox, InsertWebhookDelivery, InsertWebhook, InsertVmEvent, InsertTransaction, InsertSubgraphOperation, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertPlayProvision, InsertMempoolTransaction, InsertMagicLink, InsertIndexProgress, InsertHostedMeterDay, InsertEvent, InsertContract, InsertClaimToken, InsertBlock, InsertArchiveFetch, InsertApiKey, InsertAccountSpendCap, InsertAccountCredits, InsertAccount, IndexProgressTable, IndexProgress, IndexPrimaryKey, IndexColumnType, IndexColumn, HostedMeterDaysTable, HostedMeterDay, ForbiddenError, FailureUnit, FailureClass, EventsTable, EventsArchiveTable, Event, ErrorCodes, ErrorCode, Env, EMPTY_RANGE_EVENT_INDEX_SENTINEL, DeploySubgraphResponse, DeploySubgraphRequestSchema, DeploySubgraphRequest, DeliveryRow, DecoderCheckpointsTable, DecodedEventsTable, DecodedEventType2 as DecodedEventType, DeadRow, DeadLetterEventsTable, DbSplitStatus, DbReadRow, DbPlane, DatabaseError, Database, DEFAULT_BTC_CONFIRMATIONS, DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES, DB_TO_STREAMS_EVENT_TYPE, CreateWebhookResponse, CreateWebhookRequestSchema, CreateWebhookRequest, CoverageSegmentsTable, ContractsTable, Contract, ClaimTokensTable, ClaimToken, ChainWebhookEnvelope, ChainWebhookDelivery, ChainTxLevelEvent, ChainTestDelivery, ChainStxTransferData, ChainStxMintData, ChainStxLockData, ChainStxBurnData, ChainReorgsTable, ChainReorgRollbackEnvelope, ChainReorgRollbackDelivery, ChainReorgOrphanedEntry, ChainReadCacheTable, ChainPrintEventData, ChainNftTransferData, ChainNftMintData, ChainNftBurnData, ChainFtTransferData, ChainFtMintData, ChainFtBurnData, ChainEventEnvelope, ChainApplyEnvelopeOf, ChainApplyEnvelope, ChainApplyDeliveryOf, CODE_TO_STATUS, CHAIN_TRIGGER_TYPES, CHAIN_TRIGGER_FIELDS, BurnBlockRewardsTable, BurnBlockRewardSlotsTable, BnsNamespacesTable, BnsNamespaceEventsTable, BnsNamespaceEventStatus, BnsNamesTable, BnsNameEventsTable, BnsNameEventTopic, BnsMarketplaceEventsTable, BnsMarketplaceAction, BlocksTable, Block, AuthorizationError, AuthenticationError, ArchiveFetchesTable, ArchiveFetch, ApiKeysTable, ApiKey, AccountsTable, AccountSpendCapsTable, AccountSpendCap, AccountCreditsTable, AccountCredits, Account };
2997
+ declare namespace exports_hmac {
2998
+ export { createSignatureHeader, generateSecret, signPayload, verifySignature, verifySignatureHeader };
2999
+ }
3000
+ /**
3001
+ * Generate a random secret for delivery signing
3002
+ * Returns 32 bytes as a 64-character hex string
3003
+ */
3004
+ declare function generateSecret(): string;
3005
+ /**
3006
+ * Sign a payload with HMAC-SHA256
3007
+ * Returns the signature as a hex string
3008
+ */
3009
+ declare function signPayload(payload: string, secret: string): string;
3010
+ /**
3011
+ * Verify an HMAC signature
3012
+ * Uses constant-time comparison to prevent timing attacks
3013
+ */
3014
+ declare function verifySignature(payload: string, signature: string, secret: string): boolean;
3015
+ /**
3016
+ * Create a Stripe-style signature header
3017
+ * Format: t=timestamp,v1=signature
3018
+ */
3019
+ declare function createSignatureHeader(payload: string, secret: string, timestamp?: number): string;
3020
+ /**
3021
+ * Parse and verify a Stripe-style signature header
3022
+ * Returns true if valid, false otherwise
3023
+ */
3024
+ declare function verifySignatureHeader(payload: string, header: string, secret: string, toleranceSeconds?: number): boolean;
3025
+ declare namespace exports_ed25519 {
3026
+ export { ed25519KeyId, generateEd25519KeyPair, loadEd25519PrivateKey, loadEd25519PublicKey, publicKeyPemFromPrivate, signEd25519, verifyEd25519 };
3027
+ }
3028
+ import { KeyObject } from "node:crypto";
3029
+ /**
3030
+ * Asymmetric ed25519 signing for Streams response proofs.
3031
+ *
3032
+ * Asymmetric (not HMAC) so the proof is real: only the server holds the private
3033
+ * key, and any consumer verifies with the published public key — no shared
3034
+ * secret to leak. ed25519 uses node's `sign`/`verify` with a `null` algorithm.
3035
+ * Keys are PEM (PKCS8 private / SPKI public) for env transport; load once and
3036
+ * reuse the KeyObject on hot paths.
3037
+ */
3038
+ declare function generateEd25519KeyPair(): {
3039
+ privateKeyPem: string
3040
+ publicKeyPem: string
3041
+ };
3042
+ declare function loadEd25519PrivateKey(pem: string): KeyObject;
3043
+ declare function loadEd25519PublicKey(pem: string): KeyObject;
3044
+ declare function publicKeyPemFromPrivate(privateKeyPem: string): string;
3045
+ /** Stable short id for a public key (rotation hint via X-Signature-KeyId). */
3046
+ declare function ed25519KeyId(publicKeyPem: string): string;
3047
+ declare function signEd25519(payload: string, privateKey: KeyObject): string;
3048
+ declare function verifyEd25519(payload: string, signatureBase64: string, publicKey: KeyObject): boolean;
3049
+ export { Account, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiKey, ApiKeysTable, ArchiveFetch, ArchiveFetchesTable, AuthenticationError, AuthorizationError, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, CHAIN_TRIGGER_FIELDS, CHAIN_TRIGGER_TYPES, CODE_TO_STATUS, ChainApplyDeliveryOf, ChainApplyEnvelope, ChainApplyEnvelopeOf, ChainEventEnvelope, ChainFtBurnData, ChainFtMintData, ChainFtTransferData, ChainNftBurnData, ChainNftMintData, ChainNftTransferData, ChainPrintEventData, ChainReadCacheTable, ChainReorgOrphanedEntry, ChainReorgRollbackDelivery, ChainReorgRollbackEnvelope, ChainReorgsTable, ChainStxBurnData, ChainStxLockData, ChainStxMintData, ChainStxTransferData, ChainTestDelivery, ChainTxLevelEvent, ChainWebhookDelivery, ChainWebhookEnvelope, Contract, ContractsTable, CoverageSegmentsTable, CreateWebhookRequest, CreateWebhookRequestSchema, CreateWebhookResponse, DB_TO_STREAMS_EVENT_TYPE, DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES, DEFAULT_BTC_CONFIRMATIONS, Database, DatabaseError, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DeadRow, DecodedEventType2 as DecodedEventType, DecodedEventsTable, DecoderCheckpointsTable, DeliveryRow, DeploySubgraphRequest, DeploySubgraphRequestSchema, DeploySubgraphResponse, EMPTY_RANGE_EVENT_INDEX_SENTINEL, Env, ErrorCode, ErrorCodes, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, ForbiddenError, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountCredits, InsertAccountSpendCap, InsertApiKey, InsertArchiveFetch, InsertBlock, InsertContract, InsertEvent, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InstancesTable, KeyRotatedError, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NotFoundError, NumericAsText, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, ParsedCreateWebhookRequest, ParsedReplayWebhookRequest, ParsedUpdateWebhookRequest, PaymentRequiredError, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RateLimitError, ReindexResponse, RepairMode, ReplayResult, ReplayWebhookRequest, ReplayWebhookRequestSchema, RetryState, RotateSecretResponse, RunStatus, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, STREAMS_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_TO_DB_EVENT_TYPES, SbtcDepositEvent, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SbtcWithdrawalEvent, SbtcWithdrawalSweptConfirmedEvent, SecondLayerError, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StreamsCursor, StreamsDbEventType, StreamsEventType, Subgraph, SubgraphAgentSchema, SubgraphAggregateParams, SubgraphAggregateResponse, SubgraphDetail, SubgraphGap, SubgraphGapEntry, SubgraphGapRange, SubgraphGapsResponse, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphQueryParams, SubgraphSpecFormat, SubgraphSpecOptions, SubgraphSummary, SubgraphSyncInfo, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, TenantSuspendedError, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSubgraph, UpdateSubgraphOperation, UpdateTransaction, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UpdateWebhookRequest, UpdateWebhookRequestSchema, VM_EVENT_TYPES, VM_NODE_TO_STORED_TYPE2 as VM_NODE_TO_STORED_TYPE, VM_STORED_TO_NODE_TYPE, ValidationError, VersionConflictError, VmEvent, VmEventType, VmEventsArchiveTable, VmEventsTable, VmNodeEventType, WEBHOOK_FILTER_OPERATORS, WEBHOOK_FORMATS, WEBHOOK_RUNTIMES, WEBHOOK_STATUSES, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDetail, WebhookFilter, WebhookFilterClause, WebhookFilterClauseSchema, WebhookFilterOperator, WebhookFilterOperatorSchema, WebhookFilterPrimitive, WebhookFilterPrimitiveSchema, WebhookFilterSchema, WebhookFormat, WebhookFormatSchema, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookRuntime, WebhookRuntimeSchema, WebhookSchemaColumn, WebhookSchemaTable, WebhookSchemaTables, WebhookStatus, WebhookStatusSchema, WebhookSummary, WebhooksTable, applicationDatabaseUrl, assertDbSplit, blockEndCursor, closeDb, compareStreamsCursor, exports_hmac as crypto, decodeStreamsCursor, exports_ed25519 as ed25519, encodeStreamsCursor, finalizedBurnHeight, formatWebhookSchemaErrors, generateSubgraphAgentSchema, generateSubgraphMarkdown, generateSubgraphOpenApi, generateSubgraphSpec, getDb, getDbSplitStatus, getEnv, getErrorMessage, getMigrationRole, getRawClient, getRawClientFor, getSourceDb, getTargetDb, isBnsDecoderEnabled, isEmptyRangeCursor, isPox4DecoderEnabled, isPox5DecoderEnabled, isSbtcDecoderEnabled, jsonb, logger, onChainPlane, onControlPlane, parseJsonb, setMigrationRole, sql, validateWebhookFilterForTable };