mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-19 23:58:11 +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 {
|
export interface WakuRelayMessage {
|
||||||
payload: string;
|
payload: string;
|
||||||
contentTopic?: string;
|
contentTopic?: string;
|
||||||
|
timestamp?: number; // Float in seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NimWaku {
|
export class NimWaku {
|
||||||
@ -177,10 +178,15 @@ export class NimWaku {
|
|||||||
if (!message.payload) {
|
if (!message.payload) {
|
||||||
throw 'Attempting to send empty message';
|
throw 'Attempting to send empty message';
|
||||||
}
|
}
|
||||||
|
let timestamp;
|
||||||
|
if (message.timestamp) {
|
||||||
|
timestamp = message.timestamp.valueOf() / 1000;
|
||||||
|
}
|
||||||
|
|
||||||
const rpcMessage = {
|
const rpcMessage = {
|
||||||
payload: bufToHex(message.payload),
|
payload: bufToHex(message.payload),
|
||||||
contentTopic: message.contentTopic,
|
contentTopic: message.contentTopic,
|
||||||
|
timestamp,
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.rpcCall<boolean>('post_waku_v2_relay_v1_message', [
|
return this.rpcCall<boolean>('post_waku_v2_relay_v1_message', [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user