@secondlayer/sdk 6.10.0 → 6.12.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/index.d.ts CHANGED
@@ -337,6 +337,27 @@ type IndexTip = {
337
337
  block_height: number
338
338
  lag_seconds: number
339
339
  };
340
+ /**
341
+ * A chain reorg overlapping a returned page's height range. Height-keyed feeds
342
+ * (`/transactions`, `/contract-calls`, `/stacking`) populate this so a consumer
343
+ * can reconcile: roll back the rows whose `block_height:tx_index` cursor falls in
344
+ * `orphaned_range`, then re-fetch from `new_canonical_tip`. Empty when the page
345
+ * spans no reorg.
346
+ */
347
+ type IndexReorg = {
348
+ id: string
349
+ detected_at: string
350
+ fork_point_height: number
351
+ old_index_block_hash: string | null
352
+ new_index_block_hash: string | null
353
+ /** Orphaned cursor span `<block_height>:<tx_index>`, inclusive. */
354
+ orphaned_range: {
355
+ from: string
356
+ to: string
357
+ }
358
+ /** New canonical tip cursor to resume from. */
359
+ new_canonical_tip: string
360
+ };
340
361
  type IndexUsage = {
341
362
  product: "index"
342
363
  tier: string
@@ -365,7 +386,7 @@ type FtTransfersEnvelope = {
365
386
  events: FtTransfer[]
366
387
  next_cursor: string | null
367
388
  tip: IndexTip
368
- reorgs: never[]
389
+ reorgs: IndexReorg[]
369
390
  };
370
391
  type FtTransfersListParams = {
371
392
  cursor?: string | null
@@ -398,7 +419,7 @@ type NftTransfersEnvelope = {
398
419
  events: NftTransfer[]
399
420
  next_cursor: string | null
400
421
  tip: IndexTip
401
- reorgs: never[]
422
+ reorgs: IndexReorg[]
402
423
  };
403
424
  type NftTransfersListParams = {
404
425
  cursor?: string | null
@@ -502,7 +523,7 @@ type EventsEnvelope = {
502
523
  events: IndexEvent[]
503
524
  next_cursor: string | null
504
525
  tip: IndexTip
505
- reorgs: never[]
526
+ reorgs: IndexReorg[]
506
527
  };
507
528
  type EventsListParams = {
508
529
  /** Required. One of the decoded event types. */
@@ -539,7 +560,7 @@ type ContractCallsEnvelope = {
539
560
  contract_calls: IndexContractCall[]
540
561
  next_cursor: string | null
541
562
  tip: IndexTip
542
- reorgs: never[]
563
+ reorgs: IndexReorg[]
543
564
  };
544
565
  type ContractCallsListParams = {
545
566
  cursor?: string | null
@@ -682,7 +703,7 @@ type TransactionsEnvelope = {
682
703
  transactions: IndexTransaction[]
683
704
  next_cursor: string | null
684
705
  tip: IndexTip
685
- reorgs: never[]
706
+ reorgs: IndexReorg[]
686
707
  };
687
708
  type TransactionEnvelope = {
688
709
  transaction: IndexTransaction
@@ -731,7 +752,7 @@ type StackingEnvelope = {
731
752
  stacking: IndexStackingAction[]
732
753
  next_cursor: string | null
733
754
  tip: IndexTip
734
- reorgs: never[]
755
+ reorgs: IndexReorg[]
735
756
  /** Present only when the PoX-4 decoder is disabled, explaining an empty feed. */
736
757
  notes?: string
737
758
  };
@@ -1365,8 +1386,10 @@ type CreateStreamsClientOptions = {
1365
1386
  }
1366
1387
  /**
1367
1388
  * Verify the bulk dumps manifest's ed25519 signature in `client.dumps.list()`
1368
- * before trusting any file sha256 (default off). Uses the same key source as
1369
- * `verify`. Default off until historical manifests carry signatures.
1389
+ * before trusting any file sha256 (default ON). Uses the same key source as
1390
+ * `verify` (fetches `/public/streams/signing-key`, or a pinned PEM). Pass
1391
+ * `false` to opt out. A missing or invalid signature throws
1392
+ * `StreamsSignatureError`.
1370
1393
  */
1371
1394
  verifyDumpsManifest?: boolean
1372
1395
  };
@@ -1811,4 +1834,4 @@ declare function toJsonSafe(value: unknown): unknown;
1811
1834
  /** Decode a hex-encoded Clarity value to JSON-safe JS (uints as strings,
1812
1835
  * buffers as `0x…` hex, tuples as objects). Returns the input hex on failure. */
1813
1836
  declare function decodeClarityValue(hex: string): unknown;
1814
- export { verifyWebhookSignature, verifySecondlayerSignature, trigger, toJsonSafe, isStxTransfer, isStxMint, isStxLock, isStxBurn, isPrint, isNftTransfer, isNftMint, isNftBurn, isFtTransfer, isFtMint, isFtBurn, getSubgraph, decodeStxTransfer, decodeStxMint, decodeStxLock, decodeStxBurn, decodePrint, decodeNftTransfer, decodeNftMint, decodeNftBurn, decodeFtTransfer, decodeFtMint, decodeFtBurn, decodeClarityValue, createStreamsClient, VersionConflictError, ValidationError, UpdateSubscriptionRequest2 as UpdateSubscriptionRequest, TransactionsWalkParams, TransactionsListParams, TransactionsEnvelope, TransactionEnvelope, Subscriptions, SubscriptionSummary2 as SubscriptionSummary, SubscriptionStatus, SubscriptionRuntime, SubscriptionKind, SubscriptionFormat, SubscriptionDetail2 as SubscriptionDetail, Subgraphs, SubgraphSpecOptions3 as SubgraphSpecOptions, SubgraphSpecFormat2 as SubgraphSpecFormat, SubgraphOperationStatus, SubgraphAgentSchema3 as SubgraphAgentSchema, StreamsUsage, StreamsTip, StreamsSignatureError, StreamsServerError, StreamsReorgsListParams, StreamsReorgsListEnvelope, StreamsReorgContext, StreamsReorg, StreamsEventsSubscribeParams, StreamsEventsStreamParams, StreamsEventsListParams, StreamsEventsListEnvelope, StreamsEventsEnvelope, StreamsEventsConsumeResult, StreamsEventsConsumeParams, StreamsEventType, StreamsEventPayload, StreamsEvent, StreamsDumpsManifest, StreamsDumps, StreamsDumpFile, StreamsClient, StreamsCanonicalBlock, StreamsBatchContext, StackingWalkParams, StackingListParams, StackingEnvelope, SecondLayerOptions, SecondLayer, ScopedKeyProduct, RotateSecretResponse2 as RotateSecretResponse, ReplayResult2 as ReplayResult, RateLimitError, Pox4CallsParams, NftTransfersWalkParams, NftTransfersListParams, NftTransfersEnvelope, NftTransferPayload, NftTransferEvent, NftTransfer, MempoolWalkParams, MempoolTransactionEnvelope, MempoolListParams, MempoolEnvelope, IndexUsage, IndexTransaction, IndexTip, IndexStackingAction, IndexPostCondition, IndexMempoolTransaction, IndexEventType, IndexEvent, IndexContractCall, IndexCanonicalBlock, IndexBlock, Index, FtTransfersWalkParams, FtTransfersListParams, FtTransfersEnvelope, FtTransferPayload, FtTransferEvent, FtTransfer, FetchLike2 as FetchLike, EventsWalkParams, EventsListParams, EventsEnvelope, DeliveryRow2 as DeliveryRow, DecodedStxTransferPayload, DecodedStxTransfer, DecodedStxMintPayload, DecodedStxMint, DecodedStxLockPayload, DecodedStxLock, DecodedStxBurnPayload, DecodedStxBurn, DecodedPrintValue, DecodedPrintPayload, DecodedPrint, DecodedNftTransferPayload, DecodedNftTransfer, DecodedNftMintPayload, DecodedNftMint, DecodedNftBurnPayload, DecodedNftBurn, DecodedFtTransferPayload, DecodedFtTransfer, DecodedFtMintPayload, DecodedFtMint, DecodedFtBurnPayload, DecodedFtBurn, DecodedEventRow, DecodedEventColumns, DeadRow2 as DeadRow, Datasets, DatasetRow, CursorListParams, CursorEnvelope, Cursor, CreateSubscriptionResponse2 as CreateSubscriptionResponse, CreateSubscriptionRequest2 as CreateSubscriptionRequest, CreateApiKeyResponse, CreateApiKeyParams, ContractsListParams, ContractsEnvelope, Contracts, ContractSummary, ContractConformance, ContractCallsWalkParams, ContractCallsListParams, ContractCallsEnvelope, ContextSnapshot, ContextAccount, ChainTriggerType, ChainTrigger, CanonicalWalkParams, CanonicalListParams, CanonicalEnvelope, CURSOR_SLUGS, BlocksWalkParams, BlocksListParams, BlocksEnvelope, BlockEnvelope, AuthError, ApiKeys, ApiError, ActiveSubgraphOperation };
1837
+ export { verifyWebhookSignature, verifySecondlayerSignature, trigger, toJsonSafe, isStxTransfer, isStxMint, isStxLock, isStxBurn, isPrint, isNftTransfer, isNftMint, isNftBurn, isFtTransfer, isFtMint, isFtBurn, getSubgraph, decodeStxTransfer, decodeStxMint, decodeStxLock, decodeStxBurn, decodePrint, decodeNftTransfer, decodeNftMint, decodeNftBurn, decodeFtTransfer, decodeFtMint, decodeFtBurn, decodeClarityValue, createStreamsClient, VersionConflictError, ValidationError, UpdateSubscriptionRequest2 as UpdateSubscriptionRequest, TransactionsWalkParams, TransactionsListParams, TransactionsEnvelope, TransactionEnvelope, Subscriptions, SubscriptionSummary2 as SubscriptionSummary, SubscriptionStatus, SubscriptionRuntime, SubscriptionKind, SubscriptionFormat, SubscriptionDetail2 as SubscriptionDetail, Subgraphs, SubgraphSpecOptions3 as SubgraphSpecOptions, SubgraphSpecFormat2 as SubgraphSpecFormat, SubgraphOperationStatus, SubgraphAgentSchema3 as SubgraphAgentSchema, StreamsUsage, StreamsTip, StreamsSignatureError, StreamsServerError, StreamsReorgsListParams, StreamsReorgsListEnvelope, StreamsReorgContext, StreamsReorg, StreamsEventsSubscribeParams, StreamsEventsStreamParams, StreamsEventsListParams, StreamsEventsListEnvelope, StreamsEventsEnvelope, StreamsEventsConsumeResult, StreamsEventsConsumeParams, StreamsEventType, StreamsEventPayload, StreamsEvent, StreamsDumpsManifest, StreamsDumps, StreamsDumpFile, StreamsClient, StreamsCanonicalBlock, StreamsBatchContext, StackingWalkParams, StackingListParams, StackingEnvelope, SecondLayerOptions, SecondLayer, ScopedKeyProduct, RotateSecretResponse2 as RotateSecretResponse, ReplayResult2 as ReplayResult, RateLimitError, Pox4CallsParams, NftTransfersWalkParams, NftTransfersListParams, NftTransfersEnvelope, NftTransferPayload, NftTransferEvent, NftTransfer, MempoolWalkParams, MempoolTransactionEnvelope, MempoolListParams, MempoolEnvelope, IndexUsage, IndexTransaction, IndexTip, IndexStackingAction, IndexReorg, IndexPostCondition, IndexMempoolTransaction, IndexEventType, IndexEvent, IndexContractCall, IndexCanonicalBlock, IndexBlock, Index, FtTransfersWalkParams, FtTransfersListParams, FtTransfersEnvelope, FtTransferPayload, FtTransferEvent, FtTransfer, FetchLike2 as FetchLike, EventsWalkParams, EventsListParams, EventsEnvelope, DeliveryRow2 as DeliveryRow, DecodedStxTransferPayload, DecodedStxTransfer, DecodedStxMintPayload, DecodedStxMint, DecodedStxLockPayload, DecodedStxLock, DecodedStxBurnPayload, DecodedStxBurn, DecodedPrintValue, DecodedPrintPayload, DecodedPrint, DecodedNftTransferPayload, DecodedNftTransfer, DecodedNftMintPayload, DecodedNftMint, DecodedNftBurnPayload, DecodedNftBurn, DecodedFtTransferPayload, DecodedFtTransfer, DecodedFtMintPayload, DecodedFtMint, DecodedFtBurnPayload, DecodedFtBurn, DecodedEventRow, DecodedEventColumns, DeadRow2 as DeadRow, Datasets, DatasetRow, CursorListParams, CursorEnvelope, Cursor, CreateSubscriptionResponse2 as CreateSubscriptionResponse, CreateSubscriptionRequest2 as CreateSubscriptionRequest, CreateApiKeyResponse, CreateApiKeyParams, ContractsListParams, ContractsEnvelope, Contracts, ContractSummary, ContractConformance, ContractCallsWalkParams, ContractCallsListParams, ContractCallsEnvelope, ContextSnapshot, ContextAccount, ChainTriggerType, ChainTrigger, CanonicalWalkParams, CanonicalListParams, CanonicalEnvelope, CURSOR_SLUGS, BlocksWalkParams, BlocksListParams, BlocksEnvelope, BlockEnvelope, AuthError, ApiKeys, ApiError, ActiveSubgraphOperation };
package/dist/index.js CHANGED
@@ -1342,7 +1342,7 @@ function createStreamsClient(options) {
1342
1342
  const dumps = createStreamsDumps({
1343
1343
  baseUrl: options.dumpsBaseUrl,
1344
1344
  fetchImpl,
1345
- verifyManifest: options.verifyDumpsManifest ?? false,
1345
+ verifyManifest: options.verifyDumpsManifest ?? true,
1346
1346
  loadPublicKeyPem: async () => (await loadKey()).publicKeyPem
1347
1347
  });
1348
1348
  async function request(path) {
@@ -2013,5 +2013,5 @@ export {
2013
2013
  ApiError
2014
2014
  };
2015
2015
 
2016
- //# debugId=30831F6F187A1F5A64756E2164756E21
2016
+ //# debugId=7E891A303DCCD65B64756E2164756E21
2017
2017
  //# sourceMappingURL=index.js.map