@leofcoin/chain 1.7.2 → 1.7.4

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 } from './node-browser-Od7gtk-Y.js';
1
+ import { g as getDefaultExportFromCjs } from './node-browser-Bjb6j0bF.js';
2
2
  import './index-XTbRdu6H.js';
3
3
 
4
4
  var global;
@@ -5086,7 +5086,9 @@ class Chain extends VersionControl {
5086
5086
  return;
5087
5087
  const lastBlock = await this.#makeRequest(peer, 'lastBlock');
5088
5088
  const localBlock = await this.lastBlock;
5089
- const higherThenCurrentLocal = !localBlock.index ? true : lastBlock.index > localBlock.index;
5089
+ if (lastBlock.hash === '0x0')
5090
+ return;
5091
+ const higherThenCurrentLocal = !localBlock?.index ? true : lastBlock.index > localBlock.index;
5090
5092
  if (Object.keys(lastBlock).length > 0) {
5091
5093
  if (!this.lastBlock || higherThenCurrentLocal) {
5092
5094
  this.knownBlocks = await this.#makeRequest(peer, 'knownBlocks');
@@ -1,4 +1,4 @@
1
- import { L as LittlePubSub } from './node-browser-Od7gtk-Y.js';
1
+ import { L as LittlePubSub } from './node-browser-Bjb6j0bF.js';
2
2
  import './index-XTbRdu6H.js';
3
3
 
4
4
  class Api {
@@ -206,7 +206,7 @@ class SocketRequestClient {
206
206
  const init = async () => {
207
207
  // @ts-ignore
208
208
  if (!globalThis.WebSocket)
209
- globalThis.WebSocket = (await import('./browser-Ei0BXMlu-Bru_cjhY.js').then(function (n) { return n.b; })).default.w3cwebsocket;
209
+ globalThis.WebSocket = (await import('./browser-Ei0BXMlu-CUWm-sMO.js').then(function (n) { return n.b; })).default.w3cwebsocket;
210
210
  const client = new WebSocket(this.#url, this.#protocol);
211
211
  client.onmessage = this.onmessage;
212
212
  client.onerror = this.onerror;
@@ -280,7 +280,7 @@ const iceServers = [
280
280
  credential: 'openrelayproject'
281
281
  }
282
282
  ];
283
- const SimplePeer = (await import('./index-YQrIDBUQ-RIYuLGAF.js').then(function (n) { return n.i; })).default;
283
+ const SimplePeer = (await import('./index-YQrIDBUQ-COx7Reww.js').then(function (n) { return n.i; })).default;
284
284
  class Peer extends SimplePeer {
285
285
  peerId;
286
286
  channelName;
@@ -1,4 +1,4 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-Od7gtk-Y.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-Bjb6j0bF.js';
2
2
  import './index-XTbRdu6H.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { i as inherits_browserExports, c as commonjsGlobal, g as getDefaultExportFromCjs, r as require$$3 } from './node-browser-Od7gtk-Y.js';
1
+ import { i as inherits_browserExports, c as commonjsGlobal, g as getDefaultExportFromCjs, r as require$$3 } from './node-browser-Bjb6j0bF.js';
2
2
  import './index-XTbRdu6H.js';
3
3
 
4
4
  var browser$2 = {exports: {}};
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './node-browser-Od7gtk-Y.js';
1
+ import { F as FormatInterface } from './node-browser-Bjb6j0bF.js';
2
2
  import './index-XTbRdu6H.js';
3
3
 
4
4
  var proto$b = {
@@ -27208,7 +27208,7 @@ class Identity {
27208
27208
  this.selectedAccount = new TextDecoder().decode(selected);
27209
27209
  }
27210
27210
  else {
27211
- const importee = await import(/* webpackChunkName: "generate-account" */ './index-G74WLzL7-DW-xDkOL.js');
27211
+ const importee = await import(/* webpackChunkName: "generate-account" */ './index-G74WLzL7-D5kDRHRC.js');
27212
27212
  const { identity, accounts } = await importee.default(password, this.network);
27213
27213
  await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
27214
27214
  await globalThis.walletStore.put('version', String(1));
@@ -27400,7 +27400,7 @@ class Peernet {
27400
27400
  this.root = options.root;
27401
27401
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
27402
27402
  // FolderMessageResponse
27403
- } = await import(/* webpackChunkName: "messages" */ './messages-lWRTai7t-J7Xx6IHA.js');
27403
+ } = await import(/* webpackChunkName: "messages" */ './messages-lWRTai7t-C3uUT_S7.js');
27404
27404
  /**
27405
27405
  * proto Object containing protos
27406
27406
  * @type {Object}
@@ -27494,7 +27494,7 @@ class Peernet {
27494
27494
  if (this.#starting || this.#started)
27495
27495
  return;
27496
27496
  this.#starting = true;
27497
- const importee = await import('./client-A009z8av-BwJnq5m9.js');
27497
+ const importee = await import('./client-A009z8av-D7GxR0o2.js');
27498
27498
  /**
27499
27499
  * @access public
27500
27500
  * @type {PeernetClient}
@@ -27995,7 +27995,7 @@ var networks = {
27995
27995
  const DEFAULT_NODE_OPTIONS = {
27996
27996
  network: 'leofcoin:peach',
27997
27997
  networkVersion: 'peach',
27998
- version: '1.2.0',
27998
+ version: '1.2.1',
27999
27999
  stars: networks.leofcoin.peach.stars
28000
28000
  };
28001
28001
 
@@ -1,2 +1,2 @@
1
- export { N as default } from './node-browser-Od7gtk-Y.js';
1
+ export { N as default } from './node-browser-Bjb6j0bF.js';
2
2
  import './index-XTbRdu6H.js';
package/exports/chain.js CHANGED
@@ -1453,7 +1453,9 @@ class Chain extends VersionControl {
1453
1453
  return;
1454
1454
  const lastBlock = await this.#makeRequest(peer, 'lastBlock');
1455
1455
  const localBlock = await this.lastBlock;
1456
- const higherThenCurrentLocal = !localBlock.index ? true : lastBlock.index > localBlock.index;
1456
+ if (lastBlock.hash === '0x0')
1457
+ return;
1458
+ const higherThenCurrentLocal = !localBlock?.index ? true : lastBlock.index > localBlock.index;
1457
1459
  if (Object.keys(lastBlock).length > 0) {
1458
1460
  if (!this.lastBlock || higherThenCurrentLocal) {
1459
1461
  this.knownBlocks = await this.#makeRequest(peer, 'knownBlocks');
package/exports/node.js CHANGED
@@ -5,7 +5,7 @@ import networks from '@leofcoin/networks';
5
5
  const DEFAULT_NODE_OPTIONS = {
6
6
  network: 'leofcoin:peach',
7
7
  networkVersion: 'peach',
8
- version: '1.2.0',
8
+ version: '1.2.1',
9
9
  stars: networks.leofcoin.peach.stars
10
10
  };
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {