WACore API¶
Node
¶
Generic protocol node structure used by low-level event payloads.
Create a protocol node object.
| PARAMETER | DESCRIPTION |
|---|---|
tag
|
Node tag name.
TYPE:
|
attrs
|
List of attribute entries.
TYPE:
|
content
|
Optional payload content.
TYPE:
|
Example::
node = Node(
tag='message',
attrs=[Attrs('to', NodeValue.jid(JID('123', 's.whatsapp.net')))],
content=None,
)
Methods:¶
NodeValue
¶
NodeValue(value: str)
Represents a node attribute value.
A node value can be a plain string or a JID object.
Create a NodeValue from a string.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
Initial string value.
TYPE:
|
Example::
val = NodeValue('hello')
print(val.value) # 'hello'
Source code in python/tryx/wacore.py
tryx.wacore exposes lower-level protocol-facing types.
MediaType¶
Enum for media upload/download classification.
Node Tree Types¶
NodeValueNodeContentAttrsNode
These are useful for advanced debugging or when you need access to protocol node shape in events such as stream errors or notifications.
Business and Key Metadata¶
KeyIndexInfoBusinessSubscription
These appear in device/business sync event payloads.
When to Use WACore Types¶
Use these types only when high-level client/event abstractions are not enough. For normal client logic, prefer typed event payload objects and client namespace methods.