11import type { ApplicationOnComplete , TransactionResult } from '@algorandfoundation/algokit-utils/types/indexer'
22import algosdk from 'algosdk'
3- import { TransactionInBlock } from '../transform'
43import { Arc28EventGroup , EmittedArc28Event } from './arc-28'
4+ import { TransactionInBlock } from './block'
55import TransactionType = algosdk . TransactionType
66
77/** The result of a single subscription pull/poll. */
@@ -116,6 +116,10 @@ export interface SubscriptionPollMetadata {
116116 blockTransactions ?: TransactionInBlock [ ]
117117 /** The set of ARC-28 event groups to process against the subscribed transactions */
118118 arc28EventGroups : Arc28EventGroup [ ]
119+ /** The metadata about any blocks that were retrieved from algod as part
120+ * of the subscription poll.
121+ */
122+ blockMetadata ?: BlockMetadata [ ]
119123}
120124
121125/** Common parameters to control a single subscription pull/poll for both `AlgorandSubscriber` and `getSubscribedTransactions`. */
@@ -263,6 +267,9 @@ export interface TransactionSubscriptionParams extends CoreTransactionSubscripti
263267 watermark : number
264268}
265269
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+
266273/** Configuration for a `DynamicAlgorandSubscriber` */
267274export interface DynamicAlgorandSubscriberConfig < T > extends Omit < AlgorandSubscriberConfig , 'filters' > {
268275 /**
@@ -272,7 +279,7 @@ export interface DynamicAlgorandSubscriberConfig<T> extends Omit<AlgorandSubscri
272279 * @param watermark The current watermark being processed
273280 * @returns The set of filters to subscribe to / emit events for
274281 */
275- dynamicFilters : ( state : T , pollLevel : number , watermark : number ) => Promise < SubscriberConfigFilter < unknown > [ ] >
282+ dynamicFilters : DynamicFilterLambda < T >
276283
277284 /** Methods to retrieve and persist the current filter state so syncing is resilient */
278285 filterStatePersistence : {
0 commit comments