@secondlayer/shared 6.23.0 → 6.25.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/db/index.d.ts +730 -1
- package/dist/src/db/index.js +251 -1
- package/dist/src/db/index.js.map +4 -4
- package/dist/src/db/queries/chain-reorgs.d.ts +2 -0
- package/dist/src/db/queries/chain-reorgs.js +249 -1
- package/dist/src/db/queries/chain-reorgs.js.map +4 -4
- package/dist/src/db/queries/contracts.d.ts +2 -0
- package/dist/src/db/queries/integrity.d.ts +2 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +2 -0
- package/dist/src/db/queries/subgraph-operations.d.ts +2 -0
- package/dist/src/db/queries/subgraphs.d.ts +2 -0
- package/dist/src/db/queries/subgraphs.js +249 -1
- package/dist/src/db/queries/subgraphs.js.map +4 -4
- package/dist/src/db/queries/subscriptions.d.ts +2 -0
- package/dist/src/db/schema.d.ts +2 -0
- package/dist/src/errors.d.ts +5 -2
- package/dist/src/errors.js +8 -5
- package/dist/src/errors.js.map +3 -3
- package/dist/src/index.d.ts +772 -3
- package/dist/src/index.js +258 -5
- package/dist/src/index.js.map +6 -6
- package/dist/src/node/client.d.ts +52 -0
- package/dist/src/node/client.js +188 -1
- package/dist/src/node/client.js.map +5 -4
- package/dist/src/node/consensus.d.ts +38 -0
- package/dist/src/node/consensus.js +67 -0
- package/dist/src/node/consensus.js.map +10 -0
- package/dist/src/node/local-client.d.ts +2 -0
- package/dist/src/node/nakamoto.d.ts +90 -0
- package/dist/src/node/nakamoto.js +177 -0
- package/dist/src/node/nakamoto.js.map +10 -0
- package/dist/src/schemas/index.js.map +2 -2
- package/dist/src/schemas/subscriptions.d.ts +10 -1
- package/dist/src/schemas/subscriptions.js.map +2 -2
- package/dist/src/types.d.ts +2 -0
- package/migrations/0089_blocks_index_block_hash.ts +25 -0
- package/package.json +9 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Kysely, sql } from "kysely";
|
|
2
|
+
import { onChainPlane } from "../src/db/migration-role.ts";
|
|
3
|
+
|
|
4
|
+
// Persist the Nakamoto `index_block_hash` (StacksBlockId) on `blocks`. It
|
|
5
|
+
// already arrives in the node's /new_block payload but was dropped at insert;
|
|
6
|
+
// keeping it lets the tx-inclusion proof endpoint resolve a block's signed
|
|
7
|
+
// header from /v3/blocks without an extra node round-trip per request. Nullable:
|
|
8
|
+
// historical rows backfill lazily / on demand. `blocks` is a chain-plane table,
|
|
9
|
+
// so the DDL no-ops on the control DB under the source/target split.
|
|
10
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
11
|
+
await onChainPlane(async () => {
|
|
12
|
+
await sql`SET lock_timeout = '30s'`.execute(db);
|
|
13
|
+
await sql`ALTER TABLE blocks ADD COLUMN IF NOT EXISTS index_block_hash TEXT`.execute(
|
|
14
|
+
db,
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
20
|
+
await onChainPlane(async () => {
|
|
21
|
+
await sql`ALTER TABLE blocks DROP COLUMN IF EXISTS index_block_hash`.execute(
|
|
22
|
+
db,
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secondlayer/shared",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.25.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -124,6 +124,14 @@
|
|
|
124
124
|
"types": "./dist/src/node/hiro-client.d.ts",
|
|
125
125
|
"import": "./dist/src/node/hiro-client.js"
|
|
126
126
|
},
|
|
127
|
+
"./node/nakamoto": {
|
|
128
|
+
"types": "./dist/src/node/nakamoto.d.ts",
|
|
129
|
+
"import": "./dist/src/node/nakamoto.js"
|
|
130
|
+
},
|
|
131
|
+
"./node/consensus": {
|
|
132
|
+
"types": "./dist/src/node/consensus.d.ts",
|
|
133
|
+
"import": "./dist/src/node/consensus.js"
|
|
134
|
+
},
|
|
127
135
|
"./node/local-client": {
|
|
128
136
|
"types": "./dist/src/node/local-client.d.ts",
|
|
129
137
|
"import": "./dist/src/node/local-client.js"
|