@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.
- package/dist/src/archive/copy-loader.d.ts +1 -1
- package/dist/src/archive/copy-loader.js +4 -20
- package/dist/src/archive/copy-loader.js.map +2 -2
- package/dist/src/archive/derived-stage-report.d.ts +1 -1
- package/dist/src/archive/derived-stage-report.js +3 -19
- package/dist/src/archive/derived-stage-report.js.map +2 -2
- package/dist/src/archive/disk-guard.d.ts +1 -1
- package/dist/src/archive/disk-guard.js +3 -19
- package/dist/src/archive/disk-guard.js.map +2 -2
- package/dist/src/archive/instance-diagnosis.d.ts +1 -1
- package/dist/src/archive/instance-diagnosis.js +6 -22
- package/dist/src/archive/instance-diagnosis.js.map +2 -2
- package/dist/src/archive/key-registry.d.ts +1 -1
- package/dist/src/archive/key-registry.js +12 -12
- package/dist/src/archive/key-registry.js.map +1 -1
- package/dist/src/archive/per-height-digest.d.ts +1 -1
- package/dist/src/archive/per-height-digest.js +3 -17
- package/dist/src/archive/per-height-digest.js.map +5 -5
- package/dist/src/archive/progress.d.ts +1 -1
- package/dist/src/archive/progress.js +4 -20
- package/dist/src/archive/progress.js.map +2 -2
- package/dist/src/archive/range-digest.d.ts +25 -30
- package/dist/src/archive/range-digest.js +4 -20
- package/dist/src/archive/range-digest.js.map +2 -2
- package/dist/src/archive/reference.d.ts +1 -1
- package/dist/src/archive/reference.js +14 -12
- package/dist/src/archive/reference.js.map +5 -5
- package/dist/src/archive/root-key.d.ts +1 -1
- package/dist/src/archive/root-key.js +3 -19
- package/dist/src/archive/root-key.js.map +2 -2
- package/dist/src/archive/semantic-digest-builder.d.ts +25 -30
- package/dist/src/archive/semantic-digest-builder.js +5 -19
- package/dist/src/archive/semantic-digest-builder.js.map +5 -5
- package/dist/src/archive/semantic-digest.d.ts +1 -1
- package/dist/src/archive/semantic-digest.js +4 -20
- package/dist/src/archive/semantic-digest.js.map +2 -2
- package/dist/src/archive/status.d.ts +1 -1
- package/dist/src/archive/status.js +4 -20
- package/dist/src/archive/status.js.map +2 -2
- package/dist/src/coverage/index.d.ts +24 -29
- package/dist/src/coverage/index.js +80 -96
- package/dist/src/coverage/index.js.map +2 -2
- package/dist/src/crypto/ed25519.d.ts +1 -1
- package/dist/src/crypto/ed25519.js +13 -13
- package/dist/src/crypto/ed25519.js.map +1 -1
- package/dist/src/crypto/hmac.d.ts +1 -1
- package/dist/src/crypto/hmac.js +9 -9
- package/dist/src/crypto/hmac.js.map +1 -1
- package/dist/src/crypto/secondlayer-webhook.d.ts +1 -1
- package/dist/src/crypto/secondlayer-webhook.js +14 -14
- package/dist/src/crypto/secondlayer-webhook.js.map +2 -2
- package/dist/src/crypto/secrets.d.ts +1 -1
- package/dist/src/crypto/secrets.js +15 -29
- package/dist/src/crypto/secrets.js.map +5 -5
- package/dist/src/crypto/standard-webhooks.d.ts +1 -1
- package/dist/src/crypto/standard-webhooks.js +3 -19
- package/dist/src/crypto/standard-webhooks.js.map +2 -2
- package/dist/src/db/index.d.ts +46 -57
- package/dist/src/db/index.js +42 -58
- package/dist/src/db/index.js.map +6 -6
- package/dist/src/db/jsonb.d.ts +1 -1
- package/dist/src/db/jsonb.js +3 -19
- package/dist/src/db/jsonb.js.map +2 -2
- package/dist/src/db/queries/chain-reorgs.d.ts +24 -29
- package/dist/src/db/queries/chain-reorgs.js +29 -45
- package/dist/src/db/queries/chain-reorgs.js.map +6 -6
- package/dist/src/db/queries/contracts.d.ts +24 -29
- package/dist/src/db/queries/contracts.js +9 -23
- package/dist/src/db/queries/contracts.js.map +5 -5
- package/dist/src/db/queries/instance.d.ts +24 -29
- package/dist/src/db/queries/instance.js +7 -23
- package/dist/src/db/queries/instance.js.map +2 -2
- package/dist/src/db/queries/integrity.d.ts +25 -30
- package/dist/src/db/queries/integrity.js +8 -23
- package/dist/src/db/queries/integrity.js.map +3 -3
- package/dist/src/db/queries/subgraph-gaps.d.ts +24 -29
- package/dist/src/db/queries/subgraph-gaps.js +5 -21
- package/dist/src/db/queries/subgraph-gaps.js.map +2 -2
- package/dist/src/db/queries/subgraph-operations.d.ts +24 -29
- package/dist/src/db/queries/subgraph-operations.js +17 -33
- package/dist/src/db/queries/subgraph-operations.js.map +2 -2
- package/dist/src/db/queries/subgraphs.d.ts +23 -44
- package/dist/src/db/queries/subgraphs.js +15 -46
- package/dist/src/db/queries/subgraphs.js.map +5 -5
- package/dist/src/db/queries/sync-scope.d.ts +24 -29
- package/dist/src/db/queries/sync-scope.js +6 -22
- package/dist/src/db/queries/sync-scope.js.map +2 -2
- package/dist/src/db/queries/webhooks.d.ts +24 -29
- package/dist/src/db/queries/webhooks.js +54 -50
- package/dist/src/db/queries/webhooks.js.map +5 -5
- package/dist/src/db/schema.d.ts +27 -37
- package/dist/src/env.d.ts +1 -1
- package/dist/src/env.js +7 -23
- package/dist/src/env.js.map +2 -2
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js +15 -31
- package/dist/src/errors.js.map +2 -2
- package/dist/src/index-http.d.ts +1 -1
- package/dist/src/index-http.js +3 -19
- package/dist/src/index-http.js.map +2 -2
- package/dist/src/index-internal-auth.d.ts +1 -1
- package/dist/src/index-internal-auth.js +7 -23
- package/dist/src/index-internal-auth.js.map +2 -2
- package/dist/src/index.d.ts +164 -187
- package/dist/src/index.js +261 -316
- package/dist/src/index.js.map +13 -13
- package/dist/src/leader.d.ts +1 -1
- package/dist/src/leader.js +7 -21
- package/dist/src/leader.js.map +5 -5
- package/dist/src/logger.js +1 -17
- package/dist/src/logger.js.map +2 -2
- package/dist/src/mode.d.ts +1 -1
- package/dist/src/mode.js +5 -21
- package/dist/src/mode.js.map +2 -2
- package/dist/src/node/archive-client.d.ts +1 -1
- package/dist/src/node/archive-client.js +9 -23
- package/dist/src/node/archive-client.js.map +5 -5
- package/dist/src/node/client.d.ts +1 -1
- package/dist/src/node/client.js +4 -18
- package/dist/src/node/client.js.map +5 -5
- package/dist/src/node/consensus.d.ts +1 -1
- package/dist/src/node/consensus.js +5 -21
- package/dist/src/node/consensus.js.map +2 -2
- package/dist/src/node/hiro-client.d.ts +1 -1
- package/dist/src/node/hiro-client.js +1 -17
- package/dist/src/node/hiro-client.js.map +2 -2
- package/dist/src/node/hiro-pg-client.js +1 -17
- package/dist/src/node/hiro-pg-client.js.map +2 -2
- package/dist/src/node/local-client.d.ts +24 -29
- package/dist/src/node/local-client.js +3 -19
- package/dist/src/node/local-client.js.map +2 -2
- package/dist/src/node/nakamoto.d.ts +1 -1
- package/dist/src/node/nakamoto.js +12 -28
- package/dist/src/node/nakamoto.js.map +2 -2
- package/dist/src/queue/listener.d.ts +1 -1
- package/dist/src/queue/listener.js +4 -20
- package/dist/src/queue/listener.js.map +2 -2
- package/dist/src/runtime/index.d.ts +1 -1
- package/dist/src/runtime/index.js +51 -67
- package/dist/src/runtime/index.js.map +2 -2
- package/dist/src/schemas/index.d.ts +1 -4
- package/dist/src/schemas/index.js +19 -37
- package/dist/src/schemas/index.js.map +3 -3
- package/dist/src/schemas/subgraphs.d.ts +1 -4
- package/dist/src/schemas/subgraphs.js +1 -18
- package/dist/src/schemas/subgraphs.js.map +3 -3
- package/dist/src/schemas/webhooks.d.ts +1 -1
- package/dist/src/schemas/webhooks.js +21 -37
- package/dist/src/schemas/webhooks.js.map +2 -2
- package/dist/src/streams-bulk-manifest.d.ts +1 -1
- package/dist/src/streams-bulk-manifest.js +9 -9
- package/dist/src/streams-bulk-manifest.js.map +1 -1
- package/dist/src/streams-rows/index.d.ts +1 -1
- package/dist/src/streams-rows/index.js +32 -48
- package/dist/src/streams-rows/index.js.map +2 -2
- package/dist/src/subgraphs/spec.d.ts +1 -11
- package/dist/src/subgraphs/spec.js +27 -93
- package/dist/src/subgraphs/spec.js.map +3 -3
- package/dist/src/types.d.ts +1 -1
- package/migrations/0134_waitlists.ts +64 -0
- package/migrations/0135_drop_hosted_play_and_meters.ts +58 -0
- package/migrations/0136_drop_subgraph_visibility.ts +34 -0
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -13,6 +13,70 @@ var __export = (target, all) => {
|
|
|
13
13
|
set: __exportSetter.bind(all, name)
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
+
// src/event-types.ts
|
|
17
|
+
import {
|
|
18
|
+
DECODED_EVENT_TYPES
|
|
19
|
+
} from "@secondlayer/stacks/filters";
|
|
20
|
+
import {
|
|
21
|
+
DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2,
|
|
22
|
+
VM_EVENT_TYPES,
|
|
23
|
+
VM_NODE_TO_STORED_TYPE
|
|
24
|
+
} from "@secondlayer/stacks/filters";
|
|
25
|
+
var VM_STORED_TO_NODE_TYPE = {
|
|
26
|
+
nested_contract_call: "contract_call_event",
|
|
27
|
+
var_set: "var_set_event",
|
|
28
|
+
map_set: "map_set_event",
|
|
29
|
+
map_insert: "map_insert_event",
|
|
30
|
+
map_delete: "map_delete_event"
|
|
31
|
+
};
|
|
32
|
+
var STREAMS_EVENT_TYPES = DECODED_EVENT_TYPES;
|
|
33
|
+
// src/db-event-types.ts
|
|
34
|
+
var STREAMS_DB_EVENT_TYPES = [
|
|
35
|
+
"stx_transfer_event",
|
|
36
|
+
"stx_mint_event",
|
|
37
|
+
"stx_burn_event",
|
|
38
|
+
"stx_lock_event",
|
|
39
|
+
"ft_transfer_event",
|
|
40
|
+
"ft_mint_event",
|
|
41
|
+
"ft_burn_event",
|
|
42
|
+
"nft_transfer_event",
|
|
43
|
+
"nft_mint_event",
|
|
44
|
+
"nft_burn_event",
|
|
45
|
+
"smart_contract_event",
|
|
46
|
+
"contract_event"
|
|
47
|
+
];
|
|
48
|
+
var DB_TO_STREAMS_EVENT_TYPE = {
|
|
49
|
+
stx_transfer_event: "stx_transfer",
|
|
50
|
+
stx_mint_event: "stx_mint",
|
|
51
|
+
stx_burn_event: "stx_burn",
|
|
52
|
+
stx_lock_event: "stx_lock",
|
|
53
|
+
ft_transfer_event: "ft_transfer",
|
|
54
|
+
ft_mint_event: "ft_mint",
|
|
55
|
+
ft_burn_event: "ft_burn",
|
|
56
|
+
nft_transfer_event: "nft_transfer",
|
|
57
|
+
nft_mint_event: "nft_mint",
|
|
58
|
+
nft_burn_event: "nft_burn",
|
|
59
|
+
smart_contract_event: "print",
|
|
60
|
+
contract_event: "print"
|
|
61
|
+
};
|
|
62
|
+
var STREAMS_TO_DB_EVENT_TYPES = {
|
|
63
|
+
stx_transfer: ["stx_transfer_event"],
|
|
64
|
+
stx_mint: ["stx_mint_event"],
|
|
65
|
+
stx_burn: ["stx_burn_event"],
|
|
66
|
+
stx_lock: ["stx_lock_event"],
|
|
67
|
+
ft_transfer: ["ft_transfer_event"],
|
|
68
|
+
ft_mint: ["ft_mint_event"],
|
|
69
|
+
ft_burn: ["ft_burn_event"],
|
|
70
|
+
nft_transfer: ["nft_transfer_event"],
|
|
71
|
+
nft_mint: ["nft_mint_event"],
|
|
72
|
+
nft_burn: ["nft_burn_event"],
|
|
73
|
+
print: ["smart_contract_event", "contract_event"]
|
|
74
|
+
};
|
|
75
|
+
// src/db/index.ts
|
|
76
|
+
import { Kysely } from "kysely";
|
|
77
|
+
import { PostgresJSDialect } from "kysely-postgres-js";
|
|
78
|
+
import postgres from "postgres";
|
|
79
|
+
|
|
16
80
|
// src/env.ts
|
|
17
81
|
import { z } from "zod";
|
|
18
82
|
var networksSchema = z.string().transform((val) => {
|
|
@@ -178,27 +242,7 @@ function isOssMode() {
|
|
|
178
242
|
return getInstanceMode() === "oss";
|
|
179
243
|
}
|
|
180
244
|
|
|
181
|
-
// src/db/jsonb.ts
|
|
182
|
-
import { sql } from "kysely";
|
|
183
|
-
function jsonb(value) {
|
|
184
|
-
const escaped = JSON.stringify(value, (_k, v) => typeof v === "bigint" ? v.toString() : v).replace(/'/g, "''");
|
|
185
|
-
return sql`${sql.raw(`'${escaped}'::jsonb`)}`;
|
|
186
|
-
}
|
|
187
|
-
function parseJsonb(value) {
|
|
188
|
-
if (typeof value === "string") {
|
|
189
|
-
try {
|
|
190
|
-
return JSON.parse(value);
|
|
191
|
-
} catch {
|
|
192
|
-
return value;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return value ?? {};
|
|
196
|
-
}
|
|
197
|
-
|
|
198
245
|
// src/db/index.ts
|
|
199
|
-
import { Kysely } from "kysely";
|
|
200
|
-
import { PostgresJSDialect } from "kysely-postgres-js";
|
|
201
|
-
import postgres from "postgres";
|
|
202
246
|
import { sql as sql2 } from "kysely";
|
|
203
247
|
|
|
204
248
|
// src/db/source-read-columns.ts
|
|
@@ -715,6 +759,22 @@ var SOURCE_READ_PKS = {
|
|
|
715
759
|
events: ["tx_id", "event_index"],
|
|
716
760
|
chain_reorgs: null
|
|
717
761
|
};
|
|
762
|
+
// src/db/jsonb.ts
|
|
763
|
+
import { sql } from "kysely";
|
|
764
|
+
function jsonb(value) {
|
|
765
|
+
const escaped = JSON.stringify(value, (_k, v) => typeof v === "bigint" ? v.toString() : v).replace(/'/g, "''");
|
|
766
|
+
return sql`${sql.raw(`'${escaped}'::jsonb`)}`;
|
|
767
|
+
}
|
|
768
|
+
function parseJsonb(value) {
|
|
769
|
+
if (typeof value === "string") {
|
|
770
|
+
try {
|
|
771
|
+
return JSON.parse(value);
|
|
772
|
+
} catch {
|
|
773
|
+
return value;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
return value ?? {};
|
|
777
|
+
}
|
|
718
778
|
// src/db/migration-role.ts
|
|
719
779
|
var currentRole = "both";
|
|
720
780
|
function setMigrationRole(role) {
|
|
@@ -773,8 +833,6 @@ var TABLE_TO_DB = {
|
|
|
773
833
|
api_keys: "target",
|
|
774
834
|
sessions: "target",
|
|
775
835
|
magic_links: "target",
|
|
776
|
-
claim_tokens: "target",
|
|
777
|
-
play_provisions: "target",
|
|
778
836
|
account_spend_caps: "target",
|
|
779
837
|
processed_stripe_events: "target",
|
|
780
838
|
webhooks: "target",
|
|
@@ -788,8 +846,9 @@ var TABLE_TO_DB = {
|
|
|
788
846
|
subgraph_violations: "target",
|
|
789
847
|
subgraph_processing_stats: "target",
|
|
790
848
|
account_credits: "target",
|
|
791
|
-
hosted_meter_days: "target",
|
|
792
849
|
archive_fetches: "target",
|
|
850
|
+
waitlists: "target",
|
|
851
|
+
waitlist_signups: "target",
|
|
793
852
|
service_heartbeats: "both"
|
|
794
853
|
};
|
|
795
854
|
|
|
@@ -1099,12 +1158,58 @@ var CODE_TO_STATUS = {
|
|
|
1099
1158
|
function getErrorMessage(err) {
|
|
1100
1159
|
return err instanceof Error ? err.message : String(err);
|
|
1101
1160
|
}
|
|
1102
|
-
|
|
1161
|
+
// src/finality.ts
|
|
1162
|
+
var DEFAULT_BTC_CONFIRMATIONS = 6;
|
|
1163
|
+
function finalizedBurnHeight(burnTipHeight, confirmations = DEFAULT_BTC_CONFIRMATIONS) {
|
|
1164
|
+
if (!Number.isInteger(burnTipHeight) || burnTipHeight < 0) {
|
|
1165
|
+
throw new Error("burnTipHeight must be a non-negative integer");
|
|
1166
|
+
}
|
|
1167
|
+
if (!Number.isInteger(confirmations) || confirmations < 0) {
|
|
1168
|
+
throw new Error("confirmations must be a non-negative integer");
|
|
1169
|
+
}
|
|
1170
|
+
return Math.max(0, burnTipHeight - confirmations);
|
|
1171
|
+
}
|
|
1172
|
+
// src/streams-cursor.ts
|
|
1173
|
+
var EMPTY_RANGE_EVENT_INDEX_SENTINEL = 2147483647;
|
|
1174
|
+
function encodeStreamsCursor(cursor) {
|
|
1175
|
+
return `${cursor.block_height}:${cursor.event_index}`;
|
|
1176
|
+
}
|
|
1177
|
+
function decodeStreamsCursor(cursor) {
|
|
1178
|
+
const match = /^(0|[1-9]\d*):(0|[1-9]\d*)$/.exec(cursor);
|
|
1179
|
+
if (!match) {
|
|
1180
|
+
throw new Error("Invalid Streams cursor");
|
|
1181
|
+
}
|
|
1182
|
+
const decoded = {
|
|
1183
|
+
block_height: Number(match[1]),
|
|
1184
|
+
event_index: Number(match[2])
|
|
1185
|
+
};
|
|
1186
|
+
if (!Number.isSafeInteger(decoded.block_height) || !Number.isSafeInteger(decoded.event_index)) {
|
|
1187
|
+
throw new Error("Invalid Streams cursor");
|
|
1188
|
+
}
|
|
1189
|
+
return decoded;
|
|
1190
|
+
}
|
|
1191
|
+
function compareStreamsCursor(a, b) {
|
|
1192
|
+
if (a.block_height !== b.block_height) {
|
|
1193
|
+
return a.block_height < b.block_height ? -1 : 1;
|
|
1194
|
+
}
|
|
1195
|
+
if (a.event_index !== b.event_index) {
|
|
1196
|
+
return a.event_index < b.event_index ? -1 : 1;
|
|
1197
|
+
}
|
|
1198
|
+
return 0;
|
|
1199
|
+
}
|
|
1200
|
+
function isEmptyRangeCursor(cursor) {
|
|
1201
|
+
return cursor.event_index === EMPTY_RANGE_EVENT_INDEX_SENTINEL;
|
|
1202
|
+
}
|
|
1203
|
+
function blockEndCursor(height) {
|
|
1204
|
+
return {
|
|
1205
|
+
block_height: height,
|
|
1206
|
+
event_index: EMPTY_RANGE_EVENT_INDEX_SENTINEL
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1103
1209
|
// src/schemas/subgraphs.ts
|
|
1104
1210
|
import { z as z2 } from "zod";
|
|
1105
1211
|
var DeploySubgraphRequestSchema = z2.object({
|
|
1106
1212
|
name: z2.string().regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").max(63),
|
|
1107
|
-
version: z2.string().optional(),
|
|
1108
1213
|
description: z2.string().optional(),
|
|
1109
1214
|
sources: z2.record(z2.string(), z2.record(z2.string(), z2.unknown())).refine((s) => Object.keys(s).length > 0, "Must have at least one source"),
|
|
1110
1215
|
schema: z2.record(z2.string(), z2.unknown()),
|
|
@@ -1113,7 +1218,6 @@ var DeploySubgraphRequestSchema = z2.object({
|
|
|
1113
1218
|
sourceCode: z2.string().max(1048576, "source code exceeds 1MB limit").optional(),
|
|
1114
1219
|
dryRun: z2.boolean().optional()
|
|
1115
1220
|
});
|
|
1116
|
-
|
|
1117
1221
|
// src/schemas/webhooks.ts
|
|
1118
1222
|
import { z as z3 } from "zod";
|
|
1119
1223
|
var WEBHOOK_FORMATS = [
|
|
@@ -1518,24 +1622,19 @@ function validateWebhookFilterForTable(input) {
|
|
|
1518
1622
|
}
|
|
1519
1623
|
// src/subgraphs/spec.ts
|
|
1520
1624
|
var SYSTEM_COLUMNS = ["_id", "_block_height", "_tx_id", "_created_at"];
|
|
1521
|
-
var BASE_QUERY_PARAMS = ["_limit", "
|
|
1522
|
-
var PUBLIC_BASE_QUERY_PARAMS = ["_limit", "cursor", "_order", "_fields"];
|
|
1625
|
+
var BASE_QUERY_PARAMS = ["_limit", "cursor", "_order", "_fields"];
|
|
1523
1626
|
var COMPARISON_OPS = ["neq", "gt", "gte", "lt", "lte"];
|
|
1524
|
-
function isPublicRead(detail, options) {
|
|
1525
|
-
return options.forcePublicRead ?? detail.visibility === "public";
|
|
1526
|
-
}
|
|
1527
1627
|
function generatedAt(options) {
|
|
1528
1628
|
return options.generatedAt ?? new Date().toISOString();
|
|
1529
1629
|
}
|
|
1530
1630
|
function normalizeServerUrl(serverUrl) {
|
|
1531
1631
|
return (serverUrl ?? "http://127.0.0.1:3800").replace(/\/+$/, "");
|
|
1532
1632
|
}
|
|
1533
|
-
function tablePath(subgraphName, tableName
|
|
1534
|
-
|
|
1535
|
-
return `${base}/${subgraphName}/${tableName}`;
|
|
1633
|
+
function tablePath(subgraphName, tableName) {
|
|
1634
|
+
return `/v1/subgraphs/${subgraphName}/${tableName}`;
|
|
1536
1635
|
}
|
|
1537
|
-
function countPath(subgraphName, tableName
|
|
1538
|
-
return `${tablePath(subgraphName, tableName
|
|
1636
|
+
function countPath(subgraphName, tableName) {
|
|
1637
|
+
return `${tablePath(subgraphName, tableName)}/count`;
|
|
1539
1638
|
}
|
|
1540
1639
|
function isTextLike(type) {
|
|
1541
1640
|
return type === "text" || type === "principal" || type === "timestamp";
|
|
@@ -1602,50 +1701,50 @@ function columnEntries(table) {
|
|
|
1602
1701
|
return Object.entries(table.columns);
|
|
1603
1702
|
}
|
|
1604
1703
|
function selectableColumns(table) {
|
|
1605
|
-
return columnEntries(table).map(([
|
|
1704
|
+
return columnEntries(table).map(([name]) => name);
|
|
1606
1705
|
}
|
|
1607
1706
|
function searchableColumns(table) {
|
|
1608
|
-
return columnEntries(table).filter(([, col]) => col.searchable).map(([
|
|
1707
|
+
return columnEntries(table).filter(([, col]) => col.searchable).map(([name]) => name);
|
|
1609
1708
|
}
|
|
1610
1709
|
function filterNames(table) {
|
|
1611
1710
|
const result = [];
|
|
1612
|
-
for (const [
|
|
1613
|
-
result.push(
|
|
1614
|
-
result.push(`${
|
|
1711
|
+
for (const [name, col] of columnEntries(table)) {
|
|
1712
|
+
result.push(name);
|
|
1713
|
+
result.push(`${name}.neq`);
|
|
1615
1714
|
if (isComparable(col.type)) {
|
|
1616
|
-
for (const op of COMPARISON_OPS.filter((
|
|
1617
|
-
result.push(`${
|
|
1715
|
+
for (const op of COMPARISON_OPS.filter((op) => op !== "neq")) {
|
|
1716
|
+
result.push(`${name}.${op}`);
|
|
1618
1717
|
}
|
|
1619
1718
|
}
|
|
1620
1719
|
if (isTextLike(col.type))
|
|
1621
|
-
result.push(`${
|
|
1720
|
+
result.push(`${name}.like`);
|
|
1622
1721
|
}
|
|
1623
1722
|
return result;
|
|
1624
1723
|
}
|
|
1625
|
-
function queryParameters(table
|
|
1626
|
-
const params =
|
|
1724
|
+
function queryParameters(table) {
|
|
1725
|
+
const params = [...BASE_QUERY_PARAMS];
|
|
1627
1726
|
if (searchableColumns(table).length > 0)
|
|
1628
1727
|
params.push("_search");
|
|
1629
1728
|
return params;
|
|
1630
1729
|
}
|
|
1631
1730
|
function rowExample(table) {
|
|
1632
1731
|
const row = {};
|
|
1633
|
-
for (const [
|
|
1634
|
-
row[
|
|
1732
|
+
for (const [name, col] of columnEntries(table)) {
|
|
1733
|
+
row[name] = exampleForColumn(col.type);
|
|
1635
1734
|
}
|
|
1636
1735
|
return row;
|
|
1637
1736
|
}
|
|
1638
|
-
function openApiParameter(
|
|
1737
|
+
function openApiParameter(name, description, schema = { type: "string" }) {
|
|
1639
1738
|
return {
|
|
1640
|
-
name
|
|
1739
|
+
name,
|
|
1641
1740
|
in: "query",
|
|
1642
1741
|
required: false,
|
|
1643
1742
|
description,
|
|
1644
1743
|
schema
|
|
1645
1744
|
};
|
|
1646
1745
|
}
|
|
1647
|
-
function tableParameters(table
|
|
1648
|
-
const parameters =
|
|
1746
|
+
function tableParameters(table) {
|
|
1747
|
+
const parameters = [
|
|
1649
1748
|
openApiParameter("_limit", "Maximum rows to return.", {
|
|
1650
1749
|
type: "integer",
|
|
1651
1750
|
default: 50,
|
|
@@ -1661,52 +1760,28 @@ function tableParameters(table, publicRead) {
|
|
|
1661
1760
|
openApiParameter("_fields", "Comma-separated columns to include.", {
|
|
1662
1761
|
type: "string"
|
|
1663
1762
|
})
|
|
1664
|
-
] : [
|
|
1665
|
-
openApiParameter("_limit", "Maximum rows to return.", {
|
|
1666
|
-
type: "integer",
|
|
1667
|
-
default: 50,
|
|
1668
|
-
minimum: 1,
|
|
1669
|
-
maximum: 1000
|
|
1670
|
-
}),
|
|
1671
|
-
openApiParameter("_offset", "Rows to skip for pagination.", {
|
|
1672
|
-
type: "integer",
|
|
1673
|
-
default: 0,
|
|
1674
|
-
minimum: 0
|
|
1675
|
-
}),
|
|
1676
|
-
openApiParameter("_sort", "Column to sort by.", {
|
|
1677
|
-
type: "string",
|
|
1678
|
-
enum: selectableColumns(table)
|
|
1679
|
-
}),
|
|
1680
|
-
openApiParameter("_order", "Sort direction.", {
|
|
1681
|
-
type: "string",
|
|
1682
|
-
enum: ["asc", "desc"],
|
|
1683
|
-
default: "asc"
|
|
1684
|
-
}),
|
|
1685
|
-
openApiParameter("_fields", "Comma-separated columns to include.", {
|
|
1686
|
-
type: "string"
|
|
1687
|
-
})
|
|
1688
1763
|
];
|
|
1689
1764
|
if (searchableColumns(table).length > 0) {
|
|
1690
1765
|
parameters.push(openApiParameter("_search", "Search across searchable columns.", {
|
|
1691
1766
|
type: "string"
|
|
1692
1767
|
}));
|
|
1693
1768
|
}
|
|
1694
|
-
for (const [
|
|
1695
|
-
parameters.push(openApiParameter(
|
|
1769
|
+
for (const [name, col] of columnEntries(table)) {
|
|
1770
|
+
parameters.push(openApiParameter(name, `Filter ${name} by equality.`, {
|
|
1696
1771
|
type: "string"
|
|
1697
1772
|
}));
|
|
1698
|
-
parameters.push(openApiParameter(`${
|
|
1773
|
+
parameters.push(openApiParameter(`${name}.neq`, `Filter ${name} by inequality.`, {
|
|
1699
1774
|
type: "string"
|
|
1700
1775
|
}));
|
|
1701
1776
|
if (isComparable(col.type)) {
|
|
1702
1777
|
for (const op of ["gt", "gte", "lt", "lte"]) {
|
|
1703
|
-
parameters.push(openApiParameter(`${
|
|
1778
|
+
parameters.push(openApiParameter(`${name}.${op}`, `Filter ${name} with ${op}.`, {
|
|
1704
1779
|
type: "string"
|
|
1705
1780
|
}));
|
|
1706
1781
|
}
|
|
1707
1782
|
}
|
|
1708
1783
|
if (isTextLike(col.type)) {
|
|
1709
|
-
parameters.push(openApiParameter(`${
|
|
1784
|
+
parameters.push(openApiParameter(`${name}.like`, `Case-insensitive contains filter for ${name}.`, {
|
|
1710
1785
|
type: "string"
|
|
1711
1786
|
}));
|
|
1712
1787
|
}
|
|
@@ -1715,24 +1790,21 @@ function tableParameters(table, publicRead) {
|
|
|
1715
1790
|
}
|
|
1716
1791
|
function generateSubgraphAgentSchema(detail, options = {}) {
|
|
1717
1792
|
const serverUrl = normalizeServerUrl(options.serverUrl);
|
|
1718
|
-
const publicRead = isPublicRead(detail, options);
|
|
1719
1793
|
const tables = {};
|
|
1720
1794
|
for (const [tableName, table] of Object.entries(detail.tables)) {
|
|
1721
|
-
const path = tablePath(detail.name, tableName
|
|
1795
|
+
const path = tablePath(detail.name, tableName);
|
|
1722
1796
|
tables[tableName] = {
|
|
1723
1797
|
endpoint: `${serverUrl}${path}`,
|
|
1724
|
-
countEndpoint: `${serverUrl}${countPath(detail.name, tableName
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
streamEndpoint: `${serverUrl}${path}/stream`
|
|
1728
|
-
} : {},
|
|
1798
|
+
countEndpoint: `${serverUrl}${countPath(detail.name, tableName)}`,
|
|
1799
|
+
aggregateEndpoint: `${serverUrl}${path}/aggregate`,
|
|
1800
|
+
streamEndpoint: `${serverUrl}${path}/stream`,
|
|
1729
1801
|
rowCount: table.rowCount,
|
|
1730
1802
|
columns: table.columns,
|
|
1731
1803
|
...table.indexes ? { indexes: table.indexes } : {},
|
|
1732
1804
|
...table.uniqueKeys ? { uniqueKeys: table.uniqueKeys } : {},
|
|
1733
1805
|
query: {
|
|
1734
|
-
parameters: queryParameters(table
|
|
1735
|
-
sortable:
|
|
1806
|
+
parameters: queryParameters(table),
|
|
1807
|
+
sortable: [],
|
|
1736
1808
|
selectable: selectableColumns(table),
|
|
1737
1809
|
searchable: searchableColumns(table),
|
|
1738
1810
|
filters: filterNames(table)
|
|
@@ -1740,7 +1812,7 @@ function generateSubgraphAgentSchema(detail, options = {}) {
|
|
|
1740
1812
|
examples: {
|
|
1741
1813
|
list: rowExample(table),
|
|
1742
1814
|
count: { count: table.rowCount },
|
|
1743
|
-
curl:
|
|
1815
|
+
curl: `curl '${serverUrl}${path}?_limit=10&_order=desc'`
|
|
1744
1816
|
}
|
|
1745
1817
|
};
|
|
1746
1818
|
}
|
|
@@ -1757,7 +1829,6 @@ function generateSubgraphAgentSchema(detail, options = {}) {
|
|
|
1757
1829
|
}
|
|
1758
1830
|
function generateSubgraphOpenApi(detail, options = {}) {
|
|
1759
1831
|
const serverUrl = normalizeServerUrl(options.serverUrl);
|
|
1760
|
-
const publicRead = isPublicRead(detail, options);
|
|
1761
1832
|
const paths = {};
|
|
1762
1833
|
const schemas = {};
|
|
1763
1834
|
for (const [tableName, table] of Object.entries(detail.tables)) {
|
|
@@ -1775,7 +1846,7 @@ function generateSubgraphOpenApi(detail, options = {}) {
|
|
|
1775
1846
|
required,
|
|
1776
1847
|
example: rowExample(table)
|
|
1777
1848
|
};
|
|
1778
|
-
const responseSchema =
|
|
1849
|
+
const responseSchema = {
|
|
1779
1850
|
type: "object",
|
|
1780
1851
|
properties: {
|
|
1781
1852
|
rows: {
|
|
@@ -1792,28 +1863,12 @@ function generateSubgraphOpenApi(detail, options = {}) {
|
|
|
1792
1863
|
}
|
|
1793
1864
|
}
|
|
1794
1865
|
}
|
|
1795
|
-
} : {
|
|
1796
|
-
type: "object",
|
|
1797
|
-
properties: {
|
|
1798
|
-
data: {
|
|
1799
|
-
type: "array",
|
|
1800
|
-
items: { $ref: `#/components/schemas/${schemaName}` }
|
|
1801
|
-
},
|
|
1802
|
-
meta: {
|
|
1803
|
-
type: "object",
|
|
1804
|
-
properties: {
|
|
1805
|
-
total: { type: "integer" },
|
|
1806
|
-
limit: { type: "integer" },
|
|
1807
|
-
offset: { type: "integer" }
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1811
1866
|
};
|
|
1812
|
-
paths[tablePath(detail.name, tableName
|
|
1867
|
+
paths[tablePath(detail.name, tableName)] = {
|
|
1813
1868
|
get: {
|
|
1814
1869
|
summary: `Query ${detail.name}.${tableName}`,
|
|
1815
1870
|
operationId: `query_${detail.name.replace(/-/g, "_")}_${tableName}`,
|
|
1816
|
-
parameters: tableParameters(table
|
|
1871
|
+
parameters: tableParameters(table),
|
|
1817
1872
|
responses: {
|
|
1818
1873
|
"200": {
|
|
1819
1874
|
description: "Rows returned from the subgraph table.",
|
|
@@ -1826,11 +1881,11 @@ function generateSubgraphOpenApi(detail, options = {}) {
|
|
|
1826
1881
|
}
|
|
1827
1882
|
}
|
|
1828
1883
|
};
|
|
1829
|
-
paths[countPath(detail.name, tableName
|
|
1884
|
+
paths[countPath(detail.name, tableName)] = {
|
|
1830
1885
|
get: {
|
|
1831
1886
|
summary: `Count ${detail.name}.${tableName}`,
|
|
1832
1887
|
operationId: `count_${detail.name.replace(/-/g, "_")}_${tableName}`,
|
|
1833
|
-
parameters: tableParameters(table
|
|
1888
|
+
parameters: tableParameters(table),
|
|
1834
1889
|
responses: {
|
|
1835
1890
|
"200": {
|
|
1836
1891
|
description: "Row count for the filtered table query.",
|
|
@@ -1869,14 +1924,13 @@ function generateSubgraphOpenApi(detail, options = {}) {
|
|
|
1869
1924
|
}
|
|
1870
1925
|
function generateSubgraphMarkdown(detail, options = {}) {
|
|
1871
1926
|
const agent = generateSubgraphAgentSchema(detail, options);
|
|
1872
|
-
const publicRead = isPublicRead(detail, options);
|
|
1873
1927
|
const lines = [
|
|
1874
1928
|
`# ${detail.name} Subgraph API`,
|
|
1875
1929
|
"",
|
|
1876
1930
|
`Version: ${detail.version}`,
|
|
1877
1931
|
detail.schemaHash ? `Schema hash: ${detail.schemaHash}` : undefined,
|
|
1878
1932
|
`Server: ${agent.serverUrl}`,
|
|
1879
|
-
|
|
1933
|
+
"Responses use the `{ rows, next_cursor, tip }` envelope; paginate with `?cursor=<next_cursor>` and `_order=asc|desc` (`_offset` is rejected).",
|
|
1880
1934
|
"",
|
|
1881
1935
|
detail.description
|
|
1882
1936
|
].filter((line) => line !== undefined && line !== "");
|
|
@@ -1904,15 +1958,14 @@ function generateSubgraphSpec(detail, format, options = {}) {
|
|
|
1904
1958
|
return generateSubgraphAgentSchema(detail, options);
|
|
1905
1959
|
return generateSubgraphMarkdown(detail, options);
|
|
1906
1960
|
}
|
|
1907
|
-
|
|
1908
1961
|
// src/crypto/hmac.ts
|
|
1909
1962
|
var exports_hmac = {};
|
|
1910
1963
|
__export(exports_hmac, {
|
|
1911
|
-
|
|
1912
|
-
verifySignature: () => verifySignature,
|
|
1913
|
-
signPayload: () => signPayload,
|
|
1964
|
+
createSignatureHeader: () => createSignatureHeader,
|
|
1914
1965
|
generateSecret: () => generateSecret,
|
|
1915
|
-
|
|
1966
|
+
signPayload: () => signPayload,
|
|
1967
|
+
verifySignature: () => verifySignature,
|
|
1968
|
+
verifySignatureHeader: () => verifySignatureHeader
|
|
1916
1969
|
});
|
|
1917
1970
|
import { createHmac, randomBytes } from "node:crypto";
|
|
1918
1971
|
function generateSecret() {
|
|
@@ -1958,17 +2011,16 @@ function verifySignatureHeader(payload, header, secret, toleranceSeconds = 300)
|
|
|
1958
2011
|
const signedPayload = `${ts}.${payload}`;
|
|
1959
2012
|
return verifySignature(signedPayload, signature, secret);
|
|
1960
2013
|
}
|
|
1961
|
-
|
|
1962
2014
|
// src/crypto/ed25519.ts
|
|
1963
2015
|
var exports_ed25519 = {};
|
|
1964
2016
|
__export(exports_ed25519, {
|
|
1965
|
-
|
|
1966
|
-
signEd25519: () => signEd25519,
|
|
1967
|
-
publicKeyPemFromPrivate: () => publicKeyPemFromPrivate,
|
|
1968
|
-
loadEd25519PublicKey: () => loadEd25519PublicKey,
|
|
1969
|
-
loadEd25519PrivateKey: () => loadEd25519PrivateKey,
|
|
2017
|
+
ed25519KeyId: () => ed25519KeyId,
|
|
1970
2018
|
generateEd25519KeyPair: () => generateEd25519KeyPair,
|
|
1971
|
-
|
|
2019
|
+
loadEd25519PrivateKey: () => loadEd25519PrivateKey,
|
|
2020
|
+
loadEd25519PublicKey: () => loadEd25519PublicKey,
|
|
2021
|
+
publicKeyPemFromPrivate: () => publicKeyPemFromPrivate,
|
|
2022
|
+
signEd25519: () => signEd25519,
|
|
2023
|
+
verifyEd25519: () => verifyEd25519
|
|
1972
2024
|
});
|
|
1973
2025
|
import {
|
|
1974
2026
|
createHash,
|
|
@@ -2011,197 +2063,90 @@ function verifyEd25519(payload, signatureBase64, publicKey) {
|
|
|
2011
2063
|
return false;
|
|
2012
2064
|
}
|
|
2013
2065
|
}
|
|
2014
|
-
// src/event-types.ts
|
|
2015
|
-
import {
|
|
2016
|
-
DECODED_EVENT_TYPES
|
|
2017
|
-
} from "@secondlayer/stacks/filters";
|
|
2018
|
-
import {
|
|
2019
|
-
DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2,
|
|
2020
|
-
VM_EVENT_TYPES,
|
|
2021
|
-
VM_NODE_TO_STORED_TYPE
|
|
2022
|
-
} from "@secondlayer/stacks/filters";
|
|
2023
|
-
var VM_STORED_TO_NODE_TYPE = {
|
|
2024
|
-
nested_contract_call: "contract_call_event",
|
|
2025
|
-
var_set: "var_set_event",
|
|
2026
|
-
map_set: "map_set_event",
|
|
2027
|
-
map_insert: "map_insert_event",
|
|
2028
|
-
map_delete: "map_delete_event"
|
|
2029
|
-
};
|
|
2030
|
-
var STREAMS_EVENT_TYPES = DECODED_EVENT_TYPES;
|
|
2031
|
-
// src/db-event-types.ts
|
|
2032
|
-
var STREAMS_DB_EVENT_TYPES = [
|
|
2033
|
-
"stx_transfer_event",
|
|
2034
|
-
"stx_mint_event",
|
|
2035
|
-
"stx_burn_event",
|
|
2036
|
-
"stx_lock_event",
|
|
2037
|
-
"ft_transfer_event",
|
|
2038
|
-
"ft_mint_event",
|
|
2039
|
-
"ft_burn_event",
|
|
2040
|
-
"nft_transfer_event",
|
|
2041
|
-
"nft_mint_event",
|
|
2042
|
-
"nft_burn_event",
|
|
2043
|
-
"smart_contract_event",
|
|
2044
|
-
"contract_event"
|
|
2045
|
-
];
|
|
2046
|
-
var DB_TO_STREAMS_EVENT_TYPE = {
|
|
2047
|
-
stx_transfer_event: "stx_transfer",
|
|
2048
|
-
stx_mint_event: "stx_mint",
|
|
2049
|
-
stx_burn_event: "stx_burn",
|
|
2050
|
-
stx_lock_event: "stx_lock",
|
|
2051
|
-
ft_transfer_event: "ft_transfer",
|
|
2052
|
-
ft_mint_event: "ft_mint",
|
|
2053
|
-
ft_burn_event: "ft_burn",
|
|
2054
|
-
nft_transfer_event: "nft_transfer",
|
|
2055
|
-
nft_mint_event: "nft_mint",
|
|
2056
|
-
nft_burn_event: "nft_burn",
|
|
2057
|
-
smart_contract_event: "print",
|
|
2058
|
-
contract_event: "print"
|
|
2059
|
-
};
|
|
2060
|
-
var STREAMS_TO_DB_EVENT_TYPES = {
|
|
2061
|
-
stx_transfer: ["stx_transfer_event"],
|
|
2062
|
-
stx_mint: ["stx_mint_event"],
|
|
2063
|
-
stx_burn: ["stx_burn_event"],
|
|
2064
|
-
stx_lock: ["stx_lock_event"],
|
|
2065
|
-
ft_transfer: ["ft_transfer_event"],
|
|
2066
|
-
ft_mint: ["ft_mint_event"],
|
|
2067
|
-
ft_burn: ["ft_burn_event"],
|
|
2068
|
-
nft_transfer: ["nft_transfer_event"],
|
|
2069
|
-
nft_mint: ["nft_mint_event"],
|
|
2070
|
-
nft_burn: ["nft_burn_event"],
|
|
2071
|
-
print: ["smart_contract_event", "contract_event"]
|
|
2072
|
-
};
|
|
2073
|
-
// src/finality.ts
|
|
2074
|
-
var DEFAULT_BTC_CONFIRMATIONS = 6;
|
|
2075
|
-
function finalizedBurnHeight(burnTipHeight, confirmations = DEFAULT_BTC_CONFIRMATIONS) {
|
|
2076
|
-
if (!Number.isInteger(burnTipHeight) || burnTipHeight < 0) {
|
|
2077
|
-
throw new Error("burnTipHeight must be a non-negative integer");
|
|
2078
|
-
}
|
|
2079
|
-
if (!Number.isInteger(confirmations) || confirmations < 0) {
|
|
2080
|
-
throw new Error("confirmations must be a non-negative integer");
|
|
2081
|
-
}
|
|
2082
|
-
return Math.max(0, burnTipHeight - confirmations);
|
|
2083
|
-
}
|
|
2084
|
-
// src/streams-cursor.ts
|
|
2085
|
-
var EMPTY_RANGE_EVENT_INDEX_SENTINEL = 2147483647;
|
|
2086
|
-
function encodeStreamsCursor(cursor) {
|
|
2087
|
-
return `${cursor.block_height}:${cursor.event_index}`;
|
|
2088
|
-
}
|
|
2089
|
-
function decodeStreamsCursor(cursor) {
|
|
2090
|
-
const match = /^(0|[1-9]\d*):(0|[1-9]\d*)$/.exec(cursor);
|
|
2091
|
-
if (!match) {
|
|
2092
|
-
throw new Error("Invalid Streams cursor");
|
|
2093
|
-
}
|
|
2094
|
-
const decoded = {
|
|
2095
|
-
block_height: Number(match[1]),
|
|
2096
|
-
event_index: Number(match[2])
|
|
2097
|
-
};
|
|
2098
|
-
if (!Number.isSafeInteger(decoded.block_height) || !Number.isSafeInteger(decoded.event_index)) {
|
|
2099
|
-
throw new Error("Invalid Streams cursor");
|
|
2100
|
-
}
|
|
2101
|
-
return decoded;
|
|
2102
|
-
}
|
|
2103
|
-
function compareStreamsCursor(a, b) {
|
|
2104
|
-
if (a.block_height !== b.block_height) {
|
|
2105
|
-
return a.block_height < b.block_height ? -1 : 1;
|
|
2106
|
-
}
|
|
2107
|
-
if (a.event_index !== b.event_index) {
|
|
2108
|
-
return a.event_index < b.event_index ? -1 : 1;
|
|
2109
|
-
}
|
|
2110
|
-
return 0;
|
|
2111
|
-
}
|
|
2112
|
-
function isEmptyRangeCursor(cursor) {
|
|
2113
|
-
return cursor.event_index === EMPTY_RANGE_EVENT_INDEX_SENTINEL;
|
|
2114
|
-
}
|
|
2115
|
-
function blockEndCursor(height) {
|
|
2116
|
-
return {
|
|
2117
|
-
block_height: height,
|
|
2118
|
-
event_index: EMPTY_RANGE_EVENT_INDEX_SENTINEL
|
|
2119
|
-
};
|
|
2120
|
-
}
|
|
2121
2066
|
export {
|
|
2122
|
-
|
|
2123
|
-
sql2 as sql,
|
|
2124
|
-
setMigrationRole,
|
|
2125
|
-
parseJsonb,
|
|
2126
|
-
onControlPlane,
|
|
2127
|
-
onChainPlane,
|
|
2128
|
-
logger,
|
|
2129
|
-
jsonb,
|
|
2130
|
-
isSbtcDecoderEnabled,
|
|
2131
|
-
isPox5DecoderEnabled,
|
|
2132
|
-
isPox4DecoderEnabled,
|
|
2133
|
-
isEmptyRangeCursor,
|
|
2134
|
-
isBnsDecoderEnabled,
|
|
2135
|
-
getTargetDb,
|
|
2136
|
-
getSourceDb,
|
|
2137
|
-
getRawClientFor,
|
|
2138
|
-
getRawClient,
|
|
2139
|
-
getMigrationRole,
|
|
2140
|
-
getErrorMessage,
|
|
2141
|
-
getEnv,
|
|
2142
|
-
getDbSplitStatus,
|
|
2143
|
-
getDb,
|
|
2144
|
-
generateSubgraphSpec,
|
|
2145
|
-
generateSubgraphOpenApi,
|
|
2146
|
-
generateSubgraphMarkdown,
|
|
2147
|
-
generateSubgraphAgentSchema,
|
|
2148
|
-
formatWebhookSchemaErrors,
|
|
2149
|
-
finalizedBurnHeight,
|
|
2150
|
-
encodeStreamsCursor,
|
|
2151
|
-
exports_ed25519 as ed25519,
|
|
2152
|
-
decodeStreamsCursor,
|
|
2153
|
-
exports_hmac as crypto,
|
|
2154
|
-
compareStreamsCursor,
|
|
2155
|
-
closeDb,
|
|
2156
|
-
blockEndCursor,
|
|
2157
|
-
assertDbSplit,
|
|
2158
|
-
applicationDatabaseUrl,
|
|
2159
|
-
WebhookStatusSchema,
|
|
2160
|
-
WebhookRuntimeSchema,
|
|
2161
|
-
WebhookFormatSchema,
|
|
2162
|
-
WebhookFilterSchema,
|
|
2163
|
-
WebhookFilterPrimitiveSchema,
|
|
2164
|
-
WebhookFilterOperatorSchema,
|
|
2165
|
-
WebhookFilterClauseSchema,
|
|
2166
|
-
WEBHOOK_STATUSES,
|
|
2167
|
-
WEBHOOK_RUNTIMES,
|
|
2168
|
-
WEBHOOK_FORMATS,
|
|
2169
|
-
WEBHOOK_FILTER_OPERATORS,
|
|
2170
|
-
VersionConflictError,
|
|
2171
|
-
ValidationError,
|
|
2172
|
-
VM_STORED_TO_NODE_TYPE,
|
|
2173
|
-
VM_NODE_TO_STORED_TYPE,
|
|
2174
|
-
VM_EVENT_TYPES,
|
|
2175
|
-
UpdateWebhookRequestSchema,
|
|
2176
|
-
TenantSuspendedError,
|
|
2177
|
-
TABLE_TO_DB,
|
|
2178
|
-
SecondLayerError,
|
|
2179
|
-
STREAMS_TO_DB_EVENT_TYPES,
|
|
2180
|
-
STREAMS_EVENT_TYPES,
|
|
2181
|
-
STREAMS_DB_EVENT_TYPES,
|
|
2182
|
-
SOURCE_READ_TYPES,
|
|
2183
|
-
SOURCE_READ_PKS,
|
|
2184
|
-
SOURCE_READ_COLUMNS,
|
|
2185
|
-
ReplayWebhookRequestSchema,
|
|
2186
|
-
RateLimitError,
|
|
2187
|
-
PaymentRequiredError,
|
|
2188
|
-
NotFoundError,
|
|
2189
|
-
KeyRotatedError,
|
|
2190
|
-
ForbiddenError,
|
|
2191
|
-
ErrorCodes,
|
|
2192
|
-
EMPTY_RANGE_EVENT_INDEX_SENTINEL,
|
|
2193
|
-
DeploySubgraphRequestSchema,
|
|
2194
|
-
DatabaseError,
|
|
2195
|
-
DEFAULT_BTC_CONFIRMATIONS,
|
|
2196
|
-
DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES,
|
|
2197
|
-
DB_TO_STREAMS_EVENT_TYPE,
|
|
2198
|
-
CreateWebhookRequestSchema,
|
|
2199
|
-
CODE_TO_STATUS,
|
|
2200
|
-
CHAIN_TRIGGER_TYPES,
|
|
2201
|
-
CHAIN_TRIGGER_FIELDS,
|
|
2067
|
+
AuthenticationError,
|
|
2202
2068
|
AuthorizationError,
|
|
2203
|
-
|
|
2069
|
+
CHAIN_TRIGGER_FIELDS,
|
|
2070
|
+
CHAIN_TRIGGER_TYPES,
|
|
2071
|
+
CODE_TO_STATUS,
|
|
2072
|
+
CreateWebhookRequestSchema,
|
|
2073
|
+
DB_TO_STREAMS_EVENT_TYPE,
|
|
2074
|
+
DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES,
|
|
2075
|
+
DEFAULT_BTC_CONFIRMATIONS,
|
|
2076
|
+
DatabaseError,
|
|
2077
|
+
DeploySubgraphRequestSchema,
|
|
2078
|
+
EMPTY_RANGE_EVENT_INDEX_SENTINEL,
|
|
2079
|
+
ErrorCodes,
|
|
2080
|
+
ForbiddenError,
|
|
2081
|
+
KeyRotatedError,
|
|
2082
|
+
NotFoundError,
|
|
2083
|
+
PaymentRequiredError,
|
|
2084
|
+
RateLimitError,
|
|
2085
|
+
ReplayWebhookRequestSchema,
|
|
2086
|
+
SOURCE_READ_COLUMNS,
|
|
2087
|
+
SOURCE_READ_PKS,
|
|
2088
|
+
SOURCE_READ_TYPES,
|
|
2089
|
+
STREAMS_DB_EVENT_TYPES,
|
|
2090
|
+
STREAMS_EVENT_TYPES,
|
|
2091
|
+
STREAMS_TO_DB_EVENT_TYPES,
|
|
2092
|
+
SecondLayerError,
|
|
2093
|
+
TABLE_TO_DB,
|
|
2094
|
+
TenantSuspendedError,
|
|
2095
|
+
UpdateWebhookRequestSchema,
|
|
2096
|
+
VM_EVENT_TYPES,
|
|
2097
|
+
VM_NODE_TO_STORED_TYPE,
|
|
2098
|
+
VM_STORED_TO_NODE_TYPE,
|
|
2099
|
+
ValidationError,
|
|
2100
|
+
VersionConflictError,
|
|
2101
|
+
WEBHOOK_FILTER_OPERATORS,
|
|
2102
|
+
WEBHOOK_FORMATS,
|
|
2103
|
+
WEBHOOK_RUNTIMES,
|
|
2104
|
+
WEBHOOK_STATUSES,
|
|
2105
|
+
WebhookFilterClauseSchema,
|
|
2106
|
+
WebhookFilterOperatorSchema,
|
|
2107
|
+
WebhookFilterPrimitiveSchema,
|
|
2108
|
+
WebhookFilterSchema,
|
|
2109
|
+
WebhookFormatSchema,
|
|
2110
|
+
WebhookRuntimeSchema,
|
|
2111
|
+
WebhookStatusSchema,
|
|
2112
|
+
applicationDatabaseUrl,
|
|
2113
|
+
assertDbSplit,
|
|
2114
|
+
blockEndCursor,
|
|
2115
|
+
closeDb,
|
|
2116
|
+
compareStreamsCursor,
|
|
2117
|
+
exports_hmac as crypto,
|
|
2118
|
+
decodeStreamsCursor,
|
|
2119
|
+
exports_ed25519 as ed25519,
|
|
2120
|
+
encodeStreamsCursor,
|
|
2121
|
+
finalizedBurnHeight,
|
|
2122
|
+
formatWebhookSchemaErrors,
|
|
2123
|
+
generateSubgraphAgentSchema,
|
|
2124
|
+
generateSubgraphMarkdown,
|
|
2125
|
+
generateSubgraphOpenApi,
|
|
2126
|
+
generateSubgraphSpec,
|
|
2127
|
+
getDb,
|
|
2128
|
+
getDbSplitStatus,
|
|
2129
|
+
getEnv,
|
|
2130
|
+
getErrorMessage,
|
|
2131
|
+
getMigrationRole,
|
|
2132
|
+
getRawClient,
|
|
2133
|
+
getRawClientFor,
|
|
2134
|
+
getSourceDb,
|
|
2135
|
+
getTargetDb,
|
|
2136
|
+
isBnsDecoderEnabled,
|
|
2137
|
+
isEmptyRangeCursor,
|
|
2138
|
+
isPox4DecoderEnabled,
|
|
2139
|
+
isPox5DecoderEnabled,
|
|
2140
|
+
isSbtcDecoderEnabled,
|
|
2141
|
+
jsonb,
|
|
2142
|
+
logger,
|
|
2143
|
+
onChainPlane,
|
|
2144
|
+
onControlPlane,
|
|
2145
|
+
parseJsonb,
|
|
2146
|
+
setMigrationRole,
|
|
2147
|
+
sql2 as sql,
|
|
2148
|
+
validateWebhookFilterForTable
|
|
2204
2149
|
};
|
|
2205
2150
|
|
|
2206
|
-
//# debugId=
|
|
2151
|
+
//# debugId=920042D17F4879CF64756E2164756E21
|
|
2207
2152
|
//# sourceMappingURL=index.js.map
|