@leofcoin/peernet 0.11.16 → 0.11.19

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.
@@ -322,7 +322,7 @@ class Peer {
322
322
  * @params {Object} options
323
323
  * @params {string} options.channelName - this peerid : otherpeer id
324
324
  */
325
- constructor(options = {}) {
325
+ constructor(options = {}) {
326
326
  this._in = this._in.bind(this);
327
327
  this.offerOptions = options.offerOptions;
328
328
  this.initiator = options.initiator;
@@ -403,6 +403,7 @@ constructor(options = {}) {
403
403
  }];
404
404
 
405
405
  this.#connection = new wrtc.RTCPeerConnection();
406
+
406
407
  this.#connection.onicecandidate = ({ candidate }) => {
407
408
  if (candidate) {
408
409
  this.address = candidate.address;
@@ -449,6 +450,13 @@ constructor(options = {}) {
449
450
  await this.#connection.setLocalDescription(offer);
450
451
 
451
452
  this._sendMessage({'sdp': this.#connection.localDescription});
453
+
454
+ this.#connection.onnegotiationneeded = async () => {
455
+ const offer = await this.#connection.createOffer();
456
+ await this.#connection.setLocalDescription(offer);
457
+
458
+ this._sendMessage({'sdp': this.#connection.localDescription});
459
+ };
452
460
  }
453
461
  // }
454
462
 
@@ -2231,7 +2239,6 @@ class MessageHandler {
2231
2239
  let identity = await walletStore.get('identity');
2232
2240
  identity = JSON.parse(new TextDecoder().decode(identity));
2233
2241
  const wallet = new MultiWallet(this.network);
2234
- console.log(identity);
2235
2242
  wallet.recover(identity.mnemonic);
2236
2243
  return wallet.sign(Buffer.from(hasher.hash).slice(0, 32))
2237
2244
  }
@@ -10,7 +10,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
10
10
  var PubSub__default = /*#__PURE__*/_interopDefaultLegacy(PubSub);
11
11
  var Koa__default = /*#__PURE__*/_interopDefaultLegacy(Koa);
12
12
 
13
- var version = "0.11.15";
13
+ var version = "0.11.18";
14
14
 
15
15
  var api$1 = {
16
16
  version: ({send}) => send({client: '@peernet/api/http', version}),
@@ -320,7 +320,7 @@ class Peer {
320
320
  * @params {Object} options
321
321
  * @params {string} options.channelName - this peerid : otherpeer id
322
322
  */
323
- constructor(options = {}) {
323
+ constructor(options = {}) {
324
324
  this._in = this._in.bind(this);
325
325
  this.offerOptions = options.offerOptions;
326
326
  this.initiator = options.initiator;
@@ -401,6 +401,7 @@ constructor(options = {}) {
401
401
  }];
402
402
 
403
403
  this.#connection = new wrtc.RTCPeerConnection();
404
+
404
405
  this.#connection.onicecandidate = ({ candidate }) => {
405
406
  if (candidate) {
406
407
  this.address = candidate.address;
@@ -447,6 +448,13 @@ constructor(options = {}) {
447
448
  await this.#connection.setLocalDescription(offer);
448
449
 
449
450
  this._sendMessage({'sdp': this.#connection.localDescription});
451
+
452
+ this.#connection.onnegotiationneeded = async () => {
453
+ const offer = await this.#connection.createOffer();
454
+ await this.#connection.setLocalDescription(offer);
455
+
456
+ this._sendMessage({'sdp': this.#connection.localDescription});
457
+ };
450
458
  }
451
459
  // }
452
460
 
@@ -1589,7 +1597,6 @@ class MessageHandler {
1589
1597
  let identity = await walletStore.get('identity');
1590
1598
  identity = JSON.parse(new TextDecoder().decode(identity));
1591
1599
  const wallet = new MultiWallet(this.network);
1592
- console.log(identity);
1593
1600
  wallet.recover(identity.mnemonic);
1594
1601
  return wallet.sign(Buffer.from(hasher.hash).slice(0, 32))
1595
1602
  }
@@ -1796,7 +1803,7 @@ class Peernet {
1796
1803
  protocol: 'peernet-v0.1.0', host: '127.0.0.1', port: options.port
1797
1804
  });
1798
1805
  } else {
1799
- const http = await Promise.resolve().then(function () { return require('./http-20a16cac.js'); });
1806
+ const http = await Promise.resolve().then(function () { return require('./http-7f0fcdaf.js'); });
1800
1807
  if (environment !== 'browser') http.default(options);
1801
1808
  }
1802
1809
 
@@ -276,7 +276,7 @@ class Peer {
276
276
  * @params {Object} options
277
277
  * @params {string} options.channelName - this peerid : otherpeer id
278
278
  */
279
- constructor(options = {}) {
279
+ constructor(options = {}) {
280
280
  this._in = this._in.bind(this);
281
281
  this.offerOptions = options.offerOptions;
282
282
  this.initiator = options.initiator;
@@ -357,6 +357,7 @@ constructor(options = {}) {
357
357
  }];
358
358
 
359
359
  this.#connection = new wrtc.RTCPeerConnection();
360
+
360
361
  this.#connection.onicecandidate = ({ candidate }) => {
361
362
  if (candidate) {
362
363
  this.address = candidate.address;
@@ -403,6 +404,13 @@ constructor(options = {}) {
403
404
  await this.#connection.setLocalDescription(offer);
404
405
 
405
406
  this._sendMessage({'sdp': this.#connection.localDescription});
407
+
408
+ this.#connection.onnegotiationneeded = async () => {
409
+ const offer = await this.#connection.createOffer();
410
+ await this.#connection.setLocalDescription(offer);
411
+
412
+ this._sendMessage({'sdp': this.#connection.localDescription});
413
+ };
406
414
  }
407
415
  // }
408
416
 
@@ -2185,7 +2193,6 @@ class MessageHandler {
2185
2193
  let identity = await walletStore.get('identity');
2186
2194
  identity = JSON.parse(new TextDecoder().decode(identity));
2187
2195
  const wallet = new MultiWallet(this.network);
2188
- console.log(identity);
2189
2196
  wallet.recover(identity.mnemonic);
2190
2197
  return wallet.sign(Buffer.from(hasher.hash).slice(0, 32))
2191
2198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "0.11.16",
3
+ "version": "0.11.19",
4
4
  "description": "",
5
5
  "main": "dist/commonjs/peernet.js",
6
6
  "module": "dist/module/peernet.js",