@leofcoin/chain 1.7.139 → 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.
@@ -7,6 +7,21 @@ if (globalThis.localStorage && !TARGETS) {
7
7
  TARGETS = JSON.parse(DEBUG);
8
8
  }
9
9
  }
10
+ const getLogger = (trace) => (trace ? console.trace : console.log);
11
+ const debug$3 = (target, text, trace) => {
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");
23
+ };
24
+ const createDebugger = (target) => (text, trace) => debug$3(target, text, trace);
10
25
 
11
26
  /* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
12
27
  /**
@@ -5687,7 +5702,7 @@ class ConnectionMonitor {
5687
5702
  }
5688
5703
  }
5689
5704
 
5690
- const debug = globalThis.createDebugger('leofcoin/chain');
5705
+ const debug = createDebugger('leofcoin/chain');
5691
5706
  // check if browser or local
5692
5707
  class Chain extends VersionControl {
5693
5708
  #state;
@@ -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.139",
3
+ "version": "1.7.141",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {