@leofcoin/peernet 1.1.24 → 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.
- package/exports/browser/{client-31b62450.js → client-4112eed9.js} +1 -1
- package/exports/browser/{index-e407f1a3.js → index-688c9980.js} +1 -1
- package/exports/browser/{messages-2465e07d.js → messages-6c66a924.js} +1 -1
- package/exports/browser/{peernet-805b1e8e.js → peernet-b4b62ddc.js} +5 -6
- package/exports/browser/peernet.js +1 -1
- package/exports/peernet.js +2 -3
- package/package.json +1 -1
- package/src/dht/dht.js +1 -2
- package/src/peernet.ts +1 -1
|
@@ -6203,8 +6203,7 @@ const lastFetched = {
|
|
|
6203
6203
|
const fetchedCoordinates = {};
|
|
6204
6204
|
const getAddress = async () => {
|
|
6205
6205
|
const { address } = lastFetched;
|
|
6206
|
-
|
|
6207
|
-
if (now - address.timestamp > 1200000) {
|
|
6206
|
+
if (address) {
|
|
6208
6207
|
address.value = await fetch('https://icanhazip.com/');
|
|
6209
6208
|
address.value = await address.value.text();
|
|
6210
6209
|
address.timestamp = Math.round(new Date().getTime() / 1000);
|
|
@@ -20185,7 +20184,7 @@ class Identity {
|
|
|
20185
20184
|
globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
|
|
20186
20185
|
}
|
|
20187
20186
|
else {
|
|
20188
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-
|
|
20187
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-688c9980.js');
|
|
20189
20188
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
20190
20189
|
await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
|
|
20191
20190
|
await globalThis.walletStore.put('version', String(1));
|
|
@@ -20356,7 +20355,7 @@ class Peernet {
|
|
|
20356
20355
|
this.root = options.root;
|
|
20357
20356
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
20358
20357
|
// FolderMessageResponse
|
|
20359
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
20358
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-6c66a924.js');
|
|
20360
20359
|
/**
|
|
20361
20360
|
* proto Object containing protos
|
|
20362
20361
|
* @type {Object}
|
|
@@ -20428,7 +20427,7 @@ class Peernet {
|
|
|
20428
20427
|
if (this.#starting || this.#started)
|
|
20429
20428
|
return;
|
|
20430
20429
|
this.#starting = true;
|
|
20431
|
-
const importee = await import('./client-
|
|
20430
|
+
const importee = await import('./client-4112eed9.js');
|
|
20432
20431
|
/**
|
|
20433
20432
|
* @access public
|
|
20434
20433
|
* @type {PeernetClient}
|
|
@@ -20613,7 +20612,7 @@ class Peernet {
|
|
|
20613
20612
|
throw nothingFoundError(hash);
|
|
20614
20613
|
debug(`found ${providers.size} provider(s) for ${hash}`);
|
|
20615
20614
|
// get closest peer on earth
|
|
20616
|
-
const closestPeer =
|
|
20615
|
+
const closestPeer = providers[0];
|
|
20617
20616
|
// get peer instance by id
|
|
20618
20617
|
if (!closestPeer || !closestPeer.id)
|
|
20619
20618
|
return this.requestData(hash, store?.name || store);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as default } from './peernet-
|
|
1
|
+
export { P as default } from './peernet-b4b62ddc.js';
|
|
2
2
|
import './value-157ab062.js';
|
package/exports/peernet.js
CHANGED
|
@@ -164,8 +164,7 @@ const lastFetched = {
|
|
|
164
164
|
const fetchedCoordinates = {};
|
|
165
165
|
const getAddress = async () => {
|
|
166
166
|
const { address } = lastFetched;
|
|
167
|
-
|
|
168
|
-
if (now - address.timestamp > 1200000) {
|
|
167
|
+
if (address) {
|
|
169
168
|
address.value = await fetch('https://icanhazip.com/');
|
|
170
169
|
address.value = await address.value.text();
|
|
171
170
|
address.timestamp = Math.round(new Date().getTime() / 1000);
|
|
@@ -771,7 +770,7 @@ class Peernet {
|
|
|
771
770
|
throw nothingFoundError(hash);
|
|
772
771
|
debug(`found ${providers.size} provider(s) for ${hash}`);
|
|
773
772
|
// get closest peer on earth
|
|
774
|
-
const closestPeer =
|
|
773
|
+
const closestPeer = providers[0];
|
|
775
774
|
// get peer instance by id
|
|
776
775
|
if (!closestPeer || !closestPeer.id)
|
|
777
776
|
return this.requestData(hash, store?.name || store);
|
package/package.json
CHANGED
package/src/dht/dht.js
CHANGED
|
@@ -18,8 +18,7 @@ const fetchedCoordinates = {}
|
|
|
18
18
|
|
|
19
19
|
const getAddress = async () => {
|
|
20
20
|
const {address} = lastFetched
|
|
21
|
-
|
|
22
|
-
if (now - address.timestamp > 1200000) {
|
|
21
|
+
if (address) {
|
|
23
22
|
address.value = await fetch('https://icanhazip.com/')
|
|
24
23
|
address.value = await address.value.text()
|
|
25
24
|
address.timestamp = Math.round(new Date().getTime() / 1000);
|
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 =
|
|
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
|
|