@secondlayer/shared 6.37.1 → 6.38.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.
@@ -518,6 +518,29 @@ interface SbtcTokenEventsTable {
518
518
  source_cursor: string;
519
519
  created_at: Generated<Date>;
520
520
  }
521
+ /**
522
+ * BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
523
+ * settlement-confirmer worker, which polls our own bitcoind for confirmations of
524
+ * each `withdrawal-accept`'s `sweep_txid` and surfaces real settlement on the
525
+ * withdrawal lifecycle (the API's `settlement.{btc_confirmations,
526
+ * settlement_confirmed}` placeholder). Keyed on `sweep_txid` (not `request_id`):
527
+ * a request can produce more than one sweep over its life (RBF/rebroadcast), so
528
+ * each broadcast keeps its own confirmation history.
529
+ */
530
+ interface SbtcSettlementsTable {
531
+ sweep_txid: string;
532
+ request_id: number;
533
+ btc_confirmations: Generated<number>;
534
+ settlement_confirmed: Generated<boolean>;
535
+ /** Confirming Bitcoin block — null while the sweep is unconfirmed. */
536
+ block_hash: string | null;
537
+ block_height: number | null;
538
+ first_seen_at: Generated<Date>;
539
+ last_checked_at: Generated<Date>;
540
+ /** Set once, when `settlement_confirmed` first flips true. */
541
+ confirmed_at: Date | null;
542
+ updated_at: Generated<Date>;
543
+ }
521
544
  interface SbtcSupplySnapshotsTable {
522
545
  date: string;
523
546
  total_supply: Generated<string>;
@@ -665,6 +688,7 @@ interface Database {
665
688
  burn_block_reward_slots: BurnBlockRewardSlotsTable;
666
689
  sbtc_events: SbtcEventsTable;
667
690
  sbtc_token_events: SbtcTokenEventsTable;
691
+ sbtc_settlements: SbtcSettlementsTable;
668
692
  sbtc_supply_snapshots: SbtcSupplySnapshotsTable;
669
693
  bns_name_events: BnsNameEventsTable;
670
694
  bns_namespace_events: BnsNamespaceEventsTable;
@@ -955,7 +979,10 @@ type InsertSubscriptionDelivery = Insertable<SubscriptionDeliveriesTable>;
955
979
  interface TriggerEvaluatorStateTable {
956
980
  id: Generated<boolean>;
957
981
  last_processed_block: ColumnType<bigint, bigint | number | undefined, bigint | number>;
982
+ /** Watermark for the async sBTC settlement-confirmed webhook scan; null until
983
+ * the evaluator fast-forwards it on first run. */
984
+ last_settlement_scan_at: ColumnType<Date | null, Date | null | undefined, Date | null>;
958
985
  updated_at: Generated<Date>;
959
986
  }
960
987
  type TriggerEvaluatorState = Selectable<TriggerEvaluatorStateTable>;
961
- export { X402PaymentsTable, X402BalancesTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenantComputeAddon, UpdateTenant, UpdateSubscriptionOutbox, UpdateSubscription, UpdateSubgraphOperation, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateContract, UpdateBlock, UpdateApiKey, UpdateAccountSpendCap, UpdateAccountCredits, TriggerEvaluatorStateTable, TriggerEvaluatorState, TransactionsTable, TransactionsArchiveTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantStatus, TenantComputeAddonsTable, TenantComputeAddon, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubscriptionsTable, SubscriptionStatus, SubscriptionRuntime, SubscriptionOutboxTable, SubscriptionOutbox, SubscriptionKind, SubscriptionFormat, SubscriptionDelivery, SubscriptionDeliveriesTable, Subscription, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphOperationsTable, SubgraphOperationStatus, SubgraphOperationKind, SubgraphOperation, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, SessionsTable, Session, ServiceHeartbeatsTable, SbtcTokenEventsTable, SbtcTokenEventType, SbtcSupplySnapshotsTable, SbtcEventsTable, SbtcEventTopic, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, ProcessedStripeEventsTable, Pox4SignersDailyTable, Pox4FunctionName, Pox4CyclesDailyTable, Pox4CallsTable, OutboxStatus, MempoolTransactionsTable, MempoolTransaction, MagicLinksTable, MagicLink, InsertTransaction, InsertTenantUsageMonthly, InsertTenantComputeAddon, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubscriptionOutbox, InsertSubscriptionDelivery, InsertSubscription, InsertSubgraphUsageDaily, InsertSubgraphOperation, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMempoolTransaction, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertContract, InsertClaimToken, InsertBlock, InsertApiKey, InsertAccountSpendCap, InsertAccountInsight, InsertAccountCredits, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, EventsArchiveTable, Event, DecoderCheckpointsTable, DecodedEventsTable, DeadLetterEventsTable, Database, ContractsTable, Contract, ClaimTokensTable, ClaimToken, ChainReorgsTable, BurnBlockRewardsTable, BurnBlockRewardSlotsTable, BnsNamespacesTable, BnsNamespaceEventsTable, BnsNamespaceEventStatus, BnsNamesTable, BnsNameEventsTable, BnsNameEventTopic, BnsMarketplaceEventsTable, BnsMarketplaceAction, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountSpendCapsTable, AccountSpendCap, AccountInsightsTable, AccountInsight, AccountCreditsTable, AccountCredits, AccountAgentRunsTable, AccountAgentRun, Account };
988
+ export { X402PaymentsTable, X402BalancesTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenantComputeAddon, UpdateTenant, UpdateSubscriptionOutbox, UpdateSubscription, UpdateSubgraphOperation, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateContract, UpdateBlock, UpdateApiKey, UpdateAccountSpendCap, UpdateAccountCredits, TriggerEvaluatorStateTable, TriggerEvaluatorState, TransactionsTable, TransactionsArchiveTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantStatus, TenantComputeAddonsTable, TenantComputeAddon, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubscriptionsTable, SubscriptionStatus, SubscriptionRuntime, SubscriptionOutboxTable, SubscriptionOutbox, SubscriptionKind, SubscriptionFormat, SubscriptionDelivery, SubscriptionDeliveriesTable, Subscription, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphOperationsTable, SubgraphOperationStatus, SubgraphOperationKind, SubgraphOperation, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, SessionsTable, Session, ServiceHeartbeatsTable, SbtcTokenEventsTable, SbtcTokenEventType, SbtcSupplySnapshotsTable, SbtcSettlementsTable, SbtcEventsTable, SbtcEventTopic, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, ProcessedStripeEventsTable, Pox4SignersDailyTable, Pox4FunctionName, Pox4CyclesDailyTable, Pox4CallsTable, OutboxStatus, MempoolTransactionsTable, MempoolTransaction, MagicLinksTable, MagicLink, InsertTransaction, InsertTenantUsageMonthly, InsertTenantComputeAddon, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubscriptionOutbox, InsertSubscriptionDelivery, InsertSubscription, InsertSubgraphUsageDaily, InsertSubgraphOperation, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMempoolTransaction, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertContract, InsertClaimToken, InsertBlock, InsertApiKey, InsertAccountSpendCap, InsertAccountInsight, InsertAccountCredits, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, EventsArchiveTable, Event, DecoderCheckpointsTable, DecodedEventsTable, DeadLetterEventsTable, Database, ContractsTable, Contract, ClaimTokensTable, ClaimToken, ChainReorgsTable, BurnBlockRewardsTable, BurnBlockRewardSlotsTable, BnsNamespacesTable, BnsNamespaceEventsTable, BnsNamespaceEventStatus, BnsNamesTable, BnsNameEventsTable, BnsNameEventTopic, BnsMarketplaceEventsTable, BnsMarketplaceAction, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountSpendCapsTable, AccountSpendCap, AccountInsightsTable, AccountInsight, AccountCreditsTable, AccountCredits, AccountAgentRunsTable, AccountAgentRun, Account };
@@ -518,6 +518,29 @@ interface SbtcTokenEventsTable {
518
518
  source_cursor: string;
519
519
  created_at: Generated<Date>;
520
520
  }
521
+ /**
522
+ * BTC L1 settlement status for sBTC withdrawal sweeps. Filled by the indexer's
523
+ * settlement-confirmer worker, which polls our own bitcoind for confirmations of
524
+ * each `withdrawal-accept`'s `sweep_txid` and surfaces real settlement on the
525
+ * withdrawal lifecycle (the API's `settlement.{btc_confirmations,
526
+ * settlement_confirmed}` placeholder). Keyed on `sweep_txid` (not `request_id`):
527
+ * a request can produce more than one sweep over its life (RBF/rebroadcast), so
528
+ * each broadcast keeps its own confirmation history.
529
+ */
530
+ interface SbtcSettlementsTable {
531
+ sweep_txid: string;
532
+ request_id: number;
533
+ btc_confirmations: Generated<number>;
534
+ settlement_confirmed: Generated<boolean>;
535
+ /** Confirming Bitcoin block — null while the sweep is unconfirmed. */
536
+ block_hash: string | null;
537
+ block_height: number | null;
538
+ first_seen_at: Generated<Date>;
539
+ last_checked_at: Generated<Date>;
540
+ /** Set once, when `settlement_confirmed` first flips true. */
541
+ confirmed_at: Date | null;
542
+ updated_at: Generated<Date>;
543
+ }
521
544
  interface SbtcSupplySnapshotsTable {
522
545
  date: string;
523
546
  total_supply: Generated<string>;
@@ -665,6 +688,7 @@ interface Database {
665
688
  burn_block_reward_slots: BurnBlockRewardSlotsTable;
666
689
  sbtc_events: SbtcEventsTable;
667
690
  sbtc_token_events: SbtcTokenEventsTable;
691
+ sbtc_settlements: SbtcSettlementsTable;
668
692
  sbtc_supply_snapshots: SbtcSupplySnapshotsTable;
669
693
  bns_name_events: BnsNameEventsTable;
670
694
  bns_namespace_events: BnsNamespaceEventsTable;
@@ -955,6 +979,9 @@ type InsertSubscriptionDelivery = Insertable<SubscriptionDeliveriesTable>;
955
979
  interface TriggerEvaluatorStateTable {
956
980
  id: Generated<boolean>;
957
981
  last_processed_block: ColumnType<bigint, bigint | number | undefined, bigint | number>;
982
+ /** Watermark for the async sBTC settlement-confirmed webhook scan; null until
983
+ * the evaluator fast-forwards it on first run. */
984
+ last_settlement_scan_at: ColumnType<Date | null, Date | null | undefined, Date | null>;
958
985
  updated_at: Generated<Date>;
959
986
  }
960
987
  type TriggerEvaluatorState = Selectable<TriggerEvaluatorStateTable>;
@@ -1832,6 +1859,7 @@ declare const TABLE_TO_DB: {
1832
1859
  burn_block_reward_slots: string
1833
1860
  sbtc_events: string
1834
1861
  sbtc_token_events: string
1862
+ sbtc_settlements: string
1835
1863
  sbtc_supply_snapshots: string
1836
1864
  bns_name_events: string
1837
1865
  bns_namespace_events: string
@@ -2379,7 +2407,7 @@ declare const SubscriptionFilterPrimitiveSchema: z4.ZodType<SubscriptionFilterPr
2379
2407
  declare const SubscriptionFilterOperatorSchema: z4.ZodType<SubscriptionFilterOperator>;
2380
2408
  declare const SubscriptionFilterClauseSchema: z4.ZodType<SubscriptionFilterClause>;
2381
2409
  declare const SubscriptionFilterSchema: z4.ZodType<SubscriptionFilter>;
2382
- declare const CHAIN_TRIGGER_TYPES: readonly ["stx_transfer", "stx_mint", "stx_burn", "stx_lock", "ft_transfer", "ft_mint", "ft_burn", "nft_transfer", "nft_mint", "nft_burn", "contract_call", "contract_deploy", "print_event", "sbtc_deposit", "sbtc_withdrawal_create", "sbtc_withdrawal_accept", "sbtc_withdrawal_reject"];
2410
+ declare const CHAIN_TRIGGER_TYPES: readonly ["stx_transfer", "stx_mint", "stx_burn", "stx_lock", "ft_transfer", "ft_mint", "ft_burn", "nft_transfer", "nft_mint", "nft_burn", "contract_call", "contract_deploy", "print_event", "sbtc_deposit", "sbtc_withdrawal_create", "sbtc_withdrawal_accept", "sbtc_withdrawal_reject", "sbtc_withdrawal_swept_confirmed"];
2383
2411
  /**
2384
2412
  * Per-type accepted filter fields for chain triggers, DERIVED from
2385
2413
  * {@link ChainTriggerSchema} so the agent-facing reference can never drift behind
@@ -2498,6 +2526,10 @@ type ChainTrigger = {
2498
2526
  } | {
2499
2527
  type: "sbtc_withdrawal_reject"
2500
2528
  requestId?: number
2529
+ } | {
2530
+ type: "sbtc_withdrawal_swept_confirmed"
2531
+ requestId?: number
2532
+ sweepTxid?: string
2501
2533
  };
2502
2534
  interface CreateSubscriptionRequest {
2503
2535
  name: string;
@@ -2776,18 +2808,33 @@ interface SbtcDepositEvent {
2776
2808
  block_height: number;
2777
2809
  tx_id: string;
2778
2810
  }
2779
- /** Payload for `sbtc_withdrawal_create`, `sbtc_withdrawal_accept`, `sbtc_withdrawal_reject`. */
2811
+ /** Payload for `sbtc_withdrawal_create`, `sbtc_withdrawal_accept`, `sbtc_withdrawal_reject` —
2812
+ * the on-Stacks lifecycle events. `settlement_confirmed` is always false here; the
2813
+ * BTC L1 confirmation is delivered separately as `SbtcWithdrawalSweptConfirmedEvent`. */
2780
2814
  interface SbtcWithdrawalEvent {
2781
2815
  topic: "withdrawal-create" | "withdrawal-accept" | "withdrawal-reject";
2782
2816
  request_id: number;
2783
2817
  sender: string | null;
2784
2818
  amount: string | null;
2785
2819
  sweep_txid: string | null;
2786
- /** Always false until the BTC L1 confirmer ships. */
2787
2820
  settlement_confirmed: false;
2788
2821
  block_height: number;
2789
2822
  tx_id: string;
2790
2823
  }
2824
+ /** Payload for `sbtc_withdrawal_swept_confirmed` — fired once when a peg-out's
2825
+ * committed BTC sweep crosses the confirmation threshold on Bitcoin. Anchored to
2826
+ * the Stacks `withdrawal-accept` event (block_height/tx_id in the envelope); the
2827
+ * Bitcoin-side specifics live here. */
2828
+ interface SbtcWithdrawalSweptConfirmedEvent {
2829
+ topic: "withdrawal-swept-confirmed";
2830
+ request_id: number;
2831
+ sweep_txid: string;
2832
+ btc_confirmations: number;
2833
+ btc_block_height: number | null;
2834
+ confirmed_at: string | null;
2835
+ amount: string | null;
2836
+ sender: string | null;
2837
+ }
2791
2838
  /**
2792
2839
  * Delivered when a matched chain event lands in a canonical block
2793
2840
  * (`event_type: "chain.<trigger>.apply"`). Tx-level triggers (contract_call /
@@ -2803,7 +2850,7 @@ interface ChainApplyEnvelope {
2803
2850
  canonical: true;
2804
2851
  /** The chain-trigger type that matched. */
2805
2852
  trigger: ChainTrigger["type"];
2806
- event: SbtcDepositEvent | SbtcWithdrawalEvent | Record<string, unknown>;
2853
+ event: SbtcDepositEvent | SbtcWithdrawalEvent | SbtcWithdrawalSweptConfirmedEvent | Record<string, unknown>;
2807
2854
  }
2808
2855
  /** One orphaned delivery recalled by a reorg rollback. */
2809
2856
  interface ChainReorgOrphanedEntry {
@@ -2825,4 +2872,4 @@ interface ChainReorgRollbackEnvelope {
2825
2872
  }
2826
2873
  /** Any chain-subscription webhook body. Discriminate on `action`. */
2827
2874
  type ChainWebhookEnvelope = ChainApplyEnvelope | ChainReorgRollbackEnvelope;
2828
- export { validateSubscriptionFilterForTable, sql, setMigrationRole, parseJsonb, onControlPlane, onChainPlane, logger, jsonb, isPox4DecoderEnabled, getTargetDb, getSourceDb, getRawClientFor, getRawClient, getMigrationRole, getErrorMessage, getEnv, getDbSplitStatus, getDb, generateSubgraphSpec, generateSubgraphOpenApi, generateSubgraphMarkdown, generateSubgraphAgentSchema, formatSubscriptionSchemaErrors, finalizedBurnHeight, encodeStreamsCursor, exports_ed25519 as ed25519, decodeStreamsCursor, exports_hmac as crypto, closeDb, assertDbSplit, X402PaymentsTable, X402BalancesTable, VersionConflictError, ValidationError, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenantComputeAddon, UpdateTenant, UpdateSubscriptionRequestSchema, UpdateSubscriptionRequest, UpdateSubscriptionOutbox, UpdateSubscription, UpdateSubgraphOperation, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateContract, UpdateBlock, UpdateApiKey, UpdateAccountSpendCap, UpdateAccountCredits, TriggerEvaluatorStateTable, TriggerEvaluatorState, TransactionsTable, TransactionsArchiveTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantSuspendedError, TenantStatus, TenantComputeAddonsTable, TenantComputeAddon, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, TABLE_TO_DB, SubscriptionsTable, SubscriptionSummary, SubscriptionStatusSchema, SubscriptionStatus, SubscriptionSchemaTables, SubscriptionSchemaTable, SubscriptionSchemaColumn, SubscriptionRuntimeSchema, SubscriptionRuntime, SubscriptionOutboxTable, SubscriptionOutbox, SubscriptionKind, SubscriptionFormatSchema, SubscriptionFormat, SubscriptionFilterSchema, SubscriptionFilterPrimitiveSchema, SubscriptionFilterPrimitive, SubscriptionFilterOperatorSchema, SubscriptionFilterOperator, SubscriptionFilterClauseSchema, SubscriptionFilterClause, SubscriptionFilter, SubscriptionDetail, SubscriptionDelivery, SubscriptionDeliveriesTable, Subscription, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphSyncInfo, SubgraphSummary, SubgraphSpecOptions, SubgraphSpecFormat, SubgraphResourceWarning, SubgraphQueryParams, SubgraphProcessingStatsTable, SubgraphOperationsTable, SubgraphOperationStatus, SubgraphOperationKind, SubgraphOperation, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGapsResponse, SubgraphGapRange, SubgraphGapEntry, SubgraphGap, SubgraphDetail, SubgraphAggregateResponse, SubgraphAggregateParams, SubgraphAgentSchema, Subgraph, StxTransferFilterSchema, StxTransferFilter, StxMintFilterSchema, StxMintFilter, StxLockFilterSchema, StxLockFilter, StxBurnFilterSchema, StxBurnFilter, StreamsEventType, StreamsDbEventType, StreamsCursor, SessionsTable, Session, ServiceHeartbeatsTable, SecondLayerError, SbtcWithdrawalEvent, SbtcTokenEventsTable, SbtcTokenEventType, SbtcSupplySnapshotsTable, SbtcEventsTable, SbtcEventTopic, SbtcDepositEvent, SUBSCRIPTION_STATUSES, SUBSCRIPTION_RUNTIMES, SUBSCRIPTION_FORMATS, SUBSCRIPTION_FILTER_OPERATORS, STREAMS_TO_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_DB_EVENT_TYPES, SOURCE_READ_TYPES, SOURCE_READ_PKS, SOURCE_READ_COLUMNS, RotateSecretResponse, ReplaySubscriptionRequestSchema, ReplaySubscriptionRequest, ReplayResult, ReindexResponse, RateLimitError, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, ProcessedStripeEventsTable, PrintEventFilterSchema, PrintEventFilter, Pox4SignersDailyTable, Pox4FunctionName, Pox4CyclesDailyTable, Pox4CallsTable, PaymentRequiredError, ParsedUpdateSubscriptionRequest, ParsedReplaySubscriptionRequest, ParsedCreateSubscriptionRequest, OutboxStatus, NumericAsText, NotFoundError, NftTransferFilterSchema, NftTransferFilter, NftMintFilterSchema, NftMintFilter, NftBurnFilterSchema, NftBurnFilter, MigrationRole, MempoolTransactionsTable, MempoolTransaction, MagicLinksTable, MagicLink, KeyRotatedError, InsertTransaction, InsertTenantUsageMonthly, InsertTenantComputeAddon, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubscriptionOutbox, InsertSubscriptionDelivery, InsertSubscription, InsertSubgraphUsageDaily, InsertSubgraphOperation, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMempoolTransaction, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertContract, InsertClaimToken, InsertBlock, InsertApiKey, InsertAccountSpendCap, InsertAccountInsight, InsertAccountCredits, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, IndexPrimaryKey, IndexColumnType, IndexColumn, FtTransferFilterSchema, FtTransferFilter, FtMintFilterSchema, FtMintFilter, FtBurnFilterSchema, FtBurnFilter, ForbiddenError, EventsTable, EventsArchiveTable, EventFilterSchema, EventFilter, Event, ErrorCodes, ErrorCode, Env, EMPTY_RANGE_EVENT_INDEX_SENTINEL, DeploySubgraphResponse, DeploySubgraphRequestSchema, DeploySubgraphRequest, DeliveryRow, DecoderCheckpointsTable, DecodedEventsTable, DecodedEventType, DeadRow, DeadLetterEventsTable, DbSplitStatus, DbReadRow, DbPlane, DatabaseError, Database, DEFAULT_BTC_CONFIRMATIONS, DECODED_EVENT_TYPES, DB_TO_STREAMS_EVENT_TYPE, CreateSubscriptionResponse, CreateSubscriptionRequestSchema, CreateSubscriptionRequest, ContractsTable, ContractDeployFilterSchema, ContractDeployFilter, ContractCallFilterSchema, ContractCallFilter, Contract, ClaimTokensTable, ClaimToken, ChainWebhookEnvelope, ChainReorgsTable, ChainReorgRollbackEnvelope, ChainReorgOrphanedEntry, ChainApplyEnvelope, CODE_TO_STATUS, CHAIN_TRIGGER_TYPES, CHAIN_TRIGGER_FIELDS, ByoBreakingChangeDetails, BurnBlockRewardsTable, BurnBlockRewardSlotsTable, BnsNamespacesTable, BnsNamespaceEventsTable, BnsNamespaceEventStatus, BnsNamesTable, BnsNameEventsTable, BnsNameEventTopic, BnsMarketplaceEventsTable, BnsMarketplaceAction, BlocksTable, Block, AuthorizationError, AuthenticationError, ApiKeysTable, ApiKey, AccountsTable, AccountSpendCapsTable, AccountSpendCap, AccountInsightsTable, AccountInsight, AccountCreditsTable, AccountCredits, AccountAgentRunsTable, AccountAgentRun, Account };
2875
+ export { validateSubscriptionFilterForTable, sql, setMigrationRole, parseJsonb, onControlPlane, onChainPlane, logger, jsonb, isPox4DecoderEnabled, getTargetDb, getSourceDb, getRawClientFor, getRawClient, getMigrationRole, getErrorMessage, getEnv, getDbSplitStatus, getDb, generateSubgraphSpec, generateSubgraphOpenApi, generateSubgraphMarkdown, generateSubgraphAgentSchema, formatSubscriptionSchemaErrors, finalizedBurnHeight, encodeStreamsCursor, exports_ed25519 as ed25519, decodeStreamsCursor, exports_hmac as crypto, closeDb, assertDbSplit, X402PaymentsTable, X402BalancesTable, VersionConflictError, ValidationError, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenantComputeAddon, UpdateTenant, UpdateSubscriptionRequestSchema, UpdateSubscriptionRequest, UpdateSubscriptionOutbox, UpdateSubscription, UpdateSubgraphOperation, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateContract, UpdateBlock, UpdateApiKey, UpdateAccountSpendCap, UpdateAccountCredits, TriggerEvaluatorStateTable, TriggerEvaluatorState, TransactionsTable, TransactionsArchiveTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantSuspendedError, TenantStatus, TenantComputeAddonsTable, TenantComputeAddon, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, TABLE_TO_DB, SubscriptionsTable, SubscriptionSummary, SubscriptionStatusSchema, SubscriptionStatus, SubscriptionSchemaTables, SubscriptionSchemaTable, SubscriptionSchemaColumn, SubscriptionRuntimeSchema, SubscriptionRuntime, SubscriptionOutboxTable, SubscriptionOutbox, SubscriptionKind, SubscriptionFormatSchema, SubscriptionFormat, SubscriptionFilterSchema, SubscriptionFilterPrimitiveSchema, SubscriptionFilterPrimitive, SubscriptionFilterOperatorSchema, SubscriptionFilterOperator, SubscriptionFilterClauseSchema, SubscriptionFilterClause, SubscriptionFilter, SubscriptionDetail, SubscriptionDelivery, SubscriptionDeliveriesTable, Subscription, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphSyncInfo, SubgraphSummary, SubgraphSpecOptions, SubgraphSpecFormat, SubgraphResourceWarning, SubgraphQueryParams, SubgraphProcessingStatsTable, SubgraphOperationsTable, SubgraphOperationStatus, SubgraphOperationKind, SubgraphOperation, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGapsResponse, SubgraphGapRange, SubgraphGapEntry, SubgraphGap, SubgraphDetail, SubgraphAggregateResponse, SubgraphAggregateParams, SubgraphAgentSchema, Subgraph, StxTransferFilterSchema, StxTransferFilter, StxMintFilterSchema, StxMintFilter, StxLockFilterSchema, StxLockFilter, StxBurnFilterSchema, StxBurnFilter, StreamsEventType, StreamsDbEventType, StreamsCursor, SessionsTable, Session, ServiceHeartbeatsTable, SecondLayerError, SbtcWithdrawalSweptConfirmedEvent, SbtcWithdrawalEvent, SbtcTokenEventsTable, SbtcTokenEventType, SbtcSupplySnapshotsTable, SbtcSettlementsTable, SbtcEventsTable, SbtcEventTopic, SbtcDepositEvent, SUBSCRIPTION_STATUSES, SUBSCRIPTION_RUNTIMES, SUBSCRIPTION_FORMATS, SUBSCRIPTION_FILTER_OPERATORS, STREAMS_TO_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_DB_EVENT_TYPES, SOURCE_READ_TYPES, SOURCE_READ_PKS, SOURCE_READ_COLUMNS, RotateSecretResponse, ReplaySubscriptionRequestSchema, ReplaySubscriptionRequest, ReplayResult, ReindexResponse, RateLimitError, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, ProcessedStripeEventsTable, PrintEventFilterSchema, PrintEventFilter, Pox4SignersDailyTable, Pox4FunctionName, Pox4CyclesDailyTable, Pox4CallsTable, PaymentRequiredError, ParsedUpdateSubscriptionRequest, ParsedReplaySubscriptionRequest, ParsedCreateSubscriptionRequest, OutboxStatus, NumericAsText, NotFoundError, NftTransferFilterSchema, NftTransferFilter, NftMintFilterSchema, NftMintFilter, NftBurnFilterSchema, NftBurnFilter, MigrationRole, MempoolTransactionsTable, MempoolTransaction, MagicLinksTable, MagicLink, KeyRotatedError, InsertTransaction, InsertTenantUsageMonthly, InsertTenantComputeAddon, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubscriptionOutbox, InsertSubscriptionDelivery, InsertSubscription, InsertSubgraphUsageDaily, InsertSubgraphOperation, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMempoolTransaction, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertContract, InsertClaimToken, InsertBlock, InsertApiKey, InsertAccountSpendCap, InsertAccountInsight, InsertAccountCredits, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, IndexPrimaryKey, IndexColumnType, IndexColumn, FtTransferFilterSchema, FtTransferFilter, FtMintFilterSchema, FtMintFilter, FtBurnFilterSchema, FtBurnFilter, ForbiddenError, EventsTable, EventsArchiveTable, EventFilterSchema, EventFilter, Event, ErrorCodes, ErrorCode, Env, EMPTY_RANGE_EVENT_INDEX_SENTINEL, DeploySubgraphResponse, DeploySubgraphRequestSchema, DeploySubgraphRequest, DeliveryRow, DecoderCheckpointsTable, DecodedEventsTable, DecodedEventType, DeadRow, DeadLetterEventsTable, DbSplitStatus, DbReadRow, DbPlane, DatabaseError, Database, DEFAULT_BTC_CONFIRMATIONS, DECODED_EVENT_TYPES, DB_TO_STREAMS_EVENT_TYPE, CreateSubscriptionResponse, CreateSubscriptionRequestSchema, CreateSubscriptionRequest, ContractsTable, ContractDeployFilterSchema, ContractDeployFilter, ContractCallFilterSchema, ContractCallFilter, Contract, ClaimTokensTable, ClaimToken, ChainWebhookEnvelope, ChainReorgsTable, ChainReorgRollbackEnvelope, ChainReorgOrphanedEntry, ChainApplyEnvelope, CODE_TO_STATUS, CHAIN_TRIGGER_TYPES, CHAIN_TRIGGER_FIELDS, ByoBreakingChangeDetails, BurnBlockRewardsTable, BurnBlockRewardSlotsTable, BnsNamespacesTable, BnsNamespaceEventsTable, BnsNamespaceEventStatus, BnsNamesTable, BnsNameEventsTable, BnsNameEventTopic, BnsMarketplaceEventsTable, BnsMarketplaceAction, BlocksTable, Block, AuthorizationError, AuthenticationError, ApiKeysTable, ApiKey, AccountsTable, AccountSpendCapsTable, AccountSpendCap, AccountInsightsTable, AccountInsight, AccountCreditsTable, AccountCredits, AccountAgentRunsTable, AccountAgentRun, Account };
package/dist/src/index.js CHANGED
@@ -665,6 +665,7 @@ var TABLE_TO_DB = {
665
665
  burn_block_reward_slots: "source",
666
666
  sbtc_events: "source",
667
667
  sbtc_token_events: "source",
668
+ sbtc_settlements: "source",
668
669
  sbtc_supply_snapshots: "source",
669
670
  bns_name_events: "source",
670
671
  bns_namespace_events: "source",
@@ -1180,7 +1181,8 @@ var CHAIN_TRIGGER_TYPES = [
1180
1181
  "sbtc_deposit",
1181
1182
  "sbtc_withdrawal_create",
1182
1183
  "sbtc_withdrawal_accept",
1183
- "sbtc_withdrawal_reject"
1184
+ "sbtc_withdrawal_reject",
1185
+ "sbtc_withdrawal_swept_confirmed"
1184
1186
  ];
1185
1187
  var triggerAmount = z4.union([
1186
1188
  z4.string().trim().regex(/^\d+$/, "must be a non-negative integer string"),
@@ -1293,6 +1295,11 @@ var ChainTriggerSchema = z4.discriminatedUnion("type", [
1293
1295
  z4.object({
1294
1296
  type: z4.literal("sbtc_withdrawal_reject"),
1295
1297
  requestId: z4.number().int().nonnegative().optional()
1298
+ }).strict(),
1299
+ z4.object({
1300
+ type: z4.literal("sbtc_withdrawal_swept_confirmed"),
1301
+ requestId: z4.number().int().nonnegative().optional(),
1302
+ sweepTxid: triggerPattern.optional()
1296
1303
  }).strict()
1297
1304
  ]);
1298
1305
  var ChainTriggersSchema = z4.array(ChainTriggerSchema).min(1).max(50);
@@ -1417,6 +1424,10 @@ var trigger = {
1417
1424
  sbtcWithdrawalReject: (f = {}) => ({
1418
1425
  type: "sbtc_withdrawal_reject",
1419
1426
  ...f
1427
+ }),
1428
+ sbtcWithdrawalSweptConfirmed: (f = {}) => ({
1429
+ type: "sbtc_withdrawal_swept_confirmed",
1430
+ ...f
1420
1431
  })
1421
1432
  };
1422
1433
  var SCALAR_COLUMN_TYPES = new Set([
@@ -2143,5 +2154,5 @@ export {
2143
2154
  AuthenticationError
2144
2155
  };
2145
2156
 
2146
- //# debugId=34B8177BC0CB5AEB64756E2164756E21
2157
+ //# debugId=39B8FB62F71153DE64756E2164756E21
2147
2158
  //# sourceMappingURL=index.js.map