@secondlayer/shared 7.0.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/crypto/secondlayer-webhook.js +5 -2
- package/dist/src/crypto/secondlayer-webhook.js.map +3 -3
- package/dist/src/db/index.d.ts +29 -1
- package/dist/src/db/index.js +6 -2
- package/dist/src/db/index.js.map +4 -4
- package/dist/src/db/queries/chain-reorgs.d.ts +27 -0
- package/dist/src/db/queries/chain-reorgs.js +6 -2
- package/dist/src/db/queries/chain-reorgs.js.map +4 -4
- package/dist/src/db/queries/contracts.d.ts +27 -0
- package/dist/src/db/queries/integrity.d.ts +27 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +27 -0
- package/dist/src/db/queries/subgraph-operations.d.ts +27 -0
- package/dist/src/db/queries/subgraphs.d.ts +27 -0
- package/dist/src/db/queries/subgraphs.js +6 -2
- package/dist/src/db/queries/subgraphs.js.map +4 -4
- package/dist/src/db/queries/subscriptions.d.ts +27 -0
- package/dist/src/db/schema.d.ts +28 -1
- package/dist/src/env.d.ts +9 -2
- package/dist/src/env.js +6 -2
- package/dist/src/env.js.map +3 -3
- package/dist/src/index.d.ts +39 -4
- package/dist/src/index.js +10 -5
- package/dist/src/index.js.map +7 -7
- package/dist/src/leader.js +5 -2
- package/dist/src/leader.js.map +3 -3
- package/dist/src/logger.js +5 -2
- package/dist/src/logger.js.map +3 -3
- package/dist/src/node/archive-client.js +5 -2
- package/dist/src/node/archive-client.js.map +3 -3
- package/dist/src/node/hiro-client.js +5 -2
- package/dist/src/node/hiro-client.js.map +3 -3
- package/dist/src/node/local-client.d.ts +27 -0
- package/dist/src/schemas/filters.d.ts +1 -1
- package/dist/src/schemas/filters.js +2 -2
- package/dist/src/schemas/filters.js.map +2 -2
- package/dist/src/schemas/index.d.ts +3 -3
- package/dist/src/schemas/index.js +4 -4
- package/dist/src/schemas/index.js.map +4 -4
- package/dist/src/schemas/subgraphs.d.ts +1 -1
- package/dist/src/schemas/subgraphs.js +2 -2
- package/dist/src/schemas/subgraphs.js.map +2 -2
- package/dist/src/schemas/subscriptions.d.ts +1 -1
- package/dist/src/schemas/subscriptions.js +2 -2
- package/dist/src/schemas/subscriptions.js.map +2 -2
- package/migrations/0110_pox5_events.ts +86 -0
- package/package.json +7 -4
package/dist/src/index.d.ts
CHANGED
|
@@ -451,6 +451,32 @@ interface Pox4SignersDailyTable {
|
|
|
451
451
|
aggregation_calls: Generated<number>;
|
|
452
452
|
updated_at: Generated<Date>;
|
|
453
453
|
}
|
|
454
|
+
type Pox5EventTopic = "set-bond-admin" | "set-pause-admin" | "pause-rewards" | "setup-bond" | "add-to-allowlist" | "register-for-bond" | "update-bond-registration" | "register-signer" | "stake" | "stake-update" | "announce-l1-early-exit" | "unstake-sbtc" | "unstake" | "calculate-rewards" | "bond-distribution" | "claim-rewards" | "claim-staker-rewards-for-signer" | "grant-signer-key" | "revoke-signer-grant";
|
|
455
|
+
interface Pox5EventsTable {
|
|
456
|
+
cursor: string;
|
|
457
|
+
block_height: number;
|
|
458
|
+
block_time: Date;
|
|
459
|
+
tx_id: string;
|
|
460
|
+
tx_index: number;
|
|
461
|
+
event_index: number;
|
|
462
|
+
topic: Pox5EventTopic;
|
|
463
|
+
staker: string | null;
|
|
464
|
+
signer: string | null;
|
|
465
|
+
signer_manager: string | null;
|
|
466
|
+
bond_index: number | null;
|
|
467
|
+
amount_ustx: string | null;
|
|
468
|
+
amount_sats: string | null;
|
|
469
|
+
reward_cycle: number | null;
|
|
470
|
+
first_reward_cycle: number | null;
|
|
471
|
+
unlock_cycle: number | null;
|
|
472
|
+
unlock_burn_height: number | null;
|
|
473
|
+
is_l1_lock: boolean | null;
|
|
474
|
+
signer_key: string | null;
|
|
475
|
+
data: unknown;
|
|
476
|
+
canonical: Generated<boolean>;
|
|
477
|
+
source_cursor: string;
|
|
478
|
+
created_at: Generated<Date>;
|
|
479
|
+
}
|
|
454
480
|
interface BurnBlockRewardsTable {
|
|
455
481
|
cursor: string;
|
|
456
482
|
burn_block_height: number;
|
|
@@ -685,6 +711,7 @@ interface Database {
|
|
|
685
711
|
pox4_calls: Pox4CallsTable;
|
|
686
712
|
pox4_cycles_daily: Pox4CyclesDailyTable;
|
|
687
713
|
pox4_signers_daily: Pox4SignersDailyTable;
|
|
714
|
+
pox5_events: Pox5EventsTable;
|
|
688
715
|
burn_block_rewards: BurnBlockRewardsTable;
|
|
689
716
|
burn_block_reward_slots: BurnBlockRewardSlotsTable;
|
|
690
717
|
sbtc_events: SbtcEventsTable;
|
|
@@ -1018,6 +1045,13 @@ declare function getEnv(): Env;
|
|
|
1018
1045
|
* opted out with `POX4_DECODER_ENABLED=false` (mirrors the sBTC decoder policy).
|
|
1019
1046
|
*/
|
|
1020
1047
|
declare function isPox4DecoderEnabled(): boolean;
|
|
1048
|
+
/**
|
|
1049
|
+
* PoX-5 print-event decoder is ON by default (mirrors pox-4/sBTC policy).
|
|
1050
|
+
* No activation gating needed: pox-5 events cannot exist before the Epoch 4.0
|
|
1051
|
+
* hard fork (Bitcoin block 960,230), so pre-activation the decoder idles at
|
|
1052
|
+
* tip. Opt out with `POX5_DECODER_ENABLED=false`.
|
|
1053
|
+
*/
|
|
1054
|
+
declare function isPox5DecoderEnabled(): boolean;
|
|
1021
1055
|
import { RawBuilder } from "kysely";
|
|
1022
1056
|
/**
|
|
1023
1057
|
* Safely encode a JS value as a JSONB literal for Kysely inserts/updates.
|
|
@@ -1855,6 +1889,7 @@ declare const TABLE_TO_DB: {
|
|
|
1855
1889
|
pox4_calls: string
|
|
1856
1890
|
pox4_cycles_daily: string
|
|
1857
1891
|
pox4_signers_daily: string
|
|
1892
|
+
pox5_events: string
|
|
1858
1893
|
burn_block_rewards: string
|
|
1859
1894
|
burn_block_reward_slots: string
|
|
1860
1895
|
sbtc_events: string
|
|
@@ -2079,7 +2114,7 @@ declare class Logger {
|
|
|
2079
2114
|
error(message: string, meta?: Record<string, any>): void;
|
|
2080
2115
|
}
|
|
2081
2116
|
declare const logger: Logger;
|
|
2082
|
-
import { z as z2 } from "zod
|
|
2117
|
+
import { z as z2 } from "zod";
|
|
2083
2118
|
interface StxTransferFilter {
|
|
2084
2119
|
type: "stx_transfer";
|
|
2085
2120
|
sender?: string;
|
|
@@ -2172,7 +2207,7 @@ declare const ContractCallFilterSchema: z2.ZodType<ContractCallFilter>;
|
|
|
2172
2207
|
declare const ContractDeployFilterSchema: z2.ZodType<ContractDeployFilter>;
|
|
2173
2208
|
declare const PrintEventFilterSchema: z2.ZodType<PrintEventFilter>;
|
|
2174
2209
|
declare const EventFilterSchema: z2.ZodType<EventFilter>;
|
|
2175
|
-
import { z as z3 } from "zod
|
|
2210
|
+
import { z as z3 } from "zod";
|
|
2176
2211
|
interface DeploySubgraphRequest {
|
|
2177
2212
|
name: string;
|
|
2178
2213
|
version?: string;
|
|
@@ -2399,7 +2434,7 @@ interface SubgraphAggregateResponse {
|
|
|
2399
2434
|
min?: Record<string, string | null>;
|
|
2400
2435
|
max?: Record<string, string | null>;
|
|
2401
2436
|
}
|
|
2402
|
-
import { z as z4 } from "zod
|
|
2437
|
+
import { z as z4 } from "zod";
|
|
2403
2438
|
declare const SUBSCRIPTION_FORMATS: readonly ["standard-webhooks", "inngest", "trigger", "cloudflare", "cloudevents", "raw"];
|
|
2404
2439
|
declare const SUBSCRIPTION_RUNTIMES: readonly ["inngest", "trigger", "cloudflare", "node"];
|
|
2405
2440
|
declare const SUBSCRIPTION_STATUSES: readonly ["active", "paused", "error"];
|
|
@@ -3057,4 +3092,4 @@ interface ChainTestDelivery {
|
|
|
3057
3092
|
* "Chain subscription webhook payloads" doc.
|
|
3058
3093
|
*/
|
|
3059
3094
|
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;
|
|
3060
|
-
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, ChainWebhookDelivery, ChainTxLevelEvent, ChainTestDelivery, ChainStxTransferData, ChainStxMintData, ChainStxLockData, ChainStxBurnData, ChainReorgsTable, ChainReorgRollbackEnvelope, ChainReorgRollbackDelivery, ChainReorgOrphanedEntry, ChainPrintEventData, ChainNftTransferData, ChainNftMintData, ChainNftBurnData, ChainFtTransferData, ChainFtMintData, ChainFtBurnData, ChainEventEnvelope, ChainApplyEnvelopeOf, 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 };
|
|
3095
|
+
export { validateSubscriptionFilterForTable, sql, setMigrationRole, parseJsonb, onControlPlane, onChainPlane, logger, jsonb, isPox5DecoderEnabled, 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, Pox5EventsTable, Pox5EventTopic, 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, ChainWebhookDelivery, ChainTxLevelEvent, ChainTestDelivery, ChainStxTransferData, ChainStxMintData, ChainStxLockData, ChainStxBurnData, ChainReorgsTable, ChainReorgRollbackEnvelope, ChainReorgRollbackDelivery, ChainReorgOrphanedEntry, ChainPrintEventData, ChainNftTransferData, ChainNftMintData, ChainNftBurnData, ChainFtTransferData, ChainFtMintData, ChainFtBurnData, ChainEventEnvelope, ChainApplyEnvelopeOf, 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
|
@@ -14,7 +14,7 @@ var __export = (target, all) => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
// src/env.ts
|
|
17
|
-
import { z } from "zod
|
|
17
|
+
import { z } from "zod";
|
|
18
18
|
var networksSchema = z.string().transform((val) => {
|
|
19
19
|
const networks = val.split(",").map((n) => n.trim()).filter(Boolean);
|
|
20
20
|
const valid = ["mainnet", "testnet"];
|
|
@@ -62,6 +62,9 @@ function isProductionEnv() {
|
|
|
62
62
|
function isPox4DecoderEnabled() {
|
|
63
63
|
return process.env.POX4_DECODER_ENABLED !== "false";
|
|
64
64
|
}
|
|
65
|
+
function isPox5DecoderEnabled() {
|
|
66
|
+
return process.env.POX5_DECODER_ENABLED !== "false";
|
|
67
|
+
}
|
|
65
68
|
// src/logger.ts
|
|
66
69
|
var LOG_LEVELS = {
|
|
67
70
|
debug: 0,
|
|
@@ -657,6 +660,7 @@ var TABLE_TO_DB = {
|
|
|
657
660
|
pox4_calls: "source",
|
|
658
661
|
pox4_cycles_daily: "source",
|
|
659
662
|
pox4_signers_daily: "source",
|
|
663
|
+
pox5_events: "source",
|
|
660
664
|
burn_block_rewards: "source",
|
|
661
665
|
burn_block_reward_slots: "source",
|
|
662
666
|
sbtc_events: "source",
|
|
@@ -993,7 +997,7 @@ function getErrorMessage(err) {
|
|
|
993
997
|
|
|
994
998
|
// src/schemas/filters.ts
|
|
995
999
|
import { isValidAddress as _isValidAddress } from "@secondlayer/stacks";
|
|
996
|
-
import { z as z2 } from "zod
|
|
1000
|
+
import { z as z2 } from "zod";
|
|
997
1001
|
var isValidAddress = _isValidAddress;
|
|
998
1002
|
var stacksPrincipal = z2.string().refine((val) => {
|
|
999
1003
|
const parts = val.split(".");
|
|
@@ -1096,7 +1100,7 @@ var EventFilterSchema = z2.discriminatedUnion("type", [
|
|
|
1096
1100
|
]);
|
|
1097
1101
|
|
|
1098
1102
|
// src/schemas/subgraphs.ts
|
|
1099
|
-
import { z as z3 } from "zod
|
|
1103
|
+
import { z as z3 } from "zod";
|
|
1100
1104
|
var DeploySubgraphRequestSchema = z3.object({
|
|
1101
1105
|
name: z3.string().regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").max(63),
|
|
1102
1106
|
version: z3.string().optional(),
|
|
@@ -1112,7 +1116,7 @@ var DeploySubgraphRequestSchema = z3.object({
|
|
|
1112
1116
|
});
|
|
1113
1117
|
|
|
1114
1118
|
// src/schemas/subscriptions.ts
|
|
1115
|
-
import { z as z4 } from "zod
|
|
1119
|
+
import { z as z4 } from "zod";
|
|
1116
1120
|
var SUBSCRIPTION_FORMATS = [
|
|
1117
1121
|
"standard-webhooks",
|
|
1118
1122
|
"inngest",
|
|
@@ -2070,6 +2074,7 @@ export {
|
|
|
2070
2074
|
onChainPlane,
|
|
2071
2075
|
logger,
|
|
2072
2076
|
jsonb,
|
|
2077
|
+
isPox5DecoderEnabled,
|
|
2073
2078
|
isPox4DecoderEnabled,
|
|
2074
2079
|
getTargetDb,
|
|
2075
2080
|
getSourceDb,
|
|
@@ -2150,5 +2155,5 @@ export {
|
|
|
2150
2155
|
AuthenticationError
|
|
2151
2156
|
};
|
|
2152
2157
|
|
|
2153
|
-
//# debugId=
|
|
2158
|
+
//# debugId=84F28CECFC37450A64756E2164756E21
|
|
2154
2159
|
//# sourceMappingURL=index.js.map
|