Add API docs (#45)

This commit is contained in:
Jazz Turner-Baggs 2025-12-17 19:16:02 -08:00 committed by GitHub
parent 9e999527e5
commit a1553b74d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,8 +21,57 @@ make tests
./build/pingpong ./build/pingpong
``` ```
## API
### Client
#### `new_client(WakuClient, Identity) -> Client`
Constructs a new Client instance
#### `create_intro_bundle(Client) -> IntroBundle`
Creates a package of keys required by initiators to initialize a conversation.
#### `new_private_conversation(Client, IntroBundle, Seq<u8>)`
Used by a client to initialize a conversation. Requires the `IntroBundle` of the other participant, as well as an initial message.
#### `list_conversations(Client) -> Seq<Conversation>`
Returns a list of conversations known to this client.
#### `get_conversation(Client, String) -> Conversation`
Returns a conversation given the conversation ID.
#### `on_new_message (Client, Callback(Conversation, ReceivedMessage)) -> Void`<br> `on_new_conversation(Client, Callback(Conversation)) -> Void` <br> `on_new_delivery_ack(Client, Callback(Conversation, String)) -> Void`
Registers callback to receive updates for events.
#### `start(Client) -> Void` <br> `stop(Client) -> Void`
Start MUST be called in order to receive messages. Stop should be called to finalize remaining tasks.
### Conversation
#### `id(Conversation) -> String`
Returns the Conversation Identifier (ConvoId).
#### `send_message(Conversation, Seq<u8>) -> String`
Sends content bytes to the conversation and returns a message_id.
### WakuClient
#### `default_config() -> DefaultConfig`
Creates a safe waku configuration to initialize a WakuClient.
#### `init_waku_client(WakuConfig) -> WakuClient`
Create a wakuClient from a configuration.
### Identity
#### `create_identity*(name: string)-> Identity`
Creates a new random identity
## Details ## Details
### Features ### Features
Current state of the [ChatSDK FURPS](https://github.com/waku-org/pm/blob/master/FURPS/application/chat_sdk.md) Current state of the [ChatSDK FURPS](https://github.com/waku-org/pm/blob/master/FURPS/application/chat_sdk.md)
@ -51,6 +100,9 @@ Current state of the [ChatSDK FURPS](https://github.com/waku-org/pm/blob/master/
| +4 | Nimble Compatible | ⛔ | Blocked — upstream dependency conflicts | +4 | Nimble Compatible | ⛔ | Blocked — upstream dependency conflicts
### Message Flow ### Message Flow
To establish a secure conversation, Saro and Raya need to: To establish a secure conversation, Saro and Raya need to: