1
1
import type { ApplicationOnComplete , TransactionResult } from '@algorandfoundation/algokit-utils/types/indexer'
2
2
import algosdk from 'algosdk'
3
- import { TransactionInBlock } from '../transform'
4
3
import { Arc28EventGroup , EmittedArc28Event } from './arc-28'
4
+ import { TransactionInBlock } from './block'
5
5
import TransactionType = algosdk . TransactionType
6
6
7
7
/** The result of a single subscription pull/poll. */
@@ -116,6 +116,10 @@ export interface SubscriptionPollMetadata {
116
116
blockTransactions ?: TransactionInBlock [ ]
117
117
/** The set of ARC-28 event groups to process against the subscribed transactions */
118
118
arc28EventGroups : Arc28EventGroup [ ]
119
+ /** The metadata about any blocks that were retrieved from algod as part
120
+ * of the subscription poll.
121
+ */
122
+ blockMetadata ?: BlockMetadata [ ]
119
123
}
120
124
121
125
/** Common parameters to control a single subscription pull/poll for both `AlgorandSubscriber` and `getSubscribedTransactions`. */
@@ -263,6 +267,9 @@ export interface TransactionSubscriptionParams extends CoreTransactionSubscripti
263
267
watermark : number
264
268
}
265
269
270
+ /** A function that returns a set of filters based on a given filter state and hierarchical poll level. */
271
+ export type DynamicFilterLambda < T > = ( state : T , pollLevel : number , watermark : number ) => Promise < SubscriberConfigFilter < unknown > [ ] >
272
+
266
273
/** Configuration for a `DynamicAlgorandSubscriber` */
267
274
export interface DynamicAlgorandSubscriberConfig < T > extends Omit < AlgorandSubscriberConfig , 'filters' > {
268
275
/**
@@ -272,7 +279,7 @@ export interface DynamicAlgorandSubscriberConfig<T> extends Omit<AlgorandSubscri
272
279
* @param watermark The current watermark being processed
273
280
* @returns The set of filters to subscribe to / emit events for
274
281
*/
275
- dynamicFilters : ( state : T , pollLevel : number , watermark : number ) => Promise < SubscriberConfigFilter < unknown > [ ] >
282
+ dynamicFilters : DynamicFilterLambda < T >
276
283
277
284
/** Methods to retrieve and persist the current filter state so syncing is resilient */
278
285
filterStatePersistence : {
0 commit comments