feat: set method and content topic to decryption keys

Not mandatory but it removes errors in the console.
This commit is contained in:
fryorcraken.eth 2022-08-29 15:12:22 +10:00
parent c82244c9e6
commit 3606654b4d
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 9 additions and 2 deletions

View File

@ -26,6 +26,7 @@ import {
} from "./waku"; } from "./waku";
import { Web3Provider } from "@ethersproject/providers/src.ts/web3-provider"; import { Web3Provider } from "@ethersproject/providers/src.ts/web3-provider";
import ConnectWallet from "./ConnectWallet"; import ConnectWallet from "./ConnectWallet";
import { waku_message } from "js-waku";
const theme = createMuiTheme({ const theme = createMuiTheme({
palette: { palette: {
@ -110,7 +111,10 @@ function App() {
let unsubscribe: undefined | (() => Promise<void>); let unsubscribe: undefined | (() => Promise<void>);
waku.filter.addDecryptionKey(PublicKeyMessageEncryptionKey); waku.filter.addDecryptionKey(PublicKeyMessageEncryptionKey, {
method: waku_message.DecryptionMethod.Symmetric,
contentTopics: [PublicKeyContentTopic],
});
waku.filter waku.filter
.subscribe(observerPublicKeyMessage, [PublicKeyContentTopic]) .subscribe(observerPublicKeyMessage, [PublicKeyContentTopic])
.then( .then(
@ -140,7 +144,10 @@ function App() {
if (!waku) return; if (!waku) return;
if (!encryptionKeyPair) return; if (!encryptionKeyPair) return;
waku.filter.addDecryptionKey(encryptionKeyPair.privateKey); waku.filter.addDecryptionKey(encryptionKeyPair.privateKey, {
method: waku_message.DecryptionMethod.Asymmetric,
contentTopics: [PrivateMessageContentTopic],
});
return function cleanUp() { return function cleanUp() {
if (!waku) return; if (!waku) return;