@leofcoin/peernet 1.0.6 → 1.0.7

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.
@@ -1,4 +1,4 @@
1
- import { L as LittlePubSub } from './peernet-6a78293a.js';
1
+ import { L as LittlePubSub } from './peernet-fb815598.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  var clientApi = _pubsub => {
@@ -1,4 +1,4 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './peernet-6a78293a.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './peernet-fb815598.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './peernet-6a78293a.js';
1
+ import { F as FormatInterface } from './peernet-fb815598.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  var proto$b = {
@@ -107,7 +107,8 @@ class PeerMessage extends FormatInterface {
107
107
  }
108
108
 
109
109
  var proto$5 = {
110
- request: String()
110
+ request: String(),
111
+ 'requested?': Uint8Array()
111
112
  };
112
113
 
113
114
  class RequestMessage extends FormatInterface {
@@ -16082,7 +16082,7 @@ class Identity {
16082
16082
  globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
16083
16083
  }
16084
16084
  else {
16085
- const importee = await import(/* webpackChunkName: "generate-account" */ './index-88c7fc2e.js');
16085
+ const importee = await import(/* webpackChunkName: "generate-account" */ './index-ca09d8df.js');
16086
16086
  const { identity, accounts } = await importee.default(password, this.network);
16087
16087
  await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
16088
16088
  await globalThis.walletStore.put('version', String(1));
@@ -16248,7 +16248,7 @@ class Peernet {
16248
16248
  this.root = options.root;
16249
16249
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
16250
16250
  // FolderMessageResponse
16251
- } = await import(/* webpackChunkName: "messages" */ './messages-ba0fcf7e.js');
16251
+ } = await import(/* webpackChunkName: "messages" */ './messages-5cf1bdd4.js');
16252
16252
  /**
16253
16253
  * proto Object containing protos
16254
16254
  * @type {Object}
@@ -16297,7 +16297,7 @@ class Peernet {
16297
16297
  * @see DataHandler
16298
16298
  */
16299
16299
  pubsub.subscribe('peer:data', dataHandler);
16300
- const importee = await import('./client-cbaadd55.js');
16300
+ const importee = await import('./client-1ced0c80.js');
16301
16301
  /**
16302
16302
  * @access public
16303
16303
  * @type {PeernetClient}
@@ -16355,7 +16355,7 @@ class Peernet {
16355
16355
  async handleRequest(peer, id, proto) {
16356
16356
  const method = this.requestProtos[proto.decoded.request];
16357
16357
  if (method) {
16358
- const data = await method();
16358
+ const data = await method(proto.decoded.requested);
16359
16359
  const node = await this.prepareMessage(data);
16360
16360
  this.sendMessage(peer, id, node.encoded);
16361
16361
  }
@@ -1,2 +1,2 @@
1
- export { P as default } from './peernet-6a78293a.js';
1
+ export { P as default } from './peernet-fb815598.js';
2
2
  import './value-157ab062.js';
@@ -1,4 +1,5 @@
1
- declare namespace _default {
2
- const request: string;
3
- }
1
+ declare const _default: {
2
+ request: string;
3
+ 'requested?': any;
4
+ };
4
5
  export default _default;
@@ -106,7 +106,8 @@ class PeerMessage extends FormatInterface {
106
106
  }
107
107
 
108
108
  var proto$5 = {
109
- request: String()
109
+ request: String(),
110
+ 'requested?': Uint8Array()
110
111
  };
111
112
 
112
113
  class RequestMessage extends FormatInterface {
@@ -506,7 +506,7 @@ class Peernet {
506
506
  this.root = options.root;
507
507
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
508
508
  // FolderMessageResponse
509
- } = await import(/* webpackChunkName: "messages" */ './messages-65501ef9.js');
509
+ } = await import(/* webpackChunkName: "messages" */ './messages-82641a85.js');
510
510
  /**
511
511
  * proto Object containing protos
512
512
  * @type {Object}
@@ -613,7 +613,7 @@ class Peernet {
613
613
  async handleRequest(peer, id, proto) {
614
614
  const method = this.requestProtos[proto.decoded.request];
615
615
  if (method) {
616
- const data = await method();
616
+ const data = await method(proto.decoded.requested);
617
617
  const node = await this.prepareMessage(data);
618
618
  this.sendMessage(peer, id, node.encoded);
619
619
  }
@@ -1,4 +1,5 @@
1
- declare namespace _default {
2
- const request: string;
3
- }
1
+ declare const _default: {
2
+ request: string;
3
+ 'requested?': any;
4
+ };
4
5
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "src/peernet.js",
6
6
  "exports": {
package/src/peernet.ts CHANGED
@@ -307,7 +307,7 @@ export default class Peernet {
307
307
  async handleRequest(peer, id, proto) {
308
308
  const method = this.requestProtos[proto.decoded.request]
309
309
  if (method) {
310
- const data = await method()
310
+ const data = await method(proto.decoded.requested)
311
311
  const node = await this.prepareMessage(data)
312
312
  this.sendMessage(peer, id, node.encoded)
313
313
  }
@@ -1,3 +1,4 @@
1
1
  export default {
2
- request: String()
2
+ request: String(),
3
+ 'requested?': Uint8Array()
3
4
  }