diff --git a/packages/core/src/lib/waku_light_push/index.ts b/packages/core/src/lib/waku_light_push/index.ts index 60f202aede..2a4eb7db29 100644 --- a/packages/core/src/lib/waku_light_push/index.ts +++ b/packages/core/src/lib/waku_light_push/index.ts @@ -60,7 +60,7 @@ class WakuLightPush implements LightPush { async push( encoder: Encoder, - message: Partial, + message: Message, opts?: ProtocolOptions ): Promise { const pubSubTopic = opts?.pubSubTopic ? opts.pubSubTopic : this.pubSubTopic; diff --git a/packages/core/src/lib/waku_message/version_0.ts b/packages/core/src/lib/waku_message/version_0.ts index 38dbdb1fec..68a56b8530 100644 --- a/packages/core/src/lib/waku_message/version_0.ts +++ b/packages/core/src/lib/waku_message/version_0.ts @@ -74,11 +74,11 @@ export class DecodedMessage implements IDecodedMessage { export class Encoder implements IEncoder { constructor(public contentTopic: string, public ephemeral: boolean = false) {} - async toWire(message: Partial): Promise { + async toWire(message: Message): Promise { return proto.WakuMessage.encode(await this.toProtoObj(message)); } - async toProtoObj(message: Partial): Promise { + async toProtoObj(message: Message): Promise { const timestamp = message.timestamp ?? new Date(); return { diff --git a/packages/core/src/lib/waku_relay/index.ts b/packages/core/src/lib/waku_relay/index.ts index edd2ecd501..3e8459e6c4 100644 --- a/packages/core/src/lib/waku_relay/index.ts +++ b/packages/core/src/lib/waku_relay/index.ts @@ -99,10 +99,7 @@ class WakuRelay extends GossipSub implements Relay { /** * Send Waku message. */ - public async send( - encoder: Encoder, - message: Partial - ): Promise { + public async send(encoder: Encoder, message: Message): Promise { const msg = await encoder.toWire(message); if (!msg) { log("Failed to encode message, aborting publish"); diff --git a/packages/message-encryption/src/ecies.ts b/packages/message-encryption/src/ecies.ts index 65fee0f69d..9fe01bd235 100644 --- a/packages/message-encryption/src/ecies.ts +++ b/packages/message-encryption/src/ecies.ts @@ -37,16 +37,14 @@ class Encoder implements IEncoder { public ephemeral: boolean = false ) {} - async toWire(message: Partial): Promise { + async toWire(message: Message): Promise { const protoMessage = await this.toProtoObj(message); if (!protoMessage) return; return proto.WakuMessage.encode(protoMessage); } - async toProtoObj( - message: Partial - ): Promise { + async toProtoObj(message: Message): Promise { const timestamp = message.timestamp ?? new Date(); if (!message.payload) { log("No payload to encrypt, skipping: ", message); diff --git a/packages/message-encryption/src/symmetric.ts b/packages/message-encryption/src/symmetric.ts index 37cb42372f..b3e09f7a66 100644 --- a/packages/message-encryption/src/symmetric.ts +++ b/packages/message-encryption/src/symmetric.ts @@ -36,16 +36,14 @@ class Encoder implements IEncoder { public ephemeral: boolean = false ) {} - async toWire(message: Partial): Promise { + async toWire(message: Message): Promise { const protoMessage = await this.toProtoObj(message); if (!protoMessage) return; return proto.WakuMessage.encode(protoMessage); } - async toProtoObj( - message: Partial - ): Promise { + async toProtoObj(message: Message): Promise { const timestamp = message.timestamp ?? new Date(); if (!message.payload) { log("No payload to encrypt, skipping: ", message);