@secondlayer/shared 11.14.3 → 11.15.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.
Files changed (35) hide show
  1. package/dist/src/archive/range-digest.d.ts +5 -0
  2. package/dist/src/archive/semantic-digest-builder.d.ts +5 -0
  3. package/dist/src/coverage/index.d.ts +5 -0
  4. package/dist/src/db/index.d.ts +5 -0
  5. package/dist/src/db/queries/chain-reorgs.d.ts +5 -0
  6. package/dist/src/db/queries/contracts.d.ts +5 -0
  7. package/dist/src/db/queries/instance.d.ts +5 -0
  8. package/dist/src/db/queries/integrity.d.ts +5 -0
  9. package/dist/src/db/queries/subgraph-gaps.d.ts +5 -0
  10. package/dist/src/db/queries/subgraph-operations.d.ts +5 -0
  11. package/dist/src/db/queries/subgraphs.d.ts +5 -0
  12. package/dist/src/db/queries/sync-scope.d.ts +5 -0
  13. package/dist/src/db/queries/webhooks.d.ts +5 -0
  14. package/dist/src/db/schema.d.ts +5 -0
  15. package/dist/src/index-http.d.ts +87 -2
  16. package/dist/src/index-http.js +21 -2
  17. package/dist/src/index-http.js.map +3 -3
  18. package/dist/src/index.d.ts +106 -4
  19. package/dist/src/index.js +48 -2
  20. package/dist/src/index.js.map +4 -4
  21. package/dist/src/node/local-client.d.ts +5 -0
  22. package/dist/src/node/local-client.js +7 -1
  23. package/dist/src/node/local-client.js.map +3 -3
  24. package/dist/src/schemas/index.d.ts +15 -1
  25. package/dist/src/schemas/index.js +41 -2
  26. package/dist/src/schemas/index.js.map +3 -3
  27. package/dist/src/schemas/webhooks.d.ts +19 -1
  28. package/dist/src/schemas/webhooks.js +41 -2
  29. package/dist/src/schemas/webhooks.js.map +3 -3
  30. package/dist/src/streams-rows/index.d.ts +74 -3
  31. package/dist/src/streams-rows/index.js +8 -1
  32. package/dist/src/streams-rows/index.js.map +3 -3
  33. package/migrations/0144_bitcoin_trigger_cursor.ts +30 -0
  34. package/migrations/0145_usage_ledger_fractional_quantity.ts +23 -0
  35. package/package.json +1 -1
@@ -1004,6 +1004,11 @@ interface TriggerEvaluatorStateTable {
1004
1004
  /** Watermark for the async sBTC settlement-confirmed webhook scan; null until
1005
1005
  * the evaluator fast-forwards it on first run. */
1006
1006
  last_settlement_scan_at: ColumnType<Date | null, Date | null | undefined, Date | null>;
1007
+ /** Streams cursor (`<block_height>:<event_index>`) for the Bitcoin (Runes)
1008
+ * chain-trigger evaluator (plan 060) — a separate clock from
1009
+ * `last_processed_block` (Stacks). Null until the evaluator fast-forwards
1010
+ * it to the Bitcoin Streams tip on first run. */
1011
+ bitcoin_last_cursor: ColumnType<string | null, string | null | undefined, string | null>;
1007
1012
  updated_at: Generated<Date>;
1008
1013
  }
1009
1014
  type TriggerEvaluatorState = Selectable<TriggerEvaluatorStateTable>;
@@ -1082,6 +1087,16 @@ declare const VM_STORED_TO_NODE_TYPE: VmStoredToNode;
1082
1087
  * a bare const-to-const alias. */
1083
1088
  declare const STREAMS_EVENT_TYPES: typeof DECODED_EVENT_TYPES;
1084
1089
  type StreamsEventType = DecodedEventType;
1090
+ /**
1091
+ * Wire vocabulary for `chain=bitcoin` Streams events (plan 059) — Runes
1092
+ * activity, mirroring the Stacks `ft_*` family. Same four kinds as 058's
1093
+ * `RuneEventKind` (`packages/api/src/index/runes.ts`), duplicated here as the
1094
+ * canonical shared const rather than imported from the api package (shared
1095
+ * never depends on api); the DB `kind` column (`etch|mint|transfer|burn`) is
1096
+ * mapped at the edge in both readers.
1097
+ */
1098
+ declare const RUNE_EVENT_TYPES: readonly ["rune_etch", "rune_mint", "rune_transfer", "rune_burn"];
1099
+ type RuneEventType = (typeof RUNE_EVENT_TYPES)[number];
1085
1100
  declare const STREAMS_DB_EVENT_TYPES: readonly ["stx_transfer_event", "stx_mint_event", "stx_burn_event", "stx_lock_event", "ft_transfer_event", "ft_mint_event", "ft_burn_event", "nft_transfer_event", "nft_mint_event", "nft_burn_event", "smart_contract_event", "contract_event"];
1086
1101
  type StreamsDbEventType = (typeof STREAMS_DB_EVENT_TYPES)[number];
1087
1102
  declare const DB_TO_STREAMS_EVENT_TYPE: Record<StreamsDbEventType, StreamsEventType>;
@@ -2498,7 +2513,7 @@ declare const WebhookFilterPrimitiveSchema: z3.ZodType<WebhookFilterPrimitive>;
2498
2513
  declare const WebhookFilterOperatorSchema: z3.ZodType<WebhookFilterOperator>;
2499
2514
  declare const WebhookFilterClauseSchema: z3.ZodType<WebhookFilterClause>;
2500
2515
  declare const WebhookFilterSchema: z3.ZodType<WebhookFilter>;
2501
- 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", "nested_contract_call", "var_set", "map_set", "map_insert", "map_delete", "sbtc_deposit", "sbtc_withdrawal_create", "sbtc_withdrawal_accept", "sbtc_withdrawal_reject", "sbtc_withdrawal_swept_confirmed"];
2516
+ 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", "nested_contract_call", "var_set", "map_set", "map_insert", "map_delete", "sbtc_deposit", "sbtc_withdrawal_create", "sbtc_withdrawal_accept", "sbtc_withdrawal_reject", "sbtc_withdrawal_swept_confirmed", "rune_etch", "rune_mint", "rune_transfer", "rune_burn"];
2502
2517
  /**
2503
2518
  * Per-type accepted filter fields for chain triggers, DERIVED from
2504
2519
  * {@link ChainTriggerSchema} so the agent-facing reference can never drift behind
@@ -2643,6 +2658,20 @@ type ChainTrigger = {
2643
2658
  type: "sbtc_withdrawal_swept_confirmed"
2644
2659
  requestId?: number
2645
2660
  sweepTxid?: string
2661
+ } | {
2662
+ type: "rune_etch"
2663
+ rune?: string
2664
+ } | {
2665
+ type: "rune_mint"
2666
+ rune?: string
2667
+ } | {
2668
+ type: "rune_transfer"
2669
+ rune?: string
2670
+ address?: string
2671
+ minAmount?: ChainTriggerAmount
2672
+ } | {
2673
+ type: "rune_burn"
2674
+ rune?: string
2646
2675
  };
2647
2676
  interface CreateWebhookRequest {
2648
2677
  name: string;
@@ -2838,6 +2867,43 @@ declare function generateSubgraphAgentSchema(detail: SubgraphDetail, options?: S
2838
2867
  declare function generateSubgraphOpenApi(detail: SubgraphDetail, options?: SubgraphSpecOptions): Record<string, unknown>;
2839
2868
  declare function generateSubgraphMarkdown(detail: SubgraphDetail, options?: SubgraphSpecOptions): string;
2840
2869
  declare function generateSubgraphSpec(detail: SubgraphDetail, format: SubgraphSpecFormat, options?: SubgraphSpecOptions): Record<string, unknown> | SubgraphAgentSchema | string;
2870
+ /** The etch a `rune_etch` event created — everything a consumer needs to
2871
+ * render a fresh rune without a second lookup, minus what the envelope
2872
+ * already carries (`rune_id`). Mirrors 058's `RuneEntry` shape
2873
+ * (`packages/api/src/index/runes.ts`), trimmed to fields that exist at etch
2874
+ * time (no `mints`/`burned`/`supply` — always zero on the etching event). */
2875
+ type RuneEtchEntry = {
2876
+ /** No spacers, uppercase. */
2877
+ name: string
2878
+ /** As etched, spacers included (e.g. `DOG•GO•TO•THE•MOON`). */
2879
+ spaced_name: string
2880
+ symbol: string | null
2881
+ divisibility: number
2882
+ /** u128 decimal string. Never `Number()`. */
2883
+ premine: string
2884
+ turbo: boolean
2885
+ terms: {
2886
+ amount: string | null
2887
+ cap: string | null
2888
+ height_start: string | null
2889
+ height_end: string | null
2890
+ offset_start: string | null
2891
+ offset_end: string | null
2892
+ } | null
2893
+ };
2894
+ type RuneEventPayload = {
2895
+ /** u128 decimal string. Never `Number()`. */
2896
+ amount: string
2897
+ /** The output this event landed on. Set on `rune_transfer` only — an etch
2898
+ * or mint's allocation isn't tied to one output the way a transfer is
2899
+ * (`packages/bitcoin/src/runes/updater.ts`). */
2900
+ vout?: number
2901
+ /** The output's mainnet address. Set on `rune_transfer` only, and only
2902
+ * when the output has a standard scriptPubKey. */
2903
+ address?: string
2904
+ /** `rune_etch` only — the entry this event created. */
2905
+ entry?: RuneEtchEntry
2906
+ };
2841
2907
  /**
2842
2908
  * Payload for `sbtc_deposit` (topic: completed-deposit).
2843
2909
  * `sender` is the Stacks address that initiated the deposit and receives the sBTC.
@@ -2895,6 +2961,27 @@ interface ChainApplyEnvelope {
2895
2961
  trigger: ChainTrigger["type"];
2896
2962
  event: SbtcDepositEvent | SbtcWithdrawalEvent | SbtcWithdrawalSweptConfirmedEvent | Record<string, unknown>;
2897
2963
  }
2964
+ /**
2965
+ * Delivered when a Runes trigger (`rune_etch`/`rune_mint`/`rune_transfer`/
2966
+ * `rune_burn`) matches an event on the `chain=bitcoin` Streams clock (plan
2967
+ * 059) — a separate wire shape from {@link ChainApplyEnvelope} because it's
2968
+ * Bitcoin-sourced, not matched off the Stacks Index clock: no `canonical`
2969
+ * (Bitcoin Streams events are always canonical — orphaned ones are recalled
2970
+ * via {@link ChainReorgRollbackEnvelope} like every other chain webhook), and
2971
+ * `event_index` lives at the top level rather than nested. `event` mirrors the
2972
+ * Streams row's `payload` (see `RuneStreamsEvent` in `../streams-rows/events.ts`).
2973
+ */
2974
+ interface RuneApplyEnvelope {
2975
+ action: "apply";
2976
+ chain: "bitcoin";
2977
+ block_hash: string;
2978
+ block_height: number;
2979
+ tx_id: string;
2980
+ event_index: number;
2981
+ trigger: RuneEventType;
2982
+ rune_id: string;
2983
+ event: RuneEventPayload;
2984
+ }
2898
2985
  /** One orphaned delivery recalled by a reorg rollback. */
2899
2986
  interface ChainReorgOrphanedEntry {
2900
2987
  tx_id: string | null;
@@ -2906,15 +2993,19 @@ interface ChainReorgOrphanedEntry {
2906
2993
  * (`event_type: "chain.reorg.rollback"`). Lists the previously-delivered applies
2907
2994
  * at or above `fork_point_height` that are now orphaned, so the consumer can undo
2908
2995
  * them precisely. `orphaned` is capped (currently 500); `truncated` flags overflow.
2996
+ * `chain` is set to `"bitcoin"` on a Runes reorg (plan 060) and omitted on a
2997
+ * Stacks one — added rather than always-present so the existing (Stacks-only)
2998
+ * wire shape never changes for an existing consumer.
2909
2999
  */
2910
3000
  interface ChainReorgRollbackEnvelope {
2911
3001
  action: "rollback";
3002
+ chain?: "bitcoin";
2912
3003
  fork_point_height: number;
2913
3004
  orphaned: ChainReorgOrphanedEntry[];
2914
3005
  truncated: boolean;
2915
3006
  }
2916
3007
  /** Any chain-webhook webhook body. Discriminate on `action`. */
2917
- type ChainWebhookEnvelope = ChainApplyEnvelope | ChainReorgRollbackEnvelope;
3008
+ type ChainWebhookEnvelope = ChainApplyEnvelope | RuneApplyEnvelope | ChainReorgRollbackEnvelope;
2918
3009
  /** `event.data` for a `stx_transfer` delivery. */
2919
3010
  interface ChainStxTransferData {
2920
3011
  sender?: string;
@@ -3048,6 +3139,17 @@ type ChainApplyDeliveryOf<
3048
3139
  timestamp: string
3049
3140
  data: ChainApplyEnvelopeOf<TTrigger, TEvent>
3050
3141
  };
3142
+ /** One Runes `apply` delivery body (`type: "chain.rune_*.apply"`). Bitcoin-sourced
3143
+ * (see {@link RuneApplyEnvelope}), so — unlike {@link ChainApplyDeliveryOf} —
3144
+ * not generic over an `event` shape: every Runes trigger delivers the same
3145
+ * `RuneEventPayload`. */
3146
+ type RuneApplyDeliveryOf<TTrigger extends RuneEventType> = {
3147
+ type: `chain.${TTrigger}.apply`
3148
+ timestamp: string
3149
+ data: RuneApplyEnvelope & {
3150
+ trigger: TTrigger
3151
+ }
3152
+ };
3051
3153
  /** Delivered once per affected webhook on a reorg (`type: "chain.reorg.rollback"`). */
3052
3154
  interface ChainReorgRollbackDelivery {
3053
3155
  type: "chain.reorg.rollback";
@@ -3096,7 +3198,7 @@ interface ChainTestDelivery {
3096
3198
  * `ChainReorgRollbackEnvelope`) under a different outer envelope — see the
3097
3199
  * "Chain webhook webhook payloads" doc.
3098
3200
  */
3099
- type ChainWebhookDelivery = ChainApplyDeliveryOf<"stx_transfer", ChainEventEnvelope<"stx_transfer_event", ChainStxTransferData>> | ChainApplyDeliveryOf<"stx_mint", ChainEventEnvelope<"stx_mint_event", ChainStxMintData>> | ChainApplyDeliveryOf<"stx_burn", ChainEventEnvelope<"stx_burn_event", ChainStxBurnData>> | ChainApplyDeliveryOf<"stx_lock", ChainEventEnvelope<"stx_lock_event", ChainStxLockData>> | ChainApplyDeliveryOf<"ft_transfer", ChainEventEnvelope<"ft_transfer_event", ChainFtTransferData>> | ChainApplyDeliveryOf<"ft_mint", ChainEventEnvelope<"ft_mint_event", ChainFtMintData>> | ChainApplyDeliveryOf<"ft_burn", ChainEventEnvelope<"ft_burn_event", ChainFtBurnData>> | ChainApplyDeliveryOf<"nft_transfer", ChainEventEnvelope<"nft_transfer_event", ChainNftTransferData>> | ChainApplyDeliveryOf<"nft_mint", ChainEventEnvelope<"nft_mint_event", ChainNftMintData>> | ChainApplyDeliveryOf<"nft_burn", ChainEventEnvelope<"nft_burn_event", ChainNftBurnData>> | ChainApplyDeliveryOf<"print_event", ChainEventEnvelope<"contract_event", ChainPrintEventData>> | ChainApplyDeliveryOf<"contract_call", ChainTxLevelEvent> | ChainApplyDeliveryOf<"contract_deploy", ChainTxLevelEvent> | ChainApplyDeliveryOf<"sbtc_deposit", SbtcDepositEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_create", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_accept", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_reject", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_swept_confirmed", SbtcWithdrawalSweptConfirmedEvent> | ChainReorgRollbackDelivery | ChainTestDelivery;
3201
+ type ChainWebhookDelivery = ChainApplyDeliveryOf<"stx_transfer", ChainEventEnvelope<"stx_transfer_event", ChainStxTransferData>> | ChainApplyDeliveryOf<"stx_mint", ChainEventEnvelope<"stx_mint_event", ChainStxMintData>> | ChainApplyDeliveryOf<"stx_burn", ChainEventEnvelope<"stx_burn_event", ChainStxBurnData>> | ChainApplyDeliveryOf<"stx_lock", ChainEventEnvelope<"stx_lock_event", ChainStxLockData>> | ChainApplyDeliveryOf<"ft_transfer", ChainEventEnvelope<"ft_transfer_event", ChainFtTransferData>> | ChainApplyDeliveryOf<"ft_mint", ChainEventEnvelope<"ft_mint_event", ChainFtMintData>> | ChainApplyDeliveryOf<"ft_burn", ChainEventEnvelope<"ft_burn_event", ChainFtBurnData>> | ChainApplyDeliveryOf<"nft_transfer", ChainEventEnvelope<"nft_transfer_event", ChainNftTransferData>> | ChainApplyDeliveryOf<"nft_mint", ChainEventEnvelope<"nft_mint_event", ChainNftMintData>> | ChainApplyDeliveryOf<"nft_burn", ChainEventEnvelope<"nft_burn_event", ChainNftBurnData>> | ChainApplyDeliveryOf<"print_event", ChainEventEnvelope<"contract_event", ChainPrintEventData>> | ChainApplyDeliveryOf<"contract_call", ChainTxLevelEvent> | ChainApplyDeliveryOf<"contract_deploy", ChainTxLevelEvent> | ChainApplyDeliveryOf<"sbtc_deposit", SbtcDepositEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_create", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_accept", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_reject", SbtcWithdrawalEvent> | ChainApplyDeliveryOf<"sbtc_withdrawal_swept_confirmed", SbtcWithdrawalSweptConfirmedEvent> | RuneApplyDeliveryOf<"rune_etch"> | RuneApplyDeliveryOf<"rune_mint"> | RuneApplyDeliveryOf<"rune_transfer"> | RuneApplyDeliveryOf<"rune_burn"> | ChainReorgRollbackDelivery | ChainTestDelivery;
3100
3202
  declare namespace exports_hmac {
3101
3203
  export { createSignatureHeader, generateSecret, signPayload, verifySignature, verifySignatureHeader };
3102
3204
  }
@@ -3149,4 +3251,4 @@ declare function publicKeyPemFromPrivate(privateKeyPem: string): string;
3149
3251
  declare function ed25519KeyId(publicKeyPem: string): string;
3150
3252
  declare function signEd25519(payload: string, privateKey: KeyObject): string;
3151
3253
  declare function verifyEd25519(payload: string, signatureBase64: string, publicKey: KeyObject): boolean;
3152
- 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, RateLimitError, ReindexResponse, RepairMode, ReplayResult, ReplayWebhookRequest, ReplayWebhookRequestSchema, RetryState, RotateSecretResponse, RunStatus, 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 };
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 };
package/dist/src/index.js CHANGED
@@ -30,6 +30,12 @@ var VM_STORED_TO_NODE_TYPE = {
30
30
  map_delete: "map_delete_event"
31
31
  };
32
32
  var STREAMS_EVENT_TYPES = DECODED_EVENT_TYPES;
33
+ var RUNE_EVENT_TYPES = [
34
+ "rune_etch",
35
+ "rune_mint",
36
+ "rune_transfer",
37
+ "rune_burn"
38
+ ];
33
39
  // src/db-event-types.ts
34
40
  var STREAMS_DB_EVENT_TYPES = [
35
41
  "stx_transfer_event",
@@ -1341,8 +1347,13 @@ var CHAIN_TRIGGER_TYPES = [
1341
1347
  "sbtc_withdrawal_create",
1342
1348
  "sbtc_withdrawal_accept",
1343
1349
  "sbtc_withdrawal_reject",
1344
- "sbtc_withdrawal_swept_confirmed"
1350
+ "sbtc_withdrawal_swept_confirmed",
1351
+ "rune_etch",
1352
+ "rune_mint",
1353
+ "rune_transfer",
1354
+ "rune_burn"
1345
1355
  ];
1356
+ var runeRef = z3.string().trim().min(1);
1346
1357
  var triggerAmount = z3.union([
1347
1358
  z3.string().trim().regex(/^\d+$/, "must be a non-negative integer string"),
1348
1359
  z3.number().int().nonnegative()
@@ -1491,6 +1502,24 @@ var ChainTriggerSchema = z3.discriminatedUnion("type", [
1491
1502
  type: z3.literal("sbtc_withdrawal_swept_confirmed"),
1492
1503
  requestId: z3.number().int().nonnegative().optional(),
1493
1504
  sweepTxid: triggerPattern.optional()
1505
+ }).strict(),
1506
+ z3.object({
1507
+ type: z3.literal("rune_etch"),
1508
+ rune: runeRef.optional()
1509
+ }).strict(),
1510
+ z3.object({
1511
+ type: z3.literal("rune_mint"),
1512
+ rune: runeRef.optional()
1513
+ }).strict(),
1514
+ z3.object({
1515
+ type: z3.literal("rune_transfer"),
1516
+ rune: runeRef.optional(),
1517
+ address: triggerPattern.optional(),
1518
+ minAmount: triggerAmount.optional()
1519
+ }).strict(),
1520
+ z3.object({
1521
+ type: z3.literal("rune_burn"),
1522
+ rune: runeRef.optional()
1494
1523
  }).strict()
1495
1524
  ]);
1496
1525
  var ChainTriggersSchema = z3.array(ChainTriggerSchema).min(1).max(50);
@@ -1619,6 +1648,22 @@ var trigger = {
1619
1648
  sbtcWithdrawalSweptConfirmed: (f = {}) => ({
1620
1649
  type: "sbtc_withdrawal_swept_confirmed",
1621
1650
  ...f
1651
+ }),
1652
+ runeEtch: (f = {}) => ({
1653
+ type: "rune_etch",
1654
+ ...f
1655
+ }),
1656
+ runeMint: (f = {}) => ({
1657
+ type: "rune_mint",
1658
+ ...f
1659
+ }),
1660
+ runeTransfer: (f = {}) => ({
1661
+ type: "rune_transfer",
1662
+ ...f
1663
+ }),
1664
+ runeBurn: (f = {}) => ({
1665
+ type: "rune_burn",
1666
+ ...f
1622
1667
  })
1623
1668
  };
1624
1669
  var SCALAR_COLUMN_TYPES = new Set([
@@ -2135,6 +2180,7 @@ export {
2135
2180
  KeyRotatedError,
2136
2181
  NotFoundError,
2137
2182
  PaymentRequiredError,
2183
+ RUNE_EVENT_TYPES,
2138
2184
  RateLimitError,
2139
2185
  ReplayWebhookRequestSchema,
2140
2186
  SOURCE_READ_COLUMNS,
@@ -2206,5 +2252,5 @@ export {
2206
2252
  validateWebhookFilterForTable
2207
2253
  };
2208
2254
 
2209
- //# debugId=B12885A371ED0F4264756E2164756E21
2255
+ //# debugId=4679FC2F36F2ED1D64756E2164756E21
2210
2256
  //# sourceMappingURL=index.js.map