@leofcoin/chain 1.7.138 → 1.7.141

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,40 +1,27 @@
1
1
  import { t as toBase58, T as TransactionMessage, C as ContractMessage, R as RawTransactionMessage, B as BlockMessage, a as BWMessage, b as BWRequestMessage } from './index-DUfUgiQY.js';
2
2
 
3
- if (!globalThis.DEBUG) {
4
- globalThis.DEBUG = [];
5
- if (globalThis.localStorage) {
3
+ let TARGETS = undefined;
4
+ if (globalThis.localStorage && !TARGETS) {
6
5
  const DEBUG = globalThis.localStorage.getItem("DEBUG");
7
6
  if (DEBUG) {
8
- globalThis.DEBUG = DEBUG.startsWith("[")
9
- ? JSON.parse(DEBUG).split(",")
10
- : [DEBUG];
7
+ TARGETS = JSON.parse(DEBUG);
11
8
  }
12
- }
13
9
  }
14
-
15
10
  const getLogger = (trace) => (trace ? console.trace : console.log);
16
-
17
11
  const debug$3 = (target, text, trace) => {
18
- const _logger = getLogger(trace);
19
- if (!globalThis.DEBUG || globalThis.DEBUG?.length === 0) return;
20
- if (
21
- globalThis.DEBUG === "true" ||
22
- globalThis.DEBUG === true ||
23
- globalThis.DEBUG?.indexOf(target) !== -1 ||
24
- globalThis.DEBUG?.indexOf("*") !== -1 ||
25
- globalThis.DEBUG?.indexOf(target.split("/")[0]) !== -1
26
- )
27
- if (text) _logger("\x1b[34m\x1b[1m%s", `${target}: ${text}`, "\x1b[0m");
28
- else _logger("\x1b[34m\x1b[1m%s", `${target}`, "\x1b[0m");
12
+ const _logger = getLogger(trace);
13
+ if (!TARGETS)
14
+ return;
15
+ if (TARGETS === true ||
16
+ TARGETS?.indexOf(target) !== -1 ||
17
+ TARGETS?.indexOf("*") !== -1 ||
18
+ TARGETS?.indexOf(target.split("/")[0]) !== -1)
19
+ if (text)
20
+ _logger("\x1b[34m\x1b[1m%s", `${target}: ${text}`, "\x1b[0m");
21
+ else
22
+ _logger("\x1b[34m\x1b[1m%s", `${target}`, "\x1b[0m");
29
23
  };
30
-
31
- const createDebugger = (target) => (text) => debug$3(target, text);
32
-
33
- if (!globalThis.debug) {
34
- globalThis.debug = debug$3;
35
- // todo: deprecate
36
- globalThis.createDebugger = createDebugger;
37
- }
24
+ const createDebugger = (target) => (text, trace) => debug$3(target, text, trace);
38
25
 
39
26
  /* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
40
27
  /**
@@ -5715,7 +5702,7 @@ class ConnectionMonitor {
5715
5702
  }
5716
5703
  }
5717
5704
 
5718
- const debug = globalThis.createDebugger('leofcoin/chain');
5705
+ const debug = createDebugger('leofcoin/chain');
5719
5706
  // check if browser or local
5720
5707
  class Chain extends VersionControl {
5721
5708
  #state;
@@ -1,4 +1,4 @@
1
- import { L as LittlePubSub } from './node-browser-C5GuLP_b.js';
1
+ import { L as LittlePubSub } from './node-browser-SPIwS-5O.js';
2
2
  import './identity-nIyW_Xm8-BU8xakCv.js';
3
3
  import './index-DUfUgiQY.js';
4
4
  import './networks-BdMfU1ag.js';
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './node-browser-C5GuLP_b.js';
1
+ import { F as FormatInterface } from './node-browser-SPIwS-5O.js';
2
2
  import './identity-nIyW_Xm8-BU8xakCv.js';
3
3
  import './index-DUfUgiQY.js';
4
4
  import './networks-BdMfU1ag.js';
@@ -8347,7 +8347,7 @@ globalThis.LeofcoinStorage = LeofcoinStorage$1;
8347
8347
  globalThis.leofcoin = globalThis.leofcoin || {};
8348
8348
  globalThis.pubsub = globalThis.pubsub || new LittlePubSub();
8349
8349
  globalThis.globalSub = globalThis.globalSub || new LittlePubSub();
8350
- const debug = globalThis.createDebugger('peernet');
8350
+ const debug = createDebugger('peernet');
8351
8351
  /**
8352
8352
  * @access public
8353
8353
  * @example
@@ -8491,7 +8491,7 @@ class Peernet {
8491
8491
  this.root = options.root;
8492
8492
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
8493
8493
  // FolderMessageResponse
8494
- } = await import(/* webpackChunkName: "messages" */ './messages-C22qRxnF-tW3z5FMF.js');
8494
+ } = await import(/* webpackChunkName: "messages" */ './messages-CC7UR5ol-BvFNyHjv.js');
8495
8495
  /**
8496
8496
  * proto Object containing protos
8497
8497
  * @type {Object}
@@ -8585,7 +8585,7 @@ class Peernet {
8585
8585
  if (this.#starting || this.#started)
8586
8586
  return;
8587
8587
  this.#starting = true;
8588
- const importee = await import('./client-Lwke64Zq-DO2uqAHA.js');
8588
+ const importee = await import('./client-q0JXZnpu-ChkF_Pn_.js');
8589
8589
  /**
8590
8590
  * @access public
8591
8591
  * @type {PeernetClient}
@@ -1,4 +1,4 @@
1
- export { N as default } from './node-browser-C5GuLP_b.js';
1
+ export { N as default } from './node-browser-SPIwS-5O.js';
2
2
  import './identity-nIyW_Xm8-BU8xakCv.js';
3
3
  import './index-DUfUgiQY.js';
4
4
  import './networks-BdMfU1ag.js';
@@ -1,4 +1,3 @@
1
- import '@vandeurenglenn/debug';
2
1
  import { Address } from './types.js';
3
2
  import { VersionControl } from './version-control.js';
4
3
  export default class Chain extends VersionControl {
package/exports/chain.js CHANGED
@@ -1,4 +1,4 @@
1
- import '@vandeurenglenn/debug';
1
+ import { createDebugger } from '@vandeurenglenn/debug';
2
2
  import { formatBytes, jsonStringifyBigInt, jsonParseBigInt, parseUnits, formatUnits } from '@leofcoin/utils';
3
3
  import { TransactionMessage, BlockMessage, ContractMessage, BWMessage, BWRequestMessage } from '@leofcoin/messages';
4
4
  import addresses, { contractFactory } from '@leofcoin/addresses';
@@ -1842,7 +1842,7 @@ class ConnectionMonitor {
1842
1842
  }
1843
1843
  }
1844
1844
 
1845
- const debug = globalThis.createDebugger('leofcoin/chain');
1845
+ const debug = createDebugger('leofcoin/chain');
1846
1846
  // check if browser or local
1847
1847
  class Chain extends VersionControl {
1848
1848
  #state;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.138",
3
+ "version": "1.7.141",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {
@@ -54,8 +54,8 @@
54
54
  "@rollup/plugin-node-resolve": "^16.0.3",
55
55
  "@rollup/plugin-typescript": "^12.3.0",
56
56
  "@types/semver": "^7.7.1",
57
- "@vandeurenglenn/debug": "^1.2.6",
58
- "rollup": "^4.53.3",
57
+ "@vandeurenglenn/debug": "^1.2.7",
58
+ "rollup": "^4.53.4",
59
59
  "rollup-plugin-modify": "^3.0.0",
60
60
  "tape": "^5.9.0",
61
61
  "tslib": "^2.8.1"
@@ -69,7 +69,7 @@
69
69
  "@leofcoin/messages": "^1.4.40",
70
70
  "@leofcoin/multi-wallet": "^3.1.8",
71
71
  "@leofcoin/networks": "^1.1.25",
72
- "@leofcoin/peernet": "^1.1.104",
72
+ "@leofcoin/peernet": "^1.1.105",
73
73
  "@leofcoin/storage": "^3.5.38",
74
74
  "@leofcoin/utils": "^1.1.40",
75
75
  "@leofcoin/workers": "^1.5.27",