@waku/message-encryption 0.0.15 → 0.0.16
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 +20 -0
- package/bundle/ecies.js +1 -1
- package/bundle/{index-b8a95792.js → index-f77add72.js} +43 -23
- package/bundle/index.js +1 -1
- package/bundle/symmetric.js +1 -1
- package/dist/decoded_message.js +3 -0
- package/dist/decoded_message.js.map +1 -1
- package/dist/ecies.js +6 -0
- package/dist/ecies.js.map +1 -1
- package/dist/symmetric.js +6 -0
- package/dist/symmetric.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
@@ -35,6 +35,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
35
35
|
* @waku/interfaces bumped from 0.0.10 to 0.0.11
|
36
36
|
* @waku/utils bumped from 0.0.3 to 0.0.4
|
37
37
|
|
38
|
+
## [0.0.16](https://github.com/waku-org/js-waku/compare/message-encryption-v0.0.15...message-encryption-v0.0.16) (2023-05-18)
|
39
|
+
|
40
|
+
|
41
|
+
### ⚠ BREAKING CHANGES
|
42
|
+
|
43
|
+
* @waku/relay ([#1316](https://github.com/waku-org/js-waku/issues/1316))
|
44
|
+
|
45
|
+
### Features
|
46
|
+
|
47
|
+
* @waku/relay ([#1316](https://github.com/waku-org/js-waku/issues/1316)) ([50c2c25](https://github.com/waku-org/js-waku/commit/50c2c2540f3c5ff78d93f3fea646da0eee246e17))
|
48
|
+
|
49
|
+
|
50
|
+
### Dependencies
|
51
|
+
|
52
|
+
* The following workspace dependencies were updated
|
53
|
+
* dependencies
|
54
|
+
* @waku/core bumped from * to 0.0.18
|
55
|
+
* @waku/interfaces bumped from * to 0.0.13
|
56
|
+
* @waku/utils bumped from * to 0.0.6
|
57
|
+
|
38
58
|
## [0.0.15](https://github.com/waku-org/js-waku/compare/message-encryption-v0.0.14...message-encryption-v0.0.15) (2023-05-09)
|
39
59
|
|
40
60
|
|
package/bundle/ecies.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { b as createDecoder, c as createEncoder, g as generatePrivateKey, a as getPublicKey } from './index-
|
1
|
+
export { b as createDecoder, c as createEncoder, g as generatePrivateKey, a as getPublicKey } from './index-f77add72.js';
|
@@ -1933,11 +1933,7 @@ function getDefaultExportFromCjs (x) {
|
|
1933
1933
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
1934
1934
|
}
|
1935
1935
|
|
1936
|
-
var
|
1937
|
-
var sha3$1 = {
|
1938
|
-
get exports(){ return sha3Exports; },
|
1939
|
-
set exports(v){ sha3Exports = v; },
|
1940
|
-
};
|
1936
|
+
var sha3$1 = {exports: {}};
|
1941
1937
|
|
1942
1938
|
/**
|
1943
1939
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
@@ -2589,10 +2585,11 @@ var sha3$1 = {
|
|
2589
2585
|
root[methodNames[i]] = methods[methodNames[i]];
|
2590
2586
|
}
|
2591
2587
|
}
|
2592
|
-
})();
|
2588
|
+
})();
|
2593
2589
|
} (sha3$1));
|
2594
2590
|
|
2595
|
-
var
|
2591
|
+
var sha3Exports = sha3$1.exports;
|
2592
|
+
var sha3 = /*@__PURE__*/getDefaultExportFromCjs(sha3Exports);
|
2596
2593
|
|
2597
2594
|
const Symmetric = {
|
2598
2595
|
keySize: 32,
|
@@ -2853,7 +2850,7 @@ var base64$1 = {};
|
|
2853
2850
|
*/
|
2854
2851
|
base64.test = function test(string) {
|
2855
2852
|
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
|
2856
|
-
};
|
2853
|
+
};
|
2857
2854
|
} (base64$1));
|
2858
2855
|
|
2859
2856
|
var eventemitter = EventEmitter;
|
@@ -3389,7 +3386,7 @@ var utf8$2 = {};
|
|
3389
3386
|
}
|
3390
3387
|
}
|
3391
3388
|
return offset - start;
|
3392
|
-
};
|
3389
|
+
};
|
3393
3390
|
} (utf8$2));
|
3394
3391
|
|
3395
3392
|
var pool_1 = pool;
|
@@ -4090,8 +4087,8 @@ function requireMinimal () {
|
|
4090
4087
|
function Buffer_allocUnsafe(size) {
|
4091
4088
|
return new Buffer(size);
|
4092
4089
|
};
|
4093
|
-
};
|
4094
|
-
} (minimal));
|
4090
|
+
};
|
4091
|
+
} (minimal));
|
4095
4092
|
return minimal;
|
4096
4093
|
}
|
4097
4094
|
|
@@ -4506,6 +4503,8 @@ Reader$1._configure = function(BufferReader_) {
|
|
4506
4503
|
});
|
4507
4504
|
};
|
4508
4505
|
|
4506
|
+
var ReaderClass = /*@__PURE__*/getDefaultExportFromCjs(reader$1);
|
4507
|
+
|
4509
4508
|
var reader_buffer = BufferReader;
|
4510
4509
|
|
4511
4510
|
// extends Reader
|
@@ -4557,6 +4556,8 @@ BufferReader.prototype.string = function read_string_buffer() {
|
|
4557
4556
|
|
4558
4557
|
BufferReader._configure();
|
4559
4558
|
|
4559
|
+
var ReaderBufferClass = /*@__PURE__*/getDefaultExportFromCjs(reader_buffer);
|
4560
|
+
|
4560
4561
|
var minimalExports = requireMinimal();
|
4561
4562
|
var util$2 = /*@__PURE__*/getDefaultExportFromCjs(minimalExports);
|
4562
4563
|
|
@@ -5025,6 +5026,8 @@ Writer$1._configure = function(BufferWriter_) {
|
|
5025
5026
|
BufferWriter$1._configure();
|
5026
5027
|
};
|
5027
5028
|
|
5029
|
+
var WriterClass = /*@__PURE__*/getDefaultExportFromCjs(writer$1);
|
5030
|
+
|
5028
5031
|
var writer_buffer = BufferWriter;
|
5029
5032
|
|
5030
5033
|
// extends Writer
|
@@ -5110,11 +5113,13 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
5110
5113
|
|
5111
5114
|
BufferWriter._configure();
|
5112
5115
|
|
5116
|
+
var WriterBufferClass = /*@__PURE__*/getDefaultExportFromCjs(writer_buffer);
|
5117
|
+
|
5113
5118
|
// @ts-expect-error no types
|
5114
5119
|
function configure() {
|
5115
5120
|
util$2._configure();
|
5116
|
-
|
5117
|
-
|
5121
|
+
ReaderClass._configure(ReaderBufferClass);
|
5122
|
+
WriterClass._configure(WriterBufferClass);
|
5118
5123
|
}
|
5119
5124
|
// Set up buffer utility according to the environment
|
5120
5125
|
configure();
|
@@ -5135,7 +5140,7 @@ function patchReader(obj) {
|
|
5135
5140
|
return obj;
|
5136
5141
|
}
|
5137
5142
|
function reader(buf) {
|
5138
|
-
return patchReader(new
|
5143
|
+
return patchReader(new ReaderClass(buf));
|
5139
5144
|
}
|
5140
5145
|
function patchWriter(obj) {
|
5141
5146
|
for (const method of methods) {
|
@@ -5150,7 +5155,7 @@ function patchWriter(obj) {
|
|
5150
5155
|
return obj;
|
5151
5156
|
}
|
5152
5157
|
function writer() {
|
5153
|
-
return patchWriter(
|
5158
|
+
return patchWriter(WriterClass.create());
|
5154
5159
|
}
|
5155
5160
|
|
5156
5161
|
function decodeMessage(buf, codec) {
|
@@ -6920,11 +6925,7 @@ var PeerExchangeRPC;
|
|
6920
6925
|
};
|
6921
6926
|
})(PeerExchangeRPC || (PeerExchangeRPC = {}));
|
6922
6927
|
|
6923
|
-
var
|
6924
|
-
var browser = {
|
6925
|
-
get exports(){ return browserExports; },
|
6926
|
-
set exports(v){ browserExports = v; },
|
6927
|
-
};
|
6928
|
+
var browser = {exports: {}};
|
6928
6929
|
|
6929
6930
|
/**
|
6930
6931
|
* Helpers.
|
@@ -7640,15 +7641,18 @@ var common = setup;
|
|
7640
7641
|
} catch (error) {
|
7641
7642
|
return '[UnexpectedJSONParseError]: ' + error.message;
|
7642
7643
|
}
|
7643
|
-
};
|
7644
|
-
} (browser,
|
7644
|
+
};
|
7645
|
+
} (browser, browser.exports));
|
7645
7646
|
|
7646
|
-
var
|
7647
|
+
var browserExports = browser.exports;
|
7648
|
+
var debug = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
7647
7649
|
|
7648
7650
|
const log$2 = debug("waku:message:version-0");
|
7649
7651
|
const OneMillion$1 = BigInt(1000000);
|
7650
7652
|
const Version$1 = 0;
|
7651
7653
|
let DecodedMessage$1 = class DecodedMessage {
|
7654
|
+
pubSubTopic;
|
7655
|
+
proto;
|
7652
7656
|
constructor(pubSubTopic, proto) {
|
7653
7657
|
this.pubSubTopic = pubSubTopic;
|
7654
7658
|
this.proto = proto;
|
@@ -7693,6 +7697,7 @@ let DecodedMessage$1 = class DecodedMessage {
|
|
7693
7697
|
}
|
7694
7698
|
};
|
7695
7699
|
let Decoder$2 = class Decoder {
|
7700
|
+
contentTopic;
|
7696
7701
|
constructor(contentTopic) {
|
7697
7702
|
this.contentTopic = contentTopic;
|
7698
7703
|
if (!contentTopic || contentTopic === "") {
|
@@ -7724,6 +7729,9 @@ let Decoder$2 = class Decoder {
|
|
7724
7729
|
};
|
7725
7730
|
|
7726
7731
|
class DecodedMessage extends DecodedMessage$1 {
|
7732
|
+
signature;
|
7733
|
+
signaturePublicKey;
|
7734
|
+
_decodedPayload;
|
7727
7735
|
constructor(pubSubTopic, proto, decodedPayload, signature, signaturePublicKey) {
|
7728
7736
|
super(pubSubTopic, proto);
|
7729
7737
|
this.signature = signature;
|
@@ -8048,6 +8056,11 @@ function postCipher(message) {
|
|
8048
8056
|
|
8049
8057
|
const log$1 = debug("waku:message-encryption:ecies");
|
8050
8058
|
let Encoder$1 = class Encoder {
|
8059
|
+
contentTopic;
|
8060
|
+
publicKey;
|
8061
|
+
sigPrivKey;
|
8062
|
+
ephemeral;
|
8063
|
+
metaSetter;
|
8051
8064
|
constructor(contentTopic, publicKey, sigPrivKey, ephemeral = false, metaSetter) {
|
8052
8065
|
this.contentTopic = contentTopic;
|
8053
8066
|
this.publicKey = publicKey;
|
@@ -8100,6 +8113,7 @@ function createEncoder$1({ contentTopic, publicKey, sigPrivKey, ephemeral = fals
|
|
8100
8113
|
return new Encoder$1(contentTopic, publicKey, sigPrivKey, ephemeral, metaSetter);
|
8101
8114
|
}
|
8102
8115
|
let Decoder$1 = class Decoder extends Decoder$2 {
|
8116
|
+
privateKey;
|
8103
8117
|
constructor(contentTopic, privateKey) {
|
8104
8118
|
super(contentTopic);
|
8105
8119
|
this.privateKey = privateKey;
|
@@ -8158,6 +8172,11 @@ var ecies = /*#__PURE__*/Object.freeze({
|
|
8158
8172
|
|
8159
8173
|
const log = debug("waku:message-encryption:symmetric");
|
8160
8174
|
class Encoder {
|
8175
|
+
contentTopic;
|
8176
|
+
symKey;
|
8177
|
+
sigPrivKey;
|
8178
|
+
ephemeral;
|
8179
|
+
metaSetter;
|
8161
8180
|
constructor(contentTopic, symKey, sigPrivKey, ephemeral = false, metaSetter) {
|
8162
8181
|
this.contentTopic = contentTopic;
|
8163
8182
|
this.symKey = symKey;
|
@@ -8211,6 +8230,7 @@ function createEncoder({ contentTopic, symKey, sigPrivKey, ephemeral = false, me
|
|
8211
8230
|
return new Encoder(contentTopic, symKey, sigPrivKey, ephemeral, metaSetter);
|
8212
8231
|
}
|
8213
8232
|
class Decoder extends Decoder$2 {
|
8233
|
+
symKey;
|
8214
8234
|
constructor(contentTopic, symKey) {
|
8215
8235
|
super(contentTopic);
|
8216
8236
|
this.symKey = symKey;
|
package/bundle/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { O as OneMillion, V as Version, h as ecies, g as generatePrivateKey, d as generateSymmetricKey, a as getPublicKey, s as symmetric } from './index-
|
1
|
+
export { O as OneMillion, V as Version, h as ecies, g as generatePrivateKey, d as generateSymmetricKey, a as getPublicKey, s as symmetric } from './index-f77add72.js';
|
package/bundle/symmetric.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { f as createDecoder, e as createEncoder, d as generateSymmetricKey } from './index-
|
1
|
+
export { f as createDecoder, e as createEncoder, d as generateSymmetricKey } from './index-f77add72.js';
|
package/dist/decoded_message.js
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
import { DecodedMessage as DecodedMessageV0, } from "@waku/core/lib/message/version_0";
|
2
2
|
export class DecodedMessage extends DecodedMessageV0 {
|
3
|
+
signature;
|
4
|
+
signaturePublicKey;
|
5
|
+
_decodedPayload;
|
3
6
|
constructor(pubSubTopic, proto, decodedPayload, signature, signaturePublicKey) {
|
4
7
|
super(pubSubTopic, proto);
|
5
8
|
this.signature = signature;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decoded_message.js","sourceRoot":"","sources":["../src/decoded_message.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,gBAAgB,GAEnC,MAAM,kCAAkC,CAAC;AAG1C,MAAM,OAAO,cACX,SAAQ,gBAAgB;
|
1
|
+
{"version":3,"file":"decoded_message.js","sourceRoot":"","sources":["../src/decoded_message.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,gBAAgB,GAEnC,MAAM,kCAAkC,CAAC;AAG1C,MAAM,OAAO,cACX,SAAQ,gBAAgB;IASf;IACA;IAPQ,eAAe,CAAa;IAE7C,YACE,WAAmB,EACnB,KAAwB,EACxB,cAA0B,EACnB,SAAsB,EACtB,kBAA+B;QAEtC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAHnB,cAAS,GAAT,SAAS,CAAa;QACtB,uBAAkB,GAAlB,kBAAkB,CAAa;QAGtC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;CACF"}
|
package/dist/ecies.js
CHANGED
@@ -7,6 +7,11 @@ import { generatePrivateKey, getPublicKey, OneMillion, Version, } from "./index.
|
|
7
7
|
export { generatePrivateKey, getPublicKey };
|
8
8
|
const log = debug("waku:message-encryption:ecies");
|
9
9
|
class Encoder {
|
10
|
+
contentTopic;
|
11
|
+
publicKey;
|
12
|
+
sigPrivKey;
|
13
|
+
ephemeral;
|
14
|
+
metaSetter;
|
10
15
|
constructor(contentTopic, publicKey, sigPrivKey, ephemeral = false, metaSetter) {
|
11
16
|
this.contentTopic = contentTopic;
|
12
17
|
this.publicKey = publicKey;
|
@@ -59,6 +64,7 @@ export function createEncoder({ contentTopic, publicKey, sigPrivKey, ephemeral =
|
|
59
64
|
return new Encoder(contentTopic, publicKey, sigPrivKey, ephemeral, metaSetter);
|
60
65
|
}
|
61
66
|
class Decoder extends DecoderV0 {
|
67
|
+
privateKey;
|
62
68
|
constructor(contentTopic, privateKey) {
|
63
69
|
super(contentTopic);
|
64
70
|
this.privateKey = privateKey;
|
package/dist/ecies.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ecies.js","sourceRoot":"","sources":["../src/ecies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,OAAO,GACR,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,CAAC;AAG5C,MAAM,GAAG,GAAG,KAAK,CAAC,+BAA+B,CAAC,CAAC;AAEnD,MAAM,OAAO;
|
1
|
+
{"version":3,"file":"ecies.js","sourceRoot":"","sources":["../src/ecies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,SAAS,GACV,MAAM,mBA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,CAAC,OAAO,EAAE;YACZ,GAAG,CAAC,8CAA8C,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YACvE,OAAO;SACR;QAED,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;QAEtC,IAAI,CAAC,GAAG,EAAE;YACR,GAAG,CAAC,6CAA6C,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YACtE,OAAO;SACR;QAED,GAAG,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CACvB,WAAW,EACX,YAAY,EACZ,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,GAAG,EAAE,SAAS,EAClB,GAAG,CAAC,GAAG,EAAE,SAAS,CACnB,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAC3B,YAAoB,EACpB,UAAsB;IAEtB,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/symmetric.js
CHANGED
@@ -7,6 +7,11 @@ import { generateSymmetricKey, OneMillion, Version } from "./index.js";
|
|
7
7
|
export { generateSymmetricKey };
|
8
8
|
const log = debug("waku:message-encryption:symmetric");
|
9
9
|
class Encoder {
|
10
|
+
contentTopic;
|
11
|
+
symKey;
|
12
|
+
sigPrivKey;
|
13
|
+
ephemeral;
|
14
|
+
metaSetter;
|
10
15
|
constructor(contentTopic, symKey, sigPrivKey, ephemeral = false, metaSetter) {
|
11
16
|
this.contentTopic = contentTopic;
|
12
17
|
this.symKey = symKey;
|
@@ -60,6 +65,7 @@ export function createEncoder({ contentTopic, symKey, sigPrivKey, ephemeral = fa
|
|
60
65
|
return new Encoder(contentTopic, symKey, sigPrivKey, ephemeral, metaSetter);
|
61
66
|
}
|
62
67
|
class Decoder extends DecoderV0 {
|
68
|
+
symKey;
|
63
69
|
constructor(contentTopic, symKey) {
|
64
70
|
super(contentTopic);
|
65
71
|
this.symKey = symKey;
|
package/dist/symmetric.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"symmetric.js","sourceRoot":"","sources":["../src/symmetric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAGhC,MAAM,GAAG,GAAG,KAAK,CAAC,mCAAmC,CAAC,CAAC;AAEvD,MAAM,OAAO;
|
1
|
+
{"version":3,"file":"symmetric.js","sourceRoot":"","sources":["../src/symmetric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAGhC,MAAM,GAAG,GAAG,KAAK,CAAC,mCAAmC,CAAC,CAAC;AAEvD,MAAM,OAAO;IAEF;IACC;IACA;IACD;IACA;IALT,YACS,YAAoB,EACnB,MAAkB,EAClB,UAAuB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mBAAmB,EAAE,YAAY,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CACvB,WAAW,EACX,YAAY,EACZ,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,GAAG,EAAE,SAAS,EAClB,GAAG,CAAC,GAAG,EAAE,SAAS,CACnB,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAC3B,YAAoB,EACpB,MAAkB;IAElB,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@waku/message-encryption",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.16",
|
4
4
|
"description": "Waku Message Payload Encryption",
|
5
5
|
"types": "./dist/index.d.ts",
|
6
6
|
"module": "./dist/index.js",
|
@@ -72,10 +72,10 @@
|
|
72
72
|
},
|
73
73
|
"dependencies": {
|
74
74
|
"@noble/secp256k1": "^1.7.1",
|
75
|
-
"@waku/core": "0.0.
|
76
|
-
"@waku/interfaces": "0.0.
|
77
|
-
"@waku/proto": "
|
78
|
-
"@waku/utils": "0.0.
|
75
|
+
"@waku/core": "0.0.18",
|
76
|
+
"@waku/interfaces": "0.0.13",
|
77
|
+
"@waku/proto": "*",
|
78
|
+
"@waku/utils": "0.0.6",
|
79
79
|
"debug": "^4.3.4",
|
80
80
|
"js-sha3": "^0.8.0"
|
81
81
|
},
|
@@ -114,7 +114,7 @@
|
|
114
114
|
"puppeteer": "^19.8.2",
|
115
115
|
"rollup": "^3.21.3",
|
116
116
|
"ts-loader": "^9.4.2",
|
117
|
-
"typescript": "^
|
117
|
+
"typescript": "^5.0.4"
|
118
118
|
},
|
119
119
|
"typedoc": {
|
120
120
|
"entryPoint": "./src/index.ts"
|