Skip to content

Commit a7f9cb3

Browse files
authored
fix: pass message timestamp to the api envelope (#181)
1 parent a3f211a commit a7f9cb3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Client.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,19 @@ export default class Client {
290290
return this.publishEnvelope({
291291
contentTopic: topic,
292292
message: msgBytes,
293+
timestamp,
293294
})
294295
})
295296
)
296297

297298
return this.decodeMessage(msgBytes, topics[0])
298299
}
299300

300-
async publishEnvelope(env: messageApi.Envelope): Promise<void> {
301+
async publishEnvelope(env: {
302+
contentTopic: string
303+
message: Uint8Array
304+
timestamp?: Date
305+
}): Promise<void> {
301306
const bytes = env.message
302307
if (!env.contentTopic) {
303308
throw new Error('Missing content topic')
@@ -312,6 +317,7 @@ export default class Client {
312317
{
313318
contentTopic: env.contentTopic,
314319
message: bytes,
320+
timestamp: env.timestamp,
315321
},
316322
])
317323
} catch (err) {

0 commit comments

Comments
 (0)