import { CommentPageSchemaType, ListCommentsQueryPageParamsSchemaType, PendingDeleteCommentOperationSchemaType, PendingPostCommentOperationSchemaType, PendingCommentOperationSchemaType, PendingEditCommentOperationSchemaType, Comment } from './schemas.cjs'; import * as _ecp_eth_sdk_indexer from '@ecp.eth/sdk/indexer'; import { IndexerAPIListCommentsSchemaType, IndexerAPIExtraSchemaType } from '@ecp.eth/sdk/indexer'; import { InfiniteData } from '@tanstack/react-query'; import { ClassValue } from 'clsx'; import { Hex, Chain, ContractFunctionExecutionError } from 'viem'; import { AuthorType, ProcessEnvNetwork } from './types.cjs'; import { z } from 'zod/v3'; import { CommentDataWithIdSchemaType } from '@ecp.eth/shared-signer/schemas/signer-api/shared'; import '@ecp.eth/sdk/indexer/schemas'; declare function cn(...inputs: ClassValue[]): string; declare function isSameHex(a: Hex, b: Hex): boolean; declare function getCommentAuthorNameOrAddress(author: AuthorType): string; declare function hasNewComments(oldQueryData: InfiniteData, newCommentsPage: IndexerAPIListCommentsSchemaType): boolean; /** * Mark a comment as deleting by setting the `pendingOperation` field to a pending delete operation * * This function mutates the queryData argument */ declare function markCommentAsDeleting(queryData: InfiniteData, pendingOperation: PendingDeleteCommentOperationSchemaType): InfiniteData; /** * Mark a comment's pending delete operation as failed * * This function mutates the queryData argument */ declare function markCommentDeletionAsFailed(queryData: InfiniteData, commentId: Hex, error: Error): InfiniteData; /** * Insert a pending comment to the first page of the query data * * This function mutates the queryData argument * */ declare function insertPendingCommentToPage(queryData: InfiniteData, pendingOperation: PendingPostCommentOperationSchemaType): InfiniteData; declare function getModerationStatus(extra: IndexerAPIExtraSchemaType, comment: Pick): "pending" | "approved"; /** * Mark a comment's pending post operation as pending * * This function mutates the queryData argument */ declare function markCommentAsReposting(queryData: InfiniteData, pendingOperation: PendingPostCommentOperationSchemaType): InfiniteData; /** * Mark a pending post comment as failed * * This function mutates the queryData argument */ declare function markPendingPostCommentAsFailed(queryData: InfiniteData, commentId: Hex, error: Error): InfiniteData; /** * Mark a pending post comment as posted * * This function mutates the queryData argument */ declare function markPendingPostCommentAsPosted(queryData: InfiniteData, commentId: Hex): InfiniteData<{ extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: { content: string; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; path: string; txHash: `0x${string}`; chainId: number; zeroExSwap: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | null; replies: { extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & { pendingOperation?: PendingCommentOperationSchemaType; replies: { extra: IndexerAPIExtraSchemaType; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & /*elided*/ any)[]; pagination: _ecp_eth_sdk_indexer.IndexerAPICursorRepliesPaginationSchemaType; }; })[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; count: number; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }; commentType: number; app: `0x${string}`; author: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; }; id: `0x${string}`; channelId: bigint; deletedAt: Date | null; logIndex: number | null; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; hookMetadata: { value: `0x${string}`; key: `0x${string}`; }[]; parentId: `0x${string}` | null; targetUri: string; cursor: `0x${string}`; moderationStatus: "pending" | "approved" | "rejected"; moderationStatusChangedAt: Date; moderationClassifierResult: Record; moderationClassifierScore: number; createdAt: Date; updatedAt: Date; revision: number; viewerReactions: Record; reactionCounts: Record; pendingOperation?: { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "post"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { author: `0x${string}`; app: `0x${string}`; deadline: bigint; id: `0x${string}`; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; content: string; commentType: number; channelId: bigint; parentId: `0x${string}`; targetUri: string; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; resolvedAuthor?: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; } | undefined; zeroExSwap?: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | undefined; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "edit"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { nonce: bigint; app: `0x${string}`; deadline: bigint; commentId: `0x${string}`; content: string; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; action: "delete"; txHash: `0x${string}`; chainId: number; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; commentId: `0x${string}`; } | undefined; }[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }, { limit: number; cursor?: `0x${string}` | undefined; }>; /** * Mark a comment as re-editing by setting the `pendingOperation` field to a pending edit operation * * This function mutates the queryData argument */ declare function markCommentAsReediting(queryData: InfiniteData, pendingOperation: PendingEditCommentOperationSchemaType): InfiniteData<{ extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: { content: string; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; path: string; txHash: `0x${string}`; chainId: number; zeroExSwap: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | null; replies: { extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & { pendingOperation?: PendingCommentOperationSchemaType; replies: { extra: IndexerAPIExtraSchemaType; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & /*elided*/ any)[]; pagination: _ecp_eth_sdk_indexer.IndexerAPICursorRepliesPaginationSchemaType; }; })[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; count: number; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }; commentType: number; app: `0x${string}`; author: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; }; id: `0x${string}`; channelId: bigint; deletedAt: Date | null; logIndex: number | null; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; hookMetadata: { value: `0x${string}`; key: `0x${string}`; }[]; parentId: `0x${string}` | null; targetUri: string; cursor: `0x${string}`; moderationStatus: "pending" | "approved" | "rejected"; moderationStatusChangedAt: Date; moderationClassifierResult: Record; moderationClassifierScore: number; createdAt: Date; updatedAt: Date; revision: number; viewerReactions: Record; reactionCounts: Record; pendingOperation?: { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "post"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { author: `0x${string}`; app: `0x${string}`; deadline: bigint; id: `0x${string}`; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; content: string; commentType: number; channelId: bigint; parentId: `0x${string}`; targetUri: string; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; resolvedAuthor?: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; } | undefined; zeroExSwap?: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | undefined; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "edit"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { nonce: bigint; app: `0x${string}`; deadline: bigint; commentId: `0x${string}`; content: string; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; action: "delete"; txHash: `0x${string}`; chainId: number; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; commentId: `0x${string}`; } | undefined; }[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }, { limit: number; cursor?: `0x${string}` | undefined; }>; /** * Mark a pending edit comment as pending * * This function mutates the queryData argument */ declare function markPendingEditCommentAsPending(queryData: InfiniteData, pendingOperation: PendingEditCommentOperationSchemaType): InfiniteData<{ extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: { content: string; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; path: string; txHash: `0x${string}`; chainId: number; zeroExSwap: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | null; replies: { extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & { pendingOperation?: PendingCommentOperationSchemaType; replies: { extra: IndexerAPIExtraSchemaType; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & /*elided*/ any)[]; pagination: _ecp_eth_sdk_indexer.IndexerAPICursorRepliesPaginationSchemaType; }; })[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; count: number; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }; commentType: number; app: `0x${string}`; author: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; }; id: `0x${string}`; channelId: bigint; deletedAt: Date | null; logIndex: number | null; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; hookMetadata: { value: `0x${string}`; key: `0x${string}`; }[]; parentId: `0x${string}` | null; targetUri: string; cursor: `0x${string}`; moderationStatus: "pending" | "approved" | "rejected"; moderationStatusChangedAt: Date; moderationClassifierResult: Record; moderationClassifierScore: number; createdAt: Date; updatedAt: Date; revision: number; viewerReactions: Record; reactionCounts: Record; pendingOperation?: { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "post"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { author: `0x${string}`; app: `0x${string}`; deadline: bigint; id: `0x${string}`; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; content: string; commentType: number; channelId: bigint; parentId: `0x${string}`; targetUri: string; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; resolvedAuthor?: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; } | undefined; zeroExSwap?: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | undefined; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "edit"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { nonce: bigint; app: `0x${string}`; deadline: bigint; commentId: `0x${string}`; content: string; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; action: "delete"; txHash: `0x${string}`; chainId: number; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; commentId: `0x${string}`; } | undefined; }[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }, { limit: number; cursor?: `0x${string}` | undefined; }>; /** * Mark a pending edit comment as failed * * This function mutates the queryData argument */ declare function markPendingEditCommentAsFailed(queryData: InfiniteData, commentId: Hex, error: Error): InfiniteData<{ extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: { content: string; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; path: string; txHash: `0x${string}`; chainId: number; zeroExSwap: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | null; replies: { extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & { pendingOperation?: PendingCommentOperationSchemaType; replies: { extra: IndexerAPIExtraSchemaType; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & /*elided*/ any)[]; pagination: _ecp_eth_sdk_indexer.IndexerAPICursorRepliesPaginationSchemaType; }; })[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; count: number; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }; commentType: number; app: `0x${string}`; author: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; }; id: `0x${string}`; channelId: bigint; deletedAt: Date | null; logIndex: number | null; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; hookMetadata: { value: `0x${string}`; key: `0x${string}`; }[]; parentId: `0x${string}` | null; targetUri: string; cursor: `0x${string}`; moderationStatus: "pending" | "approved" | "rejected"; moderationStatusChangedAt: Date; moderationClassifierResult: Record; moderationClassifierScore: number; createdAt: Date; updatedAt: Date; revision: number; viewerReactions: Record; reactionCounts: Record; pendingOperation?: { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "post"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { author: `0x${string}`; app: `0x${string}`; deadline: bigint; id: `0x${string}`; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; content: string; commentType: number; channelId: bigint; parentId: `0x${string}`; targetUri: string; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; resolvedAuthor?: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; } | undefined; zeroExSwap?: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | undefined; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "edit"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { nonce: bigint; app: `0x${string}`; deadline: bigint; commentId: `0x${string}`; content: string; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; action: "delete"; txHash: `0x${string}`; chainId: number; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; commentId: `0x${string}`; } | undefined; }[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }, { limit: number; cursor?: `0x${string}` | undefined; }>; /** * Mark a pending edit comment as edited * * This function mutates the queryData argument */ declare function markPendingEditCommentAsEdited(queryData: InfiniteData, commentId: Hex): InfiniteData<{ extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: { content: string; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; path: string; txHash: `0x${string}`; chainId: number; zeroExSwap: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | null; replies: { extra: { moderationEnabled: boolean; moderationKnownReactions: string[]; }; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & { pendingOperation?: PendingCommentOperationSchemaType; replies: { extra: IndexerAPIExtraSchemaType; results: (Omit<_ecp_eth_sdk_indexer.IndexerAPICommentSchemaType, "replies"> & /*elided*/ any)[]; pagination: _ecp_eth_sdk_indexer.IndexerAPICursorRepliesPaginationSchemaType; }; })[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; count: number; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }; commentType: number; app: `0x${string}`; author: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; }; id: `0x${string}`; channelId: bigint; deletedAt: Date | null; logIndex: number | null; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; hookMetadata: { value: `0x${string}`; key: `0x${string}`; }[]; parentId: `0x${string}` | null; targetUri: string; cursor: `0x${string}`; moderationStatus: "pending" | "approved" | "rejected"; moderationStatusChangedAt: Date; moderationClassifierResult: Record; moderationClassifierScore: number; createdAt: Date; updatedAt: Date; revision: number; viewerReactions: Record; reactionCounts: Record; pendingOperation?: { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "post"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { author: `0x${string}`; app: `0x${string}`; deadline: bigint; id: `0x${string}`; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; content: string; commentType: number; channelId: bigint; parentId: `0x${string}`; targetUri: string; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; resolvedAuthor?: { address: `0x${string}`; ens?: { name: string; avatarUrl: string | null; } | undefined; farcaster?: { fid: number; username: string; pfpUrl?: string | undefined; displayName?: string | undefined; } | undefined; } | undefined; zeroExSwap?: { from: { symbol: string; address: `0x${string}`; amount: string; }; to: { symbol: string; address: "" | `0x${string}`; amount: string; }; } | undefined; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; references: ({ type: "ens"; address: `0x${string}`; name: string; avatarUrl: string | null; position: { start: number; end: number; }; url: string; } | { symbol: string; type: "erc20"; chainId: number | null; address: `0x${string}`; name: string; position: { start: number; end: number; }; logoURI: string | null; decimals: number; chains: { chainId: number; caip: string; }[]; } | { type: "farcaster"; address: `0x${string}`; fid: number; pfpUrl: string | null; displayName: string | null; username: string; position: { start: number; end: number; }; url: string; fname: string; } | { type: "webpage"; position: { start: number; end: number; }; url: string; title: string; description: string | null; favicon: string | null; opengraph: { url: string; title: string; description: string | null; image: string; } | null; mediaType: string; } | { type: "file"; position: { start: number; end: number; }; url: string; mediaType: string; } | { type: "image"; position: { start: number; end: number; }; url: string; mediaType: string; dimension?: { width: number; height: number; } | undefined; } | { type: "video"; position: { start: number; end: number; }; url: string; mediaType: string; videoTracks?: { dimension: { width: number; height: number; }; codec?: string | undefined; }[] | undefined; } | { type: "quoted_comment"; chainId: number; id: `0x${string}`; position: { start: number; end: number; }; })[]; action: "edit"; txHash: `0x${string}`; chainId: number; response: { signature: `0x${string}`; hash: `0x${string}`; data: { nonce: bigint; app: `0x${string}`; deadline: bigint; commentId: `0x${string}`; content: string; metadata: { value: `0x${string}`; key: `0x${string}`; }[]; }; }; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; } | { type: "gasless-not-preapproved" | "gasless-preapproved" | "non-gasless"; action: "delete"; txHash: `0x${string}`; chainId: number; state: { status: "pending"; } | { status: "success"; } | { status: "error"; error: Error; }; commentId: `0x${string}`; } | undefined; }[]; pagination: { limit: number; hasNext: boolean; hasPrevious: boolean; startCursor?: `0x${string}` | undefined; endCursor?: `0x${string}` | undefined; }; }, { limit: number; cursor?: `0x${string}` | undefined; }>; /** * Mark a comment as deleted by setting the `deletedAt` field to the current date * and setting the `content` field to "[deleted]" * * This function mutates the queryData argument * * @param queryData * @param commentId * @returns */ declare function markCommentAsDeleted(queryData: InfiniteData, commentId: Hex): InfiniteData; /** * Create a markdown style quotation from a comment's content * * Example: * * > This is a comment * > * > It has multiple lines * * @param comment * @returns */ declare function createQuotationFromComment(comment: Comment): string; declare function abbreviateAddressForDisplay(address: string): string; declare function formatDate(timestamp: number | Date): string; declare function formatDateRelative(timestamp: number | Date, now: number): string; /** * Replaces bigint values with their string representation * usually used in JSON.stringify * @param key * @param value * @returns */ declare function bigintReplacer(key: string, value: unknown): unknown; /** * Format an author's link * * @param author * @returns */ declare function formatAuthorLinkWithTemplate(author: AuthorType, urlTemplate?: string): string | null; /** * Get a chain by id * @param id * @param chains * @returns */ declare function getChainById(id: number, chains: Readonly): TChain | undefined; /** * A typed json response */ declare class JSONResponse extends Response { private __outputType; constructor(parser: TSchema, data: z.input, init?: ResponseInit & { jsonReplacer?: (key: string, value: unknown) => unknown; }); } declare function getNetworkFromProcessEnv(prefix: string, processEnv: object): Record; declare function formatContractFunctionExecutionError(error: ContractFunctionExecutionError): string; declare function never(message?: string): never; export { JSONResponse, abbreviateAddressForDisplay, bigintReplacer, cn, createQuotationFromComment, formatAuthorLinkWithTemplate, formatContractFunctionExecutionError, formatDate, formatDateRelative, getChainById, getCommentAuthorNameOrAddress, getModerationStatus, getNetworkFromProcessEnv, hasNewComments, insertPendingCommentToPage, isSameHex, markCommentAsDeleted, markCommentAsDeleting, markCommentAsReediting, markCommentAsReposting, markCommentDeletionAsFailed, markPendingEditCommentAsEdited, markPendingEditCommentAsFailed, markPendingEditCommentAsPending, markPendingPostCommentAsFailed, markPendingPostCommentAsPosted, never };