mirror of
https://github.com/acid-info/docs.wakuconnect.dev.git
synced 2025-02-22 22:58:04 +00:00
Add js-waku Typedoc (#5)
This commit is contained in:
parent
9e409435ec
commit
b78264465b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
book
|
||||
tmp
|
||||
|
@ -12,3 +12,7 @@ path = "book/"
|
||||
additional-css = ["custom.css"]
|
||||
git-repository-url = "https://github.com/vacp2p/docs.dappconnect.dev"
|
||||
git-branch = "master"
|
||||
|
||||
[output.html.fold]
|
||||
enable = true
|
||||
level = 2
|
||||
|
64
build_api_doc.sh
Executable file
64
build_api_doc.sh
Executable file
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ROOT_DIR=${0%/*}
|
||||
TMP_DIR="$ROOT_DIR/tmp"
|
||||
JS_WAKU_DIR="$TMP_DIR/js-waku"
|
||||
JS_WAKU_DOC_DIR="$TMP_DIR/js-waku/build/docs"
|
||||
|
||||
echo "ROOT_DIR: $ROOT_DIR"
|
||||
echo "TMP_DIR: $TMP_DIR"
|
||||
echo "JS_WAKU_DIR: $JS_WAKU_DIR"
|
||||
echo "JS_WAKU_DOC_DIR: $JS_WAKU_DOC_DIR"
|
||||
|
||||
if ! [[ -d "$TMP_DIR" ]]; then
|
||||
mkdir "$TMP_DIR"
|
||||
fi
|
||||
cd "$TMP_DIR" || exit 1
|
||||
|
||||
if ! [[ -d "js-waku" ]]; then
|
||||
git clone https://github.com/status-im/js-waku.git
|
||||
fi
|
||||
|
||||
cd "$JS_WAKU_DIR" || exit 1
|
||||
LATEST_TAG=$(git describe --abbrev=0 --tag | tr -d '\n')
|
||||
|
||||
if [[ -z "$LATEST_TAG" ]]; then
|
||||
echo "Issue retrieving latest js-waku tag"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
JS_WAKU_TARGET_DIR="$ROOT_DIR/src/api/js-waku/$LATEST_TAG"
|
||||
echo "JS_WAKU_TARGET_DIR: $JS_WAKU_TARGET_DIR"
|
||||
|
||||
if [[ -d "$JS_WAKU_TARGET_DIR" ]]; then
|
||||
echo "Documentation for 'js-waku@$LATEST_TAG' is already present, skipping retrieval"
|
||||
else
|
||||
echo "Retrieving documentation for 'js-waku@$LATEST_TAG'"
|
||||
|
||||
git checkout "$LATEST_TAG" || echo "Failed to checkout $LATEST_TAG"
|
||||
|
||||
npm install || echo "Failed to run npm install"
|
||||
|
||||
# Make typedoc generate markdown files
|
||||
npm add --save-dev typedoc-plugin-markdown || echo "Failed to install typedoc-plugin-markdown"
|
||||
npm run doc:html || echo "Failed to generate docs"
|
||||
|
||||
if ! [[ -d "$JS_WAKU_DOC_DIR" ]]; then
|
||||
echo "$JS_WAKU_DOC_DIR is missing"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -Rp "$JS_WAKU_DOC_DIR" "$JS_WAKU_TARGET_DIR"
|
||||
fi
|
||||
|
||||
# Need to index all files in SUMMARY.md
|
||||
# Use the command below to print and then copy a pre-formatted list
|
||||
|
||||
echo "-----------------------------------------------------------------------------------"
|
||||
echo "### All files must be referenced in SUMMARY.md to be present in the generated HTML"
|
||||
echo "### The output below lists all the files, you may need to add a number of README.md"
|
||||
echo "### at the root of all directories."
|
||||
echo ""
|
||||
|
||||
cd "$ROOT_DIR/src/" || exit 1
|
||||
find "api/js-waku/$LATEST_TAG" | sed -r 's/^(.*\/)([a-zA-Z._]+)\.md$/- [\2](\1\2.md)/'
|
@ -12,5 +12,30 @@
|
||||
- [Retrieve Messages Using Waku Store With ReactJS](guides/reactjs_store.md)
|
||||
- [Send Messages Using Waku Light Push](guides/light_push_send_messages.md)
|
||||
- [Examples](examples.md)
|
||||
- [API](api/README.md)
|
||||
- [js-waku](api/js-waku/README.md)
|
||||
- [v0.14.2](api/js-waku/v0.14.2/README.md)
|
||||
- [exports](api/js-waku/v0.14.2/modules.md)
|
||||
- [modules](api/js-waku/v0.14.2/modules/README.md)
|
||||
- [proto](api/js-waku/v0.14.2/modules/proto.md)
|
||||
- [utils](api/js-waku/v0.14.2/modules/utils.md)
|
||||
- [enums](api/js-waku/v0.14.2/enums/README.md)
|
||||
- [PagingInfo_Direction](api/js-waku/v0.14.2/enums/proto.PagingInfo_Direction.md)
|
||||
- [PageDirection](api/js-waku/v0.14.2/enums/PageDirection.md)
|
||||
- [classes](api/js-waku/v0.14.2/classes/README.md)
|
||||
- [WakuStore](api/js-waku/v0.14.2/classes/WakuStore.md)
|
||||
- [WakuRelay](api/js-waku/v0.14.2/classes/WakuRelay.md)
|
||||
- [WakuMessage](api/js-waku/v0.14.2/classes/WakuMessage.md)
|
||||
- [WakuLightPush](api/js-waku/v0.14.2/classes/WakuLightPush.md)
|
||||
- [Waku](api/js-waku/v0.14.2/classes/Waku.md)
|
||||
- [interfaces](api/js-waku/v0.14.2/interfaces/README.md)
|
||||
- [proto.Index](api/js-waku/v0.14.2/interfaces/proto.Index.md)
|
||||
- [proto.HistoryRPC](api/js-waku/v0.14.2/interfaces/proto.HistoryRPC.md)
|
||||
- [proto.HistoryQuery](api/js-waku/v0.14.2/interfaces/proto.HistoryQuery.md)
|
||||
- [proto.WakuMessage](api/js-waku/v0.14.2/interfaces/proto.WakuMessage.md)
|
||||
- [PushResponse](api/js-waku/v0.14.2/interfaces/PushResponse.md)
|
||||
- [proto.HistoryResponse](api/js-waku/v0.14.2/interfaces/proto.HistoryResponse.md)
|
||||
- [proto.ContentFilter](api/js-waku/v0.14.2/interfaces/proto.ContentFilter.md)
|
||||
- [proto.PagingInfo](api/js-waku/v0.14.2/interfaces/proto.PagingInfo.md)
|
||||
|
||||
[Implemented Waku Protocols](waku_protocols.md)
|
||||
|
5
src/api/README.md
Normal file
5
src/api/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# API Documentation
|
||||
|
||||
Find below the generated doc for DappConnect libraries.
|
||||
|
||||
- [js-waku](./js-waku/)
|
5
src/api/js-waku/README.md
Normal file
5
src/api/js-waku/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# JS-Waku API Documentation
|
||||
|
||||
Find below the generated TypeDoc API for js-waku releases.
|
||||
|
||||
- [v0.14.2](./v0.14.2/)
|
24
src/api/js-waku/v0.14.2/README.md
Normal file
24
src/api/js-waku/v0.14.2/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# v0.14.2
|
||||
|
||||
- [exports](modules.md)
|
||||
- [modules](modules/README.md)
|
||||
- [proto](modules/proto.md)
|
||||
- [utils](modules/utils.md)
|
||||
- [enums](enums/README.md)
|
||||
- [PagingInfo_Direction](enums/proto.PagingInfo_Direction.md)
|
||||
- [PageDirection](enums/PageDirection.md)
|
||||
- [classes](classes/README.md)
|
||||
- [WakuStore](classes/WakuStore.md)
|
||||
- [WakuRelay](classes/WakuRelay.md)
|
||||
- [WakuMessage](classes/WakuMessage.md)
|
||||
- [WakuLightPush](classes/WakuLightPush.md)
|
||||
- [Waku](classes/Waku.md)
|
||||
- [interfaces](interfaces/README.md)
|
||||
- [proto.Index](interfaces/proto.Index.md)
|
||||
- [proto.HistoryRPC](interfaces/proto.HistoryRPC.md)
|
||||
- [proto.HistoryQuery](interfaces/proto.HistoryQuery.md)
|
||||
- [proto.WakuMessage](interfaces/proto.WakuMessage.md)
|
||||
- [PushResponse](interfaces/PushResponse.md)
|
||||
- [proto.HistoryResponse](interfaces/proto.HistoryResponse.md)
|
||||
- [proto.ContentFilter](interfaces/proto.ContentFilter.md)
|
||||
- [proto.PagingInfo](interfaces/proto.PagingInfo.md)
|
7
src/api/js-waku/v0.14.2/classes/README.md
Normal file
7
src/api/js-waku/v0.14.2/classes/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# classes
|
||||
|
||||
- [WakuStore](WakuStore.md)
|
||||
- [WakuRelay](WakuRelay.md)
|
||||
- [WakuMessage](WakuMessage.md)
|
||||
- [WakuLightPush](WakuLightPush.md)
|
||||
- [Waku](Waku.md)
|
328
src/api/js-waku/v0.14.2/classes/Waku.md
Normal file
328
src/api/js-waku/v0.14.2/classes/Waku.md
Normal file
@ -0,0 +1,328 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / Waku
|
||||
|
||||
# Class: Waku
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Constructors
|
||||
|
||||
- [constructor](Waku.md#constructor)
|
||||
|
||||
### Properties
|
||||
|
||||
- [libp2p](Waku.md#libp2p)
|
||||
- [lightPush](Waku.md#lightpush)
|
||||
- [pingKeepAliveTimers](Waku.md#pingkeepalivetimers)
|
||||
- [relay](Waku.md#relay)
|
||||
- [relayKeepAliveTimers](Waku.md#relaykeepalivetimers)
|
||||
- [store](Waku.md#store)
|
||||
|
||||
### Methods
|
||||
|
||||
- [addDecryptionKey](Waku.md#adddecryptionkey)
|
||||
- [addPeerToAddressBook](Waku.md#addpeertoaddressbook)
|
||||
- [deleteDecryptionKey](Waku.md#deletedecryptionkey)
|
||||
- [dial](Waku.md#dial)
|
||||
- [getLocalMultiaddrWithID](Waku.md#getlocalmultiaddrwithid)
|
||||
- [startKeepAlive](Waku.md#startkeepalive)
|
||||
- [stop](Waku.md#stop)
|
||||
- [stopKeepAlive](Waku.md#stopkeepalive)
|
||||
- [waitForConnectedPeer](Waku.md#waitforconnectedpeer)
|
||||
- [create](Waku.md#create)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• `Private` **new Waku**(`options`, `libp2p`, `store`, `lightPush`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `options` | `CreateOptions` |
|
||||
| `libp2p` | `Libp2p` |
|
||||
| `store` | [`WakuStore`](WakuStore.md) |
|
||||
| `lightPush` | [`WakuLightPush`](WakuLightPush.md) |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:114](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L114)
|
||||
|
||||
## Properties
|
||||
|
||||
### libp2p
|
||||
|
||||
• **libp2p**: `Libp2p`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:102](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L102)
|
||||
|
||||
___
|
||||
|
||||
### lightPush
|
||||
|
||||
• **lightPush**: [`WakuLightPush`](WakuLightPush.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:105](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L105)
|
||||
|
||||
___
|
||||
|
||||
### pingKeepAliveTimers
|
||||
|
||||
• `Private` **pingKeepAliveTimers**: `Object`
|
||||
|
||||
#### Index signature
|
||||
|
||||
▪ [peer: `string`]: `ReturnType`<typeof `setInterval`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:107](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L107)
|
||||
|
||||
___
|
||||
|
||||
### relay
|
||||
|
||||
• **relay**: [`WakuRelay`](WakuRelay.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:103](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L103)
|
||||
|
||||
___
|
||||
|
||||
### relayKeepAliveTimers
|
||||
|
||||
• `Private` **relayKeepAliveTimers**: `Object`
|
||||
|
||||
#### Index signature
|
||||
|
||||
▪ [peer: `string`]: `ReturnType`<typeof `setInterval`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:110](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L110)
|
||||
|
||||
___
|
||||
|
||||
### store
|
||||
|
||||
• **store**: [`WakuStore`](WakuStore.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:104](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L104)
|
||||
|
||||
## Methods
|
||||
|
||||
### addDecryptionKey
|
||||
|
||||
▸ **addDecryptionKey**(`key`): `void`
|
||||
|
||||
Register a decryption key to attempt decryption of messages received via
|
||||
[WakuRelay](WakuRelay.md) and [WakuStore](WakuStore.md). This can either be a private key for
|
||||
asymmetric encryption or a symmetric key.
|
||||
|
||||
Strings must be in hex format.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:285](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L285)
|
||||
|
||||
___
|
||||
|
||||
### addPeerToAddressBook
|
||||
|
||||
▸ **addPeerToAddressBook**(`peerId`, `multiaddrs`): `void`
|
||||
|
||||
Add peer to address book, it will be auto-dialed in the background.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `peerId` | `string` \| `PeerId` |
|
||||
| `multiaddrs` | `string`[] \| `Multiaddr`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:254](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L254)
|
||||
|
||||
___
|
||||
|
||||
### deleteDecryptionKey
|
||||
|
||||
▸ **deleteDecryptionKey**(`key`): `void`
|
||||
|
||||
Delete a decryption key that was used to attempt decryption of messages
|
||||
received via [WakuRelay](WakuRelay.md) or [WakuStore](WakuStore.md).
|
||||
|
||||
Strings must be in hex format.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:296](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L296)
|
||||
|
||||
___
|
||||
|
||||
### dial
|
||||
|
||||
▸ **dial**(`peer`): `Promise`<{ `protocol`: `string` ; `stream`: `MuxedStream` }\>
|
||||
|
||||
Dials to the provided peer.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `peer` | `string` \| `PeerId` \| `Multiaddr` | The peer to dial |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<{ `protocol`: `string` ; `stream`: `MuxedStream` }\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:244](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L244)
|
||||
|
||||
___
|
||||
|
||||
### getLocalMultiaddrWithID
|
||||
|
||||
▸ **getLocalMultiaddrWithID**(): `string`
|
||||
|
||||
Return the local multiaddr with peer id on which libp2p is listening.
|
||||
|
||||
**`throws`** if libp2p is not listening on localhost
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:305](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L305)
|
||||
|
||||
___
|
||||
|
||||
### startKeepAlive
|
||||
|
||||
▸ `Private` **startKeepAlive**(`peerId`, `pingPeriodSecs`, `relayPeriodSecs`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `peerId` | `PeerId` |
|
||||
| `pingPeriodSecs` | `number` |
|
||||
| `relayPeriodSecs` | `number` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:354](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L354)
|
||||
|
||||
___
|
||||
|
||||
### stop
|
||||
|
||||
▸ **stop**(): `Promise`<`void`\>
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:274](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L274)
|
||||
|
||||
___
|
||||
|
||||
### stopKeepAlive
|
||||
|
||||
▸ `Private` **stopKeepAlive**(`peerId`): `void`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `peerId` | `PeerId` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:379](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L379)
|
||||
|
||||
___
|
||||
|
||||
### waitForConnectedPeer
|
||||
|
||||
▸ **waitForConnectedPeer**(): `Promise`<`void`\>
|
||||
|
||||
Wait to be connected to a peer. Useful when using the [[CreateOptions.bootstrap]]
|
||||
with [Waku.create](Waku.md#create). The Promise resolves only once we are connected to a
|
||||
Store peer, Relay peer and Light Push peer.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:320](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L320)
|
||||
|
||||
___
|
||||
|
||||
### create
|
||||
|
||||
▸ `Static` **create**(`options?`): `Promise`<[`Waku`](Waku.md)\>
|
||||
|
||||
Create new waku node
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `options?` | `CreateOptions` | Takes the same options than `Libp2p`. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`Waku`](Waku.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:148](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L148)
|
114
src/api/js-waku/v0.14.2/classes/WakuLightPush.md
Normal file
114
src/api/js-waku/v0.14.2/classes/WakuLightPush.md
Normal file
@ -0,0 +1,114 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / WakuLightPush
|
||||
|
||||
# Class: WakuLightPush
|
||||
|
||||
Implements the [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/).
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Constructors
|
||||
|
||||
- [constructor](WakuLightPush.md#constructor)
|
||||
|
||||
### Properties
|
||||
|
||||
- [libp2p](WakuLightPush.md#libp2p)
|
||||
- [pubSubTopic](WakuLightPush.md#pubsubtopic)
|
||||
|
||||
### Accessors
|
||||
|
||||
- [peers](WakuLightPush.md#peers)
|
||||
- [randomPeer](WakuLightPush.md#randompeer)
|
||||
|
||||
### Methods
|
||||
|
||||
- [push](WakuLightPush.md#push)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new WakuLightPush**(`libp2p`, `options?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `libp2p` | `Libp2p` |
|
||||
| `options?` | `CreateOptions` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_light_push/index.ts:41](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_light_push/index.ts#L41)
|
||||
|
||||
## Properties
|
||||
|
||||
### libp2p
|
||||
|
||||
• **libp2p**: `Libp2p`
|
||||
|
||||
___
|
||||
|
||||
### pubSubTopic
|
||||
|
||||
• **pubSubTopic**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_light_push/index.ts:39](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_light_push/index.ts#L39)
|
||||
|
||||
## Accessors
|
||||
|
||||
### peers
|
||||
|
||||
• `get` **peers**(): `Peer`[]
|
||||
|
||||
Returns known peers from the address book (`libp2p.peerStore`) that support
|
||||
light push protocol. Waku may or may not be currently connected to these peers.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Peer`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_light_push/index.ts:102](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_light_push/index.ts#L102)
|
||||
|
||||
___
|
||||
|
||||
### randomPeer
|
||||
|
||||
• `get` **randomPeer**(): `undefined` \| `Peer`
|
||||
|
||||
Returns a random peer that supports light push protocol from the address
|
||||
book (`libp2p.peerStore`). Waku may or may not be currently connected to
|
||||
this peer.
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Peer`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_light_push/index.ts:111](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_light_push/index.ts#L111)
|
||||
|
||||
## Methods
|
||||
|
||||
### push
|
||||
|
||||
▸ **push**(`message`, `opts?`): `Promise`<``null`` \| [`PushResponse`](../modules.md#pushresponse)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `message` | [`WakuMessage`](WakuMessage.md) |
|
||||
| `opts?` | `PushOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<``null`` \| [`PushResponse`](../modules.md#pushresponse)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_light_push/index.ts:49](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_light_push/index.ts#L49)
|
292
src/api/js-waku/v0.14.2/classes/WakuMessage.md
Normal file
292
src/api/js-waku/v0.14.2/classes/WakuMessage.md
Normal file
@ -0,0 +1,292 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / WakuMessage
|
||||
|
||||
# Class: WakuMessage
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Constructors
|
||||
|
||||
- [constructor](WakuMessage.md#constructor)
|
||||
|
||||
### Properties
|
||||
|
||||
- [proto](WakuMessage.md#proto)
|
||||
|
||||
### Accessors
|
||||
|
||||
- [contentTopic](WakuMessage.md#contenttopic)
|
||||
- [payload](WakuMessage.md#payload)
|
||||
- [payloadAsUtf8](WakuMessage.md#payloadasutf8)
|
||||
- [signature](WakuMessage.md#signature)
|
||||
- [signaturePublicKey](WakuMessage.md#signaturepublickey)
|
||||
- [timestamp](WakuMessage.md#timestamp)
|
||||
- [version](WakuMessage.md#version)
|
||||
|
||||
### Methods
|
||||
|
||||
- [encode](WakuMessage.md#encode)
|
||||
- [decode](WakuMessage.md#decode)
|
||||
- [decodeProto](WakuMessage.md#decodeproto)
|
||||
- [fromBytes](WakuMessage.md#frombytes)
|
||||
- [fromUtf8String](WakuMessage.md#fromutf8string)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• `Private` **new WakuMessage**(`proto`, `_signaturePublicKey?`, `_signature?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `proto` | [`WakuMessage`](../modules/proto.md#wakumessage) |
|
||||
| `_signaturePublicKey?` | `Uint8Array` |
|
||||
| `_signature?` | `Uint8Array` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:40](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L40)
|
||||
|
||||
## Properties
|
||||
|
||||
### proto
|
||||
|
||||
• **proto**: [`WakuMessage`](../modules/proto.md#wakumessage)
|
||||
|
||||
## Accessors
|
||||
|
||||
### contentTopic
|
||||
|
||||
• `get` **contentTopic**(): `undefined` \| `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:215](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L215)
|
||||
|
||||
___
|
||||
|
||||
### payload
|
||||
|
||||
• `get` **payload**(): `undefined` \| `Uint8Array`
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:211](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L211)
|
||||
|
||||
___
|
||||
|
||||
### payloadAsUtf8
|
||||
|
||||
• `get` **payloadAsUtf8**(): `string`
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:203](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L203)
|
||||
|
||||
___
|
||||
|
||||
### signature
|
||||
|
||||
• `get` **signature**(): `undefined` \| `Uint8Array`
|
||||
|
||||
The signature of the message.
|
||||
|
||||
MAY be present if the message is version 1.
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:244](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L244)
|
||||
|
||||
___
|
||||
|
||||
### signaturePublicKey
|
||||
|
||||
• `get` **signaturePublicKey**(): `undefined` \| `Uint8Array`
|
||||
|
||||
The public key used to sign the message.
|
||||
|
||||
MAY be present if the message is version 1.
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:235](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L235)
|
||||
|
||||
___
|
||||
|
||||
### timestamp
|
||||
|
||||
• `get` **timestamp**(): `undefined` \| `Date`
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Date`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:223](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L223)
|
||||
|
||||
___
|
||||
|
||||
### version
|
||||
|
||||
• `get` **version**(): `undefined` \| `number`
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:219](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L219)
|
||||
|
||||
## Methods
|
||||
|
||||
### encode
|
||||
|
||||
▸ **encode**(): `Uint8Array`
|
||||
|
||||
#### Returns
|
||||
|
||||
`Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:199](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L199)
|
||||
|
||||
___
|
||||
|
||||
### decode
|
||||
|
||||
▸ `Static` **decode**(`bytes`, `decryptionKeys?`): `Promise`<`undefined` \| [`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
Decode a byte array into Waku Message.
|
||||
|
||||
**`params`** bytes The message encoded using protobuf as defined in [14/WAKU2-MESSAGE](https://rfc.vac.dev/spec/14/).
|
||||
|
||||
**`params`** decryptionKeys If the payload is encrypted (version = 1), then the
|
||||
keys are used to attempt decryption of the message. The passed key can either
|
||||
be asymmetric private keys or symmetric keys, both method are tried for each
|
||||
key until the message is decrypted or combinations are ran out.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `bytes` | `Uint8Array` |
|
||||
| `decryptionKeys?` | `Uint8Array`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:121](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L121)
|
||||
|
||||
___
|
||||
|
||||
### decodeProto
|
||||
|
||||
▸ `Static` **decodeProto**(`protoBuf`, `decryptionKeys?`): `Promise`<`undefined` \| [`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
Decode and decrypt Waku Message Protobuf Object into Waku Message.
|
||||
|
||||
**`params`** protoBuf The message to decode and decrypt.
|
||||
|
||||
**`params`** decryptionKeys If the payload is encrypted (version = 1), then the
|
||||
keys are used to attempt decryption of the message. The passed key can either
|
||||
be asymmetric private keys or symmetric keys, both method are tried for each
|
||||
key until the message is decrypted or combinations are ran out.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `protoBuf` | [`WakuMessage`](../modules/proto.md#wakumessage) |
|
||||
| `decryptionKeys?` | `Uint8Array`[] |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`undefined` \| [`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:139](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L139)
|
||||
|
||||
___
|
||||
|
||||
### fromBytes
|
||||
|
||||
▸ `Static` **fromBytes**(`payload`, `contentTopic`, `opts?`): `Promise`<[`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
Create a Waku Message with the given payload.
|
||||
|
||||
By default, the payload is kept clear (version 0).
|
||||
If `opts.encPublicKey` is passed, the payload is encrypted using
|
||||
asymmetric encryption (version 1).
|
||||
|
||||
If `opts.sigPrivKey` is passed and version 1 is used, the payload is signed
|
||||
before encryption.
|
||||
|
||||
**`throws`** if both `opts.encPublicKey` and `opt.symKey` are passed
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `payload` | `Uint8Array` |
|
||||
| `contentTopic` | `string` |
|
||||
| `opts?` | `Options` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:70](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L70)
|
||||
|
||||
___
|
||||
|
||||
### fromUtf8String
|
||||
|
||||
▸ `Static` **fromUtf8String**(`utf8`, `contentTopic`, `opts?`): `Promise`<[`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
Create Message with a utf-8 string as payload.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `utf8` | `string` |
|
||||
| `contentTopic` | `string` |
|
||||
| `opts?` | `Options` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`WakuMessage`](WakuMessage.md)\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/index.ts:49](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/index.ts#L49)
|
298
src/api/js-waku/v0.14.2/classes/WakuRelay.md
Normal file
298
src/api/js-waku/v0.14.2/classes/WakuRelay.md
Normal file
@ -0,0 +1,298 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / WakuRelay
|
||||
|
||||
# Class: WakuRelay
|
||||
|
||||
Implements the [Waku v2 Relay protocol](https://rfc.vac.dev/spec/11/).
|
||||
Must be passed as a `pubsub` module to a {Libp2p} instance.
|
||||
|
||||
**`implements`** {require('libp2p-interfaces/src/pubsub')}
|
||||
|
||||
## Hierarchy
|
||||
|
||||
- `Gossipsub`
|
||||
|
||||
↳ **`WakuRelay`**
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Constructors
|
||||
|
||||
- [constructor](WakuRelay.md#constructor)
|
||||
|
||||
### Properties
|
||||
|
||||
- [decryptionKeys](WakuRelay.md#decryptionkeys)
|
||||
- [heartbeat](WakuRelay.md#heartbeat)
|
||||
- [observers](WakuRelay.md#observers)
|
||||
- [pubSubTopic](WakuRelay.md#pubsubtopic)
|
||||
|
||||
### Methods
|
||||
|
||||
- [addDecryptionKey](WakuRelay.md#adddecryptionkey)
|
||||
- [addObserver](WakuRelay.md#addobserver)
|
||||
- [deleteDecryptionKey](WakuRelay.md#deletedecryptionkey)
|
||||
- [deleteObserver](WakuRelay.md#deleteobserver)
|
||||
- [getPeers](WakuRelay.md#getpeers)
|
||||
- [send](WakuRelay.md#send)
|
||||
- [start](WakuRelay.md#start)
|
||||
- [subscribe](WakuRelay.md#subscribe)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new WakuRelay**(`libp2p`, `options?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `libp2p` | `Libp2p` |
|
||||
| `options?` | `Partial`<`CreateOptions` & `GossipOptions`\> |
|
||||
|
||||
#### Overrides
|
||||
|
||||
Gossipsub.constructor
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:78](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L78)
|
||||
|
||||
## Properties
|
||||
|
||||
### decryptionKeys
|
||||
|
||||
• **decryptionKeys**: `Set`<`Uint8Array`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:68](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L68)
|
||||
|
||||
___
|
||||
|
||||
### heartbeat
|
||||
|
||||
• **heartbeat**: `RelayHeartbeat`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Gossipsub.heartbeat
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:65](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
### observers
|
||||
|
||||
• **observers**: `Object`
|
||||
|
||||
observers called when receiving new message.
|
||||
Observers under key `""` are always called.
|
||||
|
||||
#### Index signature
|
||||
|
||||
▪ [contentTopic: `string`]: `Set`<(`message`: [`WakuMessage`](WakuMessage.md)) => `void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:74](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L74)
|
||||
|
||||
___
|
||||
|
||||
### pubSubTopic
|
||||
|
||||
• **pubSubTopic**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:66](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L66)
|
||||
|
||||
## Methods
|
||||
|
||||
### addDecryptionKey
|
||||
|
||||
▸ **addDecryptionKey**(`key`): `void`
|
||||
|
||||
Register a decryption key to attempt decryption of received messages.
|
||||
This can either be a private key for asymmetric encryption or a symmetric
|
||||
key. `WakuRelay` will attempt to decrypt messages using both methods.
|
||||
|
||||
Strings must be in hex format.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:131](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L131)
|
||||
|
||||
___
|
||||
|
||||
### addObserver
|
||||
|
||||
▸ **addObserver**(`callback`, `contentTopics?`): `void`
|
||||
|
||||
Register an observer of new messages received via waku relay
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `callback` | (`message`: [`WakuMessage`](WakuMessage.md)) => `void` | `undefined` | called when a new message is received via waku relay |
|
||||
| `contentTopics` | `string`[] | `[]` | Content Topics for which the callback with be called, all of them if undefined, [] or ["",..] is passed. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:153](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L153)
|
||||
|
||||
___
|
||||
|
||||
### deleteDecryptionKey
|
||||
|
||||
▸ **deleteDecryptionKey**(`key`): `void`
|
||||
|
||||
Delete a decryption key that was used to attempt decryption of received
|
||||
messages.
|
||||
|
||||
Strings must be in hex format.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:141](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L141)
|
||||
|
||||
___
|
||||
|
||||
### deleteObserver
|
||||
|
||||
▸ **deleteObserver**(`callback`, `contentTopics?`): `void`
|
||||
|
||||
Remove an observer of new messages received via waku relay.
|
||||
Useful to ensure the same observer is not registered several time
|
||||
(e.g when loading React components)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value |
|
||||
| :------ | :------ | :------ |
|
||||
| `callback` | (`message`: [`WakuMessage`](WakuMessage.md)) => `void` | `undefined` |
|
||||
| `contentTopics` | `string`[] | `[]` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:177](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L177)
|
||||
|
||||
___
|
||||
|
||||
### getPeers
|
||||
|
||||
▸ **getPeers**(): `Set`<`string`\>
|
||||
|
||||
Return the relay peers we are connected to and we would publish a message to
|
||||
|
||||
#### Returns
|
||||
|
||||
`Set`<`string`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:197](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L197)
|
||||
|
||||
___
|
||||
|
||||
### send
|
||||
|
||||
▸ **send**(`message`): `Promise`<`void`\>
|
||||
|
||||
Send Waku message.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `message` | [`WakuMessage`](WakuMessage.md) |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`void`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:119](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L119)
|
||||
|
||||
___
|
||||
|
||||
### start
|
||||
|
||||
▸ **start**(): `void`
|
||||
|
||||
Mounts the gossipsub protocol onto the libp2p node
|
||||
and subscribes to the default topic.
|
||||
|
||||
**`override`**
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Gossipsub.start
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:108](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L108)
|
||||
|
||||
___
|
||||
|
||||
### subscribe
|
||||
|
||||
▸ **subscribe**(`pubSubTopic`): `void`
|
||||
|
||||
Subscribe to a pubsub topic and start emitting Waku messages to observers.
|
||||
|
||||
**`override`**
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `pubSubTopic` | `string` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Overrides
|
||||
|
||||
Gossipsub.subscribe
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/index.ts:211](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/index.ts#L211)
|
184
src/api/js-waku/v0.14.2/classes/WakuStore.md
Normal file
184
src/api/js-waku/v0.14.2/classes/WakuStore.md
Normal file
@ -0,0 +1,184 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / WakuStore
|
||||
|
||||
# Class: WakuStore
|
||||
|
||||
Implements the [Waku v2 Store protocol](https://rfc.vac.dev/spec/13/).
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Constructors
|
||||
|
||||
- [constructor](WakuStore.md#constructor)
|
||||
|
||||
### Properties
|
||||
|
||||
- [decryptionKeys](WakuStore.md#decryptionkeys)
|
||||
- [libp2p](WakuStore.md#libp2p)
|
||||
- [pubSubTopic](WakuStore.md#pubsubtopic)
|
||||
|
||||
### Accessors
|
||||
|
||||
- [peers](WakuStore.md#peers)
|
||||
- [randomPeer](WakuStore.md#randompeer)
|
||||
|
||||
### Methods
|
||||
|
||||
- [addDecryptionKey](WakuStore.md#adddecryptionkey)
|
||||
- [deleteDecryptionKey](WakuStore.md#deletedecryptionkey)
|
||||
- [queryHistory](WakuStore.md#queryhistory)
|
||||
|
||||
## Constructors
|
||||
|
||||
### constructor
|
||||
|
||||
• **new WakuStore**(`libp2p`, `options?`)
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `libp2p` | `Libp2p` |
|
||||
| `options?` | `CreateOptions` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:101](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L101)
|
||||
|
||||
## Properties
|
||||
|
||||
### decryptionKeys
|
||||
|
||||
• **decryptionKeys**: `Set`<`Uint8Array`\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:99](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L99)
|
||||
|
||||
___
|
||||
|
||||
### libp2p
|
||||
|
||||
• **libp2p**: `Libp2p`
|
||||
|
||||
___
|
||||
|
||||
### pubSubTopic
|
||||
|
||||
• **pubSubTopic**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:98](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L98)
|
||||
|
||||
## Accessors
|
||||
|
||||
### peers
|
||||
|
||||
• `get` **peers**(): `Peer`[]
|
||||
|
||||
Returns known peers from the address book (`libp2p.peerStore`) that support
|
||||
store protocol. Waku may or may not be currently connected to these peers.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Peer`[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:269](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L269)
|
||||
|
||||
___
|
||||
|
||||
### randomPeer
|
||||
|
||||
• `get` **randomPeer**(): `undefined` \| `Peer`
|
||||
|
||||
Returns a random peer that supports store protocol from the address
|
||||
book (`libp2p.peerStore`). Waku may or may not be currently connected to
|
||||
this peer.
|
||||
|
||||
#### Returns
|
||||
|
||||
`undefined` \| `Peer`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:278](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L278)
|
||||
|
||||
## Methods
|
||||
|
||||
### addDecryptionKey
|
||||
|
||||
▸ **addDecryptionKey**(`key`): `void`
|
||||
|
||||
Register a decryption key to attempt decryption of messages received in any
|
||||
subsequent [queryHistory](WakuStore.md#queryhistory) call. This can either be a private key for
|
||||
asymmetric encryption or a symmetric key. [WakuStore](WakuStore.md) will attempt to
|
||||
decrypt messages using both methods.
|
||||
|
||||
Strings must be in hex format.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:251](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L251)
|
||||
|
||||
___
|
||||
|
||||
### deleteDecryptionKey
|
||||
|
||||
▸ **deleteDecryptionKey**(`key`): `void`
|
||||
|
||||
Delete a decryption key that was used to attempt decryption of messages
|
||||
received in subsequent [queryHistory](WakuStore.md#queryhistory) calls.
|
||||
|
||||
Strings must be in hex format.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `key` | `string` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`void`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:261](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L261)
|
||||
|
||||
___
|
||||
|
||||
### queryHistory
|
||||
|
||||
▸ **queryHistory**(`contentTopics`, `options?`): `Promise`<[`WakuMessage`](WakuMessage.md)[]\>
|
||||
|
||||
Do a History Query to a Waku Store.
|
||||
|
||||
**`throws`** If not able to reach a Waku Store peer to query
|
||||
or if an error is encountered when processing the reply.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `contentTopics` | `string`[] | The content topics to pass to the query, leave empty to retrieve all messages. |
|
||||
| `options?` | `QueryOptions` | - |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<[`WakuMessage`](WakuMessage.md)[]\>
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:120](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L120)
|
30
src/api/js-waku/v0.14.2/enums/PageDirection.md
Normal file
30
src/api/js-waku/v0.14.2/enums/PageDirection.md
Normal file
@ -0,0 +1,30 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / PageDirection
|
||||
|
||||
# Enumeration: PageDirection
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Enumeration members
|
||||
|
||||
- [BACKWARD](PageDirection.md#backward)
|
||||
- [FORWARD](PageDirection.md#forward)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### BACKWARD
|
||||
|
||||
• **BACKWARD** = `"backward"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/history_rpc.ts:7](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/history_rpc.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### FORWARD
|
||||
|
||||
• **FORWARD** = `"forward"`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/history_rpc.ts:8](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/history_rpc.ts#L8)
|
4
src/api/js-waku/v0.14.2/enums/README.md
Normal file
4
src/api/js-waku/v0.14.2/enums/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# enums
|
||||
|
||||
- [PagingInfo_Direction](proto.PagingInfo_Direction.md)
|
||||
- [PageDirection](PageDirection.md)
|
43
src/api/js-waku/v0.14.2/enums/proto.PagingInfo_Direction.md
Normal file
43
src/api/js-waku/v0.14.2/enums/proto.PagingInfo_Direction.md
Normal file
@ -0,0 +1,43 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / PagingInfo\_Direction
|
||||
|
||||
# Enumeration: PagingInfo\_Direction
|
||||
|
||||
[proto](../modules/proto.md).PagingInfo_Direction
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Enumeration members
|
||||
|
||||
- [DIRECTION\_BACKWARD\_UNSPECIFIED](proto.PagingInfo_Direction.md#direction_backward_unspecified)
|
||||
- [DIRECTION\_FORWARD](proto.PagingInfo_Direction.md#direction_forward)
|
||||
- [UNRECOGNIZED](proto.PagingInfo_Direction.md#unrecognized)
|
||||
|
||||
## Enumeration members
|
||||
|
||||
### DIRECTION\_BACKWARD\_UNSPECIFIED
|
||||
|
||||
• **DIRECTION\_BACKWARD\_UNSPECIFIED** = `0`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:21](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L21)
|
||||
|
||||
___
|
||||
|
||||
### DIRECTION\_FORWARD
|
||||
|
||||
• **DIRECTION\_FORWARD** = `1`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:22](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L22)
|
||||
|
||||
___
|
||||
|
||||
### UNRECOGNIZED
|
||||
|
||||
• **UNRECOGNIZED** = `-1`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:23](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L23)
|
30
src/api/js-waku/v0.14.2/interfaces/PushResponse.md
Normal file
30
src/api/js-waku/v0.14.2/interfaces/PushResponse.md
Normal file
@ -0,0 +1,30 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / PushResponse
|
||||
|
||||
# Interface: PushResponse
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [info](PushResponse.md#info)
|
||||
- [isSuccess](PushResponse.md#issuccess)
|
||||
|
||||
## Properties
|
||||
|
||||
### info
|
||||
|
||||
• **info**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/light_push.ts:15](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/light_push.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### isSuccess
|
||||
|
||||
• **isSuccess**: `boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/light_push.ts:14](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/light_push.ts#L14)
|
10
src/api/js-waku/v0.14.2/interfaces/README.md
Normal file
10
src/api/js-waku/v0.14.2/interfaces/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# interfaces
|
||||
|
||||
- [proto.Index](proto.Index.md)
|
||||
- [proto.HistoryRPC](proto.HistoryRPC.md)
|
||||
- [proto.HistoryQuery](proto.HistoryQuery.md)
|
||||
- [proto.WakuMessage](proto.WakuMessage.md)
|
||||
- [PushResponse](PushResponse.md)
|
||||
- [proto.HistoryResponse](proto.HistoryResponse.md)
|
||||
- [proto.ContentFilter](proto.ContentFilter.md)
|
||||
- [proto.PagingInfo](proto.PagingInfo.md)
|
21
src/api/js-waku/v0.14.2/interfaces/proto.ContentFilter.md
Normal file
21
src/api/js-waku/v0.14.2/interfaces/proto.ContentFilter.md
Normal file
@ -0,0 +1,21 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / ContentFilter
|
||||
|
||||
# Interface: ContentFilter
|
||||
|
||||
[proto](../modules/proto.md).ContentFilter
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [contentTopic](proto.ContentFilter.md#contenttopic)
|
||||
|
||||
## Properties
|
||||
|
||||
### contentTopic
|
||||
|
||||
• **contentTopic**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:57](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L57)
|
65
src/api/js-waku/v0.14.2/interfaces/proto.HistoryQuery.md
Normal file
65
src/api/js-waku/v0.14.2/interfaces/proto.HistoryQuery.md
Normal file
@ -0,0 +1,65 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / HistoryQuery
|
||||
|
||||
# Interface: HistoryQuery
|
||||
|
||||
[proto](../modules/proto.md).HistoryQuery
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [contentFilters](proto.HistoryQuery.md#contentfilters)
|
||||
- [endTime](proto.HistoryQuery.md#endtime)
|
||||
- [pagingInfo](proto.HistoryQuery.md#paginginfo)
|
||||
- [pubSubTopic](proto.HistoryQuery.md#pubsubtopic)
|
||||
- [startTime](proto.HistoryQuery.md#starttime)
|
||||
|
||||
## Properties
|
||||
|
||||
### contentFilters
|
||||
|
||||
• **contentFilters**: [`ContentFilter`](../modules/proto.md#contentfilter)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:62](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L62)
|
||||
|
||||
___
|
||||
|
||||
### endTime
|
||||
|
||||
• `Optional` **endTime**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:65](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L65)
|
||||
|
||||
___
|
||||
|
||||
### pagingInfo
|
||||
|
||||
• `Optional` **pagingInfo**: [`PagingInfo`](../modules/proto.md#paginginfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:63](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L63)
|
||||
|
||||
___
|
||||
|
||||
### pubSubTopic
|
||||
|
||||
• `Optional` **pubSubTopic**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:61](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L61)
|
||||
|
||||
___
|
||||
|
||||
### startTime
|
||||
|
||||
• `Optional` **startTime**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:64](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L64)
|
43
src/api/js-waku/v0.14.2/interfaces/proto.HistoryRPC.md
Normal file
43
src/api/js-waku/v0.14.2/interfaces/proto.HistoryRPC.md
Normal file
@ -0,0 +1,43 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / HistoryRPC
|
||||
|
||||
# Interface: HistoryRPC
|
||||
|
||||
[proto](../modules/proto.md).HistoryRPC
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [query](proto.HistoryRPC.md#query)
|
||||
- [requestId](proto.HistoryRPC.md#requestid)
|
||||
- [response](proto.HistoryRPC.md#response)
|
||||
|
||||
## Properties
|
||||
|
||||
### query
|
||||
|
||||
• **query**: `undefined` \| [`HistoryQuery`](../modules/proto.md#historyquery)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:112](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L112)
|
||||
|
||||
___
|
||||
|
||||
### requestId
|
||||
|
||||
• **requestId**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:111](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L111)
|
||||
|
||||
___
|
||||
|
||||
### response
|
||||
|
||||
• **response**: `undefined` \| [`HistoryResponse`](../modules/proto.md#historyresponse)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:113](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L113)
|
43
src/api/js-waku/v0.14.2/interfaces/proto.HistoryResponse.md
Normal file
43
src/api/js-waku/v0.14.2/interfaces/proto.HistoryResponse.md
Normal file
@ -0,0 +1,43 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / HistoryResponse
|
||||
|
||||
# Interface: HistoryResponse
|
||||
|
||||
[proto](../modules/proto.md).HistoryResponse
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [error](proto.HistoryResponse.md#error)
|
||||
- [messages](proto.HistoryResponse.md#messages)
|
||||
- [pagingInfo](proto.HistoryResponse.md#paginginfo)
|
||||
|
||||
## Properties
|
||||
|
||||
### error
|
||||
|
||||
• **error**: `HistoryResponse_Error`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:71](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L71)
|
||||
|
||||
___
|
||||
|
||||
### messages
|
||||
|
||||
• **messages**: [`WakuMessage`](../modules/proto.md#wakumessage)[]
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:69](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L69)
|
||||
|
||||
___
|
||||
|
||||
### pagingInfo
|
||||
|
||||
• **pagingInfo**: `undefined` \| [`PagingInfo`](../modules/proto.md#paginginfo)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:70](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L70)
|
43
src/api/js-waku/v0.14.2/interfaces/proto.Index.md
Normal file
43
src/api/js-waku/v0.14.2/interfaces/proto.Index.md
Normal file
@ -0,0 +1,43 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / Index
|
||||
|
||||
# Interface: Index
|
||||
|
||||
[proto](../modules/proto.md).Index
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [digest](proto.Index.md#digest)
|
||||
- [receivedTime](proto.Index.md#receivedtime)
|
||||
- [senderTime](proto.Index.md#sendertime)
|
||||
|
||||
## Properties
|
||||
|
||||
### digest
|
||||
|
||||
• **digest**: `Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:9](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### receivedTime
|
||||
|
||||
• **receivedTime**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:10](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L10)
|
||||
|
||||
___
|
||||
|
||||
### senderTime
|
||||
|
||||
• **senderTime**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:11](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L11)
|
43
src/api/js-waku/v0.14.2/interfaces/proto.PagingInfo.md
Normal file
43
src/api/js-waku/v0.14.2/interfaces/proto.PagingInfo.md
Normal file
@ -0,0 +1,43 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / PagingInfo
|
||||
|
||||
# Interface: PagingInfo
|
||||
|
||||
[proto](../modules/proto.md).PagingInfo
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [cursor](proto.PagingInfo.md#cursor)
|
||||
- [direction](proto.PagingInfo.md#direction)
|
||||
- [pageSize](proto.PagingInfo.md#pagesize)
|
||||
|
||||
## Properties
|
||||
|
||||
### cursor
|
||||
|
||||
• **cursor**: `undefined` \| [`Index`](../modules/proto.md#index)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:16](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L16)
|
||||
|
||||
___
|
||||
|
||||
### direction
|
||||
|
||||
• **direction**: [`PagingInfo_Direction`](../enums/proto.PagingInfo_Direction.md)
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:17](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L17)
|
||||
|
||||
___
|
||||
|
||||
### pageSize
|
||||
|
||||
• **pageSize**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:15](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L15)
|
54
src/api/js-waku/v0.14.2/interfaces/proto.WakuMessage.md
Normal file
54
src/api/js-waku/v0.14.2/interfaces/proto.WakuMessage.md
Normal file
@ -0,0 +1,54 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / [proto](../modules/proto.md) / WakuMessage
|
||||
|
||||
# Interface: WakuMessage
|
||||
|
||||
[proto](../modules/proto.md).WakuMessage
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Properties
|
||||
|
||||
- [contentTopic](proto.WakuMessage.md#contenttopic)
|
||||
- [payload](proto.WakuMessage.md#payload)
|
||||
- [timestamp](proto.WakuMessage.md#timestamp)
|
||||
- [version](proto.WakuMessage.md#version)
|
||||
|
||||
## Properties
|
||||
|
||||
### contentTopic
|
||||
|
||||
• `Optional` **contentTopic**: `string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/message.ts:9](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/message.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### payload
|
||||
|
||||
• `Optional` **payload**: `Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/message.ts:8](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/message.ts#L8)
|
||||
|
||||
___
|
||||
|
||||
### timestamp
|
||||
|
||||
• `Optional` **timestamp**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/message.ts:11](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/message.ts#L11)
|
||||
|
||||
___
|
||||
|
||||
### version
|
||||
|
||||
• `Optional` **version**: `number`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/message.ts:10](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/message.ts#L10)
|
193
src/api/js-waku/v0.14.2/modules.md
Normal file
193
src/api/js-waku/v0.14.2/modules.md
Normal file
@ -0,0 +1,193 @@
|
||||
[js-waku](README.md) / Exports
|
||||
|
||||
# js-waku
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Namespaces
|
||||
|
||||
- [proto](modules/proto.md)
|
||||
- [utils](modules/utils.md)
|
||||
|
||||
### Enumerations
|
||||
|
||||
- [PageDirection](enums/PageDirection.md)
|
||||
|
||||
### Classes
|
||||
|
||||
- [Waku](classes/Waku.md)
|
||||
- [WakuLightPush](classes/WakuLightPush.md)
|
||||
- [WakuMessage](classes/WakuMessage.md)
|
||||
- [WakuRelay](classes/WakuRelay.md)
|
||||
- [WakuStore](classes/WakuStore.md)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- [PushResponse](interfaces/PushResponse.md)
|
||||
|
||||
### Variables
|
||||
|
||||
- [DefaultPubSubTopic](modules.md#defaultpubsubtopic)
|
||||
- [LightPushCodec](modules.md#lightpushcodec)
|
||||
- [PushResponse](modules.md#pushresponse)
|
||||
- [RelayCodecs](modules.md#relaycodecs)
|
||||
- [StoreCodec](modules.md#storecodec)
|
||||
|
||||
### Functions
|
||||
|
||||
- [generatePrivateKey](modules.md#generateprivatekey)
|
||||
- [generateSymmetricKey](modules.md#generatesymmetrickey)
|
||||
- [getBootstrapNodes](modules.md#getbootstrapnodes)
|
||||
- [getPublicKey](modules.md#getpublickey)
|
||||
|
||||
## Variables
|
||||
|
||||
### DefaultPubSubTopic
|
||||
|
||||
• **DefaultPubSubTopic**: ``"/waku/2/default-waku/proto"``
|
||||
|
||||
DefaultPubSubTopic is the default gossipsub topic to use for Waku.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku.ts:37](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku.ts#L37)
|
||||
|
||||
___
|
||||
|
||||
### LightPushCodec
|
||||
|
||||
• **LightPushCodec**: ``"/vac/waku/lightpush/2.0.0-beta1"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_light_push/index.ts:15](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_light_push/index.ts#L15)
|
||||
|
||||
___
|
||||
|
||||
### PushResponse
|
||||
|
||||
• **PushResponse**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`PushResponse`](modules.md#pushresponse) |
|
||||
| `encode` | (`message`: [`PushResponse`](modules.md#pushresponse), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`PushResponse`](modules.md#pushresponse) |
|
||||
| `fromPartial` | (`object`: { `info?`: `string` ; `isSuccess?`: `boolean` }) => [`PushResponse`](modules.md#pushresponse) |
|
||||
| `toJSON` | (`message`: [`PushResponse`](modules.md#pushresponse)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/light_push.ts:105](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/light_push.ts#L105)
|
||||
|
||||
___
|
||||
|
||||
### RelayCodecs
|
||||
|
||||
• **RelayCodecs**: `string`[]
|
||||
|
||||
RelayCodec is the libp2p identifier for the waku relay protocol
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_relay/constants.ts:7](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_relay/constants.ts#L7)
|
||||
|
||||
___
|
||||
|
||||
### StoreCodec
|
||||
|
||||
• **StoreCodec**: ``"/vac/waku/store/2.0.0-beta3"``
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_store/index.ts:19](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_store/index.ts#L19)
|
||||
|
||||
## Functions
|
||||
|
||||
### generatePrivateKey
|
||||
|
||||
▸ **generatePrivateKey**(): `Uint8Array`
|
||||
|
||||
Generate a new private key to be used for asymmetric encryption.
|
||||
|
||||
Use [getPublicKey](modules.md#getpublickey) to get the corresponding Public Key.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/version_1.ts:181](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/version_1.ts#L181)
|
||||
|
||||
___
|
||||
|
||||
### generateSymmetricKey
|
||||
|
||||
▸ **generateSymmetricKey**(): `Uint8Array`
|
||||
|
||||
Generate a new symmetric key to be used for symmetric encryption.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/version_1.ts:188](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/version_1.ts#L188)
|
||||
|
||||
___
|
||||
|
||||
### getBootstrapNodes
|
||||
|
||||
▸ **getBootstrapNodes**(`path?`, `url?`, `wantedNumber?`): `Promise`<`string`[]\>
|
||||
|
||||
GET list of nodes from remote HTTP host.
|
||||
|
||||
Default behaviour is to return nodes hosted by Status.
|
||||
|
||||
**`throws`** If the remote host is unreachable or the response cannot be parsed
|
||||
according to the passed _path_.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :------ | :------ | :------ | :------ |
|
||||
| `path` | `string`[] | `undefined` | The property path to access the node list. The result should be a string, a string array or an object. If the result is an object then the values of the objects are used as multiaddresses. For example, if the GET request returns `{ foo: { bar: [address1, address2] } }` then `path` should be `[ "foo", "bar" ]`. |
|
||||
| `url` | `string` | `'https://fleets.status.im/'` | Remote host containing bootstrap peers in JSON format. |
|
||||
| `wantedNumber` | `number` | `DefaultWantedNumber` | The number of connections desired. Defaults to [DefaultWantedNumber]. |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Promise`<`string`[]\>
|
||||
|
||||
An array of multiaddresses.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/discovery.ts:26](https://github.com/status-im/js-waku/blob/31325bb/src/lib/discovery.ts#L26)
|
||||
|
||||
___
|
||||
|
||||
### getPublicKey
|
||||
|
||||
▸ **getPublicKey**(`privateKey`): `Uint8Array`
|
||||
|
||||
Return the public key for the given private key, to be used for asymmetric
|
||||
encryption.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `privateKey` | `Buffer` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Uint8Array`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/waku_message/version_1.ts:196](https://github.com/status-im/js-waku/blob/31325bb/src/lib/waku_message/version_1.ts#L196)
|
4
src/api/js-waku/v0.14.2/modules/README.md
Normal file
4
src/api/js-waku/v0.14.2/modules/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# modules
|
||||
|
||||
- [proto](proto.md)
|
||||
- [utils](utils.md)
|
169
src/api/js-waku/v0.14.2/modules/proto.md
Normal file
169
src/api/js-waku/v0.14.2/modules/proto.md
Normal file
@ -0,0 +1,169 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / proto
|
||||
|
||||
# Namespace: proto
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Enumerations
|
||||
|
||||
- [PagingInfo\_Direction](../enums/proto.PagingInfo_Direction.md)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- [ContentFilter](../interfaces/proto.ContentFilter.md)
|
||||
- [HistoryQuery](../interfaces/proto.HistoryQuery.md)
|
||||
- [HistoryRPC](../interfaces/proto.HistoryRPC.md)
|
||||
- [HistoryResponse](../interfaces/proto.HistoryResponse.md)
|
||||
- [Index](../interfaces/proto.Index.md)
|
||||
- [PagingInfo](../interfaces/proto.PagingInfo.md)
|
||||
- [WakuMessage](../interfaces/proto.WakuMessage.md)
|
||||
|
||||
### Variables
|
||||
|
||||
- [ContentFilter](proto.md#contentfilter)
|
||||
- [HistoryQuery](proto.md#historyquery)
|
||||
- [HistoryRPC](proto.md#historyrpc)
|
||||
- [HistoryResponse](proto.md#historyresponse)
|
||||
- [Index](proto.md#index)
|
||||
- [PagingInfo](proto.md#paginginfo)
|
||||
- [WakuMessage](proto.md#wakumessage)
|
||||
|
||||
## Variables
|
||||
|
||||
### ContentFilter
|
||||
|
||||
• **ContentFilter**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`ContentFilter`](proto.md#contentfilter) |
|
||||
| `encode` | (`message`: [`ContentFilter`](proto.md#contentfilter), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`ContentFilter`](proto.md#contentfilter) |
|
||||
| `fromPartial` | (`object`: { `contentTopic?`: `string` }) => [`ContentFilter`](proto.md#contentfilter) |
|
||||
| `toJSON` | (`message`: [`ContentFilter`](proto.md#contentfilter)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:305](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L305)
|
||||
|
||||
___
|
||||
|
||||
### HistoryQuery
|
||||
|
||||
• **HistoryQuery**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`HistoryQuery`](proto.md#historyquery) |
|
||||
| `encode` | (`message`: [`HistoryQuery`](proto.md#historyquery), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`HistoryQuery`](proto.md#historyquery) |
|
||||
| `fromPartial` | (`object`: { `contentFilters?`: { contentTopic?: string \| undefined; }[] ; `endTime?`: `number` ; `pagingInfo?`: { pageSize?: number \| undefined; cursor?: { digest?: Uint8Array \| undefined; receivedTime?: number \| undefined; senderTime?: number \| undefined; } \| undefined; direction?: PagingInfo\_Direction \| undefined; } ; `pubSubTopic?`: `string` ; `startTime?`: `number` }) => [`HistoryQuery`](proto.md#historyquery) |
|
||||
| `toJSON` | (`message`: [`HistoryQuery`](proto.md#historyquery)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:364](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L364)
|
||||
|
||||
___
|
||||
|
||||
### HistoryRPC
|
||||
|
||||
• **HistoryRPC**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`HistoryRPC`](proto.md#historyrpc) |
|
||||
| `encode` | (`message`: [`HistoryRPC`](proto.md#historyrpc), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`HistoryRPC`](proto.md#historyrpc) |
|
||||
| `fromPartial` | (`object`: { `query?`: { pubSubTopic?: string \| undefined; contentFilters?: { contentTopic?: string \| undefined; }[] \| undefined; pagingInfo?: { pageSize?: number \| undefined; cursor?: { digest?: Uint8Array \| undefined; receivedTime?: number \| undefined; senderTime?: number \| undefined; } \| undefined; direction?: PagingInfo\_Direction \| un... ; `requestId?`: `string` ; `response?`: { messages?: { payload?: Uint8Array \| undefined; contentTopic?: string \| undefined; version?: number \| undefined; timestamp?: number \| undefined; }[] \| undefined; pagingInfo?: { ...; } \| undefined; error?: HistoryResponse\_Error \| undefined; } }) => [`HistoryRPC`](proto.md#historyrpc) |
|
||||
| `toJSON` | (`message`: [`HistoryRPC`](proto.md#historyrpc)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:610](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L610)
|
||||
|
||||
___
|
||||
|
||||
### HistoryResponse
|
||||
|
||||
• **HistoryResponse**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`HistoryResponse`](proto.md#historyresponse) |
|
||||
| `encode` | (`message`: [`HistoryResponse`](proto.md#historyresponse), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`HistoryResponse`](proto.md#historyresponse) |
|
||||
| `fromPartial` | (`object`: { `error?`: `HistoryResponse_Error` ; `messages?`: { payload?: Uint8Array \| undefined; contentTopic?: string \| undefined; version?: number \| undefined; timestamp?: number \| undefined; }[] ; `pagingInfo?`: { pageSize?: number \| undefined; cursor?: { digest?: Uint8Array \| undefined; receivedTime?: number \| undefined; senderTime?: number \| undefined; } \| undefined; direction?: PagingInfo\_Direction \| undefined; } }) => [`HistoryResponse`](proto.md#historyresponse) |
|
||||
| `toJSON` | (`message`: [`HistoryResponse`](proto.md#historyresponse)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:505](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L505)
|
||||
|
||||
___
|
||||
|
||||
### Index
|
||||
|
||||
• **Index**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`Index`](proto.md#index) |
|
||||
| `encode` | (`message`: [`Index`](proto.md#index), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`Index`](proto.md#index) |
|
||||
| `fromPartial` | (`object`: { `digest?`: `Uint8Array` ; `receivedTime?`: `number` ; `senderTime?`: `number` }) => [`Index`](proto.md#index) |
|
||||
| `toJSON` | (`message`: [`Index`](proto.md#index)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:118](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L118)
|
||||
|
||||
___
|
||||
|
||||
### PagingInfo
|
||||
|
||||
• **PagingInfo**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`PagingInfo`](proto.md#paginginfo) |
|
||||
| `encode` | (`message`: [`PagingInfo`](proto.md#paginginfo), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`PagingInfo`](proto.md#paginginfo) |
|
||||
| `fromPartial` | (`object`: { `cursor?`: { digest?: Uint8Array \| undefined; receivedTime?: number \| undefined; senderTime?: number \| undefined; } ; `direction?`: [`PagingInfo_Direction`](../enums/proto.PagingInfo_Direction.md) ; `pageSize?`: `number` }) => [`PagingInfo`](proto.md#paginginfo) |
|
||||
| `toJSON` | (`message`: [`PagingInfo`](proto.md#paginginfo)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/store.ts:211](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/store.ts#L211)
|
||||
|
||||
___
|
||||
|
||||
### WakuMessage
|
||||
|
||||
• **WakuMessage**: `Object`
|
||||
|
||||
#### Type declaration
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `decode` | (`input`: `Uint8Array` \| `Reader`, `length?`: `number`) => [`WakuMessage`](proto.md#wakumessage) |
|
||||
| `encode` | (`message`: [`WakuMessage`](proto.md#wakumessage), `writer`: `Writer`) => `Writer` |
|
||||
| `fromJSON` | (`object`: `any`) => [`WakuMessage`](proto.md#wakumessage) |
|
||||
| `fromPartial` | (`object`: { `contentTopic?`: `string` ; `payload?`: `Uint8Array` ; `timestamp?`: `number` ; `version?`: `number` }) => [`WakuMessage`](proto.md#wakumessage) |
|
||||
| `toJSON` | (`message`: [`WakuMessage`](proto.md#wakumessage)) => `unknown` |
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/proto/waku/v2/message.ts:16](https://github.com/status-im/js-waku/blob/31325bb/src/proto/waku/v2/message.ts#L16)
|
72
src/api/js-waku/v0.14.2/modules/utils.md
Normal file
72
src/api/js-waku/v0.14.2/modules/utils.md
Normal file
@ -0,0 +1,72 @@
|
||||
[js-waku](../README.md) / [Exports](../modules.md) / utils
|
||||
|
||||
# Namespace: utils
|
||||
|
||||
## Table of contents
|
||||
|
||||
### Functions
|
||||
|
||||
- [bufToHex](utils.md#buftohex)
|
||||
- [equalByteArrays](utils.md#equalbytearrays)
|
||||
- [hexToBuf](utils.md#hextobuf)
|
||||
|
||||
## Functions
|
||||
|
||||
### bufToHex
|
||||
|
||||
▸ **bufToHex**(`buf`): `string`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `buf` | `Buffer` \| `Uint8Array` \| `ArrayBuffer` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`string`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/utils.ts:9](https://github.com/status-im/js-waku/blob/31325bb/src/lib/utils.ts#L9)
|
||||
|
||||
___
|
||||
|
||||
### equalByteArrays
|
||||
|
||||
▸ **equalByteArrays**(`a`, `b`): `boolean`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `a` | `string` \| `Buffer` \| `Uint8Array` |
|
||||
| `b` | `string` \| `Buffer` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`boolean`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/utils.ts:14](https://github.com/status-im/js-waku/blob/31325bb/src/lib/utils.ts#L14)
|
||||
|
||||
___
|
||||
|
||||
### hexToBuf
|
||||
|
||||
▸ **hexToBuf**(`hex`): `Buffer`
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `hex` | `string` \| `Buffer` \| `Uint8Array` |
|
||||
|
||||
#### Returns
|
||||
|
||||
`Buffer`
|
||||
|
||||
#### Defined in
|
||||
|
||||
[src/lib/utils.ts:1](https://github.com/status-im/js-waku/blob/31325bb/src/lib/utils.ts#L1)
|
Loading…
x
Reference in New Issue
Block a user