Skip to content

@ecp.eth/sdk


@ecp.eth/sdk / indexer/webhooks / CommentEventsSchema

Variable: CommentEventsSchema

const CommentEventsSchema: ZodDiscriminatedUnion<"event", [ZodObject<{
  data: ZodObject<{
     comment: ZodDiscriminatedUnion<"type", [ZodObject<... & ..., "strip", ZodTypeAny, {
        app: ...;
        author: ...;
        channelId: ...;
        commentType: ...;
        content: ...;
        createdAt: ...;
        id: ...;
        metadata: ...;
        moderationStatus: ...;
        references: ...;
        targetUri: ...;
        type: ...;
        updatedAt: ...;
      }, {
        app: ...;
        author: ...;
        channelId: ...;
        commentType: ...;
        content: ...;
        createdAt: ...;
        id: ...;
        metadata: ...;
        moderationStatus: ...;
        references: ...;
        targetUri: ...;
        type: ...;
        updatedAt: ...;
      }>, ZodObject<... & ..., "strip", ZodTypeAny, {
        app: ...;
        author: ...;
        channelId: ...;
        commentType: ...;
        content: ...;
        createdAt: ...;
        id: ...;
        metadata: ...;
        moderationStatus: ...;
        parentId: ...;
        references: ...;
        type: ...;
        updatedAt: ...;
      }, {
        app: ...;
        author: ...;
        channelId: ...;
        commentType: ...;
        content: ...;
        createdAt: ...;
        id: ...;
        metadata: ...;
        moderationStatus: ...;
        parentId: ...;
        references: ...;
        type: ...;
        updatedAt: ...;
     }>]>;
     zeroExSwap: ZodNullable<ZodObject<{
        from: ZodObject<..., ..., ..., ..., ...>;
        to: ZodObject<..., ..., ..., ..., ...>;
      }, "strip", ZodTypeAny, {
        from: {
           address: ...;
           amount: ...;
           symbol: ...;
        };
        to: {
           address: ...;
           amount: ...;
           symbol: ...;
        };
      }, {
        from: {
           address: ...;
           amount: ...;
           symbol: ...;
        };
        to: {
           address: ...;
           amount: ...;
           symbol: ...;
        };
     }>>;
   }, "strip", ZodTypeAny, {
     comment:   | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: bigint;
        commentType: number;
        content: string;
        createdAt: Date;
        id: `0x${string}`;
        metadata: {
           key: ...;
           value: ...;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        references: (... | ... | ... | ... | ... | ... | ... | ...)[];
        targetUri: string;
        type: "root";
        updatedAt: Date;
      }
        | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: bigint;
        commentType: number;
        content: string;
        createdAt: Date;
        id: `0x${string}`;
        metadata: {
           key: ...;
           value: ...;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        parentId: `0x${string}`;
        references: (... | ... | ... | ... | ... | ... | ... | ...)[];
        type: "reply";
        updatedAt: Date;
      };
     zeroExSwap:   | null
        | {
        from: {
           address: `0x${(...)}`;
           amount: string;
           symbol: string;
        };
        to: {
           address: ... | ...;
           amount: string;
           symbol: string;
        };
      };
   }, {
     comment:   | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: string;
        commentType: number;
        content: string;
        createdAt: string;
        id: `0x${string}`;
        metadata: {
           key: ...;
           value: ...;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        references: (... | ... | ... | ... | ... | ... | ... | ...)[];
        targetUri: string;
        type: "root";
        updatedAt: string;
      }
        | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: string;
        commentType: number;
        content: string;
        createdAt: string;
        id: `0x${string}`;
        metadata: {
           key: ...;
           value: ...;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        parentId: `0x${string}`;
        references: (... | ... | ... | ... | ... | ... | ... | ...)[];
        type: "reply";
        updatedAt: string;
      };
     zeroExSwap:   | null
        | {
        from: {
           address: `0x${(...)}`;
           amount: string;
           symbol: string;
        };
        to: {
           address: ... | ...;
           amount: string;
           symbol: string;
        };
      };
  }>;
  event: ZodLiteral<"comment:added">;
} & {
  uid: ZodString;
  version: ZodLiteral<1>;
} & {
  blockNumber: ZodEffects<ZodString, bigint, string>;
  chainId: ZodNumber;
  logIndex: ZodNumber;
  txHash: ZodEffects<ZodString, `0x${string}`, `0x${string}`>;
}, "strip", ZodTypeAny, {
  blockNumber: bigint;
  chainId: number;
  data: {
     comment:   | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: bigint;
        commentType: number;
        content: string;
        createdAt: Date;
        id: `0x${string}`;
        metadata: {
           key: `0x${string}`;
           value: `0x${string}`;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        references: (
           | {
           address: `0x${(...)}`;
           avatarUrl: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "ens";
           url: string;
         }
           | {
           address: `0x${(...)}`;
           displayName: ... | ...;
           fid: number;
           fname: string;
           pfpUrl: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           type: "farcaster";
           url: string;
           username: string;
         }
           | {
           address: `0x${(...)}`;
           chainId: ... | ...;
           chains: ...[];
           decimals: number;
           logoURI: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           symbol: string;
           type: "erc20";
         }
           | {
           description: ... | ...;
           favicon: ... | ...;
           mediaType: string;
           opengraph: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           title: string;
           type: "webpage";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "file";
           url: string;
         }
           | {
           dimension?: ... | ...;
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "image";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "video";
           url: string;
           videoTracks?: ... | ...;
         }
           | {
           chainId: number;
           id: `0x${(...)}`;
           position: {
              end: ...;
              start: ...;
           };
           type: "quoted_comment";
        })[];
        targetUri: string;
        type: "root";
        updatedAt: Date;
      }
        | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: bigint;
        commentType: number;
        content: string;
        createdAt: Date;
        id: `0x${string}`;
        metadata: {
           key: `0x${string}`;
           value: `0x${string}`;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        parentId: `0x${string}`;
        references: (
           | {
           address: `0x${(...)}`;
           avatarUrl: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "ens";
           url: string;
         }
           | {
           address: `0x${(...)}`;
           displayName: ... | ...;
           fid: number;
           fname: string;
           pfpUrl: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           type: "farcaster";
           url: string;
           username: string;
         }
           | {
           address: `0x${(...)}`;
           chainId: ... | ...;
           chains: ...[];
           decimals: number;
           logoURI: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           symbol: string;
           type: "erc20";
         }
           | {
           description: ... | ...;
           favicon: ... | ...;
           mediaType: string;
           opengraph: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           title: string;
           type: "webpage";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "file";
           url: string;
         }
           | {
           dimension?: ... | ...;
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "image";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "video";
           url: string;
           videoTracks?: ... | ...;
         }
           | {
           chainId: number;
           id: `0x${(...)}`;
           position: {
              end: ...;
              start: ...;
           };
           type: "quoted_comment";
        })[];
        type: "reply";
        updatedAt: Date;
      };
     zeroExSwap:   | null
        | {
        from: {
           address: `0x${string}`;
           amount: string;
           symbol: string;
        };
        to: {
           address: "" | `0x${string}`;
           amount: string;
           symbol: string;
        };
      };
  };
  event: "comment:added";
  logIndex: number;
  txHash: `0x${string}`;
  uid: string;
  version: 1;
}, {
  blockNumber: string;
  chainId: number;
  data: {
     comment:   | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: string;
        commentType: number;
        content: string;
        createdAt: string;
        id: `0x${string}`;
        metadata: {
           key: `0x${string}`;
           value: `0x${string}`;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        references: (
           | {
           address: `0x${(...)}`;
           avatarUrl: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "ens";
           url: string;
         }
           | {
           address: `0x${(...)}`;
           displayName: ... | ...;
           fid: number;
           fname: string;
           pfpUrl: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           type: "farcaster";
           url: string;
           username: string;
         }
           | {
           address: `0x${(...)}`;
           chainId: ... | ...;
           chains: ...[];
           decimals: number;
           logoURI: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           symbol: string;
           type: "erc20";
         }
           | {
           description: ... | ...;
           favicon: ... | ...;
           mediaType: string;
           opengraph: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           title: string;
           type: "webpage";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "file";
           url: string;
         }
           | {
           dimension?: ... | ...;
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "image";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "video";
           url: string;
           videoTracks?: ... | ...;
         }
           | {
           chainId: number;
           id: `0x${(...)}`;
           position: {
              end: ...;
              start: ...;
           };
           type: "quoted_comment";
        })[];
        targetUri: string;
        type: "root";
        updatedAt: string;
      }
        | {
        app: `0x${string}`;
        author: `0x${string}`;
        channelId: string;
        commentType: number;
        content: string;
        createdAt: string;
        id: `0x${string}`;
        metadata: {
           key: `0x${string}`;
           value: `0x${string}`;
        }[];
        moderationStatus: "approved" | "pending" | "rejected";
        parentId: `0x${string}`;
        references: (
           | {
           address: `0x${(...)}`;
           avatarUrl: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "ens";
           url: string;
         }
           | {
           address: `0x${(...)}`;
           displayName: ... | ...;
           fid: number;
           fname: string;
           pfpUrl: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           type: "farcaster";
           url: string;
           username: string;
         }
           | {
           address: `0x${(...)}`;
           chainId: ... | ...;
           chains: ...[];
           decimals: number;
           logoURI: ... | ...;
           name: string;
           position: {
              end: ...;
              start: ...;
           };
           symbol: string;
           type: "erc20";
         }
           | {
           description: ... | ...;
           favicon: ... | ...;
           mediaType: string;
           opengraph: ... | ...;
           position: {
              end: ...;
              start: ...;
           };
           title: string;
           type: "webpage";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "file";
           url: string;
         }
           | {
           dimension?: ... | ...;
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "image";
           url: string;
         }
           | {
           mediaType: string;
           position: {
              end: ...;
              start: ...;
           };
           type: "video";
           url: string;
           videoTracks?: ... | ...;
         }
           | {
           chainId: number;
           id: `0x${(...)}`;
           position: {
              end: ...;
              start: ...;
           };
           type: "quoted_comment";
        })[];
        type: "reply";
        updatedAt: string;
      };
     zeroExSwap:   | null
        | {
        from: {
           address: `0x${string}`;
           amount: string;
           symbol: string;
        };
        to: {
           address: "" | `0x${string}`;
           amount: string;
           symbol: string;
        };
      };
  };
  event: "comment:added";
  logIndex: number;
  txHash: `0x${string}`;
  uid: string;
  version: 1;
}>, ZodObject<{
  data: ZodObject<{
     comment: ZodObject<{
        hookMetadata: ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">;
        id: ZodEffects<ZodString, `0x${(...)}`, `0x${(...)}`>;
        updatedAt: ZodEffects<ZodString, Date, string>;
      }, "strip", ZodTypeAny, {
        hookMetadata: {
           key: ...;
           value: ...;
        }[];
        id: `0x${string}`;
        updatedAt: Date;
      }, {
        hookMetadata: {
           key: ...;
           value: ...;
        }[];
        id: `0x${string}`;
        updatedAt: string;
     }>;
     hookMetadataOperation: ZodDiscriminatedUnion<"type", [ZodObject<{
        key: ...;
        type: ...;
      }, "strip", ZodTypeAny, {
        key: ...;
        type: ...;
      }, {
        key: ...;
        type: ...;
      }>, ZodObject<{
        key: ...;
        type: ...;
        value: ...;
      }, "strip", ZodTypeAny, {
        key: ...;
        type: ...;
        value: ...;
      }, {
        key: ...;
        type: ...;
        value: ...;
      }>, ZodObject<{
        key: ...;
        type: ...;
        value: ...;
      }, "strip", ZodTypeAny, {
        key: ...;
        type: ...;
        value: ...;
      }, {
        key: ...;
        type: ...;
        value: ...;
     }>]>;
   }, "strip", ZodTypeAny, {
     comment: {
        hookMetadata: {
           key: `0x${(...)}`;
           value: `0x${(...)}`;
        }[];
        id: `0x${string}`;
        updatedAt: Date;
     };
     hookMetadataOperation:   | {
        key: `0x${string}`;
        type: "delete";
      }
        | {
        key: `0x${string}`;
        type: "create";
        value: `0x${string}`;
      }
        | {
        key: `0x${string}`;
        type: "update";
        value: `0x${string}`;
      };
   }, {
     comment: {
        hookMetadata: {
           key: `0x${(...)}`;
           value: `0x${(...)}`;
        }[];
        id: `0x${string}`;
        updatedAt: string;
     };
     hookMetadataOperation:   | {
        key: `0x${string}`;
        type: "delete";
      }
        | {
        key: `0x${string}`;
        type: "create";
        value: `0x${string}`;
      }
        | {
        key: `0x${string}`;
        type: "update";
        value: `0x${string}`;
      };
  }>;
  event: ZodLiteral<"comment:hook:metadata:set">;
} & {
  uid: ZodString;
  version: ZodLiteral<1>;
} & {
  blockNumber: ZodEffects<ZodString, bigint, string>;
  chainId: ZodNumber;
  logIndex: ZodNumber;
  txHash: ZodEffects<ZodString, `0x${string}`, `0x${string}`>;
}, "strip", ZodTypeAny, {
  blockNumber: bigint;
  chainId: number;
  data: {
     comment: {
        hookMetadata: {
           key: `0x${string}`;
           value: `0x${string}`;
        }[];
        id: `0x${string}`;
        updatedAt: Date;
     };
     hookMetadataOperation:   | {
        key: `0x${string}`;
        type: "delete";
      }
        | {
        key: `0x${string}`;
        type: "create";
        value: `0x${string}`;
      }
        | {
        key: `0x${string}`;
        type: "update";
        value: `0x${string}`;
      };
  };
  event: "comment:hook:metadata:set";
  logIndex: number;
  txHash: `0x${string}`;
  uid: string;
  version: 1;
}, {
  blockNumber: string;
  chainId: number;
  data: {
     comment: {
        hookMetadata: {
           key: `0x${string}`;
           value: `0x${string}`;
        }[];
        id: `0x${string}`;
        updatedAt: string;
     };
     hookMetadataOperation:   | {
        key: `0x${string}`;
        type: "delete";
      }
        | {
        key: `0x${string}`;
        type: "create";
        value: `0x${string}`;
      }
        | {
        key: `0x${string}`;
        type: "update";
        value: `0x${string}`;
      };
  };
  event: "comment:hook:metadata:set";
  logIndex: number;
  txHash: `0x${string}`;
  uid: string;
  version: 1;
}>, ZodObject<{
  data: ZodObject<{
     comment: ZodObject<{
        deletedAt: ZodEffects<ZodString, Date, string>;
        id: ZodEffects<ZodString, `0x${(...)}`, `0x${(...)}`>;
        updatedAt: ZodEffects<ZodString, Date, string>;
      }, "strip", ZodTypeAny, {
        deletedAt: Date;
        id: `0x${string}`;
        updatedAt: Date;
      }, {
        deletedAt: string;
        id: `0x${string}`;
        updatedAt: string;
     }>;
   }, "strip", ZodTypeAny, {
     comment: {
        deletedAt: Date;
        id: `0x${string}`;
        updatedAt: Date;
     };
   }, {
     comment: {
        deletedAt: string;
        id: `0x${string}`;
        updatedAt: string;
     };
  }>;
  event: ZodLiteral<"comment:deleted">;
} & {
  uid: ZodString;
  version: ZodLiteral<1>;
} & {
  blockNumber: ZodEffects<ZodString, bigint, string>;
  chainId: ZodNumber;
  logIndex: ZodNumber;
  txHash: ZodEffects<ZodString, `0x${string}`, `0x${string}`>;
}, "strip", ZodTypeAny, {
  blockNumber: bigint;
  chainId: number;
  data: {
     comment: {
        deletedAt: Date;
        id: `0x${string}`;
        updatedAt: Date;
     };
  };
  event: "comment:deleted";
  logIndex: number;
  txHash: `0x${string}`;
  uid: string;
  version: 1;
}, {
  blockNumber: string;
  chainId: number;
  data: {
     comment: {
        deletedAt: string;
        id: `0x${string}`;
        updatedAt: string;
     };
  };
  event: "comment:deleted";
  logIndex: number;
  txHash: `0x${string}`;
  uid: string;
  version: 1;
}>]>;

Defined in: packages/sdk/src/indexer/webhooks/schemas/comment.ts:347

Comment events schema.