Whisper

Whisper

new Whisper(okdk)

Source:

Initialize whisper module.

Parameters:
Name Type Description
okdk Object

OkeyDokey module instance.

Methods

post(topic, message) → {boolean}

Source:

Send message to OkeyDokey's whisper network.

Parameters:
Name Type Description
topic string

Topic recipients can subscribe to. Must be a 4 byte hex string with a '0x' prefix (e.g. 0x11223344).

message string

Message to post.

Returns:

success - Whether the message was successfully posted.

Type
boolean

subscribe(topic, onMessage, onError)

Source:

Subscrice to a topic in OkeyDokey's whisper network.

Parameters:
Name Type Description
topic string

Array of topics to subscribe to. A topic be a 4 byte hex string with a '0x' prefix (e.g. 0x11223344).

onMessage function

Callback function for message. Parameters should be (message, subscription).

onError function

Callback function for error. Parameters should be (error, subscription).