@leofcoin/peernet 0.9.4 → 0.9.5

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.
@@ -5,7 +5,7 @@ var codecFormatInterface = require('./codec-format-interface.js');
5
5
  require('bs32');
6
6
  require('bs58');
7
7
  require('is-hex');
8
- require('./codec.js');
8
+ require('./codec-73adfc0f.js');
9
9
  require('varint');
10
10
  require('./hash.js');
11
11
  require('keccak');
@@ -5,7 +5,7 @@ var codecFormatInterface = require('./codec-format-interface.js');
5
5
  require('bs32');
6
6
  require('bs58');
7
7
  require('is-hex');
8
- require('./codec.js');
8
+ require('./codec-73adfc0f.js');
9
9
  require('varint');
10
10
  require('./hash.js');
11
11
  require('keccak');
@@ -244,7 +244,7 @@ class LeofcoinStorage$1 {
244
244
 
245
245
  }
246
246
 
247
- var version = "0.9.3";
247
+ var version = "0.9.4";
248
248
 
249
249
  var api$1 = {
250
250
  version: ({send}) => send({client: '@peernet/api/http', version}),
@@ -1983,11 +1983,11 @@ class Peernet {
1983
1983
  }
1984
1984
 
1985
1985
  addProto(name, proto) {
1986
- if (!globalThis.peernet.protos[name]) globalThis.peernet.protos[name] = proto;
1986
+ if (!this.protos[name]) this.protos[name] = proto;
1987
1987
  }
1988
1988
 
1989
- addCodec(name, proto) {
1990
- if (!globalThis.peernet.codecs[name]) globalThis.peernet.codecs[name] = proto;
1989
+ addCodec(name, codec) {
1990
+ if (!this.codecs[name]) this.codecs[name] = codec;
1991
1991
  }
1992
1992
 
1993
1993
  async addStore(name, prefix, root, isPrivate = true) {
@@ -2071,7 +2071,9 @@ class Peernet {
2071
2071
  'peernet-ps': PsMessage,
2072
2072
  'chat-message': ChatMessage,
2073
2073
  };
2074
+
2074
2075
  this.protos = globalThis.peernet.protos;
2076
+ this.codecs = codecs;
2075
2077
 
2076
2078
  this._messageHandler = new MessageHandler(this.network);
2077
2079
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "",
5
5
  "main": "dist/commonjs/peernet.js",
6
6
  "module": "dist/module/peernet.js",