Class: Feed

Feed

A single action feed or transaction feed that can be consumed. More info: https://dashboard.seq.com/docs/feeds


new Feed(data, client)

Creates a new feed consumer.

Parameters:
Name Type Description
data Object

API response for a creation/retrieval of a feed.

client Client

Chain Client.

Properties:
Name Type Description
id String

Unique identifier of the feed.

type String

Type of feed, "action" or "transaction".

filter String

The query filter used to select matching items.

filterParams Array.<(string|number)>

A list of values that will be interpolated into the filter expression.

Methods


ack()

Ack ("acknowledge") saves a feed's position so that a future call to next picks up where the last one left off. Without ack, some of the same items may be redelivered by the feed. The feed does its own internal acks from time to time.


next()

Retrieve the next feed result, if available. This method satisfies the async iterator interface.

Returns:

a { value: item } tuple.

Type
Object
Example

Example usage.

const feed = await ledger.feeds.get(id: 'my-feed')
for await (const action of feed) {
  console.log("action id: " + action.id)
}

See https://github.com/tc39/proposal-async-iteration for more
information about async iterators.