-
Notifications
You must be signed in to change notification settings - Fork 54
/
message.nim
38 lines (33 loc) · 1.07 KB
/
message.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Waku Message module.
##
## See https://github.com/vacp2p/specs/blob/master/specs/waku/v2/waku-message.md
## for spec.
when (NimMajor, NimMinor) < (1, 4):
{.push raises: [Defect].}
else:
{.push raises: [].}
import
../topics,
../time,
./default_values
const
MaxMetaAttrLength* = 64 # 64 bytes
type WakuMessage* = object
# Data payload transmitted.
payload*: seq[byte]
# String identifier that can be used for content-based filtering.
contentTopic*: ContentTopic
# Application specific metadata.
meta*: seq[byte]
# Number to discriminate different types of payload encryption.
# Compatibility with Whisper/WakuV1.
version*: uint32
# Sender generated timestamp.
timestamp*: Timestamp
# The ephemeral attribute indicates signifies the transient nature of the
# message (if the message should be stored).
ephemeral*: bool
# Part of RFC 17: https://rfc.vac.dev/spec/17/
# The proof attribute indicates that the message is not spam. This
# attribute will be used in the rln-relay protocol.
proof*: seq[byte]