@leofcoin/peernet 1.1.24 → 1.1.25

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-805b1e8e.js';
1
+ import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './peernet-3749aa41.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-805b1e8e.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './peernet-3749aa41.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './peernet-805b1e8e.js';
1
+ import { F as FormatInterface } from './peernet-3749aa41.js';
2
2
  import './value-157ab062.js';
3
3
 
4
4
  var proto$b = {
@@ -6203,8 +6203,7 @@ const lastFetched = {
6203
6203
  const fetchedCoordinates = {};
6204
6204
  const getAddress = async () => {
6205
6205
  const { address } = lastFetched;
6206
- const now = Math.round(new Date().getTime() / 1000);
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-e407f1a3.js');
20187
+ const importee = await import(/* webpackChunkName: "generate-account" */ './index-116df6d1.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-2465e07d.js');
20358
+ } = await import(/* webpackChunkName: "messages" */ './messages-fab7583b.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-31b62450.js');
20430
+ const importee = await import('./client-bdab491d.js');
20432
20431
  /**
20433
20432
  * @access public
20434
20433
  * @type {PeernetClient}
@@ -1,2 +1,2 @@
1
- export { P as default } from './peernet-805b1e8e.js';
1
+ export { P as default } from './peernet-3749aa41.js';
2
2
  import './value-157ab062.js';
@@ -164,8 +164,7 @@ const lastFetched = {
164
164
  const fetchedCoordinates = {};
165
165
  const getAddress = async () => {
166
166
  const { address } = lastFetched;
167
- const now = Math.round(new Date().getTime() / 1000);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "",
5
5
  "main": "src/peernet.js",
6
6
  "exports": {
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
- const now = Math.round(new Date().getTime() / 1000);
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);