Pass timestamp to RPC call

This commit is contained in:
Franck Royer 2021-07-20 13:55:01 +10:00 committed by Franck Royer
parent c944a802a5
commit 6817a2f6b2
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4

View File

@ -63,6 +63,7 @@ export interface KeyPair {
export interface WakuRelayMessage {
payload: string;
contentTopic?: string;
timestamp?: number; // Float in seconds
}
export class NimWaku {
@ -177,10 +178,15 @@ export class NimWaku {
if (!message.payload) {
throw 'Attempting to send empty message';
}
let timestamp;
if (message.timestamp) {
timestamp = message.timestamp.valueOf() / 1000;
}
const rpcMessage = {
payload: bufToHex(message.payload),
contentTopic: message.contentTopic,
timestamp,
};
return this.rpcCall<boolean>('post_waku_v2_relay_v1_message', [