Message Content Type
text
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | text | string | |
| topic | string | Topic name,the private chat is null | |
| content | object | JSON format | |
| timestamp | long | digital representation of time in milliseconds. for conversion to specific time in time zones around the world. | |
| options | json string |
receipt
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | receipt | string | |
| targetID | string | target msg id | |
| timestamp | long | digital representation of time in milliseconds. for conversion to specific time in time zones around the world. |
textExtension
- Burn after reading
- Theme color (not implemented yet)
This is separated from text content type so web d-chat can simply ignore this content type if not implemented.
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | textExtension | string | |
| topic | string | Topic name,the private chat is null | |
| content | object | JSON format | |
| timestamp | long | digital representation of time in milliseconds. for conversion to specific time in time zones around the world. | |
| options | object |
Contact Protocol
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | contact | string | |
| requestType | header/full | string | response should not contain this field |
| content | {name: “”, avatar: { type: “base64”, data: “”}} | object | should not contain this field if request type is header |
| version | string | random uuid | |
| expiresAt | long |
If requestType is header, other side should respond with only version and expiresAt to indicate meta data.
If requestType is full, other side should include content as well.
Contact Options Protocol
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | event:contactOptions | string | |
| content | {“deleteAfterSeconds”:10} | object | |
| timestamp | long | digital representation of time in milliseconds. for conversion to specific time in time zones around the world. |
Currently only used for dialog burn after read settings, similar to Signal.
private channel
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | event:channelInvitation | string | |
| content | topic name | string | |
| timestamp | long | digital representation of time in milliseconds. for conversion to specific time in time zones around the world. |
Event
Subscribe
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | event:subscribe | string | |
| topic | string |
Unsubscribe
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | event:unsubscribe | string | |
| topic | string |
Add Permission
See [NKP-0016] Client side pub/sub permission control for details about permission spec.
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | event:add-permission | string | |
| topic | string | ||
| content | {addr: “nkn-client-addr”} or {pubkey: “public-key”} | object |
Remove Permission
See [NKP-0016] Client side pub/sub permission control for details about permission spec.
| field | value | type | description |
|---|---|---|---|
| id | string | random uuid | |
| contentType | event:remove-permission | string | |
| topic | string | ||
| content | {addr: “nkn-client-addr”} or {pubkey: “public-key”} | object |
