@leofcoin/peernet 1.1.25 → 1.1.26

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 { g as getDefaultExportFromCjs, c as commonjsGlobal } from './peernet-3749aa41.js';
1
+ import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './peernet-b4b62ddc.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  function commonjsRequire(path) {
@@ -1,4 +1,4 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './peernet-3749aa41.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './peernet-b4b62ddc.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './peernet-3749aa41.js';
1
+ import { F as FormatInterface } from './peernet-b4b62ddc.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  var proto$b = {
@@ -20184,7 +20184,7 @@ class Identity {
20184
20184
  globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
20185
20185
  }
20186
20186
  else {
20187
- const importee = await import(/* webpackChunkName: "generate-account" */ './index-116df6d1.js');
20187
+ const importee = await import(/* webpackChunkName: "generate-account" */ './index-688c9980.js');
20188
20188
  const { identity, accounts } = await importee.default(password, this.network);
20189
20189
  await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
20190
20190
  await globalThis.walletStore.put('version', String(1));
@@ -20355,7 +20355,7 @@ class Peernet {
20355
20355
  this.root = options.root;
20356
20356
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
20357
20357
  // FolderMessageResponse
20358
- } = await import(/* webpackChunkName: "messages" */ './messages-fab7583b.js');
20358
+ } = await import(/* webpackChunkName: "messages" */ './messages-6c66a924.js');
20359
20359
  /**
20360
20360
  * proto Object containing protos
20361
20361
  * @type {Object}
@@ -20427,7 +20427,7 @@ class Peernet {
20427
20427
  if (this.#starting || this.#started)
20428
20428
  return;
20429
20429
  this.#starting = true;
20430
- const importee = await import('./client-bdab491d.js');
20430
+ const importee = await import('./client-4112eed9.js');
20431
20431
  /**
20432
20432
  * @access public
20433
20433
  * @type {PeernetClient}
@@ -20612,7 +20612,7 @@ class Peernet {
20612
20612
  throw nothingFoundError(hash);
20613
20613
  debug(`found ${providers.size} provider(s) for ${hash}`);
20614
20614
  // get closest peer on earth
20615
- const closestPeer = await this.dht.closestPeer(providers);
20615
+ const closestPeer = providers[0];
20616
20616
  // get peer instance by id
20617
20617
  if (!closestPeer || !closestPeer.id)
20618
20618
  return this.requestData(hash, store?.name || store);
@@ -1,2 +1,2 @@
1
- export { P as default } from './peernet-3749aa41.js';
1
+ export { P as default } from './peernet-b4b62ddc.js';
2
2
  import './value-157ab062.js';
@@ -770,7 +770,7 @@ class Peernet {
770
770
  throw nothingFoundError(hash);
771
771
  debug(`found ${providers.size} provider(s) for ${hash}`);
772
772
  // get closest peer on earth
773
- const closestPeer = await this.dht.closestPeer(providers);
773
+ const closestPeer = providers[0];
774
774
  // get peer instance by id
775
775
  if (!closestPeer || !closestPeer.id)
776
776
  return this.requestData(hash, store?.name || store);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "",
5
5
  "main": "src/peernet.js",
6
6
  "exports": {
package/src/peernet.ts CHANGED
@@ -465,7 +465,7 @@ export default class Peernet {
465
465
  if (!providers || providers.size === 0) throw nothingFoundError(hash)
466
466
  debug(`found ${providers.size} provider(s) for ${hash}`)
467
467
  // get closest peer on earth
468
- const closestPeer = await this.dht.closestPeer(providers)
468
+ const closestPeer = providers[0]
469
469
  // get peer instance by id
470
470
  if (!closestPeer || !closestPeer.id) return this.requestData(hash, store?.name || store)
471
471