diff --git a/eth-pm/package.json b/eth-pm/package.json index 8512129..c1ccc69 100644 --- a/eth-pm/package.json +++ b/eth-pm/package.json @@ -10,7 +10,7 @@ "@material-ui/icons": "^4.11.2", "ethers": "5.7.0", "fontsource-roboto": "^4.0.0", - "js-waku": "0.26.0", + "js-waku": "0.27.0", "protobufjs": "^7.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/eth-pm/pnpm-lock.yaml b/eth-pm/pnpm-lock.yaml index 7816f8a..e432093 100644 --- a/eth-pm/pnpm-lock.yaml +++ b/eth-pm/pnpm-lock.yaml @@ -14,7 +14,7 @@ specifiers: eslint: ^8.9.0 ethers: 5.7.0 fontsource-roboto: ^4.0.0 - js-waku: 0.26.0 + js-waku: 0.27.0 npm-run-all: ^4.1.5 prettier: ^2.5.1 protobufjs: ^7.1.0 @@ -31,7 +31,7 @@ dependencies: '@material-ui/icons': 4.11.3_upnjamd3tbaukgopcqqdlc7jbm ethers: 5.7.0 fontsource-roboto: 4.0.0 - js-waku: 0.26.0_undici@5.10.0 + js-waku: 0.27.0_undici@5.10.0 protobufjs: 7.1.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -47,7 +47,7 @@ devDependencies: eslint: 8.21.0 npm-run-all: 4.1.5 prettier: 2.7.1 - react-scripts: 5.0.1_e23e7evf6537qu7ubpbcii2cdu + react-scripts: 5.0.1_zqc2lflk57y5fs7vjdkkfoejyi typescript: 4.8.2 packages: @@ -119,6 +119,11 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/compat-data/7.19.0: + resolution: {integrity: sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/core/7.18.10: resolution: {integrity: sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw==} engines: {node: '>=6.9.0'} @@ -142,6 +147,29 @@ packages: - supports-color dev: true + /@babel/core/7.19.0: + resolution: {integrity: sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.0 + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.19.0 + '@babel/helper-compilation-targets': 7.19.0_@babel+core@7.19.0 + '@babel/helper-module-transforms': 7.19.0 + '@babel/helpers': 7.19.0 + '@babel/parser': 7.19.0 + '@babel/template': 7.18.10 + '@babel/traverse': 7.19.0 + '@babel/types': 7.19.0 + convert-source-map: 1.8.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.1 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/eslint-parser/7.18.9_xqt7ek4fk233nrovqiamjvck4u: resolution: {integrity: sha512-KzSGpMBggz4fKbRbWLNyPVTuQr6cmCcBhOyXTw/fieOVaw5oYAwcAj4a7UKcDYCPxQq+CG1NCDZH9e2JTXquiQ==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} @@ -165,6 +193,15 @@ packages: jsesc: 2.5.2 dev: true + /@babel/generator/7.19.0: + resolution: {integrity: sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.19.0 + '@jridgewell/gen-mapping': 0.3.2 + jsesc: 2.5.2 + dev: true + /@babel/helper-annotate-as-pure/7.18.6: resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} engines: {node: '>=6.9.0'} @@ -193,6 +230,19 @@ packages: semver: 6.3.0 dev: true + /@babel/helper-compilation-targets/7.19.0_@babel+core@7.19.0: + resolution: {integrity: sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.19.0 + '@babel/core': 7.19.0 + '@babel/helper-validator-option': 7.18.6 + browserslist: 4.21.3 + semver: 6.3.0 + dev: true + /@babel/helper-create-class-features-plugin/7.18.9_@babel+core@7.18.10: resolution: {integrity: sha512-WvypNAYaVh23QcjpMR24CwZY2Nz6hqdOcFdPbNpV56hL5H6KiFheO7Xm1aPdlLQ7d5emYZX7VZwPp9x3z+2opw==} engines: {node: '>=6.9.0'} @@ -258,6 +308,14 @@ packages: '@babel/types': 7.18.10 dev: true + /@babel/helper-function-name/7.19.0: + resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/types': 7.19.0 + dev: true + /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} @@ -295,6 +353,22 @@ packages: - supports-color dev: true + /@babel/helper-module-transforms/7.19.0: + resolution: {integrity: sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.18.6 + '@babel/template': 7.18.10 + '@babel/traverse': 7.19.0 + '@babel/types': 7.19.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/helper-optimise-call-expression/7.18.6: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} engines: {node: '>=6.9.0'} @@ -307,6 +381,11 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/helper-plugin-utils/7.19.0: + resolution: {integrity: sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-remap-async-to-generator/7.18.9_@babel+core@7.18.10: resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} engines: {node: '>=6.9.0'} @@ -394,6 +473,17 @@ packages: - supports-color dev: true + /@babel/helpers/7.19.0: + resolution: {integrity: sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/traverse': 7.19.0 + '@babel/types': 7.19.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/highlight/7.18.6: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} @@ -411,6 +501,14 @@ packages: '@babel/types': 7.18.10 dev: true + /@babel/parser/7.19.0: + resolution: {integrity: sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.19.0 + dev: true + /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@babel+core@7.18.10: resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==} engines: {node: '>=6.9.0'} @@ -708,6 +806,16 @@ packages: '@babel/helper-plugin-utils': 7.18.9 dev: true + /@babel/plugin-syntax-flow/7.18.6_@babel+core@7.19.0: + resolution: {integrity: sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.0 + '@babel/helper-plugin-utils': 7.18.9 + dev: true + /@babel/plugin-syntax-import-assertions/7.18.6_@babel+core@7.18.10: resolution: {integrity: sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ==} engines: {node: '>=6.9.0'} @@ -746,6 +854,16 @@ packages: '@babel/helper-plugin-utils': 7.18.9 dev: true + /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.19.0: + resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.0 + '@babel/helper-plugin-utils': 7.18.9 + dev: true + /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.18.10: resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: @@ -1154,6 +1272,20 @@ packages: '@babel/types': 7.18.10 dev: true + /@babel/plugin-transform-react-jsx/7.19.0_@babel+core@7.19.0: + resolution: {integrity: sha512-UVEvX3tXie3Szm3emi1+G63jyw1w5IcMY0FSKM+CRnKRI5Mr1YbCNgsSTwoTwKphQEG9P+QqmuRFneJPZuHNhg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.19.0 + '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-plugin-utils': 7.19.0 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.19.0 + '@babel/types': 7.19.0 + dev: true + /@babel/plugin-transform-react-pure-annotations/7.18.6_@babel+core@7.18.10: resolution: {integrity: sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==} engines: {node: '>=6.9.0'} @@ -1458,6 +1590,24 @@ packages: - supports-color dev: true + /@babel/traverse/7.19.0: + resolution: {integrity: sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.19.0 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.19.0 + '@babel/types': 7.19.0 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/types/7.18.10: resolution: {integrity: sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ==} engines: {node: '>=6.9.0'} @@ -1467,6 +1617,15 @@ packages: to-fast-properties: 2.0.0 dev: true + /@babel/types/7.19.0: + resolution: {integrity: sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.18.10 + '@babel/helper-validator-identifier': 7.18.6 + to-fast-properties: 2.0.0 + dev: true + /@bcoe/v8-coverage/0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true @@ -2847,8 +3006,8 @@ packages: - supports-color dev: false - /@libp2p/mplex/5.1.1_undici@5.10.0: - resolution: {integrity: sha512-a4hUUzHaFUmk6hx0lV6dveyOmHlOqB/MwDJJfIDyHvDILb2ZXGLJaI3JnbMYqPCwOCeSFkKu8Ixw5HphffV0Aw==} + /@libp2p/mplex/5.1.2_undici@5.10.0: + resolution: {integrity: sha512-PJcHwhUTXxtyG3lLjX9itBSPYuhReLn63KhJU8HsvFxi6KZC52mdOyDUuwMQr68QKcdZGP1K5sg5mRoC0U3PAw==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: '@libp2p/components': 2.0.4_undici@5.10.0 @@ -6042,7 +6201,7 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-react-app/7.0.1_4xxghbdbtpkpzboxb63ap6m5cq: + /eslint-config-react-app/7.0.1_2ylqirllgycyymgyhdbcrjlvlu: resolution: {integrity: sha512-K6rNzvkIeHaTd8m/QEh1Zko0KI7BACWkkneSs6s9cKZC/J27X3eZR6Upt1jkmZ/4FK+XUOPPxMEN7+lbUXfSlA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -6060,7 +6219,7 @@ packages: babel-preset-react-app: 10.0.1 confusing-browser-globals: 1.0.11 eslint: 8.21.0 - eslint-plugin-flowtype: 8.0.3_bfhyaeqlroxospgntnspvajiaq + eslint-plugin-flowtype: 8.0.3_v2k3klyshfzqdyz7lqhiiifqye eslint-plugin-import: 2.26.0_wuikv5nqgdfyng42xxm7lklfmi eslint-plugin-jest: 25.7.0_es3s5ega56ydzpv3u2fqyh4w34 eslint-plugin-jsx-a11y: 6.6.1_eslint@8.21.0 @@ -6112,7 +6271,7 @@ packages: - supports-color dev: true - /eslint-plugin-flowtype/8.0.3_bfhyaeqlroxospgntnspvajiaq: + /eslint-plugin-flowtype/8.0.3_v2k3klyshfzqdyz7lqhiiifqye: resolution: {integrity: sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -6120,8 +6279,8 @@ packages: '@babel/plugin-transform-react-jsx': ^7.14.9 eslint: ^8.1.0 dependencies: - '@babel/plugin-syntax-flow': 7.18.6_@babel+core@7.18.10 - '@babel/plugin-transform-react-jsx': 7.18.10_@babel+core@7.18.10 + '@babel/plugin-syntax-flow': 7.18.6_@babel+core@7.19.0 + '@babel/plugin-transform-react-jsx': 7.19.0_@babel+core@7.19.0 eslint: 8.21.0 lodash: 4.17.21 string-natural-compare: 3.0.1 @@ -8284,8 +8443,8 @@ packages: /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - /js-waku/0.26.0_undici@5.10.0: - resolution: {integrity: sha512-BcgMeYj9wYGNt4fs3lFUSLpFqQttpju4FAmVbB19oYK1IWR8nGKu52eLAFBrh0uH3r73Ud9PXG3I1099THqlOQ==} + /js-waku/0.27.0_undici@5.10.0: + resolution: {integrity: sha512-uIh1h2Gu+aEyrGb4qmyk2Sc91in3fMfOil0kdtrps9HnA7ESbC5c6d148LeJaxqH5rfOkrfXXIhw1zwA3hlauw==} engines: {node: '>=16'} dependencies: '@chainsafe/libp2p-gossipsub': 4.1.1_undici@5.10.0 @@ -8297,8 +8456,9 @@ packages: '@libp2p/interface-peer-id': 1.0.4 '@libp2p/interface-peer-info': 1.0.2_undici@5.10.0 '@libp2p/interface-peer-store': 1.2.1_undici@5.10.0 + '@libp2p/interface-pubsub': 2.0.1_undici@5.10.0 '@libp2p/interfaces': 3.0.3 - '@libp2p/mplex': 5.1.1_undici@5.10.0 + '@libp2p/mplex': 5.1.2_undici@5.10.0 '@libp2p/peer-id': 1.1.15 '@libp2p/websockets': 3.0.3_undici@5.10.0 '@multiformats/multiaddr': 10.4.0_undici@5.10.0 @@ -10560,7 +10720,7 @@ packages: engines: {node: '>=0.10.0'} dev: true - /react-scripts/5.0.1_e23e7evf6537qu7ubpbcii2cdu: + /react-scripts/5.0.1_zqc2lflk57y5fs7vjdkkfoejyi: resolution: {integrity: sha512-8VAmEm/ZAwQzJ+GOMLbBsTdDKOpuZh7RPs0UymvBR2vRk4iZWCskjbFnxqjrzoIvlNNRZ3QJFx6/qDSi6zSnaQ==} engines: {node: '>=14.0.0'} hasBin: true @@ -10588,7 +10748,7 @@ packages: dotenv: 10.0.0 dotenv-expand: 5.1.0 eslint: 8.21.0 - eslint-config-react-app: 7.0.1_4xxghbdbtpkpzboxb63ap6m5cq + eslint-config-react-app: 7.0.1_2ylqirllgycyymgyhdbcrjlvlu eslint-webpack-plugin: 3.2.0_u2suxbtqimpjcabkd5w2ufy4qm file-loader: 6.2.0_webpack@5.74.0 fs-extra: 10.1.0 diff --git a/eth-pm/src/App.tsx b/eth-pm/src/App.tsx index 78a9688..1648881 100644 --- a/eth-pm/src/App.tsx +++ b/eth-pm/src/App.tsx @@ -2,7 +2,7 @@ import "@ethersproject/shims"; import React, { useEffect, useState } from "react"; import "./App.css"; -import { Waku } from "js-waku"; +import type { WakuLight } from "js-waku/lib/interfaces"; import { KeyPair, PublicKeyMessageEncryptionKey } from "./crypto"; import { Message } from "./messaging/Messages"; import "fontsource-roboto"; @@ -67,7 +67,7 @@ const useStyles = makeStyles({ }); function App() { - const [waku, setWaku] = useState(); + const [waku, setWaku] = useState(); const [provider, setProvider] = useState(); const [encryptionKeyPair, setEncryptionKeyPair] = useState< KeyPair | undefined diff --git a/eth-pm/src/BroadcastPublicKey.tsx b/eth-pm/src/BroadcastPublicKey.tsx index 8b487f7..00423f5 100644 --- a/eth-pm/src/BroadcastPublicKey.tsx +++ b/eth-pm/src/BroadcastPublicKey.tsx @@ -6,13 +6,14 @@ import { PublicKeyMessageEncryptionKey, } from "./crypto"; import { PublicKeyMessage } from "./messaging/wire"; -import { WakuMessage, Waku } from "js-waku"; +import { WakuMessage } from "js-waku"; +import { WakuLight } from "js-waku/lib/interfaces"; import { PublicKeyContentTopic } from "./waku"; import type { TypedDataSigner } from "@ethersproject/abstract-signer"; interface Props { EncryptionKeyPair: KeyPair | undefined; - waku: Waku | undefined; + waku: WakuLight | undefined; address: string | undefined; signer: TypedDataSigner | undefined; } diff --git a/eth-pm/src/messaging/Messaging.tsx b/eth-pm/src/messaging/Messaging.tsx index 968f7c6..96ad52f 100644 --- a/eth-pm/src/messaging/Messaging.tsx +++ b/eth-pm/src/messaging/Messaging.tsx @@ -1,5 +1,5 @@ import Messages, { Message } from "./Messages"; -import { Waku } from "js-waku"; +import type { WakuLight } from "js-waku/lib/interfaces"; import SendMessage from "./SendMessage"; import { makeStyles } from "@material-ui/core"; @@ -13,7 +13,7 @@ const useStyles = makeStyles({ }); interface Props { - waku: Waku | undefined; + waku: WakuLight | undefined; recipients: Map; messages: Message[]; } diff --git a/eth-pm/src/messaging/SendMessage.tsx b/eth-pm/src/messaging/SendMessage.tsx index 21a385f..be0fe9e 100644 --- a/eth-pm/src/messaging/SendMessage.tsx +++ b/eth-pm/src/messaging/SendMessage.tsx @@ -7,7 +7,8 @@ import { TextField, } from "@material-ui/core"; import React, { ChangeEvent, useState, KeyboardEvent } from "react"; -import { utils, Waku, WakuMessage } from "js-waku"; +import { utils, WakuMessage } from "js-waku"; +import type { WakuLight } from "js-waku/lib/interfaces"; import { PrivateMessage } from "./wire"; import { PrivateMessageContentTopic } from "../waku"; @@ -22,7 +23,7 @@ const useStyles = makeStyles((theme) => ({ })); export interface Props { - waku: Waku | undefined; + waku: WakuLight | undefined; // address, public key recipients: Map; } @@ -120,7 +121,7 @@ async function encodeEncryptedWakuMessage( } function sendMessage( - waku: Waku, + waku: WakuLight, recipientAddress: string, recipientPublicKey: Uint8Array, message: string, diff --git a/eth-pm/src/waku.ts b/eth-pm/src/waku.ts index e7df8b3..3731547 100644 --- a/eth-pm/src/waku.ts +++ b/eth-pm/src/waku.ts @@ -1,22 +1,23 @@ import { Dispatch, SetStateAction } from "react"; -import { Protocols, utils, Waku, WakuMessage } from "js-waku"; +import { Protocols, utils, WakuMessage } from "js-waku"; +import type { WakuLight } from "js-waku/lib/interfaces"; import { PrivateMessage, PublicKeyMessage } from "./messaging/wire"; import { validatePublicKeyMessage } from "./crypto"; import { Message } from "./messaging/Messages"; import { equals } from "uint8arrays/equals"; -import { createWaku } from "js-waku/lib/create_waku"; import { PeerDiscoveryStaticPeers } from "js-waku/lib/peer_discovery_static_list"; import { getPredefinedBootstrapNodes, Fleet, } from "js-waku/lib/predefined_bootstrap_nodes"; import { waitForRemotePeer } from "js-waku/lib/wait_for_remote_peer"; +import { createLightNode } from "js-waku/lib/create_waku"; export const PublicKeyContentTopic = "/eth-pm/1/public-key/proto"; export const PrivateMessageContentTopic = "/eth-pm/1/private-message/proto"; -export async function initWaku(): Promise { - const waku = await createWaku({ +export async function initWaku(): Promise { + const waku = await createLightNode({ libp2p: { peerDiscovery: [ new PeerDiscoveryStaticPeers(getPredefinedBootstrapNodes(Fleet.Test)),