Skip to content

@ecp.eth/sdk


@ecp.eth/sdk / indexer / FetchNotificationsOptions

Type Alias: FetchNotificationsOptions

type FetchNotificationsOptions = {
  after?: string;
  apiUrl?: string;
  app?:   | Hex
     | Hex[];
  appSecretKey: string;
  before?: string;
  limit?: number;
  parentId?: Hex;
  retries?: number;
  seen?: boolean;
  signal?: AbortSignal;
  type?:   | IndexerAPINotificationTypeSchemaType
     | IndexerAPINotificationTypeSchemaType[];
  user: Hex | string;
};

Defined in: packages/sdk/src/indexer/api.ts:1211

The options for fetchNotifications()

Properties

after?

optional after: string;

Defined in: packages/sdk/src/indexer/api.ts:1244

After cursor to fetch notifications from (older notifications)


apiUrl?

optional apiUrl: string;

Defined in: packages/sdk/src/indexer/api.ts:1217

URL on which /api/notifications endpoint will be called

Default

"https://api.ethcomments.xyz"

app?

optional app: 
  | Hex
  | Hex[];

Defined in: packages/sdk/src/indexer/api.ts:1230

The app signers to fetch notifications for


appSecretKey

appSecretKey: string;

Defined in: packages/sdk/src/indexer/api.ts:1222

App secret key to authenticate the request. Can be found in the https://dashboard.ethcomments.xyz after creating an app.


before?

optional before: string;

Defined in: packages/sdk/src/indexer/api.ts:1240

Before cursor to fetch notifications from (newer notifications)


limit?

optional limit: number;

Defined in: packages/sdk/src/indexer/api.ts:1260

The number of notifications to fetch

Default

10

parentId?

optional parentId: Hex;

Defined in: packages/sdk/src/indexer/api.ts:1248

Fetch notifications for a specific parent id


retries?

optional retries: number;

Defined in: packages/sdk/src/indexer/api.ts:1266

Number of times to retry the request in case of failure (non‑parsing/network errors).

Default

3

seen?

optional seen: boolean;

Defined in: packages/sdk/src/indexer/api.ts:1254

Whether to fetch only seen or unseen notifications

Default

undefined - fetches all notifications

signal?

optional signal: AbortSignal;

Defined in: packages/sdk/src/indexer/api.ts:1270

The signal to abort the request


type?

optional type: 
  | IndexerAPINotificationTypeSchemaType
  | IndexerAPINotificationTypeSchemaType[];

Defined in: packages/sdk/src/indexer/api.ts:1234

The types of notifications to fetch


user

user: Hex | string;

Defined in: packages/sdk/src/indexer/api.ts:1226

The user to fetch notifications for, either ETH address or ENS name