sol2uml 2.2.4 → 2.2.6

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/README.md CHANGED
@@ -58,7 +58,7 @@ Options:
58
58
  -f, --outputFormat <value> output file format. (choices: "svg", "png", "dot", "all", default: "svg")
59
59
  -o, --outputFileName <value> output file name
60
60
  -i, --ignoreFilesOrFolders <filesOrFolders> comma separated list of files or folders to ignore
61
- -n, --network <network> Ethereum network (choices: "mainnet", "ropsten", "kovan", "rinkeby", "goerli", "sepolia", "polygon", "testnet.polygon", "arbitrum", "testnet.arbitrum", "avalanche", "testnet.avalanche", "bsc", "testnet.bsc", "crono", "fantom", "testnet.fantom", "moonbeam", "optimistic", "kovan-optimistic", default: "mainnet", env: ETH_NETWORK)
61
+ -n, --network <network> Ethereum network (choices: "mainnet", "ropsten", "kovan", "rinkeby", "goerli", "sepolia", "polygon", "testnet.polygon", "arbitrum", "testnet.arbitrum", "avalanche", "testnet.avalanche", "bsc", "testnet.bsc", "crono", "fantom", "testnet.fantom", "moonbeam", "optimistic", "kovan-optimistic", "gnosisscan", default: "mainnet", env: ETH_NETWORK)
62
62
  -k, --apiKey <key> Blockchain explorer API key. eg Etherscan, Arbiscan, BscScan, CronoScan, FTMScan, PolygonScan or SnowTrace API key (env: SCAN_API_KEY)
63
63
  -v, --verbose run with debugging statements (default: false)
64
64
  -h, --help display help for command
@@ -1,6 +1,6 @@
1
1
  import { ASTNode } from '@solidity-parser/parser/dist/src/ast-types';
2
2
  import { UmlClass } from './umlClass';
3
- export declare const networks: readonly ["mainnet", "ropsten", "kovan", "rinkeby", "goerli", "sepolia", "polygon", "testnet.polygon", "arbitrum", "testnet.arbitrum", "avalanche", "testnet.avalanche", "bsc", "testnet.bsc", "crono", "fantom", "testnet.fantom", "moonbeam", "optimistic", "kovan-optimistic"];
3
+ export declare const networks: readonly ["mainnet", "ropsten", "kovan", "rinkeby", "goerli", "sepolia", "polygon", "testnet.polygon", "arbitrum", "testnet.arbitrum", "avalanche", "testnet.avalanche", "bsc", "testnet.bsc", "crono", "fantom", "testnet.fantom", "moonbeam", "optimistic", "kovan-optimistic", "gnosisscan"];
4
4
  declare type Network = typeof networks[number];
5
5
  export declare class EtherscanParser {
6
6
  protected apikey: string;
@@ -32,6 +32,7 @@ exports.networks = [
32
32
  'moonbeam',
33
33
  'optimistic',
34
34
  'kovan-optimistic',
35
+ 'gnosisscan',
35
36
  ];
36
37
  class EtherscanParser {
37
38
  constructor(apikey = 'ZAD4UI2RCXCQTP38EXS3UY2MPHFU5H9KB1', network = 'mainnet') {
@@ -69,14 +70,15 @@ class EtherscanParser {
69
70
  }
70
71
  else if (network === 'bsc') {
71
72
  this.url = 'https://api.bscscan.com/api';
73
+ this.apikey = 'APYH49FXVY9UA3KTDI6F4WP3KPIC86NITN';
72
74
  }
73
75
  else if (network === 'testnet.bsc') {
74
76
  this.url = 'https://api-testnet.bscscan.com/api';
77
+ this.apikey = 'APYH49FXVY9UA3KTDI6F4WP3KPIC86NITN';
75
78
  }
76
79
  else if (network === 'crono') {
77
80
  this.url = 'https://api.cronoscan.com/api';
78
81
  this.apikey = '76A3RG5WHTPMMR66E9SFI2EIDT6MP976W2';
79
- this.apikey = 'APYH49FXVY9UA3KTDI6F4WP3KPIC86NITN';
80
82
  }
81
83
  else if (network === 'fantom') {
82
84
  this.url = 'https://api.ftmscan.com/api';
@@ -94,6 +96,10 @@ class EtherscanParser {
94
96
  this.url = 'https://api-moonbeam.moonscan.io/api';
95
97
  this.apikey = '5EUFXW6TDC16VERF3D9SCWRRU6AEMTBHNJ';
96
98
  }
99
+ else if (network === 'gnosisscan') {
100
+ this.url = 'https://api.gnosisscan.io/api';
101
+ this.apikey = '2RWGXIWK538EJ8XSP9DE2JUINSCG7UCSJB';
102
+ }
97
103
  else {
98
104
  this.url = `https://api-${network}.etherscan.io/api`;
99
105
  }
@@ -11,7 +11,7 @@ const parserUmlClasses = async (fileFolderAddress, options) => {
11
11
  };
12
12
  if ((0, regEx_1.isAddress)(fileFolderAddress)) {
13
13
  debug(`argument ${fileFolderAddress} is an Ethereum address so checking Etherscan for the verified source code`);
14
- const etherscanApiKey = options.etherscanApiKey || 'ZAD4UI2RCXCQTP38EXS3UY2MPHFU5H9KB1';
14
+ const etherscanApiKey = options.apiKey || 'ZAD4UI2RCXCQTP38EXS3UY2MPHFU5H9KB1';
15
15
  const etherscanParser = new parserEtherscan_1.EtherscanParser(etherscanApiKey, options.network);
16
16
  result = await etherscanParser.getUmlClasses(fileFolderAddress);
17
17
  }
package/lib/sol2uml.js CHANGED
@@ -37,7 +37,7 @@ The Solidity code can be pulled from verified source code on Blockchain explorer
37
37
  .choices(parserEtherscan_1.networks)
38
38
  .default('mainnet')
39
39
  .env('ETH_NETWORK'))
40
- .addOption(new commander_1.Option('-k, --apiKey <key>', 'Blockchain explorer API key. eg Etherscan, Arbiscan, BscScan, CronoScan, FTMScan, PolygonScan or SnowTrace API key').env('SCAN_API_KEY'))
40
+ .addOption(new commander_1.Option('-k, --apiKey <key>', 'Blockchain explorer API key. eg Etherscan, Arbiscan, Optimism, BscScan, CronoScan, FTMScan, PolygonScan or SnowTrace API key').env('SCAN_API_KEY'))
41
41
  .option('-v, --verbose', 'run with debugging statements', false);
42
42
  program
43
43
  .command('class', { isDefault: true })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sol2uml",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "Solidity contract visualisation tool.",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -31,10 +31,10 @@
31
31
  "klaw": "^4.0.1"
32
32
  },
33
33
  "devDependencies": {
34
+ "@openzeppelin/contracts": "4.7.3",
34
35
  "@types/jest": "^29.1.1",
35
36
  "@types/klaw": "^3.0.3",
36
37
  "jest": "^29.1.2",
37
- "@openzeppelin/contracts": "4.7.3",
38
38
  "prettier": "^2.7.1",
39
39
  "ts-jest": "^29.0.3",
40
40
  "ts-node": "^10.9.1",