@secondlayer/shared 11.16.1 → 11.18.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.
- package/dist/src/archive/range-digest.d.ts +8 -0
- package/dist/src/archive/semantic-digest-builder.d.ts +8 -0
- package/dist/src/coverage/index.d.ts +8 -0
- package/dist/src/db/index.d.ts +11 -1
- package/dist/src/db/index.js +2 -1
- package/dist/src/db/index.js.map +3 -3
- package/dist/src/db/queries/chain-reorgs.d.ts +8 -0
- package/dist/src/db/queries/chain-reorgs.js +2 -1
- package/dist/src/db/queries/chain-reorgs.js.map +3 -3
- package/dist/src/db/queries/contracts.d.ts +8 -0
- package/dist/src/db/queries/instance.d.ts +8 -0
- package/dist/src/db/queries/integrity.d.ts +8 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +8 -0
- package/dist/src/db/queries/subgraph-operations.d.ts +8 -0
- package/dist/src/db/queries/subgraphs.d.ts +8 -0
- package/dist/src/db/queries/sync-scope.d.ts +8 -0
- package/dist/src/db/queries/webhooks.d.ts +8 -0
- package/dist/src/db/schema.d.ts +10 -1
- package/dist/src/index-http.d.ts +4 -0
- package/dist/src/index.d.ts +11 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +3 -3
- package/dist/src/node/local-client.d.ts +8 -0
- package/dist/src/queue/listener.js +2 -1
- package/dist/src/queue/listener.js.map +3 -3
- package/dist/src/streams-rows/index.d.ts +4 -0
- package/migrations/0150_sentinel_accounts.ts +27 -0
- package/package.json +1 -1
|
@@ -223,6 +223,10 @@ type RuneStreamsEvent = {
|
|
|
223
223
|
event_type: RuneEventType
|
|
224
224
|
rune_id: string
|
|
225
225
|
payload: RuneEventPayload
|
|
226
|
+
/** The event's block time, ISO 8601. Absent when the indexer has no header
|
|
227
|
+
* time for that block yet (rows written before block times were recorded,
|
|
228
|
+
* until backfilled). */
|
|
229
|
+
ts?: string
|
|
226
230
|
/** True when this event's block is past the finality boundary (immutable).
|
|
227
231
|
* Optional for back-compat with the same reasoning as `StreamsEventBase`. */
|
|
228
232
|
finalized?: boolean
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Kysely, sql } from "kysely";
|
|
2
|
+
import { onControlPlane } from "../src/db/migration-role.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Which accounts Sentinel's service key may touch. A row exists only for an
|
|
6
|
+
* account Sentinel created (`via = 'created'`) or one whose owner opted in
|
|
7
|
+
* from Sentinel's UI (`via = 'consent'`). Every `/internal/sentinel/*` call
|
|
8
|
+
* (and Sentinel-key `/internal/meters` items) beyond resolve/link requires a
|
|
9
|
+
* row, so a leaked key can't spend from or credit an arbitrary account.
|
|
10
|
+
*/
|
|
11
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
12
|
+
await onControlPlane(async () => {
|
|
13
|
+
await sql`
|
|
14
|
+
CREATE TABLE sentinel_accounts (
|
|
15
|
+
account_id uuid PRIMARY KEY REFERENCES accounts(id) ON DELETE CASCADE,
|
|
16
|
+
linked_at timestamptz NOT NULL DEFAULT now(),
|
|
17
|
+
via text NOT NULL CHECK (via IN ('created', 'consent'))
|
|
18
|
+
)
|
|
19
|
+
`.execute(db);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
24
|
+
await onControlPlane(async () => {
|
|
25
|
+
await sql`DROP TABLE IF EXISTS sentinel_accounts`.execute(db);
|
|
26
|
+
});
|
|
27
|
+
}
|