@secondlayer/sdk 12.4.1 → 13.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.
@@ -2295,6 +2295,7 @@ type Pox5EventsListParams = {
2295
2295
  toHeight?: number;
2296
2296
  };
2297
2297
  type Pox5EventsWalkParams = Omit<Pox5EventsListParams, "limit"> & WalkOptions;
2298
+ type Pox5EventsConsumeParams<TTx = never> = Omit<Pox5EventsListParams, "cursor" | "fromCursor" | "limit"> & IndexConsumeOptions<IndexPox5Event, Pox5EventsEnvelope, TTx>;
2298
2299
  /** `index.pox5` — decoded PoX-5 print events, the staking primitive from the
2299
2300
  * epoch 4.0 hard fork onward (PoX-4's `index.stacking` stream ends there). */
2300
2301
  interface Pox5Resource {
@@ -2306,6 +2307,15 @@ interface Pox5Resource {
2306
2307
  }): Promise<Pox5EventsEnvelope<Pox5EventFields<F>>>;
2307
2308
  list(params?: Pox5EventsListParams): Promise<Pox5EventsEnvelope>;
2308
2309
  walk(params?: Pox5EventsWalkParams): AsyncIterable<IndexPox5Event>;
2310
+ /** Checkpointed sweep of the pox-5 print log — append-only across all
2311
+ * 19 topics. See {@link IndexConsumeOptions}. */
2312
+ consume<TTx = never>(params: Pox5EventsConsumeParams<TTx> & {
2313
+ sink?: ConsumerSink<TTx>;
2314
+ }): Promise<{
2315
+ cursor: string | null;
2316
+ pages: number;
2317
+ emptyPolls: number;
2318
+ }>;
2309
2319
  };
2310
2320
  }
2311
2321
  /**
@@ -1759,7 +1759,18 @@ class Index extends BaseClient {
1759
1759
  pox5 = {
1760
1760
  events: {
1761
1761
  list: (params = {}) => this.listPox5Events(params),
1762
- walk: (params = {}) => this.walkPox5Events(params)
1762
+ walk: (params = {}) => this.walkPox5Events(params),
1763
+ consume: (params) => consumeIndexFeed({
1764
+ ...params,
1765
+ fetchPage: ({ cursor, fromHeight, limit }) => this.listPox5Events({
1766
+ ...feedFilters(params),
1767
+ cursor,
1768
+ fromHeight,
1769
+ limit,
1770
+ signal: params.signal
1771
+ }),
1772
+ itemsOf: (envelope) => envelope.events
1773
+ })
1763
1774
  }
1764
1775
  };
1765
1776
  async listFtTransfers(params = {}) {
@@ -2679,5 +2690,5 @@ export {
2679
2690
  getSubgraph
2680
2691
  };
2681
2692
 
2682
- //# debugId=022E11732B2A24D564756E2164756E21
2693
+ //# debugId=E8E071B63ACA039B64756E2164756E21
2683
2694
  //# sourceMappingURL=index.js.map