Interface NDKSubscriptionOptions

Hierarchy

  • NDKSubscriptionOptions

Properties

closeOnEose?: boolean

Whether to close the subscription when all relays have reached the end of the event stream.

Default

false
groupable?: boolean

Groupable subscriptions are created with a slight time delayed to allow similar filters to be grouped together.

groupableDelay?: number

The delay to use when grouping subscriptions, specified in milliseconds.

Default

100

Example

const sub1 = ndk.subscribe({ kinds: [1], authors: ["alice"] }, { groupableDelay: 100 });
const sub2 = ndk.subscribe({ kinds: [0], authors: ["alice"] }, { groupableDelay: 1000 });
// sub1 and sub2 will be grouped together and executed 100ms after sub1 was created
groupableDelayType?: "at-least" | "at-most"

Specifies how this delay should be interpreted. "at-least" means "wait at least this long before sending the subscription" "at-most" means "wait at most this long before sending the subscription"

Default

"at-most"

Example

const sub1 = ndk.subscribe({ kinds: [1], authors: ["alice"] }, { groupableDelay: 100, groupableDelayType: "at-least" });
const sub2 = ndk.subscribe({ kinds: [0], authors: ["alice"] }, { groupableDelay: 1000, groupableDelayType: "at-most" });
// sub1 and sub2 will be grouped together and executed 1000ms after sub1 was created
pool?: NDKPool

Pool to use

skipValidation?: boolean

Skip event validation

Default

false
skipVerification?: boolean

Skip signature verification

Default

false
subId?: string

The subscription ID to use for the subscription.

Generated using TypeDoc