algokit-subscriber-ts

@algorandfoundation/algokit-subscriber / types/subscription / TransactionSubscriptionParams

Interface: TransactionSubscriptionParams

types/subscription.TransactionSubscriptionParams

Parameters to control a single subscription pull/poll.

Hierarchy

Table of contents

Properties

Properties

arc28Events

Optional arc28Events: Arc28EventGroup[]

Any ARC-28 event definitions to process from app call logs

Inherited from

CoreTransactionSubscriptionParams.arc28Events

Defined in

src/types/subscription.ts:260


currentRound

Optional currentRound: bigint

The current tip of the configured Algorand blockchain. If not provided, it will be resolved on demand.

Defined in

src/types/subscription.ts:382


filters

filters: NamedTransactionFilter[]

The filter(s) to apply to find transactions of interest. A list of filters with corresponding names.

Example

 filter: [{
  name: 'asset-transfers',
  filter: {
    type: TransactionType.axfer,
    //...
  }
 }, {
  name: 'payments',
  filter: {
    type: TransactionType.pay,
    //...
  }
 }]

Inherited from

CoreTransactionSubscriptionParams.filters

Defined in

src/types/subscription.ts:258


maxIndexerRoundsToSync

Optional maxIndexerRoundsToSync: number

The maximum number of rounds to sync from indexer when using `syncBehaviour: ‘catchup-with-indexer’.

By default there is no limit and it will paginate through all of the rounds. Sometimes this can result in an incredibly long catchup time that may break the service due to execution and memory constraints, particularly for filters that result in a large number of transactions.

Instead, this allows indexer catchup to be split into multiple polls, each with a transactionally consistent boundary based on the number of rounds specified here.

Inherited from

CoreTransactionSubscriptionParams.maxIndexerRoundsToSync

Defined in

src/types/subscription.ts:280


maxRoundsToSync

Optional maxRoundsToSync: number

The maximum number of rounds to sync from algod for each subscription pull/poll.

Defaults to 500.

This gives you control over how many rounds you wait for at a time, your staleness tolerance when using skip-sync-newest or fail, and your catchup speed when using sync-oldest.

Inherited from

CoreTransactionSubscriptionParams.maxRoundsToSync

Defined in

src/types/subscription.ts:269


syncBehaviour

syncBehaviour: "skip-sync-newest" | "sync-oldest" | "sync-oldest-start-now" | "catchup-with-indexer" | "fail"

If the current tip of the configured Algorand blockchain is more than maxRoundsToSync past watermark then how should that be handled:

Inherited from

CoreTransactionSubscriptionParams.syncBehaviour

Defined in

src/types/subscription.ts:298


watermark

watermark: bigint

The current round watermark that transactions have previously been synced to.

Persist this value as you process transactions processed from this method to allow for resilient and incremental syncing.

Syncing will start from watermark + 1.

Start from 0 if you want to start from the beginning of time, noting that will be slow if onMaxRounds is sync-oldest.

Defined in

src/types/subscription.ts:377