chore(eth-pm): bump @waku/core to 0.0.11 and other @waku/* pkgs (#221)
* chore(eth-pm): bump @waku/core to 0.0.11 and other @waku/* pkgs * chore(eth-pm): bump @waku/core to 0.0.16 and other @waku/* pkgs
This commit is contained in:
parent
6506aa286a
commit
2f419f4199
File diff suppressed because it is too large
Load Diff
|
@ -8,11 +8,11 @@
|
|||
"@ethersproject/providers": "5.7.0",
|
||||
"@material-ui/core": "^4.12.4",
|
||||
"@material-ui/icons": "^4.11.3",
|
||||
"@waku/byte-utils": "0.0.2",
|
||||
"@waku/core": "^0.0.10",
|
||||
"@waku/create": "^0.0.6",
|
||||
"@waku/interfaces": "^0.0.6",
|
||||
"@waku/message-encryption": "^0.0.7",
|
||||
"@waku/core": "^0.0.16",
|
||||
"@waku/create": "^0.0.12",
|
||||
"@waku/interfaces": "^0.0.11",
|
||||
"@waku/message-encryption": "^0.0.14",
|
||||
"@waku/utils": "0.0.4",
|
||||
"ethers": "5.7.1",
|
||||
"fontsource-roboto": "^4.0.0",
|
||||
"protobufjs": "^7.1.2",
|
||||
|
|
|
@ -117,7 +117,7 @@ function App() {
|
|||
|
||||
let unsubscribe: undefined | (() => Promise<void>);
|
||||
|
||||
waku.relay.addObserver(publicKeyMessageDecoder, observerPublicKeyMessage);
|
||||
waku.relay.subscribe(publicKeyMessageDecoder, observerPublicKeyMessage);
|
||||
|
||||
return function cleanUp() {
|
||||
if (typeof unsubscribe === "undefined") return;
|
||||
|
@ -152,7 +152,7 @@ function App() {
|
|||
|
||||
let unsubscribe: undefined | (() => Promise<void>);
|
||||
|
||||
waku.relay.addObserver(privateMessageDecoder, observerPrivateMessage);
|
||||
waku.relay.subscribe(privateMessageDecoder, observerPrivateMessage);
|
||||
|
||||
return function cleanUp() {
|
||||
if (typeof unsubscribe === "undefined") return;
|
||||
|
@ -164,7 +164,7 @@ function App() {
|
|||
if (!waku) return;
|
||||
|
||||
const interval = setInterval(async () => {
|
||||
const peers = waku.relay.getPeers();
|
||||
const peers = waku.relay.gossipSub.getPeers();
|
||||
|
||||
setPeerStats({
|
||||
relayPeers: peers.length,
|
||||
|
|
|
@ -47,12 +47,11 @@ export default function BroadcastPublicKey({
|
|||
})();
|
||||
const payload = _publicKeyMessage.encode();
|
||||
|
||||
const publicKeyMessageEncoder = createEncoder(
|
||||
PublicKeyContentTopic,
|
||||
PublicKeyMessageEncryptionKey,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
const publicKeyMessageEncoder = createEncoder({
|
||||
contentTopic: PublicKeyContentTopic,
|
||||
symKey: PublicKeyMessageEncryptionKey,
|
||||
ephemeral: true,
|
||||
});
|
||||
|
||||
await waku.relay.send(publicKeyMessageEncoder, { payload });
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ import { PublicKeyContentTopic } from "./waku";
|
|||
import { keccak256, _TypedDataEncoder, recoverAddress } from "ethers/lib/utils";
|
||||
import { equals } from "uint8arrays/equals";
|
||||
import type { TypedDataSigner } from "@ethersproject/abstract-signer";
|
||||
import { bytesToHex, hexToBytes, utf8ToBytes } from "@waku/byte-utils";
|
||||
import { bytesToHex, hexToBytes, utf8ToBytes } from "@waku/utils/bytes";
|
||||
|
||||
export const PublicKeyMessageEncryptionKey = hexToBytes(
|
||||
keccak256(utf8ToBytes(PublicKeyContentTopic))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { KeyPair } from "../crypto";
|
||||
import { bytesToHex, hexToBytes } from "@waku/byte-utils";
|
||||
import { bytesToHex, hexToBytes } from "@waku/utils/bytes";
|
||||
|
||||
/**
|
||||
* Save key pair to storage, encrypted with password
|
||||
|
|
|
@ -6,12 +6,12 @@ import {
|
|||
Select,
|
||||
TextField,
|
||||
} from "@material-ui/core";
|
||||
import React, { ChangeEvent, useState, KeyboardEvent } from "react";
|
||||
import React, { ChangeEvent, KeyboardEvent, useState } from "react";
|
||||
import type { RelayNode } from "@waku/interfaces";
|
||||
import { createEncoder } from "@waku/message-encryption/ecies";
|
||||
import { PrivateMessage } from "./wire";
|
||||
import { PrivateMessageContentTopic } from "../waku";
|
||||
import { hexToBytes } from "@waku/byte-utils";
|
||||
import { hexToBytes } from "@waku/utils/bytes";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
formControl: {
|
||||
|
@ -118,12 +118,11 @@ async function sendMessage(
|
|||
});
|
||||
const payload = privateMessage.encode();
|
||||
|
||||
const encoder = createEncoder(
|
||||
PrivateMessageContentTopic,
|
||||
recipientPublicKey,
|
||||
undefined,
|
||||
true
|
||||
);
|
||||
const encoder = createEncoder({
|
||||
contentTopic: PrivateMessageContentTopic,
|
||||
publicKey: recipientPublicKey,
|
||||
ephemeral: true,
|
||||
});
|
||||
|
||||
console.log("pushing");
|
||||
const res = await waku.relay.send(encoder, { payload });
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Message } from "./messaging/Messages";
|
|||
import { equals } from "uint8arrays/equals";
|
||||
import { waitForRemotePeer } from "@waku/core";
|
||||
import { createRelayNode } from "@waku/create";
|
||||
import { bytesToHex, hexToBytes } from "@waku/byte-utils";
|
||||
import { bytesToHex, hexToBytes } from "@waku/utils/bytes";
|
||||
import type { DecodedMessage } from "@waku/message-encryption";
|
||||
|
||||
export const PublicKeyContentTopic = "/eth-pm/1/public-key/proto";
|
||||
|
|
Loading…
Reference in New Issue