@secondlayer/shared 11.15.0 → 11.15.2
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/disk-guard.d.ts +6 -1
- package/dist/src/archive/disk-guard.js +2 -1
- package/dist/src/archive/disk-guard.js.map +3 -3
- package/dist/src/archive/range-digest.d.ts +35 -0
- package/dist/src/archive/semantic-digest-builder.d.ts +35 -0
- package/dist/src/coverage/index.d.ts +35 -0
- package/dist/src/db/index.d.ts +49 -1
- package/dist/src/db/index.js +11 -1
- package/dist/src/db/index.js.map +4 -4
- package/dist/src/db/queries/chain-reorgs.d.ts +35 -0
- package/dist/src/db/queries/chain-reorgs.js +10 -1
- package/dist/src/db/queries/chain-reorgs.js.map +4 -4
- package/dist/src/db/queries/contracts.d.ts +35 -0
- package/dist/src/db/queries/instance.d.ts +35 -0
- package/dist/src/db/queries/integrity.d.ts +35 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +35 -0
- package/dist/src/db/queries/subgraph-operations.d.ts +35 -0
- package/dist/src/db/queries/subgraphs.d.ts +35 -0
- package/dist/src/db/queries/sync-scope.d.ts +35 -0
- package/dist/src/db/queries/webhooks.d.ts +35 -0
- package/dist/src/db/schema.d.ts +36 -1
- package/dist/src/index.d.ts +49 -1
- package/dist/src/index.js +11 -1
- package/dist/src/index.js.map +4 -4
- package/dist/src/node/local-client.d.ts +35 -0
- package/dist/src/queue/listener.js +10 -1
- package/dist/src/queue/listener.js.map +4 -4
- package/migrations/0146_pox5_cycles.ts +63 -0
- package/package.json +2 -2
|
@@ -427,6 +427,39 @@ interface Pox5EventsTable {
|
|
|
427
427
|
source_cursor: string;
|
|
428
428
|
created_at: Generated<Date>;
|
|
429
429
|
}
|
|
430
|
+
interface Pox5CyclesTable {
|
|
431
|
+
reward_cycle: number;
|
|
432
|
+
start_burn_height: number;
|
|
433
|
+
prepare_start_burn_height: number;
|
|
434
|
+
end_burn_height: number;
|
|
435
|
+
total_stacked_ustx: string;
|
|
436
|
+
reward_eligible_ustx: string;
|
|
437
|
+
stakers: number;
|
|
438
|
+
signers_in_set: number;
|
|
439
|
+
/** bond index (as string) -> sats staked for this cycle. */
|
|
440
|
+
bond_sats: unknown;
|
|
441
|
+
bond_total_sats: string;
|
|
442
|
+
sbtc_custodied_sats: string;
|
|
443
|
+
rewards_allocated_stx: string;
|
|
444
|
+
rewards_allocated_bond: string;
|
|
445
|
+
reserve_deposit: string;
|
|
446
|
+
rewards_per_token_stx: string | null;
|
|
447
|
+
/** bond index (as string) -> cumulative rewards-per-sat for this cycle. */
|
|
448
|
+
rewards_per_token_bond: unknown;
|
|
449
|
+
distributions: number;
|
|
450
|
+
rewards_claimed: string;
|
|
451
|
+
computed_through_height: number;
|
|
452
|
+
updated_at: Generated<Date>;
|
|
453
|
+
}
|
|
454
|
+
interface Pox5CycleSignersTable {
|
|
455
|
+
reward_cycle: number;
|
|
456
|
+
signer: string;
|
|
457
|
+
delegated_ustx: string;
|
|
458
|
+
stx_only_ustx: string;
|
|
459
|
+
reward_shares_ustx: string;
|
|
460
|
+
in_set: boolean;
|
|
461
|
+
rewards_claimed: string;
|
|
462
|
+
}
|
|
430
463
|
interface BurnBlockRewardsTable {
|
|
431
464
|
cursor: string;
|
|
432
465
|
burn_block_height: number;
|
|
@@ -774,6 +807,8 @@ interface Database {
|
|
|
774
807
|
chain_reorgs: ChainReorgsTable;
|
|
775
808
|
pox4_calls: Pox4CallsTable;
|
|
776
809
|
pox5_events: Pox5EventsTable;
|
|
810
|
+
pox5_cycles: Pox5CyclesTable;
|
|
811
|
+
pox5_cycle_signers: Pox5CycleSignersTable;
|
|
777
812
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
778
813
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
779
814
|
sbtc_events: SbtcEventsTable;
|
|
@@ -417,6 +417,39 @@ interface Pox5EventsTable {
|
|
|
417
417
|
source_cursor: string;
|
|
418
418
|
created_at: Generated<Date>;
|
|
419
419
|
}
|
|
420
|
+
interface Pox5CyclesTable {
|
|
421
|
+
reward_cycle: number;
|
|
422
|
+
start_burn_height: number;
|
|
423
|
+
prepare_start_burn_height: number;
|
|
424
|
+
end_burn_height: number;
|
|
425
|
+
total_stacked_ustx: string;
|
|
426
|
+
reward_eligible_ustx: string;
|
|
427
|
+
stakers: number;
|
|
428
|
+
signers_in_set: number;
|
|
429
|
+
/** bond index (as string) -> sats staked for this cycle. */
|
|
430
|
+
bond_sats: unknown;
|
|
431
|
+
bond_total_sats: string;
|
|
432
|
+
sbtc_custodied_sats: string;
|
|
433
|
+
rewards_allocated_stx: string;
|
|
434
|
+
rewards_allocated_bond: string;
|
|
435
|
+
reserve_deposit: string;
|
|
436
|
+
rewards_per_token_stx: string | null;
|
|
437
|
+
/** bond index (as string) -> cumulative rewards-per-sat for this cycle. */
|
|
438
|
+
rewards_per_token_bond: unknown;
|
|
439
|
+
distributions: number;
|
|
440
|
+
rewards_claimed: string;
|
|
441
|
+
computed_through_height: number;
|
|
442
|
+
updated_at: Generated<Date>;
|
|
443
|
+
}
|
|
444
|
+
interface Pox5CycleSignersTable {
|
|
445
|
+
reward_cycle: number;
|
|
446
|
+
signer: string;
|
|
447
|
+
delegated_ustx: string;
|
|
448
|
+
stx_only_ustx: string;
|
|
449
|
+
reward_shares_ustx: string;
|
|
450
|
+
in_set: boolean;
|
|
451
|
+
rewards_claimed: string;
|
|
452
|
+
}
|
|
420
453
|
interface BurnBlockRewardsTable {
|
|
421
454
|
cursor: string;
|
|
422
455
|
burn_block_height: number;
|
|
@@ -764,6 +797,8 @@ interface Database {
|
|
|
764
797
|
chain_reorgs: ChainReorgsTable;
|
|
765
798
|
pox4_calls: Pox4CallsTable;
|
|
766
799
|
pox5_events: Pox5EventsTable;
|
|
800
|
+
pox5_cycles: Pox5CyclesTable;
|
|
801
|
+
pox5_cycle_signers: Pox5CycleSignersTable;
|
|
767
802
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
768
803
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
769
804
|
sbtc_events: SbtcEventsTable;
|
package/dist/src/db/schema.d.ts
CHANGED
|
@@ -416,6 +416,39 @@ interface Pox5EventsTable {
|
|
|
416
416
|
source_cursor: string;
|
|
417
417
|
created_at: Generated<Date>;
|
|
418
418
|
}
|
|
419
|
+
interface Pox5CyclesTable {
|
|
420
|
+
reward_cycle: number;
|
|
421
|
+
start_burn_height: number;
|
|
422
|
+
prepare_start_burn_height: number;
|
|
423
|
+
end_burn_height: number;
|
|
424
|
+
total_stacked_ustx: string;
|
|
425
|
+
reward_eligible_ustx: string;
|
|
426
|
+
stakers: number;
|
|
427
|
+
signers_in_set: number;
|
|
428
|
+
/** bond index (as string) -> sats staked for this cycle. */
|
|
429
|
+
bond_sats: unknown;
|
|
430
|
+
bond_total_sats: string;
|
|
431
|
+
sbtc_custodied_sats: string;
|
|
432
|
+
rewards_allocated_stx: string;
|
|
433
|
+
rewards_allocated_bond: string;
|
|
434
|
+
reserve_deposit: string;
|
|
435
|
+
rewards_per_token_stx: string | null;
|
|
436
|
+
/** bond index (as string) -> cumulative rewards-per-sat for this cycle. */
|
|
437
|
+
rewards_per_token_bond: unknown;
|
|
438
|
+
distributions: number;
|
|
439
|
+
rewards_claimed: string;
|
|
440
|
+
computed_through_height: number;
|
|
441
|
+
updated_at: Generated<Date>;
|
|
442
|
+
}
|
|
443
|
+
interface Pox5CycleSignersTable {
|
|
444
|
+
reward_cycle: number;
|
|
445
|
+
signer: string;
|
|
446
|
+
delegated_ustx: string;
|
|
447
|
+
stx_only_ustx: string;
|
|
448
|
+
reward_shares_ustx: string;
|
|
449
|
+
in_set: boolean;
|
|
450
|
+
rewards_claimed: string;
|
|
451
|
+
}
|
|
419
452
|
interface BurnBlockRewardsTable {
|
|
420
453
|
cursor: string;
|
|
421
454
|
burn_block_height: number;
|
|
@@ -763,6 +796,8 @@ interface Database {
|
|
|
763
796
|
chain_reorgs: ChainReorgsTable;
|
|
764
797
|
pox4_calls: Pox4CallsTable;
|
|
765
798
|
pox5_events: Pox5EventsTable;
|
|
799
|
+
pox5_cycles: Pox5CyclesTable;
|
|
800
|
+
pox5_cycle_signers: Pox5CycleSignersTable;
|
|
766
801
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
767
802
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
768
803
|
sbtc_events: SbtcEventsTable;
|
|
@@ -1036,4 +1071,4 @@ interface WaitlistSignupsTable {
|
|
|
1036
1071
|
type Waitlist = Selectable<WaitlistsTable>;
|
|
1037
1072
|
type WaitlistSignup = Selectable<WaitlistSignupsTable>;
|
|
1038
1073
|
type InsertWaitlistSignup = Insertable<WaitlistSignupsTable>;
|
|
1039
|
-
export { Account, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiKey, ApiKeysTable, ArchiveFetch, ArchiveFetchesTable, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, ChainReadCacheTable, ChainReorgsTable, Contract, ContractsTable, CoverageSegmentsTable, Database, DeadLetterEventsTable, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountCredits, InsertAccountSpendCap, InsertApiKey, InsertArchiveFetch, InsertBlock, InsertContract, InsertEvent, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, NativeClock, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RepairMode, RetryState, RunStatus, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, Subgraph, SubgraphGap, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSubgraph, UpdateSubgraphOperation, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UsageLedgerRow, UsageLedgerTable, VmEvent, VmEventsArchiveTable, VmEventsTable, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookFormat, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookRuntime, WebhookStatus, WebhooksTable };
|
|
1074
|
+
export { Account, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiKey, ApiKeysTable, ArchiveFetch, ArchiveFetchesTable, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, ChainReadCacheTable, ChainReorgsTable, Contract, ContractsTable, CoverageSegmentsTable, Database, DeadLetterEventsTable, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountCredits, InsertAccountSpendCap, InsertApiKey, InsertArchiveFetch, InsertBlock, InsertContract, InsertEvent, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, NativeClock, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RepairMode, RetryState, RunStatus, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, Subgraph, SubgraphGap, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSubgraph, UpdateSubgraphOperation, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UsageLedgerRow, UsageLedgerTable, VmEvent, VmEventsArchiveTable, VmEventsTable, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookFormat, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookRuntime, WebhookStatus, WebhooksTable };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -416,6 +416,39 @@ interface Pox5EventsTable {
|
|
|
416
416
|
source_cursor: string;
|
|
417
417
|
created_at: Generated<Date>;
|
|
418
418
|
}
|
|
419
|
+
interface Pox5CyclesTable {
|
|
420
|
+
reward_cycle: number;
|
|
421
|
+
start_burn_height: number;
|
|
422
|
+
prepare_start_burn_height: number;
|
|
423
|
+
end_burn_height: number;
|
|
424
|
+
total_stacked_ustx: string;
|
|
425
|
+
reward_eligible_ustx: string;
|
|
426
|
+
stakers: number;
|
|
427
|
+
signers_in_set: number;
|
|
428
|
+
/** bond index (as string) -> sats staked for this cycle. */
|
|
429
|
+
bond_sats: unknown;
|
|
430
|
+
bond_total_sats: string;
|
|
431
|
+
sbtc_custodied_sats: string;
|
|
432
|
+
rewards_allocated_stx: string;
|
|
433
|
+
rewards_allocated_bond: string;
|
|
434
|
+
reserve_deposit: string;
|
|
435
|
+
rewards_per_token_stx: string | null;
|
|
436
|
+
/** bond index (as string) -> cumulative rewards-per-sat for this cycle. */
|
|
437
|
+
rewards_per_token_bond: unknown;
|
|
438
|
+
distributions: number;
|
|
439
|
+
rewards_claimed: string;
|
|
440
|
+
computed_through_height: number;
|
|
441
|
+
updated_at: Generated<Date>;
|
|
442
|
+
}
|
|
443
|
+
interface Pox5CycleSignersTable {
|
|
444
|
+
reward_cycle: number;
|
|
445
|
+
signer: string;
|
|
446
|
+
delegated_ustx: string;
|
|
447
|
+
stx_only_ustx: string;
|
|
448
|
+
reward_shares_ustx: string;
|
|
449
|
+
in_set: boolean;
|
|
450
|
+
rewards_claimed: string;
|
|
451
|
+
}
|
|
419
452
|
interface BurnBlockRewardsTable {
|
|
420
453
|
cursor: string;
|
|
421
454
|
burn_block_height: number;
|
|
@@ -763,6 +796,8 @@ interface Database {
|
|
|
763
796
|
chain_reorgs: ChainReorgsTable;
|
|
764
797
|
pox4_calls: Pox4CallsTable;
|
|
765
798
|
pox5_events: Pox5EventsTable;
|
|
799
|
+
pox5_cycles: Pox5CyclesTable;
|
|
800
|
+
pox5_cycle_signers: Pox5CycleSignersTable;
|
|
766
801
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
767
802
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
768
803
|
sbtc_events: SbtcEventsTable;
|
|
@@ -2028,6 +2063,8 @@ declare const TABLE_TO_DB: {
|
|
|
2028
2063
|
decoder_checkpoints: string
|
|
2029
2064
|
pox4_calls: string
|
|
2030
2065
|
pox5_events: string
|
|
2066
|
+
pox5_cycles: string
|
|
2067
|
+
pox5_cycle_signers: string
|
|
2031
2068
|
burn_block_rewards: string
|
|
2032
2069
|
burn_block_reward_slots: string
|
|
2033
2070
|
sbtc_events: string
|
|
@@ -2148,6 +2185,17 @@ declare function getRawClient(role?: "source" | "target"): ReturnType<typeof pos
|
|
|
2148
2185
|
declare function getRawClientFor(url: string): ReturnType<typeof postgres>;
|
|
2149
2186
|
/** Close all DB connection pools. Call in CLI commands to allow process exit. */
|
|
2150
2187
|
declare function closeDb(): Promise<void>;
|
|
2188
|
+
/**
|
|
2189
|
+
* `closeDb()`, but never let it block process exit past `timeoutMs`.
|
|
2190
|
+
*
|
|
2191
|
+
* 2026-09-28: a canonical printed its summary and then sat idle for 20
|
|
2192
|
+
* minutes — 0% CPU, `wchan=ep_poll`, one open socket — stuck in `await
|
|
2193
|
+
* closeDb()`. Only the wrapper's own 6h timeout moved things along. A driver
|
|
2194
|
+
* holding a socket open past `.destroy()`/`.end()` finishing (or never
|
|
2195
|
+
* finishing at all) must not stop a one-shot script from exiting once its
|
|
2196
|
+
* actual work is done.
|
|
2197
|
+
*/
|
|
2198
|
+
declare function closeDbOrTimeout(timeoutMs?: number, closeFn?: () => Promise<void>): Promise<void>;
|
|
2151
2199
|
declare const ErrorCodes: {
|
|
2152
2200
|
readonly VALIDATION_ERROR: "VALIDATION_ERROR"
|
|
2153
2201
|
readonly DATABASE_ERROR: "DATABASE_ERROR"
|
|
@@ -3251,4 +3299,4 @@ declare function publicKeyPemFromPrivate(privateKeyPem: string): string;
|
|
|
3251
3299
|
declare function ed25519KeyId(publicKeyPem: string): string;
|
|
3252
3300
|
declare function signEd25519(payload: string, privateKey: KeyObject): string;
|
|
3253
3301
|
declare function verifyEd25519(payload: string, signatureBase64: string, publicKey: KeyObject): boolean;
|
|
3254
|
-
export { Account, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiKey, ApiKeysTable, ArchiveFetch, ArchiveFetchesTable, AuthenticationError, AuthorizationError, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, CHAIN_TRIGGER_FIELDS, CHAIN_TRIGGER_TYPES, CODE_TO_STATUS, ChainApplyDeliveryOf, ChainApplyEnvelope, ChainApplyEnvelopeOf, ChainEventEnvelope, ChainFtBurnData, ChainFtMintData, ChainFtTransferData, ChainNftBurnData, ChainNftMintData, ChainNftTransferData, ChainPrintEventData, ChainReadCacheTable, ChainReorgOrphanedEntry, ChainReorgRollbackDelivery, ChainReorgRollbackEnvelope, ChainReorgsTable, ChainStxBurnData, ChainStxLockData, ChainStxMintData, ChainStxTransferData, ChainTestDelivery, ChainTxLevelEvent, ChainWebhookDelivery, ChainWebhookEnvelope, Contract, ContractsTable, CoverageSegmentsTable, CreateWebhookRequest, CreateWebhookRequestSchema, CreateWebhookResponse, DB_TO_STREAMS_EVENT_TYPE, DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES, DEFAULT_BTC_CONFIRMATIONS, Database, DatabaseError, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DeadRow, DecodedEventType2 as DecodedEventType, DecodedEventsTable, DecoderCheckpointsTable, DeliveryRow, DeploySubgraphRequest, DeploySubgraphRequestSchema, DeploySubgraphResponse, EMPTY_RANGE_EVENT_INDEX_SENTINEL, Env, ErrorCode, ErrorCodes, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, ForbiddenError, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountCredits, InsertAccountSpendCap, InsertApiKey, InsertArchiveFetch, InsertBlock, InsertContract, InsertEvent, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InstancesTable, KeyRotatedError, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NotFoundError, NumericAsText, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, ParsedCreateWebhookRequest, ParsedReplayWebhookRequest, ParsedUpdateWebhookRequest, PaymentRequiredError, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RUNE_EVENT_TYPES, RateLimitError, ReindexResponse, RepairMode, ReplayResult, ReplayWebhookRequest, ReplayWebhookRequestSchema, RetryState, RotateSecretResponse, RunStatus, RuneApplyDeliveryOf, RuneApplyEnvelope, RuneEventType, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, STREAMS_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_TO_DB_EVENT_TYPES, SbtcDepositEvent, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SbtcWithdrawalEvent, SbtcWithdrawalSweptConfirmedEvent, SecondLayerError, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StreamsCursor, StreamsDbEventType, StreamsEventType, Subgraph, SubgraphAgentSchema, SubgraphAggregateParams, SubgraphAggregateResponse, SubgraphDetail, SubgraphGap, SubgraphGapEntry, SubgraphGapRange, SubgraphGapsResponse, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphQueryParams, SubgraphSpecFormat, SubgraphSpecOptions, SubgraphSummary, SubgraphSyncInfo, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, TenantSuspendedError, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSubgraph, UpdateSubgraphOperation, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UpdateWebhookRequest, UpdateWebhookRequestSchema, UsageLedgerRow, UsageLedgerTable, VM_EVENT_TYPES, VM_NODE_TO_STORED_TYPE2 as VM_NODE_TO_STORED_TYPE, VM_STORED_TO_NODE_TYPE, ValidationError, VersionConflictError, VmEvent, VmEventType, VmEventsArchiveTable, VmEventsTable, VmNodeEventType, WEBHOOK_FILTER_OPERATORS, WEBHOOK_FORMATS, WEBHOOK_RUNTIMES, WEBHOOK_STATUSES, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDetail, WebhookFilter, WebhookFilterClause, WebhookFilterClauseSchema, WebhookFilterOperator, WebhookFilterOperatorSchema, WebhookFilterPrimitive, WebhookFilterPrimitiveSchema, WebhookFilterSchema, WebhookFormat, WebhookFormatSchema, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookRuntime, WebhookRuntimeSchema, WebhookSchemaColumn, WebhookSchemaTable, WebhookSchemaTables, WebhookStatus, WebhookStatusSchema, WebhookSummary, WebhooksTable, applicationDatabaseUrl, assertDbSplit, blockEndCursor, closeDb, committedHeight, compareStreamsCursor, exports_hmac as crypto, decodeStreamsCursor, describeDbUrl, exports_ed25519 as ed25519, encodeStreamsCursor, finalizedBurnHeight, formatWebhookSchemaErrors, generateSubgraphAgentSchema, generateSubgraphMarkdown, generateSubgraphOpenApi, generateSubgraphSpec, getDb, getDbSplitStatus, getEnv, getErrorMessage, getMigrationRole, getRawClient, getRawClientFor, getSourceDb, getTargetDb, isBnsDecoderEnabled, isEmptyRangeCursor, isPox4DecoderEnabled, isPox5DecoderEnabled, isSbtcDecoderEnabled, jsonb, logger, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql, validateWebhookFilterForTable };
|
|
3302
|
+
export { Account, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiKey, ApiKeysTable, ArchiveFetch, ArchiveFetchesTable, AuthenticationError, AuthorizationError, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, CHAIN_TRIGGER_FIELDS, CHAIN_TRIGGER_TYPES, CODE_TO_STATUS, ChainApplyDeliveryOf, ChainApplyEnvelope, ChainApplyEnvelopeOf, ChainEventEnvelope, ChainFtBurnData, ChainFtMintData, ChainFtTransferData, ChainNftBurnData, ChainNftMintData, ChainNftTransferData, ChainPrintEventData, ChainReadCacheTable, ChainReorgOrphanedEntry, ChainReorgRollbackDelivery, ChainReorgRollbackEnvelope, ChainReorgsTable, ChainStxBurnData, ChainStxLockData, ChainStxMintData, ChainStxTransferData, ChainTestDelivery, ChainTxLevelEvent, ChainWebhookDelivery, ChainWebhookEnvelope, Contract, ContractsTable, CoverageSegmentsTable, CreateWebhookRequest, CreateWebhookRequestSchema, CreateWebhookResponse, DB_TO_STREAMS_EVENT_TYPE, DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES, DEFAULT_BTC_CONFIRMATIONS, Database, DatabaseError, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DeadRow, DecodedEventType2 as DecodedEventType, DecodedEventsTable, DecoderCheckpointsTable, DeliveryRow, DeploySubgraphRequest, DeploySubgraphRequestSchema, DeploySubgraphResponse, EMPTY_RANGE_EVENT_INDEX_SENTINEL, Env, ErrorCode, ErrorCodes, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, ForbiddenError, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountCredits, InsertAccountSpendCap, InsertApiKey, InsertArchiveFetch, InsertBlock, InsertContract, InsertEvent, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InstancesTable, KeyRotatedError, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NotFoundError, NumericAsText, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, ParsedCreateWebhookRequest, ParsedReplayWebhookRequest, ParsedUpdateWebhookRequest, PaymentRequiredError, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RUNE_EVENT_TYPES, RateLimitError, ReindexResponse, RepairMode, ReplayResult, ReplayWebhookRequest, ReplayWebhookRequestSchema, RetryState, RotateSecretResponse, RunStatus, RuneApplyDeliveryOf, RuneApplyEnvelope, RuneEventType, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, STREAMS_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_TO_DB_EVENT_TYPES, SbtcDepositEvent, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SbtcWithdrawalEvent, SbtcWithdrawalSweptConfirmedEvent, SecondLayerError, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StreamsCursor, StreamsDbEventType, StreamsEventType, Subgraph, SubgraphAgentSchema, SubgraphAggregateParams, SubgraphAggregateResponse, SubgraphDetail, SubgraphGap, SubgraphGapEntry, SubgraphGapRange, SubgraphGapsResponse, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphQueryParams, SubgraphSpecFormat, SubgraphSpecOptions, SubgraphSummary, SubgraphSyncInfo, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, TenantSuspendedError, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSubgraph, UpdateSubgraphOperation, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UpdateWebhookRequest, UpdateWebhookRequestSchema, UsageLedgerRow, UsageLedgerTable, VM_EVENT_TYPES, VM_NODE_TO_STORED_TYPE2 as VM_NODE_TO_STORED_TYPE, VM_STORED_TO_NODE_TYPE, ValidationError, VersionConflictError, VmEvent, VmEventType, VmEventsArchiveTable, VmEventsTable, VmNodeEventType, WEBHOOK_FILTER_OPERATORS, WEBHOOK_FORMATS, WEBHOOK_RUNTIMES, WEBHOOK_STATUSES, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDetail, WebhookFilter, WebhookFilterClause, WebhookFilterClauseSchema, WebhookFilterOperator, WebhookFilterOperatorSchema, WebhookFilterPrimitive, WebhookFilterPrimitiveSchema, WebhookFilterSchema, WebhookFormat, WebhookFormatSchema, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookRuntime, WebhookRuntimeSchema, WebhookSchemaColumn, WebhookSchemaTable, WebhookSchemaTables, WebhookStatus, WebhookStatusSchema, WebhookSummary, WebhooksTable, applicationDatabaseUrl, assertDbSplit, blockEndCursor, closeDb, closeDbOrTimeout, committedHeight, compareStreamsCursor, exports_hmac as crypto, decodeStreamsCursor, describeDbUrl, exports_ed25519 as ed25519, encodeStreamsCursor, finalizedBurnHeight, formatWebhookSchemaErrors, generateSubgraphAgentSchema, generateSubgraphMarkdown, generateSubgraphOpenApi, generateSubgraphSpec, getDb, getDbSplitStatus, getEnv, getErrorMessage, getMigrationRole, getRawClient, getRawClientFor, getSourceDb, getTargetDb, isBnsDecoderEnabled, isEmptyRangeCursor, isPox4DecoderEnabled, isPox5DecoderEnabled, isSbtcDecoderEnabled, jsonb, logger, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql, validateWebhookFilterForTable };
|
package/dist/src/index.js
CHANGED
|
@@ -824,6 +824,8 @@ var TABLE_TO_DB = {
|
|
|
824
824
|
decoder_checkpoints: "source",
|
|
825
825
|
pox4_calls: "source",
|
|
826
826
|
pox5_events: "source",
|
|
827
|
+
pox5_cycles: "source",
|
|
828
|
+
pox5_cycle_signers: "source",
|
|
827
829
|
burn_block_rewards: "source",
|
|
828
830
|
burn_block_reward_slots: "source",
|
|
829
831
|
sbtc_events: "source",
|
|
@@ -1035,6 +1037,13 @@ async function closeDb() {
|
|
|
1035
1037
|
}
|
|
1036
1038
|
pools.clear();
|
|
1037
1039
|
}
|
|
1040
|
+
var DEFAULT_CLOSE_DB_TIMEOUT_MS = 30000;
|
|
1041
|
+
async function closeDbOrTimeout(timeoutMs = DEFAULT_CLOSE_DB_TIMEOUT_MS, closeFn = closeDb) {
|
|
1042
|
+
await Promise.race([
|
|
1043
|
+
closeFn(),
|
|
1044
|
+
new Promise((resolve) => setTimeout(resolve, timeoutMs))
|
|
1045
|
+
]);
|
|
1046
|
+
}
|
|
1038
1047
|
// src/errors.ts
|
|
1039
1048
|
var ErrorCodes = {
|
|
1040
1049
|
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
@@ -2213,6 +2222,7 @@ export {
|
|
|
2213
2222
|
assertDbSplit,
|
|
2214
2223
|
blockEndCursor,
|
|
2215
2224
|
closeDb,
|
|
2225
|
+
closeDbOrTimeout,
|
|
2216
2226
|
committedHeight,
|
|
2217
2227
|
compareStreamsCursor,
|
|
2218
2228
|
exports_hmac as crypto,
|
|
@@ -2252,5 +2262,5 @@ export {
|
|
|
2252
2262
|
validateWebhookFilterForTable
|
|
2253
2263
|
};
|
|
2254
2264
|
|
|
2255
|
-
//# debugId=
|
|
2265
|
+
//# debugId=AC6B59824A89F06164756E2164756E21
|
|
2256
2266
|
//# sourceMappingURL=index.js.map
|