@secondlayer/shared 17.0.0 → 17.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/index.d.ts +18 -1
- package/dist/src/index.js +51 -7
- package/dist/src/index.js.map +6 -4
- package/dist/src/node/tx-summary.d.ts +7 -1
- package/dist/src/node/tx-summary.js +17 -2
- package/dist/src/node/tx-summary.js.map +3 -3
- package/dist/src/schemas/index.js +28 -7
- package/dist/src/schemas/index.js.map +5 -4
- package/dist/src/schemas/webhooks.js +28 -7
- package/dist/src/schemas/webhooks.js.map +5 -4
- package/dist/src/streams-rows/index.d.ts +35 -12
- package/dist/src/streams-rows/index.js +25 -21
- package/dist/src/streams-rows/index.js.map +5 -5
- package/migrations/0207_bns_buy_listing_price.ts +39 -0
- package/migrations/0208_pox5_calculate_rewards_cycle.ts +31 -0
- package/migrations/0209_chain_reorgs_index_block_hash.ts +51 -0
- package/migrations/0210_mempool_evict_superseded_nonces.ts +71 -0
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -3008,6 +3008,23 @@ declare function isEmptyRangeCursor(cursor: StreamsCursor): boolean;
|
|
|
3008
3008
|
declare function committedHeight(cursor: string | null | undefined): number | null;
|
|
3009
3009
|
/** Exclusive end of every event that can live in `height`. */
|
|
3010
3010
|
declare function blockEndCursor(height: number): StreamsCursor;
|
|
3011
|
+
/**
|
|
3012
|
+
* Normalize a Bitcoin txid to the stored form: `0x` + 64 lowercase hex.
|
|
3013
|
+
* Explorers show bare hex; the Index stores (and matches) the prefixed form,
|
|
3014
|
+
* so every input boundary (trigger schema, API filters) runs through here.
|
|
3015
|
+
* Returns null when the value isn't a 32-byte hex txid.
|
|
3016
|
+
*/
|
|
3017
|
+
declare function normalizeBtcTxid(value: string): string | null;
|
|
3018
|
+
/** Each era starts at `fromBurnHeight` (inclusive) and runs until the next. */
|
|
3019
|
+
declare const MAINNET_POX_CONTRACT_ERAS: readonly {
|
|
3020
|
+
fromBurnHeight: number
|
|
3021
|
+
contractId: string
|
|
3022
|
+
}[];
|
|
3023
|
+
/** The mainnet PoX contract live at `burnHeight`. */
|
|
3024
|
+
declare function mainnetPoxContractAt(burnHeight: number): string;
|
|
3025
|
+
/** True for a PoX contract on any network (`<deployer>.pox`, `.pox-N`). Wide
|
|
3026
|
+
* on purpose: it only decides whether a filter needs its stx_lock branch. */
|
|
3027
|
+
declare function isPoxContractId(contractId: string): boolean;
|
|
3011
3028
|
declare class Logger {
|
|
3012
3029
|
private _level?;
|
|
3013
3030
|
private _isProduction?;
|
|
@@ -3888,4 +3905,4 @@ declare function publicKeyPemFromPrivate(privateKeyPem: string): string;
|
|
|
3888
3905
|
declare function ed25519KeyId(publicKeyPem: string): string;
|
|
3889
3906
|
declare function signEd25519(payload: string, privateKey: KeyObject): string;
|
|
3890
3907
|
declare function verifyEd25519(payload: string, signatureBase64: string, publicKey: KeyObject): boolean;
|
|
3891
|
-
export { ABI_STATUSES, AbiStatus, Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeyExpiredError, ApiKeyRevokedError, ApiKeyStatus, ApiKeysTable, ApiRequestLogRow, ApiRequestLogTable, 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, CliDeviceLogin, CliDeviceLoginStatus, CliDeviceLoginsTable, CliDeviceProduct, ContactRequest, ContactRequestsTable, 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, DeadReason, DeadRow, DecodedEventType2 as DecodedEventType, DecodedEventsTable, DecoderCheckpointsTable, DeliveryRow, DeploySubgraphRequest, DeploySubgraphRequestSchema, DeploySubgraphResponse, EMPTY_RANGE_EVENT_INDEX_SENTINEL, Env, ErrorCode, ErrorCodes, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, ForbiddenError, GapReason, HealthHour, HealthSnapshotPoint, HostedStackStateTable, INSIGHT_SEVERITIES, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountBalanceAlerts, InsertAccountCredits, InsertAccountSpendCap, InsertApiFailedRequest, InsertApiKey, InsertApiRequestLogRow, InsertArchiveFetch, InsertBlock, InsertContactRequest, InsertContract, InsertEvent, InsertFeedbackTicket, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertStateWrite, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUpdateSubscriber, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, Insight, InsightEvidence, InsightEvidenceSchema, InsightListResponse, InsightListResponseSchema, InsightMutesTable, InsightResourceKind, InsightResourceKindSchema, InsightSchema, InsightSeverity, InsightSeveritySchema, InsightsTable, InstancesTable, KeyRotatedError, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NotFoundError, NumericAsText, OBSERVER_JOURNAL_STATUSES, OauthClient, OauthClientsTable, OauthCodesTable, OauthGrant, OauthGrantsTable, OauthRefreshRetiredTable, OauthRequestStatus, OauthRequestsTable, OauthTokenKind, OauthTokensTable, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, ParsedCreateWebhookRequest, ParsedReplayWebhookRequest, ParsedUpdateWebhookRequest, PaymentRequiredError, PendingForkBlocksTable, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, PushPrefs, PushPrefsTable, PushSentTable, PushSubscription, PushSubscriptionsTable, RUNE_EVENT_TYPES, RateLimitError, ReindexResponse, RepairMode, ReplayResult, ReplayWebhookRequest, ReplayWebhookRequestSchema, RetryState, RotateSecretResponse, RunStatus, RuneApplyDeliveryOf, RuneApplyEnvelope, RuneEventType, SEVERITY_ORDER, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, STREAMS_CURSOR_VERSION, STREAMS_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_TO_DB_EVENT_TYPES, SUBGRAPH_STATES, SbtcDepositEvent, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SbtcWithdrawalEvent, SbtcWithdrawalSweptConfirmedEvent, SecondLayerError, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StateWrite, StateWritesArchiveTable, StateWritesTable, StreamsCursor, StreamsCursorFeed, StreamsCursorFeedMismatchError, StreamsDbEventType, StreamsEventType, Subgraph, SubgraphAgentSchema, SubgraphAggregateParams, SubgraphAggregateResponse, SubgraphDetail, SubgraphErrorGroupsTable, SubgraphGap, SubgraphGapEntry, SubgraphGapRange, SubgraphGapsResponse, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphQueryParams, SubgraphSpecFormat, SubgraphSpecOptions, SubgraphStatus, SubgraphSummary, SubgraphSyncInfo, SubgraphSyncState, SubgraphVerification, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, TenantSuspendedError, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountBalanceAlerts, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSendsTable, UpdateSubgraph, UpdateSubgraphOperation, UpdateSubscriber, UpdateSubscribersTable, 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_FORMATS, WEBHOOK_STATUSES, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDeliveryHoursTable, WebhookDetail, WebhookFormat, WebhookFormatSchema, WebhookIncidentAlert, WebhookIncidentAlertsTable, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookPauseReason, WebhookReplay, WebhookReplayStatus, WebhookReplaysTable, WebhookStatus, WebhookStatusSchema, WebhookSummary, WebhooksTable, applicationDatabaseUrl, assertDbSplit, blockEndCursor, bucketHourly, closeDb, closeDbOrTimeout, committedHeight, compareStreamsCursor, configuredSourceUrl, configuredTargetUrl, exports_hmac as crypto, decodeFeedCursor, decodeStreamsCursor, decodeTaggedStreamsCursor, describeDbUrl, exports_ed25519 as ed25519, encodeFeedCursor, encodeStreamsCursor, finalizedBurnHeight, formatWebhookSchemaErrors, generateSubgraphAgentSchema, generateSubgraphMarkdown, generateSubgraphOpenApi, generateSubgraphSpec, getDb, getDbSplitStatus, getEnv, getErrorMessage, getMigrationRole, getRawClient, getSourceDb, getTargetDb, isBnsDecoderEnabled, isEmptyRangeCursor, isPox5DecoderEnabled, isSbtcDecoderEnabled, jsonb, logger, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql, stacksNetwork, syncState };
|
|
3908
|
+
export { ABI_STATUSES, AbiStatus, Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeyExpiredError, ApiKeyRevokedError, ApiKeyStatus, ApiKeysTable, ApiRequestLogRow, ApiRequestLogTable, 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, CliDeviceLogin, CliDeviceLoginStatus, CliDeviceLoginsTable, CliDeviceProduct, ContactRequest, ContactRequestsTable, 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, DeadReason, DeadRow, DecodedEventType2 as DecodedEventType, DecodedEventsTable, DecoderCheckpointsTable, DeliveryRow, DeploySubgraphRequest, DeploySubgraphRequestSchema, DeploySubgraphResponse, EMPTY_RANGE_EVENT_INDEX_SENTINEL, Env, ErrorCode, ErrorCodes, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, ForbiddenError, GapReason, HealthHour, HealthSnapshotPoint, HostedStackStateTable, INSIGHT_SEVERITIES, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountBalanceAlerts, InsertAccountCredits, InsertAccountSpendCap, InsertApiFailedRequest, InsertApiKey, InsertApiRequestLogRow, InsertArchiveFetch, InsertBlock, InsertContactRequest, InsertContract, InsertEvent, InsertFeedbackTicket, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertStateWrite, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUpdateSubscriber, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, Insight, InsightEvidence, InsightEvidenceSchema, InsightListResponse, InsightListResponseSchema, InsightMutesTable, InsightResourceKind, InsightResourceKindSchema, InsightSchema, InsightSeverity, InsightSeveritySchema, InsightsTable, InstancesTable, KeyRotatedError, MAINNET_POX_CONTRACT_ERAS, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NotFoundError, NumericAsText, OBSERVER_JOURNAL_STATUSES, OauthClient, OauthClientsTable, OauthCodesTable, OauthGrant, OauthGrantsTable, OauthRefreshRetiredTable, OauthRequestStatus, OauthRequestsTable, OauthTokenKind, OauthTokensTable, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, ParsedCreateWebhookRequest, ParsedReplayWebhookRequest, ParsedUpdateWebhookRequest, PaymentRequiredError, PendingForkBlocksTable, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, PushPrefs, PushPrefsTable, PushSentTable, PushSubscription, PushSubscriptionsTable, RUNE_EVENT_TYPES, RateLimitError, ReindexResponse, RepairMode, ReplayResult, ReplayWebhookRequest, ReplayWebhookRequestSchema, RetryState, RotateSecretResponse, RunStatus, RuneApplyDeliveryOf, RuneApplyEnvelope, RuneEventType, SEVERITY_ORDER, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, STREAMS_CURSOR_VERSION, STREAMS_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_TO_DB_EVENT_TYPES, SUBGRAPH_STATES, SbtcDepositEvent, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SbtcWithdrawalEvent, SbtcWithdrawalSweptConfirmedEvent, SecondLayerError, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StateWrite, StateWritesArchiveTable, StateWritesTable, StreamsCursor, StreamsCursorFeed, StreamsCursorFeedMismatchError, StreamsDbEventType, StreamsEventType, Subgraph, SubgraphAgentSchema, SubgraphAggregateParams, SubgraphAggregateResponse, SubgraphDetail, SubgraphErrorGroupsTable, SubgraphGap, SubgraphGapEntry, SubgraphGapRange, SubgraphGapsResponse, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphQueryParams, SubgraphSpecFormat, SubgraphSpecOptions, SubgraphStatus, SubgraphSummary, SubgraphSyncInfo, SubgraphSyncState, SubgraphVerification, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, TenantSuspendedError, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountBalanceAlerts, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSendsTable, UpdateSubgraph, UpdateSubgraphOperation, UpdateSubscriber, UpdateSubscribersTable, 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_FORMATS, WEBHOOK_STATUSES, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDeliveryHoursTable, WebhookDetail, WebhookFormat, WebhookFormatSchema, WebhookIncidentAlert, WebhookIncidentAlertsTable, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookPauseReason, WebhookReplay, WebhookReplayStatus, WebhookReplaysTable, WebhookStatus, WebhookStatusSchema, WebhookSummary, WebhooksTable, applicationDatabaseUrl, assertDbSplit, blockEndCursor, bucketHourly, closeDb, closeDbOrTimeout, committedHeight, compareStreamsCursor, configuredSourceUrl, configuredTargetUrl, exports_hmac as crypto, decodeFeedCursor, decodeStreamsCursor, decodeTaggedStreamsCursor, describeDbUrl, exports_ed25519 as ed25519, encodeFeedCursor, encodeStreamsCursor, finalizedBurnHeight, formatWebhookSchemaErrors, generateSubgraphAgentSchema, generateSubgraphMarkdown, generateSubgraphOpenApi, generateSubgraphSpec, getDb, getDbSplitStatus, getEnv, getErrorMessage, getMigrationRole, getRawClient, getSourceDb, getTargetDb, isBnsDecoderEnabled, isEmptyRangeCursor, isPox5DecoderEnabled, isPoxContractId, isSbtcDecoderEnabled, jsonb, logger, mainnetPoxContractAt, normalizeBtcTxid, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql, stacksNetwork, syncState };
|
package/dist/src/index.js
CHANGED
|
@@ -1320,6 +1320,34 @@ function blockEndCursor(height) {
|
|
|
1320
1320
|
event_index: EMPTY_RANGE_EVENT_INDEX_SENTINEL
|
|
1321
1321
|
};
|
|
1322
1322
|
}
|
|
1323
|
+
// src/btc-txid.ts
|
|
1324
|
+
var BTC_TXID = /^(?:0x)?[0-9a-f]{64}$/;
|
|
1325
|
+
function normalizeBtcTxid(value) {
|
|
1326
|
+
const v = value.trim().toLowerCase();
|
|
1327
|
+
if (!BTC_TXID.test(v))
|
|
1328
|
+
return null;
|
|
1329
|
+
return v.startsWith("0x") ? v : `0x${v}`;
|
|
1330
|
+
}
|
|
1331
|
+
// src/pox-contracts.ts
|
|
1332
|
+
var BOOT = "SP000000000000000000002Q6VF78";
|
|
1333
|
+
var MAINNET_POX_CONTRACT_ERAS = [
|
|
1334
|
+
{ fromBurnHeight: 0, contractId: `${BOOT}.pox` },
|
|
1335
|
+
{ fromBurnHeight: 781551, contractId: `${BOOT}.pox-2` },
|
|
1336
|
+
{ fromBurnHeight: 789250, contractId: `${BOOT}.pox-3` },
|
|
1337
|
+
{ fromBurnHeight: 840360, contractId: `${BOOT}.pox-4` },
|
|
1338
|
+
{ fromBurnHeight: 960230, contractId: `${BOOT}.pox-5` }
|
|
1339
|
+
];
|
|
1340
|
+
function mainnetPoxContractAt(burnHeight) {
|
|
1341
|
+
let contractId = MAINNET_POX_CONTRACT_ERAS[0].contractId;
|
|
1342
|
+
for (const era of MAINNET_POX_CONTRACT_ERAS) {
|
|
1343
|
+
if (burnHeight >= era.fromBurnHeight)
|
|
1344
|
+
contractId = era.contractId;
|
|
1345
|
+
}
|
|
1346
|
+
return contractId;
|
|
1347
|
+
}
|
|
1348
|
+
function isPoxContractId(contractId) {
|
|
1349
|
+
return /\.pox(-\d+)?$/.test(contractId);
|
|
1350
|
+
}
|
|
1323
1351
|
// src/schemas/subgraphs.ts
|
|
1324
1352
|
import { z as z2 } from "zod";
|
|
1325
1353
|
var DeploySubgraphRequestSchema = z2.object({
|
|
@@ -1585,6 +1613,18 @@ var triggerAmount = z4.union([
|
|
|
1585
1613
|
z4.number().int().nonnegative()
|
|
1586
1614
|
]);
|
|
1587
1615
|
var triggerPattern = z4.string().trim().min(1);
|
|
1616
|
+
var triggerExact = z4.string().trim().min(1);
|
|
1617
|
+
var btcTxid = z4.string().transform((value, ctx) => {
|
|
1618
|
+
const txid = normalizeBtcTxid(value);
|
|
1619
|
+
if (txid === null) {
|
|
1620
|
+
ctx.addIssue({
|
|
1621
|
+
code: "custom",
|
|
1622
|
+
message: "must be a 64-character hex Bitcoin txid (0x optional)"
|
|
1623
|
+
});
|
|
1624
|
+
return z4.NEVER;
|
|
1625
|
+
}
|
|
1626
|
+
return txid;
|
|
1627
|
+
});
|
|
1588
1628
|
var trait = z4.string().trim().min(1);
|
|
1589
1629
|
var printWhereValue = z4.string().min(1).max(256);
|
|
1590
1630
|
var PrintWhereSchema = z4.record(z4.string().trim().min(1).max(64), z4.union([printWhereValue, z4.array(printWhereValue).min(1).max(20)])).refine((o) => {
|
|
@@ -1708,14 +1748,14 @@ var ChainTriggerSchema = z4.discriminatedUnion("type", [
|
|
|
1708
1748
|
}).strict(),
|
|
1709
1749
|
z4.object({
|
|
1710
1750
|
type: z4.literal("sbtc_deposit"),
|
|
1711
|
-
recipient:
|
|
1751
|
+
recipient: triggerExact.optional(),
|
|
1712
1752
|
minAmount: triggerAmount.optional(),
|
|
1713
1753
|
maxAmount: triggerAmount.optional(),
|
|
1714
|
-
bitcoinTxid:
|
|
1754
|
+
bitcoinTxid: btcTxid.optional()
|
|
1715
1755
|
}).strict(),
|
|
1716
1756
|
z4.object({
|
|
1717
1757
|
type: z4.literal("sbtc_withdrawal_create"),
|
|
1718
|
-
sender:
|
|
1758
|
+
sender: triggerExact.optional(),
|
|
1719
1759
|
minAmount: triggerAmount.optional(),
|
|
1720
1760
|
maxAmount: triggerAmount.optional(),
|
|
1721
1761
|
requestId: z4.number().int().nonnegative().optional()
|
|
@@ -1723,7 +1763,7 @@ var ChainTriggerSchema = z4.discriminatedUnion("type", [
|
|
|
1723
1763
|
z4.object({
|
|
1724
1764
|
type: z4.literal("sbtc_withdrawal_accept"),
|
|
1725
1765
|
requestId: z4.number().int().nonnegative().optional(),
|
|
1726
|
-
sweepTxid:
|
|
1766
|
+
sweepTxid: btcTxid.optional()
|
|
1727
1767
|
}).strict(),
|
|
1728
1768
|
z4.object({
|
|
1729
1769
|
type: z4.literal("sbtc_withdrawal_reject"),
|
|
@@ -1732,7 +1772,7 @@ var ChainTriggerSchema = z4.discriminatedUnion("type", [
|
|
|
1732
1772
|
z4.object({
|
|
1733
1773
|
type: z4.literal("sbtc_withdrawal_swept_confirmed"),
|
|
1734
1774
|
requestId: z4.number().int().nonnegative().optional(),
|
|
1735
|
-
sweepTxid:
|
|
1775
|
+
sweepTxid: btcTxid.optional()
|
|
1736
1776
|
}).strict(),
|
|
1737
1777
|
z4.object({
|
|
1738
1778
|
type: z4.literal("rune_etch"),
|
|
@@ -1745,7 +1785,7 @@ var ChainTriggerSchema = z4.discriminatedUnion("type", [
|
|
|
1745
1785
|
z4.object({
|
|
1746
1786
|
type: z4.literal("rune_transfer"),
|
|
1747
1787
|
rune: runeRef.optional(),
|
|
1748
|
-
address:
|
|
1788
|
+
address: triggerExact.optional(),
|
|
1749
1789
|
minAmount: triggerAmount.optional()
|
|
1750
1790
|
}).strict(),
|
|
1751
1791
|
z4.object({
|
|
@@ -2391,6 +2431,7 @@ export {
|
|
|
2391
2431
|
InsightSchema,
|
|
2392
2432
|
InsightSeveritySchema,
|
|
2393
2433
|
KeyRotatedError,
|
|
2434
|
+
MAINNET_POX_CONTRACT_ERAS,
|
|
2394
2435
|
NotFoundError,
|
|
2395
2436
|
OBSERVER_JOURNAL_STATUSES,
|
|
2396
2437
|
PaymentRequiredError,
|
|
@@ -2455,9 +2496,12 @@ export {
|
|
|
2455
2496
|
isBnsDecoderEnabled,
|
|
2456
2497
|
isEmptyRangeCursor,
|
|
2457
2498
|
isPox5DecoderEnabled,
|
|
2499
|
+
isPoxContractId,
|
|
2458
2500
|
isSbtcDecoderEnabled,
|
|
2459
2501
|
jsonb,
|
|
2460
2502
|
logger,
|
|
2503
|
+
mainnetPoxContractAt,
|
|
2504
|
+
normalizeBtcTxid,
|
|
2461
2505
|
onChainPlane,
|
|
2462
2506
|
onControlPlane,
|
|
2463
2507
|
parseJsonb,
|
|
@@ -2469,5 +2513,5 @@ export {
|
|
|
2469
2513
|
syncState
|
|
2470
2514
|
};
|
|
2471
2515
|
|
|
2472
|
-
//# debugId=
|
|
2516
|
+
//# debugId=36068E06C8C082DB64756E2164756E21
|
|
2473
2517
|
//# sourceMappingURL=index.js.map
|