Skip to content

@ecp.eth/sdk


@ecp.eth/sdk / indexer / FetchCommentRepliesOptions

Type Alias: FetchCommentRepliesOptions

type FetchCommentRepliesOptions = {
  apiUrl?: string;
  app?: Hex;
  chainId: number | number[];
  channelId?: bigint;
  commentId: Hex;
  commentType?: number;
  cursor?: Hex;
  excludeByModerationLabels?: IndexerAPIModerationClassificationLabelSchemaType[];
  isReplyDeleted?: boolean;
  limit?: number;
  mode?: IndexerAPICommentListModeSchemaType;
  moderationScore?: number;
  moderationStatus?:   | IndexerAPICommentModerationStatusSchemaType
     | IndexerAPICommentModerationStatusSchemaType[];
  retries?: number;
  signal?: AbortSignal;
  sort?: IndexerAPISortSchemaType;
  viewer?: Hex;
};

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

The options for fetchCommentReplies()

Properties

apiUrl?

optional apiUrl: string;

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

URL on which /api/comments/$commentId/replies endpoint will be called

Default

"https://api.ethcomments.xyz"

app?

optional app: Hex;

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

Filters to only comments sent using this app signer key.


chainId

chainId: number | number[];

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

Filter replies by chain ID(s)


channelId?

optional channelId: bigint;

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

Filter replies by channel ID


commentId

commentId: Hex;

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

The ID of the comment to fetch replies for


commentType?

optional commentType: number;

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

Filter replies by comment type


cursor?

optional cursor: Hex;

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

The cursor to fetch comments from


excludeByModerationLabels?

optional excludeByModerationLabels: IndexerAPIModerationClassificationLabelSchemaType[];

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

Filter replies by moderation labels.

Only comments with moderation labels not included in the provided array are returned. This can be used to bypass premoderation, make sure to pass all moderation statuses to moderationStatus parameter if the premoderation is enabled.


isReplyDeleted?

optional isReplyDeleted: boolean;

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

Whether to return only deleted replies or only undeleted replies. If omitted it will return both deleted and undeleted replies.


limit?

optional limit: number;

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

Default

50

mode?

optional mode: IndexerAPICommentListModeSchemaType;

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

The mode to fetch replies, by default it returns only the first level of replies.

  • "flat" mode returns all replies (no matter the nesting level) sorted by timestamp in descending order.
  • "nested" mode returns only the first level of replies sorted by timestamp in descending order.

Default

"nested"

moderationScore?

optional moderationScore: number;

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

Filter replies by moderation score.

Only comments with moderation score lower or equal to the provided value are returned. This can be used to bypass premoderation, make sure to pass all moderation statuses to moderationStatus parameter if the premoderation is enabled.


moderationStatus?

optional moderationStatus: 
  | IndexerAPICommentModerationStatusSchemaType
  | IndexerAPICommentModerationStatusSchemaType[];

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

Filter replies by moderation status.

By default API returns only approved comments if moderation is enabled for all comments except when the viewer is provided, for viewer it returns all comments regardless of status.

If moderation is disabled, this parameter is ignored.


retries?

optional retries: number;

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

Number of times to retry the signing operation in case of failure.

Default

3

signal?

optional signal: AbortSignal;

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


sort?

optional sort: IndexerAPISortSchemaType;

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

Default

"desc"

viewer?

optional viewer: Hex;

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

The viewer's address. This is useful when the content moderation is enabled on the indexer.