@secondlayer/shared 17.0.0 → 18.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.
- package/dist/src/archive/range-digest.d.ts +2 -65
- package/dist/src/archive/semantic-digest-builder.d.ts +2 -65
- package/dist/src/coverage/index.d.ts +12 -76
- package/dist/src/coverage/index.js +19 -60
- package/dist/src/coverage/index.js.map +3 -3
- package/dist/src/db/index.d.ts +3 -111
- package/dist/src/db/index.js +1 -34
- package/dist/src/db/index.js.map +5 -5
- package/dist/src/db/queries/chain-reorgs.d.ts +2 -65
- package/dist/src/db/queries/chain-reorgs.js +1 -34
- package/dist/src/db/queries/chain-reorgs.js.map +5 -5
- package/dist/src/db/queries/contracts.d.ts +2 -65
- package/dist/src/db/queries/contracts.js.map +2 -2
- package/dist/src/db/queries/instance.d.ts +2 -65
- package/dist/src/db/queries/integrity.d.ts +2 -65
- package/dist/src/db/queries/subgraph-gaps.d.ts +2 -65
- package/dist/src/db/queries/subgraph-operations.d.ts +2 -65
- package/dist/src/db/queries/subgraphs.d.ts +2 -65
- package/dist/src/db/queries/sync-scope.d.ts +2 -65
- package/dist/src/db/queries/webhook-replays.d.ts +2 -65
- package/dist/src/db/queries/webhooks.d.ts +2 -65
- package/dist/src/db/schema.d.ts +3 -64
- package/dist/src/db/schema.js.map +2 -2
- package/dist/src/index.d.ts +20 -111
- package/dist/src/index.js +51 -40
- package/dist/src/index.js.map +9 -7
- package/dist/src/insights/index.d.ts +2 -65
- package/dist/src/leader.js +1 -34
- package/dist/src/leader.js.map +5 -5
- package/dist/src/node/local-client.d.ts +2 -65
- package/dist/src/node/tx-summary.d.ts +7 -1
- package/dist/src/node/tx-summary.js +17 -2
- package/dist/src/node/tx-summary.js.map +3 -3
- package/dist/src/queue/listener.js +1 -34
- package/dist/src/queue/listener.js.map +5 -5
- package/dist/src/schemas/index.js +28 -7
- package/dist/src/schemas/index.js.map +5 -4
- package/dist/src/schemas/webhooks.js +28 -7
- package/dist/src/schemas/webhooks.js.map +5 -4
- package/dist/src/streams-rows/index.d.ts +35 -12
- package/dist/src/streams-rows/index.js +25 -21
- package/dist/src/streams-rows/index.js.map +5 -5
- package/migrations/0207_bns_buy_listing_price.ts +39 -0
- package/migrations/0208_pox5_calculate_rewards_cycle.ts +31 -0
- package/migrations/0209_chain_reorgs_index_block_hash.ts +51 -0
- package/migrations/0210_mempool_evict_superseded_nonces.ts +71 -0
- package/migrations/0211_decoded_events_slim.ts +114 -0
- package/migrations/0212_events_transactions_redundant_indexes.ts +71 -0
- package/migrations/0213_drop_sbtc_token_events.ts +32 -0
- package/migrations/0214_drop_coverage_receipts.ts +24 -0
- package/migrations/0215_decoder_checkpoints_last_output_at.ts +33 -0
- package/package.json +1 -1
|
@@ -10,8 +10,6 @@ declare const NATIVE_CLOCKS: readonly ["block", "cursor", "queue"];
|
|
|
10
10
|
type NativeClock = (typeof NATIVE_CLOCKS)[number];
|
|
11
11
|
declare const REPAIR_MODES: readonly ["range_safe", "full_reindex", "archive_replay", "none"];
|
|
12
12
|
type RepairMode = (typeof REPAIR_MODES)[number];
|
|
13
|
-
declare const RUN_STATUSES: readonly ["pending", "running", "complete", "syncing", "lagging", "gap", "stale", "failed", "unverified_import", "unanchored", "source_unavailable", "out_of_scope", "disabled", "halted"];
|
|
14
|
-
type RunStatus = (typeof RUN_STATUSES)[number];
|
|
15
13
|
declare const FAILURE_UNITS: readonly ["block", "range", "cursor", "queue"];
|
|
16
14
|
type FailureUnit = (typeof FAILURE_UNITS)[number];
|
|
17
15
|
declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch", "crash", "reorg", "source_gap", "handler", "timeout", "unknown"];
|
|
@@ -452,7 +450,6 @@ interface DecodedEventsTable {
|
|
|
452
450
|
tx_index: number;
|
|
453
451
|
event_index: number;
|
|
454
452
|
event_type: string;
|
|
455
|
-
microblock_hash: string | null;
|
|
456
453
|
canonical: Generated<boolean>;
|
|
457
454
|
contract_id: string | null;
|
|
458
455
|
sender: string | null;
|
|
@@ -464,13 +461,14 @@ interface DecodedEventsTable {
|
|
|
464
461
|
/** Decoded payload for event types that don't fit the flat columns
|
|
465
462
|
* (e.g. `print`: { topic, value, raw_value }). Null for transfer types. */
|
|
466
463
|
payload: unknown | null;
|
|
467
|
-
source_cursor: string;
|
|
468
464
|
created_at: Generated<Date>;
|
|
469
465
|
}
|
|
470
466
|
interface DecoderCheckpointsTable {
|
|
471
467
|
decoder_name: string;
|
|
472
468
|
last_cursor: string | null;
|
|
473
469
|
updated_at: Generated<Date>;
|
|
470
|
+
/** Last commit that wrote output rows; health's real-work signal. */
|
|
471
|
+
last_output_at: Date | null;
|
|
474
472
|
}
|
|
475
473
|
interface ChainReorgsTable {
|
|
476
474
|
id: Generated<string>;
|
|
@@ -598,23 +596,6 @@ interface SbtcEventsTable {
|
|
|
598
596
|
source_cursor: string;
|
|
599
597
|
created_at: Generated<Date>;
|
|
600
598
|
}
|
|
601
|
-
type SbtcTokenEventType = "transfer" | "mint" | "burn";
|
|
602
|
-
interface SbtcTokenEventsTable {
|
|
603
|
-
cursor: string;
|
|
604
|
-
block_height: number;
|
|
605
|
-
block_time: Date;
|
|
606
|
-
tx_id: string;
|
|
607
|
-
tx_index: number;
|
|
608
|
-
event_index: number;
|
|
609
|
-
event_type: SbtcTokenEventType;
|
|
610
|
-
sender: string | null;
|
|
611
|
-
recipient: string | null;
|
|
612
|
-
amount: string;
|
|
613
|
-
memo: string | null;
|
|
614
|
-
canonical: Generated<boolean>;
|
|
615
|
-
source_cursor: string;
|
|
616
|
-
created_at: Generated<Date>;
|
|
617
|
-
}
|
|
618
599
|
/**
|
|
619
600
|
* BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
|
|
620
601
|
* settlement-confirmer worker, which polls our own bitcoind for confirmations of
|
|
@@ -796,50 +777,10 @@ interface StageRegistryTable {
|
|
|
796
777
|
enabled: Generated<boolean>;
|
|
797
778
|
created_at: Generated<Date>;
|
|
798
779
|
}
|
|
799
|
-
/** One versioned sweep of a stage. Nothing writes this table yet; kept because the receipts and failures tables reference it. */
|
|
800
|
-
interface StageRunsTable {
|
|
801
|
-
id: Generated<string>;
|
|
802
|
-
stage_id: string;
|
|
803
|
-
code_hash: string;
|
|
804
|
-
config_hash: string;
|
|
805
|
-
handler_hash: string | null;
|
|
806
|
-
target_height: number | null;
|
|
807
|
-
target_cursor: string | null;
|
|
808
|
-
status: RunStatus;
|
|
809
|
-
complete_through: number | null;
|
|
810
|
-
started_at: Generated<Date>;
|
|
811
|
-
finished_at: Date | null;
|
|
812
|
-
}
|
|
813
|
-
/** Per-block acknowledgement. Unique on (stage, height, hash). */
|
|
814
|
-
interface StageBlockReceiptsTable {
|
|
815
|
-
id: Generated<string>;
|
|
816
|
-
stage_id: string;
|
|
817
|
-
run_id: string | null;
|
|
818
|
-
block_height: number;
|
|
819
|
-
block_hash: string;
|
|
820
|
-
input_count: number;
|
|
821
|
-
input_digest: string;
|
|
822
|
-
effect_digest: string;
|
|
823
|
-
finalized: Generated<boolean>;
|
|
824
|
-
compacted_at: Date | null;
|
|
825
|
-
created_at: Generated<Date>;
|
|
826
|
-
}
|
|
827
|
-
/** Compacted finalized range. Only sealed after receipts in the range finalize. */
|
|
828
|
-
interface CoverageSegmentsTable {
|
|
829
|
-
id: Generated<string>;
|
|
830
|
-
stage_id: string;
|
|
831
|
-
from_height: number;
|
|
832
|
-
to_height: number;
|
|
833
|
-
chain_digest: string;
|
|
834
|
-
input_digest: string;
|
|
835
|
-
output_digest: string;
|
|
836
|
-
sealed_at: Generated<Date>;
|
|
837
|
-
}
|
|
838
780
|
/** Exact unit or range that failed, plus retry/retention state. */
|
|
839
781
|
interface StageFailuresTable {
|
|
840
782
|
id: Generated<string>;
|
|
841
783
|
stage_id: string;
|
|
842
|
-
run_id: string | null;
|
|
843
784
|
unit_kind: FailureUnit;
|
|
844
785
|
from_height: number | null;
|
|
845
786
|
to_height: number | null;
|
|
@@ -909,7 +850,6 @@ interface Database {
|
|
|
909
850
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
910
851
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
911
852
|
sbtc_events: SbtcEventsTable;
|
|
912
|
-
sbtc_token_events: SbtcTokenEventsTable;
|
|
913
853
|
sbtc_settlements: SbtcSettlementsTable;
|
|
914
854
|
bns_name_events: BnsNameEventsTable;
|
|
915
855
|
bns_namespace_events: BnsNamespaceEventsTable;
|
|
@@ -922,9 +862,6 @@ interface Database {
|
|
|
922
862
|
observer_journal: ObserverJournalTable;
|
|
923
863
|
sync_scopes: SyncScopesTable;
|
|
924
864
|
stage_registry: StageRegistryTable;
|
|
925
|
-
stage_runs: StageRunsTable;
|
|
926
|
-
stage_block_receipts: StageBlockReceiptsTable;
|
|
927
|
-
coverage_segments: CoverageSegmentsTable;
|
|
928
865
|
stage_failures: StageFailuresTable;
|
|
929
866
|
archive_fetches: ArchiveFetchesTable;
|
|
930
867
|
usage_ledger: UsageLedgerTable;
|
|
@@ -19,4 +19,10 @@ interface TxSummary {
|
|
|
19
19
|
* network fallback. Null when the bytes do not decode.
|
|
20
20
|
*/
|
|
21
21
|
declare function decodeRawTx(rawTx: string, txid?: string): TxSummary | null;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The origin account nonce of a raw Stacks tx, read straight from its bytes
|
|
24
|
+
* (no full deserialize, so it stays cheap on every confirmed tx of a block).
|
|
25
|
+
* Null when the bytes are too short or the auth type is unknown.
|
|
26
|
+
*/
|
|
27
|
+
declare function rawTxNonce(rawTx: string): bigint | null;
|
|
28
|
+
export { TX_TYPE_NAMES, TxSummary, decodeRawTx, rawTxNonce };
|
|
@@ -196,10 +196,25 @@ function decodeRawTx(rawTx, txid) {
|
|
|
196
196
|
return null;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
+
var AUTH_TYPE_HEX_OFFSET = (1 + 4) * 2;
|
|
200
|
+
var ORIGIN_NONCE_HEX_OFFSET = (1 + 4 + 1 + 1 + 20) * 2;
|
|
201
|
+
var STANDARD_AUTH = "04";
|
|
202
|
+
var SPONSORED_AUTH = "05";
|
|
203
|
+
function rawTxNonce(rawTx) {
|
|
204
|
+
const hex = rawTx.startsWith("0x") ? rawTx.slice(2) : rawTx;
|
|
205
|
+
const authType = hex.slice(AUTH_TYPE_HEX_OFFSET, AUTH_TYPE_HEX_OFFSET + 2);
|
|
206
|
+
if (authType !== STANDARD_AUTH && authType !== SPONSORED_AUTH)
|
|
207
|
+
return null;
|
|
208
|
+
const nonceHex = hex.slice(ORIGIN_NONCE_HEX_OFFSET, ORIGIN_NONCE_HEX_OFFSET + 16);
|
|
209
|
+
if (!/^[0-9a-fA-F]{16}$/.test(nonceHex))
|
|
210
|
+
return null;
|
|
211
|
+
return BigInt(`0x${nonceHex}`);
|
|
212
|
+
}
|
|
199
213
|
export {
|
|
200
214
|
TX_TYPE_NAMES,
|
|
201
|
-
decodeRawTx
|
|
215
|
+
decodeRawTx,
|
|
216
|
+
rawTxNonce
|
|
202
217
|
};
|
|
203
218
|
|
|
204
|
-
//# debugId=
|
|
219
|
+
//# debugId=97EA15F22F873DEF64756E2164756E21
|
|
205
220
|
//# sourceMappingURL=tx-summary.js.map
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/node/tx-summary.ts", "../src/env.ts", "../src/logger.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * Raw Stacks transaction -> the summary fields Secondlayer stores per tx.\n */\nimport { serializeCV } from \"@secondlayer/stacks/clarity\";\nimport {\n\tAddressHashMode,\n\ttype ContractCallPayload,\n\tPayloadType,\n\ttype SmartContractPayload,\n\tdeserializeTransaction,\n} from \"@secondlayer/stacks/transactions\";\nimport { AddressVersion, c32address } from \"@secondlayer/stacks/utils\";\nimport { logger } from \"../logger.ts\";\n\n/**\n * Transaction type names matching what we store in the database\n */\nexport const TX_TYPE_NAMES: Record<PayloadType, string> = {\n\t[PayloadType.TokenTransfer]: \"token_transfer\",\n\t[PayloadType.SmartContract]: \"smart_contract\",\n\t[PayloadType.VersionedSmartContract]: \"smart_contract\",\n\t[PayloadType.ContractCall]: \"contract_call\",\n\t[PayloadType.PoisonMicroblock]: \"poison_microblock\",\n\t[PayloadType.Coinbase]: \"coinbase\",\n\t[PayloadType.CoinbaseToAltRecipient]: \"coinbase\",\n\t[PayloadType.TenureChange]: \"tenure_change\",\n\t[PayloadType.NakamotoCoinbase]: \"coinbase\",\n};\n\n/** The columnar fields a `transactions` row (and so a handler's `ctx.tx`)\n * carries, decoded from the raw tx bytes. */\nexport interface TxSummary {\n\ttxType: string;\n\tsender: string;\n\tcontractId: string | null;\n\tfunctionName: string | null;\n\tfunctionArgs: string[] | null;\n}\n\n/**\n * Decode raw_tx hex to the stored tx type, sender and call target. One\n * decoder for block ingest, mempool ingest and subgraph replay, so a replayed\n * `ctx.tx` is byte-for-byte the indexed one. Pure CPU (deserialize + c32), no\n * network fallback. Null when the bytes do not decode.\n */\nexport function decodeRawTx(rawTx: string, txid?: string): TxSummary | null {\n\ttry {\n\t\tconst tx = deserializeTransaction(rawTx);\n\n\t\t// Get tx type\n\t\tconst txType = TX_TYPE_NAMES[tx.payload.payloadType] ?? \"unknown\";\n\n\t\t// Get sender address from spending condition\n\t\tconst { signer, hashMode } = tx.auth.spendingCondition;\n\n\t\t// Determine address version based on tx version and hash mode\n\t\t// tx.version: 0 = mainnet, 128 = testnet\n\t\tconst isMainnet = tx.version === 0;\n\t\tconst isSingleSig =\n\t\t\thashMode === AddressHashMode.P2PKH || hashMode === AddressHashMode.P2WPKH;\n\n\t\tlet addressVersion: AddressVersion;\n\t\tif (isMainnet) {\n\t\t\taddressVersion = isSingleSig\n\t\t\t\t? AddressVersion.MainnetSingleSig\n\t\t\t\t: AddressVersion.MainnetMultiSig;\n\t\t} else {\n\t\t\taddressVersion = isSingleSig\n\t\t\t\t? AddressVersion.TestnetSingleSig\n\t\t\t\t: AddressVersion.TestnetMultiSig;\n\t\t}\n\n\t\tconst sender = c32address(addressVersion, signer);\n\n\t\t// Extract contract details if applicable\n\t\tlet contractId: string | null = null;\n\t\tlet functionName: string | null = null;\n\t\tlet functionArgs: string[] | null = null;\n\n\t\tif (tx.payload.payloadType === PayloadType.ContractCall) {\n\t\t\tconst payload = tx.payload as ContractCallPayload;\n\t\t\tcontractId = `${payload.contractAddress}.${payload.contractName}`;\n\t\t\tfunctionName = payload.functionName;\n\t\t\tfunctionArgs = payload.functionArgs?.map((cv) => serializeCV(cv)) ?? null;\n\t\t} else if (\n\t\t\ttx.payload.payloadType === PayloadType.SmartContract ||\n\t\t\ttx.payload.payloadType === PayloadType.VersionedSmartContract\n\t\t) {\n\t\t\tconst payload = tx.payload as SmartContractPayload;\n\t\t\tcontractId = `${sender}.${payload.contractName}`;\n\t\t}\n\n\t\treturn { txType, sender, contractId, functionName, functionArgs };\n\t} catch (error) {\n\t\t// Some transactions can't be decoded - log for debugging and use fallback values\n\t\tlogger.warn(\"Failed to decode raw_tx\", {\n\t\t\ttxid,\n\t\t\terror: String(error).split(\"\\n\")[0],\n\t\t});\n\t\treturn null;\n\t}\n}\n",
|
|
5
|
+
"/**\n * Raw Stacks transaction -> the summary fields Secondlayer stores per tx.\n */\nimport { serializeCV } from \"@secondlayer/stacks/clarity\";\nimport {\n\tAddressHashMode,\n\ttype ContractCallPayload,\n\tPayloadType,\n\ttype SmartContractPayload,\n\tdeserializeTransaction,\n} from \"@secondlayer/stacks/transactions\";\nimport { AddressVersion, c32address } from \"@secondlayer/stacks/utils\";\nimport { logger } from \"../logger.ts\";\n\n/**\n * Transaction type names matching what we store in the database\n */\nexport const TX_TYPE_NAMES: Record<PayloadType, string> = {\n\t[PayloadType.TokenTransfer]: \"token_transfer\",\n\t[PayloadType.SmartContract]: \"smart_contract\",\n\t[PayloadType.VersionedSmartContract]: \"smart_contract\",\n\t[PayloadType.ContractCall]: \"contract_call\",\n\t[PayloadType.PoisonMicroblock]: \"poison_microblock\",\n\t[PayloadType.Coinbase]: \"coinbase\",\n\t[PayloadType.CoinbaseToAltRecipient]: \"coinbase\",\n\t[PayloadType.TenureChange]: \"tenure_change\",\n\t[PayloadType.NakamotoCoinbase]: \"coinbase\",\n};\n\n/** The columnar fields a `transactions` row (and so a handler's `ctx.tx`)\n * carries, decoded from the raw tx bytes. */\nexport interface TxSummary {\n\ttxType: string;\n\tsender: string;\n\tcontractId: string | null;\n\tfunctionName: string | null;\n\tfunctionArgs: string[] | null;\n}\n\n/**\n * Decode raw_tx hex to the stored tx type, sender and call target. One\n * decoder for block ingest, mempool ingest and subgraph replay, so a replayed\n * `ctx.tx` is byte-for-byte the indexed one. Pure CPU (deserialize + c32), no\n * network fallback. Null when the bytes do not decode.\n */\nexport function decodeRawTx(rawTx: string, txid?: string): TxSummary | null {\n\ttry {\n\t\tconst tx = deserializeTransaction(rawTx);\n\n\t\t// Get tx type\n\t\tconst txType = TX_TYPE_NAMES[tx.payload.payloadType] ?? \"unknown\";\n\n\t\t// Get sender address from spending condition\n\t\tconst { signer, hashMode } = tx.auth.spendingCondition;\n\n\t\t// Determine address version based on tx version and hash mode\n\t\t// tx.version: 0 = mainnet, 128 = testnet\n\t\tconst isMainnet = tx.version === 0;\n\t\tconst isSingleSig =\n\t\t\thashMode === AddressHashMode.P2PKH || hashMode === AddressHashMode.P2WPKH;\n\n\t\tlet addressVersion: AddressVersion;\n\t\tif (isMainnet) {\n\t\t\taddressVersion = isSingleSig\n\t\t\t\t? AddressVersion.MainnetSingleSig\n\t\t\t\t: AddressVersion.MainnetMultiSig;\n\t\t} else {\n\t\t\taddressVersion = isSingleSig\n\t\t\t\t? AddressVersion.TestnetSingleSig\n\t\t\t\t: AddressVersion.TestnetMultiSig;\n\t\t}\n\n\t\tconst sender = c32address(addressVersion, signer);\n\n\t\t// Extract contract details if applicable\n\t\tlet contractId: string | null = null;\n\t\tlet functionName: string | null = null;\n\t\tlet functionArgs: string[] | null = null;\n\n\t\tif (tx.payload.payloadType === PayloadType.ContractCall) {\n\t\t\tconst payload = tx.payload as ContractCallPayload;\n\t\t\tcontractId = `${payload.contractAddress}.${payload.contractName}`;\n\t\t\tfunctionName = payload.functionName;\n\t\t\tfunctionArgs = payload.functionArgs?.map((cv) => serializeCV(cv)) ?? null;\n\t\t} else if (\n\t\t\ttx.payload.payloadType === PayloadType.SmartContract ||\n\t\t\ttx.payload.payloadType === PayloadType.VersionedSmartContract\n\t\t) {\n\t\t\tconst payload = tx.payload as SmartContractPayload;\n\t\t\tcontractId = `${sender}.${payload.contractName}`;\n\t\t}\n\n\t\treturn { txType, sender, contractId, functionName, functionArgs };\n\t} catch (error) {\n\t\t// Some transactions can't be decoded - log for debugging and use fallback values\n\t\tlogger.warn(\"Failed to decode raw_tx\", {\n\t\t\ttxid,\n\t\t\terror: String(error).split(\"\\n\")[0],\n\t\t});\n\t\treturn null;\n\t}\n}\n\n// SIP-005 layout up to the origin nonce: version(1) chain_id(4) auth_type(1)\n// then the origin spending condition hash_mode(1) signer(20) nonce(8). Fixed\n// for standard and sponsored auth, single- and multi-sig alike.\nconst AUTH_TYPE_HEX_OFFSET = (1 + 4) * 2;\nconst ORIGIN_NONCE_HEX_OFFSET = (1 + 4 + 1 + 1 + 20) * 2;\nconst STANDARD_AUTH = \"04\";\nconst SPONSORED_AUTH = \"05\";\n\n/**\n * The origin account nonce of a raw Stacks tx, read straight from its bytes\n * (no full deserialize, so it stays cheap on every confirmed tx of a block).\n * Null when the bytes are too short or the auth type is unknown.\n */\nexport function rawTxNonce(rawTx: string): bigint | null {\n\tconst hex = rawTx.startsWith(\"0x\") ? rawTx.slice(2) : rawTx;\n\tconst authType = hex.slice(AUTH_TYPE_HEX_OFFSET, AUTH_TYPE_HEX_OFFSET + 2);\n\tif (authType !== STANDARD_AUTH && authType !== SPONSORED_AUTH) return null;\n\tconst nonceHex = hex.slice(\n\t\tORIGIN_NONCE_HEX_OFFSET,\n\t\tORIGIN_NONCE_HEX_OFFSET + 16,\n\t);\n\tif (!/^[0-9a-fA-F]{16}$/.test(nonceHex)) return null;\n\treturn BigInt(`0x${nonceHex}`);\n}\n",
|
|
6
6
|
"import { z } from \"zod\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\t/**\n\t * Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.\n\t * Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.\n\t */\n\tSOURCE_DATABASE_URL?: string;\n\t/**\n\t * Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.\n\t * Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.\n\t */\n\tTARGET_DATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tSOURCE_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tTARGET_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tconst named = stacksNetwork();\n\t\tenabledNetworks = named === \"testnet\" ? [\"testnet\"] : [\"mainnet\"];\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\nlet warnedNetworkFallback = false;\n\n/**\n * The Stacks network this process serves, and the only place that decides it:\n * `STACKS_NETWORK`, else the deprecated `NETWORK` (warned once so a deployment\n * that only sets it is not silently re-keyed), else mainnet. Not validated;\n * `instanceNetworkFromEnv` is the strict form.\n */\nexport function stacksNetwork(env: NodeJS.ProcessEnv = process.env): string {\n\tif (env.STACKS_NETWORK) return env.STACKS_NETWORK;\n\tif (env.NETWORK) {\n\t\tif (!warnedNetworkFallback) {\n\t\t\twarnedNetworkFallback = true;\n\t\t\tconsole.warn(\"NETWORK is deprecated: set STACKS_NETWORK instead\");\n\t\t}\n\t\treturn env.NETWORK;\n\t}\n\treturn \"mainnet\";\n}\n\n/**\n * True when `NODE_ENV=production`, read at RUNTIME — the single source of truth\n * for prod-vs-dev branching in this package.\n *\n * Why a helper instead of inlining `process.env.NODE_ENV === \"production\"`:\n * bunup/esbuild constant-folds the dot-access `process.env.NODE_ENV` to its\n * BUILD-time value. `@secondlayer/shared` is consumed by other services as its\n * built `dist`, so an inlined check freezes to a literal in the shipped bundle\n * (e.g. `const isProd = false`) and silently ignores the container's real\n * NODE_ENV. The bracket access below is NOT folded, so it stays a runtime read.\n * Route every prod check through here so the footgun lives in exactly one place.\n */\nexport function isProductionEnv(): boolean {\n\t// biome-ignore lint/complexity/useLiteralKeys: bracket access is deliberate — dot-access gets constant-folded by the bundler, freezing this to a build-time literal in the shipped dist.\n\treturn process.env[\"NODE_ENV\"] === \"production\";\n}\n\ntype EnvMap = NodeJS.ProcessEnv;\n\n/**\n * PoX-5 print-event decoder is ON by default (mirrors the sBTC policy).\n * No activation gating needed: pox-5 events cannot exist before the Epoch 4.0\n * hard fork (Bitcoin block 960,230), so pre-activation the decoder idles at\n * tip. Opt out with `POX5_DECODER_ENABLED=false`.\n */\nexport function isPox5DecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.POX5_DECODER_ENABLED !== \"false\";\n}\n\n/** Default ON. Opt out with `SBTC_DECODER_ENABLED=false`. */\nexport function isSbtcDecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.SBTC_DECODER_ENABLED !== \"false\";\n}\n\n/** Default OFF. Opt in with `BNS_DECODER_ENABLED=true`. */\nexport function isBnsDecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.BNS_DECODER_ENABLED === \"true\";\n}\n\n// Export for testing\nexport { envSchema };\n",
|
|
7
7
|
"import { getEnv } from \"./env.ts\";\n\ntype LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nconst LOG_LEVELS: Record<LogLevel, number> = {\n\tdebug: 0,\n\tinfo: 1,\n\twarn: 2,\n\terror: 3,\n};\n\nclass Logger {\n\tprivate _level?: LogLevel;\n\tprivate _isProduction?: boolean;\n\tprivate _initialized = false;\n\n\tprivate init() {\n\t\tif (this._initialized) return;\n\t\tthis._initialized = true;\n\t\ttry {\n\t\t\tconst env = getEnv();\n\t\t\tthis._level = env.LOG_LEVEL;\n\t\t\tthis._isProduction = env.NODE_ENV === \"production\";\n\t\t} catch {\n\t\t\t// Fallback when env is unavailable (e.g. tests without DATABASE_URL)\n\t\t\tthis._level = \"info\";\n\t\t\tthis._isProduction = false;\n\t\t}\n\t}\n\n\tprivate get level(): LogLevel {\n\t\tthis.init();\n\t\t// biome-ignore lint/style/noNonNullAssertion: value is non-null after preceding check or by construction; TS narrowing limitation\n\t\treturn this._level!;\n\t}\n\n\tprivate get isProduction(): boolean {\n\t\tthis.init();\n\t\t// biome-ignore lint/style/noNonNullAssertion: value is non-null after preceding check or by construction; TS narrowing limitation\n\t\treturn this._isProduction!;\n\t}\n\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\treturn LOG_LEVELS[level] >= LOG_LEVELS[this.level];\n\t}\n\n\tprivate formatMessage(\n\t\tlevel: LogLevel,\n\t\tmessage: string,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tmeta?: Record<string, any>,\n\t) {\n\t\tconst timestamp = new Date().toISOString();\n\n\t\tif (this.isProduction) {\n\t\t\t// JSON output for production\n\t\t\treturn JSON.stringify({\n\t\t\t\ttimestamp,\n\t\t\t\tlevel,\n\t\t\t\tmessage,\n\t\t\t\t...meta,\n\t\t\t});\n\t\t}\n\n\t\t// Human-readable output for development\n\t\tconst metaStr = meta ? ` ${JSON.stringify(meta)}` : \"\";\n\t\treturn `[${timestamp}] ${level.toUpperCase()}: ${message}${metaStr}`;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\tdebug(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"debug\")) {\n\t\t\tconsole.debug(this.formatMessage(\"debug\", message, meta));\n\t\t}\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\tinfo(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"info\")) {\n\t\t\tconsole.info(this.formatMessage(\"info\", message, meta));\n\t\t}\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\twarn(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"warn\")) {\n\t\t\tconsole.warn(this.formatMessage(\"warn\", message, meta));\n\t\t}\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\terror(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"error\")) {\n\t\t\tconsole.error(this.formatMessage(\"error\", message, meta));\n\t\t}\n\t}\n}\n\n// Export singleton instance\nexport const logger: Logger = new Logger();\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";AAGA;AACA;AAAA;AAAA;AAAA;AAAA;AAOA;;;ACXA;AAGA,IAAM,iBAAiB,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ;AAAA,EACpD,MAAM,WAAW,IACf,MAAM,GAAG,EACT,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,OAAO;AAAA,EAChB,MAAM,QAAQ,CAAC,WAAW,SAAS;AAAA,EACnC,WAAW,KAAK,UAAU;AAAA,IACzB,IAAI,CAAC,MAAM,SAAS,CAAC,GAAG;AAAA,MACvB,MAAM,IAAI,MACT,oBAAoB,sBAAsB,MAAM,KAAK,IAAI,GAC1D;AAAA,IACD;AAAA,EACD;AAAA,EACA,OAAO;AAAA,CACP;AAsBD,IAAM,YAAwC,EAAE,OAAO;AAAA,EACtD,cAAc,EAA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I,MAAM,MAAM,CAAC,IAAI;AAAA,EACtD,MAAM,WAAW,IAAI,MAAM,sBAAsB,uBAAuB,CAAC;AAAA,EACzE,IAAI,aAAa,iBAAiB,aAAa;AAAA,IAAgB,OAAO;AAAA,EACtE,MAAM,WAAW,IAAI,MACpB,yBACA,0BAA0B,EAC3B;AAAA,EACA,IAAI,CAAC,oBAAoB,KAAK,QAAQ;AAAA,IAAG,OAAO;AAAA,EAChD,OAAO,OAAO,KAAK,UAAU;AAAA;",
|
|
10
|
+
"debugId": "97EA15F22F873DEF64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -331,20 +331,6 @@ var SOURCE_READ_COLUMNS = {
|
|
|
331
331
|
"tx_id",
|
|
332
332
|
"tx_index"
|
|
333
333
|
],
|
|
334
|
-
sbtc_token_events: [
|
|
335
|
-
"amount",
|
|
336
|
-
"block_height",
|
|
337
|
-
"block_time",
|
|
338
|
-
"canonical",
|
|
339
|
-
"cursor",
|
|
340
|
-
"event_index",
|
|
341
|
-
"event_type",
|
|
342
|
-
"memo",
|
|
343
|
-
"recipient",
|
|
344
|
-
"sender",
|
|
345
|
-
"tx_id",
|
|
346
|
-
"tx_index"
|
|
347
|
-
],
|
|
348
334
|
bns_name_events: [
|
|
349
335
|
"block_height",
|
|
350
336
|
"block_time",
|
|
@@ -543,20 +529,6 @@ var SOURCE_READ_TYPES = {
|
|
|
543
529
|
tx_id: { type: "text" },
|
|
544
530
|
tx_index: { type: "int" }
|
|
545
531
|
},
|
|
546
|
-
sbtc_token_events: {
|
|
547
|
-
amount: { type: "text" },
|
|
548
|
-
block_height: { type: "int" },
|
|
549
|
-
block_time: { type: "timestamp" },
|
|
550
|
-
canonical: { type: "boolean" },
|
|
551
|
-
cursor: { type: "text" },
|
|
552
|
-
event_index: { type: "int" },
|
|
553
|
-
event_type: { type: "text" },
|
|
554
|
-
memo: { type: "text", nullable: true },
|
|
555
|
-
recipient: { type: "text", nullable: true },
|
|
556
|
-
sender: { type: "text", nullable: true },
|
|
557
|
-
tx_id: { type: "text" },
|
|
558
|
-
tx_index: { type: "int" }
|
|
559
|
-
},
|
|
560
532
|
bns_name_events: {
|
|
561
533
|
block_height: { type: "int" },
|
|
562
534
|
block_time: { type: "timestamp" },
|
|
@@ -666,7 +638,6 @@ var SOURCE_READ_PKS = {
|
|
|
666
638
|
mempool_transactions: ["seq"],
|
|
667
639
|
pox5_events: ["cursor"],
|
|
668
640
|
sbtc_events: ["cursor"],
|
|
669
|
-
sbtc_token_events: ["cursor"],
|
|
670
641
|
bns_name_events: ["cursor"],
|
|
671
642
|
bns_namespace_events: ["cursor"],
|
|
672
643
|
bns_marketplace_events: ["cursor"],
|
|
@@ -730,9 +701,6 @@ var TABLE_TO_DB = {
|
|
|
730
701
|
observer_journal: "source",
|
|
731
702
|
sync_scopes: "source",
|
|
732
703
|
stage_registry: "source",
|
|
733
|
-
stage_runs: "source",
|
|
734
|
-
stage_block_receipts: "source",
|
|
735
|
-
coverage_segments: "source",
|
|
736
704
|
stage_failures: "source",
|
|
737
705
|
decoded_events: "source",
|
|
738
706
|
decoder_checkpoints: "source",
|
|
@@ -742,7 +710,6 @@ var TABLE_TO_DB = {
|
|
|
742
710
|
burn_block_rewards: "source",
|
|
743
711
|
burn_block_reward_slots: "source",
|
|
744
712
|
sbtc_events: "source",
|
|
745
|
-
sbtc_token_events: "source",
|
|
746
713
|
sbtc_settlements: "source",
|
|
747
714
|
bns_name_events: "source",
|
|
748
715
|
bns_namespace_events: "source",
|
|
@@ -1055,5 +1022,5 @@ export {
|
|
|
1055
1022
|
targetListenerUrl
|
|
1056
1023
|
};
|
|
1057
1024
|
|
|
1058
|
-
//# debugId=
|
|
1025
|
+
//# debugId=D2C4300CC7413C1364756E2164756E21
|
|
1059
1026
|
//# sourceMappingURL=listener.js.map
|