@waku/message-encryption 0.0.35-c7fe44e.0 → 0.0.36-3545a8e.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -101,6 +101,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
101
101
  * @waku/interfaces bumped from 0.0.27 to 0.0.28
102
102
  * @waku/utils bumped from 0.0.20 to 0.0.21
103
103
 
104
+ ## [0.0.35](https://github.com/waku-org/js-waku/compare/message-encryption-v0.0.34...message-encryption-v0.0.35) (2025-07-18)
105
+
106
+
107
+ ### Dependencies
108
+
109
+ * The following workspace dependencies were updated
110
+ * dependencies
111
+ * @waku/core bumped from 0.0.36 to 0.0.37
112
+ * @waku/interfaces bumped from 0.0.31 to 0.0.32
113
+ * @waku/proto bumped from 0.0.11 to 0.0.12
114
+ * @waku/utils bumped from 0.0.24 to 0.0.25
115
+
104
116
  ## [0.0.34](https://github.com/waku-org/js-waku/compare/message-encryption-v0.0.33...message-encryption-v0.0.34) (2025-06-23)
105
117
 
106
118
 
package/bundle/crypto.js CHANGED
@@ -1 +1 @@
1
- export { e as ecies, g as generatePrivateKey, a as generateSymmetricKey, b as getPublicKey, c as getSubtle, k as keccak256, r as randomBytes, s as sha256, d as sign, f as symmetric } from './symmetric-DPlNQ4aL.js';
1
+ export { e as ecies, g as generatePrivateKey, a as generateSymmetricKey, b as getPublicKey, c as getSubtle, k as keccak256, r as randomBytes, s as sha256, d as sign, f as symmetric } from './symmetric-B5XVN0Wd.js';
@@ -1,17 +1,17 @@
1
- import { L as Logger, d as determinePubsubTopic, W as WakuMessage, p as preCipher, e as encryptAsymmetric, D as Decoder$1, a as decryptAsymmetric, b as postCipher, c as DecodedMessage } from './encryption-D_9ex828.js';
2
- import { O as OneMillion, V as Version, g as generatePrivateKey } from './symmetric-DPlNQ4aL.js';
1
+ import { L as Logger, W as WakuMessage, p as preCipher, e as encryptAsymmetric, D as Decoder$1, d as decryptAsymmetric, a as postCipher, b as DecodedMessage } from './encryption-DCdb0Qpb.js';
2
+ import { O as OneMillion, V as Version, g as generatePrivateKey } from './symmetric-B5XVN0Wd.js';
3
3
 
4
4
  const log = new Logger("message-encryption:ecies");
5
5
  class Encoder {
6
- pubsubTopic;
7
6
  contentTopic;
7
+ routingInfo;
8
8
  publicKey;
9
9
  sigPrivKey;
10
10
  ephemeral;
11
11
  metaSetter;
12
- constructor(pubsubTopic, contentTopic, publicKey, sigPrivKey, ephemeral = false, metaSetter) {
13
- this.pubsubTopic = pubsubTopic;
12
+ constructor(contentTopic, routingInfo, publicKey, sigPrivKey, ephemeral = false, metaSetter) {
14
13
  this.contentTopic = contentTopic;
14
+ this.routingInfo = routingInfo;
15
15
  this.publicKey = publicKey;
16
16
  this.sigPrivKey = sigPrivKey;
17
17
  this.ephemeral = ephemeral;
@@ -20,6 +20,9 @@ class Encoder {
20
20
  throw new Error("Content topic must be specified");
21
21
  }
22
22
  }
23
+ get pubsubTopic() {
24
+ return this.routingInfo.pubsubTopic;
25
+ }
23
26
  async toWire(message) {
24
27
  const protoMessage = await this.toProtoObj(message);
25
28
  if (!protoMessage)
@@ -58,13 +61,13 @@ class Encoder {
58
61
  * The payload can optionally be signed with the given private key as defined
59
62
  * in [26/WAKU2-PAYLOAD](https://rfc.vac.dev/spec/26/).
60
63
  */
61
- function createEncoder({ pubsubTopic, pubsubTopicShardInfo, contentTopic, publicKey, sigPrivKey, ephemeral = false, metaSetter }) {
62
- return new Encoder(determinePubsubTopic(contentTopic, pubsubTopic ?? pubsubTopicShardInfo), contentTopic, publicKey, sigPrivKey, ephemeral, metaSetter);
64
+ function createEncoder({ contentTopic, routingInfo, publicKey, sigPrivKey, ephemeral = false, metaSetter }) {
65
+ return new Encoder(contentTopic, routingInfo, publicKey, sigPrivKey, ephemeral, metaSetter);
63
66
  }
64
67
  class Decoder extends Decoder$1 {
65
68
  privateKey;
66
- constructor(pubsubTopic, contentTopic, privateKey) {
67
- super(pubsubTopic, contentTopic);
69
+ constructor(contentTopic, routingInfo, privateKey) {
70
+ super(contentTopic, routingInfo);
68
71
  this.privateKey = privateKey;
69
72
  }
70
73
  async fromProtoObj(pubsubTopic, protoMessage) {
@@ -104,10 +107,11 @@ class Decoder extends Decoder$1 {
104
107
  * decode incoming messages.
105
108
  *
106
109
  * @param contentTopic The resulting decoder will only decode messages with this content topic.
110
+ * @param routingInfo
107
111
  * @param privateKey The private key used to decrypt the message.
108
112
  */
109
- function createDecoder(contentTopic, privateKey, pubsubTopicShardInfo) {
110
- return new Decoder(determinePubsubTopic(contentTopic, pubsubTopicShardInfo), contentTopic, privateKey);
113
+ function createDecoder(contentTopic, routingInfo, privateKey) {
114
+ return new Decoder(contentTopic, routingInfo, privateKey);
111
115
  }
112
116
 
113
117
  var ecies = /*#__PURE__*/Object.freeze({
package/bundle/ecies.js CHANGED
@@ -1,3 +1,3 @@
1
- export { a as decryptAsymmetric, e as encryptAsymmetric, b as postCipher, p as preCipher } from './encryption-D_9ex828.js';
2
- export { g as generatePrivateKey } from './symmetric-DPlNQ4aL.js';
3
- export { a as createDecoder, c as createEncoder } from './ecies-SoJnlQ4a.js';
1
+ export { d as decryptAsymmetric, e as encryptAsymmetric, a as postCipher, p as preCipher } from './encryption-DCdb0Qpb.js';
2
+ export { g as generatePrivateKey } from './symmetric-B5XVN0Wd.js';
3
+ export { a as createDecoder, c as createEncoder } from './ecies-HdUXyKbi.js';