feat: set method and content topic to decryption keys
Not mandatory but it removes errors in the console.
This commit is contained in:
parent
c82244c9e6
commit
3606654b4d
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue