update payload creation
This commit is contained in:
parent
6b04c467f1
commit
af8f6e0dca
19
src/index.js
19
src/index.js
|
@ -6,16 +6,13 @@ const TTL = 10;
|
|||
const POW_TARGET = 0.002;
|
||||
const CHANNEL = Web3.utils.sha3("status").slice(0, 10);
|
||||
|
||||
function createStatusPayload(
|
||||
{
|
||||
tag = '~#c4',
|
||||
content = 'Hello everyone',
|
||||
messageType = '~:public-group-user-message',
|
||||
clockValue = (new Date().getTime()) * 100,
|
||||
contentType = 'text/plain',
|
||||
timestamp = new Date().getTime(),
|
||||
} = {},
|
||||
) {
|
||||
function createStatusPayload() {
|
||||
let tag = '~#c4';
|
||||
let content = 'Hello everyone';
|
||||
let messageType = '~:public-group-user-message';
|
||||
let clockValue = (new Date().getTime()) * 100;
|
||||
let contentType = 'text/plain';
|
||||
let timestamp = new Date().getTime();
|
||||
return asciiToHex(
|
||||
JSON.stringify([
|
||||
tag,
|
||||
|
@ -61,7 +58,7 @@ function createStatusPayload(
|
|||
sig: keys.sig, // signs the message using the keyPair ID
|
||||
ttl: TTL,
|
||||
topic: CHANNEL,
|
||||
payload: createStatusPayload("hello there"),
|
||||
payload: createStatusPayload(),
|
||||
powTime: POW_TIME,
|
||||
powTarget: POW_TARGET
|
||||
}).then(() => {
|
||||
|
|
Loading…
Reference in New Issue