broadcast
object.
Methods
(static) decodeAsync(buf, opts) → {Promise.<DecodeResult>}
Decode broadcast
object message.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
buf |
Buffer | Message |
||||||
opts |
Object | Any of object.decode options and: Properties
|
- Source:
Returns:
A promise that contains
decoded broadcast
structure when fulfilled.
- Type
- Promise.<DecodeResult>
(static) decodePayloadAsync()
Decode broadcast
object message payload.
The same as decodeAsync.
- Source:
(static) encodeAsync(opts) → {Promise.<Buffer>}
Encode broadcast
object message.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
- Source:
Returns:
A promise that contains encoded message when fulfilled.
- Type
- Promise.<Buffer>
(static) encodePayloadAsync()
Encode broadcast
object message payload.
The same as encodeAsync.
- Source:
Type Definitions
DecodeResult
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
nonce |
Buffer | A 8-byte object nonce |
|
ttl |
number | Time to live in seconds |
|
expires |
Date | Object expiration date |
|
type |
number | Object type |
|
version |
number | Object version |
|
stream |
number | Object stream |
|
headerLength |
number | Length of the object header |
|
tag |
Buffer | Tag derived from the address object used
to send this |
|
senderVersion |
number | Sender's address version |
|
senderStream |
number | Sender's stream |
|
behavior |
Object | Sender's pubkey features that can be expected from the node |
|
signPublicKey |
Buffer | Sender's signing public key |
|
encPublicKey |
Buffer | Sender's encryption public key |
|
nonceTrialsPerByte |
number | Difficulty parameter of the sender (present only if sender's address version >= 3) |
|
payloadLengthExtraBytes |
number | Difficulty parameter of the sender (present only if sender's address version >= 3) |
|
encoding |
number | Message encoding |
|
message |
string | Buffer | Message string for TRIVIAL and SIMPLE encodings or unparsed buffer data for other encodings |
|
subject |
string |
<optional> |
Subject string for SIMPLE encoding |
signature |
Buffer | Signature of the message |
|
length |
number | Real data length |
- Source: