Skip to content

@ecp.eth/sdk


@ecp.eth/sdk / comments / createDeleteCommentTypedData

Function: createDeleteCommentTypedData()

function createDeleteCommentTypedData(params): {
  domain: {
     chainId: number;
     name: "Ethereum Comments Protocol";
     verifyingContract: `0x${string}`;
     version: "1";
  };
  message: {
     app: `0x${string}`;
     author: `0x${string}`;
     commentId: `0x${string}`;
     deadline: bigint;
  };
  primaryType: "DeleteComment";
  types: {
     DeleteComment: (
        | {
        name: "commentId";
        type: "bytes32";
      }
        | {
        name: "author";
        type: "address";
      }
        | {
        name: "app";
        type: "address";
      }
        | {
        name: "deadline";
        type: "uint256";
     })[];
  };
};

Defined in: packages/sdk/src/comments/comment.ts:634

Create the EIP-712 typed data structure for deleting comment

The comment won't be really deleted because of the nature of the blockchain. The purpose of this is to mark comment as deleted so indexers can do their logic for deletions.

Parameters

params

CreateDeleteCommentTypedDataParams

Returns

{
  domain: {
     chainId: number;
     name: "Ethereum Comments Protocol";
     verifyingContract: `0x${string}`;
     version: "1";
  };
  message: {
     app: `0x${string}`;
     author: `0x${string}`;
     commentId: `0x${string}`;
     deadline: bigint;
  };
  primaryType: "DeleteComment";
  types: {
     DeleteComment: (
        | {
        name: "commentId";
        type: "bytes32";
      }
        | {
        name: "author";
        type: "address";
      }
        | {
        name: "app";
        type: "address";
      }
        | {
        name: "deadline";
        type: "uint256";
     })[];
  };
}

The typed data

domain

domain: {
  chainId: number;
  name: "Ethereum Comments Protocol";
  verifyingContract: `0x${string}`;
  version: "1";
};

domain.chainId

chainId: number;

domain.name

name: "Ethereum Comments Protocol";

domain.verifyingContract

verifyingContract: `0x${string}` = HexSchema;

domain.version

version: "1";

message

message: {
  app: `0x${string}`;
  author: `0x${string}`;
  commentId: `0x${string}`;
  deadline: bigint;
};

message.app

app: `0x${string}` = HexSchema;

message.author

author: `0x${string}` = HexSchema;

message.commentId

commentId: `0x${string}` = HexSchema;

message.deadline

deadline: bigint;

primaryType

primaryType: "DeleteComment";

types

types: {
  DeleteComment: (
     | {
     name: "commentId";
     type: "bytes32";
   }
     | {
     name: "author";
     type: "address";
   }
     | {
     name: "app";
     type: "address";
   }
     | {
     name: "deadline";
     type: "uint256";
  })[];
};

types.DeleteComment

DeleteComment: (
  | {
  name: "commentId";
  type: "bytes32";
}
  | {
  name: "author";
  type: "address";
}
  | {
  name: "app";
  type: "address";
}
  | {
  name: "deadline";
  type: "uint256";
})[];