From 205270924a83f906cb54787728eedb95f9ce3c9a Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 18 Aug 2022 15:26:23 -0400 Subject: [PATCH] fix: c bindings docs --- library/README.md | 17 ++++++++--------- library/api_filter.go | 4 ++-- mobile/api_filter.go | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/library/README.md b/library/README.md index 506c7c7f..f3a74d90 100644 --- a/library/README.md +++ b/library/README.md @@ -108,14 +108,14 @@ The criteria to create subscription to a light node in JSON Format: ```ts { contentFilters: ContentFilter[]; - topic: string?; + pubsubTopic: string?; } ``` Fields: - `contentFilters`: Array of [`ContentFilter`](#contentfilter-type) being subscribed to / unsubscribed from. -- `topic`: Optional message topic. +- `topic`: Optional pubsub topic. ### `ContentFilter` type @@ -128,11 +128,11 @@ Fields: Fields: -- `contentTopic`: The content topic of a waku message. +- `contentTopic`: The content topic of a Waku message. ### `StoreQuery` type -Criteria used to retreive historical messages +Criteria used to retrieve historical messages ```ts interface StoreQuery { @@ -180,7 +180,7 @@ Fields: - `pageSize`: Number of messages to retrieve per page. - `cursor`: Message Index from which to perform pagination. If not included and forward is set to true, paging will be performed from the beginning of the list. If not included and forward is set to false, paging will be performed from the end of the list. -- `forward`: `true` if paging forward, `false` if paging backward +- `forward`: `true` if paging forward, `false` if paging backward ### `Index` type @@ -196,7 +196,7 @@ interface Index { Fields: - `digest`: Hash of the message at this [`Index`](#index-type). -- `receiverTime`: UNIX timestamp in nanoseconds at which the message at this [`Index`](#index-type) was received +- `receiverTime`: UNIX timestamp in nanoseconds at which the message at this [`Index`](#index-type) was received. - `senderTime`: UNIX timestamp in nanoseconds at which the message is generated by its sender. - `pubsubTopic`: The pubsub topic of the message at this [`Index`](#index-type). @@ -782,13 +782,13 @@ For example: ## Waku Filter -### `extern char* waku_filter_subscribe(char* filterJSON, char* peerID, int ms)` +### `extern char* waku_filter_subscribe(char* filterJSON, char* peerID, int timeoutMs)` Creates a subscription in a lightnode for messages that matches a content filter and optionally a [PubSub `topic`](https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-topic-descriptor). **Parameters** -1. `char* filterJSON`: JSON string containing the [`FilterSubscription`](#filtersubscription-type) to unsubscribe from +1. `char* filterJSON`: JSON string containing the [`FilterSubscription`](#filtersubscription-type) to subscribe to. 2. `char* peerID`: Peer ID to subscribe to. The peer must be already known. It must have been added before with [`waku_add_peer`](#extern-char-waku_add_peerchar-address-char-protocolid) @@ -1060,7 +1060,6 @@ Decode a base64 string (useful for reading the payload from Waku Messages). A [`JsonResponse`](#jsonresponse-type). If the execution is successful, the `result` field contains the decoded payload. - # Copyright Copyright and related rights waived via diff --git a/library/api_filter.go b/library/api_filter.go index ef7c3a88..8cdc017c 100644 --- a/library/api_filter.go +++ b/library/api_filter.go @@ -15,7 +15,7 @@ import ( // "contentTopic": "the content topic" // }, ... // ], -// "topic": "the pubsub topic" // optional +// "pubsubTopic": "the pubsub topic" // optional // } // peerID should contain the ID of a peer supporting the filter protocol. Use NULL to automatically select a node // If ms is greater than 0, the subscription must happen before the timeout @@ -34,7 +34,7 @@ func waku_filter_subscribe(filterJSON *C.char, peerID *C.char, ms C.int) *C.char // "contentTopic": "the content topic" // }, ... // ], -// "topic": "the pubsub topic" // optional +// "pubsubTopic": "the pubsub topic" // optional // } // If ms is greater than 0, the subscription must happen before the timeout // (in milliseconds) is reached, or an error will be returned diff --git a/mobile/api_filter.go b/mobile/api_filter.go index e1b62fe8..9e111a0e 100644 --- a/mobile/api_filter.go +++ b/mobile/api_filter.go @@ -11,7 +11,7 @@ import ( ) type FilterArgument struct { - Topic string `json:"topic,omitempty"` + Topic string `json:"pubsubTopic,omitempty"` ContentFilters []pb.ContentFilter `json:"contentFilters,omitempty"` }