chore(eth-pm): bump @waku/core to 0.0.11 and other @waku/* pkgs

This commit is contained in:
fryorcraken.eth 2023-04-03 16:15:40 +10:00
parent 2820bd2579
commit 20bf22dff9
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
7 changed files with 927 additions and 1322 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,11 +8,11 @@
"@ethersproject/providers": "5.7.0", "@ethersproject/providers": "5.7.0",
"@material-ui/core": "^4.12.4", "@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.11.3", "@material-ui/icons": "^4.11.3",
"@waku/byte-utils": "0.0.2", "@waku/core": "^0.0.15",
"@waku/core": "^0.0.10", "@waku/create": "^0.0.11",
"@waku/create": "^0.0.6", "@waku/interfaces": "^0.0.10",
"@waku/interfaces": "^0.0.6", "@waku/message-encryption": "^0.0.13",
"@waku/message-encryption": "^0.0.7", "@waku/utils": "0.0.3",
"ethers": "5.7.1", "ethers": "5.7.1",
"fontsource-roboto": "^4.0.0", "fontsource-roboto": "^4.0.0",
"protobufjs": "^7.1.2", "protobufjs": "^7.1.2",

View File

@ -47,12 +47,11 @@ export default function BroadcastPublicKey({
})(); })();
const payload = _publicKeyMessage.encode(); const payload = _publicKeyMessage.encode();
const publicKeyMessageEncoder = createEncoder( const publicKeyMessageEncoder = createEncoder({
PublicKeyContentTopic, contentTopic: PublicKeyContentTopic,
PublicKeyMessageEncryptionKey, symKey: PublicKeyMessageEncryptionKey,
undefined, ephemeral: true,
true });
);
await waku.relay.send(publicKeyMessageEncoder, { payload }); await waku.relay.send(publicKeyMessageEncoder, { payload });
}; };

View File

@ -6,7 +6,7 @@ import { PublicKeyContentTopic } from "./waku";
import { keccak256, _TypedDataEncoder, recoverAddress } from "ethers/lib/utils"; import { keccak256, _TypedDataEncoder, recoverAddress } from "ethers/lib/utils";
import { equals } from "uint8arrays/equals"; import { equals } from "uint8arrays/equals";
import type { TypedDataSigner } from "@ethersproject/abstract-signer"; 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( export const PublicKeyMessageEncryptionKey = hexToBytes(
keccak256(utf8ToBytes(PublicKeyContentTopic)) keccak256(utf8ToBytes(PublicKeyContentTopic))

View File

@ -1,5 +1,5 @@
import { KeyPair } from "../crypto"; 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 * Save key pair to storage, encrypted with password

View File

@ -6,12 +6,12 @@ import {
Select, Select,
TextField, TextField,
} from "@material-ui/core"; } 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 type { RelayNode } from "@waku/interfaces";
import { createEncoder } from "@waku/message-encryption/ecies"; import { createEncoder } from "@waku/message-encryption/ecies";
import { PrivateMessage } from "./wire"; import { PrivateMessage } from "./wire";
import { PrivateMessageContentTopic } from "../waku"; import { PrivateMessageContentTopic } from "../waku";
import { hexToBytes } from "@waku/byte-utils"; import { hexToBytes } from "@waku/utils/bytes";
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
formControl: { formControl: {
@ -118,12 +118,11 @@ async function sendMessage(
}); });
const payload = privateMessage.encode(); const payload = privateMessage.encode();
const encoder = createEncoder( const encoder = createEncoder({
PrivateMessageContentTopic, contentTopic: PrivateMessageContentTopic,
recipientPublicKey, publicKey: recipientPublicKey,
undefined, ephemeral: true,
true });
);
console.log("pushing"); console.log("pushing");
const res = await waku.relay.send(encoder, { payload }); const res = await waku.relay.send(encoder, { payload });

View File

@ -7,7 +7,7 @@ import { Message } from "./messaging/Messages";
import { equals } from "uint8arrays/equals"; import { equals } from "uint8arrays/equals";
import { waitForRemotePeer } from "@waku/core"; import { waitForRemotePeer } from "@waku/core";
import { createRelayNode } from "@waku/create"; 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"; import type { DecodedMessage } from "@waku/message-encryption";
export const PublicKeyContentTopic = "/eth-pm/1/public-key/proto"; export const PublicKeyContentTopic = "/eth-pm/1/public-key/proto";