@waku/enr 0.0.14 → 0.0.15

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
@@ -51,6 +51,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
51
51
  * devDependencies
52
52
  * @waku/interfaces bumped from 0.0.14 to 0.0.15
53
53
 
54
+ ## [0.0.15](https://github.com/waku-org/js-waku/compare/enr-v0.0.14...enr-v0.0.15) (2023-07-26)
55
+
56
+
57
+ ### ⚠ BREAKING CHANGES
58
+
59
+ * upgrade to libp2p@0.45 ([#1400](https://github.com/waku-org/js-waku/issues/1400))
60
+
61
+ ### Features
62
+
63
+ * Upgrade to libp2p@0.45 ([#1400](https://github.com/waku-org/js-waku/issues/1400)) ([420e6c6](https://github.com/waku-org/js-waku/commit/420e6c698dd8f44d40d34e47d876da5d2e1ce85e))
64
+
65
+
66
+ ### Dependencies
67
+
68
+ * The following workspace dependencies were updated
69
+ * dependencies
70
+ * @waku/utils bumped from 0.0.8 to 0.0.9
71
+ * devDependencies
72
+ * @waku/interfaces bumped from 0.0.15 to 0.0.16
73
+
54
74
  ## [0.0.12](https://github.com/waku-org/js-waku/compare/enr-v0.0.11...enr-v0.0.12) (2023-05-18)
55
75
 
56
76
 
package/bundle/index.js CHANGED
@@ -6,6 +6,17 @@ const ERR_NO_SIGNATURE = "No valid signature found";
6
6
  // The size is a big endian 16-bit unsigned integer
7
7
  const MULTIADDR_LENGTH_SIZE = 2;
8
8
 
9
+ /**
10
+ * To guarantee Uint8Array semantics, convert nodejs Buffers
11
+ * into vanilla Uint8Arrays
12
+ */
13
+ function asUint8Array(buf) {
14
+ if (globalThis.Buffer != null) {
15
+ return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
16
+ }
17
+ return buf;
18
+ }
19
+
9
20
  // base-x encoding / decoding
10
21
  // Copyright (c) 2018 base-x contributors
11
22
  // Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
@@ -528,8 +539,8 @@ const identity$1 = from$1({
528
539
  });
529
540
 
530
541
  var identityBase = /*#__PURE__*/Object.freeze({
531
- __proto__: null,
532
- identity: identity$1
542
+ __proto__: null,
543
+ identity: identity$1
533
544
  });
534
545
 
535
546
  // @ts-check
@@ -542,8 +553,8 @@ const base2 = rfc4648({
542
553
  });
543
554
 
544
555
  var base2$1 = /*#__PURE__*/Object.freeze({
545
- __proto__: null,
546
- base2: base2
556
+ __proto__: null,
557
+ base2: base2
547
558
  });
548
559
 
549
560
  // @ts-check
@@ -556,8 +567,8 @@ const base8 = rfc4648({
556
567
  });
557
568
 
558
569
  var base8$1 = /*#__PURE__*/Object.freeze({
559
- __proto__: null,
560
- base8: base8
570
+ __proto__: null,
571
+ base8: base8
561
572
  });
562
573
 
563
574
  const base10 = baseX({
@@ -567,8 +578,8 @@ const base10 = baseX({
567
578
  });
568
579
 
569
580
  var base10$1 = /*#__PURE__*/Object.freeze({
570
- __proto__: null,
571
- base10: base10
581
+ __proto__: null,
582
+ base10: base10
572
583
  });
573
584
 
574
585
  // @ts-check
@@ -588,9 +599,9 @@ const base16upper = rfc4648({
588
599
  });
589
600
 
590
601
  var base16$1 = /*#__PURE__*/Object.freeze({
591
- __proto__: null,
592
- base16: base16,
593
- base16upper: base16upper
602
+ __proto__: null,
603
+ base16: base16,
604
+ base16upper: base16upper
594
605
  });
595
606
 
596
607
  const base32 = rfc4648({
@@ -657,16 +668,16 @@ const base32z = rfc4648({
657
668
  });
658
669
 
659
670
  var base32$1 = /*#__PURE__*/Object.freeze({
660
- __proto__: null,
661
- base32: base32,
662
- base32hex: base32hex,
663
- base32hexpad: base32hexpad,
664
- base32hexpadupper: base32hexpadupper,
665
- base32hexupper: base32hexupper,
666
- base32pad: base32pad,
667
- base32padupper: base32padupper,
668
- base32upper: base32upper,
669
- base32z: base32z
671
+ __proto__: null,
672
+ base32: base32,
673
+ base32hex: base32hex,
674
+ base32hexpad: base32hexpad,
675
+ base32hexpadupper: base32hexpadupper,
676
+ base32hexupper: base32hexupper,
677
+ base32pad: base32pad,
678
+ base32padupper: base32padupper,
679
+ base32upper: base32upper,
680
+ base32z: base32z
670
681
  });
671
682
 
672
683
  const base36 = baseX({
@@ -682,9 +693,9 @@ const base36upper = baseX({
682
693
  });
683
694
 
684
695
  var base36$1 = /*#__PURE__*/Object.freeze({
685
- __proto__: null,
686
- base36: base36,
687
- base36upper: base36upper
696
+ __proto__: null,
697
+ base36: base36,
698
+ base36upper: base36upper
688
699
  });
689
700
 
690
701
  const base58btc = baseX({
@@ -700,9 +711,9 @@ const base58flickr = baseX({
700
711
  });
701
712
 
702
713
  var base58 = /*#__PURE__*/Object.freeze({
703
- __proto__: null,
704
- base58btc: base58btc,
705
- base58flickr: base58flickr
714
+ __proto__: null,
715
+ base58btc: base58btc,
716
+ base58flickr: base58flickr
706
717
  });
707
718
 
708
719
  // @ts-check
@@ -736,11 +747,11 @@ const base64urlpad = rfc4648({
736
747
  });
737
748
 
738
749
  var base64$3 = /*#__PURE__*/Object.freeze({
739
- __proto__: null,
740
- base64: base64$2,
741
- base64pad: base64pad,
742
- base64url: base64url,
743
- base64urlpad: base64urlpad
750
+ __proto__: null,
751
+ base64: base64$2,
752
+ base64pad: base64pad,
753
+ base64url: base64url,
754
+ base64urlpad: base64urlpad
744
755
  });
745
756
 
746
757
  const alphabet = Array.from('🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂');
@@ -782,8 +793,8 @@ const base256emoji = from$1({
782
793
  });
783
794
 
784
795
  var base256emoji$1 = /*#__PURE__*/Object.freeze({
785
- __proto__: null,
786
- base256emoji: base256emoji
796
+ __proto__: null,
797
+ base256emoji: base256emoji
787
798
  });
788
799
 
789
800
  var encode_1$1 = encode$3;
@@ -1667,17 +1678,6 @@ const cidSymbol = Symbol.for('@ipld/js-cid/CID');
1667
1678
 
1668
1679
  const bases = { ...identityBase, ...base2$1, ...base8$1, ...base10$1, ...base16$1, ...base32$1, ...base36$1, ...base58, ...base64$3, ...base256emoji$1 };
1669
1680
 
1670
- /**
1671
- * To guarantee Uint8Array semantics, convert nodejs Buffers
1672
- * into vanilla Uint8Arrays
1673
- */
1674
- function asUint8Array(buf) {
1675
- if (globalThis.Buffer != null) {
1676
- return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
1677
- }
1678
- return buf;
1679
- }
1680
-
1681
1681
  /**
1682
1682
  * Where possible returns a Uint8Array of the requested size that references
1683
1683
  * uninitialized memory. Only use if you are certain you will immediately
@@ -1730,7 +1730,7 @@ const BASES = {
1730
1730
  'utf-8': string,
1731
1731
  hex: bases.base16,
1732
1732
  latin1: ascii,
1733
- ascii: ascii,
1733
+ ascii,
1734
1734
  binary: ascii,
1735
1735
  ...bases
1736
1736
  };
@@ -1814,8 +1814,8 @@ function concat$1(byteArrays, totalLength) {
1814
1814
  var _nodeResolve_empty = {};
1815
1815
 
1816
1816
  var nodeCrypto = /*#__PURE__*/Object.freeze({
1817
- __proto__: null,
1818
- default: _nodeResolve_empty
1817
+ __proto__: null,
1818
+ default: _nodeResolve_empty
1819
1819
  });
1820
1820
 
1821
1821
  /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
@@ -5222,6 +5222,8 @@ function protoFromTuple(tup) {
5222
5222
  * AbortSignal.
5223
5223
  */
5224
5224
  class CodeError extends Error {
5225
+ code;
5226
+ props;
5225
5227
  constructor(message, code, props) {
5226
5228
  super(message);
5227
5229
  this.code = code;
@@ -23688,13 +23690,13 @@ function ensureKey(key, length) {
23688
23690
  }
23689
23691
 
23690
23692
  var Ed25519 = /*#__PURE__*/Object.freeze({
23691
- __proto__: null,
23692
- Ed25519PrivateKey: Ed25519PrivateKey,
23693
- Ed25519PublicKey: Ed25519PublicKey,
23694
- generateKeyPair: generateKeyPair$2,
23695
- generateKeyPairFromSeed: generateKeyPairFromSeed,
23696
- unmarshalEd25519PrivateKey: unmarshalEd25519PrivateKey,
23697
- unmarshalEd25519PublicKey: unmarshalEd25519PublicKey
23693
+ __proto__: null,
23694
+ Ed25519PrivateKey: Ed25519PrivateKey,
23695
+ Ed25519PublicKey: Ed25519PublicKey,
23696
+ generateKeyPair: generateKeyPair$2,
23697
+ generateKeyPairFromSeed: generateKeyPairFromSeed,
23698
+ unmarshalEd25519PrivateKey: unmarshalEd25519PrivateKey,
23699
+ unmarshalEd25519PublicKey: unmarshalEd25519PublicKey
23698
23700
  });
23699
23701
 
23700
23702
  function bigIntegerToUintBase64url(num, len) {
@@ -24582,13 +24584,13 @@ async function generateKeyPair$1(bits) {
24582
24584
  }
24583
24585
 
24584
24586
  var RSA = /*#__PURE__*/Object.freeze({
24585
- __proto__: null,
24586
- RsaPrivateKey: RsaPrivateKey,
24587
- RsaPublicKey: RsaPublicKey,
24588
- fromJwk: fromJwk,
24589
- generateKeyPair: generateKeyPair$1,
24590
- unmarshalRsaPrivateKey: unmarshalRsaPrivateKey,
24591
- unmarshalRsaPublicKey: unmarshalRsaPublicKey
24587
+ __proto__: null,
24588
+ RsaPrivateKey: RsaPrivateKey,
24589
+ RsaPublicKey: RsaPublicKey,
24590
+ fromJwk: fromJwk,
24591
+ generateKeyPair: generateKeyPair$1,
24592
+ unmarshalRsaPrivateKey: unmarshalRsaPrivateKey,
24593
+ unmarshalRsaPublicKey: unmarshalRsaPublicKey
24592
24594
  });
24593
24595
 
24594
24596
  function generateKey() {
@@ -24739,12 +24741,12 @@ async function generateKeyPair() {
24739
24741
  }
24740
24742
 
24741
24743
  var Secp256k1 = /*#__PURE__*/Object.freeze({
24742
- __proto__: null,
24743
- Secp256k1PrivateKey: Secp256k1PrivateKey,
24744
- Secp256k1PublicKey: Secp256k1PublicKey,
24745
- generateKeyPair: generateKeyPair,
24746
- unmarshalSecp256k1PrivateKey: unmarshalSecp256k1PrivateKey,
24747
- unmarshalSecp256k1PublicKey: unmarshalSecp256k1PublicKey
24744
+ __proto__: null,
24745
+ Secp256k1PrivateKey: Secp256k1PrivateKey,
24746
+ Secp256k1PublicKey: Secp256k1PublicKey,
24747
+ generateKeyPair: generateKeyPair,
24748
+ unmarshalSecp256k1PrivateKey: unmarshalSecp256k1PrivateKey,
24749
+ unmarshalSecp256k1PublicKey: unmarshalSecp256k1PublicKey
24748
24750
  });
24749
24751
 
24750
24752
  const supportedKeys = {
@@ -24802,6 +24804,11 @@ const LIBP2P_KEY_CODE = 0x72;
24802
24804
  const MARSHALLED_ED225519_PUBLIC_KEY_LENGTH = 36;
24803
24805
  const MARSHALLED_SECP256K1_PUBLIC_KEY_LENGTH = 37;
24804
24806
  class PeerIdImpl {
24807
+ type;
24808
+ multihash;
24809
+ privateKey;
24810
+ publicKey;
24811
+ string;
24805
24812
  constructor(init) {
24806
24813
  this.type = init.type;
24807
24814
  this.multihash = init.multihash;
@@ -24815,9 +24822,7 @@ class PeerIdImpl {
24815
24822
  get [Symbol.toStringTag]() {
24816
24823
  return `PeerId(${this.toString()})`;
24817
24824
  }
24818
- get [symbol]() {
24819
- return true;
24820
- }
24825
+ [symbol] = true;
24821
24826
  toString() {
24822
24827
  if (this.string == null) {
24823
24828
  this.string = base58btc.encode(this.multihash.bytes).slice(1);
@@ -24872,23 +24877,26 @@ class PeerIdImpl {
24872
24877
  }
24873
24878
  }
24874
24879
  class RSAPeerIdImpl extends PeerIdImpl {
24880
+ type = 'RSA';
24881
+ publicKey;
24875
24882
  constructor(init) {
24876
24883
  super({ ...init, type: 'RSA' });
24877
- this.type = 'RSA';
24878
24884
  this.publicKey = init.publicKey;
24879
24885
  }
24880
24886
  }
24881
24887
  class Ed25519PeerIdImpl extends PeerIdImpl {
24888
+ type = 'Ed25519';
24889
+ publicKey;
24882
24890
  constructor(init) {
24883
24891
  super({ ...init, type: 'Ed25519' });
24884
- this.type = 'Ed25519';
24885
24892
  this.publicKey = init.multihash.digest;
24886
24893
  }
24887
24894
  }
24888
24895
  class Secp256k1PeerIdImpl extends PeerIdImpl {
24896
+ type = 'secp256k1';
24897
+ publicKey;
24889
24898
  constructor(init) {
24890
24899
  super({ ...init, type: 'secp256k1' });
24891
- this.type = 'secp256k1';
24892
24900
  this.publicKey = init.multihash.digest;
24893
24901
  }
24894
24902
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waku/enr",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "ENR (EIP-778) for Waku",
5
5
  "types": "./dist/index.d.ts",
6
6
  "module": "./dist/index.js",
@@ -53,34 +53,26 @@
53
53
  "dependencies": {
54
54
  "@ethersproject/rlp": "^5.7.0",
55
55
  "@libp2p/crypto": "^1.0.17",
56
- "@libp2p/peer-id": "^2.0.3",
56
+ "@libp2p/peer-id": "^2.0.4",
57
57
  "@multiformats/multiaddr": "^12.0.0",
58
58
  "@noble/secp256k1": "^1.7.1",
59
- "@waku/utils": "0.0.8",
59
+ "@waku/utils": "0.0.9",
60
60
  "debug": "^4.3.4",
61
61
  "js-sha3": "^0.8.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@libp2p/interface-peer-id": "^2.0.1",
65
- "@libp2p/interface-peer-info": "^1.0.8",
66
- "@libp2p/peer-id-factory": "^2.0.3",
64
+ "@libp2p/interface-peer-id": "^2.0.2",
65
+ "@libp2p/interface-peer-info": "^1.0.10",
66
+ "@libp2p/peer-id-factory": "^2.0.4",
67
67
  "@rollup/plugin-commonjs": "^24.0.1",
68
68
  "@rollup/plugin-json": "^6.0.0",
69
69
  "@rollup/plugin-node-resolve": "^15.0.2",
70
70
  "@types/chai": "^4.3.4",
71
71
  "@types/mocha": "^10.0.1",
72
- "@typescript-eslint/eslint-plugin": "^5.57.0",
73
- "@typescript-eslint/parser": "^5.59.8",
74
72
  "@waku/build-utils": "*",
75
- "@waku/interfaces": "0.0.15",
73
+ "@waku/interfaces": "0.0.16",
76
74
  "chai": "^4.3.7",
77
75
  "cspell": "^6.31.1",
78
- "eslint": "^8.41.0",
79
- "eslint-config-prettier": "^8.6.0",
80
- "eslint-plugin-eslint-comments": "^3.2.0",
81
- "eslint-plugin-functional": "^5.0.4",
82
- "eslint-plugin-import": "^2.27.5",
83
- "eslint-plugin-prettier": "^4.2.1",
84
76
  "karma": "^6.4.1",
85
77
  "karma-chrome-launcher": "^3.1.1",
86
78
  "karma-mocha": "^2.0.1",
@@ -93,7 +85,7 @@
93
85
  "rollup": "^3.21.3",
94
86
  "ts-loader": "^9.4.2",
95
87
  "typescript": "^5.0.4",
96
- "uint8arrays": "^4.0.3"
88
+ "uint8arrays": "^4.0.4"
97
89
  },
98
90
  "typedoc": {
99
91
  "entryPoint": "./src/index.ts"