mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-05-23 17:49:28 +00:00
chore(eth-pm): bump @waku/core to 0.0.11 and other @waku/* pkgs
This commit is contained in:
parent
2820bd2579
commit
20bf22dff9
2207
examples/eth-pm/package-lock.json
generated
2207
examples/eth-pm/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||||
|
|||||||
@ -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 });
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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))
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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 });
|
||||||
|
|||||||
@ -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";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user