@secondlayer/shared 8.0.0 → 10.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.
Files changed (36) hide show
  1. package/dist/src/archive/range-digest.d.ts +16 -0
  2. package/dist/src/archive/semantic-digest-builder.d.ts +16 -0
  3. package/dist/src/archive/status.js +11 -3
  4. package/dist/src/archive/status.js.map +3 -3
  5. package/dist/src/coverage/index.d.ts +16 -13
  6. package/dist/src/coverage/index.js +1 -11
  7. package/dist/src/coverage/index.js.map +3 -3
  8. package/dist/src/db/index.d.ts +18 -1
  9. package/dist/src/db/index.js +2 -1
  10. package/dist/src/db/index.js.map +3 -3
  11. package/dist/src/db/queries/chain-reorgs.d.ts +16 -0
  12. package/dist/src/db/queries/chain-reorgs.js +2 -1
  13. package/dist/src/db/queries/chain-reorgs.js.map +3 -3
  14. package/dist/src/db/queries/contracts.d.ts +16 -0
  15. package/dist/src/db/queries/instance.d.ts +16 -0
  16. package/dist/src/db/queries/integrity.d.ts +16 -0
  17. package/dist/src/db/queries/subgraph-gaps.d.ts +16 -0
  18. package/dist/src/db/queries/subgraph-operations.d.ts +16 -0
  19. package/dist/src/db/queries/subgraphs.d.ts +16 -0
  20. package/dist/src/db/queries/subscriptions.d.ts +16 -0
  21. package/dist/src/db/queries/sync-scope.d.ts +1006 -0
  22. package/dist/src/db/queries/sync-scope.js +116 -0
  23. package/dist/src/db/queries/sync-scope.js.map +10 -0
  24. package/dist/src/db/schema.d.ts +17 -1
  25. package/dist/src/index.d.ts +18 -1
  26. package/dist/src/index.js +2 -1
  27. package/dist/src/index.js.map +3 -3
  28. package/dist/src/node/local-client.d.ts +16 -0
  29. package/dist/src/runtime/index.d.ts +188 -18
  30. package/dist/src/runtime/index.js +322 -38
  31. package/dist/src/runtime/index.js.map +10 -7
  32. package/migrations/0120_sync_scopes.ts +42 -0
  33. package/package.json +7 -6
  34. package/dist/src/x402.d.ts +0 -47
  35. package/dist/src/x402.js +0 -79
  36. package/dist/src/x402.js.map +0 -10
@@ -18,6 +18,7 @@ declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch
18
18
  type FailureClass = (typeof FAILURE_CLASSES)[number];
19
19
  declare const RETRY_STATES: readonly ["open", "retrying", "halted", "resolved"];
20
20
  type RetryState = (typeof RETRY_STATES)[number];
21
+ type BootstrapSource = "archive" | "genesis" | "import";
21
22
  interface BlocksTable {
22
23
  height: number;
23
24
  hash: string;
@@ -720,6 +721,20 @@ interface StageFailuresTable {
720
721
  resolved_at: Date | null;
721
722
  retain_until: Generated<Date>;
722
723
  }
724
+ /**
725
+ * The instance's declared scope — one row per network. `start_height` is what
726
+ * makes missing history below it deliberate rather than a gap.
727
+ */
728
+ interface SyncScopesTable {
729
+ network: string;
730
+ start_height: number;
731
+ target_height: number | null;
732
+ bootstrap_source: BootstrapSource;
733
+ bootstrap_manifest_digest: string | null;
734
+ genesis_hash: string | null;
735
+ created_at: Generated<Date>;
736
+ updated_at: Generated<Date>;
737
+ }
723
738
  interface Database {
724
739
  blocks: BlocksTable;
725
740
  transactions: TransactionsTable;
@@ -772,6 +787,7 @@ interface Database {
772
787
  chain_read_cache: ChainReadCacheTable;
773
788
  pending_fork_blocks: PendingForkBlocksTable;
774
789
  observer_journal: ObserverJournalTable;
790
+ sync_scopes: SyncScopesTable;
775
791
  stage_registry: StageRegistryTable;
776
792
  stage_runs: StageRunsTable;
777
793
  stage_block_receipts: StageBlockReceiptsTable;
@@ -18,6 +18,7 @@ declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch
18
18
  type FailureClass = (typeof FAILURE_CLASSES)[number];
19
19
  declare const RETRY_STATES: readonly ["open", "retrying", "halted", "resolved"];
20
20
  type RetryState = (typeof RETRY_STATES)[number];
21
+ type BootstrapSource = "archive" | "genesis" | "import";
21
22
  interface BlocksTable {
22
23
  height: number;
23
24
  hash: string;
@@ -720,6 +721,20 @@ interface StageFailuresTable {
720
721
  resolved_at: Date | null;
721
722
  retain_until: Generated<Date>;
722
723
  }
724
+ /**
725
+ * The instance's declared scope — one row per network. `start_height` is what
726
+ * makes missing history below it deliberate rather than a gap.
727
+ */
728
+ interface SyncScopesTable {
729
+ network: string;
730
+ start_height: number;
731
+ target_height: number | null;
732
+ bootstrap_source: BootstrapSource;
733
+ bootstrap_manifest_digest: string | null;
734
+ genesis_hash: string | null;
735
+ created_at: Generated<Date>;
736
+ updated_at: Generated<Date>;
737
+ }
723
738
  interface Database {
724
739
  blocks: BlocksTable;
725
740
  transactions: TransactionsTable;
@@ -772,6 +787,7 @@ interface Database {
772
787
  chain_read_cache: ChainReadCacheTable;
773
788
  pending_fork_blocks: PendingForkBlocksTable;
774
789
  observer_journal: ObserverJournalTable;
790
+ sync_scopes: SyncScopesTable;
775
791
  stage_registry: StageRegistryTable;
776
792
  stage_runs: StageRunsTable;
777
793
  stage_block_receipts: StageBlockReceiptsTable;
@@ -18,6 +18,7 @@ declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch
18
18
  type FailureClass = (typeof FAILURE_CLASSES)[number];
19
19
  declare const RETRY_STATES: readonly ["open", "retrying", "halted", "resolved"];
20
20
  type RetryState = (typeof RETRY_STATES)[number];
21
+ type BootstrapSource = "archive" | "genesis" | "import";
21
22
  interface BlocksTable {
22
23
  height: number;
23
24
  hash: string;
@@ -720,6 +721,20 @@ interface StageFailuresTable {
720
721
  resolved_at: Date | null;
721
722
  retain_until: Generated<Date>;
722
723
  }
724
+ /**
725
+ * The instance's declared scope — one row per network. `start_height` is what
726
+ * makes missing history below it deliberate rather than a gap.
727
+ */
728
+ interface SyncScopesTable {
729
+ network: string;
730
+ start_height: number;
731
+ target_height: number | null;
732
+ bootstrap_source: BootstrapSource;
733
+ bootstrap_manifest_digest: string | null;
734
+ genesis_hash: string | null;
735
+ created_at: Generated<Date>;
736
+ updated_at: Generated<Date>;
737
+ }
723
738
  interface Database {
724
739
  blocks: BlocksTable;
725
740
  transactions: TransactionsTable;
@@ -772,6 +787,7 @@ interface Database {
772
787
  chain_read_cache: ChainReadCacheTable;
773
788
  pending_fork_blocks: PendingForkBlocksTable;
774
789
  observer_journal: ObserverJournalTable;
790
+ sync_scopes: SyncScopesTable;
775
791
  stage_registry: StageRegistryTable;
776
792
  stage_runs: StageRunsTable;
777
793
  stage_block_receipts: StageBlockReceiptsTable;
@@ -18,6 +18,7 @@ declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch
18
18
  type FailureClass = (typeof FAILURE_CLASSES)[number];
19
19
  declare const RETRY_STATES: readonly ["open", "retrying", "halted", "resolved"];
20
20
  type RetryState = (typeof RETRY_STATES)[number];
21
+ type BootstrapSource = "archive" | "genesis" | "import";
21
22
  interface BlocksTable {
22
23
  height: number;
23
24
  hash: string;
@@ -720,6 +721,20 @@ interface StageFailuresTable {
720
721
  resolved_at: Date | null;
721
722
  retain_until: Generated<Date>;
722
723
  }
724
+ /**
725
+ * The instance's declared scope — one row per network. `start_height` is what
726
+ * makes missing history below it deliberate rather than a gap.
727
+ */
728
+ interface SyncScopesTable {
729
+ network: string;
730
+ start_height: number;
731
+ target_height: number | null;
732
+ bootstrap_source: BootstrapSource;
733
+ bootstrap_manifest_digest: string | null;
734
+ genesis_hash: string | null;
735
+ created_at: Generated<Date>;
736
+ updated_at: Generated<Date>;
737
+ }
723
738
  interface Database {
724
739
  blocks: BlocksTable;
725
740
  transactions: TransactionsTable;
@@ -772,6 +787,7 @@ interface Database {
772
787
  chain_read_cache: ChainReadCacheTable;
773
788
  pending_fork_blocks: PendingForkBlocksTable;
774
789
  observer_journal: ObserverJournalTable;
790
+ sync_scopes: SyncScopesTable;
775
791
  stage_registry: StageRegistryTable;
776
792
  stage_runs: StageRunsTable;
777
793
  stage_block_receipts: StageBlockReceiptsTable;
@@ -18,6 +18,7 @@ declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch
18
18
  type FailureClass = (typeof FAILURE_CLASSES)[number];
19
19
  declare const RETRY_STATES: readonly ["open", "retrying", "halted", "resolved"];
20
20
  type RetryState = (typeof RETRY_STATES)[number];
21
+ type BootstrapSource = "archive" | "genesis" | "import";
21
22
  interface BlocksTable {
22
23
  height: number;
23
24
  hash: string;
@@ -720,6 +721,20 @@ interface StageFailuresTable {
720
721
  resolved_at: Date | null;
721
722
  retain_until: Generated<Date>;
722
723
  }
724
+ /**
725
+ * The instance's declared scope — one row per network. `start_height` is what
726
+ * makes missing history below it deliberate rather than a gap.
727
+ */
728
+ interface SyncScopesTable {
729
+ network: string;
730
+ start_height: number;
731
+ target_height: number | null;
732
+ bootstrap_source: BootstrapSource;
733
+ bootstrap_manifest_digest: string | null;
734
+ genesis_hash: string | null;
735
+ created_at: Generated<Date>;
736
+ updated_at: Generated<Date>;
737
+ }
723
738
  interface Database {
724
739
  blocks: BlocksTable;
725
740
  transactions: TransactionsTable;
@@ -772,6 +787,7 @@ interface Database {
772
787
  chain_read_cache: ChainReadCacheTable;
773
788
  pending_fork_blocks: PendingForkBlocksTable;
774
789
  observer_journal: ObserverJournalTable;
790
+ sync_scopes: SyncScopesTable;
775
791
  stage_registry: StageRegistryTable;
776
792
  stage_runs: StageRunsTable;
777
793
  stage_block_receipts: StageBlockReceiptsTable;