Skip to content

@ecp.eth/sdk


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

Type Alias: ChannelMetadataSetEvent

type ChannelMetadataSetEvent = {
  blockNumber: bigint;
  chainId: number;
  data: {
     channel: {
        id: bigint;
        metadata: {
           key: `0x${string}`;
           value: `0x${string}`;
        }[];
        updatedAt: Date;
     };
     metadataOperation:   | {
        key: `0x${string}`;
        type: "delete";
      }
        | {
        key: `0x${string}`;
        type: "create";
        value: `0x${string}`;
      }
        | {
        key: `0x${string}`;
        type: "update";
        value: `0x${string}`;
      };
  };
  event: "channel:metadata:set";
  logIndex: number;
  txHash: `0x${string}`;
  uid: string;
  version: 1;
};

Defined in: packages/sdk/src/indexer/webhooks/schemas/channel.ts:224

An event sent to webhook when a channel metadata is set.

Type declaration

blockNumber

blockNumber: bigint = StringBigintSchema;

Block number. On wire it is a stringified bigint.

chainId

chainId: number;

Chain ID

data

data: {
  channel: {
     id: bigint;
     metadata: {
        key: `0x${string}`;
        value: `0x${string}`;
     }[];
     updatedAt: Date;
  };
  metadataOperation:   | {
     key: `0x${string}`;
     type: "delete";
   }
     | {
     key: `0x${string}`;
     type: "create";
     value: `0x${string}`;
   }
     | {
     key: `0x${string}`;
     type: "update";
     value: `0x${string}`;
   };
};

Data of the event

data.channel

channel: {
  id: bigint;
  metadata: {
     key: `0x${string}`;
     value: `0x${string}`;
  }[];
  updatedAt: Date;
};

Updated channel data

data.channel.id

id: bigint = StringBigintSchema;

ID of the channel

data.channel.metadata

metadata: {
  key: `0x${string}`;
  value: `0x${string}`;
}[] = MetadataArraySchema;

Metadata of the channel

data.channel.updatedAt

updatedAt: Date = ISO8601DateSchema;

Updated at date

data.metadataOperation

metadataOperation: 
  | {
  key: `0x${string}`;
  type: "delete";
}
  | {
  key: `0x${string}`;
  type: "create";
  value: `0x${string}`;
}
  | {
  key: `0x${string}`;
  type: "update";
  value: `0x${string}`;
} = MetadataSetOperationSchema;

Metadata operation

event

event: "channel:metadata:set";

Event type

logIndex

logIndex: number;

Log index

txHash

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

Transaction hash

uid

uid: string;

Unique identifier for the event. You can use it to deduplicate events. In case of retry attempts the id is the same.

version

version: 1;

Version of the event