@secondlayer/sdk 10.4.2 → 10.4.3

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.
@@ -1,4 +1,5 @@
1
- import { STREAMS_EVENT_TYPES, StreamsEvent, StreamsEventType } from "@secondlayer/shared/streams-rows";
1
+ import { VmEventType } from "@secondlayer/shared";
2
+ import { STREAMS_EVENT_TYPES, StreamsEvent, StreamsEventType, StreamsWireEvent, VmStreamsEvent } from "@secondlayer/shared/streams-rows";
2
3
  /**
3
4
  * A consumer sink: the destination adapter a consume loop writes through.
4
5
  *
@@ -217,9 +218,39 @@ type IndexPrint = IndexEventBase & {
217
218
  raw_value: string | null;
218
219
  };
219
220
  };
221
+ type IndexNestedContractCall = IndexEventBase & {
222
+ event_type: "nested_contract_call";
223
+ sender: string | null;
224
+ caller: string;
225
+ function_name: string;
226
+ function_args: unknown;
227
+ raw_result: string | null;
228
+ };
229
+ type IndexVarSet = IndexEventBase & {
230
+ event_type: "var_set";
231
+ var_name: string;
232
+ raw_value: string;
233
+ };
234
+ type IndexMapSet = IndexEventBase & {
235
+ event_type: "map_set";
236
+ map: string;
237
+ raw_key: string;
238
+ raw_value: string;
239
+ };
240
+ type IndexMapInsert = IndexEventBase & {
241
+ event_type: "map_insert";
242
+ map: string;
243
+ raw_key: string;
244
+ raw_value: string;
245
+ };
246
+ type IndexMapDelete = IndexEventBase & {
247
+ event_type: "map_delete";
248
+ map: string;
249
+ raw_key: string;
250
+ };
220
251
  /** Decoded chain event, discriminated by `event_type`. */
221
- type IndexEvent = IndexFtTransfer | IndexNftTransfer | IndexStxTransfer | IndexStxMint | IndexStxBurn | IndexStxLock | IndexFtMint | IndexFtBurn | IndexNftMint | IndexNftBurn | IndexPrint;
222
- import { StreamsEventPayload } from "@secondlayer/shared/streams-rows";
252
+ type IndexEvent = IndexFtTransfer | IndexNftTransfer | IndexStxTransfer | IndexStxMint | IndexStxBurn | IndexStxLock | IndexFtMint | IndexFtBurn | IndexNftMint | IndexNftBurn | IndexPrint | IndexNestedContractCall | IndexVarSet | IndexMapSet | IndexMapInsert | IndexMapDelete;
253
+ import { StreamsWireEvent as StreamsWireEvent2, StreamsEventPayload } from "@secondlayer/shared/streams-rows";
223
254
  type StreamsTip = {
224
255
  block_height: number;
225
256
  block_hash: string;
@@ -315,9 +346,11 @@ type StreamsEventsListParams = {
315
346
  cursor?: string | null;
316
347
  fromHeight?: number;
317
348
  toHeight?: number;
318
- types?: readonly StreamsEventType[];
349
+ /** `vm` reads ordinal. Omit for Streams 1.0. */
350
+ clock?: "classic" | "vm";
351
+ types?: readonly (StreamsEventType | VmEventType)[];
319
352
  /** Event types to exclude (applied after `types`). */
320
- notTypes?: readonly StreamsEventType[];
353
+ notTypes?: readonly (StreamsEventType | VmEventType)[];
321
354
  contractId?: StreamsFilterValue;
322
355
  sender?: StreamsFilterValue;
323
356
  recipient?: StreamsFilterValue;
@@ -709,11 +742,26 @@ type StreamsClient = {
709
742
  }): AsyncIterableIterator<StreamsBatch<StreamsEventOfTypes<T>>>;
710
743
  consume(params?: StreamsConsumeParams): AsyncIterableIterator<StreamsBatch>;
711
744
  events: {
712
- /** Narrowing overload, matching `consume`. */
713
- list<const T extends readonly StreamsEventType[]>(params: StreamsEventsListParams & {
745
+ /** `clock: "vm"` pages carry vm rows only (a parallel vocabulary,
746
+ * `event_index` = `ordinal`). Never `StreamsEvent`. */
747
+ list(params: StreamsEventsListParams & {
748
+ clock: "vm";
749
+ }): Promise<StreamsEventsEnvelope<VmStreamsEvent>>;
750
+ /** Narrowing overload, matching `consume`. Classic clock only —
751
+ * `clock: "vm"` is overload 1, and a general `StreamsEventsListParams`
752
+ * variable (clock unresolved) is the wire-union fallback. */
753
+ list<const T extends readonly StreamsEventType[]>(params: Omit<StreamsEventsListParams, "clock" | "types" | "notTypes"> & {
714
754
  types: T;
755
+ notTypes?: readonly StreamsEventType[];
756
+ clock?: "classic";
715
757
  }): Promise<StreamsEventsEnvelope<StreamsEventOfTypes<T>>>;
716
- list(params?: StreamsEventsListParams): Promise<StreamsEventsEnvelope>;
758
+ list(params?: Omit<StreamsEventsListParams, "clock" | "types" | "notTypes"> & {
759
+ types?: readonly StreamsEventType[];
760
+ notTypes?: readonly StreamsEventType[];
761
+ clock?: "classic";
762
+ }): Promise<StreamsEventsEnvelope>;
763
+ /** Unresolved `clock` on a general params variable: the wire union. */
764
+ list(params: StreamsEventsListParams): Promise<StreamsEventsEnvelope<StreamsWireEvent>>;
717
765
  byTxId(txId: string): Promise<StreamsEventsListEnvelope>;
718
766
  /**
719
767
  * Pull pages from Streams and call `onBatch` after each page.
@@ -972,4 +1020,4 @@ declare const Cursor: {
972
1020
  eventIndex: number;
973
1021
  };
974
1022
  };
975
- export { isStxTransfer, isStxMint, isStxLock, isStxBurn, isPrint, isNftTransfer, isNftMint, isNftBurn, isFtTransfer, isFtMint, isFtBurn, decodeStxTransfer, decodeStxMint, decodeStxLock, decodeStxBurn, decodePrint, decodeNftTransfer, decodeNftMint, decodeNftBurn, decodeFtTransfer, decodeFtMint, decodeFtBurn, decode, createStreamsClient, ValidationError, StreamsTip, StreamsSubscription, StreamsSignatureError, StreamsServerError, StreamsReorgsListParams, StreamsReorgsListEnvelope, StreamsReorgContext, StreamsReorg, StreamsEventsSubscribeParams, StreamsEventsStreamParams, StreamsEventsListParams, StreamsEventsListEnvelope, StreamsEventsEnvelope, StreamsEventsConsumeResult, StreamsEventsConsumeParams, StreamsEventType, StreamsEventPayload, StreamsEvent, StreamsDumpsManifest, StreamsDumps, StreamsDumpFile, StreamsConsumeParams, StreamsClient, StreamsCanonicalBlock, StreamsBatchContext, StreamsBatch, STREAMS_EVENT_TYPES, RateLimitError, NftTransferPayload2 as NftTransferPayload, NftTransferEvent, FtTransferPayload2 as FtTransferPayload, FtTransferEvent, FetchLike2 as FetchLike, 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, Cursor, ConsumerBatchContext, AuthError };
1023
+ export { isStxTransfer, isStxMint, isStxLock, isStxBurn, isPrint, isNftTransfer, isNftMint, isNftBurn, isFtTransfer, isFtMint, isFtBurn, decodeStxTransfer, decodeStxMint, decodeStxLock, decodeStxBurn, decodePrint, decodeNftTransfer, decodeNftMint, decodeNftBurn, decodeFtTransfer, decodeFtMint, decodeFtBurn, decode, createStreamsClient, VmStreamsEvent, ValidationError, StreamsWireEvent2 as StreamsWireEvent, StreamsTip, StreamsSubscription, StreamsSignatureError, StreamsServerError, StreamsReorgsListParams, StreamsReorgsListEnvelope, StreamsReorgContext, StreamsReorg, StreamsEventsSubscribeParams, StreamsEventsStreamParams, StreamsEventsListParams, StreamsEventsListEnvelope, StreamsEventsEnvelope, StreamsEventsConsumeResult, StreamsEventsConsumeParams, StreamsEventType, StreamsEventPayload, StreamsEvent, StreamsDumpsManifest, StreamsDumps, StreamsDumpFile, StreamsConsumeParams, StreamsClient, StreamsCanonicalBlock, StreamsBatchContext, StreamsBatch, STREAMS_EVENT_TYPES, RateLimitError, NftTransferPayload2 as NftTransferPayload, NftTransferEvent, FtTransferPayload2 as FtTransferPayload, FtTransferEvent, FetchLike2 as FetchLike, 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, Cursor, ConsumerBatchContext, AuthError };
@@ -1313,6 +1313,7 @@ function createStreamsClient(options) {
1313
1313
  asset_identifier: params.assetIdentifier,
1314
1314
  types: params.types,
1315
1315
  not_types: params.notTypes,
1316
+ clock: params.clock === "vm" ? "vm" : undefined,
1316
1317
  filters: encodeFilters(params.filters)
1317
1318
  })}`);
1318
1319
  }
@@ -1507,5 +1508,5 @@ export {
1507
1508
  AuthError
1508
1509
  };
1509
1510
 
1510
- //# debugId=7D4A6263BDC781FF64756E2164756E21
1511
+ //# debugId=67918C210E187D1F64756E2164756E21
1511
1512
  //# sourceMappingURL=index.js.map