mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-17 06:47:29 +00:00
Pass timestamp to RPC call
This commit is contained in:
parent
c944a802a5
commit
6817a2f6b2
@ -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', [
|
||||
|
Loading…
x
Reference in New Issue
Block a user