diff --git a/.github/contributing.md b/.github/CONTRIBUTING.md similarity index 100% rename from .github/contributing.md rename to .github/CONTRIBUTING.md diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index dbbf82fc14..0000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,23 +0,0 @@ -'package: account': - - packages/account/* - - packages/account/**/* - -'package: block': - - packages/block/* - - packages/block/**/* - -'package: blockchain': - - packages/blockchain/* - - packages/blockchain/**/* - -'package: common': - - packages/common/* - - packages/common/**/* - -'package: tx': - - packages/tx/* - - packages/tx/**/* - -'package: vm': - - packages/vm/* - - packages/vm/**/* diff --git a/.github/workflows/client-build.yml b/.github/workflows/client-build.yml index 1ecfb2dcce..6a2f0b8e2d 100644 --- a/.github/workflows/client-build.yml +++ b/.github/workflows/client-build.yml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - network: ['rinkeby', 'goerli'] + network: ['goerli'] syncmode: ['full', 'light'] fail-fast: false steps: diff --git a/config/MONOREPO.md b/config/MONOREPO.md index f42af3b1e9..f45d3e7cf5 100644 --- a/config/MONOREPO.md +++ b/config/MONOREPO.md @@ -2,7 +2,7 @@ ## Development quick start -First, make sure you have the `ethereum-tests` git submodule, by running: +First, make sure you have the `ethereum-tests` git submodule, by running: ```sh git submodule init @@ -12,16 +12,36 @@ git submodule update This monorepo uses [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces). It links the local packages together, making development a lot easier. TLDR: Setup + ```sh npm i ``` TLDR: To update dependencies + ```sh npm run build --workspaces ``` -Above is the quickest way to set you up. Going down the road, there are two sets of commands: *project* and *package-specific* commands. You can find them at `./package.json` and `./packages/*/package.json`, respectively. Here's a breakdown: +Above is the quickest way to set you up. + +### ℹ️ Note for Windows users: + +Windows users might run into the following error when trying to install the repo: `'.' is not recognized as an internal or external command`. To remediate for this, you can force Windows to use Git bash to run scripts (you'll need to install [Git for Windows](https://git-scm.com/download/win) for this) with the following command: + +```sh +npm config set script-shell "C:\\Program Files (x86)\\git\\bin\\bash.exe" +``` + +If you ever need to reset this change, you can do so with this command: + +```sh +npm config delete script-shell +``` + +--- + +Going down the road, there are two sets of commands: _project_ and _package-specific_ commands. You can find them at `./package.json` and `./packages/*/package.json`, respectively. Here's a breakdown: ### Project scripts — run from repository root @@ -49,8 +69,8 @@ Rebuilds all generated docs. ### Package scripts — run from `./packages/` - **⚠️ Important: if you run `npm install` from the package directory, it will [ignore the workspace](https://github.com/npm/cli/issues/2546). Run `npm install` from the root only.** - +**⚠️ Important: if you run `npm install` from the package directory, it will [ignore the workspace](https://github.com/npm/cli/issues/2546). Run `npm install` from the root only.** + There's a set of rather standardized commands you will find in each package of this repository. #### `npm run build` @@ -75,6 +95,6 @@ Fixes code style according to the rules. Differently from `npm run lint`, this c #### `npm run test` -Runs the package tests. +Runs the package tests. -_Note that the VM has several test scopes - refer to [packages/vm/package.json](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/package.json) for more info._ \ No newline at end of file +_Note that the VM has several test scopes - refer to [packages/vm/package.json](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/package.json) for more info._ diff --git a/config/cli/prepublish.sh b/config/cli/prepublish.sh new file mode 100755 index 0000000000..54d6088548 --- /dev/null +++ b/config/cli/prepublish.sh @@ -0,0 +1 @@ +npm run clean && npm run build && npm run test \ No newline at end of file diff --git a/config/eslint.js b/config/eslint.js index cef26d7b7b..e33857e2fd 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -5,38 +5,48 @@ module.exports = { es6: true, node: true, }, - ignorePatterns: ['node_modules/', 'dist/', 'dist.browser/', 'coverage/', 'prettier.config.js', 'typedoc.js', 'karma.conf.js'], + ignorePatterns: [ + 'node_modules/', + 'dist/', + 'dist.browser/', + 'coverage/', + 'prettier.config.js', + 'typedoc.js', + 'karma.conf.js', + ], extends: ['typestrict', 'eslint:recommended'], rules: { 'no-console': 'warn', 'no-debugger': 'error', 'prefer-const': 'error', 'no-var': 'error', - 'implicit-dependencies/no-implicit': [ - 'error', - { peer: true, dev: true, optional: true }, - ], + 'implicit-dependencies/no-implicit': ['error', { peer: true, dev: true, optional: true }], '@typescript-eslint/prefer-nullish-coalescing': 'error', '@typescript-eslint/no-use-before-define': 'error', '@typescript-eslint/naming-convention': [ 'error', { - selector: 'interface', - format: ['PascalCase', 'camelCase'], - custom: { - regex: '^I[A-Z]', - match: false, - } - } + selector: 'interface', + format: ['PascalCase', 'camelCase'], + custom: { + regex: '^I[A-Z]', + match: false, + }, + }, ], 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }], + '@typescript-eslint/no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, + ], '@typescript-eslint/no-unnecessary-condition': 'off', 'no-dupe-class-members': 'off', 'prettier/prettier': 'error', + 'no-redeclare': 'off', + '@typescript-eslint/no-redeclare': ['error'], }, parserOptions: { sourceType: 'module', - project: './tsconfig.json' + project: './tsconfig.json', }, -}; +} diff --git a/greenkeeper.json b/greenkeeper.json deleted file mode 100644 index a78acbfda7..0000000000 --- a/greenkeeper.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "groups": { - "default": { - "packages": [ - "packages/account/package.json", - "packages/block/package.json", - "packages/blockchain/package.json", - "packages/common/package.json", - "packages/tx/package.json", - "packages/vm/package.json" - ] - } - } -} diff --git a/package-lock.json b/package-lock.json index fcf5b02aa3..3e9904754c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,9 +48,9 @@ } }, "node_modules/@babel/core": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.4.tgz", - "integrity": "sha512-Lkcv9I4a8bgUI8LJOLM6IKv6hnz1KOju6KM1lceqVMKlKKqNRopYd2Pc9MgIurqvMJ6BooemrnJz8jlIiQIpsA==", + "version": "7.15.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz", + "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.14.5", @@ -58,7 +58,7 @@ "@babel/helper-compilation-targets": "^7.15.4", "@babel/helper-module-transforms": "^7.15.4", "@babel/helpers": "^7.15.4", - "@babel/parser": "^7.15.4", + "@babel/parser": "^7.15.5", "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", "@babel/types": "^7.15.4", @@ -77,29 +77,30 @@ "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "safe-buffer": "~5.1.1" } }, - "node_modules/@babel/core/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "node_modules/@babel/core/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/generator": { "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", @@ -132,6 +133,15 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-function-name": { "version": "7.15.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", @@ -195,19 +205,19 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz", - "integrity": "sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz", + "integrity": "sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw==", "dev": true, "dependencies": { "@babel/helper-module-imports": "^7.15.4", "@babel/helper-replace-supers": "^7.15.4", "@babel/helper-simple-access": "^7.15.4", "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-validator-identifier": "^7.15.7", "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/types": "^7.15.6" }, "engines": { "node": ">=6.9.0" @@ -286,9 +296,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -332,9 +342,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.4.tgz", - "integrity": "sha512-xmzz+7fRpjrvDUj+GV7zfz/R3gSK2cOxGlazaXooxspCr539cbTXJKvBJzSVI2pPhcRGquoOtaIkKCsHQUiO3w==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.7.tgz", + "integrity": "sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -393,33 +403,19 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/traverse/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "dependencies": { - "ms": "2.1.2" - }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=4" } }, - "node_modules/@babel/traverse/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/@babel/types": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.4.tgz", - "integrity": "sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", + "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.14.9", @@ -522,27 +518,6 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz", "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==" }, - "node_modules/@motrix/nat-api/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@motrix/nat-api/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/@multiformats/base-x": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz", @@ -840,9 +815,9 @@ } }, "node_modules/@types/lodash": { - "version": "4.14.172", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.172.tgz", - "integrity": "sha512-/BHF5HAx3em7/KkzVKm3LrsD6HZAXuXO1AJZQ3cRRBZj4oHZDviWPYu0aEplAqDFNHZPW6d3G7KN+ONcCCC7pw==" + "version": "4.14.173", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.173.tgz", + "integrity": "sha512-vv0CAYoaEjCw/mLy96GBTnRoZrSxkGE0BKzKimdR8P3OzrNYNvBgtW7p055A+E8C31vXNUhWKoFCbhq7gbyhFg==" }, "node_modules/@types/long": { "version": "4.0.1", @@ -922,15 +897,6 @@ "@types/node": "*" } }, - "node_modules/@types/tape-catch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/tape-catch/-/tape-catch-1.0.0.tgz", - "integrity": "sha512-jHTUTszHf2FDMzgA86Yn68F4JZeKgVud0tlUqUfTEbjAK8gygd9Bd5HxpTWEL84Vi5P3PDTx2I4jxAULdLLd/w==", - "dev": true, - "dependencies": { - "@types/tape": "*" - } - }, "node_modules/@types/ws": { "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", @@ -940,13 +906,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz", - "integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz", + "integrity": "sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "4.30.0", - "@typescript-eslint/scope-manager": "4.30.0", + "@typescript-eslint/experimental-utils": "4.31.2", + "@typescript-eslint/scope-manager": "4.31.2", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", @@ -970,72 +936,16 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz", - "integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz", + "integrity": "sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.30.0", - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/typescript-estree": "4.30.0", + "@typescript-eslint/scope-manager": "4.31.2", + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/typescript-estree": "4.31.2", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -1051,14 +961,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz", - "integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.2.tgz", + "integrity": "sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "4.30.0", - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/typescript-estree": "4.30.0", + "@typescript-eslint/scope-manager": "4.31.2", + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/typescript-estree": "4.31.2", "debug": "^4.3.1" }, "engines": { @@ -1077,37 +987,14 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/@typescript-eslint/scope-manager": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz", - "integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz", + "integrity": "sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/visitor-keys": "4.30.0" + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/visitor-keys": "4.31.2" }, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" @@ -1118,9 +1005,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz", - "integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.2.tgz", + "integrity": "sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w==", "dev": true, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" @@ -1131,13 +1018,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz", - "integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz", + "integrity": "sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/visitor-keys": "4.30.0", + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/visitor-keys": "4.31.2", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -1157,69 +1044,13 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz", - "integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz", + "integrity": "sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.30.0", + "@typescript-eslint/types": "4.31.2", "eslint-visitor-keys": "^2.0.0" }, "engines": { @@ -1688,29 +1519,6 @@ "node": ">=8.5.0" } }, - "node_modules/0x/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/0x/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/0x/node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -1928,6 +1736,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -2019,46 +1839,6 @@ "readable-stream": "^2.0.6" } }, - "node_modules/are-we-there-yet/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/are-we-there-yet/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "node_modules/are-we-there-yet/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -2590,38 +2370,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/bl/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "node_modules/bl/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/bl/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/bl/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/blakejs": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", @@ -2659,6 +2407,21 @@ "node": ">= 0.8" } }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2792,11 +2555,6 @@ "safe-buffer": "^5.0.1" } }, - "node_modules/browserify-aes/node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - }, "node_modules/browserify-cipher": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", @@ -2847,6 +2605,20 @@ "safe-buffer": "^5.2.0" } }, + "node_modules/browserify-sign/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/browserify-zlib": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", @@ -2856,53 +2628,17 @@ "pako": "~1.0.5" } }, - "node_modules/browserify/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/browserify/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/browserify/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/browserify/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/browserslist": { - "version": "4.16.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", - "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.1.tgz", + "integrity": "sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ==", "dev": true, "dependencies": { - "caniuse-lite": "^1.0.30001251", - "colorette": "^1.3.0", - "electron-to-chromium": "^1.3.811", + "caniuse-lite": "^1.0.30001259", + "electron-to-chromium": "^1.3.846", "escalade": "^3.1.1", - "node-releases": "^1.1.75" + "nanocolors": "^0.1.5", + "node-releases": "^1.1.76" }, "bin": { "browserslist": "cli.js" @@ -2962,12 +2698,9 @@ "dev": true }, "node_modules/buffer-xor": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", - "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", - "dependencies": { - "safe-buffer": "^5.1.1" - } + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "node_modules/bufio": { "version": "1.0.7", @@ -3190,10 +2923,13 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001252", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001252.tgz", - "integrity": "sha512-I56jhWDGMtdILQORdusxBOH+Nl/KgQSdDmpJezYddnAkVOmnoU8zwjTV9xAjMIYxr0iPreEAVylCGcmHCjfaOw==", + "version": "1.0.30001260", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz", + "integrity": "sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg==", "dev": true, + "dependencies": { + "nanocolors": "^0.1.0" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/browserslist" @@ -3477,39 +3213,35 @@ } }, "node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/cliui/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/clone": { @@ -3584,12 +3316,6 @@ "simple-swizzle": "^0.2.2" } }, - "node_modules/colorette": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", - "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", - "dev": true - }, "node_modules/colors": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", @@ -3620,12 +3346,6 @@ "source-map": "~0.5.3" } }, - "node_modules/combine-source-map/node_modules/convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3703,6 +3423,21 @@ "node": ">= 0.8" } }, + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/compression/node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -3729,42 +3464,6 @@ "typedarray": "^0.0.6" } }, - "node_modules/concat-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/concat-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", @@ -3780,6 +3479,21 @@ "node": ">= 0.10.0" } }, + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/console-browserify": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", @@ -3836,18 +3550,9 @@ } }, "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/convert-source-map/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", "dev": true }, "node_modules/cookie": { @@ -3925,9 +3630,9 @@ "hasInstallScript": true }, "node_modules/core-js-pure": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.17.2.tgz", - "integrity": "sha512-2VV7DlIbooyTI7Bh+yzOOWL9tGwLnQKHno7qATE+fqZzDKYr6llVjVQOzpD/QLZFgXDPb8T71pJokHEZHEYJhQ==", + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.18.0.tgz", + "integrity": "sha512-ZnK+9vyuMhKulIGqT/7RHGRok8RtkHMEX/BGPHkHx+ouDkq+MUvf9mfIgdqhpmPDu8+V5UtRn/CbCRc9I4lX4w==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -3935,9 +3640,9 @@ } }, "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cors": { "version": "2.8.5", @@ -4373,6 +4078,35 @@ "whatwg-url": "^7.0.0" } }, + "node_modules/data-urls/node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/data-urls/node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/data-urls/node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "node_modules/date-format": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz", @@ -4404,11 +4138,19 @@ "dev": true }, "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dependencies": { - "ms": "2.0.0" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/debug-log": { @@ -4421,9 +4163,9 @@ } }, "node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/decamelize": { "version": "1.2.0", @@ -4454,26 +4196,41 @@ } }, "node_modules/deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", + "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "dependencies": { + "call-bind": "^1.0.0", + "es-get-iterator": "^1.1.1", + "get-intrinsic": "^1.0.1", "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", + "is-date-object": "^1.0.2", + "is-regex": "^1.1.1", + "isarray": "^2.0.5", + "object-is": "^1.1.4", "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" + "object.assign": "^4.1.2", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.3", + "which-boxed-primitive": "^1.0.1", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/deep-equal/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "node_modules/default-gateway": { @@ -4728,27 +4485,6 @@ "receptacle": "^1.3.2" } }, - "node_modules/dns-over-http-resolver/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/dns-over-http-resolver/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -4773,12 +4509,6 @@ "void-elements": "^2.0.0" } }, - "node_modules/dom-walk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", - "dev": true - }, "node_modules/domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -4845,42 +4575,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/duplexer2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/duplexer2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/duplexer2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/duplexer2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -4893,42 +4587,6 @@ "stream-shift": "^1.0.0" } }, - "node_modules/duplexify/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/duplexify/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/duplexify/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/duplexify/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -4970,9 +4628,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.3.829", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.829.tgz", - "integrity": "sha512-5EXDbvsaLRxS1UOfRr8Hymp3dR42bvBNPgzVuPwUFj3v66bpvDUcNwwUywQUQYn/scz26/3Sgd3fNVGQOlVwvQ==", + "version": "1.3.849", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.849.tgz", + "integrity": "sha512-RweyW60HPOqIcxoKTGr38Yvtf2aliSUqX8dB3e9geJ0Bno0YLjcOX5F7/DPVloBkJWaPZ7xOM1A0Yme2T1A34w==", "dev": true }, "node_modules/elliptic": { @@ -5095,29 +4753,6 @@ "node": ">=8.0.0" } }, - "node_modules/engine.io/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/engine.io/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/engine.io/node_modules/ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", @@ -5203,21 +4838,22 @@ } }, "node_modules/es-abstract": { - "version": "1.18.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz", - "integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==", + "version": "1.18.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz", + "integrity": "sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==", "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-symbols": "^1.0.2", "internal-slot": "^1.0.3", - "is-callable": "^1.2.3", + "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", + "is-regex": "^1.1.4", + "is-string": "^1.0.7", "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", @@ -5232,6 +4868,31 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-get-iterator": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", + "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.0", + "has-symbols": "^1.0.1", + "is-arguments": "^1.1.0", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-get-iterator/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -5514,6 +5175,21 @@ "resolve": "^1.1.6" } }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/eslint-module-utils": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz", @@ -5747,23 +5423,6 @@ "node": ">=10" } }, - "node_modules/eslint/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/eslint/node_modules/eslint-utils": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", @@ -5785,27 +5444,6 @@ "node": ">=4" } }, - "node_modules/eslint/node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "dependencies": { - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/eslint/node_modules/regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -5815,13 +5453,13 @@ "node": ">=6.5.0" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "node_modules/eslint/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true, - "engines": { - "node": ">=8" + "bin": { + "semver": "bin/semver.js" } }, "node_modules/espree": { @@ -6140,6 +5778,15 @@ "node": ">=0.10.0" } }, + "node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, "node_modules/expand-brackets/node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -6244,6 +5891,12 @@ "node": ">=0.10.0" } }, + "node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", @@ -6306,6 +5959,21 @@ "node": ">= 0.6" } }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/express/node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -6319,9 +5987,9 @@ "dev": true }, "node_modules/ext": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.5.0.tgz", - "integrity": "sha512-+ONcYoWj/SoQwUofMr94aGu05Ou4FepKi7N7b+O8T4jVfyIsZQV1/xeS8jpaBzF0csAk0KLXoHCxU7cKYZjo1Q==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "dev": true, "dependencies": { "type": "^2.5.0" @@ -6492,14 +6160,15 @@ } }, "node_modules/fast-safe-stringify": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", - "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true }, "node_modules/fastq": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz", - "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -6588,6 +6257,21 @@ "node": ">= 0.8" } }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/find-cache-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", @@ -6874,51 +6558,15 @@ "readable-stream": "^2.3.6" } }, - "node_modules/flush-write-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/flush-write-stream/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/flush-write-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/flush-write-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/fn.name": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", - "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", "dev": true, "funding": [ { @@ -7063,53 +6711,36 @@ "readable-stream": "^2.0.0" } }, - "node_modules/from2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/from2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, + "node_modules/fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" } }, - "node_modules/from2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/from2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, + "node_modules/fs-extra/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dependencies": { - "safe-buffer": "~5.1.0" + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" } }, - "node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, + "node_modules/fs-extra/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "engines": { - "node": ">=6 <7 || >=8" + "node": ">= 10.0.0" } }, "node_modules/fs-write-stream-atomic": { @@ -7124,42 +6755,6 @@ "readable-stream": "1 || 2" } }, - "node_modules/fs-write-stream-atomic/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/fs-write-stream-atomic/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/fs-write-stream-atomic/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/fs-write-stream-atomic/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -7325,6 +6920,15 @@ "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", @@ -7345,6 +6949,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -7363,9 +6982,9 @@ } }, "node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -7394,16 +7013,6 @@ "node": ">= 6" } }, - "node_modules/global": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", - "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", - "dev": true, - "dependencies": { - "min-document": "^2.19.0", - "process": "~0.5.1" - } - }, "node_modules/global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -7430,22 +7039,19 @@ "node": ">=6" } }, - "node_modules/global/node_modules/process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, + "dependencies": { + "type-fest": "^0.8.1" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globby": { @@ -7573,6 +7179,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-dynamic-import": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.0.tgz", + "integrity": "sha512-GYPi/aZmACJVrVfEhP1rNUFmtCuK+SQ96mn8Bs7mXiGZRAJiI4VjaMmjj4uuvW8qaF085uWJvyJk9UNYUIYn0A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -7688,6 +7306,19 @@ "node": ">=4" } }, + "node_modules/hash-base/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/hash.js": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", @@ -8149,9 +7780,9 @@ } }, "node_modules/inquirer/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -8216,12 +7847,12 @@ } }, "node_modules/inquirer/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -8676,6 +8307,15 @@ "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" }, + "node_modules/is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-my-ip-valid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", @@ -8801,6 +8441,15 @@ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, + "node_modules/is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -8863,6 +8512,24 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "node_modules/is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.1.tgz", + "integrity": "sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -8885,9 +8552,9 @@ } }, "node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "node_modules/isbinaryfile": { "version": "4.0.8", @@ -8926,6 +8593,19 @@ "node": ">=0.8.x" } }, + "node_modules/iso-random-stream/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/iso-url": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-1.1.5.tgz", @@ -8957,9 +8637,9 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "node_modules/istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz", + "integrity": "sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ==", "dev": true, "engines": { "node": ">=8" @@ -8992,6 +8672,15 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", @@ -9030,6 +8719,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/istanbul-lib-report/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -9056,29 +8754,6 @@ "node": ">=8" } }, - "node_modules/istanbul-lib-source-maps/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/istanbul-lib-source-maps/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/istanbul-lib-source-maps/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -9148,6 +8823,19 @@ "ieee754": "^1.2.1" } }, + "node_modules/it-buffer/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/it-drain": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.4.tgz", @@ -9164,9 +8852,9 @@ "integrity": "sha512-wiI02c+G1BVuu0jz30Nsr1/et0cpSRulKUusN8HDZXxuX4MdUzfMp2P4JUk+a49Wr1kHitRLrnnh3+UzJ6neaQ==" }, "node_modules/it-glob": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-0.0.13.tgz", - "integrity": "sha512-0Hcd5BraJUPzL28NWiFbdNrcdyNxNTKKdU3sjdFiYynNTQpwlG2UKW31X7bp+XhJwux/oPzIquo5ioztVmc2RQ==", + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-0.0.14.tgz", + "integrity": "sha512-TKKzs9CglbsihSpcwJPXN5DBUssu4akRzPlp8QJRCoLrKoaOpyY2V1qDlxx+UMivn0i114YyTd4AawWl7eqIdw==", "dependencies": { "@types/minimatch": "^3.0.4", "minimatch": "^3.0.4" @@ -9257,6 +8945,19 @@ "ieee754": "^1.1.13" } }, + "node_modules/it-length-prefixed/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/it-length-prefixed/node_modules/varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -9376,6 +9077,19 @@ "bl": "^5.0.0" } }, + "node_modules/it-pb-rpc/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/it-pipe": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/it-pipe/-/it-pipe-1.1.0.tgz", @@ -9439,6 +9153,19 @@ "ieee754": "^1.1.13" } }, + "node_modules/it-reader/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/it-take": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/it-take/-/it-take-1.0.0.tgz", @@ -9480,6 +9207,19 @@ "ieee754": "^1.2.1" } }, + "node_modules/it-to-stream/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/it-ws": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-4.0.0.tgz", @@ -9543,9 +9283,9 @@ } }, "node_modules/jayson/node_modules/@types/node": { - "version": "12.20.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.23.tgz", - "integrity": "sha512-FW0q7NI8UnjbKrJK8NGr6QXY69ATw9IFe6ItIo5yozPwA9DU/xkhiPddctUVyrmFXvyFYerYgQak/qu200UBDw==" + "version": "12.20.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.26.tgz", + "integrity": "sha512-gIt+h4u2uTho2bsH1K250fUv5fHU71ET1yWT7bM4523zV/XrFb9jlWBOV4DO8FpscY+Sz/WEr1EEjIP2H4yumQ==" }, "node_modules/jayson/node_modules/commander": { "version": "2.20.3", @@ -9667,6 +9407,26 @@ "node": ">=6" } }, + "node_modules/jsdom/node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/jsdom/node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -9736,10 +9496,17 @@ "node": ">=6" } }, + "node_modules/jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -9799,6 +9566,12 @@ "jsonstream": "bin/jsonstream.js" } }, + "node_modules/jsonstream2/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, "node_modules/jsonstream2/node_modules/jsonparse": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.6.tgz", @@ -10069,9 +9842,9 @@ } }, "node_modules/karma-typescript/node_modules/acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -10081,9 +9854,9 @@ } }, "node_modules/karma-typescript/node_modules/acorn-walk": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz", - "integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, "engines": { "node": ">=0.4.0" @@ -10131,6 +9904,15 @@ "ieee754": "^1.1.13" } }, + "node_modules/karma-typescript/node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, "node_modules/karma-typescript/node_modules/domain-browser": { "version": "4.22.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", @@ -10167,6 +9949,20 @@ "node": ">=6" } }, + "node_modules/karma-typescript/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/karma-typescript/node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -10182,6 +9978,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/karma-typescript/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/karma-typescript/node_modules/source-map": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", @@ -10239,59 +10041,6 @@ "which-typed-array": "^1.1.2" } }, - "node_modules/karma/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/karma/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/karma/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/karma/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/karma/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/karma/node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -10325,18 +10074,6 @@ "node": ">=0.10.0" } }, - "node_modules/karma/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/karma/node_modules/tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -10349,59 +10086,6 @@ "node": ">=8.17.0" } }, - "node_modules/karma/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/karma/node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/karma/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/karma/node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/keccak": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", @@ -10416,6 +10100,19 @@ "node": ">=10.0.0" } }, + "node_modules/keccak/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/keygrip": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", @@ -10549,6 +10246,19 @@ "node": ">=6" } }, + "node_modules/level-iterator-stream/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/level-js": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz", @@ -10631,6 +10341,19 @@ "node": ">=6" } }, + "node_modules/level-ws/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/leveldown": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", @@ -10757,40 +10480,45 @@ } }, "node_modules/libp2p-bootstrap": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.12.2.tgz", - "integrity": "sha512-ICRv0oertc7mZ1AOTq5Uw28YR9clcYd2ADYJFIBdpiIk7SRpqWCP4pn4fY5nSRntAjdcG6KrGoyZ4YpQ8J/x1w==", + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.12.3.tgz", + "integrity": "sha512-4S7+YyZYy8wRmNxXGwsBsKrxGMk59nTqwDdBeEf9m3aVWZ0zdz5uu3WXq7sl8ULb703Zx5IdjGDrdbxhYtdqlA==", "dependencies": { - "debug": "^4.1.1", - "mafmt": "^8.0.0", - "multiaddr": "^8.0.0", + "debug": "^4.3.1", + "mafmt": "^9.0.0", + "multiaddr": "^9.0.1", "peer-id": "^0.14.0" }, "engines": { - "node": ">=6.0.0", - "npm": ">=3.0.0" + "node": ">=14.0.0" } }, - "node_modules/libp2p-bootstrap/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/libp2p-bootstrap/node_modules/err-code": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", + "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + }, + "node_modules/libp2p-bootstrap/node_modules/mafmt": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", + "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "multiaddr": "^9.0.1" } }, - "node_modules/libp2p-bootstrap/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "node_modules/libp2p-bootstrap/node_modules/multiaddr": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", + "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", + "dependencies": { + "cids": "^1.0.0", + "dns-over-http-resolver": "^1.0.0", + "err-code": "^3.0.1", + "is-ip": "^3.1.0", + "multibase": "^4.0.2", + "uint8arrays": "^2.1.3", + "varint": "^6.0.0" + } }, "node_modules/libp2p-crypto": { "version": "0.19.7", @@ -10861,22 +10589,6 @@ "uint8arrays": "^2.0.5" } }, - "node_modules/libp2p-interfaces/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/libp2p-interfaces/node_modules/delay": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/delay/-/delay-4.4.1.tgz", @@ -10888,11 +10600,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/libp2p-interfaces/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/libp2p-interfaces/node_modules/multibase": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", @@ -10961,27 +10668,6 @@ "npm": ">=6.0.0" } }, - "node_modules/libp2p-kad-dht/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/libp2p-kad-dht/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/libp2p-kad-dht/node_modules/varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -11035,31 +10721,23 @@ "ieee754": "^1.2.1" } }, - "node_modules/libp2p-mplex/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/libp2p-mplex/node_modules/err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" }, - "node_modules/libp2p-mplex/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "node_modules/libp2p-mplex/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } }, "node_modules/libp2p-noise": { "version": "2.0.5", @@ -11080,27 +10758,6 @@ "uint8arrays": "^2.0.5" } }, - "node_modules/libp2p-noise/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/libp2p-noise/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/libp2p-record": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/libp2p-record/-/libp2p-record-0.9.0.tgz", @@ -11163,44 +10820,80 @@ } }, "node_modules/libp2p-tcp": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.15.3.tgz", - "integrity": "sha512-j9efQ0aAbcCmVnnF0UqWH1r+qjNc0TpC3bV+QJDxBIe6v92a8l3kZ04G/QkP3vmzDT5Z4ayzMGjrOAas8hJIBA==", + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.15.4.tgz", + "integrity": "sha512-MqXIlqV7t9z0A1Ww9Omd2XIlndcYOAh5R6kWRZ8Vo/CITazKUC5ZGNoj23hq/aEPaX8p5XmJs2BKESg/OuhGhQ==", "dependencies": { "abortable-iterator": "^3.0.0", "class-is": "^1.1.0", - "debug": "^4.1.1", - "err-code": "^2.0.0", - "libp2p-utils": "^0.2.0", - "mafmt": "^8.0.0", - "multiaddr": "^8.0.0", + "debug": "^4.3.1", + "err-code": "^3.0.1", + "libp2p-utils": "^0.3.0", + "mafmt": "^9.0.0", + "multiaddr": "^9.0.1", "stream-to-it": "^0.2.2" }, "engines": { - "node": ">=6.0.0", - "npm": ">=3.0.0" + "node": ">=14.0.0" } }, - "node_modules/libp2p-tcp/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/libp2p-tcp/node_modules/err-code": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", + "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + }, + "node_modules/libp2p-tcp/node_modules/ip-address": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-7.1.0.tgz", + "integrity": "sha512-V9pWC/VJf2lsXqP7IWJ+pe3P1/HCYGBMZrrnT62niLGjAfCbeiwXMUxaeHvnVlz19O27pvXP4azs+Pj/A0x+SQ==", "dependencies": { - "ms": "2.1.2" + "jsbn": "1.1.0", + "sprintf-js": "1.1.2" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">= 10" } }, - "node_modules/libp2p-tcp/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "node_modules/libp2p-tcp/node_modules/libp2p-utils": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.3.1.tgz", + "integrity": "sha512-LOVfww7a6Rhtoupl3z1ABuTEli5whY3VLTB9QntsOIwbOcX9GfmjuhqYbEDht9lVPAQl+rCUWbfDMvK121ryUg==", + "dependencies": { + "abortable-iterator": "^3.0.0", + "debug": "^4.3.0", + "err-code": "^3.0.1", + "ip-address": "^7.1.0", + "is-loopback-addr": "^1.0.0", + "multiaddr": "^9.0.1", + "private-ip": "^2.1.1" + } + }, + "node_modules/libp2p-tcp/node_modules/mafmt": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", + "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", + "dependencies": { + "multiaddr": "^9.0.1" + } + }, + "node_modules/libp2p-tcp/node_modules/multiaddr": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", + "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", + "dependencies": { + "cids": "^1.0.0", + "dns-over-http-resolver": "^1.0.0", + "err-code": "^3.0.1", + "is-ip": "^3.1.0", + "multibase": "^4.0.2", + "uint8arrays": "^2.1.3", + "varint": "^6.0.0" + } + }, + "node_modules/libp2p-tcp/node_modules/sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" }, "node_modules/libp2p-utils": { "version": "0.2.3", @@ -11216,27 +10909,6 @@ "private-ip": "^2.1.1" } }, - "node_modules/libp2p-utils/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/libp2p-utils/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/libp2p-websockets": { "version": "0.15.9", "resolved": "https://registry.npmjs.org/libp2p-websockets/-/libp2p-websockets-0.15.9.tgz", @@ -11279,22 +10951,6 @@ "ieee754": "^1.2.1" } }, - "node_modules/libp2p-websockets/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/libp2p-websockets/node_modules/err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", @@ -11357,11 +11013,6 @@ "multiaddr": "^9.0.1" } }, - "node_modules/libp2p-websockets/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/libp2p-websockets/node_modules/multiaddr": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", @@ -11376,27 +11027,21 @@ "varint": "^6.0.0" } }, + "node_modules/libp2p-websockets/node_modules/node-fetch": { + "name": "@achingbrain/node-fetch", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==", + "license": "MIT", + "engines": { + "node": "4.x || >=6.0.0" + } + }, "node_modules/libp2p-websockets/node_modules/sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" }, - "node_modules/libp2p/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/libp2p/node_modules/es6-promisify": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", @@ -11410,11 +11055,6 @@ "node": ">=0.8.x" } }, - "node_modules/libp2p/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", @@ -11531,51 +11171,77 @@ "node": ">=8.0.0" } }, - "node_modules/lockfile-lint-api/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/lockfile-lint/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, - "node_modules/lockfile-lint-api/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "node_modules/lockfile-lint/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "node_modules/lockfile-lint/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/lockfile-lint/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/lockfile-lint/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "dependencies": { - "ms": "2.1.2" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" }, "engines": { - "node": ">=6.0" + "node": ">=6" + } + }, + "node_modules/lockfile-lint/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "engines": { + "node": ">=6" } }, - "node_modules/lockfile-lint/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/lockfile-lint/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } }, "node_modules/lodash": { "version": "4.17.21", @@ -11694,38 +11360,15 @@ "node": ">=8.0" } }, - "node_modules/log4js/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/log4js/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/logform": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz", - "integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.3.0.tgz", + "integrity": "sha512-graeoWUH2knKbGthMtuG1EfaSPMZFZBIrhuJHhkS5ZseFBrc7DupCzihOQAzsK/qIKPQaPJ/lFQFctILUY5ARQ==", "dependencies": { "colors": "^1.2.1", - "fast-safe-stringify": "^2.0.4", "fecha": "^4.2.0", "ms": "^2.1.1", + "safe-stable-stringify": "^1.1.0", "triple-beam": "^1.3.0" } }, @@ -11856,9 +11499,9 @@ } }, "node_modules/marked": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.2.tgz", - "integrity": "sha512-TMJQQ79Z0e3rJYazY0tIoMsFzteUGw9fB3FD+gzuIT3zLuG9L9ckIvUfF51apdJkcqc208jJN2KbtPbOvXtbjA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.4.tgz", + "integrity": "sha512-jBo8AOayNaEcvBhNobg6/BLhdsK3NvnKWJg33MAAPbvTWiG4QBn9gpW1+7RssrKu4K1dKlN+0goVQwV41xEfOA==", "dev": true, "bin": { "marked": "bin/marked" @@ -11928,42 +11571,6 @@ "node": ">=4.3.0 <5.0.0 || >=5.10" } }, - "node_modules/memory-fs/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/memory-fs/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/memory-fs/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/memory-fs/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -12095,15 +11702,6 @@ "node": ">=6" } }, - "node_modules/min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "dev": true, - "dependencies": { - "dom-walk": "^0.1.0" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -12211,42 +11809,6 @@ "node": ">= 0.8.0" } }, - "node_modules/module-deps/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/module-deps/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/module-deps/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/module-deps/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/moment": { "version": "2.29.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", @@ -12523,27 +12085,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/multistream-select/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/multistream-select/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "node_modules/multistream-select/node_modules/multibase": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", @@ -12558,6 +12099,19 @@ "npm": ">=6.0.0" } }, + "node_modules/multistream-select/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/multistream-select/node_modules/uint8arrays": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", @@ -12720,6 +12274,12 @@ "node": ">=0.8.0" } }, + "node_modules/nanocolors": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.1.12.tgz", + "integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==", + "dev": true + }, "node_modules/nanohtml": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/nanohtml/-/nanohtml-1.9.1.tgz", @@ -12739,6 +12299,21 @@ "transform-ast": "^2.4.0" } }, + "node_modules/nanohtml/node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/nanohtml/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/nanoid": { "version": "3.1.25", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", @@ -12778,9 +12353,9 @@ "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" }, "node_modules/native-abort-controller": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/native-abort-controller/-/native-abort-controller-1.0.3.tgz", - "integrity": "sha512-fd5LY5q06mHKZPD5FmMrn7Lkd2H018oBGKNOAdLpctBDEPFKsfJ1nX9ke+XRa8PEJJpjqrpQkGjq2IZ27QNmYA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/native-abort-controller/-/native-abort-controller-1.0.4.tgz", + "integrity": "sha512-zp8yev7nxczDJMoP6pDxyD20IU0T22eX8VwN2ztDccKvSZhRaV33yP1BGwKSZfXuqWUzsXopVFjBdau9OOAwMQ==", "peerDependencies": { "abort-controller": "*" } @@ -12888,11 +12463,12 @@ } }, "node_modules/node-fetch": { - "name": "@achingbrain/node-fetch", - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==", - "license": "MIT", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", + "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" } @@ -12906,9 +12482,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -12972,33 +12548,6 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "node_modules/node-libs-browser/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/node-libs-browser/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/node-libs-browser/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "node_modules/node-libs-browser/node_modules/stream-http": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", @@ -13012,15 +12561,6 @@ "xtend": "^4.0.0" } }, - "node_modules/node-libs-browser/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/node-libs-browser/node_modules/timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", @@ -13049,9 +12589,9 @@ } }, "node_modules/node-releases": { - "version": "1.1.75", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.75.tgz", - "integrity": "sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==", + "version": "1.1.76", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz", + "integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==", "dev": true }, "node_modules/normalize-html-whitespace": { @@ -13250,21 +12790,39 @@ "node": ">=6" } }, - "node_modules/nyc/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/nyc/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "dependencies": { - "ms": "2.1.2" - }, + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/nyc/node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/nyc/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/nyc/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=4" } }, "node_modules/nyc/node_modules/istanbul-lib-coverage": { @@ -13358,12 +12916,6 @@ "semver": "bin/semver" } }, - "node_modules/nyc/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/nyc/node_modules/pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", @@ -13373,6 +12925,21 @@ "node": ">=6" } }, + "node_modules/nyc/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/nyc/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/nyc/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -13382,6 +12949,20 @@ "node": ">=0.10.0" } }, + "node_modules/nyc/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/nyc/node_modules/supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -13394,6 +12975,38 @@ "node": ">=6" } }, + "node_modules/nyc/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/nyc/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -14078,42 +13691,6 @@ "readable-stream": "^2.1.5" } }, - "node_modules/parallel-transform/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/parallel-transform/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/parallel-transform/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/parallel-transform/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -14276,6 +13853,11 @@ "isarray": "0.0.1" } }, + "node_modules/path-to-regexp/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -14309,24 +13891,23 @@ } }, "node_modules/peer-id": { - "version": "0.14.6", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.14.6.tgz", - "integrity": "sha512-Ubww7Y69OdKISOGYfkc232MPHhcQQ9FJzSoOVmDmuxqo1jEjgT5ThvwoPom2LqAd/KRbrmk5bxFeGMvbgpazog==", + "version": "0.14.8", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.14.8.tgz", + "integrity": "sha512-GpuLpob/9FrEFvyZrKKsISEkaBYsON2u0WtiawLHj1ii6ewkoeRiSDFLyIefYhw0jGvQoeoZS05jaT52X7Bvig==", "dependencies": { "cids": "^1.1.5", "class-is": "^1.1.0", "libp2p-crypto": "^0.19.0", "minimist": "^1.2.5", "multihashes": "^4.0.2", - "protons": "^2.0.0", + "protobufjs": "^6.10.2", "uint8arrays": "^2.0.5" }, "bin": { "peer-id": "src/bin.js" }, "engines": { - "node": ">=10.0.0", - "npm": ">=6.0.0" + "node": ">=14.0.0" } }, "node_modules/pem-jwk": { @@ -14463,6 +14044,20 @@ "pino-pretty": "bin.js" } }, + "node_modules/pino-pretty/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/pino-std-serializers": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-2.5.0.tgz", @@ -14722,9 +14317,9 @@ } }, "node_modules/prettier": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", - "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -14781,6 +14376,12 @@ "pretty-trace": "bin/pretty-trace" } }, + "node_modules/pretty-trace/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, "node_modules/pretty-trace/node_modules/readable-stream": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", @@ -14905,14 +14506,14 @@ } }, "node_modules/protobufjs/node_modules/@types/node": { - "version": "16.7.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", - "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" + "version": "16.9.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz", + "integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ==" }, "node_modules/protocol-buffers-schema": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.5.2.tgz", - "integrity": "sha512-LPzSaBYp/TcbuSlpGwqT5jR9kvJ3Zp5ic2N5c2ybx6XB/lSfEHq2D7ja8AgoxHoMD91wXFALJoXsvshKPuXyew==" + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" }, "node_modules/protons": { "version": "2.0.3", @@ -15180,42 +14781,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/read-only-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/read-only-stream/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/read-only-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/read-only-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -15256,16 +14821,30 @@ } }, "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/readable-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" } }, "node_modules/readdirp": { @@ -15833,6 +15412,11 @@ "ret": "~0.1.10" } }, + "node_modules/safe-stable-stringify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz", + "integrity": "sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw==" + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -15917,12 +15501,18 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/semver-compare": { @@ -15932,9 +15522,9 @@ "dev": true }, "node_modules/semver-regex": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz", - "integrity": "sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", + "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", "dev": true, "engines": { "node": ">=8" @@ -15943,6 +15533,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -15967,6 +15575,21 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/send/node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -16151,12 +15774,12 @@ } }, "node_modules/shiki": { - "version": "0.9.10", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.10.tgz", - "integrity": "sha512-xeM7Oc6hY+6iW5O/T5hor8ul7mEprzyl5y4r5zthEHToQNw7MIhREMgU3r2gKDB0NaMLNrkcEQagudCdzE13Lg==", + "version": "0.9.11", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.11.tgz", + "integrity": "sha512-tjruNTLFhU0hruCPoJP0y+B9LKOmcqUhTpxn7pcJB3fa+04gFChuEmxmrUfOJ7ZO6Jd+HwMnDHgY3lv3Tqonuw==", "dev": true, "dependencies": { - "json5": "^2.2.0", + "jsonc-parser": "^3.0.0", "onigasm": "^2.2.5", "vscode-textmate": "5.2.0" } @@ -16175,9 +15798,9 @@ } }, "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==" }, "node_modules/signed-varint": { "version": "2.0.1", @@ -16427,6 +16050,15 @@ "node": ">=0.10.0" } }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, "node_modules/snapdragon/node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -16531,6 +16163,12 @@ "node": ">=0.10.0" } }, + "node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/snappyjs": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/snappyjs/-/snappyjs-0.6.1.tgz", @@ -16576,52 +16214,6 @@ "node": ">=10.0.0" } }, - "node_modules/socket.io-parser/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/socket.io-parser/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/socket.io/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/socket.io/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/sonic-boom": { "version": "0.7.7", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-0.7.7.tgz", @@ -16661,9 +16253,9 @@ } }, "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", "dev": true, "dependencies": { "buffer-from": "^1.0.0", @@ -16770,6 +16362,20 @@ "readable-stream": "^3.0.0" } }, + "node_modules/split2/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -16979,6 +16585,15 @@ "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, + "node_modules/standard/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, "node_modules/standard/node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -17234,12 +16849,6 @@ "node": ">=0.10.0" } }, - "node_modules/standard/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "node_modules/standard/node_modules/json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", @@ -17249,6 +16858,12 @@ "jsonify": "~0.0.0" } }, + "node_modules/standard/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "node_modules/standard/node_modules/onetime": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", @@ -17535,42 +17150,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/stream-browserify/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/stream-browserify/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/stream-browserify/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/stream-browserify/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/stream-combiner2": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", @@ -17581,42 +17160,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/stream-combiner2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/stream-combiner2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/stream-combiner2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/stream-combiner2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/stream-each": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", @@ -17639,6 +17182,20 @@ "xtend": "^4.0.2" } }, + "node_modules/stream-http/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/stream-shift": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", @@ -17655,42 +17212,6 @@ "readable-stream": "^2.0.2" } }, - "node_modules/stream-splicer/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/stream-splicer/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/stream-splicer/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/stream-splicer/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/stream-to-it": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/stream-to-it/-/stream-to-it-0.2.4.tgz", @@ -17730,23 +17251,6 @@ "node": ">=4.0" } }, - "node_modules/streamroller/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/streamroller/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -17761,12 +17265,6 @@ "node": ">=6 <7 || >=8" } }, - "node_modules/streamroller/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -17776,35 +17274,35 @@ } }, "node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/string-width/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" } }, "node_modules/string-width/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -17956,23 +17454,6 @@ "node": ">= 7.0.0" } }, - "node_modules/superagent/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/superagent/node_modules/form-data": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", @@ -17987,24 +17468,6 @@ "node": ">= 6" } }, - "node_modules/superagent/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/superagent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/superagent/node_modules/qs": { "version": "6.10.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", @@ -18020,27 +17483,20 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/superagent/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/superagent/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=10" + "node": ">= 6" } }, - "node_modules/superagent/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/supertest": { "version": "6.1.6", "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.1.6.tgz", @@ -18145,12 +17601,6 @@ "tap-out": "bin/cmd.js" } }, - "node_modules/tap-out/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "node_modules/tap-out/node_modules/process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", @@ -18285,41 +17735,46 @@ } }, "node_modules/tape": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.14.0.tgz", - "integrity": "sha512-z0+WrUUJuG6wIdWrl4W3rTte2CR26G6qcPOj3w1hfRdcmhF3kHBhOBW9VHsPVAkz08ZmGzp7phVpDupbLzrYKQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.3.1.tgz", + "integrity": "sha512-Mj3h+/dgfI2xct4kTpzqZaRxhhglXcMg//xGTbB0AQisfiOYa6ZBNQIgv46xi1MqbgthuNLSS1SAySDZsb7MMA==", "dev": true, "dependencies": { - "call-bind": "~1.0.2", - "deep-equal": "~1.1.1", - "defined": "~1.0.0", - "dotignore": "~0.1.2", - "for-each": "~0.3.3", - "glob": "~7.1.7", - "has": "~1.0.3", - "inherits": "~2.0.4", - "is-regex": "~1.1.3", - "minimist": "~1.2.5", - "object-inspect": "~1.11.0", - "resolve": "~1.20.0", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.2.4", - "through": "~2.3.8" + "call-bind": "^1.0.2", + "deep-equal": "^2.0.5", + "defined": "^1.0.0", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.1.7", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.0", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.5", + "object-inspect": "^1.11.0", + "object-is": "^1.1.5", + "object.assign": "^4.1.2", + "resolve": "^2.0.0-next.3", + "resumer": "^0.0.0", + "string.prototype.trim": "^1.2.4", + "through": "^2.3.8" }, "bin": { "tape": "bin/tape" } }, - "node_modules/tape-catch": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/tape-catch/-/tape-catch-1.0.6.tgz", - "integrity": "sha1-EpMdXqYKA6l9m9GdDX2M/D9s7PE=", + "node_modules/tape/node_modules/resolve": { + "version": "2.0.0-next.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", + "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", "dev": true, "dependencies": { - "global": "~4.3.0" + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" }, - "peerDependencies": { - "tape": "*" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/terser": { @@ -18483,42 +17938,6 @@ "xtend": "~4.0.1" } }, - "node_modules/through2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/timeout-abort-controller": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/timeout-abort-controller/-/timeout-abort-controller-1.1.1.tgz", @@ -18648,22 +18067,9 @@ } }, "node_modules/tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/tr46/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, "node_modules/transform-ast": { "version": "2.4.4", @@ -18680,6 +18086,15 @@ "nanobench": "^2.1.1" } }, + "node_modules/transform-ast/node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, "node_modules/transform-ast/node_modules/is-buffer": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", @@ -18712,6 +18127,12 @@ "source-map": "^0.5.6" } }, + "node_modules/transform-ast/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/trim": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", @@ -18785,6 +18206,15 @@ "node": ">=4.0.0" } }, + "node_modules/ts-loader/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/ts-node": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.2.1.tgz", @@ -18830,9 +18260,9 @@ } }, "node_modules/ts-node/node_modules/acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -18842,9 +18272,9 @@ } }, "node_modules/ts-node/node_modules/acorn-walk": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz", - "integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, "engines": { "node": ">=0.4.0" @@ -18935,15 +18365,12 @@ } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/type-is": { @@ -18975,19 +18402,16 @@ } }, "node_modules/typedoc": { - "version": "0.21.9", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.21.9.tgz", - "integrity": "sha512-VRo7aII4bnYaBBM1lhw4bQFmUcDQV8m8tqgjtc7oXl87jc1Slbhfw2X5MccfcR2YnEClHDWgsiQGgNB8KJXocA==", + "version": "0.22.4", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.4.tgz", + "integrity": "sha512-M/a8NnPxq3/iZNNVjzFCK5gu4m//HTJIPbSS0JQVbkHJPP9wyepR12agylWTSqeVZe0xsbidVtO26+PP7iD/jw==", "dev": true, "dependencies": { "glob": "^7.1.7", - "handlebars": "^4.7.7", "lunr": "^2.3.9", - "marked": "^3.0.2", - "minimatch": "^3.0.0", - "progress": "^2.0.3", - "shiki": "^0.9.8", - "typedoc-default-themes": "^0.12.10" + "marked": "^3.0.4", + "minimatch": "^3.0.4", + "shiki": "^0.9.11" }, "bin": { "typedoc": "bin/typedoc" @@ -18999,31 +18423,22 @@ "typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x" } }, - "node_modules/typedoc-default-themes": { - "version": "0.12.10", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz", - "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/typedoc-plugin-markdown": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.10.4.tgz", - "integrity": "sha512-if9w7S9fXLg73AYi/EoRSEhTOZlg3I8mIP8YEmvzSE33VrNXC9/hA0nVcLEwFVJeQY7ay6z67I6kW0KIv7LjeA==", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.1.tgz", + "integrity": "sha512-OqCkbN2mjHx1NnKSKyjp5QoGzNcJLZke3UMiUQsFCowfzebegr7Tx5YILL3JDlPlpE96DJD3USImVas5vaS4WA==", "dev": true, "dependencies": { "handlebars": "^4.7.7" }, "peerDependencies": { - "typedoc": ">=0.21.2" + "typedoc": ">=0.22.0" } }, "node_modules/typescript": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", - "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -19053,9 +18468,9 @@ } }, "node_modules/uglify-js": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", - "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", + "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==", "dev": true, "optional": true, "bin": { @@ -19164,6 +18579,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, "engines": { "node": ">= 4.0.0" } @@ -19236,12 +18652,6 @@ "node": ">=0.10.0" } }, - "node_modules/unset-value/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "node_modules/upath": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", @@ -19845,6 +19255,11 @@ "extsprintf": "^1.2.0" } }, + "node_modules/verror/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, "node_modules/vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -20130,13 +19545,6 @@ "node": ">=0.10.0" } }, - "node_modules/watchpack-chokidar2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, "node_modules/watchpack-chokidar2/node_modules/micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -20162,22 +19570,6 @@ "node": ">=0.10.0" } }, - "node_modules/watchpack-chokidar2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "optional": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "node_modules/watchpack-chokidar2/node_modules/readdirp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", @@ -20193,23 +19585,6 @@ "node": ">=0.10" } }, - "node_modules/watchpack-chokidar2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "node_modules/watchpack-chokidar2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/watchpack-chokidar2/node_modules/to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -20340,6 +19715,32 @@ "webpack": "4.x.x" } }, + "node_modules/webpack-cli/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/webpack-cli/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/webpack-cli/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/webpack-cli/node_modules/json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -20366,6 +19767,20 @@ "node": ">=4.0.0" } }, + "node_modules/webpack-cli/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/webpack-cli/node_modules/supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -20378,6 +19793,38 @@ "node": ">=6" } }, + "node_modules/webpack-cli/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/webpack-cli/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, "node_modules/webpack-sources": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", @@ -20515,12 +19962,6 @@ "node": ">=0.10.0" } }, - "node_modules/webpack/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "node_modules/webpack/node_modules/json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -20581,27 +20022,6 @@ "node": ">=0.10.0" } }, - "node_modules/webpack/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/webpack/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "node_modules/webpack/node_modules/schema-utils": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", @@ -20616,15 +20036,6 @@ "node": ">= 4" } }, - "node_modules/webpack/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/webpack/node_modules/to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -20654,16 +20065,19 @@ "dev": true }, "node_modules/whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, + "node_modules/whatwg-url/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -20691,6 +20105,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dev": true, + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -20809,43 +20238,24 @@ "node": ">= 6.4.0" } }, - "node_modules/winston-transport/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "node_modules/winston-transport/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/winston-transport/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/winston-transport/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/winston/node_modules/async": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz", "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==" }, + "node_modules/winston/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -20871,42 +20281,74 @@ } }, "node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=6" + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/wrappy": { @@ -20939,9 +20381,9 @@ } }, "node_modules/ws": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz", - "integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", "engines": { "node": ">=8.3.0" }, @@ -21028,20 +20470,21 @@ } }, "node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" } }, "node_modules/yargs-parser": { @@ -21053,30 +20496,22 @@ "decamelize": "^1.2.0" } }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "node_modules/yargs/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, "engines": { - "node": ">=4" + "node": ">=10" } }, - "node_modules/yargs/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/yn": { @@ -21101,18 +20536,18 @@ }, "packages/block": { "name": "@ethereumjs/block", - "version": "3.4.0", + "version": "3.5.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", - "ethereumjs-util": "^7.1.0", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/tx": "^3.3.1", + "ethereumjs-util": "^7.1.1", "merkle-patricia-tree": "^4.2.1" }, "devDependencies": { "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -21121,22 +20556,22 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, "packages/blockchain": { "name": "@ethereumjs/blockchain", - "version": "5.4.0", + "version": "5.4.1", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/ethash": "^1.0.0", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/ethash": "^1.1.0", "debug": "^2.2.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", "rlp": "^2.2.4", @@ -21146,7 +20581,7 @@ "@types/async": "^2.4.1", "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -21155,27 +20590,40 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, + "packages/blockchain/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "packages/blockchain/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, "packages/client": { "name": "@ethereumjs/client", "version": "0.0.6", "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/devp2p": "^4.1.0", - "@ethereumjs/tx": "^3.3.0", - "@ethereumjs/vm": "^5.5.2", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/blockchain": "^5.4.1", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/devp2p": "^4.2.0", + "@ethereumjs/tx": "^3.3.1", + "@ethereumjs/vm": "^5.5.3", "chalk": "^2.4.2", - "ethereumjs-util": "^7.1.0", - "fs-extra": "^7.0.1", + "ethereumjs-util": "^7.1.1", + "fs-extra": "^10.0.0", "it-pipe": "^1.1.0", "it-pushable": "^1.4.2", "jayson": "^3.4.4", @@ -21201,10 +20649,10 @@ }, "devDependencies": { "@babel/plugin-transform-spread": "^7.10.1", + "@types/fs-extra": "^8.1.0", "@types/levelup": "^4.3.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", - "@types/tape-catch": "^1.0.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "file-replace-loader": "^1.2.0", "it-pair": "^1.0.0", @@ -21219,13 +20667,12 @@ "pino-pretty": "^2.2.2", "pull-pair": "^1.1.0", "supertest": "^6.1.3", - "tape": "^4.10.1", - "tape-catch": "~1.0.6", + "tape": "^5.3.1", "testdouble": "^3.8.2", "testdouble-timers": "^0.1.1", "ts-loader": "^7.0.5", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2", "webpack": "^4.43.0", "webpack-cli": "^3.3.11" @@ -21234,17 +20681,92 @@ "node": ">=8.0.0" } }, + "packages/client/node_modules/@types/fs-extra": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.2.tgz", + "integrity": "sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "packages/client/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "packages/client/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "packages/client/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "engines": { + "node": ">=4" + } + }, + "packages/client/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/client/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "packages/client/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, "packages/common": { "name": "@ethereumjs/common", - "version": "2.4.0", + "version": "2.5.0", "license": "MIT", "dependencies": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.0" + "ethereumjs-util": "^7.1.1" }, "devDependencies": { "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -21253,25 +20775,25 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, "packages/devp2p": { "name": "@ethereumjs/devp2p", - "version": "4.1.0", + "version": "4.2.0", "license": "MIT", "dependencies": { - "@ethereumjs/common": "^2.4.0", + "@ethereumjs/common": "^2.5.0", "@types/bl": "^2.1.0", "@types/k-bucket": "^5.0.0", "@types/lru-cache": "^5.1.0", "base64url": "^3.0.1", "bl": "^1.1.2", "debug": "^2.2.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "hi-base32": "^0.5.0", "inherits": "^2.0.1", "ip": "^1.1.3", @@ -21286,8 +20808,8 @@ "snappyjs": "^0.6.1" }, "devDependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/tx": "^3.3.1", "@types/async": "^2.4.1", "@types/chalk": "^2.2.0", "@types/debug": "^4.1.4", @@ -21296,51 +20818,74 @@ "@types/ms": "^0.7.30", "@types/node": "^11.13.4", "@types/secp256k1": "^4.0.1", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "async": "^2.6.0", "chalk": "^2.4.2", "eslint": "^6.8.0", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "testdouble": "^3.8.2", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" }, "engines": { "node": ">=10.0" } }, + "packages/devp2p/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "packages/devp2p/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, "packages/ethash": { "name": "@ethereumjs/ethash", - "version": "1.0.0", + "version": "1.1.0", "license": "MPL-2.0", "dependencies": { + "@ethereumjs/block": "^3.5.0", "@types/levelup": "^4.3.0", "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "miller-rabin": "^4.0.0" }, "devDependencies": { - "@ethereumjs/block": "^3.4.0", - "@types/tape": "^4.13.0", + "@ethereumjs/common": "^2.5.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "level-mem": "^5.0.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, + "packages/ethash/node_modules/buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "dependencies": { + "safe-buffer": "^5.1.1" + } + }, "packages/trie": { "name": "merkle-patricia-tree", "version": "4.2.1", "license": "MPL-2.0", "dependencies": { "@types/levelup": "^4.3.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "level-mem": "^5.0.1", "level-ws": "^2.0.0", "readable-stream": "^3.6.0", @@ -21350,7 +20895,7 @@ "devDependencies": { "@types/benchmark": "^1.0.33", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "0x": "^4.9.1", "benchmark": "^2.1.4", "eslint": "^6.8.0", @@ -21361,24 +20906,37 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, + "packages/trie/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "packages/tx": { "name": "@ethereumjs/tx", - "version": "3.3.0", + "version": "3.3.1", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^2.4.0", - "ethereumjs-util": "^7.1.0" + "@ethereumjs/common": "^2.5.0", + "ethereumjs-util": "^7.1.1" }, "devDependencies": { "@types/minimist": "^1.2.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -21389,15 +20947,15 @@ "node-dir": "^0.1.16", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, "packages/util": { "name": "ethereumjs-util", - "version": "7.1.0", + "version": "7.1.1", "license": "MPL-2.0", "dependencies": { "@types/bn.js": "^5.1.0", @@ -21411,7 +20969,7 @@ "@types/assert": "^1.5.4", "@types/node": "^11.13.4", "@types/secp256k1": "^4.0.1", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -21428,19 +20986,82 @@ "node": ">=10.0.0" } }, + "packages/util/node_modules/deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "dependencies": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "packages/util/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "packages/util/node_modules/tape": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.14.0.tgz", + "integrity": "sha512-z0+WrUUJuG6wIdWrl4W3rTte2CR26G6qcPOj3w1hfRdcmhF3kHBhOBW9VHsPVAkz08ZmGzp7phVpDupbLzrYKQ==", + "dev": true, + "dependencies": { + "call-bind": "~1.0.2", + "deep-equal": "~1.1.1", + "defined": "~1.0.0", + "dotignore": "~0.1.2", + "for-each": "~0.3.3", + "glob": "~7.1.7", + "has": "~1.0.3", + "inherits": "~2.0.4", + "is-regex": "~1.1.3", + "minimist": "~1.2.5", + "object-inspect": "~1.11.0", + "resolve": "~1.20.0", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.2.4", + "through": "~2.3.8" + }, + "bin": { + "tape": "bin/tape" + } + }, "packages/vm": { "name": "@ethereumjs/vm", - "version": "5.5.2", + "version": "5.5.3", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/blockchain": "^5.4.1", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/tx": "^3.3.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^2.2.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "merkle-patricia-tree": "^4.2.1", @@ -21452,7 +21073,7 @@ "@types/core-js": "^2.5.0", "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "benchmark": "^2.1.4", "eslint": "^6.8.0", "karma": "^6.3.2", @@ -21469,9 +21090,9 @@ "rlp": "^2.2.4", "standard": "^10.0.0", "tap-spec": "^5.0.0", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, @@ -21588,6 +21209,12 @@ "ms": "^2.1.1" } }, + "packages/vm/node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "packages/vm/node_modules/@babel/types": { "version": "7.0.0-beta.51", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.51.tgz", @@ -21599,6 +21226,23 @@ "to-fast-properties": "^2.0.0" } }, + "packages/vm/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "packages/vm/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "packages/vm/node_modules/istanbul-lib-coverage": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", @@ -21633,10 +21277,9 @@ "dev": true }, "packages/vm/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "packages/vm/node_modules/nyc": { "version": "12.0.2", @@ -24516,9 +24159,9 @@ "dev": true }, "@babel/core": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.4.tgz", - "integrity": "sha512-Lkcv9I4a8bgUI8LJOLM6IKv6hnz1KOju6KM1lceqVMKlKKqNRopYd2Pc9MgIurqvMJ6BooemrnJz8jlIiQIpsA==", + "version": "7.15.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz", + "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==", "dev": true, "requires": { "@babel/code-frame": "^7.14.5", @@ -24526,7 +24169,7 @@ "@babel/helper-compilation-targets": "^7.15.4", "@babel/helper-module-transforms": "^7.15.4", "@babel/helpers": "^7.15.4", - "@babel/parser": "^7.15.4", + "@babel/parser": "^7.15.5", "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", "@babel/types": "^7.15.4", @@ -24538,19 +24181,25 @@ "source-map": "^0.5.0" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "requires": { - "ms": "2.1.2" + "safe-buffer": "~5.1.1" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -24576,6 +24225,14 @@ "@babel/helper-validator-option": "^7.14.5", "browserslist": "^4.16.6", "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "@babel/helper-function-name": { @@ -24626,19 +24283,19 @@ } }, "@babel/helper-module-transforms": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz", - "integrity": "sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz", + "integrity": "sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.15.4", "@babel/helper-replace-supers": "^7.15.4", "@babel/helper-simple-access": "^7.15.4", "@babel/helper-split-export-declaration": "^7.15.4", - "@babel/helper-validator-identifier": "^7.14.9", + "@babel/helper-validator-identifier": "^7.15.7", "@babel/template": "^7.15.4", "@babel/traverse": "^7.15.4", - "@babel/types": "^7.15.4" + "@babel/types": "^7.15.6" } }, "@babel/helper-optimise-call-expression": { @@ -24696,9 +24353,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", "dev": true }, "@babel/helper-validator-option": { @@ -24730,9 +24387,9 @@ } }, "@babel/parser": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.4.tgz", - "integrity": "sha512-xmzz+7fRpjrvDUj+GV7zfz/R3gSK2cOxGlazaXooxspCr539cbTXJKvBJzSVI2pPhcRGquoOtaIkKCsHQUiO3w==", + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.7.tgz", + "integrity": "sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g==", "dev": true }, "@babel/plugin-transform-spread": { @@ -24773,27 +24430,18 @@ "globals": "^11.1.0" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true } } }, "@babel/types": { - "version": "7.15.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.4.tgz", - "integrity": "sha512-0f1HJFuGmmbrKTCZtbm3cU+b/AqdEYk5toj5iQur58xkVMlS0JWaKxTBSmCXd47uiN7vbcozAupm6Mvs80GNhw==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", + "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.9", @@ -24828,13 +24476,13 @@ "@ethereumjs/block": { "version": "file:packages/block", "requires": { - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/tx": "^3.3.1", "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.0", @@ -24843,25 +24491,25 @@ "merkle-patricia-tree": "^4.2.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, "@ethereumjs/blockchain": { "version": "file:packages/blockchain", "requires": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/ethash": "^1.0.0", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/ethash": "^1.1.0", "@types/async": "^2.4.1", "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "debug": "^2.2.0", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.0", @@ -24873,31 +24521,46 @@ "prettier": "^2.0.5", "rlp": "^2.2.4", "semaphore-async-await": "^1.5.1", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, "@ethereumjs/client": { "version": "file:packages/client", "requires": { "@babel/plugin-transform-spread": "^7.10.1", - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/devp2p": "^4.1.0", - "@ethereumjs/tx": "^3.3.0", - "@ethereumjs/vm": "^5.5.2", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/blockchain": "^5.4.1", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/devp2p": "^4.2.0", + "@ethereumjs/tx": "^3.3.1", + "@ethereumjs/vm": "^5.5.3", + "@types/fs-extra": "^8.1.0", "@types/levelup": "^4.3.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", - "@types/tape-catch": "^1.0.0", + "@types/tape": "^4.13.2", "chalk": "^2.4.2", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "file-replace-loader": "^1.2.0", - "fs-extra": "^7.0.1", + "fs-extra": "^10.0.0", "it-pair": "^1.0.0", "it-pipe": "^1.1.0", "it-pushable": "^1.4.2", @@ -24927,28 +24590,95 @@ "qheap": "^1.4.0", "rlp": "^2.2.4", "supertest": "^6.1.3", - "tape": "^4.10.1", - "tape-catch": "~1.0.6", + "tape": "^5.3.1", "testdouble": "^3.8.2", "testdouble-timers": "^0.1.1", "ts-loader": "^7.0.5", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2", "webpack": "^4.43.0", "webpack-cli": "^3.3.11", "winston": "3.3.3", "yargs": "^13.2.1" + }, + "dependencies": { + "@types/fs-extra": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.2.tgz", + "integrity": "sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + } } }, "@ethereumjs/common": { "version": "file:packages/common", "requires": { "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "crc-32": "^1.2.0", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.0", @@ -24956,18 +24686,18 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, "@ethereumjs/devp2p": { "version": "file:packages/devp2p", "requires": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/tx": "^3.3.1", "@types/async": "^2.4.1", "@types/bl": "^2.1.0", "@types/chalk": "^2.2.0", @@ -24979,14 +24709,14 @@ "@types/ms": "^0.7.30", "@types/node": "^11.13.4", "@types/secp256k1": "^4.0.1", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "async": "^2.6.0", "base64url": "^3.0.1", "bl": "^1.1.2", "chalk": "^2.4.2", "debug": "^2.2.0", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "hi-base32": "^0.5.0", "inherits": "^2.0.1", "ip": "^1.1.3", @@ -25001,40 +24731,69 @@ "scanf": "^1.1.2", "secp256k1": "^4.0.2", "snappyjs": "^0.6.1", - "tape": "^4.10.1", + "tape": "^5.3.1", "testdouble": "^3.8.2", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + } } }, "@ethereumjs/ethash": { "version": "file:packages/ethash", "requires": { - "@ethereumjs/block": "^3.4.0", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/common": "^2.5.0", "@types/levelup": "^4.3.0", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "buffer-xor": "^2.0.1", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "level-mem": "^5.0.1", "miller-rabin": "^4.0.0", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", + "typedoc": "^0.22.4", "typescript": "^4.4.2" + }, + "dependencies": { + "buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "requires": { + "safe-buffer": "^5.1.1" + } + } } }, "@ethereumjs/tx": { "version": "file:packages/tx", "requires": { - "@ethereumjs/common": "^2.4.0", + "@ethereumjs/common": "^2.5.0", "@types/minimist": "^1.2.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.0", @@ -25044,30 +24803,30 @@ "node-dir": "^0.1.16", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" } }, "@ethereumjs/vm": { "version": "file:packages/vm", "requires": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/block": "^3.5.0", + "@ethereumjs/blockchain": "^5.4.1", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/tx": "^3.3.1", "@types/benchmark": "^1.0.33", "@types/core-js": "^2.5.0", "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "async-eventemitter": "^0.2.4", "benchmark": "^2.1.4", "core-js-pure": "^3.0.1", "debug": "^2.2.0", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "functional-red-black-tree": "^1.0.1", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -25086,9 +24845,9 @@ "rustbn.js": "~0.2.0", "standard": "^10.0.0", "tap-spec": "^5.0.0", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2", "util.promisify": "^1.0.1" }, @@ -25199,6 +24958,12 @@ "requires": { "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true } } }, @@ -25213,6 +24978,20 @@ "to-fast-properties": "^2.0.0" } }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, "istanbul-lib-coverage": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", @@ -25241,10 +25020,9 @@ "dev": true }, "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "nyc": { "version": "12.0.2", @@ -27332,19 +27110,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz", "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==" - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -27635,9 +27400,9 @@ } }, "@types/lodash": { - "version": "4.14.172", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.172.tgz", - "integrity": "sha512-/BHF5HAx3em7/KkzVKm3LrsD6HZAXuXO1AJZQ3cRRBZj4oHZDviWPYu0aEplAqDFNHZPW6d3G7KN+ONcCCC7pw==" + "version": "4.14.173", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.173.tgz", + "integrity": "sha512-vv0CAYoaEjCw/mLy96GBTnRoZrSxkGE0BKzKimdR8P3OzrNYNvBgtW7p055A+E8C31vXNUhWKoFCbhq7gbyhFg==" }, "@types/long": { "version": "4.0.1", @@ -27717,15 +27482,6 @@ "@types/node": "*" } }, - "@types/tape-catch": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/tape-catch/-/tape-catch-1.0.0.tgz", - "integrity": "sha512-jHTUTszHf2FDMzgA86Yn68F4JZeKgVud0tlUqUfTEbjAK8gygd9Bd5HxpTWEL84Vi5P3PDTx2I4jxAULdLLd/w==", - "dev": true, - "requires": { - "@types/tape": "*" - } - }, "@types/ws": { "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", @@ -27735,183 +27491,84 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz", - "integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz", + "integrity": "sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.30.0", - "@typescript-eslint/scope-manager": "4.30.0", + "@typescript-eslint/experimental-utils": "4.31.2", + "@typescript-eslint/scope-manager": "4.31.2", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.1.0", "semver": "^7.3.5", "tsutils": "^3.21.0" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } } }, "@typescript-eslint/experimental-utils": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz", - "integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz", + "integrity": "sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q==", "dev": true, "requires": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.30.0", - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/typescript-estree": "4.30.0", + "@typescript-eslint/scope-manager": "4.31.2", + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/typescript-estree": "4.31.2", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz", - "integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.2.tgz", + "integrity": "sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.30.0", - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/typescript-estree": "4.30.0", + "@typescript-eslint/scope-manager": "4.31.2", + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/typescript-estree": "4.31.2", "debug": "^4.3.1" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "@typescript-eslint/scope-manager": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz", - "integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz", + "integrity": "sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w==", "dev": true, "requires": { - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/visitor-keys": "4.30.0" + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/visitor-keys": "4.31.2" } }, "@typescript-eslint/types": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz", - "integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.2.tgz", + "integrity": "sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz", - "integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz", + "integrity": "sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.30.0", - "@typescript-eslint/visitor-keys": "4.30.0", + "@typescript-eslint/types": "4.31.2", + "@typescript-eslint/visitor-keys": "4.31.2", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", "semver": "^7.3.5", "tsutils": "^3.21.0" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } } }, "@typescript-eslint/visitor-keys": { - "version": "4.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz", - "integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==", + "version": "4.31.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz", + "integrity": "sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug==", "dev": true, "requires": { - "@typescript-eslint/types": "4.30.0", + "@typescript-eslint/types": "4.31.2", "eslint-visitor-keys": "^2.0.0" } }, @@ -28314,21 +27971,6 @@ "which": "^1.2.4" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -28487,6 +28129,14 @@ "dev": true, "requires": { "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } } }, "ansi-regex": { @@ -28563,48 +28213,6 @@ "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "arg": { @@ -29035,40 +28643,6 @@ "requires": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "blakejs": { @@ -29103,6 +28677,23 @@ "qs": "6.7.0", "raw-body": "2.4.0", "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "brace-expansion": { @@ -29211,44 +28802,6 @@ "util": "~0.10.1", "vm-browserify": "^1.0.0", "xtend": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "browserify-aes": { @@ -29262,13 +28815,6 @@ "evp_bytestokey": "^1.0.3", "inherits": "^2.0.1", "safe-buffer": "^5.0.1" - }, - "dependencies": { - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - } } }, "browserify-cipher": { @@ -29319,6 +28865,19 @@ "parse-asn1": "^5.1.5", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "browserify-zlib": { @@ -29331,16 +28890,16 @@ } }, "browserslist": { - "version": "4.16.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz", - "integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==", + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.1.tgz", + "integrity": "sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001251", - "colorette": "^1.3.0", - "electron-to-chromium": "^1.3.811", + "caniuse-lite": "^1.0.30001259", + "electron-to-chromium": "^1.3.846", "escalade": "^3.1.1", - "node-releases": "^1.1.75" + "nanocolors": "^0.1.5", + "node-releases": "^1.1.76" } }, "bs58": { @@ -29390,12 +28949,9 @@ "dev": true }, "buffer-xor": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", - "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", - "requires": { - "safe-buffer": "^5.1.1" - } + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "bufio": { "version": "1.0.7", @@ -29579,10 +29135,13 @@ "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" }, "caniuse-lite": { - "version": "1.0.30001252", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001252.tgz", - "integrity": "sha512-I56jhWDGMtdILQORdusxBOH+Nl/KgQSdDmpJezYddnAkVOmnoU8zwjTV9xAjMIYxr0iPreEAVylCGcmHCjfaOw==", - "dev": true + "version": "1.0.30001260", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz", + "integrity": "sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg==", + "dev": true, + "requires": { + "nanocolors": "^0.1.0" + } }, "caseless": { "version": "0.12.0", @@ -29813,33 +29372,29 @@ "dev": true }, "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" }, "dependencies": { - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "ansi-regex": "^5.0.1" } } } @@ -29903,12 +29458,6 @@ "simple-swizzle": "^0.2.2" } }, - "colorette": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", - "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", - "dev": true - }, "colors": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", @@ -29934,14 +29483,6 @@ "inline-source-map": "~0.6.0", "lodash.memoize": "~3.0.3", "source-map": "~0.5.3" - }, - "dependencies": { - "convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - } } }, "combined-stream": { @@ -30006,6 +29547,21 @@ "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", "dev": true }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -30029,44 +29585,6 @@ "inherits": "^2.0.3", "readable-stream": "^2.2.2", "typedarray": "^0.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "connect": { @@ -30079,6 +29597,23 @@ "finalhandler": "1.1.2", "parseurl": "~1.3.3", "utils-merge": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "console-browserify": { @@ -30130,21 +29665,10 @@ "dev": true }, "convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } - } + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true }, "cookie": { "version": "0.4.1", @@ -30209,14 +29733,14 @@ "dev": true }, "core-js-pure": { - "version": "3.17.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.17.2.tgz", - "integrity": "sha512-2VV7DlIbooyTI7Bh+yzOOWL9tGwLnQKHno7qATE+fqZzDKYr6llVjVQOzpD/QLZFgXDPb8T71pJokHEZHEYJhQ==" + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.18.0.tgz", + "integrity": "sha512-ZnK+9vyuMhKulIGqT/7RHGRok8RtkHMEX/BGPHkHx+ouDkq+MUvf9mfIgdqhpmPDu8+V5UtRn/CbCRc9I4lX4w==" }, "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "cors": { "version": "2.8.5", @@ -30623,6 +30147,34 @@ "abab": "^2.0.0", "whatwg-mimetype": "^2.2.0", "whatwg-url": "^7.0.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } } }, "date-format": { @@ -30650,17 +30202,17 @@ "dev": true }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "requires": { - "ms": "2.0.0" + "ms": "2.1.2" }, "dependencies": { "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -30690,23 +30242,40 @@ } }, "deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", + "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dev": true, "requires": { + "call-bind": "^1.0.0", + "es-get-iterator": "^1.1.1", + "get-intrinsic": "^1.0.1", "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", + "is-date-object": "^1.0.2", + "is-regex": "^1.1.1", + "isarray": "^2.0.5", + "object-is": "^1.1.4", "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" + "object.assign": "^4.1.2", + "regexp.prototype.flags": "^1.3.0", + "side-channel": "^1.0.3", + "which-boxed-primitive": "^1.0.1", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.2" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } } }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "default-gateway": { @@ -30916,21 +30485,6 @@ "debug": "^4.3.1", "native-fetch": "^3.0.0", "receptacle": "^1.3.2" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } } }, "doctrine": { @@ -30954,12 +30508,6 @@ "void-elements": "^2.0.0" } }, - "dom-walk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", - "dev": true - }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -31013,44 +30561,6 @@ "dev": true, "requires": { "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "duplexify": { @@ -31063,44 +30573,6 @@ "inherits": "^2.0.1", "readable-stream": "^2.0.0", "stream-shift": "^1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "ecc-jsbn": { @@ -31143,9 +30615,9 @@ } }, "electron-to-chromium": { - "version": "1.3.829", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.829.tgz", - "integrity": "sha512-5EXDbvsaLRxS1UOfRr8Hymp3dR42bvBNPgzVuPwUFj3v66bpvDUcNwwUywQUQYn/scz26/3Sgd3fNVGQOlVwvQ==", + "version": "1.3.849", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.849.tgz", + "integrity": "sha512-RweyW60HPOqIcxoKTGr38Yvtf2aliSUqX8dB3e9geJ0Bno0YLjcOX5F7/DPVloBkJWaPZ7xOM1A0Yme2T1A34w==", "dev": true }, "elliptic": { @@ -31245,21 +30717,6 @@ "ws": "~7.4.2" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", @@ -31330,21 +30787,22 @@ } }, "es-abstract": { - "version": "1.18.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz", - "integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==", + "version": "1.18.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz", + "integrity": "sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==", "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-symbols": "^1.0.2", "internal-slot": "^1.0.3", - "is-callable": "^1.2.3", + "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", + "is-regex": "^1.1.4", + "is-string": "^1.0.7", "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", @@ -31353,6 +30811,30 @@ "unbox-primitive": "^1.0.1" } }, + "es-get-iterator": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", + "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.0", + "has-symbols": "^1.0.1", + "is-arguments": "^1.1.0", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -31567,15 +31049,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, "eslint-utils": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", @@ -31591,31 +31064,16 @@ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -31645,6 +31103,23 @@ "debug": "^2.2.0", "object-assign": "^4.0.1", "resolve": "^1.1.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "eslint-module-utils": { @@ -31929,7 +31404,7 @@ "@types/bn.js": "^5.1.0", "@types/node": "^11.13.4", "@types/secp256k1": "^4.0.1", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "bn.js": "^5.1.2", "create-hash": "^1.1.2", "eslint": "^6.8.0", @@ -31946,6 +31421,59 @@ "tape": "^4.10.1", "ts-node": "^10.2.1", "typescript": "^4.4.2" + }, + "dependencies": { + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "tape": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.14.0.tgz", + "integrity": "sha512-z0+WrUUJuG6wIdWrl4W3rTte2CR26G6qcPOj3w1hfRdcmhF3kHBhOBW9VHsPVAkz08ZmGzp7phVpDupbLzrYKQ==", + "dev": true, + "requires": { + "call-bind": "~1.0.2", + "deep-equal": "~1.1.1", + "defined": "~1.0.0", + "dotignore": "~0.1.2", + "for-each": "~0.3.3", + "glob": "~7.1.7", + "has": "~1.0.3", + "inherits": "~2.0.4", + "is-regex": "~1.1.3", + "minimist": "~1.2.5", + "object-inspect": "~1.11.0", + "resolve": "~1.20.0", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.2.4", + "through": "~2.3.8" + } + } } }, "ethjs-util": { @@ -32086,6 +31614,15 @@ "to-regex": "^3.0.1" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -32166,6 +31703,12 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -32222,6 +31765,21 @@ "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", "dev": true }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -32237,9 +31795,9 @@ } }, "ext": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.5.0.tgz", - "integrity": "sha512-+ONcYoWj/SoQwUofMr94aGu05Ou4FepKi7N7b+O8T4jVfyIsZQV1/xeS8jpaBzF0csAk0KLXoHCxU7cKYZjo1Q==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", + "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", "dev": true, "requires": { "type": "^2.5.0" @@ -32384,14 +31942,15 @@ "dev": true }, "fast-safe-stringify": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", - "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true }, "fastq": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz", - "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -32463,6 +32022,23 @@ "parseurl": "~1.3.3", "statuses": "~1.5.0", "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "find-cache-dir": { @@ -32696,44 +32272,6 @@ "requires": { "inherits": "^2.0.3", "readable-stream": "^2.3.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "fn.name": { @@ -32742,9 +32280,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "follow-redirects": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.3.tgz", - "integrity": "sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==", + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", "dev": true }, "for-each": { @@ -32854,56 +32392,34 @@ "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" + } + }, + "fs-extra": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", + "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" } } }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -32914,44 +32430,6 @@ "iferr": "^0.1.5", "imurmurhash": "^0.1.4", "readable-stream": "1 || 2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "fs.realpath": { @@ -33090,6 +32568,12 @@ "resolved": "https://registry.npmjs.org/get-iterator/-/get-iterator-1.0.2.tgz", "integrity": "sha512-v+dm9bNVfOYsY1OrhaCrmyOcYoSeVvbt+hHZ0Au+T+p1y+0Uyj9aMaGIeUTT6xdpRbWzDeYKvfOslPhggQMcsg==" }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", @@ -33101,6 +32585,15 @@ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -33116,9 +32609,9 @@ } }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -33138,24 +32631,6 @@ "is-glob": "^4.0.1" } }, - "global": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", - "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", - "dev": true, - "requires": { - "min-document": "^2.19.0", - "process": "~0.5.1" - }, - "dependencies": { - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", - "dev": true - } - } - }, "global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -33177,10 +32652,13 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } }, "globby": { "version": "11.0.4", @@ -33274,6 +32752,15 @@ "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==" }, + "has-dynamic-import": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.0.tgz", + "integrity": "sha512-GYPi/aZmACJVrVfEhP1rNUFmtCuK+SQ96mn8Bs7mXiGZRAJiI4VjaMmjj4uuvW8qaF085uWJvyJk9UNYUIYn0A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -33358,6 +32845,18 @@ "inherits": "^2.0.4", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "hash.js": { @@ -33727,9 +33226,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -33773,12 +33272,12 @@ "dev": true }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "supports-color": { @@ -34118,6 +33617,12 @@ "resolved": "https://registry.npmjs.org/is-loopback-addr/-/is-loopback-addr-1.0.1.tgz", "integrity": "sha512-DhWU/kqY7X2F6KrrVTu7mHlbd2Pbo4D1YkAzasBMjQs6lJAoefxaA6m6CpSX0K6pjt9D0b9PNFI5zduy/vzOYw==" }, + "is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "dev": true + }, "is-my-ip-valid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", @@ -34207,6 +33712,12 @@ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, + "is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "dev": true + }, "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -34245,6 +33756,18 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "dev": true + }, + "is-weakset": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.1.tgz", + "integrity": "sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw==", + "dev": true + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -34261,9 +33784,9 @@ } }, "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isbinaryfile": { "version": "4.0.8", @@ -34289,6 +33812,16 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -34315,9 +33848,9 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz", + "integrity": "sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ==", "dev": true }, "istanbul-lib-hook": { @@ -34339,6 +33872,14 @@ "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.0.0", "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "istanbul-lib-report": { @@ -34367,6 +33908,12 @@ "semver": "^6.0.0" } }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -34389,21 +33936,6 @@ "source-map": "^0.6.1" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -34454,6 +33986,16 @@ "base64-js": "^1.3.1", "ieee754": "^1.2.1" } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -34473,9 +34015,9 @@ "integrity": "sha512-wiI02c+G1BVuu0jz30Nsr1/et0cpSRulKUusN8HDZXxuX4MdUzfMp2P4JUk+a49Wr1kHitRLrnnh3+UzJ6neaQ==" }, "it-glob": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-0.0.13.tgz", - "integrity": "sha512-0Hcd5BraJUPzL28NWiFbdNrcdyNxNTKKdU3sjdFiYynNTQpwlG2UKW31X7bp+XhJwux/oPzIquo5ioztVmc2RQ==", + "version": "0.0.14", + "resolved": "https://registry.npmjs.org/it-glob/-/it-glob-0.0.14.tgz", + "integrity": "sha512-TKKzs9CglbsihSpcwJPXN5DBUssu4akRzPlp8QJRCoLrKoaOpyY2V1qDlxx+UMivn0i114YyTd4AawWl7eqIdw==", "requires": { "@types/minimatch": "^3.0.4", "minimatch": "^3.0.4" @@ -34540,6 +34082,16 @@ "ieee754": "^1.1.13" } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -34629,6 +34181,16 @@ "requires": { "bl": "^5.0.0" } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -34680,6 +34242,16 @@ "base64-js": "^1.3.1", "ieee754": "^1.1.13" } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -34709,6 +34281,16 @@ "base64-js": "^1.3.1", "ieee754": "^1.2.1" } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -34757,9 +34339,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.23.tgz", - "integrity": "sha512-FW0q7NI8UnjbKrJK8NGr6QXY69ATw9IFe6ItIo5yozPwA9DU/xkhiPddctUVyrmFXvyFYerYgQak/qu200UBDw==" + "version": "12.20.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.26.tgz", + "integrity": "sha512-gIt+h4u2uTho2bsH1K250fUv5fHU71ET1yWT7bM4523zV/XrFb9jlWBOV4DO8FpscY+Sz/WEr1EEjIP2H4yumQ==" }, "commander": { "version": "2.20.3", @@ -34856,6 +34438,26 @@ "psl": "^1.1.28", "punycode": "^2.1.1" } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } } } }, @@ -34916,10 +34518,17 @@ "minimist": "^1.2.5" } }, + "jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -34961,6 +34570,12 @@ "type-component": "0.0.1" }, "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, "jsonparse": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.6.tgz", @@ -35111,47 +34726,6 @@ "yargs": "^16.1.1" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -35173,15 +34747,6 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, "tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", @@ -35190,44 +34755,6 @@ "requires": { "rimraf": "^3.0.0" } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true } } }, @@ -35322,15 +34849,15 @@ }, "dependencies": { "acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true }, "acorn-walk": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz", - "integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, "assert": { @@ -35361,6 +34888,15 @@ "ieee754": "^1.1.13" } }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "domain-browser": { "version": "4.22.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", @@ -35385,6 +34921,17 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -35394,6 +34941,12 @@ "glob": "^7.1.3" } }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "source-map": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", @@ -35452,6 +35005,18 @@ "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "keygrip": { @@ -35545,6 +35110,18 @@ "inherits": "^2.0.4", "readable-stream": "^3.4.0", "xtend": "^4.0.2" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "level-js": { @@ -35603,6 +35180,18 @@ "inherits": "^2.0.3", "readable-stream": "^3.1.0", "xtend": "^4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "leveldown": { @@ -35710,14 +35299,6 @@ "xsalsa20": "^1.0.2" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, "es6-promisify": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-6.1.1.tgz", @@ -35727,37 +35308,46 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, "libp2p-bootstrap": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.12.2.tgz", - "integrity": "sha512-ICRv0oertc7mZ1AOTq5Uw28YR9clcYd2ADYJFIBdpiIk7SRpqWCP4pn4fY5nSRntAjdcG6KrGoyZ4YpQ8J/x1w==", + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/libp2p-bootstrap/-/libp2p-bootstrap-0.12.3.tgz", + "integrity": "sha512-4S7+YyZYy8wRmNxXGwsBsKrxGMk59nTqwDdBeEf9m3aVWZ0zdz5uu3WXq7sl8ULb703Zx5IdjGDrdbxhYtdqlA==", "requires": { - "debug": "^4.1.1", - "mafmt": "^8.0.0", - "multiaddr": "^8.0.0", + "debug": "^4.3.1", + "mafmt": "^9.0.0", + "multiaddr": "^9.0.1", "peer-id": "^0.14.0" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "err-code": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", + "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + }, + "mafmt": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", + "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", "requires": { - "ms": "2.1.2" + "multiaddr": "^9.0.1" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "multiaddr": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", + "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", + "requires": { + "cids": "^1.0.0", + "dns-over-http-resolver": "^1.0.0", + "err-code": "^3.0.1", + "is-ip": "^3.1.0", + "multibase": "^4.0.2", + "uint8arrays": "^2.1.3", + "varint": "^6.0.0" + } } } }, @@ -35829,24 +35419,11 @@ "uint8arrays": "^2.0.5" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, "delay": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/delay/-/delay-4.4.1.tgz", "integrity": "sha512-aL3AhqtfhOlT/3ai6sWXeqwnw63ATNpnUiN4HL7x9q+My5QtHlO3OIkasmug9LKzpheLdmUKGRKnYXYAS7FQkQ==" }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "multibase": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", @@ -35904,19 +35481,6 @@ "xor-distance": "^2.0.0" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -35958,23 +35522,20 @@ "ieee754": "^1.2.1" } }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, "err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -35994,21 +35555,6 @@ "peer-id": "^0.14.3", "protobufjs": "^6.10.1", "uint8arrays": "^2.0.5" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } } }, "libp2p-record": { @@ -36064,32 +35610,74 @@ } }, "libp2p-tcp": { - "version": "0.15.3", - "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.15.3.tgz", - "integrity": "sha512-j9efQ0aAbcCmVnnF0UqWH1r+qjNc0TpC3bV+QJDxBIe6v92a8l3kZ04G/QkP3vmzDT5Z4ayzMGjrOAas8hJIBA==", + "version": "0.15.4", + "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.15.4.tgz", + "integrity": "sha512-MqXIlqV7t9z0A1Ww9Omd2XIlndcYOAh5R6kWRZ8Vo/CITazKUC5ZGNoj23hq/aEPaX8p5XmJs2BKESg/OuhGhQ==", "requires": { "abortable-iterator": "^3.0.0", "class-is": "^1.1.0", - "debug": "^4.1.1", - "err-code": "^2.0.0", - "libp2p-utils": "^0.2.0", - "mafmt": "^8.0.0", - "multiaddr": "^8.0.0", + "debug": "^4.3.1", + "err-code": "^3.0.1", + "libp2p-utils": "^0.3.0", + "mafmt": "^9.0.0", + "multiaddr": "^9.0.1", "stream-to-it": "^0.2.2" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "err-code": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", + "integrity": "sha512-GiaH0KJUewYok+eeY05IIgjtAe4Yltygk9Wqp1V5yVWLdhf0hYZchRjNIT9bb0mSwRcIusT3cx7PJUf3zEIfUA==" + }, + "ip-address": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-7.1.0.tgz", + "integrity": "sha512-V9pWC/VJf2lsXqP7IWJ+pe3P1/HCYGBMZrrnT62niLGjAfCbeiwXMUxaeHvnVlz19O27pvXP4azs+Pj/A0x+SQ==", "requires": { - "ms": "2.1.2" + "jsbn": "1.1.0", + "sprintf-js": "1.1.2" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "libp2p-utils": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/libp2p-utils/-/libp2p-utils-0.3.1.tgz", + "integrity": "sha512-LOVfww7a6Rhtoupl3z1ABuTEli5whY3VLTB9QntsOIwbOcX9GfmjuhqYbEDht9lVPAQl+rCUWbfDMvK121ryUg==", + "requires": { + "abortable-iterator": "^3.0.0", + "debug": "^4.3.0", + "err-code": "^3.0.1", + "ip-address": "^7.1.0", + "is-loopback-addr": "^1.0.0", + "multiaddr": "^9.0.1", + "private-ip": "^2.1.1" + } + }, + "mafmt": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/mafmt/-/mafmt-9.0.0.tgz", + "integrity": "sha512-BwKL6FJxc6R85K6gFE/pX7MVyCp0NkM2DJHg0RatxVgDlK4g9kqtfXQUt2iReSmTcgZss/Q/Bdfa2KTg4KyC+g==", + "requires": { + "multiaddr": "^9.0.1" + } + }, + "multiaddr": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", + "integrity": "sha512-YFaEb9t4yXSbaGksSEdg+Kn2U02s7w4wXUgyEMQmPxFJj7CfVHY10WOsScAX/rK6Soa15S1zXYadqH9TtlVreQ==", + "requires": { + "cids": "^1.0.0", + "dns-over-http-resolver": "^1.0.0", + "err-code": "^3.0.1", + "is-ip": "^3.1.0", + "multibase": "^4.0.2", + "uint8arrays": "^2.1.3", + "varint": "^6.0.0" + } + }, + "sprintf-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", + "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" } } }, @@ -36105,21 +35693,6 @@ "is-loopback-addr": "^1.0.0", "multiaddr": "^8.0.0", "private-ip": "^2.1.1" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } } }, "libp2p-websockets": { @@ -36150,14 +35723,6 @@ "ieee754": "^1.2.1" } }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, "err-code": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/err-code/-/err-code-3.0.1.tgz", @@ -36217,11 +35782,6 @@ "multiaddr": "^9.0.1" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "multiaddr": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/multiaddr/-/multiaddr-9.0.2.tgz", @@ -36236,6 +35796,10 @@ "varint": "^6.0.0" } }, + "node-fetch": { + "version": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==" + }, "sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", @@ -36324,20 +35888,68 @@ "yargs": "^13.2.4" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "ms": "2.1.2" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } } } }, @@ -36349,23 +35961,6 @@ "requires": { "@yarnpkg/lockfile": "^1.1.0", "debug": "^4.1.0" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "lodash": { @@ -36480,34 +36075,17 @@ "flatted": "^2.0.1", "rfdc": "^1.1.4", "streamroller": "^2.2.4" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "logform": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz", - "integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.3.0.tgz", + "integrity": "sha512-graeoWUH2knKbGthMtuG1EfaSPMZFZBIrhuJHhkS5ZseFBrc7DupCzihOQAzsK/qIKPQaPJ/lFQFctILUY5ARQ==", "requires": { "colors": "^1.2.1", - "fast-safe-stringify": "^2.0.4", "fecha": "^4.2.0", "ms": "^2.1.1", + "safe-stable-stringify": "^1.1.0", "triple-beam": "^1.3.0" }, "dependencies": { @@ -36625,9 +36203,9 @@ } }, "marked": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.2.tgz", - "integrity": "sha512-TMJQQ79Z0e3rJYazY0tIoMsFzteUGw9fB3FD+gzuIT3zLuG9L9ckIvUfF51apdJkcqc208jJN2KbtPbOvXtbjA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.4.tgz", + "integrity": "sha512-jBo8AOayNaEcvBhNobg6/BLhdsK3NvnKWJg33MAAPbvTWiG4QBn9gpW1+7RssrKu4K1dKlN+0goVQwV41xEfOA==", "dev": true }, "mcl-wasm": { @@ -36679,44 +36257,6 @@ "requires": { "errno": "^0.1.3", "readable-stream": "^2.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "merge-descriptors": { @@ -36767,11 +36307,11 @@ "@types/benchmark": "^1.0.33", "@types/levelup": "^4.3.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "0x": "^4.9.1", "benchmark": "^2.1.4", "eslint": "^6.8.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", "karma-firefox-launcher": "^2.1.0", @@ -36784,10 +36324,22 @@ "readable-stream": "^3.6.0", "rlp": "^2.2.4", "semaphore-async-await": "^1.5.1", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "methods": { @@ -36846,15 +36398,6 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, - "min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "dev": true, - "requires": { - "dom-walk": "^0.1.0" - } - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -36942,44 +36485,6 @@ "subarg": "^1.0.0", "through2": "^2.0.0", "xtend": "^4.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "moment": { @@ -37224,19 +36729,6 @@ "ieee754": "^1.1.13" } }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, "multibase": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/multibase/-/multibase-3.1.2.tgz", @@ -37246,6 +36738,16 @@ "web-encoding": "^1.0.6" } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "uint8arrays": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-1.1.0.tgz", @@ -37379,6 +36881,12 @@ } } }, + "nanocolors": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.1.12.tgz", + "integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==", + "dev": true + }, "nanohtml": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/nanohtml/-/nanohtml-1.9.1.tgz", @@ -37396,6 +36904,23 @@ "normalize-html-whitespace": "^0.2.0", "through2": "^2.0.3", "transform-ast": "^2.4.0" + }, + "dependencies": { + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "nanoid": { @@ -37428,9 +36953,9 @@ "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" }, "native-abort-controller": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/native-abort-controller/-/native-abort-controller-1.0.3.tgz", - "integrity": "sha512-fd5LY5q06mHKZPD5FmMrn7Lkd2H018oBGKNOAdLpctBDEPFKsfJ1nX9ke+XRa8PEJJpjqrpQkGjq2IZ27QNmYA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/native-abort-controller/-/native-abort-controller-1.0.4.tgz", + "integrity": "sha512-zp8yev7nxczDJMoP6pDxyD20IU0T22eX8VwN2ztDccKvSZhRaV33yP1BGwKSZfXuqWUzsXopVFjBdau9OOAwMQ==", "requires": {} }, "native-fetch": { @@ -37522,9 +37047,12 @@ } }, "node-fetch": { - "version": "npm:@achingbrain/node-fetch@2.6.7", - "resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==" + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", + "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", + "requires": { + "whatwg-url": "^5.0.0" + } }, "node-forge": { "version": "0.10.0", @@ -37532,9 +37060,9 @@ "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, "node-gyp-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" }, "node-libs-browser": { "version": "2.2.1", @@ -37590,33 +37118,6 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "stream-http": { "version": "2.8.3", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", @@ -37630,15 +37131,6 @@ "xtend": "^4.0.0" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "timers-browserify": { "version": "2.0.12", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", @@ -37666,9 +37158,9 @@ } }, "node-releases": { - "version": "1.1.75", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.75.tgz", - "integrity": "sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==", + "version": "1.1.76", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz", + "integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==", "dev": true }, "normalize-html-whitespace": { @@ -37842,15 +37334,38 @@ "yargs-parser": "^13.0.0" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, "requires": { - "ms": "2.1.2" + "safe-buffer": "~5.1.1" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "istanbul-lib-coverage": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", @@ -37923,24 +37438,41 @@ } } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -37949,6 +37481,35 @@ "requires": { "has-flag": "^3.0.0" } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } } } }, @@ -38456,44 +38017,6 @@ "cyclist": "^1.0.1", "inherits": "^2.0.3", "readable-stream": "^2.1.5" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "parent-module": { @@ -38623,6 +38146,13 @@ "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "requires": { "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + } } }, "path-type": { @@ -38649,16 +38179,16 @@ } }, "peer-id": { - "version": "0.14.6", - "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.14.6.tgz", - "integrity": "sha512-Ubww7Y69OdKISOGYfkc232MPHhcQQ9FJzSoOVmDmuxqo1jEjgT5ThvwoPom2LqAd/KRbrmk5bxFeGMvbgpazog==", + "version": "0.14.8", + "resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.14.8.tgz", + "integrity": "sha512-GpuLpob/9FrEFvyZrKKsISEkaBYsON2u0WtiawLHj1ii6ewkoeRiSDFLyIefYhw0jGvQoeoZS05jaT52X7Bvig==", "requires": { "cids": "^1.1.5", "class-is": "^1.1.0", "libp2p-crypto": "^0.19.0", "minimist": "^1.2.5", "multihashes": "^4.0.2", - "protons": "^2.0.0", + "protobufjs": "^6.10.2", "uint8arrays": "^2.0.5" } }, @@ -38765,6 +38295,19 @@ "pump": "^3.0.0", "readable-stream": "^3.0.6", "split2": "^3.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "pino-std-serializers": { @@ -38966,9 +38509,9 @@ "dev": true }, "prettier": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", - "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", "dev": true }, "prettier-linter-helpers": { @@ -39007,6 +38550,12 @@ "split2": "~0.2.1" }, "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, "readable-stream": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", @@ -39113,16 +38662,16 @@ }, "dependencies": { "@types/node": { - "version": "16.7.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz", - "integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA==" + "version": "16.9.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.6.tgz", + "integrity": "sha512-YHUZhBOMTM3mjFkXVcK+WwAcYmyhe1wL4lfqNtzI0b3qAy7yuSetnM7QJazgE5PFmgVTNGiLOgRFfJMqW7XpSQ==" } } }, "protocol-buffers-schema": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.5.2.tgz", - "integrity": "sha512-LPzSaBYp/TcbuSlpGwqT5jR9kvJ3Zp5ic2N5c2ybx6XB/lSfEHq2D7ja8AgoxHoMD91wXFALJoXsvshKPuXyew==" + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" }, "protons": { "version": "2.0.3", @@ -39351,44 +38900,6 @@ "dev": true, "requires": { "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "read-pkg": { @@ -39424,13 +38935,32 @@ } }, "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "readdirp": { @@ -39872,6 +39402,11 @@ "ret": "~0.1.10" } }, + "safe-stable-stringify": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz", + "integrity": "sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw==" + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -39936,10 +39471,30 @@ "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=" }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } }, "semver-compare": { "version": "1.0.0", @@ -39948,9 +39503,9 @@ "dev": true }, "semver-regex": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz", - "integrity": "sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.3.tgz", + "integrity": "sha512-Aqi54Mk9uYTjVexLnR67rTyBusmwd04cLkHy9hNvk3+G3nT2Oyg7E0l4XVbOaNwIvQ3hHeYxGcyEy+mKreyBFQ==", "dev": true }, "send": { @@ -39974,6 +39529,23 @@ "statuses": "~1.5.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -40125,12 +39697,12 @@ } }, "shiki": { - "version": "0.9.10", - "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.10.tgz", - "integrity": "sha512-xeM7Oc6hY+6iW5O/T5hor8ul7mEprzyl5y4r5zthEHToQNw7MIhREMgU3r2gKDB0NaMLNrkcEQagudCdzE13Lg==", + "version": "0.9.11", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.11.tgz", + "integrity": "sha512-tjruNTLFhU0hruCPoJP0y+B9LKOmcqUhTpxn7pcJB3fa+04gFChuEmxmrUfOJ7ZO6Jd+HwMnDHgY3lv3Tqonuw==", "dev": true, "requires": { - "json5": "^2.2.0", + "jsonc-parser": "^3.0.0", "onigasm": "^2.2.5", "vscode-textmate": "5.2.0" } @@ -40146,9 +39718,9 @@ } }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==" }, "signed-varint": { "version": "2.0.1", @@ -40307,6 +39879,15 @@ "use": "^3.1.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -40387,6 +39968,12 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true } } }, @@ -40452,23 +40039,6 @@ "engine.io": "~4.1.0", "socket.io-adapter": "~2.1.0", "socket.io-parser": "~4.0.3" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "socket.io-adapter": { @@ -40486,23 +40056,6 @@ "@types/component-emitter": "^1.2.10", "component-emitter": "~1.3.0", "debug": "~4.3.1" - }, - "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } } }, "sonic-boom": { @@ -40541,9 +40094,9 @@ } }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -40641,6 +40194,19 @@ "dev": true, "requires": { "readable-stream": "^3.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "sprintf-js": { @@ -40789,6 +40355,15 @@ "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -40994,12 +40569,6 @@ "number-is-nan": "^1.0.0" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", @@ -41009,6 +40578,12 @@ "jsonify": "~0.0.0" } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "onetime": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", @@ -41254,44 +40829,6 @@ "requires": { "inherits": "~2.0.1", "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "stream-combiner2": { @@ -41302,44 +40839,6 @@ "requires": { "duplexer2": "~0.1.0", "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "stream-each": { @@ -41362,6 +40861,19 @@ "inherits": "^2.0.4", "readable-stream": "^3.6.0", "xtend": "^4.0.2" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } } }, "stream-shift": { @@ -41378,44 +40890,6 @@ "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "stream-to-it": { @@ -41448,15 +40922,6 @@ "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", "dev": true }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -41467,12 +40932,6 @@ "jsonfile": "^4.0.0", "universalify": "^0.1.0" } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true } } }, @@ -41485,29 +40944,29 @@ } }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } } } @@ -41620,15 +41079,6 @@ "semver": "^7.3.2" }, "dependencies": { - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, "form-data": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", @@ -41640,21 +41090,6 @@ "mime-types": "^2.1.12" } }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "qs": { "version": "6.10.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", @@ -41664,20 +41099,16 @@ "side-channel": "^1.0.4" } }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true } } }, @@ -41769,12 +41200,6 @@ "trim": "0.0.1" }, "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", @@ -41888,35 +41313,42 @@ "dev": true }, "tape": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.14.0.tgz", - "integrity": "sha512-z0+WrUUJuG6wIdWrl4W3rTte2CR26G6qcPOj3w1hfRdcmhF3kHBhOBW9VHsPVAkz08ZmGzp7phVpDupbLzrYKQ==", - "dev": true, - "requires": { - "call-bind": "~1.0.2", - "deep-equal": "~1.1.1", - "defined": "~1.0.0", - "dotignore": "~0.1.2", - "for-each": "~0.3.3", - "glob": "~7.1.7", - "has": "~1.0.3", - "inherits": "~2.0.4", - "is-regex": "~1.1.3", - "minimist": "~1.2.5", - "object-inspect": "~1.11.0", - "resolve": "~1.20.0", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.2.4", - "through": "~2.3.8" - } - }, - "tape-catch": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/tape-catch/-/tape-catch-1.0.6.tgz", - "integrity": "sha1-EpMdXqYKA6l9m9GdDX2M/D9s7PE=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.3.1.tgz", + "integrity": "sha512-Mj3h+/dgfI2xct4kTpzqZaRxhhglXcMg//xGTbB0AQisfiOYa6ZBNQIgv46xi1MqbgthuNLSS1SAySDZsb7MMA==", "dev": true, "requires": { - "global": "~4.3.0" + "call-bind": "^1.0.2", + "deep-equal": "^2.0.5", + "defined": "^1.0.0", + "dotignore": "^0.1.2", + "for-each": "^0.3.3", + "get-package-type": "^0.1.0", + "glob": "^7.1.7", + "has": "^1.0.3", + "has-dynamic-import": "^2.0.0", + "inherits": "^2.0.4", + "is-regex": "^1.1.4", + "minimist": "^1.2.5", + "object-inspect": "^1.11.0", + "object-is": "^1.1.5", + "object.assign": "^4.1.2", + "resolve": "^2.0.0-next.3", + "resumer": "^0.0.0", + "string.prototype.trim": "^1.2.4", + "through": "^2.3.8" + }, + "dependencies": { + "resolve": { + "version": "2.0.0-next.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", + "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + } } }, "terser": { @@ -42049,44 +41481,6 @@ "requires": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "timeout-abort-controller": { @@ -42192,21 +41586,9 @@ } }, "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, "transform-ast": { "version": "2.4.4", @@ -42223,6 +41605,15 @@ "nanobench": "^2.1.1" }, "dependencies": { + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "is-buffer": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", @@ -42237,6 +41628,12 @@ "requires": { "source-map": "^0.5.6" } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true } } }, @@ -42297,6 +41694,12 @@ "emojis-list": "^3.0.0", "json5": "^1.0.1" } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, @@ -42321,15 +41724,15 @@ }, "dependencies": { "acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", "dev": true }, "acorn-walk": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz", - "integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true } } @@ -42401,9 +41804,9 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, "type-is": { @@ -42432,40 +41835,31 @@ } }, "typedoc": { - "version": "0.21.9", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.21.9.tgz", - "integrity": "sha512-VRo7aII4bnYaBBM1lhw4bQFmUcDQV8m8tqgjtc7oXl87jc1Slbhfw2X5MccfcR2YnEClHDWgsiQGgNB8KJXocA==", + "version": "0.22.4", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.22.4.tgz", + "integrity": "sha512-M/a8NnPxq3/iZNNVjzFCK5gu4m//HTJIPbSS0JQVbkHJPP9wyepR12agylWTSqeVZe0xsbidVtO26+PP7iD/jw==", "dev": true, "requires": { "glob": "^7.1.7", - "handlebars": "^4.7.7", "lunr": "^2.3.9", - "marked": "^3.0.2", - "minimatch": "^3.0.0", - "progress": "^2.0.3", - "shiki": "^0.9.8", - "typedoc-default-themes": "^0.12.10" + "marked": "^3.0.4", + "minimatch": "^3.0.4", + "shiki": "^0.9.11" } }, - "typedoc-default-themes": { - "version": "0.12.10", - "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz", - "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==", - "dev": true - }, "typedoc-plugin-markdown": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.10.4.tgz", - "integrity": "sha512-if9w7S9fXLg73AYi/EoRSEhTOZlg3I8mIP8YEmvzSE33VrNXC9/hA0nVcLEwFVJeQY7ay6z67I6kW0KIv7LjeA==", + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.11.1.tgz", + "integrity": "sha512-OqCkbN2mjHx1NnKSKyjp5QoGzNcJLZke3UMiUQsFCowfzebegr7Tx5YILL3JDlPlpE96DJD3USImVas5vaS4WA==", "dev": true, "requires": { "handlebars": "^4.7.7" } }, "typescript": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", - "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true }, "ua-parser-js": { @@ -42475,9 +41869,9 @@ "dev": true }, "uglify-js": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", - "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", + "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==", "dev": true, "optional": true }, @@ -42566,7 +41960,8 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true }, "unix-crypt-td-js": { "version": "1.1.4", @@ -42622,12 +42017,6 @@ "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true } } }, @@ -43119,6 +42508,13 @@ "assert-plus": "^1.0.0", "core-util-is": "1.0.2", "extsprintf": "^1.2.0" + }, + "dependencies": { + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + } } }, "vm-browserify": { @@ -43369,13 +42765,6 @@ } } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -43398,22 +42787,6 @@ "to-regex": "^3.0.2" } }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, "readdirp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", @@ -43426,23 +42799,6 @@ "readable-stream": "^2.0.2" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -43620,12 +42976,6 @@ } } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -43677,27 +43027,6 @@ "to-regex": "^3.0.2" } }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "schema-utils": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", @@ -43709,15 +43038,6 @@ "ajv-keywords": "^3.1.0" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "to-regex-range": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", @@ -43749,6 +43069,29 @@ "yargs": "^13.3.2" }, "dependencies": { + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -43769,6 +43112,17 @@ "json5": "^1.0.1" } }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -43777,6 +43131,35 @@ "requires": { "has-flag": "^3.0.0" } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } } } }, @@ -43814,14 +43197,19 @@ "dev": true }, "whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + } } }, "which": { @@ -43845,6 +43233,18 @@ "is-symbol": "^1.0.3" } }, + "which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dev": true, + "requires": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + } + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -43936,6 +43336,16 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/async/-/async-3.2.1.tgz", "integrity": "sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg==" + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -43946,40 +43356,6 @@ "requires": { "readable-stream": "^2.3.7", "triple-beam": "^1.2.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } } }, "word-wrap": { @@ -44004,33 +43380,53 @@ } }, "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "dependencies": { - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" } } } @@ -44062,9 +43458,9 @@ } }, "ws": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz", - "integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", "requires": {} }, "xml-name-validator": { @@ -44125,41 +43521,31 @@ "dev": true }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, "dependencies": { - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true } } }, diff --git a/packages/block/CHANGELOG.md b/packages/block/CHANGELOG.md index 76776b4c8a..d7d43d8631 100644 --- a/packages/block/CHANGELOG.md +++ b/packages/block/CHANGELOG.md @@ -6,6 +6,44 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 3.5.1 - 2021-09-28 + +- Fixed a bug not initializing the HF correctly when run on a custom chain with the `london` HF happening on block 0 or 1, PR [#1492](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1492) + +## 3.5.0 - 2021-09-24 + +### Experimental Merge/PoS Support + +This release comes with experimental support for the Merge HF as defined in [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675) respectively support for creating PoS compatible `Block` objects (from an Eth 1.0 perspective). + +#### PoS Block Instantiation + +Proof-of-Stake compatible execution blocks come with its own set of header field simplifications and associated validation rules. The difficuly is set to `0` since not relevant any more, just to name an example. For a full list of changes see `EIP-3675`. + +You can instantiate a Merge/PoS block like this: + +```typescript +import { Block } from '@ethereumjs/block' +import Common, { Chain, Hardfork } from '@ethereumjs/common' +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Merge, }) +const block = Block.fromBlockData({ + // Provide your block data here or use default values +}, { common }) +``` + +See: PR [#1393](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1393) and PR [#1408](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1393) + +#### Set Hardfork by Total Difficulty + +There is a new `hardforkByTD` option which expands the current `hardforkByBlockNumber` option and allows for setting the hardfork either by total difficulty or a `Common`-matching block number. The supportive functionality within the `Common` library has been introduced along the `v2.5.0` release. + +See. PR [#1473](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1473) + +### Other Changes + +- The hash from the `block.hash()` method now gets cached for blocks created with the `freeze` option (activated by default), PR [#1445](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1445) + + ## 3.4.0 - 2021-07-08 ### Finalized London HF Support @@ -28,15 +66,22 @@ Source files from the `src` folder are now included in the distribution build, s This `Block` release comes with full functional support for the `london` hardfork (all EIPs are finalized and integrated and `london` HF can be activated, there are no final block numbers for the HF integrated though yet). Please note that the default HF is still set to `istanbul`. You therefore need to explicitly set the `hardfork` parameter for instantiating a `Common` instance with a `london` HF activated: ```typescript -import { Block } from 'ethereumjs-block' +import { BN } from 'ethereumjs-util' +import { Block } from '@ethereumjs/block' import Common from '@ethereumjs/common' const common = new Common({ chain: 'mainnet', hardfork: 'london' }) + const block = Block.fromBlockData({ header: { - //..., baseFeePerGas: new BN(10), + gasLimit: new BN(100), + gasUsed: new BN(60) } }, { common }) + +// Base fee will increase for next block since the +// gas used is greater than half the gas limit +block.header.calcNextBaseFee().toNumber() // 11 ``` #### EIP-1559: Fee market change for ETH 1.0 chain @@ -204,7 +249,7 @@ Generally internal types representing block header values are now closer to thei **Block Class** -There are analogue new static factories for the `Block` class: +There are analog new static factories for the `Block` class: - `Block.fromBlockData(blockData: BlockData = {}, opts?: BlockOptions)` - `Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)` @@ -413,7 +458,7 @@ Generally internal types representing block header values are now closer to thei **Block Class** -There are analogue new static factories for the `Block` class: +There are analog new static factories for the `Block` class: - `Block.fromBlockData(blockData: BlockData = {}, opts?: BlockOptions)` - `Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)` diff --git a/packages/block/README.md b/packages/block/README.md index e7e5d995d3..08a144993e 100644 --- a/packages/block/README.md +++ b/packages/block/README.md @@ -9,7 +9,7 @@ | Implements schema and functions related to Ethereum's block. | | --- | -Note: this `README` reflects the state of the library from `v3.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-block) for an introduction on the last preceeding release. +Note: this `README` reflects the state of the library from `v3.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-block) for an introduction on the last preceding release. # INSTALL @@ -25,7 +25,7 @@ There are three static factories to instantiate a `Block`: - `Block.fromRLPSerializedBlock(serialized: Buffer, opts?: BlockOptions)` - `Block.fromValuesArray(values: BlockBuffer, opts?: BlockOptions)` -For `BlockHeader` instantiation analogue factory methods exists, see API docs linked below. +For `BlockHeader` instantiation analog factory methods exists, see API docs linked below. Instantiation Example: @@ -62,15 +62,22 @@ This library supports the creation of [EIP-1559](https://eips.ethereum.org/EIPS/ To instantiate an EIP-1559 block the hardfork parameter on the `Common` instance needs to be explicitly set to `london` (default is still `istanbul`): ```typescript -import { Block } from 'ethereumjs-block' +import { BN } from 'ethereumjs-util' +import { Block } from '@ethereumjs/block' import Common, { Chain, Hardfork } from '@ethereumjs/common' const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) + const block = Block.fromBlockData({ header: { - //..., baseFeePerGas: new BN(10), + gasLimit: new BN(100), + gasUsed: new BN(60) } }, { common }) + +// Base fee will increase for next block since the +// gas used is greater than half the gas limit +block.header.calcNextBaseFee().toNumber() // 11 ``` EIP-1559 blocks have an extra `baseFeePerGas` field (default: `new BN(7)`) and can encompass `FeeMarketEIP1559Transaction` txs (type `2`) (supported by `@ethereumjs/tx` `v3.2.0` or higher) as well as `Transaction` legacy txs (internal type `0`) and `AccessListEIP2930Transaction` txs (type `1`). @@ -131,6 +138,23 @@ Additionally there are the following utility methods for Clique/PoA related func See the API docs for detailed documentation. Note that these methods will throw if called in a non-Clique/PoA context. +### Casper/PoS (since v3.5.0) (experimental) + +Merge-friendly Casper/PoS blocks have been introduced along with the `v3.5.0` release. Proof-of-Stake compatible execution blocks come with their own set of header field simplifications and associated validation rules. The difficulty is set to `0` since not relevant anymore, just to name an example. For a full list of changes see [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675). + +You can instantiate a Merge/PoS block like this: + +```typescript +import { Block } from '@ethereumjs/block' +import Common, { Chain, Hardfork } from '@ethereumjs/common' +const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Merge, }) +const block = Block.fromBlockData({ + // Provide your block data here or use default values +}, { common }) +``` + +Note that all `Merge` respectively `Casper/PoS` related functionality is still considered `experimental`. + # API [Documentation](./docs/README.md) diff --git a/packages/block/package.json b/packages/block/package.json index 12dabb0aab..ef3082e19f 100644 --- a/packages/block/package.json +++ b/packages/block/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/block", - "version": "3.4.0", + "version": "3.5.1", "description": "Provides Block serialization and help functions", "license": "MPL-2.0", "author": "mjbecze (mb@ethdev.com)", @@ -20,7 +20,7 @@ "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "coverage": "../../config/cli/coverage.sh", "docs:build": "typedoc --options typedoc.js", @@ -35,15 +35,15 @@ "test:browser": "karma start karma.conf.js" }, "dependencies": { - "@ethereumjs/common": "^2.4.0", + "@ethereumjs/common": "^2.5.0", "merkle-patricia-tree": "^4.2.1", - "@ethereumjs/tx": "^3.3.0", - "ethereumjs-util": "^7.1.0" + "@ethereumjs/tx": "^3.3.1", + "ethereumjs-util": "^7.1.1" }, "devDependencies": { "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -52,8 +52,8 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", - "typedoc": "^0.21.5", + "tape": "^5.3.1", + "typedoc": "^0.22.4", "ts-node": "^10.2.1", "typescript": "^4.4.2" }, diff --git a/packages/block/src/block.ts b/packages/block/src/block.ts index c5e070ffe6..98e451072e 100644 --- a/packages/block/src/block.ts +++ b/packages/block/src/block.ts @@ -46,16 +46,19 @@ export class Block { // parse uncle headers const uncleHeaders = [] + const uncleOpts: BlockOptions = { + hardforkByBlockNumber: true, + ...opts, // This potentially overwrites hardforkByBlocknumber + // Use header common in case of hardforkByBlockNumber being activated + common: header._common, + // Disable this option here (all other options carried over), since this overwrites the provided Difficulty to an incorrect value + calcDifficultyFromHeader: undefined, + } + if (uncleOpts.hardforkByTD) { + delete uncleOpts.hardforkByBlockNumber + } for (const uhData of uhsData ?? []) { - const uh = BlockHeader.fromHeaderData(uhData, { - hardforkByBlockNumber: true, - ...opts, // This potentially overwrites hardforkByBlocknumber - // Use header common in case of hardforkByBlockNumber being activated - common: header._common, - // Disable this option here (all other options carried over), since this overwrites - // the provided Difficulty to an incorrect value - calcDifficultyFromHeader: undefined, - }) + const uh = BlockHeader.fromHeaderData(uhData, uncleOpts) uncleHeaders.push(uh) } @@ -107,17 +110,19 @@ export class Block { // parse uncle headers const uncleHeaders = [] + const uncleOpts: BlockOptions = { + hardforkByBlockNumber: true, + ...opts, // This potentially overwrites hardforkByBlocknumber + // Use header common in case of hardforkByBlockNumber being activated + common: header._common, + // Disable this option here (all other options carried over), since this overwrites the provided Difficulty to an incorrect value + calcDifficultyFromHeader: undefined, + } + if (uncleOpts.hardforkByTD) { + delete uncleOpts.hardforkByBlockNumber + } for (const uncleHeaderData of uhsData || []) { - uncleHeaders.push( - BlockHeader.fromValuesArray(uncleHeaderData, { - hardforkByBlockNumber: true, - ...opts, // This potentially overwrites hardforkByBlocknumber - // Use header common in case of hardforkByBlockNumber being activated - common: header._common, - // Disable this option here (all other options carried over), since this overwrites the provided Difficulty to an incorrect value - calcDifficultyFromHeader: undefined, - }) - ) + uncleHeaders.push(BlockHeader.fromValuesArray(uncleHeaderData, uncleOpts)) } return new Block(header, transactions, uncleHeaders, opts) diff --git a/packages/block/src/header.ts b/packages/block/src/header.ts index 5f72c4fbfb..dacb50d057 100644 --- a/packages/block/src/header.ts +++ b/packages/block/src/header.ts @@ -1,4 +1,4 @@ -import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' +import Common, { Chain, ConsensusAlgorithm, ConsensusType } from '@ethereumjs/common' import { Address, BN, @@ -210,17 +210,23 @@ export class BlockHeader { if (options.common) { this._common = options.common.copy() } else { - const chain = Chain.Mainnet // default + this._common = new Common({ + chain: Chain.Mainnet, // default + }) if (options.initWithGenesisHeader) { - this._common = new Common({ chain, hardfork: Hardfork.Chainstart }) - } else { - // This initializes on the Common default hardfork - this._common = new Common({ chain }) + this._common.setHardforkByBlockNumber(0) } } - if (options.hardforkByBlockNumber) { - this._common.setHardforkByBlockNumber(number.toNumber()) + if (options.hardforkByBlockNumber !== undefined && options.hardforkByTD !== undefined) { + throw new Error( + `The hardforkByBlockNumber and hardforkByTD options can't be used in conjunction` + ) + } + + const hardforkByBlockNumber = options.hardforkByBlockNumber ?? false + if (hardforkByBlockNumber || options.hardforkByTD) { + this._common.setHardforkByBlockNumber(number, options.hardforkByTD) } if (this._common.isActivatedEIP(1559)) { diff --git a/packages/block/src/types.ts b/packages/block/src/types.ts index ece8d88b67..a6176a600f 100644 --- a/packages/block/src/types.ts +++ b/packages/block/src/types.ts @@ -28,6 +28,17 @@ export interface BlockOptions { * Default: `false` (HF is set to whatever default HF is set by the {@link Common} instance) */ hardforkByBlockNumber?: boolean + /** + * Determine the HF by total difficulty (Merge HF) + * + * This option is a superset of `hardforkByBlockNumber` (so only use one of both options) + * and determines the HF by both the block number and the TD. + * + * Since the TD is only a threshold the block number will in doubt take precedence (imagine + * e.g. both Merge and Shanghai HF blocks set and the block number from the block provided + * pointing to a Shanghai block: this will lead to set the HF as Shanghai and not the Merge). + */ + hardforkByTD?: BNLike /** * Turns the block header into the canonical genesis block header * diff --git a/packages/block/test/block.spec.ts b/packages/block/test/block.spec.ts index 4c4b96b06e..7842ee6842 100644 --- a/packages/block/test/block.spec.ts +++ b/packages/block/test/block.spec.ts @@ -1,10 +1,14 @@ import tape from 'tape' -import { BN, keccak256, rlp, zeros } from 'ethereumjs-util' +import { BN, keccak256, rlp, zeros, toBuffer } from 'ethereumjs-util' import Common, { Chain, Hardfork } from '@ethereumjs/common' import { Block, BlockBuffer, BlockHeader } from '../src' import blockFromRpc from '../src/from-rpc' import { Mockchain } from './mockchain' import { createBlock } from './util' +import testnetMerge from './testdata/testnetMerge.json' +import * as testData from './testdata/testdata.json' +import * as testData2 from './testdata/testdata2.json' +import * as testDataGenesis from './testdata/genesishashestest.json' import * as testDataFromRpcGoerli from './testdata/testdata-from-rpc-goerli.json' // explicitly import util, needed for karma-typescript bundling @@ -58,6 +62,65 @@ tape('[Block]: block functions', function (t) { st.end() }) + t.test('initialization -> hardforkByBlockNumber option', function (st) { + const customChains = [testnetMerge] + const common = new Common({ + chain: 'testnetMerge', + hardfork: Hardfork.Istanbul, + customChains, + }) + + let block = Block.fromBlockData( + { + header: { + number: 12, // Berlin block + }, + }, + { common, hardforkByBlockNumber: true } + ) + st.equal(block._common.hardfork(), 'berlin', 'should use hardforkByBlockNumber option') + + block = Block.fromBlockData( + { + header: { + number: 20, // Future block + }, + }, + { common, hardforkByTD: 5001 } + ) + st.equal(block._common.hardfork(), 'merge', 'should use hardforkByTD option (td > threshold)') + + block = Block.fromBlockData( + { + header: { + number: 12, // Berlin block + }, + }, + { common, hardforkByTD: 3000 } + ) + st.equal( + block._common.hardfork(), + 'berlin', + 'should work with hardforkByTD option (td < threshold)' + ) + + try { + Block.fromBlockData({}, { common, hardforkByBlockNumber: true, hardforkByTD: 3000 }) + st.fail('should not reach this') + } catch (e: any) { + const msg = + 'should throw if hardforkByBlockNumber and hardforkByTD options are used in conjunction' + st.ok( + e.message.includes( + `The hardforkByBlockNumber and hardforkByTD options can't be used in conjunction` + ), + msg + ) + } + + st.end() + }) + t.test('should initialize with undefined parameters without throwing', function (st) { st.doesNotThrow(function () { Block.fromBlockData() @@ -66,13 +129,14 @@ tape('[Block]: block functions', function (t) { }) t.test('should initialize with null parameters without throwing', function (st) { + const common = new Common({ chain: Chain.Ropsten }) + const opts = { common } st.doesNotThrow(function () { - const common = new Common({ chain: Chain.Ropsten }) - const opts = { common } Block.fromBlockData({}, opts) - st.end() }) + st.end() }) + t.test( 'should throw when trying to initialize with uncle headers on a PoA network', function (st) { @@ -81,7 +145,6 @@ tape('[Block]: block functions', function (t) { { header: { extraData: Buffer.alloc(117) } }, { common } ) - st.throws(function () { Block.fromBlockData({ uncleHeaders: [uncleBlock.header] }, { common }) }) @@ -89,18 +152,18 @@ tape('[Block]: block functions', function (t) { } ) - const testData = require('./testdata/testdata.json') - t.test('should test block validation on pow chain', async function (st) { - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp) const blockchain = new Mockchain() - const genesisBlock = Block.fromRLPSerializedBlock(testData.genesisRLP) + const genesisBlock = Block.fromRLPSerializedBlock(toBuffer(testData.genesisRLP)) await blockchain.putBlock(genesisBlock) - st.doesNotThrow(async () => { + try { await block.validate(blockchain) - st.end() - }) + st.pass('should pass') + } catch (error: any) { + st.fail('should not throw') + } }) t.test('should test block validation on poa chain', async function (st) { @@ -133,7 +196,6 @@ tape('[Block]: block functions', function (t) { } catch (error: any) { st.fail('error thrown') } - st.end() }) async function testTransactionValidation(st: tape.Test, block: Block) { @@ -142,7 +204,7 @@ tape('[Block]: block functions', function (t) { } t.test('should test transaction validation', async function (st) { - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { freeze: false }) await testTransactionValidation(st, block) ;(block.header as any).transactionsTrie = Buffer.alloc(32) @@ -152,18 +214,16 @@ tape('[Block]: block functions', function (t) { } catch (error: any) { st.equal(error.message, 'invalid transaction trie') } - st.end() }) t.test('should test transaction validation with empty transaction list', async function (st) { const block = Block.fromBlockData({}) await testTransactionValidation(st, block) - st.end() }) t.test('should test transaction validation with legacy tx in london', async function (st) { const common = new Common({ chain: Chain.Goerli, hardfork: Hardfork.London }) - const blockRlp = testData.blocks[0].rlp + const blockRlp = toBuffer(testData.blocks[0].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { common, freeze: false }) await testTransactionValidation(st, block) ;(block.transactions[0] as any).gasPrice = new BN(0) @@ -172,12 +232,10 @@ tape('[Block]: block functions', function (t) { result[0].includes('tx unable to pay base fee (non EIP-1559 tx)'), 'should throw when legacy tx is unable to pay base fee' ) - st.end() }) - const testData2 = require('./testdata/testdata2.json') t.test('should test uncles hash validation', async function (st) { - const blockRlp = testData2.blocks[2].rlp + const blockRlp = toBuffer(testData2.blocks[2].rlp) const block = Block.fromRLPSerializedBlock(blockRlp, { freeze: false }) st.equal(block.validateUnclesHash(), true) ;(block.header as any).uncleHash = Buffer.alloc(32) @@ -187,7 +245,6 @@ tape('[Block]: block functions', function (t) { } catch (error: any) { st.equal(error.message, 'invalid uncle hash') } - st.end() }) t.test('should throw if an uncle is listed twice', async function (st) { @@ -211,7 +268,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws if the uncle is included twice in the block') } - st.end() }) t.test('should throw if an uncle is included before', async function (st) { @@ -242,7 +298,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws if uncle is already included') } - st.end() }) t.test( @@ -278,7 +333,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws if uncle parent hash is not part of the canonical chain') } - st.end() } ) @@ -305,7 +359,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws uncle is too old') } - st.end() }) t.test('should throw if uncle is too young', async function (st) { @@ -326,7 +379,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws uncle is too young') } - st.end() }) t.test('should throw if the uncle header is invalid', async function (st) { @@ -358,7 +410,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws uncle header is invalid') } - st.end() }) t.test('throws if more than 2 uncles included', async function (st) { @@ -398,7 +449,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws if more than 2 uncles are included') } - st.end() }) t.test('throws if uncle is a canonical block', async function (st) { @@ -419,7 +469,6 @@ tape('[Block]: block functions', function (t) { } catch (e: any) { st.pass('block throws if an uncle is a canonical block') } - st.end() }) t.test('successfully validates uncles', async function (st) { @@ -440,8 +489,6 @@ tape('[Block]: block functions', function (t) { await block1.validate(blockchain) await block2.validate(blockchain) st.pass('uncle blocks validated succesfully') - - st.end() }) t.test( @@ -556,7 +603,6 @@ tape('[Block]: block functions', function (t) { } st.ok(common.hardfork() === 'london', 'validation did not change common hardfork') - st.end() } ) @@ -577,14 +623,15 @@ tape('[Block]: block functions', function (t) { st.end() }) - const testDataGenesis = require('./testdata/genesishashestest.json').test t.test('should test genesis hashes (mainnet default)', function (st) { const genesis = Block.genesis() const genesisRlp = genesis.serialize() - st.strictEqual(genesisRlp.toString('hex'), testDataGenesis.genesis_rlp_hex, 'rlp hex match') - st.strictEqual( - genesis.hash().toString('hex'), - testDataGenesis.genesis_hash, + st.ok( + genesisRlp.equals(Buffer.from(testDataGenesis.test.genesis_rlp_hex, 'hex')), + 'rlp hex match' + ) + st.ok( + genesis.hash().equals(Buffer.from(testDataGenesis.test.genesis_hash, 'hex')), 'genesis hash match' ) st.end() @@ -593,34 +640,25 @@ tape('[Block]: block functions', function (t) { t.test('should test genesis hashes (ropsten)', function (st) { const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Chainstart }) const genesis = Block.genesis({}, { common }) - st.strictEqual( - genesis.hash().toString('hex'), - common.genesis().hash.slice(2), - 'genesis hash match' - ) + st.ok(genesis.hash().equals(toBuffer(common.genesis().hash)), 'genesis hash match') st.end() }) t.test('should test genesis hashes (rinkeby)', function (st) { const common = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.Chainstart }) const genesis = Block.genesis({}, { common }) - st.strictEqual( - genesis.hash().toString('hex'), - common.genesis().hash.slice(2), - 'genesis hash match' - ) + st.ok(genesis.hash().equals(toBuffer(common.genesis().hash)), 'genesis hash match') st.end() }) t.test('should test genesis parameters (ropsten)', function (st) { const common = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Chainstart }) const genesis = Block.genesis({}, { common }) - const ropstenStateRoot = '217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b' - st.strictEqual( - genesis.header.stateRoot.toString('hex'), - ropstenStateRoot, - 'genesis stateRoot match' + const ropstenStateRoot = Buffer.from( + '217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b', + 'hex' ) + st.ok(genesis.header.stateRoot.equals(ropstenStateRoot), 'genesis stateRoot match') st.end() }) @@ -635,14 +673,14 @@ tape('[Block]: block functions', function (t) { }) t.test('should return the same block data from raw()', function (st) { - const block = Block.fromRLPSerializedBlock(testData2.blocks[2].rlp) + const block = Block.fromRLPSerializedBlock(toBuffer(testData2.blocks[2].rlp)) const blockFromRaw = Block.fromValuesArray(block.raw()) st.ok(block.hash().equals(blockFromRaw.hash())) st.end() }) t.test('should test toJSON', function (st) { - const block = Block.fromRLPSerializedBlock(testData2.blocks[2].rlp) + const block = Block.fromRLPSerializedBlock(toBuffer(testData2.blocks[2].rlp)) st.equal(typeof block.toJSON(), 'object') st.end() }) diff --git a/packages/block/test/testdata/testnetMerge.json b/packages/block/test/testdata/testnetMerge.json new file mode 100644 index 0000000000..2823c16c81 --- /dev/null +++ b/packages/block/test/testdata/testnetMerge.json @@ -0,0 +1,84 @@ +{ + "name": "testnetMerge", + "chainId": 55555, + "networkId": 55555, + "defaultHardfork": "istanbul", + "consensus": { + "type": "poa", + "algorithm": "clique", + "clique": { + "period": 15, + "epoch": 30000 + } + }, + "comment": "Private test network", + "url": "[TESTNET_URL]", + "genesis": { + "hash": "0xaa00000000000000000000000000000000000000000000000000000000000000", + "timestamp": null, + "gasLimit": 1000000, + "difficulty": 1, + "nonce": "0xbb00000000000000", + "extraData": "0xcc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xdd00000000000000000000000000000000000000000000000000000000000000" + }, + "hardforks": [ + { + "name": "chainstart", + "block": 0 + }, + { + "name": "homestead", + "block": 1 + }, + { + "name": "tangerineWhistle", + "block": 2 + }, + { + "name": "spuriousDragon", + "block": 3 + }, + { + "name": "istanbul", + "block": 8 + }, + { + "name": "muirGlacier", + "block": 10 + }, + { + "name": "berlin", + "block": 12 + }, + { + "name": "london", + "block": 14 + }, + { + "name": "merge", + "block": null, + "td": 5000 + }, + { + "name": "shanghai", + "block": null + } + ], + "bootstrapNodes": [ + { + "ip": "10.0.0.1", + "port": 30303, + "id": "11000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + }, + { + "ip": "10.0.0.2", + "port": 30303, + "id": "22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + } + ] +} diff --git a/packages/block/tsconfig.json b/packages/block/tsconfig.json index 35752954e2..ec77a108e2 100644 --- a/packages/block/tsconfig.json +++ b/packages/block/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../config/tsconfig.json", - "include": ["src/**/*.ts", "test/**/*.ts"], + "include": ["src/**/*.ts", "test/**/*.ts"] } diff --git a/packages/blockchain/CHANGELOG.md b/packages/blockchain/CHANGELOG.md index fe833b87bc..9ff25e6031 100644 --- a/packages/blockchain/CHANGELOG.md +++ b/packages/blockchain/CHANGELOG.md @@ -6,14 +6,31 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 5.4.2 - 2021-09-28 -# 5.4.0 - 2021-07-08 +- Fixed a bug not initializing the HF correctly when run on a custom chain with the `london` HF happening on block 0 or 1, PR [#1492](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1492) + +## 5.4.1 - 2021-09-24 + +### Experimental Casper/PoS and Merge Support + +This release adds first experimental Casper/PoS respectively Merge HF support by allowing to build a blockchain which switches to Casper/PoS consensus validation at some point triggered by a merge HF occurred. The `Blockchain` library now allows for taking in the respective Casper/PoS conforming blocks (see `@ethereumjs/block` release v3.5.0), do the correct validations and set the HF accordingly (Merge HF-related logic and a new PoS consensus type have been added to the `Common` library along with the v2.5.0 release). + +See: PR [#1408](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1408) + +### Other Changes + +- Added new `Blockchain.cliqueSignerInTurn()` method, PR [#1444](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1444) +- Added new `Blockchain.copy()` method, PR [#1444](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1444) +- Added browser tests, PR [#1380](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1380) + +## 5.4.0 - 2021-07-08 ### Finalized London HF Support This release integrates a `Common` library version which provides the `london` HF blocks for all networks including `mainnet` and is therefore the first release with finalized London HF support. -# 5.3.1 - 2021-06-25 +## 5.3.1 - 2021-06-25 ### PoA Reorg Fix @@ -104,7 +121,7 @@ npm i @ethereumjs/blockchain ### Library Promisification -The `Blockchain` library has been promisified and callbacks have been removed along PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceeding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779). +The `Blockchain` library has been promisified and callbacks have been removed along PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779). Old API example: @@ -236,7 +253,7 @@ npm i @ethereumjs/blockchain ### Library Promisification The `Blockchain` library has been promisified and callbacks have been removed along -PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceeding PR +PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779). Old API example: diff --git a/packages/blockchain/README.md b/packages/blockchain/README.md index abf4efc825..4623619c15 100644 --- a/packages/blockchain/README.md +++ b/packages/blockchain/README.md @@ -9,7 +9,7 @@ | A module to store and interact with blocks. | | --- | -Note: this `README` reflects the state of the library from `v5.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-blockchain) for an introduction on the last preceeding release. +Note: this `README` reflects the state of the library from `v5.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-blockchain) for an introduction on the last preceding release. # INSTALL diff --git a/packages/blockchain/docs/.nojekyll b/packages/blockchain/docs/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/packages/blockchain/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/packages/blockchain/docs/README.md b/packages/blockchain/docs/README.md index 77e694d0f3..b7d9db52d8 100644 --- a/packages/blockchain/docs/README.md +++ b/packages/blockchain/docs/README.md @@ -10,5 +10,5 @@ ### Interfaces -- [BlockchainInterface](interfaces/blockchaininterface.md) -- [BlockchainOptions](interfaces/blockchainoptions.md) +- [BlockchainInterface](interfaces/BlockchainInterface.md) +- [BlockchainOptions](interfaces/BlockchainOptions.md) diff --git a/packages/blockchain/docs/classes/default.md b/packages/blockchain/docs/classes/default.md index 4b5052a7e9..effe03e4e9 100644 --- a/packages/blockchain/docs/classes/default.md +++ b/packages/blockchain/docs/classes/default.md @@ -6,7 +6,7 @@ This class stores and interacts with blocks. ## Implements -- [*BlockchainInterface*](../interfaces/blockchaininterface.md) +- [`BlockchainInterface`](../interfaces/BlockchainInterface.md) ## Table of contents @@ -28,6 +28,8 @@ This class stores and interacts with blocks. ### Methods - [cliqueActiveSigners](default.md#cliqueactivesigners) +- [cliqueSignerInTurn](default.md#cliquesignerinturn) +- [copy](default.md#copy) - [delBlock](default.md#delblock) - [getBlock](default.md#getblock) - [getBlocks](default.md#getblocks) @@ -52,93 +54,147 @@ This class stores and interacts with blocks. ### constructor -\+ **new default**(`opts?`: [*BlockchainOptions*](../interfaces/blockchainoptions.md)): [*default*](default.md) +• **new default**(`opts?`) Creates new Blockchain object **`deprecated`** - The direct usage of this constructor is discouraged since non-finalized async initialization might lead to side effects. Please -use the async `Blockchain.create()` constructor instead (same API). +use the async {@link Blockchain.create} constructor instead (same API). #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `opts` | [*BlockchainOptions*](../interfaces/blockchainoptions.md) | {} | An object with the options that this constructor takes. See [BlockchainOptions](../interfaces/blockchainoptions.md). | +| Name | Type | Description | +| :------ | :------ | :------ | +| `opts` | [`BlockchainOptions`](../interfaces/BlockchainOptions.md) | An object with the options that this constructor takes. See [BlockchainOptions](../interfaces/BlockchainOptions.md). | -**Returns:** [*default*](default.md) +#### Defined in -Defined in: [index.ts:228](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L228) +[index.ts:245](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L245) ## Properties ### \_ethash -• `Optional` **\_ethash**: *default* +• `Optional` **\_ethash**: `default` + +#### Defined in -Defined in: [index.ts:147](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L147) +[index.ts:152](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L152) ___ ### db -• **db**: *LevelUp*, AbstractIterator\> +• **db**: `LevelUp`<`AbstractLevelDOWN`<`any`, `any`\>, `AbstractIterator`<`any`, `any`\>\> + +#### Defined in -Defined in: [index.ts:123](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L123) +[index.ts:128](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L128) ___ ### dbManager -• **dbManager**: *DBManager* +• **dbManager**: `DBManager` -Defined in: [index.ts:124](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L124) +#### Defined in + +[index.ts:129](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L129) ___ ### initPromise -• **initPromise**: *Promise* +• **initPromise**: `Promise`<`void`\> + +#### Defined in -Defined in: [index.ts:139](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L139) +[index.ts:144](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L144) ## Accessors ### meta -• get **meta**(): *object* +• `get` **meta**(): `Object` Returns an object with metadata about the Blockchain. It's defined for backwards compatibility. -**Returns:** *object* +#### Returns + +`Object` | Name | Type | | :------ | :------ | -| `genesis` | *undefined* \| *Buffer* | -| `heads` | *object* | -| `rawHead` | *undefined* \| *Buffer* | +| `genesis` | `undefined` \| `Buffer` | +| `heads` | `Object` | +| `rawHead` | `undefined` \| `Buffer` | -Defined in: [index.ts:298](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L298) +#### Defined in + +[index.ts:303](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L303) ## Methods ### cliqueActiveSigners -▸ **cliqueActiveSigners**(): *Address*[] +▸ **cliqueActiveSigners**(): `Address`[] Returns a list with the current block signers (only clique PoA, throws otherwise) -**Returns:** *Address*[] +#### Returns + +`Address`[] -Defined in: [index.ts:708](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L708) +#### Defined in + +[index.ts:721](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L721) + +___ + +### cliqueSignerInTurn + +▸ **cliqueSignerInTurn**(`signer`): `Promise`<`boolean`\> + +Helper to determine if a signer is in or out of turn for the next block. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `signer` | `Address` | The signer address | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[index.ts:1583](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1583) + +___ + +### copy + +▸ **copy**(): [`default`](default.md) + +Returns a deep copy of this {@link Blockchain} instance. + +#### Returns + +[`default`](default.md) + +#### Defined in + +[index.ts:314](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L314) ___ ### delBlock -▸ **delBlock**(`blockHash`: *Buffer*): *Promise* +▸ **delBlock**(`blockHash`): `Promise`<`void`\> Completely deletes a block from the blockchain including any references to this block. If this block was in the canonical chain, then also each child @@ -153,19 +209,25 @@ we can be sure it is correct). | Name | Type | Description | | :------ | :------ | :------ | -| `blockHash` | *Buffer* | The hash of the block to be deleted | +| `blockHash` | `Buffer` | The hash of the block to be deleted | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of -**Returns:** *Promise* +[BlockchainInterface](../interfaces/BlockchainInterface.md).[delBlock](../interfaces/BlockchainInterface.md#delblock) -Implementation of: [BlockchainInterface](../interfaces/blockchaininterface.md) +#### Defined in -Defined in: [index.ts:1135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1135) +[index.ts:1159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1159) ___ ### getBlock -▸ **getBlock**(`blockId`: *number* \| *Buffer* \| *BN*): *Promise* +▸ **getBlock**(`blockId`): `Promise`<`Block`\> Gets a block by its hash. @@ -173,19 +235,25 @@ Gets a block by its hash. | Name | Type | Description | | :------ | :------ | :------ | -| `blockId` | *number* \| *Buffer* \| *BN* | The block's hash or number. If a hash is provided, then this will be immediately looked up, otherwise it will wait until we have unlocked the DB | +| `blockId` | `number` \| `Buffer` \| `BN` | The block's hash or number. If a hash is provided, then this will be immediately looked up, otherwise it will wait until we have unlocked the DB | -**Returns:** *Promise* +#### Returns -Implementation of: [BlockchainInterface](../interfaces/blockchaininterface.md) +`Promise`<`Block`\> -Defined in: [index.ts:1018](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1018) +#### Implementation of + +[BlockchainInterface](../interfaces/BlockchainInterface.md).[getBlock](../interfaces/BlockchainInterface.md#getblock) + +#### Defined in + +[index.ts:1042](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1042) ___ ### getBlocks -▸ **getBlocks**(`blockId`: *number* \| *Buffer* \| *BN*, `maxBlocks`: *number*, `skip`: *number*, `reverse`: *boolean*): *Promise* +▸ **getBlocks**(`blockId`, `maxBlocks`, `skip`, `reverse`): `Promise`<`Block`[]\> Looks up many blocks relative to blockId Note: due to `GetBlockHeaders (0x03)` (ETH wire protocol) we have to support skip/reverse as well. @@ -194,91 +262,111 @@ Looks up many blocks relative to blockId Note: due to `GetBlockHeaders | Name | Type | Description | | :------ | :------ | :------ | -| `blockId` | *number* \| *Buffer* \| *BN* | The block's hash or number | -| `maxBlocks` | *number* | Max number of blocks to return | -| `skip` | *number* | Number of blocks to skip apart | -| `reverse` | *boolean* | Fetch blocks in reverse | +| `blockId` | `number` \| `Buffer` \| `BN` | The block's hash or number | +| `maxBlocks` | `number` | Max number of blocks to return | +| `skip` | `number` | Number of blocks to skip apart | +| `reverse` | `boolean` | Fetch blocks in reverse | + +#### Returns + +`Promise`<`Block`[]\> -**Returns:** *Promise* +#### Defined in -Defined in: [index.ts:1053](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1053) +[index.ts:1077](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1077) ___ ### getHead -▸ **getHead**(`name?`: *string*): *Promise* +▸ **getHead**(`name?`): `Promise`<`Block`\> Returns the specified iterator head. -**`deprecated`** use `getIteratorHead()` instead. Note that `getIteratorHead()` -doesn't return the `headHeader` but the genesis hash as an initial -iterator head value (now matching the behavior of the `iterator()` -method on a first run) +**`deprecated`** use {@link Blockchain.getIteratorHead} instead. +Note that {@link Blockchain.getIteratorHead} doesn't return +the `headHeader` but the genesis hash as an initial iterator +head value (now matching the behavior of {@link Blockchain.iterator} +on a first run) #### Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | -| `name` | *string* | 'vm' | Optional name of the iterator head (default: 'vm') | +| `name` | `string` | `'vm'` | Optional name of the iterator head (default: 'vm') | -**Returns:** *Promise* +#### Returns -Defined in: [index.ts:759](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L759) +`Promise`<`Block`\> + +#### Defined in + +[index.ts:775](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L775) ___ ### getIteratorHead -▸ **getIteratorHead**(`name?`: *string*): *Promise* +▸ **getIteratorHead**(`name?`): `Promise`<`Block`\> Returns the specified iterator head. -This function replaces the old `getHead()` method. Note that +This function replaces the old {@link Blockchain.getHead} method. Note that the function deviates from the old behavior and returns the genesis hash instead of the current head block if an iterator -has not been run. This matches the behavior of the `iterator()` -method. +has not been run. This matches the behavior of {@link Blockchain.iterator}. #### Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | -| `name` | *string* | 'vm' | Optional name of the iterator head (default: 'vm') | +| `name` | `string` | `'vm'` | Optional name of the iterator head (default: 'vm') | + +#### Returns -**Returns:** *Promise* +`Promise`<`Block`\> -Defined in: [index.ts:736](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L736) +#### Defined in + +[index.ts:751](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L751) ___ ### getLatestBlock -▸ **getLatestBlock**(): *Promise* +▸ **getLatestBlock**(): `Promise`<`Block`\> Returns the latest full block in the canonical chain. -**Returns:** *Promise* +#### Returns + +`Promise`<`Block`\> + +#### Defined in -Defined in: [index.ts:789](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L789) +[index.ts:804](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L804) ___ ### getLatestHeader -▸ **getLatestHeader**(): *Promise* +▸ **getLatestHeader**(): `Promise`<`BlockHeader`\> Returns the latest header in the canonical chain. -**Returns:** *Promise* +#### Returns -Defined in: [index.ts:775](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L775) +`Promise`<`BlockHeader`\> + +#### Defined in + +[index.ts:791](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L791) ___ ### getTotalDifficulty -▸ **getTotalDifficulty**(`hash`: *Buffer*, `number?`: *BN*): *Promise* +▸ **getTotalDifficulty**(`hash`, `number?`): `Promise`<`BN`\> Gets total difficulty for a block specified by hash and number @@ -286,44 +374,54 @@ Gets total difficulty for a block specified by hash and number | Name | Type | | :------ | :------ | -| `hash` | *Buffer* | -| `number?` | *BN* | +| `hash` | `Buffer` | +| `number?` | `BN` | + +#### Returns -**Returns:** *Promise* +`Promise`<`BN`\> -Defined in: [index.ts:1038](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1038) +#### Defined in + +[index.ts:1062](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1062) ___ ### iterator -▸ **iterator**(`name`: *string*, `onBlock`: OnBlock, `maxBlocks?`: *number*): *Promise* +▸ **iterator**(`name`, `onBlock`, `maxBlocks?`): `Promise`<`number`\> Iterates through blocks starting at the specified iterator head and calls the onBlock function on each block. The current location of an iterator -head can be retrieved using the `getHead()` method. +head can be retrieved using {@link Blockchain.getIteratorHead}. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `name` | *string* | Name of the state root head | -| `onBlock` | OnBlock | Function called on each block with params (block, reorg) | -| `maxBlocks?` | *number* | How many blocks to run. By default, run all unprocessed blocks in the canonical chain. | +| `name` | `string` | Name of the state root head | +| `onBlock` | `OnBlock` | Function called on each block with params (block, reorg) | +| `maxBlocks?` | `number` | How many blocks to run. By default, run all unprocessed blocks in the canonical chain. | + +#### Returns -**Returns:** *Promise* +`Promise`<`number`\> number of blocks actually iterated -Implementation of: [BlockchainInterface](../interfaces/blockchaininterface.md) +#### Implementation of -Defined in: [index.ts:1233](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1233) +[BlockchainInterface](../interfaces/BlockchainInterface.md).[iterator](../interfaces/BlockchainInterface.md#iterator) + +#### Defined in + +[index.ts:1257](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1257) ___ ### putBlock -▸ **putBlock**(`block`: *Block*): *Promise* +▸ **putBlock**(`block`): `Promise`<`void`\> Adds a block to the blockchain. @@ -335,19 +433,25 @@ heads/hashes are overwritten. | Name | Type | Description | | :------ | :------ | :------ | -| `block` | *Block* | The block to be added to the blockchain | +| `block` | `Block` | The block to be added to the blockchain | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of -**Returns:** *Promise* +[BlockchainInterface](../interfaces/BlockchainInterface.md).[putBlock](../interfaces/BlockchainInterface.md#putblock) -Implementation of: [BlockchainInterface](../interfaces/blockchaininterface.md) +#### Defined in -Defined in: [index.ts:824](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L824) +[index.ts:839](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L839) ___ ### putBlocks -▸ **putBlocks**(`blocks`: *Block*[]): *Promise* +▸ **putBlocks**(`blocks`): `Promise`<`void`\> Adds blocks to the blockchain. @@ -360,17 +464,21 @@ chain is rebuilt and any stale heads/hashes are overwritten. | Name | Type | Description | | :------ | :------ | :------ | -| `blocks` | *Block*[] | The blocks to be added to the blockchain | +| `blocks` | `Block`[] | The blocks to be added to the blockchain | -**Returns:** *Promise* +#### Returns -Defined in: [index.ts:809](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L809) +`Promise`<`void`\> + +#### Defined in + +[index.ts:824](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L824) ___ ### putHeader -▸ **putHeader**(`header`: *BlockHeader*): *Promise* +▸ **putHeader**(`header`): `Promise`<`void`\> Adds a header to the blockchain. @@ -382,17 +490,21 @@ heads/hashes are overwritten. | Name | Type | Description | | :------ | :------ | :------ | -| `header` | *BlockHeader* | The header to be added to the blockchain | +| `header` | `BlockHeader` | The header to be added to the blockchain | + +#### Returns -**Returns:** *Promise* +`Promise`<`void`\> -Defined in: [index.ts:853](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L853) +#### Defined in + +[index.ts:868](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L868) ___ ### putHeaders -▸ **putHeaders**(`headers`: *any*[]): *Promise* +▸ **putHeaders**(`headers`): `Promise`<`void`\> Adds many headers to the blockchain. @@ -405,17 +517,21 @@ chain is rebuilt and any stale heads/hashes are overwritten. | Name | Type | Description | | :------ | :------ | :------ | -| `headers` | *any*[] | The headers to be added to the blockchain | +| `headers` | `any`[] | The headers to be added to the blockchain | + +#### Returns -**Returns:** *Promise* +`Promise`<`void`\> -Defined in: [index.ts:838](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L838) +#### Defined in + +[index.ts:853](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L853) ___ ### safeNumberToHash -▸ **safeNumberToHash**(`number`: *BN*): *Promise*<``false`` \| Buffer\> +▸ **safeNumberToHash**(`number`): `Promise`<``false`` \| `Buffer`\> This method either returns a Buffer if there exists one in the DB or if it does not exist (DB throws a `NotFoundError`) then return false If DB throws @@ -425,17 +541,21 @@ any other error, this function throws. | Name | Type | | :------ | :------ | -| `number` | *BN* | +| `number` | `BN` | + +#### Returns + +`Promise`<``false`` \| `Buffer`\> -**Returns:** *Promise*<``false`` \| Buffer\> +#### Defined in -Defined in: [index.ts:1499](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1499) +[index.ts:1567](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1567) ___ ### selectNeededHashes -▸ **selectNeededHashes**(`hashes`: *Buffer*[]): *Promise* +▸ **selectNeededHashes**(`hashes`): `Promise`<`Buffer`[]\> Given an ordered array, returns an array of hashes that are not in the blockchain yet. Uses binary search to find out what hashes are missing. @@ -445,39 +565,47 @@ Therefore, the array needs to be ordered upon number. | Name | Type | Description | | :------ | :------ | :------ | -| `hashes` | *Buffer*[] | Ordered array of hashes (ordered on `number`). | +| `hashes` | `Buffer`[] | Ordered array of hashes (ordered on `number`). | -**Returns:** *Promise* +#### Returns -Defined in: [index.ts:1095](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1095) +`Promise`<`Buffer`[]\> + +#### Defined in + +[index.ts:1119](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1119) ___ ### setHead -▸ **setHead**(`tag`: *string*, `headHash`: *Buffer*): *Promise* +▸ **setHead**(`tag`, `headHash`): `Promise`<`void`\> Set header hash of a certain `tag`. When calling the iterator, the iterator will start running the first child block after the header hash currenntly stored. -**`deprecated`** use `setIteratorHead()` instead +**`deprecated`** use {@link Blockchain.setIteratorHead()} instead #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `tag` | *string* | The tag to save the headHash to | -| `headHash` | *Buffer* | The head hash to save | +| `tag` | `string` | The tag to save the headHash to | +| `headHash` | `Buffer` | The head hash to save | + +#### Returns -**Returns:** *Promise* +`Promise`<`void`\> -Defined in: [index.ts:1298](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1298) +#### Defined in + +[index.ts:1322](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1322) ___ ### setIteratorHead -▸ **setIteratorHead**(`tag`: *string*, `headHash`: *Buffer*): *Promise* +▸ **setIteratorHead**(`tag`, `headHash`): `Promise`<`void`\> Set header hash of a certain `tag`. When calling the iterator, the iterator will start running the first child block after the header hash currenntly stored. @@ -486,48 +614,60 @@ When calling the iterator, the iterator will start running the first child block | Name | Type | Description | | :------ | :------ | :------ | -| `tag` | *string* | The tag to save the headHash to | -| `headHash` | *Buffer* | The head hash to save | +| `tag` | `string` | The tag to save the headHash to | +| `headHash` | `Buffer` | The head hash to save | + +#### Returns + +`Promise`<`void`\> -**Returns:** *Promise* +#### Defined in -Defined in: [index.ts:1286](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1286) +[index.ts:1310](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L1310) ___ ### create -▸ `Static` **create**(`opts?`: [*BlockchainOptions*](../interfaces/blockchainoptions.md)): *Promise*<[*default*](default.md)\> +▸ `Static` **create**(`opts?`): `Promise`<[`default`](default.md)\> Safe creation of a new Blockchain object awaiting the initialization function, encouraged method to use when creating a blockchain object. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `opts` | [*BlockchainOptions*](../interfaces/blockchainoptions.md) | {} | Constructor options, see [BlockchainOptions](../interfaces/blockchainoptions.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `opts` | [`BlockchainOptions`](../interfaces/BlockchainOptions.md) | Constructor options, see [BlockchainOptions](../interfaces/BlockchainOptions.md) | + +#### Returns -**Returns:** *Promise*<[*default*](default.md)\> +`Promise`<[`default`](default.md)\> -Defined in: [index.ts:203](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L203) +#### Defined in + +[index.ts:208](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L208) ___ ### fromBlocksData -▸ `Static` **fromBlocksData**(`blocksData`: BlockData[], `opts?`: [*BlockchainOptions*](../interfaces/blockchainoptions.md)): *Promise*<[*default*](default.md)\> +▸ `Static` **fromBlocksData**(`blocksData`, `opts?`): `Promise`<[`default`](default.md)\> Creates a blockchain from a list of block objects, -objects must be readable by the `Block.fromBlockData()` method +objects must be readable by {@link Block.fromBlockData} #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `blocksData` | BlockData[] | - | - | -| `opts` | [*BlockchainOptions*](../interfaces/blockchainoptions.md) | {} | Constructor options, see [BlockchainOptions](../interfaces/blockchainoptions.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `blocksData` | `BlockData`[] | - | +| `opts` | [`BlockchainOptions`](../interfaces/BlockchainOptions.md) | Constructor options, see [BlockchainOptions](../interfaces/BlockchainOptions.md) | + +#### Returns + +`Promise`<[`default`](default.md)\> -**Returns:** *Promise*<[*default*](default.md)\> +#### Defined in -Defined in: [index.ts:218](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L218) +[index.ts:223](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L223) diff --git a/packages/blockchain/docs/interfaces/blockchaininterface.md b/packages/blockchain/docs/interfaces/blockchaininterface.md index eb548a3f9b..ae2dd5d9fb 100644 --- a/packages/blockchain/docs/interfaces/blockchaininterface.md +++ b/packages/blockchain/docs/interfaces/blockchaininterface.md @@ -4,22 +4,22 @@ ## Implemented by -- [*default*](../classes/default.md) +- [`default`](../classes/default.md) ## Table of contents ### Methods -- [delBlock](blockchaininterface.md#delblock) -- [getBlock](blockchaininterface.md#getblock) -- [iterator](blockchaininterface.md#iterator) -- [putBlock](blockchaininterface.md#putblock) +- [delBlock](BlockchainInterface.md#delblock) +- [getBlock](BlockchainInterface.md#getblock) +- [iterator](BlockchainInterface.md#iterator) +- [putBlock](BlockchainInterface.md#putblock) ## Methods ### delBlock -▸ **delBlock**(`blockHash`: *Buffer*): *Promise* +▸ **delBlock**(`blockHash`): `Promise`<`void`\> Deletes a block from the blockchain. All child blocks in the chain are deleted and any encountered heads are set to the parent block. @@ -28,17 +28,21 @@ deleted and any encountered heads are set to the parent block. | Name | Type | Description | | :------ | :------ | :------ | -| `blockHash` | *Buffer* | The hash of the block to be deleted | +| `blockHash` | `Buffer` | The hash of the block to be deleted | -**Returns:** *Promise* +#### Returns -Defined in: [index.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L42) +`Promise`<`void`\> + +#### Defined in + +[index.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L43) ___ ### getBlock -▸ **getBlock**(`blockId`: *number* \| *Buffer* \| *BN*): *Promise*<``null`` \| Block\> +▸ **getBlock**(`blockId`): `Promise`<``null`` \| `Block`\> Returns a block by its hash or number. @@ -46,17 +50,21 @@ Returns a block by its hash or number. | Name | Type | | :------ | :------ | -| `blockId` | *number* \| *Buffer* \| *BN* | +| `blockId` | `number` \| `Buffer` \| `BN` | + +#### Returns + +`Promise`<``null`` \| `Block`\> -**Returns:** *Promise*<``null`` \| Block\> +#### Defined in -Defined in: [index.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L47) +[index.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L48) ___ ### iterator -▸ **iterator**(`name`: *string*, `onBlock`: OnBlock): *Promise* +▸ **iterator**(`name`, `onBlock`): `Promise`<`number` \| `void`\> Iterates through blocks starting at the specified iterator head and calls the onBlock function on each block. @@ -65,18 +73,22 @@ the onBlock function on each block. | Name | Type | Description | | :------ | :------ | :------ | -| `name` | *string* | Name of the state root head | -| `onBlock` | OnBlock | Function called on each block with params (block: Block, reorg: boolean) | +| `name` | `string` | Name of the state root head | +| `onBlock` | `OnBlock` | Function called on each block with params (block: Block, reorg: boolean) | -**Returns:** *Promise* +#### Returns -Defined in: [index.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L57) +`Promise`<`number` \| `void`\> + +#### Defined in + +[index.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L58) ___ ### putBlock -▸ **putBlock**(`block`: *Block*): *Promise* +▸ **putBlock**(`block`): `Promise`<`void`\> Adds a block to the blockchain. @@ -84,8 +96,12 @@ Adds a block to the blockchain. | Name | Type | Description | | :------ | :------ | :------ | -| `block` | *Block* | The block to be added to the blockchain. | +| `block` | `Block` | The block to be added to the blockchain. | + +#### Returns + +`Promise`<`void`\> -**Returns:** *Promise* +#### Defined in -Defined in: [index.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L34) +[index.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L35) diff --git a/packages/blockchain/docs/interfaces/blockchainoptions.md b/packages/blockchain/docs/interfaces/blockchainoptions.md index 8fd546d7a7..e76493d446 100644 --- a/packages/blockchain/docs/interfaces/blockchainoptions.md +++ b/packages/blockchain/docs/interfaces/blockchainoptions.md @@ -8,30 +8,32 @@ This are the options that the Blockchain constructor can receive. ### Properties -- [common](blockchainoptions.md#common) -- [db](blockchainoptions.md#db) -- [genesisBlock](blockchainoptions.md#genesisblock) -- [hardforkByHeadBlockNumber](blockchainoptions.md#hardforkbyheadblocknumber) -- [validateBlocks](blockchainoptions.md#validateblocks) -- [validateConsensus](blockchainoptions.md#validateconsensus) +- [common](BlockchainOptions.md#common) +- [db](BlockchainOptions.md#db) +- [genesisBlock](BlockchainOptions.md#genesisblock) +- [hardforkByHeadBlockNumber](BlockchainOptions.md#hardforkbyheadblocknumber) +- [validateBlocks](BlockchainOptions.md#validateblocks) +- [validateConsensus](BlockchainOptions.md#validateconsensus) ## Properties ### common -• `Optional` **common**: *default* +• `Optional` **common**: `default` -Specify the chain and hardfork by passing a Common instance. +Specify the chain and hardfork by passing a {@link Common} instance. If not provided this defaults to chain `mainnet` and hardfork `chainstart` -Defined in: [index.ts:70](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L70) +#### Defined in + +[index.ts:71](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L71) ___ ### db -• `Optional` **db**: *LevelUp*, AbstractIterator\> +• `Optional` **db**: `LevelUp`<`AbstractLevelDOWN`<`any`, `any`\>, `AbstractIterator`<`any`, `any`\>\> Database to store blocks and metadata. Should be an `abstract-leveldown` compliant store @@ -41,13 +43,15 @@ For example: or use the `level` convenience package: `level('./db1')` -Defined in: [index.ts:88](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L88) +#### Defined in + +[index.ts:93](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L93) ___ ### genesisBlock -• `Optional` **genesisBlock**: *Block* +• `Optional` **genesisBlock**: `Block` The blockchain only initializes succesfully if it has a genesis block. If there is no block available in the DB and a `genesisBlock` is provided, @@ -55,37 +59,47 @@ then the provided `genesisBlock` will be used as genesis. If no block is present in the DB and no block is provided, then the genesis block as provided from the `common` will be used. -Defined in: [index.ts:116](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L116) +#### Defined in + +[index.ts:121](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L121) ___ ### hardforkByHeadBlockNumber -• `Optional` **hardforkByHeadBlockNumber**: *boolean* +• `Optional` **hardforkByHeadBlockNumber**: `boolean` + +Set the HF to the fork determined by the head block and update on head updates. -Set the HF to the fork determined by the head block and update on head updates +Note: for HFs where the transition is also determined by a total difficulty +threshold (merge HF) the calculated TD is additionally taken into account +for HF determination. -Default: `false` (HF is set to whatever default HF is set by the Common instance) +Default: `false` (HF is set to whatever default HF is set by the {@link Common} instance) -Defined in: [index.ts:77](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L77) +#### Defined in + +[index.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L82) ___ ### validateBlocks -• `Optional` **validateBlocks**: *boolean* +• `Optional` **validateBlocks**: `boolean` This flag indicates if protocol-given consistency checks on block headers and included uncles and transactions should be performed, see Block#validate for details. -Defined in: [index.ts:107](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L107) +#### Defined in + +[index.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L112) ___ ### validateConsensus -• `Optional` **validateConsensus**: *boolean* +• `Optional` **validateConsensus**: `boolean` This flags indicates if a block should be validated along the consensus algorithm or protocol used by the chain, e.g. by verifying the PoW on the block. @@ -95,4 +109,6 @@ Supported consensus types and algorithms (taken from the `Common` instance): - 'poa' with 'clique' algorithm (verifies the block signatures) Default: `true`. -Defined in: [index.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L99) +#### Defined in + +[index.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/index.ts#L104) diff --git a/packages/blockchain/package.json b/packages/blockchain/package.json index ec080b3150..8b50dce83b 100644 --- a/packages/blockchain/package.json +++ b/packages/blockchain/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/blockchain", - "version": "5.4.0", + "version": "5.4.2", "description": "A module to store and interact with blocks", "license": "MPL-2.0", "keywords": [ @@ -16,7 +16,7 @@ "types": "dist/index.d.ts", "browser": "dist.browser/index.js", "scripts": { - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", @@ -35,11 +35,11 @@ }, "author": "mjbecze ", "dependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/ethash": "^1.0.0", + "@ethereumjs/block": "^3.5.1", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/ethash": "^1.1.0", "debug": "^2.2.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", "rlp": "^2.2.4", @@ -49,7 +49,7 @@ "@types/async": "^2.4.1", "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -58,8 +58,8 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", - "typedoc": "^0.21.5", + "tape": "^5.3.1", + "typedoc": "^0.22.4", "ts-node": "^10.2.1", "typescript": "^4.4.2" }, diff --git a/packages/blockchain/src/db/manager.ts b/packages/blockchain/src/db/manager.ts index 31eabbff2c..77ced3393c 100644 --- a/packages/blockchain/src/db/manager.ts +++ b/packages/blockchain/src/db/manager.ts @@ -1,12 +1,6 @@ import * as rlp from 'rlp' import { Address, BN } from 'ethereumjs-util' -import { - Block, - BlockHeader, - BlockBuffer, - BlockHeaderBuffer, - BlockBodyBuffer, -} from '@ethereumjs/block' +import { Block, BlockHeader, BlockBuffer, BlockBodyBuffer } from '@ethereumjs/block' import Common from '@ethereumjs/common' import { CliqueLatestSignerStates, CliqueLatestVotes, CliqueLatestBlockSigners } from '../clique' import Cache from './cache' @@ -157,7 +151,7 @@ export class DBManager { throw new Error('Unknown blockId type') } - const header: BlockHeaderBuffer = (await this.getHeader(hash, number)).raw() + const header = await this.getHeader(hash, number) let body: BlockBodyBuffer = [[], []] try { body = await this.getBody(hash, number) @@ -166,8 +160,12 @@ export class DBManager { throw error } } - const blockData = [header, ...body] as BlockBuffer - const opts = { common: this._common, hardforkByBlockNumber: true } + const blockData = [header.raw(), ...body] as BlockBuffer + let parentTd + if (!number.eqn(0)) { + parentTd = await this.getTotalDifficulty(header.parentHash, number.subn(1)) + } + const opts = { common: this._common, hardforkByTD: parentTd } return Block.fromValuesArray(blockData, opts) } @@ -184,7 +182,12 @@ export class DBManager { */ async getHeader(blockHash: Buffer, blockNumber: BN) { const encodedHeader = await this.get(DBTarget.Header, { blockHash, blockNumber }) - const opts = { common: this._common, hardforkByBlockNumber: true } + let parentTd + if (!blockNumber.eqn(0)) { + const parentHash = await this.numberToHash(blockNumber.subn(1)) + parentTd = await this.getTotalDifficulty(parentHash, blockNumber.subn(1)) + } + const opts = { common: this._common, hardforkByTD: parentTd } return BlockHeader.fromRLPSerializedHeader(encodedHeader, opts) } diff --git a/packages/blockchain/src/index.ts b/packages/blockchain/src/index.ts index 3519f50a44..179613e3a6 100644 --- a/packages/blockchain/src/index.ts +++ b/packages/blockchain/src/index.ts @@ -71,7 +71,11 @@ export interface BlockchainOptions { common?: Common /** - * Set the HF to the fork determined by the head block and update on head updates + * Set the HF to the fork determined by the head block and update on head updates. + * + * Note: for HFs where the transition is also determined by a total difficulty + * threshold (merge HF) the calculated TD is additionally taken into account + * for HF determination. * * Default: `false` (HF is set to whatever default HF is set by the {@link Common} instance) */ @@ -304,6 +308,13 @@ export default class Blockchain implements BlockchainInterface { } } + /** + * Returns a deep copy of this {@link Blockchain} instance. + */ + copy(): Blockchain { + return Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)) + } + /** * This method is called in the constructor and either sets up the DB or reads * values from the DB and makes these available to the consumers of @@ -324,7 +335,7 @@ export default class Blockchain implements BlockchainInterface { if (!genesisBlock) { const common = this._common.copy() - common.setHardfork(Hardfork.Chainstart) + common.setHardforkByBlockNumber(0) genesisBlock = Block.genesis({}, { common }) } @@ -399,7 +410,8 @@ export default class Blockchain implements BlockchainInterface { } if (this._hardforkByHeadBlockNumber) { const latestHeader = await this._getHeader(this._headHeaderHash) - this._common.setHardforkByBlockNumber(latestHeader.number) + const td = await this.getTotalDifficulty(this._headHeaderHash) + this._common.setHardforkByBlockNumber(latestHeader.number, td) } } @@ -709,6 +721,9 @@ export default class Blockchain implements BlockchainInterface { public cliqueActiveSigners(): Address[] { this._requireClique() const signers = this._cliqueLatestSignerStates + if (signers.length === 0) { + return [] + } return [...signers[signers.length - 1][1]] } @@ -872,8 +887,7 @@ export default class Blockchain implements BlockchainInterface { const block = item instanceof BlockHeader ? new Block(item, undefined, undefined, { - common: this._common, - hardforkByBlockNumber: true, + common: item._common, }) : item const isGenesis = block.isGenesis() @@ -938,25 +952,23 @@ export default class Blockchain implements BlockchainInterface { } } - if (block._common.consensusType() !== ConsensusType.ProofOfStake) { - // set total difficulty in the current context scope - if (this._headHeaderHash) { - currentTd.header = await this.getTotalDifficulty(this._headHeaderHash) - } - if (this._headBlockHash) { - currentTd.block = await this.getTotalDifficulty(this._headBlockHash) - } - - // calculate the total difficulty of the new block - let parentTd = new BN(0) - if (!block.isGenesis()) { - parentTd = await this.getTotalDifficulty(header.parentHash, blockNumber.subn(1)) - } - td.iadd(parentTd) + // set total difficulty in the current context scope + if (this._headHeaderHash) { + currentTd.header = await this.getTotalDifficulty(this._headHeaderHash) + } + if (this._headBlockHash) { + currentTd.block = await this.getTotalDifficulty(this._headBlockHash) + } - // save total difficulty to the database - dbOps = dbOps.concat(DBSetTD(td, blockNumber, blockHash)) + // calculate the total difficulty of the new block + let parentTd = new BN(0) + if (!block.isGenesis()) { + parentTd = await this.getTotalDifficulty(header.parentHash, blockNumber.subn(1)) } + td.iadd(parentTd) + + // save total difficulty to the database + dbOps = dbOps.concat(DBSetTD(td, blockNumber, blockHash)) // save header/block to the database dbOps = dbOps.concat(DBSetBlockOrHeader(block)) @@ -977,7 +989,7 @@ export default class Blockchain implements BlockchainInterface { this._headBlockHash = blockHash } if (this._hardforkByHeadBlockNumber) { - this._common.setHardforkByBlockNumber(blockNumber) + this._common.setHardforkByBlockNumber(blockNumber, td) } // TODO SET THIS IN CONSTRUCTOR @@ -1458,14 +1470,14 @@ export default class Blockchain implements BlockchainInterface { const blockHash = header.hash() const blockNumber = header.number - DBSaveLookups(blockHash, blockNumber).map((op) => { - ops.push(op) - }) - if (blockNumber.isZero()) { break } + DBSaveLookups(blockHash, blockNumber).map((op) => { + ops.push(op) + }) + // mark each key `_heads` which is currently set to the hash in the DB as // stale to overwrite this later. Object.keys(this._heads).forEach((name) => { @@ -1478,9 +1490,8 @@ export default class Blockchain implements BlockchainInterface { staleHeadBlock = true } - currentNumber.isubn(1) try { - header = await this._getHeader(header.parentHash, currentNumber) + header = await this._getHeader(header.parentHash, currentNumber.isubn(1)) } catch (error: any) { staleHeads = [] if (error.type !== 'NotFoundError') { @@ -1564,4 +1575,18 @@ export default class Blockchain implements BlockchainInterface { return false } } + + /** + * Helper to determine if a signer is in or out of turn for the next block. + * @param signer The signer address + */ + async cliqueSignerInTurn(signer: Address): Promise { + const signers = this.cliqueActiveSigners() + const signerIndex = signers.findIndex((address) => address.equals(signer)) + if (signerIndex === -1) { + throw new Error('Signer not found') + } + const { number } = await this.getLatestHeader() + return number.addn(1).mod(new BN(signers.length)).eqn(signerIndex) + } } diff --git a/packages/blockchain/test/clique.spec.ts b/packages/blockchain/test/clique.spec.ts index 5f4a1232c9..3fa71bfb36 100644 --- a/packages/blockchain/test/clique.spec.ts +++ b/packages/blockchain/test/clique.spec.ts @@ -1,5 +1,5 @@ import { Block } from '@ethereumjs/block' -import Common, { Chain, Hardfork } from '@ethereumjs/common' +import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '@ethereumjs/common' import { Address, BN } from 'ethereumjs-util' import tape from 'tape' import Blockchain from '../src' @@ -538,8 +538,8 @@ tape('Clique: Initialization', (t) => { 'rinkeby', { consensus: { - type: 'poa', - algorithm: 'clique', + type: ConsensusType.ProofOfAuthority, + algorithm: ConsensusAlgorithm.Clique, clique: { period: 15, epoch: 3, @@ -601,8 +601,8 @@ tape('Clique: Initialization', (t) => { 'rinkeby', { consensus: { - type: 'poa', - algorithm: 'clique', + type: ConsensusType.ProofOfAuthority, + algorithm: ConsensusAlgorithm.Clique, clique: { period: 15, epoch: 3, @@ -628,4 +628,29 @@ tape('Clique: Initialization', (t) => { st.end() } ) + + t.test('cliqueSignerInTurn() -> should work as expected', async (st) => { + const { blocks, blockchain } = await initWithSigners([A, B, C]) + // block 1: B, next signer: C + await addNextBlock(blockchain, blocks, B) + st.notOk(await blockchain.cliqueSignerInTurn(A.address)) + st.notOk(await blockchain.cliqueSignerInTurn(B.address)) + st.ok(await blockchain.cliqueSignerInTurn(C.address)) + // block 2: C, next signer: A + await addNextBlock(blockchain, blocks, C) + st.ok(await blockchain.cliqueSignerInTurn(A.address)) + st.notOk(await blockchain.cliqueSignerInTurn(B.address)) + st.notOk(await blockchain.cliqueSignerInTurn(C.address)) + // block 3: A, next signer: B + await addNextBlock(blockchain, blocks, A) + st.notOk(await blockchain.cliqueSignerInTurn(A.address)) + st.ok(await blockchain.cliqueSignerInTurn(B.address)) + st.notOk(await blockchain.cliqueSignerInTurn(C.address)) + // block 4: B, next signer: C + await addNextBlock(blockchain, blocks, B) + st.notOk(await blockchain.cliqueSignerInTurn(A.address)) + st.notOk(await blockchain.cliqueSignerInTurn(B.address)) + st.ok(await blockchain.cliqueSignerInTurn(C.address)) + st.end() + }) }) diff --git a/packages/blockchain/test/pos.spec.ts b/packages/blockchain/test/pos.spec.ts index 00033f52eb..1230386a39 100644 --- a/packages/blockchain/test/pos.spec.ts +++ b/packages/blockchain/test/pos.spec.ts @@ -31,7 +31,7 @@ const buildChain = async (blockchain: Blockchain, common: Common, height: number { calcDifficultyFromHeader: blocks[number - 1].header, common, - hardforkByBlockNumber: true, + hardforkByTD: await blockchain.getTotalDifficulty(blocks[number - 1].hash()), } ) blocks.push(block) @@ -40,39 +40,67 @@ const buildChain = async (blockchain: Blockchain, common: Common, height: number } tape('Proof of Stake - inserting blocks into blockchain', async (t) => { - const common = new Common({ chain: testnet, hardfork: Hardfork.Chainstart }) - const blockchain = await Blockchain.create({ - validateBlocks: true, - validateConsensus: false, - common, - hardforkByHeadBlockNumber: true, - }) - const genesisHeader = await blockchain.getLatestHeader() + const testnetOnlyTD = JSON.parse(JSON.stringify(testnet)) + testnetOnlyTD['hardforks'][11] = { + name: 'merge', + td: 1313600, + block: null, + } + const scenarios = [ + { + common: new Common({ chain: testnet, hardfork: Hardfork.Chainstart }), + }, + { + common: new Common({ chain: testnetOnlyTD, hardfork: Hardfork.Chainstart }), + }, + ] - t.equal( - genesisHeader.hash().toString('hex'), - 'd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3', - 'genesis hash matches' - ) - await buildChain(blockchain, common, 15) + for (const s of scenarios) { + const blockchain = await Blockchain.create({ + validateBlocks: true, + validateConsensus: false, + common: s.common, + hardforkByHeadBlockNumber: true, + }) + const genesisHeader = await blockchain.getLatestHeader() - const latestHeader = await blockchain.getLatestHeader() - t.equals(latestHeader.number.toNumber(), 15, 'blockchain is at correct height') + t.equal( + genesisHeader.hash().toString('hex'), + 'ac9c82e94824e583ab7972ee0f48b520912ffd5456ae4c62943852c3fb31876d', + 'genesis hash matches' + ) + await buildChain(blockchain, s.common, 15) - const powBlock = Block.fromBlockData({ - header: { - number: 16, - difficulty: new BN(1), - parentHash: latestHeader.hash(), - timestamp: latestHeader.timestamp.addn(1), - gasLimit: new BN(10000), - }, - }) - try { - await blockchain.putBlock(powBlock) - t.fail('should throw when inserting PoW block') - } catch (err: any) { - t.equals(err.message, 'invalid difficulty', 'should throw with invalid difficulty message') - t.end() + const latestHeader = await blockchain.getLatestHeader() + t.equal(latestHeader.number.toNumber(), 15, 'blockchain is at correct height') + + t.equal( + (blockchain as any)._common.hardfork(), + 'merge', + 'HF should have been correctly updated' + ) + const td = await blockchain.getTotalDifficulty(latestHeader.hash()) + t.equal( + td.toNumber(), + 1313601, + 'should have calculated the correct post-Merge total difficulty' + ) + + const powBlock = Block.fromBlockData({ + header: { + number: 16, + difficulty: new BN(1), + parentHash: latestHeader.hash(), + timestamp: latestHeader.timestamp.addn(1), + gasLimit: new BN(10000), + }, + }) + try { + await blockchain.putBlock(powBlock) + t.fail('should throw when inserting PoW block') + } catch (err: any) { + t.equal(err.message, 'invalid difficulty', 'should throw with invalid difficulty message') + } } + t.end() }) diff --git a/packages/blockchain/test/testdata/testnet.json b/packages/blockchain/test/testdata/testnet.json index d7743287d9..eb6753989c 100644 --- a/packages/blockchain/test/testdata/testnet.json +++ b/packages/blockchain/test/testdata/testnet.json @@ -10,13 +10,13 @@ "comment": "Private test network", "url": "[TESTNET_URL]", "genesis": { - "hash": "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3", + "hash": "0xac9c82e94824e583ab7972ee0f48b520912ffd5456ae4c62943852c3fb31876d", "timestamp": null, "gasLimit": 5000, - "difficulty": 17179869184, - "nonce": "0x0000000000000042", - "extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa", - "stateRoot": "0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544" + "difficulty": 1, + "nonce": "0xbb00000000000000", + "extraData": "0xcc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xdd00000000000000000000000000000000000000000000000000000000000000" }, "hardforks": [ { diff --git a/packages/client/.eslintrc.js b/packages/client/.eslintrc.js index daf5fda34c..6924095ec8 100644 --- a/packages/client/.eslintrc.js +++ b/packages/client/.eslintrc.js @@ -15,6 +15,12 @@ module.exports = { ], }, }, + { + files: ['bin/cli.ts'], + rules: { + 'no-console': 'off' + }, + }, ], ignorePatterns: ['webpack.config.js'] } diff --git a/packages/client/DESIGN.md b/packages/client/DESIGN.md new file mode 100644 index 0000000000..ba0a06979f --- /dev/null +++ b/packages/client/DESIGN.md @@ -0,0 +1,75 @@ +## Design + +**Goals** + +Contributors should aim to achieve the following goals when making design decisions: + +- **Loosely coupled components**: Components should require as little knowledge of the definitions of + other components as possible. This reduces dependencies between PRs and encourages contributors + to work in parallel. It also improves extensibility of the code as new features like sharding + and libp2p support are added. +- **Easily tested**: The design should make testing of individual components as easy as possible. + This goes hand in hand with the previous goal of loose coupling. +- **Readable code**: More readable code should encourage more contributions from the community and help + with bug fixing. +- **Well documented**: Similar to above, this will help both contributors and users of the project. + +The current design tries to achieve the goals of loose coupling and ease of testing by using an +event-driven architecture where possible. Readability is improved by using features of JavaScript +ES6 such as classes, async/await, promises, arrow functions, for...of, template literals and +destructuring assignment among others. Shorter names are used when possible and long functions are +broken up into smaller helpers, along with TypeDoc annotations for most methods and parameters. +Documentation is auto-generated from TypeDoc comments and many examples of usage are provided (TO DO). + +We will now briefly describe the directory structure and main components of the Ethereumjs client +to help contributors better understand how the project is organized. + +**Directory structure** + +- `/bin` Contains the CLI script for the `ethereumjs` command. +- `/docs` Contains auto-generated API docs. +- `/lib/blockchain` Contains the `Chain` class. +- `/lib/net` Contains all of the network layer classes including `Peer`, `Protocol` and its subclasses, `Server` and its subclasses, and `PeerPool`. +- `/lib/service` Contains the main Ethereum services (`FullEthereumService` and `LightEthereumService`). +- `/lib/rpc` Contains the RPC server (optionally) embedded in the client. +- `/lib/sync` Contains the various chain synchronizers and `Fetcher` helpers. +- `/lib/miner` Contains the miner module that can build new blocks on top of the chain. +- `/test` Contains test cases, testing helper functions, mocks and test data. + +**Components** + +- `Chain` [**In Progress**] This class represents the blockchain and is a wrapper around + `@ethereumjs/blockchain`. It handles creation of the data directory, provides basic blockchain operations + and maintains an updated current state of the blockchain, including current height, total difficulty, and + latest block. +- `Server` This class represents a server that discovers new peers and handles incoming and dropped + connections. When a new peer connects, the `Server` class will negotiate protocols and emit a `connected` + event with a new `Peer`instance. The peer will have properties corresponding to each protocol. For example, + if a new peer understands the `eth` protocol, it will contain an `eth` property that provides all `eth` + protocol methods (for example: `peer.eth.getBlockHeaders()`) + - `RlpxServer` [**In Progress**] Subclass of `Server` that implements the `devp2p/rlpx` transport. + - `Libp2pServer` [**In Progress**] Subclass of `Server` that implements the `libp2p` transport. +- `Peer` Represents a network peer. Instances of `Peer` are generated by the `Server` + subclasses and contain instances of supported protocol classes as properties. Instances of `Peer` subclasses can also be used to directly connect to other nodes via the `connect()` method. Peers emit `message` events + whenever a new message is received using any of the supported protocols. + - `RlpxPeer` [**In Progress**] Subclass of `Peer` that implements the `devp2p/rlpx` transport. + - `Libp2pPeer` [**In Progress**] Subclass of `Peer` that implements the `libp2p` transport. +- `Protocol` [**In Progress**] This class and subclasses provide a user-friendly wrapper around the + low level ethereum protocols `eth/66` and `les/4`. Subclasses must define the messages provided by the protocol. + - `EthProtocol` [**In Progress**] Implements `eth/66` protocol. + - `LesProtocol` [**In Progress**] Implements `les/4` protocol. +- `PeerPool` [**In Progress**] Represents a pool of network peers. `PeerPool` instances emit `added` + and `removed` events when new peers are added and removed and also emit the `message` event whenever + any of the peers in the pool emit a message. Each `Service` has an associated `PeerPool` and they are used primarily by `Synchronizer`s to help with blockchain synchronization. +- `Synchronizer` Subclasses of this class implements a specific blockchain synchronization strategy. They + also make use of subclasses of the `Fetcher` class that help fetch headers and bodies from pool peers. The fetchers internally make use of streams to handle things like queuing and backpressure. + - `FullSynchronizer` [**In Progress**] Implements full syncing of the blockchain + - `LightSynchronizer` [**In Progress**] Implements light syncing of the blockchain +- `Handler` Subclasses of this class implements a protocol message handler. Handlers respond to incoming requests from peers. + - `EthHandler` [**In Progress**] Handles incoming ETH requests + - `LesHandler` [**In Progress**] Handles incoming LES requests +- `Service` Subclasses of `Service` will implement specific functionality of a `Client`. For example, the `EthereumService` subclasses will synchronize the blockchain using the full or light sync protocols. Each service must specify which protocols it needs and define a `start()` and `stop()` function. + - `FullEthereumService` [**In Progress**] Implementation of ethereum full sync. + - `LightEthereumService` [**In Progress**] Implementation of ethereum light sync. +- `Client` [**In Progress**] Represents the top-level ethereum client, and is responsible for managing the lifecycle of included services. +- `RPCManager` [**In Progress**] Implements an embedded JSON-RPC server to handle incoming RPC requests. \ No newline at end of file diff --git a/packages/client/EXAMPLES.md b/packages/client/EXAMPLES.md deleted file mode 100644 index 5acbcac86a..0000000000 --- a/packages/client/EXAMPLES.md +++ /dev/null @@ -1,160 +0,0 @@ - -# Networking/Running the client - -Below are various use cases for running the client. - -## Local Connections : EthereumJS <- EthereumJS - -For debugging on networking issues there are two custom npm start scripts with appropriate settings. - -Start a first client listening on the default port and using the default data directory with: - -```shell -DEBUG=devp2p:* npm run client:start:dev1 -DEBUG=devp2p:* npm run client:start:dev1 -- --datadir=datadir-dev1 -``` - -Then take the enode address from the started client instance (use `127.0.0.1` for the IP address) and start a second client with: - -```shell -DEBUG=devp2p:* npm run client:start:dev2 -- --bootnodes=enode://[DEV1_NODE_ID]@127.0.0.1:30303 -``` - -This second client is using './datadir-dev2' for its data directory. - -## Local Connection: EthereumJS <- Geth - -To connect Geth to a running EthereumJS instance start a client with: - -```shell -DEBUG=devp2p:* npm run client:start:dev1 -``` - -Then connect with your Geth instance via: - -```shell -geth --maxpeers=1 --bootnodes=enode://[DEV1_NODE_ID]@127.0.0.1:30303 -``` - -## Local Connection: Geth <- EthereumJS - -Start your Geth instance: - -```shell -geth [--syncmode=full] [--verbosity=5] -``` -Then connect with your EthereumJS instance via: - -```shell -DEBUG=devp2p:* npm run client:start:dev2 -- --bootnodes=enode://[GETH_NODE_ID]@127.0.0.1:30303 -``` - -## Light sync - -In this example, we will run two ethereumjs-clients. The first will be a full sync client that -will connect to the rinkeby network and start downloading the blockchain. The second will be a -light client that connects to the first client and syncs headers as they are downloaded. - -The first client will use RLPx to connect to the rinkeby network, but will also provide a libp2p -listener. The second client will use libp2p to connect to the first client. - -Run the first client and start downloading blocks: - -``` -ethereumjs --syncmode full --lightserv true --datadir first --network rinkeby --transports rlpx libp2p --multiaddrs /ip4/127.0.0.1/tcp/50505/ws -``` - -Output: - -
-...
-INFO [10-24|11:42:26] Listener up transport=rlpx url=enode://1c3a3d70e9fb7c274355b7ffbbb34465576ecec7ab275947fd4bdc7ddcd19320dfb61b210cbacc0702011aea6971204d4309cf9cc1856fce4887145962281907@[::]:30303
-INFO [10-24|11:37:48] Listener up transport=libp2p url=/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa
-...
-
- -Copy the libp2p URL from the output. In this example, the url is `/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa` but it will be different in your case. - -Wait until a few thousand blocks are downloaded and then run the second client in a new terminal, using the url above to connect to the first client: - -
-ethereumjs --syncmode light --network rinkeby --datadir second --transports libp2p --multiaddrs /ip4/0.0.0.0/tcp/50506 --bootnodes=/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa
-
- -Notice that we have to run the second client on port 50506 using the `--multiaddrs /ip4/0.0.0.0/tcp/50506` libp2p option to avoid port conflicts. - -## Light sync from within a browser - -In this example, we will again perform a light sync by connecting to the first client from above. However, this time we will connect directly to the first client from within a browser window using libp2p websockets. - -First, let's make the bundle: - -``` -git clone https://github.com/ethereumjs/ethereumjs-monorepo -cd ethereumjs-monorepo -npm i -cd packages/client -npm run build:browser -``` - -This will create the file `dist/bundle.js`. Now, we will create an`index.html` file that serves it up on `http://localhost:8080`. - -``` -echo '' > index.html -npm i -g http-server -http-server -``` - -Now, open a new browser window and navigate to `http://localhost:8080`. Open the developer console in your browser and run the following command to start syncing to the first client. Again, remember to change the value of bootnodes to match the url of the first client from above: - -```js -ethereumjs.run({ - network: 'rinkeby', - syncmode: 'light', - bootnodes: '/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa', - discDns: false -}) -``` - -That's it! Now, you should start seeing headers being downloaded to the local storage of your browser. Since IndexDB is being used, even if you close and re-open the browser window, the headers you've downloaded will be saved. - -![EthereumJS Client Libp2p Browser Syncing](./browser_sync.png?raw=true) - -## Running a private network with geth - -In this example, we import the genesis parameters for a private Proof-of-Authority network using the geth genesis parameters format and then sync our client with a geth instance that is sealing blocks. - -First, create a signer account and place in the `data` directory to use with geth to seal blocks following [these instructions](https://geth.ethereum.org/docs/interface/managing-your-accounts). - -Next, open [these genesis parameters](./test/testdata/poa.json) and replace "728bb68502bfcd91ce4c7a692a0c0773ced5cff" with your signer address in both the `extradata` property and in the `alloc` section. - -Second, get geth configured to use the genesis parameters file just updated. - -`geth init --datadir data poa.json` - -Now, let's run geth and ensure that its sealing blocks. Note, geth will prompt you for a password to unlock your signer account. - -`geth --datadir data --nat extip:[your local ip address here] --networkid 15470 --unlock [the signer account you created] --mine --nodiscover` - -You should start seeing logs like below: -```bash -INFO [08-26|09:13:16.218] Commit new mining work number=1 sealhash=b6eb1d..65ac14 uncles=0 txs=0 gas=0 fees=0 elapsed="91.644µs" -INFO [08-26|09:13:16.218] Successfully sealed new block number=1 sealhash=b6eb1d..65ac14 hash=0fa2b5..d62aec elapsed="382.998µs" -INFO [08-26|09:13:16.218] 🔨 mined potential block number=1 hash=0fa2b5..d62aec -INFO [08-26|09:13:16.218] Commit new mining work number=2 sealhash=6111ce..1521f3 uncles=0 txs=0 gas=0 fees=0 elapsed="285.226µs" -``` - -Next, let's get the geth `enode` address as follows: - -`geth attach data/geth.ipc` - -Then, execute this command in the geth javascript console: `admin.nodeInfo` and copy the enode address. - -Start the ethereumjs client with the custom genesis parameters: - -`npm run client:start -- --gethGenesis=path/to/poa.json --bootnodes=[enode address of your geth node] --port=30305` - -Shortly, you should start seeing the client produce logs showing it importing and executing blocks produced by the geth client! -```bash -INFO [08-26|09:22:46] Imported blocks count=2 number=26 hash=da44b792... hardfork=tangerineWhistle peers=1 -``` diff --git a/packages/client/README.md b/packages/client/README.md index 095f85454e..5ee90681cf 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -1,4 +1,4 @@ -# SYNOPSIS +# @ethereumjs/client [![NPM Package][client-npm-badge]][client-npm-link] [![GitHub Issues][client-issues-badge]][client-issues-link] @@ -6,112 +6,151 @@ [![Code Coverage][client-coverage-badge]][client-coverage-link] [![Discord][discord-badge]][discord-link] -This is the work repository for the EthereumJS client project targeting both Node.js and the browser. +| Ethereum Execution (Eth 1.0) Client built in TypeScript/JavaScript. | +| --- | -See [Technical Guidelines](#technical-guidelines) to dive directly into development info. +Note: there is no current release on npm and the releases from the [standalone repository](https://github.com/ethereumjs/ethereumjs-client) are outdated. Use the latest `master` to run the client. There will be an up-to-date client release soon (Fall 2021) under a scoped `@ethereumjs/client` naming scheme. -Current development stage: `EARLY DEVELOPMENT` +# INTRODUCTION -# PROJECT SUMMARY +The EthereumJS Client is an Ethereum Execution Client (similar to [go-ethereum](https://github.com/ethereum/go-ethereum) or [Nethermind](https://github.com/NethermindEth/nethermind)) written in `TypeScript`/`JavaScript`, the non-Smart-Contract language Ethereum dApp developers are most familiar with. It is targeted to be a client for research and development and not meant to be used in production on `mainnet` for the foreseeable future (out of resource and security considerations). -Project summary from [this document](./PROJECT.md) is currently outdated. Please refer to our communication channels for some information on the current state of client development. +Here are some use cases: -# TECHNICAL GUIDELINES +- Sync the main Ethereum networks (`mainnet`, `goerli`, `rinkeby`,...) +- Set up your own local development networks (PoA Clique) +- Run a network with your own custom [EthereumJS VM](../vm) +- Analyze what's in the Ethereum `mainnet` [transaction pool](./lib/sync/txpool.ts) +- Run experiments with Ethereum browser sync (see [example](./examples/light-browser-sync.md)) -## Client Setup +The client has an extremely modular design by building upon central other libraries in the EthereumJS monorepo ([VM](../vm), [Merkle Patricia Tree](../trie), [Blockchain](../blockchain), [Block](../block), [tx](../tx), [devp2p](../devp2p) and [Common](../common)) and is therefore extremely well suited for a deep dive into Ethereum protocol development. -### Installing the Client +We invite you to explore and would be delighted if you give us feedback on your journey! 🙂 ❤️ -```shell -npm install ethereumjs-client -``` +# SETUP -For the `ethereumjs` CLI command to work run: +## INSTALL ```shell -npm link +npm install -g @ethereumjs/client // Release during Fall 2021 ``` -Note: for development purposes, you can invoke the client with `npm run client:start` from the `client` root directory (e.g. `packages/client` if working on a local copy of the monorepo) +As long as there is no up-to-date client release on npm and for development purposes the client can be used like this: + +1. Clone the monorepo with `git clone https://github.com/ethereumjs/ethereumjs-monorepo.git` +2. Set things up and install dependencies (see [monorepo docs](../../config/MONOREPO.md)) +3. Run the client with `npm run client:start` from the `client` root directory (e.g. `packages/client` if working on a local copy of the monorepo) + +Furthermore see the [Technical Guidelines](#technical-guidelines) to dive directly into some more in-depth development info. -### Running the Client +## USAGE -You can get up the client up and running with default settings with: +### Introduction + +You can get the client up and running by going to the shell and run: ```shell -ethereumjs --network=mainnet [--loglevel=debug] +# npm installation +ethereumjs + +# GitHub installation +npm run client:start ``` -### CLI reference [WORK-IN-PROGRESS] -#### `--network` -You can connect to specific networks by name using the `--network` parameter as below: (`rinkeby` is used here) +And pass in CLI paramters like: ```shell -ethereumjs --network rinkeby +# npm installation +ethereumjs --network=goerli + +# GitHub installation +npm run client:start -- --network=goerli ``` -The client currently supports the below networks: -- mainnet -- rinkeby -- ropsten -- goerli -- kovan -- Note: kovan support is limited and chain syncing may not work due to the kovan consensus mechanism not being implemented +To see a help page with the full list of client options available run: +```shell +ethereumjs --help +``` + +### Supported Networks + +The EthereumJS client is tightly integrated with the EthereumJS [Common](../common) library and gets its network state and information from this library and supports all networks support by `Common`. -#### `--help` +The main supported networks are: -The help can be shown with: +- `mainnet` +- `rinkeby` +- `ropsten` +- `goerli` + +Use the CLI `--network` option to switch the network: ```shell -ethereumjs --help +ethereumjs --network=rinkeby ``` -### `--loglevel` -The client's logging verbosity level can be set with `--loglevel`. Available levels are -`error`, `warn`, `info`, `debug` +The client currently supports `full` sync being set as a default and has experimental support for `light` sync. + +### Custom Chains + +The EthereumJS client supports running custom chains based on a custom chain configuration. There are two ways of reading in custom chain configuration parameters: + +#### Common-based Configuration + +We have got our own flexible chain configuration and genesis state configuration format applied in the `Common` library, see the `Common` [chain JSON files](../common/src/chains/) as well as corresponding [Genesis JSON files](../common/src/genesisStates/) for inspiration. + +Custom chain files following this format can be passed in to the client with the following options: ```shell -ethereumjs --loglevel=debug +ethereumjs --customChain=[COMMON_FORMAT_CHAIN_FILE] --customGenesisState=[COMMON_FORMAT_GENESIS_STATE] ``` -If you want to have verbose logging output across the stack you can use... +#### Geth Genesis Files + +It is also possible to use a chain configuration as defined by the Go-Ethereum [genesis.json file format](https://geth.ethereum.org/docs/interface/private-network). + +Use the following option to pass in to the client: ```shell -DEBUG=*,-babel [CLIENT_START_COMMAND] +ethereumjs --gethGenesis=[GETH_GENESIS_JSON_FILE] ``` -for all output or something more targeted by listing the loggers like +### Custom Network Mining (Beta) + +The client supports private custom network mining on PoA clique chains by using the `--mine` option together with passing in a comma separated list of accounts with the `--unlock` option: ```shell -DEBUG=devp2p:rlpx,devp2p:eth,-babel [CLIENT_START_COMMAND] +ethereumjs --mine --unlock=[ADDRESS1],[ADDRESS2],... ``` -#### Node.js +Note that this feature is in `beta` and shouldn't be used with accounts holding a substantial amount of `Ether` on mainnet (or other valuable assets) for security reasons. -To programmatically run a client do: +### Custom network for development -```typescript -import { Config, EthereumClient } from '@ethereumjs/client' -const config = new Config() -const client = new EthereumClient({ config }) +The client provides a quick way to get a local instance of a blockchain up and running using the `--dev` command. This will start up a private PoA clique +network with a prefunded account that mines block on 10 second intervals. The prefunded account and its private key are printed to the screen when the client starts. When paired with the `--rpc` command, you have a ready-made environment for local development. -client.open() -client.start() -client.stop() +```shell +ethereumjs --dev --rpc + +================================================== +Account generated for mining blocks: +Address: 0xd8066d5822138e7c76d1565deb249f5f7ae370fa +Private key: 0x6239e36ab8b27212868a1aa3f9c3b88b084075ea56aa4979d206371f065d3feb +WARNING: Do not use this account for mainnet funds +================================================== ``` -You can also provide your custom [@ethereumjs/vm](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/vm) instance: +Please **heed** the warning and do not use the provided account/private key for mainnet funds. -```typescript -import VM from '@ethereumjs/vm' -import { Config, EthereumClient } from '@ethereumjs/client' -const vm = new VM() -const config = new Config({ vm }) -const client = new EthereumClient({ config }) -``` +This can also be paired with the `--unlock` command if you would like to specify the miner/prefunded account: -[WORK-IN-PROGRESS] Programmatic invocation on the client is in a very early stage and only meant for experimental purposes. You are invited to play around, please let us know what control functionality you would want the client to expose and what information you would need to get out of the client to be useful in your usage context. +```shell +ethereumjs --dev --rpc --unlock=0xd8066d5822138e7c76d1565deb249f5f7ae370fa +``` +Note: If the `--dev` command is used in conjunction with `--unlock` to use a predefined account, the blockchain's state will be preserved between consecutive runs. If you try to use a different predefined account, you may see errors related to incompatible genesis blocks. Simply run the client with the `--dev` flag by itself and use the new prefunded account provided by the client in further rounds of execution. ## API [API Reference](./docs/README.md) @@ -215,92 +254,49 @@ Output: } } ``` -### Running the client - -See [the examples](./EXAMPLES.md) for various scenarios for running the client - -## Design - -**Goals** - -Contributors should aim to achieve the following goals when making design decisions: - -- **Loosely coupled components**: Components should require as little knowledge of the definitions of - other components as possible. This reduces dependencies between PRs and encourages contributors - to work in parallel. It also improves extensibility of the code as new features like sharding - and libp2p support are added. -- **Easily tested**: The design should make testing of individual components as easy as possible. - This goes hand in hand with the previous goal of loose coupling. -- **Readable code**: More readable code should encourage more contributions from the community and help - with bug fixing. -- **Well documented**: Similar to above, this will help both contributors and users of the project. - -The current design tries to achieves the goals of loose coupling and ease of testing by using an -event-driven architecture where possible. Readability is improved by using features of JavaScript -ES6 such as classes, async/await, promises, arrow functions, for...of, template literals and -destructuring assignment among others. Shorter names are used when possible and long functions are -broken up into smaller helpers, along with TypeDoc annotations for most methods and parameters. -Documentation is auto-generated from TypeDoc comments and many examples of usage are provided (TO DO). - -We will now briefly describe the directory structure and main components of the Ethereumjs client -to help contributors better understand how the project is organized. - -**Directory structure** - -- `/bin` Contains the CLI script for the `ethereumjs` command. -- `/docs` Contains auto-generated API docs. -- `/lib/blockchain` Contains the `Chain` class. -- `/lib/net` Contains all of the network layer classes including `Peer`, `Protocol` and its subclasses, `Server` and its subclasses, and `PeerPool`. -- `/lib/service` Contains the main Ethereum services (`FullEthereumService` and `LightEthereumService`). -- `/lib/rpc` Contains the RPC server (optionally) embedded in the client. -- `/lib/sync` Contains the various chain synchronizers and `Fetcher` helpers. -- `/test` Contains test cases, testing helper functions, mocks and test data. - -**Components** - -- `Chain` [**In Progress**] This class represents the blockchain and is a wrapper around - `@ethereumjs/blockchain`. It handles creation of the data directory, provides basic blockchain operations - and maintains an updated current state of the blockchain, including current height, total difficulty, and - latest block. -- `Server` This class represents a server that discovers new peers and handles incoming and dropped - connections. When a new peer connects, the `Server` class will negotiate protocols and emit a `connected` - event with a new `Peer`instance. The peer will have properties corresponding to each protocol. For example, - if a new peer understands the `eth` protocol, it will contain an `eth` property that provides all `eth` - protocol methods (for example: `peer.eth.getBlockHeaders()`) - `RlpxServer` [**In Progress**] Subclass of `Server` that implements the `devp2p/rlpx` transport. - `Libp2pServer` [**In Progress**] Subclass of `Server` that implements the `libp2p` transport. -- `Peer` Represents a network peer. Instances of `Peer` are generated by the `Server` - subclasses and contain instances of supported protocol classes as properties. Instances of `Peer` subclasses can also be used to directly connect to other nodes via the `connect()` method. Peers emit `message` events - whenever a new message is received using any of the supported protocols. - `RlpxPeer` [**In Progress**] Subclass of `Peer` that implements the `devp2p/rlpx` transport. - `Libp2pPeer` [**In Progress**] Subclass of `Peer` that implements the `libp2p` transport. -- `Protocol` [**In Progress**] This class and subclasses provide a user-friendly wrapper around the - low level ethereum protocols such as `eth/62`, `eth/63` and `les/2`. Subclasses must define the messages provided by the protocol. - `EthProtocol` [**In Progress**] Implements the `eth/62` and `eth/63` protocols. - `LesProtocol` [**In Progress**] Implements the `les/2` protocol. - `ShhProtocol` [**Not Started**] Implements the whisper protocol. -- `PeerPool` [**In Progress**] Represents a pool of network peers. `PeerPool` instances emit `added` - and `removed` events when new peers are added and removed and also emit the `message` event whenever - any of the peers in the pool emit a message. Each `Service` has an associated `PeerPool` and they are used primarily by `Synchronizer`s to help with blockchain synchronization. -- `Synchronizer` Subclasses of this class implements a specific blockchain synchronization strategy. They - also make use of subclasses of the `Fetcher` class that help fetch headers and bodies from pool peers. The fetchers internally make use of streams to handle things like queuing and backpressure. - `FullSynchronizer` [**In Progress**] Implements full syncing of the blockchain - `LightSynchronizer` [**In Progress**] Implements light syncing of the blockchain -- `Handler` Subclasses of this class implements a protocol message handler. Handlers respond to incoming requests from peers. - - `EthHandler` [**In Progress**] Handles incoming ETH requests - - `LesHandler` [**In Progress**] Handles incoming LES requests -- `Service` Subclasses of `Service` will implement specific functionality of a `Client`. For example, the `EthereumService` subclasses will synchronize the blockchain using the full or light sync protocols. Each service must specify which protocols it needs and define a `start()` and `stop()` function. - - `FullEthereumService` [**In Progress**] Implementation of ethereum full sync. - - `LightEthereumService` [**In Progress**] Implementation of ethereum light sync. - - `WhisperService` [**Not Started**] Implementation of an ethereum whisper node. -- `Client` [**In Progress**] Represents the top-level ethereum client, and is responsible for managing the lifecycle of included services. -- `RPCManager` [**In Progress**] Implements an embedded JSON-RPC server to handle incoming RPC requests. - -## Developer -### Diagram Updates +## DEVELOPMENT -To update the structure diagram files in the root folder open the `client.drawio` file in [draw.io](https://draw.io/), make your changes, and open a PR with the updated files. Export `svg` and `png` with `border` `width=20` and `transparency=false`. For `png` go to "Advanced" and select `300 DPI`. +### Design + +For an overview on the design goals which served as a guideline on design decisions as well as some structural client overview see the dedicated [DESIGN.md](./DESIGN.md) document. + +### Client Customization + +To get a start on customizing the client and using it programmatically see the code from [./bin/cli.ts](./bin/cli.ts) to get an idea of how an [EthereumClient](./lib/client.ts) instance is invoked programmatically. + +We would love to hear feedback from you on what you are planning and exchange on ideas how a programmatic exposure of the client API can be achieved more systematically and useful for third-party development use. + +### Debugging + +### Local Test Network + +For some guidance on how to setup local testnetworks see the examples on [local debugging](./examples/local-debugging.md) and setting up a [private network with Geth](./examples/private-geth-network.md). + +#### Using Debug Loggers + +The client's logging verbosity level can be set with `--loglevel`. Available levels are +`error`, `warn`, `info`, `debug`. + +```shell +ethereumjs --loglevel=debug +``` + +For more in-depth debugging on networking the underlying [devp2p](../devp2p) library integrates with the [debug](https://github.com/visionmedia/debug) package and can also be used from within a client execution context: + +```shell +DEBUG=*,-babel [CLIENT_START_COMMAND] +``` -## Environment / Ecosystem +The above command outputs the log messages from all `devp2p` debug loggers available. For a more targeted logging the different loggers can also be activated separately, e.g.: -**EthereumJS Ecosystem** +```shell +DEBUG=devp2p:rlpx,devp2p:eth,-babel [CLIENT_START_COMMAND] +``` -This project will be embedded in the EthereumJS ecosystem and many submodules already exist and -can be used within the project, have a look e.g. at [@ethereumjs/block](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/block), [@ethereumjs/vm](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/vm), -[merkle-patricia-tree](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/trie) or the -[@ethereumjs/devp2p](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/devp2p) implementation. Work needs to be done both within these repos and related libraries. +### Diagram Updates + +To update the structure diagram files in the root folder open the `client.drawio` file in [draw.io](https://draw.io/), make your changes, and open a PR with the updated files. Export `svg` and `png` with `border` `width=20` and `transparency=false`. For `png` go to "Advanced" and select `300 DPI`. ## EthereumJS diff --git a/packages/client/bin/cli.ts b/packages/client/bin/cli.ts index 436529623b..5ca4172c01 100755 --- a/packages/client/bin/cli.ts +++ b/packages/client/bin/cli.ts @@ -1,20 +1,24 @@ -#!/usr/bin/env client +#!/usr/bin/env node +import { homedir } from 'os' +import path from 'path' +import readline from 'readline' +import { randomBytes } from 'crypto' +import { ensureDirSync, readFileSync, removeSync } from 'fs-extra' import { Server as RPCServer } from 'jayson/promise' -import Common, { Hardfork } from '@ethereumjs/common' +import Common, { Chain, Hardfork, ConsensusType } from '@ethereumjs/common' +import { _getInitializedChains } from '@ethereumjs/common/dist/chains' +import { Address, toBuffer } from 'ethereumjs-util' import { parseMultiaddrs, parseGenesisState, parseCustomParams } from '../lib/util' import EthereumClient from '../lib/client' import { Config } from '../lib/config' import { Logger } from '../lib/logging' import { RPCManager } from '../lib/rpc' import { Event } from '../lib/types' -const os = require('os') -const path = require('path') -const fs = require('fs-extra') -const chains = require('@ethereumjs/common/dist/chains').chains +import type { Chain as IChain, GenesisState } from '@ethereumjs/common/dist/types' const level = require('level') -const networks = Object.entries(chains.names) +const networks = Object.entries(_getInitializedChains().names) const args = require('yargs') .options({ @@ -29,7 +33,7 @@ const args = require('yargs') default: undefined, }, syncmode: { - describe: 'Blockchain sync mode', + describe: 'Blockchain sync mode (light sync experimental)', choices: ['light', 'full'], default: Config.SYNCMODE_DEFAULT, }, @@ -40,14 +44,14 @@ const args = require('yargs') }, datadir: { describe: 'Data directory for the blockchain', - default: `${os.homedir()}/Library/Ethereum/ethereumjs`, + default: `${homedir()}/Library/Ethereum/ethereumjs`, }, customChain: { - describe: 'Path to custom chain parameters json file from Common', + describe: 'Path to custom chain parameters json file (@ethereumjs/common format)', coerce: path.resolve, }, customGenesisState: { - describe: 'Path to custom genesis state json file from Common', + describe: 'Path to custom genesis state json file (@ethereumjs/common format)', coerce: path.resolve, }, gethGenesis: { @@ -127,6 +131,21 @@ const args = require('yargs') describe: 'Use v4 ("findneighbour" node requests) for peer discovery', boolean: true, }, + mine: { + describe: 'Enable private custom network mining (beta, PoA only)', + boolean: true, + default: false, + }, + unlock: { + describe: + 'Comma separated list of accounts to unlock - currently only the first account is used for sealing mined blocks. Beta, you will be promped for a 0x-prefixed private key until keystore functionality is added - FOR YOUR SAFETY PLEASE DO NOT USE ANY ACCOUNTS HOLDING SUBSTANTIAL AMOUNTS OF ETH', + array: true, + }, + dev: { + describe: 'Start an ephemeral PoA blockchain with a single miner and prefunded accounts', + boolean: true, + default: false, + }, }) .locale('en_EN').argv @@ -140,9 +159,9 @@ let logger: Logger | null = null */ async function runNode(config: Config) { const chainDataDir = config.getChainDataDirectory() - fs.ensureDirSync(chainDataDir) + ensureDirSync(chainDataDir) const stateDataDir = config.getStateDataDirectory() - fs.ensureDirSync(stateDataDir) + ensureDirSync(stateDataDir) config.logger.info(`Data directory: ${config.datadir}`) @@ -187,32 +206,152 @@ async function run() { // give network id precedence over network name const chain = args.networkId ?? args.network ?? 'mainnet' + // configure accounts for mining and prefunding in a local devnet + const accounts: [address: Address, privateKey: Buffer][] = [] + if (args.unlock) { + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + }) + + // Hide key input + ;(rl as any).input.on('keypress', function () { + // get the number of characters entered so far: + const len = (rl as any).line.length + // move cursor back to the beginning of the input: + readline.moveCursor((rl as any).output, -len, 0) + // clear everything to the right of the cursor: + readline.clearLine((rl as any).output, 1) + // replace the original input with asterisks: + for (let i = 0; i < len; i++) { + // eslint-disable-next-line no-extra-semi + ;(rl as any).output.write('*') + } + }) + + const question = (text: string) => { + return new Promise((resolve) => { + rl.question(text, resolve) + }) + } + + try { + for (const addressString of args.unlock) { + const address = Address.fromString(addressString) + const inputKey = await question( + `Please enter the 0x-prefixed private key to unlock ${address}:\n` + ) + ;(rl as any).history = (rl as any).history.slice(1) + const privKey = toBuffer(inputKey) + const derivedAddress = Address.fromPrivateKey(privKey) + if (address.equals(derivedAddress)) { + accounts.push([address, privKey]) + } else { + console.error( + `Private key does not match for ${address} (address derived: ${derivedAddress})` + ) + process.exit() + } + } + } catch (e: any) { + console.error(`Encountered error unlocking account:\n${e.message}`) + process.exit() + } + rl.close() + } + + let common = new Common({ chain: Chain.Mainnet }) + + if (args.dev) { + if (accounts.length === 0) { + // Delete old chain data for devnet if generating ephemeral keys for mining to prevent genesis block mismatch + removeSync(`${args.datadir}/devnet`) + } + + if (accounts.length === 0) { + // Create new account for devnet if not provided + const privKey = randomBytes(32) + const account = Address.fromPrivateKey(privKey) + accounts.push([account, privKey]) + // prettier-ignore + console.log(`==================================================\nAccount generated for mining blocks:\nAddress: ${account.toString()}\nPrivate key: 0x${privKey.toString( 'hex')}\nWARNING: Do not use this account for mainnet funds\n==================================================`) + } + + const prefundAddress = accounts[0][0].toString().slice(2) + const defaultChainData = { + config: { + chainId: 123456, + homesteadBlock: 0, + eip150Block: 0, + eip150Hash: '0x0000000000000000000000000000000000000000000000000000000000000000', + eip155Block: 0, + eip158Block: 0, + byzantiumBlock: 0, + constantinopleBlock: 0, + petersburgBlock: 0, + istanbulBlock: 0, + berlinBlock: 0, + londonBlock: 0, + clique: { + period: 10, + epoch: 30000, + }, + }, + nonce: '0x0', + timestamp: '0x614b3731', + gasLimit: '0x47b760', + difficulty: '0x1', + mixHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + coinbase: '0x0000000000000000000000000000000000000000', + number: '0x0', + gasUsed: '0x0', + parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000', + baseFeePerGas: 7, + } + const extraData = '0x' + '0'.repeat(64) + prefundAddress + '0'.repeat(130) + const chainData = { + ...defaultChainData, + extraData, + alloc: { [prefundAddress]: { balance: '0x10000000000000000000' } }, + } + const chainParams = await parseCustomParams(chainData, 'devnet') + const genesisState = await parseGenesisState(chainData) + const customChainParams: [IChain, GenesisState][] = [[chainParams, genesisState]] + common = new Common({ + chain: 'devnet', + customChains: customChainParams, + hardfork: Hardfork.London, + }) + } + // configure common based on args given - let common: Common = {} as Common if ( (args.customChainParams || args.customGenesisState || args.gethGenesis) && (!(args.network === 'mainnet') || args.networkId) ) { - throw new Error('cannot specify both custom chain parameters and preset network ID') + console.error('cannot specify both custom chain parameters and preset network ID') + process.exit() } // Use custom chain parameters file if specified if (args.customChain) { if (!args.customGenesisState) { - throw new Error('cannot have custom chain parameters without genesis state') + console.error('cannot have custom chain parameters without genesis state') + process.exit() } try { - const customChainParams = JSON.parse(fs.readFileSync(args.customChain, 'utf-8')) - const genesisState = JSON.parse(fs.readFileSync(args.customGenesisState)) + const customChainParams = JSON.parse(readFileSync(args.customChain, 'utf-8')) + const genesisState = JSON.parse(readFileSync(args.customGenesisState, 'utf-8')) common = new Common({ chain: customChainParams.name, customChains: [[customChainParams, genesisState]], }) } catch (err: any) { - throw new Error(`invalid chain parameters: ${err.message}`) + console.error(`invalid chain parameters: ${err.message}`) + process.exit() } - // Use geth genesis parameters file if specified } else if (args.gethGenesis) { - const genesisFile = JSON.parse(fs.readFileSync(args.gethGenesis, 'utf-8')) + // Use geth genesis parameters file if specified + const genesisFile = JSON.parse(readFileSync(args.gethGenesis, 'utf-8')) const genesisParams = await parseCustomParams( genesisFile, path.parse(args.gethGenesis).base.split('.')[0] @@ -222,15 +361,25 @@ async function run() { chain: genesisParams.name, customChains: [[genesisParams, genesisState]], }) - } - // Use default common configuration for specified `chain` if no custom parameters specified - else { + } else if (!args.dev) { + // Use default common configuration for specified `chain` if no custom parameters specified common = new Common({ chain: chain, hardfork: Hardfork.Chainstart }) } + if (args.mine) { + if (common.consensusType() !== ConsensusType.ProofOfAuthority) { + console.error('Currently mining is only supported for PoA consensus') + process.exit() + } + if (!args.unlock) { + console.error('Please provide an account to sign sealed blocks with `--unlock [address]` ') + process.exit() + } + } + const datadir = args.datadir ?? Config.DATADIR_DEFAULT const configDirectory = `${datadir}/${common.chainName()}/config` - fs.ensureDirSync(configDirectory) + ensureDirSync(configDirectory) const key = await Config.getClientKey(datadir, common) const config = new Config({ common, @@ -254,6 +403,8 @@ async function run() { debugCode: args.debugCode, discDns: args.discDns, discV4: args.discV4, + mine: args.mine || args.dev, + accounts, }) logger = config.logger config.events.setMaxListeners(50) @@ -270,5 +421,4 @@ async function run() { }) } -// eslint-disable-next-line no-console run().catch((err) => logger?.error(err) ?? console.error(err)) diff --git a/packages/client/examples/light-browser-sync.md b/packages/client/examples/light-browser-sync.md new file mode 100644 index 0000000000..0dc7aa2b3a --- /dev/null +++ b/packages/client/examples/light-browser-sync.md @@ -0,0 +1,72 @@ +# Example: Light Browser Sync + +## Light sync + +In this example, we will run two ethereumjs clients. The first will be a full sync client that +connects to the rinkeby network and starts downloading the blockchain. The second will be a +light client that connects to the first client and syncs headers as they are downloaded. + +The first client will use RLPx to connect to the rinkeby network, but will also provide a libp2p +listener. The second client will use libp2p to connect to the first client. + +Run the first client and start downloading blocks: + +``` +npm run client:start -- --syncmode full --lightserv true --datadir first --network rinkeby --transports rlpx libp2p --multiaddrs /ip4/127.0.0.1/tcp/50505/ws +``` + +Output: + +
+...
+INFO [10-24|11:42:26] Listener up transport=rlpx url=enode://1c3a3d70e9fb7c274355b7ffbbb34465576ecec7ab275947fd4bdc7ddcd19320dfb61b210cbacc0702011aea6971204d4309cf9cc1856fce4887145962281907@[::]:30303
+INFO [10-24|11:37:48] Listener up transport=libp2p url=/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa
+...
+
+ +Copy the libp2p URL from the output. In this example, the url is `/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa` but it will be different in your case. + +Wait until a few thousand blocks are downloaded and then run the second client in a new terminal, using the url above to connect to the first client: + +
+npm run client:start -- --syncmode light --network rinkeby --datadir second --transports libp2p --multiaddrs /ip4/0.0.0.0/tcp/50506 --bootnodes=/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa
+
+ +Notice that we have to run the second client on port 50506 using the `--multiaddrs /ip4/0.0.0.0/tcp/50506` libp2p option to avoid port conflicts. + +## Light sync from within a browser + +In this example, we will again perform a light sync by connecting to the first client from above. However, this time we will connect directly to the first client from within a browser window using libp2p websockets. + +First, let's make the bundle: + +``` +git clone https://github.com/ethereumjs/ethereumjs-monorepo +cd ethereumjs-monorepo +npm i +cd packages/client +npm run build:browser +``` + +This will create the file `dist/bundle.js`. Now, we will create an`index.html` file that serves it up on `http://localhost:8080`. + +``` +echo '' > index.html +npm i -g http-server +http-server +``` + +Now, open a new browser window and navigate to `http://localhost:8080`. Open the developer console in your browser and run the following command to start syncing to the first client. Again, remember to change the value of bootnodes to match the url of the first client from above: + +```js +ethereumjs.run({ + network: 'rinkeby', + syncmode: 'light', + bootnodes: '/ip4/127.0.0.1/tcp/50505/ws/p2p/QmYAuYxw6QX1x5aafs6g3bUrPbMDifP5pDun3N9zbVLpEa', + discDns: false +}) +``` + +That's it! Now, you should start seeing headers being downloaded to the local storage of your browser. Since IndexDB is being used, even if you close and re-open the browser window, the headers you've downloaded will be saved. + +![EthereumJS Client Libp2p Browser Syncing](./browser_sync.png?raw=true) \ No newline at end of file diff --git a/packages/client/examples/local-debugging.md b/packages/client/examples/local-debugging.md new file mode 100644 index 0000000000..70c70f7379 --- /dev/null +++ b/packages/client/examples/local-debugging.md @@ -0,0 +1,47 @@ +# Example: Local Debugging + +## Local Connections : EthereumJS <- EthereumJS + +For debugging on networking issues there are two custom npm start scripts with appropriate settings. + +Start a first client listening on the default port and using the default data directory with: + +```shell +DEBUG=devp2p:* npm run client:start:dev1 +DEBUG=devp2p:* npm run client:start:dev1 -- --datadir=datadir-dev1 +``` + +Then take the enode address from the started client instance (use `127.0.0.1` for the IP address) and start a second client with: + +```shell +DEBUG=devp2p:* npm run client:start:dev2 -- --bootnodes=enode://[DEV1_NODE_ID]@127.0.0.1:30303 +``` + +This second client is using './datadir-dev2' for its data directory. + +## Local Connection: EthereumJS <- Geth + +To connect Geth to a running EthereumJS instance start a client with: + +```shell +DEBUG=devp2p:* npm run client:start:dev1 +``` + +Then connect with your Geth instance via: + +```shell +geth --maxpeers=1 --bootnodes=enode://[DEV1_NODE_ID]@127.0.0.1:30303 +``` + +## Local Connection: Geth <- EthereumJS + +Start your Geth instance: + +```shell +geth [--syncmode=full] [--verbosity=5] +``` +Then connect with your EthereumJS instance via: + +```shell +DEBUG=devp2p:* npm run client:start:dev2 -- --bootnodes=enode://[GETH_NODE_ID]@127.0.0.1:30303 +``` \ No newline at end of file diff --git a/packages/client/examples/private-geth-network.md b/packages/client/examples/private-geth-network.md new file mode 100644 index 0000000000..49ca6174bc --- /dev/null +++ b/packages/client/examples/private-geth-network.md @@ -0,0 +1,40 @@ +# Example: Private Geth Network + +## Running a private network with geth + +In this example, we import the genesis parameters for a private Proof-of-Authority network using the geth genesis parameters format and then sync our client with a geth instance that is sealing blocks. + +First, create a signer account and place in the `data` directory to use with geth to seal blocks following [these instructions](https://geth.ethereum.org/docs/interface/managing-your-accounts). + +Next, open [these genesis parameters](./test/testdata/poa.json) and replace "728bb68502bfcd91ce4c7a692a0c0773ced5cff0" with your signer address in both the `extradata` property and in the `alloc` section. + +Second, get geth configured to use the genesis parameters file just updated. + +`geth init --datadir data poa.json` + +Now, let's run geth and ensure that its sealing blocks. Note, geth will prompt you for a password to unlock your signer account. + +`geth --datadir data --nat extip:[your local ip address here] --networkid 15470 --unlock [the signer account you created] --mine --nodiscover` + +You should start seeing logs like below: +```bash +INFO [08-26|09:13:16.218] Commit new mining work number=1 sealhash=b6eb1d..65ac14 uncles=0 txs=0 gas=0 fees=0 elapsed="91.644µs" +INFO [08-26|09:13:16.218] Successfully sealed new block number=1 sealhash=b6eb1d..65ac14 hash=0fa2b5..d62aec elapsed="382.998µs" +INFO [08-26|09:13:16.218] 🔨 mined potential block number=1 hash=0fa2b5..d62aec +INFO [08-26|09:13:16.218] Commit new mining work number=2 sealhash=6111ce..1521f3 uncles=0 txs=0 gas=0 fees=0 elapsed="285.226µs" +``` + +Next, let's get the geth `enode` address as follows: + +`geth attach data/geth.ipc` + +Then, execute this command in the geth javascript console: `admin.nodeInfo` and copy the enode address. + +Start the ethereumjs client with the custom genesis parameters: + +`npm run client:start -- --gethGenesis=path/to/poa.json --bootnodes=[enode address of your geth node] --port=30305` + +Shortly, you should start seeing the client produce logs showing it importing and executing blocks produced by the geth client! +```bash +INFO [08-26|09:22:46] Imported blocks count=2 number=26 hash=da44b792... hardfork=tangerineWhistle peers=1 +``` diff --git a/packages/client/lib/@types/qheap/index.d.ts b/packages/client/lib/@types/qheap/index.d.ts new file mode 100644 index 0000000000..42b192058c --- /dev/null +++ b/packages/client/lib/@types/qheap/index.d.ts @@ -0,0 +1,25 @@ +/** + * QHeap types. + * @types/qheap does not exist, so we define it here. + * https://www.npmjs.com/package/qheap + */ +declare module 'qheap' { + type QHeapOptions = { + comparBefore?(a: any, b: any): boolean + compar?(a: any, b: any): number + freeSpace?: number + size?: number + } + export default class QHeap { + constructor(opts?: QHeapOptions) + insert(item: T): void + push(item: T): void + enqueue(item: T): void + remove(): T | undefined + shift(): T | undefined + dequeue(): T | undefined + peek(): T | undefined + length: number + gc(opts: { minLength: number; maxLength: number }): void + } +} diff --git a/packages/client/lib/blockchain/chain.ts b/packages/client/lib/blockchain/chain.ts index 303cf8cad6..e5259b870d 100644 --- a/packages/client/lib/blockchain/chain.ts +++ b/packages/client/lib/blockchain/chain.ts @@ -150,10 +150,11 @@ export class Chain { */ get genesis(): GenesisBlockParams { const genesis = this.config.chainCommon.genesis() + const genesisParams: GenesisBlockParams = {} Object.entries(genesis).forEach(([k, v]) => { - genesis[k] = toBuffer(v as string) + genesisParams[k] = toBuffer(v as string) }) - return genesis + return genesisParams } /** diff --git a/packages/client/lib/config.ts b/packages/client/lib/config.ts index c7c18b6379..6bee094b0e 100644 --- a/packages/client/lib/config.ts +++ b/packages/client/lib/config.ts @@ -1,6 +1,7 @@ import Common, { Hardfork } from '@ethereumjs/common' import VM from '@ethereumjs/vm' import { genPrivateKey } from '@ethereumjs/devp2p' +import { Address } from 'ethereumjs-util' import Multiaddr from 'multiaddr' import { getLogger, Logger } from './logging' import { Libp2pServer, RlpxServer } from './net/server' @@ -176,6 +177,21 @@ export interface ConfigOptions { * Default: `false` for testnets, true for mainnet */ discV4?: boolean + + /** + * Enable mining + * + * Default: `false` + */ + mine?: boolean + + /** + * Unlocked accounts of form [address, privateKey] + * Currently only the first account is used to seal mined PoA blocks + * + * Default: [] + */ + accounts?: [address: Address, privKey: Buffer][] } export class Config { @@ -222,6 +238,8 @@ export class Config { public readonly debugCode: boolean public readonly discDns: boolean public readonly discV4: boolean + public readonly mine: boolean + public readonly accounts: [address: Address, privKey: Buffer][] public synchronized: boolean public lastSyncDate: number @@ -252,6 +270,8 @@ export class Config { this.maxPeers = options.maxPeers ?? Config.MAXPEERS_DEFAULT this.dnsAddr = options.dnsAddr ?? Config.DNSADDR_DEFAULT this.debugCode = options.debugCode ?? Config.DEBUGCODE_DEFAULT + this.mine = options.mine ?? false + this.accounts = options.accounts ?? [] this.synchronized = false this.lastSyncDate = 0 @@ -288,7 +308,7 @@ export class Config { // Otherwise parse transports from transports option this.servers = parseTransports(this.transports).map((t) => { if (t.name === 'rlpx') { - const bootnodes = this.bootnodes ?? this.chainCommon.bootstrapNodes() + const bootnodes = this.bootnodes ?? (this.chainCommon.bootstrapNodes() as any) const dnsNetworks = options.dnsNetworks ?? this.chainCommon.dnsNetworks() return new RlpxServer({ config: this, bootnodes, dnsNetworks }) } else if (t.name === 'libp2p') { diff --git a/packages/client/lib/miner/index.ts b/packages/client/lib/miner/index.ts new file mode 100644 index 0000000000..c7d2f8496d --- /dev/null +++ b/packages/client/lib/miner/index.ts @@ -0,0 +1,5 @@ +/** + * @module miner + */ + +export * from './miner' diff --git a/packages/client/lib/miner/miner.ts b/packages/client/lib/miner/miner.ts new file mode 100644 index 0000000000..1c10a94b09 --- /dev/null +++ b/packages/client/lib/miner/miner.ts @@ -0,0 +1,258 @@ +import { BlockHeader } from '@ethereumjs/block' +import { BN } from 'ethereumjs-util' +import { ConsensusType } from '@ethereumjs/common' +import { Event } from '../types' +import { Config } from '../config' +import { FullSynchronizer } from '../sync' + +export interface MinerOptions { + /* Config */ + config: Config + + /* FullSynchronizer */ + synchronizer: FullSynchronizer +} + +/** + * @module miner + */ + +/** + * Implements Ethereum block creation and mining. + * @memberof module:miner + */ +export class Miner { + private DEFAULT_PERIOD = 15 + private config: Config + private synchronizer: FullSynchronizer + private assembling: boolean + private period: number + public running: boolean + + /* global NodeJS */ + private _nextAssemblyTimeoutId: NodeJS.Timeout | undefined + + /** + * Create miner + * @param options constructor parameters + */ + constructor(options: MinerOptions) { + this.config = options.config + this.synchronizer = options.synchronizer + this.running = false + this.assembling = false + this.period = (this.config.chainCommon.consensusConfig().period ?? this.DEFAULT_PERIOD) * 1000 // defined in ms for setTimeout use + } + + /** + * Convenience alias to return the latest block in the blockchain + */ + private latestBlockHeader(): BlockHeader { + return (this.synchronizer as any).chain.headers.latest + } + + /** + * Sets the timeout for the next block assembly + */ + private async queueNextAssembly(timeout?: number) { + if (this._nextAssemblyTimeoutId) { + clearTimeout(this._nextAssemblyTimeoutId) + } + timeout = timeout ?? this.period + if (this.config.chainCommon.consensusType() === ConsensusType.ProofOfAuthority) { + // EIP-225 spec: If the signer is out-of-turn, + // delay signing by rand(SIGNER_COUNT * 500ms) + const [signerAddress] = this.config.accounts[0] + const { blockchain } = this.synchronizer.execution.vm + const inTurn = await blockchain.cliqueSignerInTurn(signerAddress) + if (!inTurn) { + const signerCount = blockchain.cliqueActiveSigners().length + timeout += Math.random() * signerCount * 500 + } + } + this._nextAssemblyTimeoutId = setTimeout(this.assembleBlock.bind(this), timeout) + } + + /** + * Sets the next block assembly to latestBlock.timestamp + period + */ + private async chainUpdated() { + const latestBlockHeader = this.latestBlockHeader() + const target = latestBlockHeader.timestamp.muln(1000).addn(this.period).sub(new BN(Date.now())) + const timeout = BN.max(new BN(0), target).toNumber() + this.config.logger.debug( + `Miner: Chain updated with block ${latestBlockHeader.number.toNumber()}. Queuing next block assembly in ${Math.round( + timeout / 1000 + )}s` + ) + await this.queueNextAssembly(timeout) + } + + /** + * Start miner + */ + start(): boolean { + if (!this.config.mine || this.running) { + return false + } + this.running = true + this.config.events.on(Event.CHAIN_UPDATED, this.chainUpdated.bind(this)) + void this.queueNextAssembly() // void operator satisfies eslint rule for no-floating-promises + this.config.logger.info(`Miner started. Assembling next block in ${this.period / 1000}s`) + return true + } + + /** + * Assembles a block from txs in the TxPool and adds it to the chain. + * If a new block is received while assembling it will abort. + */ + async assembleBlock() { + if (this.assembling) { + return + } + this.assembling = true + + // Abort if a new block is received while assembling this block + let interrupt = false + const setInterrupt = () => { + interrupt = true + this.assembling = false + } + this.config.events.on(Event.CHAIN_UPDATED, setInterrupt.bind(this)) + + const parentBlockHeader = this.latestBlockHeader() + const number = parentBlockHeader.number.addn(1) + let { gasLimit } = parentBlockHeader + const [signerAddress, signerPrivKey] = this.config.accounts[0] + + // Abort if we have too recently signed + if (this.config.chainCommon.consensusType() === ConsensusType.ProofOfAuthority) { + const header = BlockHeader.fromHeaderData( + { number }, + { common: this.config.chainCommon, cliqueSigner: signerPrivKey } + ) + if ((this.synchronizer.execution.vm.blockchain as any).cliqueCheckRecentlySigned(header)) { + this.config.logger.info(`Miner: We have too recently signed, waiting for next block`) + this.assembling = false + return + } + } + + // Use a copy of the vm to not modify the existing state. + // The state will be updated when the newly assembled block + // is inserted into the canonical chain. + const vmCopy = this.synchronizer.execution.vm.copy() + + if (parentBlockHeader.number.isZero()) { + // In the current architecture of the client, + // if we are on the genesis block the canonical genesis state + // will not have been initialized yet in the execution vm + // since the following line won't be reached: + // https://github.com/ethereumjs/ethereumjs-monorepo/blob/c008e8eb76f520df83eb47c769e3a006bc24124f/packages/client/lib/sync/execution/vmexecution.ts#L100 + // So we will do it here: + await vmCopy.stateManager.generateCanonicalGenesis() + } else { + // Set the state root to ensure the resulting state + // is based on the parent block's state + await vmCopy.stateManager.setStateRoot(parentBlockHeader.stateRoot) + } + + let difficulty + if (this.config.chainCommon.consensusType() === ConsensusType.ProofOfAuthority) { + // Determine if signer is INTURN (2) or NOTURN (1) + const inTurn = await vmCopy.blockchain.cliqueSignerInTurn(signerAddress) + difficulty = inTurn ? 2 : 1 + } + + let baseFeePerGas + const londonHardforkBlock = this.config.chainCommon.hardforkBlockBN('london') + const isInitialEIP1559Block = londonHardforkBlock && number.eq(londonHardforkBlock) + if (isInitialEIP1559Block) { + // Get baseFeePerGas from `paramByEIP` since 1559 not currently active on common + baseFeePerGas = new BN( + this.config.chainCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559) + ) + // Set initial EIP1559 block gas limit to 2x parent gas limit per logic in `block.validateGasLimit` + gasLimit = gasLimit.muln(2) + } else if (this.config.chainCommon.isActivatedEIP(1559)) { + baseFeePerGas = parentBlockHeader.calcNextBaseFee() + } + const parentBlock = (this.synchronizer as any).chain.blocks.latest + const blockBuilder = await vmCopy.buildBlock({ + parentBlock, + headerData: { + number, + difficulty, + gasLimit, + baseFeePerGas, + }, + blockOpts: { + cliqueSigner: signerPrivKey, + hardforkByBlockNumber: true, + }, + }) + + const txs = await this.synchronizer.txPool.txsByPriceAndNonce( + vmCopy.stateManager, + baseFeePerGas + ) + this.config.logger.info( + `Miner: Assembling block from ${txs.length} eligible txs ${ + baseFeePerGas ? `(baseFee: ${baseFeePerGas.toNumber()})` : '' + }` + ) + let index = 0 + let blockFull = false + while (index < txs.length && !blockFull && !interrupt) { + try { + await blockBuilder.addTransaction(txs[index]) + } catch (error: any) { + if (error.message === 'tx has a higher gas limit than the remaining gas in the block') { + if (blockBuilder.gasUsed.gt(gasLimit.subn(21000))) { + // If block has less than 21000 gas remaining, consider it full + blockFull = true + this.config.logger.debug( + `Miner: Assembled block full (gasLeft: ${gasLimit + .sub(blockBuilder.gasUsed) + .toNumber()})` + ) + } + } else { + // If there is an error adding a tx, it will be skipped + const hash = '0x' + txs[index].hash().toString('hex') + this.config.logger.debug( + `Skipping tx ${hash}, error encountered when trying to add tx:\n${error}` + ) + } + } + index++ + } + if (interrupt) return + // Build block, sealing it + const block = await blockBuilder.build() + this.config.logger.info(`Miner: Sealed block with ${block.transactions.length} txs`) + this.assembling = false + if (interrupt) return + // Put block in blockchain + await this.synchronizer.handleNewBlock(block) + // Remove included txs from TxPool + this.synchronizer.txPool.removeNewBlockTxs([block]) + this.config.events.removeListener(Event.CHAIN_UPDATED, setInterrupt.bind(this)) + } + + /** + * Stop miner execution + */ + stop(): boolean { + if (!this.running) { + return false + } + this.config.events.removeListener(Event.CHAIN_UPDATED, this.chainUpdated.bind(this)) + if (this._nextAssemblyTimeoutId) { + clearTimeout(this._nextAssemblyTimeoutId) + } + this.running = false + this.config.logger.info('Miner stopped.') + return true + } +} diff --git a/packages/client/lib/net/protocol/ethprotocol.ts b/packages/client/lib/net/protocol/ethprotocol.ts index f2acc66468..2ad68bb1d6 100644 --- a/packages/client/lib/net/protocol/ethprotocol.ts +++ b/packages/client/lib/net/protocol/ethprotocol.ts @@ -142,7 +142,7 @@ export class EthProtocol extends Protocol { { name: 'NewBlock', code: 0x07, - encode: ([block, td]: [Block, BN]) => [block.raw(), td.toBuffer()], + encode: ([block, td]: [Block, BN]) => [block.raw(), td.toArrayLike(Buffer)], decode: ([block, td]: [BlockBuffer, Buffer]) => [ Block.fromValuesArray(block, { // eslint-disable-next-line no-invalid-this diff --git a/packages/client/lib/rpc/modules/eth.ts b/packages/client/lib/rpc/modules/eth.ts index 325c40788b..3d871e9d85 100644 --- a/packages/client/lib/rpc/modules/eth.ts +++ b/packages/client/lib/rpc/modules/eth.ts @@ -471,7 +471,8 @@ export class Eth { try { const common = this.client.config.chainCommon.copy() - if (!this.service.synchronizer.syncTargetHeight) { + const { syncTargetHeight } = this.service.synchronizer + if (!syncTargetHeight && !this.client.config.mine) { return { code: INTERNAL_ERROR, message: `client is not aware of the current chain height yet (give sync some more time)`, @@ -479,7 +480,9 @@ export class Eth { } // Set the tx common to an appropriate HF to create a tx // with matching HF rules - common.setHardforkByBlockNumber(this.service.synchronizer.syncTargetHeight) + if (syncTargetHeight) { + common.setHardforkByBlockNumber(syncTargetHeight) + } const tx = TransactionFactory.fromSerializedData(toBuffer(serializedTx), { common }) if (!tx.isSigned()) { return { @@ -489,13 +492,11 @@ export class Eth { } // Add the tx to own tx pool - // TODO: eslint is giving an "Insert `;`" error, retest periodically or fix - // eslint-disable-next-line - const txPool = (this.service.synchronizer as FullSynchronizer).txPool + const { txPool } = this.service.synchronizer as FullSynchronizer txPool.add(tx) const peerPool = this.service.pool - if (peerPool.peers.length === 0) { + if (peerPool.peers.length === 0 && !this.client.config.mine) { return { code: INTERNAL_ERROR, message: `no peer connection available`, diff --git a/packages/client/lib/service/fullethereumservice.ts b/packages/client/lib/service/fullethereumservice.ts index 4d142498fa..a8197f9f0e 100644 --- a/packages/client/lib/service/fullethereumservice.ts +++ b/packages/client/lib/service/fullethereumservice.ts @@ -4,6 +4,7 @@ import { EthProtocol } from '../net/protocol/ethprotocol' import { LesProtocol } from '../net/protocol/lesprotocol' import { Peer } from '../net/peer/peer' import { Protocol } from '../net/protocol' +import { Miner } from '../miner' interface FullEthereumServiceOptions extends EthereumServiceOptions { /* Serve LES requests (default: false) */ @@ -17,6 +18,7 @@ interface FullEthereumServiceOptions extends EthereumServiceOptions { export class FullEthereumService extends EthereumService { public synchronizer: FullSynchronizer public lightserv: boolean + public miner: Miner | undefined /** * Create new ETH service @@ -36,6 +38,31 @@ export class FullEthereumService extends EthereumService { stateDB: options.stateDB, interval: this.interval, }) + + if (this.config.mine) { + this.miner = new Miner({ + config: this.config, + synchronizer: this.synchronizer, + }) + } + } + + /** + * Start service + * @return {Promise} + */ + async start(): Promise { + await super.start() + this.miner?.start() + } + + /** + * Stop service + * @return {Promise} + */ + async stop(): Promise { + this.miner?.stop() + await super.stop() } /** @@ -97,7 +124,7 @@ export class FullEthereumService extends EthereumService { } else if (message.name === 'Transactions') { await this.synchronizer.txPool.handleAnnouncedTxs(message.data, peer, this.pool) } else if (message.name === 'NewBlock') { - await this.synchronizer.handleNewBlock(message.data[0]) + await this.synchronizer.handleNewBlock(message.data[0], peer) } else if (message.name === 'NewPooledTransactionHashes') { await this.synchronizer.txPool.handleAnnouncedTxHashes(message.data, peer, this.pool) } else if (message.name === 'GetPooledTransactions') { diff --git a/packages/client/lib/sync/execution/vmexecution.ts b/packages/client/lib/sync/execution/vmexecution.ts index 6a7fbd3dae..08fae3a8d2 100644 --- a/packages/client/lib/sync/execution/vmexecution.ts +++ b/packages/client/lib/sync/execution/vmexecution.ts @@ -157,7 +157,7 @@ export class VMExecution extends Execution { const blockNumber = block.header.number.toNumber() const hash = short(block.hash()) this.config.logger.warn( - `Execution of block number=${blockNumber} hash=${hash} hardfork=${this.hardfork} failed` + `Execution of block number=${blockNumber} hash=${hash} hardfork=${this.hardfork} failed:\n${error}` ) if (this.config.debugCode) { await debugCodeReplayBlock(this, block) diff --git a/packages/client/lib/sync/fetcher/blockfetcherbase.ts b/packages/client/lib/sync/fetcher/blockfetcherbase.ts index ddf121179e..f3fb5b2d5f 100644 --- a/packages/client/lib/sync/fetcher/blockfetcherbase.ts +++ b/packages/client/lib/sync/fetcher/blockfetcherbase.ts @@ -60,4 +60,47 @@ export abstract class BlockFetcherBase extends Fetcher< } return tasks } + + /** + * Create new tasks based on the list with + * block/header numbers provided. + * + * If numbers are sequential request is created + * as bulk request. + * + * @param numberList Block/header numbers + * @param min Start block number + */ + enqueueByNumberList(numberList: BN[], min: BN) { + const numBlocks = numberList.length + let bulkRequest = true + const seqCheckNum = min.clone() + for (let num = 1; num <= numBlocks; num++) { + if (!numberList.map((num) => num.toString()).includes(seqCheckNum.toString())) { + bulkRequest = false + break + } + seqCheckNum.iaddn(1) + } + + if (bulkRequest) { + this.enqueueTask( + { + first: min, + count: numBlocks, + }, + true + ) + } else { + numberList.forEach((first) => { + this.enqueueTask( + { + first, + count: 1, + }, + true + ) + }) + } + } } diff --git a/packages/client/lib/sync/fetcher/fetcher.ts b/packages/client/lib/sync/fetcher/fetcher.ts index 8aa8afdbfc..59514fac14 100644 --- a/packages/client/lib/sync/fetcher/fetcher.ts +++ b/packages/client/lib/sync/fetcher/fetcher.ts @@ -1,12 +1,10 @@ import { Readable, Writable } from 'stream' -const Heap = require('qheap') - +import Heap from 'qheap' import { PeerPool } from '../../net/peerpool' +import { Peer } from '../../net/peer' import { Config } from '../../config' - -import { Event, QHeap } from '../../types' +import { Event } from '../../types' import { Job } from './types' -import { Peer } from '../../net/peer' export interface FetcherOptions { /* Common chain config*/ @@ -48,8 +46,8 @@ export abstract class Fetcher extends Readable protected interval: number protected banTime: number protected maxQueue: number - protected in: QHeap> - protected out: QHeap> + protected in: Heap> + protected out: Heap> protected total: number protected processed: number // number of processed tasks, awaiting the write job protected finished: number // number of tasks which are both processed and also finished writing diff --git a/packages/client/lib/sync/fullsync.ts b/packages/client/lib/sync/fullsync.ts index 2258861d73..e1560764ee 100644 --- a/packages/client/lib/sync/fullsync.ts +++ b/packages/client/lib/sync/fullsync.ts @@ -8,18 +8,26 @@ import { VMExecution } from './execution/vmexecution' import { TxPool } from './txpool' import { Event } from '../types' +interface HandledObject { + hash: Buffer + added: number +} + +type PeerId = string /** * Implements an ethereum full sync synchronizer * @memberof module:sync */ export class FullSynchronizer extends Synchronizer { public execution: VMExecution - public txPool: TxPool + private newBlocksKnownByPeer: Map + constructor(options: SynchronizerOptions) { super(options) + this.newBlocksKnownByPeer = new Map() this.execution = new VMExecution({ config: options.config, stateDB: options.stateDB, @@ -72,11 +80,14 @@ export class FullSynchronizer extends Synchronizer { hash )} hardfork=${this.config.chainCommon.hardfork()}` ) + if (this.config.mine) { + // Start the TxPool immediately if mining + this.txPool.start() + } } /** * Returns true if peer can be used for syncing - * @return {boolean} */ syncable(peer: Peer): boolean { return peer.eth !== undefined @@ -106,7 +117,7 @@ export class FullSynchronizer extends Synchronizer { /** * Get latest header of peer - * @return {Promise} Resolves with header + * @return Resolves with header */ async latest(peer: Peer) { const result = await peer.eth?.getBlockHeaders({ @@ -199,25 +210,123 @@ export class FullSynchronizer extends Synchronizer { }) } + /** + * Add newly broadcasted blocks to peer record + * @param blockHash hash of block received in NEW_BLOCK message + * @param peer + * @returns True if block has already been sent to peer + */ + private addToKnownByPeer(blockHash: Buffer, peer: Peer): boolean { + const knownBlocks = this.newBlocksKnownByPeer.get(peer.id) ?? [] + if (knownBlocks.find((knownBlock) => knownBlock.hash.equals(blockHash))) { + return true + } + knownBlocks.push({ hash: blockHash, added: Date.now() }) + this.newBlocksKnownByPeer.set(peer.id, knownBlocks) + return false + } + + /** + * Send (broadcast) a new block to connected peers. + * @param Block + * @param peers + */ + async sendNewBlock(block: Block, peers: Peer[]) { + for (const peer of peers) { + const alreadyKnownByPeer = this.addToKnownByPeer(block.hash(), peer) + if (!alreadyKnownByPeer) { + peer.eth?.send('NewBlock', [block, this.chain.blocks.td]) + } + } + } + /** * - * Processes `NEW_BLOCK` announcement from a peer and inserts into local chain if child of chain tip + * Handles `NEW_BLOCK` announcement from a peer and inserts into local chain if child of chain tip * @param blockData `NEW_BLOCK` received from peer + * @param peer `Peer` that sent `NEW_BLOCK` announcement */ - async handleNewBlock(block: Block) { - const chainTip = (await this.chain.getLatestHeader()).hash() - // If block parent is current chain tip, insert block into chain - if (chainTip.toString('hex') === block.header.parentHash.toString('hex')) { + async handleNewBlock(block: Block, peer?: Peer) { + if (peer) { + // Don't send NEW_BLOCK announcement to peer that sent original new block message + this.addToKnownByPeer(block.hash(), peer) + } + try { + await block.header.validate(this.chain.blockchain) + } catch (err) { + this.config.logger.debug( + `Error processing new block from peer: ${ + peer ? short(Buffer.from(peer.id)) : 'no peer' + } hash: ${short(block.hash())}` + ) + this.config.logger.debug(err) + return + } + // Send NEW_BLOCK to square root of total number of peers in pool + // https://github.com/ethereum/devp2p/blob/master/caps/eth.md#block-propagation + const numPeersToShareWith = Math.floor(Math.sqrt(this.pool.peers.length)) + await this.sendNewBlock(block, this.pool.peers.slice(0, numPeersToShareWith)) + if (this.chain.blocks.latest?.hash().equals(block.header.parentHash)) { + // If new block is child of current chain tip, insert new block into chain await this.chain.putBlocks([block]) + // Check if new sync target height can be set + const blockNumber = block.header.number + if (!this.syncTargetHeight || blockNumber.gt(this.syncTargetHeight)) { + this.syncTargetHeight = blockNumber + } } else { - // If block is beyond current tip, handle as `NEW_BLOCK_HASHES` - this.handleNewBlockHashes([[block.header.hash(), block.header.number]]) + // Call handleNewBlockHashes to retrieve all blocks between chain tip and new block + this.handleNewBlockHashes([[block.hash(), block.header.number]]) + } + for (const peer of this.pool.peers.slice(numPeersToShareWith)) { + // Send `NEW_BLOCK_HASHES` message for received block to all other peers + const alreadyKnownByPeer = this.addToKnownByPeer(block.hash(), peer) + if (!alreadyKnownByPeer) { + peer.eth?.send('NewBlockHashes', [[block.hash(), block.header.number]]) + } } } + /** + * Chain was updated, new block hashes received + * @param data new block hash announcements + */ + handleNewBlockHashes(data: [Buffer, BN][]) { + if (!data.length) { + return + } + if (!this.fetcher) { + return + } + let min = new BN(-1) + let newSyncHeight + const blockNumberList: BN[] = [] + data.forEach((value) => { + const blockNumber = value[1] + blockNumberList.push(blockNumber) + if (min.eqn(-1) || blockNumber.lt(min)) { + min = blockNumber + } + + // Check if new sync target height can be set + if (!this.syncTargetHeight || blockNumber.gt(this.syncTargetHeight)) { + newSyncHeight = blockNumber + } + }) + + if (!newSyncHeight) { + return + } + this.syncTargetHeight = newSyncHeight + const [hash, height] = data[data.length - 1] + this.config.logger.info( + `New sync target height number=${height.toString(10)} hash=${short(hash)}` + ) + this.fetcher.enqueueByNumberList(blockNumberList, min) + } + /** * Stop synchronization. Returns a promise that resolves once its stopped. - * @return {Promise} */ async stop(): Promise { this.execution.syncing = false @@ -230,9 +339,7 @@ export class FullSynchronizer extends Synchronizer { if (this.fetcher) { this.fetcher.destroy() - // TODO: Should this be deleted? - // @ts-ignore: error: The operand of a 'delete' operator must be optional - delete this.fetcher + this.fetcher = null } await super.stop() @@ -241,7 +348,6 @@ export class FullSynchronizer extends Synchronizer { /** * Close synchronizer. - * @return {Promise} */ async close() { if (this.opened) { diff --git a/packages/client/lib/sync/lightsync.ts b/packages/client/lib/sync/lightsync.ts index 2388986d6c..5eea7e89f2 100644 --- a/packages/client/lib/sync/lightsync.ts +++ b/packages/client/lib/sync/lightsync.ts @@ -2,7 +2,7 @@ import { BN } from 'ethereumjs-util' import { BlockHeader } from '@ethereumjs/block' import { Peer } from '../net/peer/peer' import { Synchronizer, SynchronizerOptions } from './sync' -import { HeaderFetcher } from './fetcher/headerfetcher' +import { HeaderFetcher } from './fetcher' import { short } from '../util' import { Event } from '../types' @@ -155,9 +155,7 @@ export class LightSynchronizer extends Synchronizer { } if (this.fetcher) { this.fetcher.destroy() - // TODO: Should this be deleted? - // @ts-ignore: error: The operand of a 'delete' operator must be optional - delete this.fetcher + this.fetcher = null } await super.stop() return true diff --git a/packages/client/lib/sync/sync.ts b/packages/client/lib/sync/sync.ts index b195ae6e9e..7c8746b289 100644 --- a/packages/client/lib/sync/sync.ts +++ b/packages/client/lib/sync/sync.ts @@ -178,75 +178,6 @@ export abstract class Synchronizer { return this.syncWithPeer(peer) } - /** - * Chain was updated, new block hashes received - * @param {[blockhash, number][]} data new block hash announcements - */ - handleNewBlockHashes(data: [Buffer, BN][]) { - if (!data.length) { - return - } - let min = new BN(-1) - let newSyncHeight - const blockNumberList: string[] = [] - data.forEach((value) => { - const blockNumber = value[1] - blockNumberList.push(blockNumber.toString()) - if (min.eqn(-1) || blockNumber.lt(min)) { - min = blockNumber - } - - // Check if new sync target height can be set - if (!this.syncTargetHeight || blockNumber.gt(this.syncTargetHeight)) { - newSyncHeight = blockNumber - } - }) - if (min.eqn(-1)) { - return - } - if (newSyncHeight) { - this.syncTargetHeight = newSyncHeight - const [hash, height] = data[data.length - 1] - this.config.logger.info( - `New sync target height number=${height.toString(10)} hash=${short(hash)}` - ) - } - - const numBlocks = blockNumberList.length - - // check if we can request the blocks in bulk - let bulkRequest = true - const minCopy = min.clone() - for (let num = 1; num < numBlocks; num++) { - min.iaddn(1) - if (!blockNumberList.includes(min.toString())) { - bulkRequest = false - break - } - } - - if (bulkRequest) { - this.fetcher!.enqueueTask( - { - first: minCopy, - count: numBlocks, - }, - true - ) - } else { - data.forEach((value) => { - const blockNumber = value[1] - this.fetcher!.enqueueTask( - { - first: blockNumber, - count: 1, - }, - true - ) - }) - } - } - async stop(): Promise { if (!this.running) { return false diff --git a/packages/client/lib/sync/txpool.ts b/packages/client/lib/sync/txpool.ts index f9f7ef8edb..a632d9c544 100644 --- a/packages/client/lib/sync/txpool.ts +++ b/packages/client/lib/sync/txpool.ts @@ -1,9 +1,17 @@ -import { TypedTransaction } from '@ethereumjs/tx' +import Heap from 'qheap' +import { + Capability, + FeeMarketEIP1559Transaction, + Transaction, + TypedTransaction, +} from '@ethereumjs/tx' +import { Address, BN } from 'ethereumjs-util' import { Config } from '../config' import { Peer } from '../net/peer' import { EthProtocolMethods } from '../net/protocol' -import type { Block } from '@ethereumjs/block' import { PeerPool } from '../net/peerpool' +import type { Block } from '@ethereumjs/block' +import type { StateManager } from '@ethereumjs/vm/dist/state' export interface TxPoolOptions { /* Config */ @@ -157,14 +165,14 @@ export class TxPool { * @param tx Transaction */ add(tx: TypedTransaction) { - const sender: UnprefixedAddress = tx.getSenderAddress().toString() + const sender: UnprefixedAddress = tx.getSenderAddress().toString().slice(2) const inPool = this.pool.get(sender) let add: TxPoolObject[] = [] if (inPool) { // Replace pooled txs with the same nonce add = inPool.filter((poolObj) => !poolObj.tx.nonce.eq(tx.nonce)) } - const address: UnprefixedAddress = tx.getSenderAddress().toString() + const address: UnprefixedAddress = tx.getSenderAddress().toString().slice(2) const hash: UnprefixedHash = tx.hash().toString('hex') const added = Date.now() add.push({ tx, added, hash }) @@ -356,7 +364,7 @@ export class TxPool { this.config.logger.debug( `TxPool: requesting txs number=${reqHashes.length} pending=${this.pending.length}` ) - const [, txs] = await (peer!.eth as EthProtocolMethods).getPooledTransactions({ + const [_, txs] = await (peer!.eth as EthProtocolMethods).getPooledTransactions({ hashes: reqHashes.slice(0, this.TX_RETRIEVAL_LIMIT), }) @@ -419,6 +427,100 @@ export class TxPool { }) } + /** + * Helper to return a normalized gas price across different + * transaction types. Providing the baseFee param returns the + * priority tip, and omitting it returns the max total fee. + * @param tx The tx + * @param baseFee Provide a baseFee to subtract from the legacy + * gasPrice to determine the leftover priority tip. + */ + private txGasPrice(tx: TypedTransaction, baseFee?: BN) { + const supports1559 = tx.supports(Capability.EIP1559FeeMarket) + if (baseFee) { + if (supports1559) { + return (tx as FeeMarketEIP1559Transaction).maxPriorityFeePerGas + } else { + return (tx as Transaction).gasPrice.sub(baseFee) + } + } else { + if (supports1559) { + return (tx as FeeMarketEIP1559Transaction).maxFeePerGas + } else { + return (tx as Transaction).gasPrice + } + } + } + + /** + * Returns eligible txs to be mined sorted by price in such a way that the + * nonce orderings within a single account are maintained. + * + * Note, this is not as trivial as it seems from the first look as there are three + * different criteria that need to be taken into account (price, nonce, account + * match), which cannot be done with any plain sorting method, as certain items + * cannot be compared without context. + * + * This method first sorts the separates the list of transactions into individual + * sender accounts and sorts them by nonce. After the account nonce ordering is + * satisfied, the results are merged back together by price, always comparing only + * the head transaction from each account. This is done via a heap to keep it fast. + * + * @param stateManager Account nonces are queried to only include executable txs + * @param baseFee Provide a baseFee to exclude txs with a lower gasPrice + */ + async txsByPriceAndNonce(stateManager: StateManager, baseFee?: BN) { + const txs: TypedTransaction[] = [] + // Separate the transactions by account and sort by nonce + const byNonce = new Map() + for (const [address, poolObjects] of this.pool) { + let txsSortedByNonce = poolObjects + .map((obj) => obj.tx) + .sort((a, b) => a.nonce.sub(b.nonce).toNumber()) + // Check if the account nonce matches the lowest known tx nonce + const { nonce } = await stateManager.getAccount(new Address(Buffer.from(address, 'hex'))) + if (!txsSortedByNonce[0].nonce.eq(nonce)) { + // Account nonce does not match the lowest known tx nonce, + // therefore no txs from this address are currently exectuable + continue + } + if (baseFee) { + // If any tx has an insiffucient gasPrice, + // remove all txs after that since they cannot be executed + const found = txsSortedByNonce.findIndex((tx) => this.txGasPrice(tx).lt(baseFee)) + if (found > -1) { + txsSortedByNonce = txsSortedByNonce.slice(0, found) + } + } + byNonce.set(address, txsSortedByNonce) + } + // Initialize a price based heap with the head transactions + const byPrice = new Heap({ + comparBefore: (a: TypedTransaction, b: TypedTransaction) => + this.txGasPrice(b, baseFee).sub(this.txGasPrice(a, baseFee)).ltn(0), + }) + byNonce.forEach((txs, address) => { + byPrice.insert(txs[0]) + byNonce.set(address, txs.slice(1)) + }) + // Merge by replacing the best with the next from the same account + while (byPrice.length > 0) { + // Retrieve the next best transaction by price + const best = byPrice.remove() + if (!best) break + // Push in its place the next transaction from the same account + const address = best.getSenderAddress().toString().slice(2) + const accTxs = byNonce.get(address)! + if (accTxs.length > 0) { + byPrice.insert(accTxs[0]) + byNonce.set(address, accTxs.slice(1)) + } + // Accumulate the best priced transaction + txs.push(best) + } + return txs + } + /** * Stop pool execution */ diff --git a/packages/client/lib/types.ts b/packages/client/lib/types.ts index d0e1f0ae23..213c753a52 100644 --- a/packages/client/lib/types.ts +++ b/packages/client/lib/types.ts @@ -53,7 +53,7 @@ export declare interface EventBus { on(event: T, listener: (...args: EventParams[T]) => void): this } -// eslint-disable-next-line no-redeclare, @typescript-eslint/no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars export class EventBus extends EventEmitter {} export type EventBusType = EventBus & EventBus & @@ -90,27 +90,3 @@ export type DnsNetwork = string */ export type Libp2pConnection = Connection export type Libp2pMuxedStream = MuxedStream - -/** - * QHeap types. - * @types/qheap does not exist, so we define a custom interface here. - */ -type QHeapOptions = { - comparBefore(a: any, b: any): boolean - compar(a: any, b: any): number - freeSpace: number - size: number -} -export interface QHeap { - // eslint-disable-next-line @typescript-eslint/no-misused-new - new (opts: QHeapOptions): QHeap - insert(item: T): void - push(item: T): void - enqueue(item: T): void - remove(): T | undefined - shift(): T | undefined - dequeue(): T | undefined - peek(): T | undefined - length: number - gc(opts: { minLength: number; maxLength: number }): void -} diff --git a/packages/client/lib/util/parse.ts b/packages/client/lib/util/parse.ts index 14b58be602..1d6df211ea 100644 --- a/packages/client/lib/util/parse.ts +++ b/packages/client/lib/util/parse.ts @@ -217,10 +217,12 @@ async function parseGethParams(json: any) { berlin: 'berlinBlock', london: 'londonBlock', } - params.hardforks = hardforks.map((name) => ({ - name: name, - block: name === 'chainstart' ? 0 : config[forkMap[name]] ?? null, - })) + params.hardforks = hardforks + .map((name) => ({ + name: name, + block: name === 'chainstart' ? 0 : config[forkMap[name]] ?? null, + })) + .filter((fork) => fork.block !== null) return params } /** diff --git a/packages/client/package.json b/packages/client/package.json index 2f9deab7c3..6e01118a96 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -30,7 +30,7 @@ "build": "npm run build:node && npm run build:browser", "build:node": "tsc --build ./tsconfig.prod.json", "build:browser": "tsc -p ./tsconfig.browser.json && npm run bundle && rm -rf dist.browser", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "bundle": "webpack", "client:start": "ts-node bin/cli.ts", @@ -45,19 +45,19 @@ "test:unit": "npm run tape -- 'test/!(integration|cli)/**/*.spec.ts' 'test/*.spec.ts'", "test:integration": "npm run tape -- 'test/integration/**/*.spec.ts'", "test:cli": "npm run tape -- 'test/cli/*.spec.ts'", - "test:browser": "karma start karma.conf.js" + "test:browser": "karma start karma.conf.js", + "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/devp2p": "^4.1.0", - "@ethereumjs/tx": "^3.3.0", - "@ethereumjs/vm": "^5.5.2", - "merkle-patricia-tree": "^4.2.1", + "@ethereumjs/block": "^3.5.1", + "@ethereumjs/blockchain": "^5.4.2", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/devp2p": "^4.2.0", + "@ethereumjs/tx": "^3.3.1", + "@ethereumjs/vm": "^5.5.3", "chalk": "^2.4.2", - "ethereumjs-util": "^7.1.0", - "fs-extra": "^7.0.1", + "ethereumjs-util": "^7.1.1", + "fs-extra": "^10.0.0", "it-pipe": "^1.1.0", "it-pushable": "^1.4.2", "jayson": "^3.4.4", @@ -66,10 +66,11 @@ "libp2p-bootstrap": "^0.12.2", "libp2p-interfaces": "^0.8.3", "libp2p-kad-dht": "^0.20.6", - "libp2p-noise": "^2.0.4", "libp2p-mplex": "^0.10.2", + "libp2p-noise": "^2.0.4", "libp2p-tcp": "^0.15.3", "libp2p-websockets": "^0.15.1", + "merkle-patricia-tree": "^4.2.1", "multiaddr": "^8.1.2", "peer-id": "^0.14.3", "qheap": "^1.4.0", @@ -79,10 +80,10 @@ }, "devDependencies": { "@babel/plugin-transform-spread": "^7.10.1", + "@types/fs-extra": "^8.1.0", "@types/levelup": "^4.3.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", - "@types/tape-catch": "^1.0.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "file-replace-loader": "^1.2.0", "it-pair": "^1.0.0", @@ -97,13 +98,12 @@ "pino-pretty": "^2.2.2", "pull-pair": "^1.1.0", "supertest": "^6.1.3", - "tape": "^4.10.1", - "tape-catch": "~1.0.6", + "tape": "^5.3.1", "testdouble": "^3.8.2", "testdouble-timers": "^0.1.1", "ts-loader": "^7.0.5", - "typedoc": "^0.21.5", "ts-node": "^10.2.1", + "typedoc": "^0.22.4", "typescript": "^4.4.2", "webpack": "^4.43.0", "webpack-cli": "^3.3.11" diff --git a/packages/client/test/cli/cli.spec.ts b/packages/client/test/cli/cli.spec.ts index a121764f43..6bb2451c80 100644 --- a/packages/client/test/cli/cli.spec.ts +++ b/packages/client/test/cli/cli.spec.ts @@ -12,20 +12,13 @@ tape('[CLI]', (t) => { const child = spawn(process.execPath, [file, ...cliArgs]) let hasEnded = false - - const timeout = setTimeout(() => { - t.fail('timed out before finishing') - // eslint-disable-next-line @typescript-eslint/no-use-before-define - end() - }, 240000) - const end = () => { - clearTimeout(timeout) - if (!hasEnded) { - hasEnded = true - child.kill('SIGINT') - t.end() - } + if (hasEnded) return + hasEnded = true + child.stdout.removeAllListeners() + child.stderr.removeAllListeners() + child.kill('SIGINT') + t.end() } child.stdout.on('data', (data) => { diff --git a/packages/client/test/client.spec.ts b/packages/client/test/client.spec.ts index de137f4632..dae1f8f9a9 100644 --- a/packages/client/test/client.spec.ts +++ b/packages/client/test/client.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { Config } from '../lib/config' import { PeerPool } from '../lib/net/peerpool' diff --git a/packages/client/test/config.spec.ts b/packages/client/test/config.spec.ts index 0933096d13..b11071c6d4 100644 --- a/packages/client/test/config.spec.ts +++ b/packages/client/test/config.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import { Config } from '../lib/config' import Common, { Chain } from '@ethereumjs/common' diff --git a/packages/client/test/integration/client.spec.ts b/packages/client/test/integration/client.spec.ts index 6d1ca286b3..59f68951b7 100644 --- a/packages/client/test/integration/client.spec.ts +++ b/packages/client/test/integration/client.spec.ts @@ -1,16 +1,16 @@ import tape from 'tape' import { Config } from '../../lib/config' import EthereumClient from '../../lib/client' -import MockServer from './mocks/mockserver' import { Event } from '../../lib/types' +import MockServer from './mocks/mockserver' tape('[Integration:EthereumClient]', (t) => { const serverConfig = new Config({ loglevel: 'error' }) const servers = [new MockServer({ config: serverConfig }) as any] const config = new Config({ servers, syncmode: 'full', lightserv: false, loglevel: 'error' }) - //@ts-ignore -- attach server to centralized event bus - config.servers[0].config.events = config.events + // attach server to centralized event bus + ;(config.servers[0].config as any).events = config.events const node = new EthereumClient({ config }) t.test('should start/stop', async (t) => { diff --git a/packages/client/test/integration/fullethereumservice.spec.ts b/packages/client/test/integration/fullethereumservice.spec.ts index 8964546870..892ce762fc 100644 --- a/packages/client/test/integration/fullethereumservice.spec.ts +++ b/packages/client/test/integration/fullethereumservice.spec.ts @@ -1,21 +1,21 @@ import tape from 'tape' +import Blockchain from '@ethereumjs/blockchain' +import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' +import { Block } from '@ethereumjs/block' import { BN, toBuffer } from 'ethereumjs-util' import { Config } from '../../lib/config' import { FullEthereumService } from '../../lib/service' +import { Event } from '../../lib/types' import MockServer from './mocks/mockserver' import MockChain from './mocks/mockchain' import { destroy } from './util' -import Blockchain from '@ethereumjs/blockchain' -import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' -import { Block } from '@ethereumjs/block' -import { Event } from '../../lib/types' tape('[Integration:FullEthereumService]', async (t) => { async function setup(): Promise<[MockServer, FullEthereumService]> { const loglevel = 'error' const config = new Config({ loglevel }) const server = new MockServer({ config }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false, }) @@ -35,6 +35,7 @@ tape('[Integration:FullEthereumService]', async (t) => { } t.test('should handle ETH requests', async (t) => { + t.plan(8) const [server, service] = await setup() const peer = await server.accept('peer0') const [reqId1, headers] = await peer.eth!.getBlockHeaders({ block: new BN(1), max: 2 }) @@ -53,24 +54,28 @@ tape('[Integration:FullEthereumService]', async (t) => { t.pass('handled NewBlockHashes') break } - case 'NewBlock': - { - { - t.pass('handled NewBlock') - await destroy(server, service) - t.end() - } - } + case 'NewBlock': { + t.pass('handled NewBlock') + await destroy(server, service) break + } } }) peer.eth!.send('NewBlockHashes', [[hash, new BN(2)]]) + const block = Block.fromBlockData({ + header: { + number: 1, + difficulty: 1, + }, + }) + peer.eth!.send('NewBlock', [block, new BN(1)]) + const txData = '0x02f90108018001018402625a0094cccccccccccccccccccccccccccccccccccccccc830186a0b8441a8451e600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f85bf859940000000000000000000000000000000000000101f842a00000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000060a701a0afb6e247b1c490e284053c87ab5f6b59e219d51f743f7a4d83e400782bc7e4b9a0479a268e0e0acd4de3f1e28e4fac2a6b32a4195e8dfa9d19147abe8807aa6f64' const tx = FeeMarketEIP1559Transaction.fromSerializedTx(toBuffer(txData)) service.synchronizer.txPool.add(tx) - const [, txs] = await peer.eth!.getPooledTransactions({ hashes: [tx.hash()] }) + const [_, txs] = await peer.eth!.getPooledTransactions({ hashes: [tx.hash()] }) t.equal( txs[0].hash().toString('hex'), tx.hash().toString('hex'), @@ -79,13 +84,6 @@ tape('[Integration:FullEthereumService]', async (t) => { peer.eth!.send('Transactions', [tx]) t.pass('handled Transactions') - const block = Block.fromBlockData({ - header: { - number: 1, - difficulty: 1, - }, - }) - peer.eth!.send('NewBlock', [block, new BN(1)]) }) t.test('should handle LES requests', async (t) => { @@ -98,6 +96,5 @@ tape('[Integration:FullEthereumService]', async (t) => { 'handled GetBlockHeaders' ) await destroy(server, service) - t.end() }) }) diff --git a/packages/client/test/integration/fullsync.spec.ts b/packages/client/test/integration/fullsync.spec.ts index cbb378b538..85dc013415 100644 --- a/packages/client/test/integration/fullsync.spec.ts +++ b/packages/client/test/integration/fullsync.spec.ts @@ -1,6 +1,7 @@ import tape from 'tape' import { Event } from '../../lib/types' import { wait, setup, destroy } from './util' + tape('[Integration:FullSync]', async (t) => { t.test('should sync blocks', async (t) => { const [remoteServer, remoteService] = await setup({ location: '127.0.0.2', height: 20 }) @@ -11,7 +12,6 @@ tape('[Integration:FullSync]', async (t) => { t.equals(localService.chain.blocks.height.toNumber(), 20, 'synced') await destroy(localServer, localService) await destroy(remoteServer, remoteService) - t.end() }) await localService.synchronizer.start() }) @@ -27,7 +27,6 @@ tape('[Integration:FullSync]', async (t) => { await destroy(localServer, localService) await destroy(remoteServer, remoteService) t.pass('did not sync') - t.end() }) t.test('should sync with best peer', async (t) => { @@ -48,7 +47,6 @@ tape('[Integration:FullSync]', async (t) => { await destroy(remoteServer1, remoteService1) await destroy(remoteServer2, remoteService2) await destroy(localServer, localService) - t.end() } }) await localService.synchronizer.start() diff --git a/packages/client/test/integration/lightsync.spec.ts b/packages/client/test/integration/lightsync.spec.ts index 37f2cf4a82..b724c800f2 100644 --- a/packages/client/test/integration/lightsync.spec.ts +++ b/packages/client/test/integration/lightsync.spec.ts @@ -20,7 +20,6 @@ tape('[Integration:LightSync]', async (t) => { t.equals(localService.chain.headers.height.toNumber(), 20, 'synced') await destroy(localServer, localService) await destroy(remoteServer, remoteService) - t.end() }) await localService.synchronizer.start() }) @@ -44,7 +43,6 @@ tape('[Integration:LightSync]', async (t) => { await destroy(localServer, localService) await destroy(remoteServer, remoteService) t.pass('did not sync') - t.end() }) t.test('should sync with best peer', async (t) => { @@ -72,7 +70,6 @@ tape('[Integration:LightSync]', async (t) => { await destroy(localServer, localService) await destroy(remoteServer1, remoteService1) await destroy(remoteServer2, remoteService2) - t.end() } }) await localService.synchronizer.start() diff --git a/packages/client/test/integration/miner.spec.ts b/packages/client/test/integration/miner.spec.ts new file mode 100644 index 0000000000..023c346732 --- /dev/null +++ b/packages/client/test/integration/miner.spec.ts @@ -0,0 +1,90 @@ +import tape from 'tape' +import Blockchain from '@ethereumjs/blockchain' +import Common, { Chain as ChainCommon, ConsensusType, ConsensusAlgorithm } from '@ethereumjs/common' +import { BN, Address } from 'ethereumjs-util' +import { Config } from '../../lib/config' +import { Chain } from '../../lib/blockchain' +import { FullEthereumService } from '../../lib/service' +import { Event } from '../../lib/types' +import MockServer from './mocks/mockserver' +import { setup, destroy } from './util' + +tape('[Integration:Miner]', async (t) => { + const common = Common.custom( + { + consensus: { + type: ConsensusType.ProofOfAuthority, + algorithm: ConsensusAlgorithm.Clique, + clique: { + period: 1, // use 1s period for quicker test execution + epoch: 30000, + }, + }, + }, + { baseChain: ChainCommon.Rinkeby } + ) + const accounts: [Address, Buffer][] = [ + [ + new Address(Buffer.from('0b90087d864e82a284dca15923f3776de6bb016f', 'hex')), + Buffer.from('64bf9cc30328b0e42387b3c82c614e6386259136235e20c1357bd11cdee86993', 'hex'), + ], + ] + async function minerSetup(): Promise<[MockServer, FullEthereumService]> { + const loglevel = 'error' + const config = new Config({ loglevel, common }) + const server = new MockServer({ config }) + + const blockchain = await Blockchain.create({ + common, + validateBlocks: false, + validateConsensus: false, + }) + blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub + const chain = new Chain({ config, blockchain }) + const serviceConfig = new Config({ + loglevel, + common, + servers: [server as any], + mine: true, + accounts, + }) + // attach chain to centralized event bus + ;(chain.config as any).events = serviceConfig.events + const service = new FullEthereumService({ + config: serviceConfig, + chain, + }) + service.synchronizer.execution.run = async () => 1 // stub + await service.open() + await server.start() + await service.start() + return [server, service] + } + + t.test( + 'should mine blocks while a peer stays connected to tip of chain', + { timeout: 25000 }, + async (t) => { + const [server, service] = await minerSetup() + const [remoteServer, remoteService] = await setup({ + location: '127.0.0.2', + height: 0, + common, + }) + remoteService.chain.blockchain.cliqueActiveSigners = () => [accounts[0][0]] // stub + ;(remoteService.synchronizer as any).execution.run = async () => 1 // stub + await server.discover('remotePeer1', '127.0.0.2') + const targetHeight = new BN(5) + remoteService.config.events.on(Event.SYNC_SYNCHRONIZED, async (chainHeight) => { + if (chainHeight.eq(targetHeight)) { + t.ok(remoteService.chain.blocks.height.eq(targetHeight), 'synced blocks successfully') + await destroy(server, service) + await destroy(remoteServer, remoteService) + t.end() + } + }) + await remoteService.synchronizer.start() + await new Promise(() => {}) // resolves once t.end() is called + } + ) +}) diff --git a/packages/client/test/integration/mocks/mockchain.ts b/packages/client/test/integration/mocks/mockchain.ts index 141fc4edca..edf17d811f 100644 --- a/packages/client/test/integration/mocks/mockchain.ts +++ b/packages/client/test/integration/mocks/mockchain.ts @@ -28,7 +28,7 @@ export default class MockChain extends Chain { header: { number: number + 1, difficulty: 1, - parentHash: number ? blocks[number - 1].hash() : (this.genesis as any).hash, + parentHash: number ? blocks[number - 1].hash() : this.genesis.hash, }, }) blocks.push(block) diff --git a/packages/client/test/integration/mocks/network.ts b/packages/client/test/integration/mocks/network.ts index 81f80e7028..8fcff4957b 100644 --- a/packages/client/test/integration/mocks/network.ts +++ b/packages/client/test/integration/mocks/network.ts @@ -9,7 +9,7 @@ const Stream = function (protocols: string[]) { } } -// eslint-disable-next-line no-redeclare +// eslint-disable-next-line @typescript-eslint/no-redeclare export type Stream = ReturnType export type RemoteStream = ReturnType diff --git a/packages/client/test/integration/peerpool.spec.ts b/packages/client/test/integration/peerpool.spec.ts index f76185e7be..04d82b29e2 100644 --- a/packages/client/test/integration/peerpool.spec.ts +++ b/packages/client/test/integration/peerpool.spec.ts @@ -1,11 +1,12 @@ import tape from 'tape' +import Blockchain from '@ethereumjs/blockchain' import { Config } from '../../lib/config' +import { Event } from '../../lib/types' import { EthProtocol } from '../../lib/net/protocol' import { PeerPool } from '../../lib/net/peerpool' import MockServer from './mocks/mockserver' import MockChain from './mocks/mockchain' -import Blockchain from '@ethereumjs/blockchain' -import { Event } from '../../lib/types' +import { wait } from './util' tape('[Integration:PeerPool]', async (t) => { async function setup(protocols: EthProtocol[] = []): Promise<[MockServer, PeerPool]> { @@ -28,7 +29,6 @@ tape('[Integration:PeerPool]', async (t) => { const [server, pool] = await setup() t.ok((pool as any).opened, 'opened') await destroy(server, pool) - t.end() }) t.test('should add/remove peer', async (t) => { @@ -40,12 +40,10 @@ tape('[Integration:PeerPool]', async (t) => { t.equal(peer.id, 'peer0', 'removed peer') ) pool.add(await server.accept('peer0')) - setTimeout(async () => { - server.disconnect('peer0') - await destroy(server, pool) - t.pass('destroyed') - t.end() - }, 100) + await wait(100) + server.disconnect('peer0') + await destroy(server, pool) + t.pass('destroyed') }) t.test('should ban peer', async (t) => { @@ -57,12 +55,10 @@ tape('[Integration:PeerPool]', async (t) => { t.equal(peer.id, 'peer0', 'banned peer') ) pool.add(await server.accept('peer0')) - setTimeout(async () => { - pool.ban(pool.peers[0]) - await destroy(server, pool) - t.pass('destroyed') - t.end() - }, 100) + await wait(100) + pool.ban(pool.peers[0]) + await destroy(server, pool) + t.pass('destroyed') }) t.test('should handle peer messages', async (t) => { @@ -85,11 +81,9 @@ tape('[Integration:PeerPool]', async (t) => { t.deepEqual([msg, proto, peer.id], ['msg0', 'proto0', 'peer0'], 'got message') }) pool.add(await server.accept('peer0')) - setTimeout(async () => { - config.events.emit(Event.PROTOCOL_MESSAGE, 'msg0', 'proto0', pool.peers[0]) - await destroy(server, pool) - t.pass('destroyed') - t.end() - }, 100) + await wait(100) + config.events.emit(Event.PROTOCOL_MESSAGE, 'msg0', 'proto0', pool.peers[0]) + await destroy(server, pool) + t.pass('destroyed') }) }) diff --git a/packages/client/test/integration/util.ts b/packages/client/test/integration/util.ts index 9a074375bc..49806260be 100644 --- a/packages/client/test/integration/util.ts +++ b/packages/client/test/integration/util.ts @@ -3,6 +3,7 @@ import { FullEthereumService, LightEthereumService } from '../../lib/service' import MockServer from './mocks/mockserver' import MockChain from './mocks/mockchain' import Blockchain from '@ethereumjs/blockchain' +import Common from '@ethereumjs/common' interface SetupOptions { location?: string @@ -10,6 +11,7 @@ interface SetupOptions { interval?: number syncmode?: string minPeers?: number + common?: Common } export async function setup( @@ -20,20 +22,22 @@ export async function setup( const loglevel = 'error' const lightserv = syncmode === 'full' - const config = new Config({ loglevel, syncmode, lightserv, minPeers }) + const common = options.common + const config = new Config({ loglevel, syncmode, lightserv, minPeers, common }) const server = new MockServer({ config, location }) - const blockchain = new Blockchain({ + const blockchain = await Blockchain.create({ validateBlocks: false, validateConsensus: false, + common, }) const chain = new MockChain({ config, blockchain, height }) const servers = [server] as any - const serviceConfig = new Config({ loglevel, syncmode, servers, lightserv, minPeers }) - //@ts-ignore -- attach server eventbus to ethereums service eventbus (to simulate centralized client eventbus)) - server.config.events = serviceConfig.events + const serviceConfig = new Config({ loglevel, syncmode, servers, lightserv, minPeers, common }) + // attach server to centralized event bus + ;(server.config as any).events = serviceConfig.events const serviceOpts = { config: serviceConfig, chain, diff --git a/packages/client/test/miner/miner.spec.ts b/packages/client/test/miner/miner.spec.ts new file mode 100644 index 0000000000..abfc29bc7e --- /dev/null +++ b/packages/client/test/miner/miner.spec.ts @@ -0,0 +1,449 @@ +import tape from 'tape' +import td from 'testdouble' +import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common' +import { FeeMarketEIP1559Transaction, Transaction } from '@ethereumjs/tx' +import { Block, BlockHeader } from '@ethereumjs/block' +import { Account, Address, BN } from 'ethereumjs-util' +import { Config } from '../../lib/config' +import { FullSynchronizer } from '../../lib/sync/fullsync' +import { Chain } from '../../lib/blockchain' +import { Miner } from '../../lib/miner' +import { Event } from '../../lib/types' +import { wait } from '../integration/util' + +tape('[Miner]', async (t) => { + BlockHeader.prototype.validate = td.func() + td.replace('@ethereumjs/block', { BlockHeader }) + + class PeerPool { + open() {} + close() {} + get peers() { + return [] + } + } + class FakeChain { + open() {} + close() {} + update() {} + get headers() { + return { + latest: BlockHeader.fromHeaderData(), + } + } + get blocks() { + return { + latest: Block.fromBlockData(), + } + } + } + + const A = { + address: new Address(Buffer.from('0b90087d864e82a284dca15923f3776de6bb016f', 'hex')), + privateKey: Buffer.from( + '64bf9cc30328b0e42387b3c82c614e6386259136235e20c1357bd11cdee86993', + 'hex' + ), + } + + const B = { + address: new Address(Buffer.from('6f62d8382bf2587361db73ceca28be91b2acb6df', 'hex')), + privateKey: Buffer.from( + '2a6e9ad5a6a8e4f17149b8bc7128bf090566a11dbd63c30e5a0ee9f161309cd6', + 'hex' + ), + } + + const common = new Common({ chain: CommonChain.Rinkeby, hardfork: Hardfork.Berlin }) + common.setMaxListeners(50) + const accounts: [Address, Buffer][] = [[A.address, A.privateKey]] + const config = new Config({ transports: [], loglevel: 'error', accounts, mine: true, common }) + config.events.setMaxListeners(50) + + const createTx = ( + from = A, + to = B, + nonce = 0, + value = 1, + gasPrice = 1000000000, + gasLimit = 100000 + ) => { + const txData = { + nonce, + gasPrice, + gasLimit, + to: to.address, + value, + } + const tx = Transaction.fromTxData(txData, { common }) + const signedTx = tx.sign(from.privateKey) + return signedTx + } + + const txA01 = createTx() // A -> B, nonce: 0, value: 1, normal gasPrice + const txA02 = createTx(A, B, 1, 1, 2000000000) // A -> B, nonce: 1, value: 1, 2x gasPrice + const txA03 = createTx(A, B, 2, 1, 3000000000) // A -> B, nonce: 2, value: 1, 3x gasPrice + const txB01 = createTx(B, A, 0, 1, 2500000000) // B -> A, nonce: 0, value: 1, 2.5x gasPrice + + t.test('should initialize correctly', (t) => { + const pool = new PeerPool() as any + const chain = new FakeChain() as any + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + const miner = new Miner({ config, synchronizer }) + t.notOk(miner.running) + t.end() + }) + + t.test('should start/stop', async (t) => { + t.plan(4) + const pool = new PeerPool() as any + const chain = new FakeChain() as any + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + synchronizer.execution.vm.blockchain.cliqueSignerInTurn = async () => true // stub + let miner = new Miner({ config, synchronizer }) + t.notOk(miner.running) + miner.start() + t.ok(miner.running) + await wait(10) + miner.stop() + t.notOk(miner.running) + + // Should not start when config.mine=false + const configMineFalse = new Config({ transports: [], loglevel: 'error', accounts, mine: false }) + miner = new Miner({ config: configMineFalse, synchronizer }) + miner.start() + t.notOk(miner.running, 'miner should not start when config.mine=false') + }) + + t.test('assembleBlocks() -> with a single tx', async (t) => { + t.plan(1) + const pool = new PeerPool() as any + const chain = new FakeChain() as any + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + const miner = new Miner({ config, synchronizer }) + const { txPool } = synchronizer + const { vm } = synchronizer.execution + vm.blockchain.putBlock = async () => {} // stub + vm.blockchain.cliqueActiveSigners = () => [A.address] // stub + txPool.start() + miner.start() + + // add balance to account + await vm.stateManager.putAccount(A.address, new Account(new BN(0), new BN('200000000000001'))) // this line can be replaced with modifyAccountFields() when #1369 is available + + // add a block to skip generateCanonicalGenesis() in assembleBlock() + await vm.runBlock({ block: Block.fromBlockData({}, { common }), generate: true }) + + // add tx + txPool.add(txA01) + + // disable consensus to skip PoA block signer validation + ;(vm.blockchain as any)._validateConsensus = false + + chain.putBlocks = (blocks: Block[]) => { + t.equal(blocks[0].transactions.length, 1, 'new block should include tx') + miner.stop() + txPool.stop() + } + await (miner as any).queueNextAssembly(0) + await wait(500) + }) + + t.test( + 'assembleBlocks() -> with multiple txs, properly ordered by gasPrice and nonce', + async (t) => { + t.plan(4) + const pool = new PeerPool() as any + const chain = new FakeChain() as any + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + const miner = new Miner({ config, synchronizer }) + const { txPool } = synchronizer + const { vm } = synchronizer.execution + vm.blockchain.putBlock = async () => {} // stub + vm.blockchain.cliqueActiveSigners = () => [A.address] // stub + txPool.start() + miner.start() + + // add balance to accounts + await vm.stateManager.putAccount(A.address, new Account(new BN(0), new BN('400000000000001'))) // these two lines can be replaced with modifyAccountFields() when #1369 is available + await vm.stateManager.putAccount(B.address, new Account(new BN(0), new BN('400000000000001'))) + + // add a block to skip generateCanonicalGenesis() in assembleBlock() + await vm.runBlock({ block: Block.fromBlockData({}, { common }), generate: true }) + + // add txs + txPool.add(txA01) + txPool.add(txA02) + txPool.add(txA03) + txPool.add(txB01) + + // disable consensus to skip PoA block signer validation + ;(vm.blockchain as any)._validateConsensus = false + + chain.putBlocks = (blocks: Block[]) => { + const msg = 'txs in block should be properly ordered by gasPrice and nonce' + const expectedOrder = [txB01, txA01, txA02, txA03] + for (const [index, tx] of expectedOrder.entries()) { + t.ok(blocks[0].transactions[index].hash().equals(tx.hash()), msg) + } + miner.stop() + txPool.stop() + } + await (miner as any).queueNextAssembly(0) + await wait(500) + } + ) + + t.test('assembleBlocks() -> should not include tx under the baseFee', async (t) => { + t.plan(1) + const customChainParams = { hardforks: [{ name: 'london', block: 0 }] } + const common = Common.forCustomChain(CommonChain.Rinkeby, customChainParams, Hardfork.London) + const config = new Config({ transports: [], loglevel: 'error', accounts, mine: true, common }) + const pool = new PeerPool() as any + const chain = new FakeChain() as any + const block = Block.fromBlockData({}, { common }) + Object.defineProperty(chain, 'headers', { + get: function () { + return { latest: block.header } + }, + }) + Object.defineProperty(chain, 'blocks', { + get: function () { + return { latest: block } + }, + }) + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + const miner = new Miner({ config, synchronizer }) + const { txPool } = synchronizer + const { vm } = synchronizer.execution + vm.blockchain.putBlock = async () => {} // stub + vm.blockchain.cliqueActiveSigners = () => [A.address] // stub + txPool.start() + miner.start() + + // the default block baseFee will be 7 + // add tx with maxFeePerGas of 6 + const tx = FeeMarketEIP1559Transaction.fromTxData( + { to: B.address, maxFeePerGas: 6 }, + { common } + ).sign(A.privateKey) + txPool.add(tx) + + // disable consensus to skip PoA block signer validation + ;(vm.blockchain as any)._validateConsensus = false + + synchronizer.handleNewBlock = async (block: Block) => { + t.equal(block.transactions.length, 0, 'should not include tx') + miner.stop() + txPool.stop() + } + await wait(500) + await (miner as any).queueNextAssembly(0) + await wait(500) + }) + + t.test("assembleBlocks() -> should stop assembling a block after it's full", async (t) => { + t.plan(1) + const pool = new PeerPool() as any + const chain = new FakeChain() as any + const gasLimit = 100000 + const block = Block.fromBlockData({ header: { gasLimit } }, { common }) + Object.defineProperty(chain, 'headers', { + get: function () { + return { latest: block.header } + }, + }) + Object.defineProperty(chain, 'blocks', { + get: function () { + return { latest: block } + }, + }) + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + const miner = new Miner({ config, synchronizer }) + const { txPool } = synchronizer + const { vm } = synchronizer.execution + vm.blockchain.putBlock = async () => {} // stub + vm.blockchain.cliqueActiveSigners = () => [A.address] // stub + txPool.start() + miner.start() + + // add balance to accounts + await vm.stateManager.putAccount(A.address, new Account(new BN(0), new BN('200000000000001'))) // this line can be replaced with modifyAccountFields() when #1369 is available + + // add a block to skip generateCanonicalGenesis() in assembleBlock() + await vm.runBlock({ block: Block.fromBlockData({}, { common }), generate: true }) + + // add txs + const data = '0xfe' // INVALID opcode, consumes all gas + const tx1FillsBlockGasLimit = Transaction.fromTxData( + { gasLimit: gasLimit - 1, data }, + { common } + ).sign(A.privateKey) + const tx2ExceedsBlockGasLimit = Transaction.fromTxData( + { gasLimit: 21000, to: B.address, nonce: 1 }, + { common } + ).sign(A.privateKey) + txPool.add(tx1FillsBlockGasLimit) + txPool.add(tx2ExceedsBlockGasLimit) + + // disable consensus to skip PoA block signer validation + ;(vm.blockchain as any)._validateConsensus = false + + chain.putBlocks = (blocks: Block[]) => { + t.equal(blocks[0].transactions.length, 1, 'only one tx should be included') + miner.stop() + txPool.stop() + } + await (miner as any).queueNextAssembly(0) + await wait(500) + }) + + t.test('assembleBlocks() -> should stop assembling when a new block is received', async (t) => { + t.plan(2) + const pool = new PeerPool() as any + const chain = new FakeChain() as any + const config = new Config({ transports: [], loglevel: 'error', accounts, mine: true, common }) + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + const miner = new Miner({ config, synchronizer }) + + // stub chainUpdated so assemble isn't called again + // when emitting Event.CHAIN_UPDATED in this test + ;(miner as any).chainUpdated = async () => {} + + const { txPool } = synchronizer + const { vm } = synchronizer.execution + vm.blockchain.putBlock = async () => {} // stub + vm.blockchain.cliqueActiveSigners = () => [A.address] // stub + txPool.start() + miner.start() + + // add balance to accounts + await vm.stateManager.putAccount(A.address, new Account(new BN(0), new BN('200000000000001'))) // this line can be replaced with modifyAccountFields() when #1369 is available + + // add a block to skip generateCanonicalGenesis() in assembleBlock() + await vm.runBlock({ block: Block.fromBlockData({}, { common }), generate: true }) + + // add many txs to slow assembling + for (let i = 0; i < 1000; i++) { + txPool.add(createTx()) + } + + chain.putBlocks = () => { + t.fail('should have stopped assembling when a new block was received') + } + await (miner as any).queueNextAssembly(5) + await wait(5) + t.ok((miner as any).assembling, 'miner should be assembling') + config.events.emit(Event.CHAIN_UPDATED) + await wait(10) + t.notOk((miner as any).assembling, 'miner should have stopped assembling') + miner.stop() + txPool.stop() + }) + + t.test('should handle mining over the london hardfork block', async (t) => { + const customChainParams = { + hardforks: [ + { name: 'chainstart', block: 0 }, + { name: 'berlin', block: 2 }, + { name: 'london', block: 3 }, + ], + } + const common = Common.custom(customChainParams, { baseChain: CommonChain.Rinkeby }) + common.setHardforkByBlockNumber(0) + const pool = new PeerPool() as any + const config = new Config({ transports: [], loglevel: 'error', accounts, mine: true, common }) + const chain = new Chain({ config }) + await chain.open() + const synchronizer = new FullSynchronizer({ + config, + pool, + chain, + }) + const miner = new Miner({ config, synchronizer }) + + const { vm } = synchronizer.execution + vm.blockchain.cliqueActiveSigners = () => [A.address] // stub + ;(miner as any).chainUpdated = async () => {} // stub + miner.start() + await wait(100) + + // in this test we need to explicitly update common with + // setHardforkByBlockNumber() to test the hardfork() value + // since the vmexecution run method isn't reached in this + // stubbed configuration. + + // block 1: chainstart + await (miner as any).queueNextAssembly(0) + await wait(100) + config.execCommon.setHardforkByBlockNumber(1) + t.equal(config.execCommon.hardfork(), 'chainstart') + + // block 2: berlin + await (miner as any).queueNextAssembly(0) + await wait(100) + config.execCommon.setHardforkByBlockNumber(2) + t.equal(config.execCommon.hardfork(), 'berlin') + const blockHeader2 = await chain.getLatestHeader() + + // block 3: london + await (miner as any).queueNextAssembly(0) + await wait(100) + const blockHeader3 = await chain.getLatestHeader() + config.execCommon.setHardforkByBlockNumber(3) + t.equal(config.execCommon.hardfork(), 'london') + t.ok( + blockHeader2.gasLimit.muln(2).eq(blockHeader3.gasLimit), + 'gas limit should be double previous block' + ) + const initialBaseFee = new BN(config.execCommon.paramByEIP('gasConfig', 'initialBaseFee', 1559)) + t.ok(blockHeader3.baseFeePerGas!.eq(initialBaseFee), 'baseFee should be initial value') + + // block 4 + await (miner as any).queueNextAssembly(0) + await wait(100) + const blockHeader4 = await chain.getLatestHeader() + config.execCommon.setHardforkByBlockNumber(4) + t.equal(config.execCommon.hardfork(), 'london') + t.ok( + blockHeader4.baseFeePerGas!.eq(blockHeader3.calcNextBaseFee()), + 'baseFee should be as calculated' + ) + t.ok((await chain.getLatestHeader()).number.eqn(4)) + miner.stop() + await chain.close() + }) + + t.test('should reset td', (t) => { + td.reset() + t.end() + }) +}) diff --git a/packages/client/test/net/peer/libp2pnode.spec.ts b/packages/client/test/net/peer/libp2pnode.spec.ts index 6618dc94c3..373cb477c2 100644 --- a/packages/client/test/net/peer/libp2pnode.spec.ts +++ b/packages/client/test/net/peer/libp2pnode.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' tape('[Libp2pNode]', async (t) => { diff --git a/packages/client/test/net/peer/peer.spec.ts b/packages/client/test/net/peer/peer.spec.ts index 6f906459d4..7559e0be70 100644 --- a/packages/client/test/net/peer/peer.spec.ts +++ b/packages/client/test/net/peer/peer.spec.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'events' -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { Peer } from '../../../lib/net/peer' import { Config } from '../../../lib/config' diff --git a/packages/client/test/net/peer/rlpxpeer.spec.ts b/packages/client/test/net/peer/rlpxpeer.spec.ts index b201e74dc4..a42c72db22 100644 --- a/packages/client/test/net/peer/rlpxpeer.spec.ts +++ b/packages/client/test/net/peer/rlpxpeer.spec.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'events' -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { Config } from '../../../lib/config' import { RlpxSender } from '../../../lib/net/protocol/rlpxsender' diff --git a/packages/client/test/net/peerpool.spec.ts b/packages/client/test/net/peerpool.spec.ts index 1b5dcb2645..8dc298b295 100644 --- a/packages/client/test/net/peerpool.spec.ts +++ b/packages/client/test/net/peerpool.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { EventEmitter } from 'events' import { Config } from '../../lib/config' diff --git a/packages/client/test/net/protocol/boundprotocol.spec.ts b/packages/client/test/net/protocol/boundprotocol.spec.ts index c7ff30042c..436be9d9d5 100644 --- a/packages/client/test/net/protocol/boundprotocol.spec.ts +++ b/packages/client/test/net/protocol/boundprotocol.spec.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'events' -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { Sender } from '../../../lib/net/protocol/sender' import { BoundProtocol } from '../../../lib/net/protocol' diff --git a/packages/client/test/net/protocol/ethprotocol.spec.ts b/packages/client/test/net/protocol/ethprotocol.spec.ts index d1cb10e649..6669fe7898 100644 --- a/packages/client/test/net/protocol/ethprotocol.spec.ts +++ b/packages/client/test/net/protocol/ethprotocol.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import { BN } from 'ethereumjs-util' import { Chain } from '../../../lib/blockchain/chain' import { Config } from '../../../lib/config' diff --git a/packages/client/test/net/protocol/flowcontrol.spec.ts b/packages/client/test/net/protocol/flowcontrol.spec.ts index e78aeb88ea..35b7e5e3b1 100644 --- a/packages/client/test/net/protocol/flowcontrol.spec.ts +++ b/packages/client/test/net/protocol/flowcontrol.spec.ts @@ -1,5 +1,5 @@ /// -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import timers from 'testdouble-timers' import { FlowControl } from '../../../lib/net/protocol' diff --git a/packages/client/test/net/protocol/lesprotocol.spec.ts b/packages/client/test/net/protocol/lesprotocol.spec.ts index c1010165a0..1d20ca89c7 100644 --- a/packages/client/test/net/protocol/lesprotocol.spec.ts +++ b/packages/client/test/net/protocol/lesprotocol.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import { BN } from 'ethereumjs-util' import { Chain } from '../../../lib/blockchain' import { Config } from '../../../lib/config' diff --git a/packages/client/test/net/protocol/libp2psender.spec.ts b/packages/client/test/net/protocol/libp2psender.spec.ts index 5894c2e94c..8e88779057 100644 --- a/packages/client/test/net/protocol/libp2psender.spec.ts +++ b/packages/client/test/net/protocol/libp2psender.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import { Libp2pSender } from '../../../lib/net/protocol' const DuplexPair = require('it-pair/duplex') diff --git a/packages/client/test/net/protocol/protocol.spec.ts b/packages/client/test/net/protocol/protocol.spec.ts index af6ef6078b..8185a55f48 100644 --- a/packages/client/test/net/protocol/protocol.spec.ts +++ b/packages/client/test/net/protocol/protocol.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { BoundProtocol, Protocol, Sender } from '../../../lib/net/protocol' import { Config } from '../../../lib/config' diff --git a/packages/client/test/net/protocol/rlpxsender.spec.ts b/packages/client/test/net/protocol/rlpxsender.spec.ts index 336a1164e2..23d62336e3 100644 --- a/packages/client/test/net/protocol/rlpxsender.spec.ts +++ b/packages/client/test/net/protocol/rlpxsender.spec.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'events' -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { ETH as Devp2pETH } from '@ethereumjs/devp2p' import { RlpxSender } from '../../../lib/net/protocol' diff --git a/packages/client/test/net/protocol/sender.spec.ts b/packages/client/test/net/protocol/sender.spec.ts index 3b9afeee98..f60070ded2 100644 --- a/packages/client/test/net/protocol/sender.spec.ts +++ b/packages/client/test/net/protocol/sender.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' const { Sender } = require('../../../lib/net/protocol') tape('[Sender]', (t) => { diff --git a/packages/client/test/net/server/libp2pserver.spec.ts b/packages/client/test/net/server/libp2pserver.spec.ts index 3dbc9ffeb1..f01cb87b86 100644 --- a/packages/client/test/net/server/libp2pserver.spec.ts +++ b/packages/client/test/net/server/libp2pserver.spec.ts @@ -1,9 +1,10 @@ import { EventEmitter } from 'events' -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import multiaddr from 'multiaddr' import { Config } from '../../../lib/config' import { Event } from '../../../lib/types' +import { wait } from '../../integration/util' tape('[Libp2pServer]', async (t) => { const Libp2pPeer = td.replace('../../../lib/net/peer/libp2ppeer') @@ -136,9 +137,8 @@ tape('[Libp2pServer]', async (t) => { t.notOk(server.addProtocols([]), 'cannot add protocols after start') server.ban('peer0', 10) t.ok(server.isBanned('peer0'), 'banned') - setTimeout(() => { - t.notOk(server.isBanned('peer0'), 'ban expired') - }, 20) + await wait(100) + t.notOk(server.isBanned('peer0'), 'ban expired') const { node } = server as any t.equals(node.constructor.name, 'Libp2pNode', 'libp2p node created') node.emit('peer:discovery', peerId) diff --git a/packages/client/test/net/server/rlpxserver.spec.ts b/packages/client/test/net/server/rlpxserver.spec.ts index ca3c9d9b42..6316635541 100644 --- a/packages/client/test/net/server/rlpxserver.spec.ts +++ b/packages/client/test/net/server/rlpxserver.spec.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'events' -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import multiaddr from 'multiaddr' import { Config } from '../../../lib/config' diff --git a/packages/client/test/rpc/admin/nodeInfo.spec.ts b/packages/client/test/rpc/admin/nodeInfo.spec.ts index 40b6e40cde..cb062b4c36 100644 --- a/packages/client/test/rpc/admin/nodeInfo.spec.ts +++ b/packages/client/test/rpc/admin/nodeInfo.spec.ts @@ -3,7 +3,7 @@ import { startRPC, createManager, createClient, params, baseRequest } from '../h const method = 'admin_nodeInfo' -tape(method, (t) => { +tape(method, async (t) => { const manager = createManager(createClient({ opened: true })) const server = startRPC(manager.getMethods()) @@ -17,5 +17,5 @@ tape(method, (t) => { throw new Error('no return value') } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/consensus/assembleBlock.spec.ts b/packages/client/test/rpc/consensus/assembleBlock.spec.ts index 27a541e55b..5ccd89826c 100644 --- a/packages/client/test/rpc/consensus/assembleBlock.spec.ts +++ b/packages/client/test/rpc/consensus/assembleBlock.spec.ts @@ -5,7 +5,7 @@ import { checkError } from '../util' const method = 'consensus_assembleBlock' -tape(`${method}: call with invalid block hash without 0x`, (t) => { +tape(`${method}: call with invalid block hash without 0x`, async (t) => { const { server } = baseSetup() const req = params(method, ['WRONG BLOCK NUMBER', 10000]) @@ -14,21 +14,21 @@ tape(`${method}: call with invalid block hash without 0x`, (t) => { INVALID_PARAMS, 'invalid argument 0: hex string without 0x prefix' ) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid hex string as block hash`, (t) => { +tape(`${method}: call with invalid hex string as block hash`, async (t) => { const { server } = baseSetup() const req = params(method, ['0xWRONG BLOCK NUMBER', 10000]) const expectRes = checkError(t, INVALID_PARAMS, 'invalid argument 0: invalid block hash') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call without second parameter`, (t) => { +tape(`${method}: call without second parameter`, async (t) => { const { server } = baseSetup() const req = params(method, ['0x0']) const expectRes = checkError(t, INVALID_PARAMS, 'missing value for required argument 1') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/consensus/finaliseBlock.spec.ts b/packages/client/test/rpc/consensus/finaliseBlock.spec.ts index 2efb55790f..7bc3d69f62 100644 --- a/packages/client/test/rpc/consensus/finaliseBlock.spec.ts +++ b/packages/client/test/rpc/consensus/finaliseBlock.spec.ts @@ -5,7 +5,7 @@ import { checkError } from '../util' const method = 'consensus_finaliseBlock' -tape(`${method}: call with invalid block hash without 0x`, (t) => { +tape(`${method}: call with invalid block hash without 0x`, async (t) => { const { server } = baseSetup() const req = params(method, ['WRONG BLOCK NUMBER']) @@ -14,13 +14,13 @@ tape(`${method}: call with invalid block hash without 0x`, (t) => { INVALID_PARAMS, 'invalid argument 0: hex string without 0x prefix' ) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid hex string as block hash`, (t) => { +tape(`${method}: call with invalid hex string as block hash`, async (t) => { const { server } = baseSetup() const req = params(method, ['0xWRONG BLOCK NUMBER']) const expectRes = checkError(t, INVALID_PARAMS, 'invalid argument 0: invalid block hash') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/consensus/newBlock.spec.ts b/packages/client/test/rpc/consensus/newBlock.spec.ts index 16b83dd95e..3b5a0eb80a 100644 --- a/packages/client/test/rpc/consensus/newBlock.spec.ts +++ b/packages/client/test/rpc/consensus/newBlock.spec.ts @@ -5,10 +5,10 @@ import { checkError } from '../util' const method = 'consensus_newBlock' -tape(`${method}: call without parameter`, (t) => { +tape(`${method}: call without parameter`, async (t) => { const { server } = baseSetup() const req = params(method) const expectRes = checkError(t, INVALID_PARAMS, 'missing value for required argument 0') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/consensus/setHead.spec.ts b/packages/client/test/rpc/consensus/setHead.spec.ts index 792ab7b2fe..72974b6918 100644 --- a/packages/client/test/rpc/consensus/setHead.spec.ts +++ b/packages/client/test/rpc/consensus/setHead.spec.ts @@ -5,7 +5,7 @@ import { checkError } from '../util' const method = 'consensus_setHead' -tape(`${method}: call with invalid block hash without 0x`, (t) => { +tape(`${method}: call with invalid block hash without 0x`, async (t) => { const { server } = baseSetup() const req = params(method, ['WRONG BLOCK NUMBER']) @@ -14,13 +14,13 @@ tape(`${method}: call with invalid block hash without 0x`, (t) => { INVALID_PARAMS, 'invalid argument 0: hex string without 0x prefix' ) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid hex string as block hash`, (t) => { +tape(`${method}: call with invalid hex string as block hash`, async (t) => { const { server } = baseSetup() const req = params(method, ['0xWRONG BLOCK NUMBER']) const expectRes = checkError(t, INVALID_PARAMS, 'invalid argument 0: invalid block hash') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/call.spec.ts b/packages/client/test/rpc/eth/call.spec.ts index da9ee69930..25fb0596e3 100644 --- a/packages/client/test/rpc/eth/call.spec.ts +++ b/packages/client/test/rpc/eth/call.spec.ts @@ -72,7 +72,7 @@ tape(`${method}: call with valid arguments`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: call with unsupported block argument`, async (t) => { @@ -102,5 +102,5 @@ tape(`${method}: call with unsupported block argument`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/chainId.spec.ts b/packages/client/test/rpc/eth/chainId.spec.ts index 432aa9363b..d2d73f0d19 100644 --- a/packages/client/test/rpc/eth/chainId.spec.ts +++ b/packages/client/test/rpc/eth/chainId.spec.ts @@ -5,7 +5,7 @@ import { baseSetup, params, baseRequest, createClient, createManager, startRPC } const method = 'eth_chainId' -tape(`${method}: calls`, (t) => { +tape(`${method}: calls`, async (t) => { const { server } = baseSetup() const req = params(method, []) @@ -17,10 +17,10 @@ tape(`${method}: calls`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: returns 1 for Mainnet`, (t) => { +tape(`${method}: returns 1 for Mainnet`, async (t) => { const { server } = baseSetup() const req = params(method, []) @@ -28,10 +28,10 @@ tape(`${method}: returns 1 for Mainnet`, (t) => { const msg = 'should return chainId 1' t.equal(res.body.result, '0x1', msg) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: returns 3 for Ropsten`, (t) => { +tape(`${method}: returns 3 for Ropsten`, async (t) => { const manager = createManager( createClient({ opened: true, commonChain: new Common({ chain: Chain.Ropsten }) }) ) @@ -42,10 +42,10 @@ tape(`${method}: returns 3 for Ropsten`, (t) => { const msg = 'should return chainId 3' t.equal(res.body.result, '0x3', msg) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: returns 42 for Kovan`, (t) => { +tape(`${method}: returns 42 for Kovan`, async (t) => { const manager = createManager( createClient({ opened: true, commonChain: new Common({ chain: Chain.Kovan }) }) ) @@ -57,5 +57,5 @@ tape(`${method}: returns 42 for Kovan`, (t) => { const chainId = new BN(42).toString(16) t.equal(res.body.result, `0x${chainId}`, msg) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/estimateGas.spec.ts b/packages/client/test/rpc/eth/estimateGas.spec.ts index 932d3412cb..c3ed9f83c3 100644 --- a/packages/client/test/rpc/eth/estimateGas.spec.ts +++ b/packages/client/test/rpc/eth/estimateGas.spec.ts @@ -72,7 +72,7 @@ tape(`${method}: call with valid arguments`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: call with unsupported block argument`, async (t) => { @@ -102,5 +102,5 @@ tape(`${method}: call with unsupported block argument`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getBalance.spec.ts b/packages/client/test/rpc/eth/getBalance.spec.ts index 3e0fa10594..30ac4fb078 100644 --- a/packages/client/test/rpc/eth/getBalance.spec.ts +++ b/packages/client/test/rpc/eth/getBalance.spec.ts @@ -32,7 +32,7 @@ tape(`${method}: call with valid arguments`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: ensure balance deducts after a tx`, async (t) => { @@ -73,7 +73,7 @@ tape(`${method}: ensure balance deducts after a tx`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: call with unsupported block argument`, async (t) => { @@ -102,5 +102,5 @@ tape(`${method}: call with unsupported block argument`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getBlockByHash.spec.ts b/packages/client/test/rpc/eth/getBlockByHash.spec.ts index 823430a4cc..79ea78a592 100644 --- a/packages/client/test/rpc/eth/getBlockByHash.spec.ts +++ b/packages/client/test/rpc/eth/getBlockByHash.spec.ts @@ -5,7 +5,7 @@ import { checkError } from '../util' const method = 'eth_getBlockByHash' -tape(`${method}: call with valid arguments`, (t) => { +tape(`${method}: call with valid arguments`, async (t) => { const { server } = baseSetup() const req = params(method, [ @@ -16,10 +16,10 @@ tape(`${method}: call with valid arguments`, (t) => { const msg = 'should return the correct number' t.equal(res.body.result.number, 444444, msg) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with false for second argument`, (t) => { +tape(`${method}: call with false for second argument`, async (t) => { const { server } = baseSetup() const req = params(method, [ @@ -32,10 +32,10 @@ tape(`${method}: call with false for second argument`, (t) => { msg = 'should return only the hashes of the transactions' t.equal(typeof res.body.result.transactions[0], 'string', msg) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid block hash without 0x`, (t) => { +tape(`${method}: call with invalid block hash without 0x`, async (t) => { const { server } = baseSetup() const req = params(method, ['WRONG BLOCK NUMBER', true]) @@ -44,29 +44,29 @@ tape(`${method}: call with invalid block hash without 0x`, (t) => { INVALID_PARAMS, 'invalid argument 0: hex string without 0x prefix' ) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid hex string as block hash`, (t) => { +tape(`${method}: call with invalid hex string as block hash`, async (t) => { const { server } = baseSetup() const req = params(method, ['0xWRONG BLOCK NUMBER', true]) const expectRes = checkError(t, INVALID_PARAMS, 'invalid argument 0: invalid block hash') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call without second parameter`, (t) => { +tape(`${method}: call without second parameter`, async (t) => { const { server } = baseSetup() const req = params(method, ['0x0']) const expectRes = checkError(t, INVALID_PARAMS, 'missing value for required argument 1') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid second parameter`, (t) => { +tape(`${method}: call with invalid second parameter`, async (t) => { const { server } = baseSetup() const req = params(method, ['0x0', 'INVALID PARAMETER']) const expectRes = checkError(t, INVALID_PARAMS) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getBlockByNumber.spec.ts b/packages/client/test/rpc/eth/getBlockByNumber.spec.ts index 8d5619f0aa..1dae5707e9 100644 --- a/packages/client/test/rpc/eth/getBlockByNumber.spec.ts +++ b/packages/client/test/rpc/eth/getBlockByNumber.spec.ts @@ -28,7 +28,7 @@ function createBlockchain() { const method = 'eth_getBlockByNumber' -tape(`${method}: call with valid arguments`, (t) => { +tape(`${method}: call with valid arguments`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) @@ -41,10 +41,10 @@ tape(`${method}: call with valid arguments`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with false for second argument`, (t) => { +tape(`${method}: call with false for second argument`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) @@ -63,10 +63,10 @@ tape(`${method}: call with false for second argument`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with earliest param`, (t) => { +tape(`${method}: call with earliest param`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) @@ -79,10 +79,10 @@ tape(`${method}: call with earliest param`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with latest param`, (t) => { +tape(`${method}: call with latest param`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) @@ -95,10 +95,10 @@ tape(`${method}: call with latest param`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with unimplemented pending param`, (t) => { +tape(`${method}: call with unimplemented pending param`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) @@ -112,19 +112,19 @@ tape(`${method}: call with unimplemented pending param`, (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with non-string block number`, (t) => { +tape(`${method}: call with non-string block number`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) const req = params(method, [10, true]) const expectRes = checkError(t, INVALID_PARAMS, 'invalid argument 0: argument must be a string') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid block number`, (t) => { +tape(`${method}: call with invalid block number`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) @@ -135,23 +135,23 @@ tape(`${method}: call with invalid block number`, (t) => { 'invalid argument 0: block option must be a valid 0x-prefixed block hash or hex integer, or "latest", "earliest" or "pending"' ) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call without second parameter`, (t) => { +tape(`${method}: call without second parameter`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) const req = params(method, ['0x0']) const expectRes = checkError(t, INVALID_PARAMS, 'missing value for required argument 1') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid second parameter`, (t) => { +tape(`${method}: call with invalid second parameter`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) const req = params(method, ['0x0', 'INVALID PARAMETER']) const expectRes = checkError(t, INVALID_PARAMS) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getBlockNumber.spec.ts b/packages/client/test/rpc/eth/getBlockNumber.spec.ts index 30571ab47b..1524a8e74b 100644 --- a/packages/client/test/rpc/eth/getBlockNumber.spec.ts +++ b/packages/client/test/rpc/eth/getBlockNumber.spec.ts @@ -4,7 +4,7 @@ import { startRPC, createManager, createClient, params, baseRequest } from '../h const method = 'eth_blockNumber' -tape(`${method}: call with valid arguments`, (t) => { +tape(`${method}: call with valid arguments`, async (t) => { const mockBlockNumber = 123 const mockBlockChain = { getLatestHeader: async function (): Promise { @@ -20,5 +20,5 @@ tape(`${method}: call with valid arguments`, (t) => { const expectRes = (res: any) => { t.equal(res.body.result, intToHex(mockBlockNumber)) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getBlockTransactionCountByHash.spec.ts b/packages/client/test/rpc/eth/getBlockTransactionCountByHash.spec.ts index 61e6389df1..06ae514d5b 100644 --- a/packages/client/test/rpc/eth/getBlockTransactionCountByHash.spec.ts +++ b/packages/client/test/rpc/eth/getBlockTransactionCountByHash.spec.ts @@ -5,7 +5,7 @@ import { checkError } from '../util' const method = 'eth_getBlockTransactionCountByHash' -tape(`${method}: call with valid arguments`, (t) => { +tape(`${method}: call with valid arguments`, async (t) => { const { server } = baseSetup() const req = params(method, ['0x910abca1728c53e8d6df870dd7af5352e974357dc58205dea1676be17ba6becf']) @@ -17,10 +17,10 @@ tape(`${method}: call with valid arguments`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid block hash without 0x`, (t) => { +tape(`${method}: call with invalid block hash without 0x`, async (t) => { const { server } = baseSetup() const req = params(method, ['WRONG BLOCK NUMBER']) @@ -29,29 +29,29 @@ tape(`${method}: call with invalid block hash without 0x`, (t) => { INVALID_PARAMS, 'invalid argument 0: hex string without 0x prefix' ) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid hex string as block hash`, (t) => { +tape(`${method}: call with invalid hex string as block hash`, async (t) => { const { server } = baseSetup() const req = params(method, ['0xWRONG BLOCK NUMBER', true]) const expectRes = checkError(t, INVALID_PARAMS, 'invalid argument 0: invalid block hash') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call without first parameter`, (t) => { +tape(`${method}: call without first parameter`, async (t) => { const { server } = baseSetup() const req = params(method, []) const expectRes = checkError(t, INVALID_PARAMS, 'missing value for required argument 0') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid second parameter`, (t) => { +tape(`${method}: call with invalid second parameter`, async (t) => { const { server } = baseSetup() const req = params(method, ['INVALID PARAMETER']) const expectRes = checkError(t, INVALID_PARAMS) - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getCode.spec.ts b/packages/client/test/rpc/eth/getCode.spec.ts index 5c4fa2acec..f6952082d0 100644 --- a/packages/client/test/rpc/eth/getCode.spec.ts +++ b/packages/client/test/rpc/eth/getCode.spec.ts @@ -27,7 +27,7 @@ tape(`${method}: call with valid arguments`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: ensure returns correct code`, async (t) => { @@ -73,7 +73,7 @@ tape(`${method}: ensure returns correct code`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: call with unsupported block argument`, async (t) => { @@ -95,5 +95,5 @@ tape(`${method}: call with unsupported block argument`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getStorageAt.spec.ts b/packages/client/test/rpc/eth/getStorageAt.spec.ts index f4f4b3276c..3694632bdf 100644 --- a/packages/client/test/rpc/eth/getStorageAt.spec.ts +++ b/packages/client/test/rpc/eth/getStorageAt.spec.ts @@ -82,7 +82,7 @@ tape(`${method}: call with valid arguments (retrieve pos0)`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: call with valid arguments (retrieve pos1)`, async (t) => { @@ -106,7 +106,7 @@ tape(`${method}: call with valid arguments (retrieve pos1)`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: call with unsupported block argument`, async (t) => { @@ -121,5 +121,5 @@ tape(`${method}: call with unsupported block argument`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getTransactionCount.spec.ts b/packages/client/test/rpc/eth/getTransactionCount.spec.ts index bb9b3db061..b352d34280 100644 --- a/packages/client/test/rpc/eth/getTransactionCount.spec.ts +++ b/packages/client/test/rpc/eth/getTransactionCount.spec.ts @@ -26,7 +26,7 @@ tape(`${method}: call with valid arguments`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: ensure count increments after a tx`, async (t) => { @@ -60,7 +60,7 @@ tape(`${method}: ensure count increments after a tx`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: call with unsupported block argument`, async (t) => { @@ -82,5 +82,5 @@ tape(`${method}: call with unsupported block argument`, async (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts b/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts index 6f3174cdb1..50acfbdb08 100644 --- a/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts +++ b/packages/client/test/rpc/eth/getUncleCountByBlockNumber.spec.ts @@ -18,7 +18,7 @@ function createBlockchain() { const method = 'eth_getUncleCountByBlockNumber' -tape(`${method}: call with valid arguments`, (t) => { +tape(`${method}: call with valid arguments`, async (t) => { const mockUncleCount = 3 const manager = createManager(createClient({ blockchain: createBlockchain() })) @@ -33,10 +33,10 @@ tape(`${method}: call with valid arguments`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid block number`, (t) => { +tape(`${method}: call with invalid block number`, async (t) => { const manager = createManager(createClient({ blockchain: createBlockchain() })) const server = startRPC(manager.getMethods()) @@ -53,5 +53,5 @@ tape(`${method}: call with invalid block number`, (t) => { } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/protocolVersion.spec.ts b/packages/client/test/rpc/eth/protocolVersion.spec.ts index 8f68f91ab3..7eba122ddb 100644 --- a/packages/client/test/rpc/eth/protocolVersion.spec.ts +++ b/packages/client/test/rpc/eth/protocolVersion.spec.ts @@ -3,7 +3,7 @@ import { baseSetup, params, baseRequest } from '../helpers' const method = 'eth_protocolVersion' -tape(`${method}: call`, (t) => { +tape(`${method}: call`, async (t) => { const { server } = baseSetup() const req = params(method, []) @@ -16,5 +16,5 @@ tape(`${method}: call`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/sendRawTransaction.spec.ts b/packages/client/test/rpc/eth/sendRawTransaction.spec.ts index 103d1e7510..3b6ecfe2a0 100644 --- a/packages/client/test/rpc/eth/sendRawTransaction.spec.ts +++ b/packages/client/test/rpc/eth/sendRawTransaction.spec.ts @@ -6,7 +6,7 @@ import { baseSetup, params, baseRequest, createClient, createManager, startRPC } const method = 'eth_sendRawTransaction' -tape(`${method}: call with valid arguments`, (t) => { +tape(`${method}: call with valid arguments`, async (t) => { const { server } = baseSetup() // Mainnet EIP-1559 tx @@ -21,10 +21,10 @@ tape(`${method}: call with valid arguments`, (t) => { msg ) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with sync target height not set yet`, (t) => { +tape(`${method}: call with sync target height not set yet`, async (t) => { const { server, client } = baseSetup() const service = client.services.find((s) => s.name === 'eth') service!.synchronizer.syncTargetHeight = undefined @@ -44,10 +44,10 @@ tape(`${method}: call with sync target height not set yet`, (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with invalid tx (wrong chain ID)`, (t) => { +tape(`${method}: call with invalid tx (wrong chain ID)`, async (t) => { const { server } = baseSetup() // Baikal EIP-1559 tx @@ -65,10 +65,10 @@ tape(`${method}: call with invalid tx (wrong chain ID)`, (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with unsigned tx`, (t) => { +tape(`${method}: call with unsigned tx`, async (t) => { const { server } = baseSetup() // Mainnet EIP-1559 tx @@ -92,10 +92,10 @@ tape(`${method}: call with unsigned tx`, (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with no peers`, (t) => { +tape(`${method}: call with no peers`, async (t) => { const client = createClient({ noPeers: true }) const manager = createManager(client) const server = startRPC(manager.getMethods()) @@ -112,5 +112,5 @@ tape(`${method}: call with no peers`, (t) => { throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/eth/syncing.spec.ts b/packages/client/test/rpc/eth/syncing.spec.ts index ba196c678f..2af9602d7d 100644 --- a/packages/client/test/rpc/eth/syncing.spec.ts +++ b/packages/client/test/rpc/eth/syncing.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { baseRequest, createManager, createClient, params, startRPC } from '../helpers' import { BN } from 'ethereumjs-util' @@ -23,7 +23,7 @@ tape(`${method}: should return false when the client is synchronized`, async (t) throw new Error(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) tape(`${method}: should return no peer available error`, async (t) => { @@ -43,7 +43,7 @@ tape(`${method}: should return no peer available error`, async (t) => { } } - baseRequest(t, rpcServer, req, 200, expectRes) + await baseRequest(t, rpcServer, req, 200, expectRes) }) tape(`${method}: should return highest block header unavailable error`, async (t) => { @@ -67,7 +67,7 @@ tape(`${method}: should return highest block header unavailable error`, async (t } } - baseRequest(t, rpcServer, req, 200, expectRes) + await baseRequest(t, rpcServer, req, 200, expectRes) }) tape(`${method}: should return syncing status object when unsynced`, async (t) => { @@ -97,7 +97,7 @@ tape(`${method}: should return syncing status object when unsynced`, async (t) = } } - baseRequest(t, rpcServer, req, 200, expectRes) + await baseRequest(t, rpcServer, req, 200, expectRes) }) tape('should reset td', (t) => { diff --git a/packages/client/test/rpc/helpers.ts b/packages/client/test/rpc/helpers.ts index c6a74027ba..21f2060aaa 100644 --- a/packages/client/test/rpc/helpers.ts +++ b/packages/client/test/rpc/helpers.ts @@ -117,21 +117,24 @@ export function params(method: string, params: Array = []) { return req } -export function baseRequest( +export async function baseRequest( t: tape.Test, server: HttpServer, req: Object, expect: number, expectRes: Function ) { - request(server) - .post('/') - .set('Content-Type', 'application/json') - .send(req) - .expect(expect) - .expect(expectRes) - .end((err?: Error) => { - closeRPC(server) - t.end(err) - }) + try { + await request(server) + .post('/') + .set('Content-Type', 'application/json') + .send(req) + .expect(expect) + .expect(expectRes) + closeRPC(server) + t.end() + } catch (err) { + closeRPC(server) + t.end(err) + } } diff --git a/packages/client/test/rpc/net/listening.spec.ts b/packages/client/test/rpc/net/listening.spec.ts index 725b483173..a875d81203 100644 --- a/packages/client/test/rpc/net/listening.spec.ts +++ b/packages/client/test/rpc/net/listening.spec.ts @@ -3,7 +3,7 @@ import { startRPC, createManager, createClient, params, baseRequest } from '../h const method = 'net_listening' -tape(`${method}: call while listening`, (t) => { +tape(`${method}: call while listening`, async (t) => { const manager = createManager(createClient({ opened: true })) const server = startRPC(manager.getMethods()) @@ -24,10 +24,10 @@ tape(`${method}: call while listening`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call while not listening`, (t) => { +tape(`${method}: call while not listening`, async (t) => { const manager = createManager(createClient({ opened: false })) const server = startRPC(manager.getMethods()) @@ -48,5 +48,5 @@ tape(`${method}: call while not listening`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/net/peerCount.spec.ts b/packages/client/test/rpc/net/peerCount.spec.ts index e777b5430d..cb60d2312a 100644 --- a/packages/client/test/rpc/net/peerCount.spec.ts +++ b/packages/client/test/rpc/net/peerCount.spec.ts @@ -3,7 +3,7 @@ import { startRPC, createManager, createClient, params, baseRequest } from '../h const method = 'net_peerCount' -tape(`${method}: call`, (t) => { +tape(`${method}: call`, async (t) => { const manager = createManager(createClient({ opened: true })) const server = startRPC(manager.getMethods()) @@ -17,5 +17,5 @@ tape(`${method}: call`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/net/version.spec.ts b/packages/client/test/rpc/net/version.spec.ts index dd39cad6d3..bc839be1ed 100644 --- a/packages/client/test/rpc/net/version.spec.ts +++ b/packages/client/test/rpc/net/version.spec.ts @@ -27,7 +27,7 @@ function compareResult(t: any, result: any, chainId: any) { } } -tape(`${method}: call on ropsten`, (t) => { +tape(`${method}: call on ropsten`, async (t) => { const manager = createManager( createClient({ opened: true, commonChain: new Common({ chain: Chain.Ropsten }) }) ) @@ -38,10 +38,10 @@ tape(`${method}: call on ropsten`, (t) => { const { result } = res.body compareResult(t, result, '3') } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call on mainnet`, (t) => { +tape(`${method}: call on mainnet`, async (t) => { const { server } = baseSetup() const req = params(method, []) @@ -49,10 +49,10 @@ tape(`${method}: call on mainnet`, (t) => { const { result } = res.body compareResult(t, result, '1') } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call on rinkeby`, (t) => { +tape(`${method}: call on rinkeby`, async (t) => { const manager = createManager( createClient({ opened: true, commonChain: new Common({ chain: Chain.Rinkeby }) }) ) @@ -63,10 +63,10 @@ tape(`${method}: call on rinkeby`, (t) => { const { result } = res.body compareResult(t, result, '4') } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call on kovan`, (t) => { +tape(`${method}: call on kovan`, async (t) => { const manager = createManager( createClient({ opened: true, commonChain: new Common({ chain: Chain.Kovan }) }) ) @@ -77,10 +77,10 @@ tape(`${method}: call on kovan`, (t) => { const { result } = res.body compareResult(t, result, '42') } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call on goerli`, (t) => { +tape(`${method}: call on goerli`, async (t) => { const manager = createManager( createClient({ opened: true, commonChain: new Common({ chain: Chain.Goerli }) }) ) @@ -91,5 +91,5 @@ tape(`${method}: call on goerli`, (t) => { const { result } = res.body compareResult(t, result, '5') } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/validation.spec.ts b/packages/client/test/rpc/validation.spec.ts index c410615de2..52c54a73c9 100644 --- a/packages/client/test/rpc/validation.spec.ts +++ b/packages/client/test/rpc/validation.spec.ts @@ -6,7 +6,7 @@ import { checkError } from './util' const prefix = 'rpc/validation:' -tape(`${prefix} should work without \`params\` when it's optional`, (t) => { +tape(`${prefix} should work without \`params\` when it's optional`, async (t) => { const mockMethodName = 'mock' const server = startRPC({ [mockMethodName]: middleware((_params: any) => true, 0, []), @@ -20,10 +20,10 @@ tape(`${prefix} should work without \`params\` when it's optional`, (t) => { const expectRes = (res: any) => { t.equal(res.body.error, undefined, 'should not return an error object') } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${prefix} should return error without \`params\` when it's required`, (t) => { +tape(`${prefix} should return error without \`params\` when it's required`, async (t) => { const mockMethodName = 'mock' const server = startRPC({ [mockMethodName]: middleware((_params: any) => true, 1, []), @@ -37,7 +37,7 @@ tape(`${prefix} should return error without \`params\` when it's required`, (t) const expectRes = checkError(t, INVALID_PARAMS, 'missing value for required argument 0') - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) const validatorResult = (result: Object | undefined) => { diff --git a/packages/client/test/rpc/web3/clientVersion.spec.ts b/packages/client/test/rpc/web3/clientVersion.spec.ts index 01efe151f9..3834366a80 100644 --- a/packages/client/test/rpc/web3/clientVersion.spec.ts +++ b/packages/client/test/rpc/web3/clientVersion.spec.ts @@ -4,7 +4,7 @@ import { baseSetup, params, baseRequest } from '../helpers' const method = 'web3_clientVersion' -tape(`${method}: call`, (t) => { +tape(`${method}: call`, async (t) => { const { server } = baseSetup() const req = params(method, []) @@ -51,5 +51,5 @@ tape(`${method}: call`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/rpc/web3/sha3.spec.ts b/packages/client/test/rpc/web3/sha3.spec.ts index 67a695b9f7..da094fbc14 100644 --- a/packages/client/test/rpc/web3/sha3.spec.ts +++ b/packages/client/test/rpc/web3/sha3.spec.ts @@ -21,7 +21,7 @@ function compareErrorMsg(t: any, error: any, errorMsg: any) { } } -tape(`${method}: call with one valid parameter`, (t) => { +tape(`${method}: call with one valid parameter`, async (t) => { const { server } = baseSetup() const req = params(method, ['0x68656c6c6f20776f726c64']) @@ -41,10 +41,10 @@ tape(`${method}: call with one valid parameter`, (t) => { t.pass(msg) } } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with one non-hex parameter`, (t) => { +tape(`${method}: call with one non-hex parameter`, async (t) => { const { server } = baseSetup() const req = params(method, ['hello world']) @@ -56,10 +56,10 @@ tape(`${method}: call with one non-hex parameter`, (t) => { const errorMsg = 'invalid argument 0: hex string without 0x prefix' compareErrorMsg(t, error, errorMsg) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) -tape(`${method}: call with no parameters`, (t) => { +tape(`${method}: call with no parameters`, async (t) => { const { server } = baseSetup() const req = params(method, []) @@ -71,5 +71,5 @@ tape(`${method}: call with no parameters`, (t) => { const errorMsg = 'missing value for required argument 0' compareErrorMsg(t, error, errorMsg) } - baseRequest(t, server, req, 200, expectRes) + await baseRequest(t, server, req, 200, expectRes) }) diff --git a/packages/client/test/service/fullethereumservice.spec.ts b/packages/client/test/service/fullethereumservice.spec.ts index 2efb21bafe..d2e21cbede 100644 --- a/packages/client/test/service/fullethereumservice.spec.ts +++ b/packages/client/test/service/fullethereumservice.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' @@ -9,13 +9,11 @@ tape('[FullEthereumService]', async (t) => { open() {} close() {} } - PeerPool.prototype.open = td.func() PeerPool.prototype.close = td.func() td.replace('../../lib/net/peerpool', { PeerPool }) const Chain = td.constructor([] as any) Chain.prototype.open = td.func() - // Chain.prototype.blocks.height = new BN(1) td.replace('../../lib/blockchain', { Chain }) const EthProtocol = td.constructor([] as any) const LesProtocol = td.constructor([] as any) @@ -101,7 +99,7 @@ tape('[FullEthereumService]', async (t) => { const config = new Config({ transports: [], loglevel: 'error' }) const service = new FullEthereumService({ config }) await service.handle({ name: 'NewBlock', data: [{}, new BN(1)] }, 'eth', undefined as any) - td.verify(service.synchronizer.handleNewBlock({} as any)) + td.verify(service.synchronizer.handleNewBlock({} as any, undefined)) t.end() }) diff --git a/packages/client/test/service/lightethereumservice.spec.ts b/packages/client/test/service/lightethereumservice.spec.ts index 00bb1debfd..0b4f5fe455 100644 --- a/packages/client/test/service/lightethereumservice.spec.ts +++ b/packages/client/test/service/lightethereumservice.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' diff --git a/packages/client/test/sync/execution/vmexecution.spec.ts b/packages/client/test/sync/execution/vmexecution.spec.ts index b6b25319fc..f618afd27e 100644 --- a/packages/client/test/sync/execution/vmexecution.spec.ts +++ b/packages/client/test/sync/execution/vmexecution.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import VM from '@ethereumjs/vm' import Blockchain from '@ethereumjs/blockchain' import { Config } from '../../../lib/config' diff --git a/packages/client/test/sync/fetcher/blockfetcher.spec.ts b/packages/client/test/sync/fetcher/blockfetcher.spec.ts index 15d25c7d7d..d6d03f3e06 100644 --- a/packages/client/test/sync/fetcher/blockfetcher.spec.ts +++ b/packages/client/test/sync/fetcher/blockfetcher.spec.ts @@ -1,12 +1,9 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { BN } from 'ethereumjs-util' import { Config } from '../../../lib/config' import { Chain } from '../../../lib/blockchain/chain' - -async function wait(delay?: number) { - await new Promise((resolve) => setTimeout(resolve, delay ?? 10)) -} +import { wait } from '../../integration/util' tape('[BlockFetcher]', async (t) => { class PeerPool { @@ -15,7 +12,6 @@ tape('[BlockFetcher]', async (t) => { } PeerPool.prototype.idle = td.func() PeerPool.prototype.ban = td.func() - td.replace('../../lib/net/peerpool', { PeerPool }) const { BlockFetcher } = await import('../../../lib/sync/fetcher/blockfetcher') @@ -36,14 +32,44 @@ tape('[BlockFetcher]', async (t) => { // eslint-disable-next-line @typescript-eslint/no-floating-promises fetcher.fetch() t.equals((fetcher as any).in.size(), 2, 'added 2 tasks') - await wait() + await wait(100) t.ok((fetcher as any).running, 'started') fetcher.destroy() - await wait() + await wait(100) t.notOk((fetcher as any).running, 'stopped') t.end() }) + t.test('enqueueByNumberList()', async (t) => { + const config = new Config({ maxPerRequest: 5, loglevel: 'error', transports: [] }) + const pool = new PeerPool() as any + const chain = new Chain({ config }) + const fetcher = new BlockFetcher({ + config, + pool, + chain, + first: new BN(1), + count: new BN(10), + timeout: 5, + }) + // eslint-disable-next-line @typescript-eslint/no-floating-promises + fetcher.fetch() + t.equals((fetcher as any).in.size(), 2, 'added 2 tasks') + await wait(100) + + let blockNumberList = [new BN(11), new BN(12)] + let min = new BN(11) + fetcher.enqueueByNumberList(blockNumberList, min) + t.equals((fetcher as any).in.size(), 3, '1 new task for two subsequent block numbers') + + blockNumberList = [new BN(13), new BN(15)] + min = new BN(13) + fetcher.enqueueByNumberList(blockNumberList, min) + t.equals((fetcher as any).in.size(), 5, '2 new tasks for two non-subsequent block numbers') + fetcher.destroy() + t.end() + }) + t.test('should process', (t) => { const config = new Config({ loglevel: 'error', transports: [] }) const pool = new PeerPool() as any @@ -55,11 +81,9 @@ tape('[BlockFetcher]', async (t) => { first: new BN(0), count: new BN(0), }) - const blocks = [{ header: { number: 1 } }, { header: { number: 2 } }] - //@ts-ignore - t.deepEquals(fetcher.process({ task: { count: 2 } }, blocks), blocks, 'got results') - //@ts-ignore - t.notOk(fetcher.process({ task: { count: 2 } }, { blocks: [] }), 'bad results') + const blocks: any = [{ header: { number: 1 } }, { header: { number: 2 } }] + t.deepEquals(fetcher.process({ task: { count: 2 } } as any, blocks), blocks, 'got results') + t.notOk(fetcher.process({ task: { count: 2 } } as any, { blocks: [] } as any), 'bad results') t.end() }) diff --git a/packages/client/test/sync/fetcher/fetcher.spec.ts b/packages/client/test/sync/fetcher/fetcher.spec.ts index c6dfbcaf88..ab41e1778f 100644 --- a/packages/client/test/sync/fetcher/fetcher.spec.ts +++ b/packages/client/test/sync/fetcher/fetcher.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { Config } from '../../../lib/config' import { Fetcher } from '../../../lib/sync/fetcher/fetcher' diff --git a/packages/client/test/sync/fetcher/headerfetcher.spec.ts b/packages/client/test/sync/fetcher/headerfetcher.spec.ts index 79db9e9ca3..71a656db9e 100644 --- a/packages/client/test/sync/fetcher/headerfetcher.spec.ts +++ b/packages/client/test/sync/fetcher/headerfetcher.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { Config } from '../../../lib/config' import { BN } from 'ethereumjs-util' diff --git a/packages/client/test/sync/fullsync.spec.ts b/packages/client/test/sync/fullsync.spec.ts index c640ef3be4..f3f16b6740 100644 --- a/packages/client/test/sync/fullsync.spec.ts +++ b/packages/client/test/sync/fullsync.spec.ts @@ -1,23 +1,25 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' import { Chain } from '../../lib/blockchain' import { Event } from '../../lib/types' +import { Block } from '@ethereumjs/block' tape('[FullSynchronizer]', async (t) => { class PeerPool { open() {} close() {} + idle() {} } PeerPool.prototype.open = td.func() PeerPool.prototype.close = td.func() - td.replace('../../lib/net/peerpool', { PeerPool }) + PeerPool.prototype.idle = td.func() class BlockFetcher { fetch() {} } BlockFetcher.prototype.fetch = td.func() - td.replace('../../lib/sync/fetcher/blockfetcher', { BlockFetcher }) + td.replace('../../lib/sync/fetcher', { BlockFetcher }) const { FullSynchronizer } = await import('../../lib/sync/fullsync') @@ -110,10 +112,9 @@ tape('[FullSynchronizer]', async (t) => { number: new BN(2), hash: () => Buffer.from([]), }) - td.when((BlockFetcher.prototype as any).fetch(), { delay: 20 }).thenResolve(undefined) + td.when(BlockFetcher.prototype.fetch(), { delay: 20, times: 2 }).thenResolve(undefined) ;(sync as any).chain = { blocks: { height: new BN(3) } } t.notOk(await sync.sync(), 'local height > remote height') - await sync.stop() ;(sync as any).chain = { blocks: { height: new BN(0) }, } @@ -121,9 +122,7 @@ tape('[FullSynchronizer]', async (t) => { config.events.emit(Event.SYNC_SYNCHRONIZED, new BN(0)) }, 100) t.ok(await sync.sync(), 'local height < remote height') - await sync.stop() - - td.when((BlockFetcher.prototype as any).fetch()).thenReject(new Error('err0')) + td.when(BlockFetcher.prototype.fetch()).thenReject(new Error('err0')) try { await sync.sync() } catch (err: any) { @@ -133,6 +132,89 @@ tape('[FullSynchronizer]', async (t) => { } }) + t.test('should send NewBlock/NewBlockHashes to right peers', async (t) => { + t.plan(9) + const config = new Config({ loglevel: 'error', transports: [] }) + const pool = new PeerPool() as any + const chain = new Chain({ config }) + const sync = new FullSynchronizer({ + config, + interval: 1, + pool, + chain, + }) + ;(sync as any).fetcher = { + enqueueByNumberList: (blockNumberList: BN[], min: BN) => { + t.ok(blockNumberList[0].eqn(0), 'enqueueing the correct block in the Fetcher') + t.equal(blockNumberList.length, 1, 'correct number of blocks enqueued in Fetcher') + t.ok(min.eqn(0), 'correct start block number in Fetcher') + }, + } + + let timesSentToPeer2 = 0 + const peers = [ + { + id: 'Peer 1', + eth: { + status: { td: new BN(1) }, + send(name: string) { + t.equal(name, 'NewBlock', 'sent NewBlock to Peer 1') + }, + }, + inbound: false, + }, + { + id: 'Peer 2', + eth: { + status: { td: new BN(2) }, + send(name: string) { + t.equal(name, 'NewBlockHashes', 'sent NewBlockHashes to Peer 2') + timesSentToPeer2++ + }, + }, + inbound: false, + }, + { + id: 'Peer 3', + eth: { + status: { td: new BN(3) }, + send() { + t.fail('should not send announcement to peer3') + }, + }, + inbound: false, + }, + ] + ;(sync as any).pool = { peers } + + Block.prototype.validateDifficulty = td.func() + td.when(Block.prototype.validateDifficulty(td.matchers.anything())).thenReturn(true) + const chainTip = Block.fromBlockData({ + header: {}, + }) + const newBlock = Block.fromBlockData({ + header: { + parentHash: chainTip.hash(), + }, + }) + chain.getLatestBlock = td.func() + chain.putBlocks = td.func() + + // NewBlock message from Peer 3 + await sync.handleNewBlock(newBlock, peers[2] as any) + + t.ok(sync.syncTargetHeight?.eqn(0), 'sync target height should be set to 0') + await sync.handleNewBlock(newBlock) + t.ok(timesSentToPeer2 === 1, 'sent NewBlockHashes to Peer 2 once') + t.pass('did not send NewBlock to Peer 3') + ;(sync as any).chain._blocks = { + latest: chainTip, + } + ;(sync as any).newBlocksKnownByPeer.delete(peers[0].id) + await sync.handleNewBlock(newBlock, peers[2] as any) + td.verify(chain.putBlocks([newBlock])) + }) + t.test('should reset td', (t) => { td.reset() t.end() diff --git a/packages/client/test/sync/lightsync.spec.ts b/packages/client/test/sync/lightsync.spec.ts index d1a3264116..54362b702a 100644 --- a/packages/client/test/sync/lightsync.spec.ts +++ b/packages/client/test/sync/lightsync.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' @@ -12,12 +12,11 @@ tape('[LightSynchronizer]', async (t) => { } PeerPool.prototype.open = td.func() PeerPool.prototype.close = td.func() - td.replace('../../lib/net/peerpool', { PeerPool }) class HeaderFetcher { fetch() {} } HeaderFetcher.prototype.fetch = td.func() - td.replace('../../lib/sync/fetcher/headerfetcher', { HeaderFetcher }) + td.replace('../../lib/sync/fetcher', { HeaderFetcher }) const { LightSynchronizer } = await import('../../lib/sync/lightsync') @@ -76,7 +75,7 @@ tape('[LightSynchronizer]', async (t) => { number: new BN(2), hash: () => Buffer.from([]), }) - td.when(HeaderFetcher.prototype.fetch(), { delay: 20 }).thenResolve(undefined) + td.when(HeaderFetcher.prototype.fetch(), { delay: 20, times: 2 }).thenResolve(undefined) ;(sync as any).chain = { headers: { height: new BN(3) } } t.notOk(await sync.sync(), 'local height > remote height') ;(sync as any).chain = { headers: { height: new BN(0) } } @@ -89,6 +88,8 @@ tape('[LightSynchronizer]', async (t) => { await sync.sync() } catch (err: any) { t.equals(err.message, 'err0', 'got error') + await sync.stop() + await sync.close() } }) diff --git a/packages/client/test/sync/sync.spec.ts b/packages/client/test/sync/sync.spec.ts index 8cff3d6711..be4dfb6512 100644 --- a/packages/client/test/sync/sync.spec.ts +++ b/packages/client/test/sync/sync.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import td from 'testdouble' import { BN } from 'ethereumjs-util' import { Config } from '../../lib/config' @@ -26,7 +26,6 @@ tape('[Synchronizer]', async (t) => { } PeerPool.prototype.open = td.func() PeerPool.prototype.close = td.func() - td.replace('../../lib/net/peerpool', { PeerPool }) t.test('should sync', async (t) => { const config = new Config({ loglevel: 'error', transports: [] }) diff --git a/packages/client/test/sync/txpool.spec.ts b/packages/client/test/sync/txpool.spec.ts index 86cf89e41e..4106ff54dc 100644 --- a/packages/client/test/sync/txpool.spec.ts +++ b/packages/client/test/sync/txpool.spec.ts @@ -1,5 +1,5 @@ -import tape from 'tape-catch' -import Common from '@ethereumjs/common' +import tape from 'tape' +import Common, { Chain, Hardfork } from '@ethereumjs/common' import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx' import { Block } from '@ethereumjs/block' import { PeerPool } from '../../lib/net/peerpool' @@ -7,7 +7,7 @@ import { TxPool } from '../../lib/sync/txpool' import { Config } from '../../lib/config' tape('[TxPool]', async (t) => { - const common = new Common({ chain: 'mainnet', hardfork: 'london' }) + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) const config = new Config({ transports: [], loglevel: 'error' }) const A = { @@ -42,8 +42,8 @@ tape('[TxPool]', async (t) => { const txA01 = createTx() // A -> B, nonce: 0, value: 1 const txA02 = createTx(A, B, 0, 2) // A -> B, nonce: 0, value: 2 (different hash) - const txB01 = createTx(B, A) // B -> A, nonce: 0 - const txB02 = createTx(B, A, 1, 5) // B -> A, nonce: 1 + const txB01 = createTx(B, A) // B -> A, nonce: 0, value: 1 + const txB02 = createTx(B, A, 1, 5) // B -> A, nonce: 1, value: 5 t.test('should initialize correctly', (t) => { const config = new Config({ transports: [], loglevel: 'error' }) @@ -210,7 +210,7 @@ tape('[TxPool]', async (t) => { await pool.handleAnnouncedTxHashes([txA01.hash(), txA02.hash()], peer, peerPool) t.equal(pool.pool.size, 1, 'pool size 1') - const address = `0x${A.address.toString('hex')}` + const address = A.address.toString('hex') const poolContent = pool.pool.get(address)! t.equal(poolContent.length, 1, 'only one tx') t.deepEqual(poolContent[0].tx.hash(), txA02.hash(), 'only later-added tx') @@ -234,7 +234,7 @@ tape('[TxPool]', async (t) => { await pool.handleAnnouncedTxs([txA01], peer, peerPool) t.equal(pool.pool.size, 1, 'pool size 1') - const address = `0x${A.address.toString('hex')}` + const address = A.address.toString('hex') const poolContent = pool.pool.get(address)! t.equal(poolContent.length, 1, 'one tx') t.deepEqual(poolContent[0].tx.hash(), txA01.hash(), 'correct tx') @@ -280,7 +280,7 @@ tape('[TxPool]', async (t) => { } await pool.handleAnnouncedTxHashes([txB01.hash(), txB02.hash()], peer, peerPool) t.equal(pool.pool.size, 1, 'pool size 1') - const address = `0x${B.address.toString('hex')}` + const address = B.address.toString('hex') let poolContent = pool.pool.get(address)! t.equal(poolContent.length, 2, 'two txs') @@ -346,7 +346,7 @@ tape('[TxPool]', async (t) => { 'should not remove txs from handled (HANDLED_CLEANUP_TIME_LIMIT within range)' ) - const address = txB01.getSenderAddress().toString() + const address = txB01.getSenderAddress().toString().slice(2) const poolObj = pool.pool.get(address)![0] poolObj.added = Date.now() - pool.POOLED_STORAGE_TIME_LIMIT * 60 - 1 pool.pool.set(address, [poolObj]) diff --git a/packages/client/test/util/parse.spec.ts b/packages/client/test/util/parse.spec.ts index f19aa8bcfc..7231abf53e 100644 --- a/packages/client/test/util/parse.spec.ts +++ b/packages/client/test/util/parse.spec.ts @@ -1,4 +1,4 @@ -import tape from 'tape-catch' +import tape from 'tape' import multiaddr from 'multiaddr' import { parseMultiaddrs, diff --git a/packages/client/tsconfig.browser.json b/packages/client/tsconfig.browser.json index 9af9a9b3e0..f99ce2bbeb 100644 --- a/packages/client/tsconfig.browser.json +++ b/packages/client/tsconfig.browser.json @@ -5,5 +5,6 @@ "compilerOptions": { "target": "ES2017", "outDir": "dist.browser", + "typeRoots": ["node_modules/@types", "lib/@types"], } } diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 64001d22ee..a8128d3036 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -2,5 +2,6 @@ "extends": "../../config/tsconfig.json", "include": ["bin", "lib", "test"], "compilerOptions": { + "typeRoots": ["node_modules/@types", "lib/@types"] }, } diff --git a/packages/client/tsconfig.karma.json b/packages/client/tsconfig.karma.json index 12cd4289ef..c47e764282 100644 --- a/packages/client/tsconfig.karma.json +++ b/packages/client/tsconfig.karma.json @@ -2,6 +2,6 @@ "extends": "../../config/tsconfig.prod.json", "include": ["bin", "lib", "test"], "compilerOptions": { - "skipLibCheck": true, + "typeRoots": ["node_modules/@types", "lib/@types"], }, } diff --git a/packages/client/tsconfig.prod.json b/packages/client/tsconfig.prod.json index 78763e9cc3..e3cabd72ee 100644 --- a/packages/client/tsconfig.prod.json +++ b/packages/client/tsconfig.prod.json @@ -4,6 +4,7 @@ "compilerOptions": { "outDir": "dist", "lib": ["es2018", "dom"], + "typeRoots": ["node_modules/@types", "lib/@types"], }, "references": [ { "path": "../block/tsconfig.prod.json" }, diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index fad7cb1434..674899f049 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -6,13 +6,80 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [UNRELEASED] +## 2.5.0 - 2021-09-24 -**New Features** +### Common with custom Genesis State -**Bug Fixes and Maintenance** +In addition to initializing Common with a custom chain configuration it is now also possible to provide a custom genesis state JSON file, which completes the Common custom chain functionality. The format follows our genesis state file definitions for the built-in chains (see e.g. `src/genesisStates/goerli.json`) and can be used to initialize a Common instance like: -- Fixed `hardforkBlockBN()` to correctly return null for unscheduled hardforks, PR [#1329](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1329) +```typescript +import myCustomChain1 from '[PATH_TO_MY_CHAINS]/myCustomChain1.json' +import chain1GenesisState from '[PATH_TO_GENESIS_STATES]/chain1GenesisState.json' +const common = new Common({ chain: 'myCustomChain1', customChains: [ [ myCustomChain1, chain1GenesisState ] ]}) +``` + +Accessing the genesis state is now integrated into the `Common` class and can be accessed in a much more natural way by doing: + +```typescript +const genesisState = common.genesisState() +``` + +This now also provides direct access to custom genesis states passed into `Common` as described above. The old Common-separate `genesisStateByName()` and `genesisStateById()` functions are now `deprecated` and usage should be avoided. + +### Experimental Merge HF Support / HF by Total Difficulty + +The Merge HF has been added as a new HF and can be used with `Hardfork.Merge`, also [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675) as the core HF EIP has been added as an EIP JSON config file, see #1393. Note that all Merge HF related functionality is still considered `experimental`. + +See e.g. the following HF definition in one of our test chain files: + +```json +{ + "name": "merge", + "block": null, + "td": 5000 +} +``` + +There is also a new `consensusType` `pos` which can be set along a HF file (see `src/hardforks/merge.json`) or directly in a chain file (like `src/chains/mainnet.json`) to create a pure PoS chain (note that the creation of pure PoS chains is still untested). To reference this new consensus type `ConsensusType.ProofOfStake` from the `ConsensusType` enum dict can be used. + +To allow a HF switch by total difficulty (TD) - which is planned for the Merge - the chain file type has been updated to now also accept a `td` value as an alternative (respectively also: in addition) to the `block` number value, see PR [#1473](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1473). Along the `getHardforkByBlockNumber()` and `setHardforkByBlockNumber()` function signatures have been expanded to also allow for setting/getting a HF by the total difficulty value: + +- -> `getHardforkByBlockNumber(blockNumber: BNLike, td?: BNLike): string` +- -> `setHardforkByBlockNumber(blockNumber: BNLike, td?: BNLike): string` + +There is a new `hardforkTD(hardfork?: string | Hardfork): BN | null` function to get the TD value for a HF switch (so primarily: for the `merge` HF) if a total difficulty HF switch is configured. + +### Improved Typing for Hardfork, Chain and Genesis releated API Calls + +In the Common library all functionality returning hardfork, chain or genesis parameters has previously been under-typed respectively just returned `any` in most cases. This has been improved along PR [#1480](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1480) and is now finding its way into a release. + +Improved Signature Types: + +- -> `activeHardforks(blockNumber?: BNLike | null, opts: hardforkOptions = {}): HardforkParams[]` +- -> `genesis(): GenesisBlock` +- -> `hardforks(): HardforkParams[]` +- -> `bootstrapNodes(): BootstrapNode[]` +- -> `dnsNetworks(): string[]` + +**Potentially TypeScript Breaking**: Note while this is not strictly `TypeScript` breaking this might cause problems e.g. in the combination of using custom chain files with incomplete (but previously unused) parameters. So it is recommended to be a bit careful here. + +### Changed Null Semantics for Hardfork Block Numbers in Chain Files + +From this release onwards we will work with a tightened semantics using `null` for hardforks in the chain files. Up to this release `null` was used both for 1. HFs from the past which were not applied on a particular chain (e.g. the `dao` HF on `goerli`) as well as 2. HFs which are known to take place in the future but do not have a block number yet (e.g. the `shanghai` HF). + +We have removed all type 1. HF usages (so mainly `dao` HF inclusions) with PR [#1344](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1344) and HF block number `null` values are now strictly reserved for type 2.. + +If you have got left over type 1. `dao` HF inclusions in your custom chain files we encourage you to remove since this might cause problems along future releases. + +### Bug Fixes + +- **TypeScript Breaking**: Fixed `hardforkBlockBN()` to correctly return `null` for unscheduled hardforks, note that this changes the `TypeScript` function signature and might break your development setup (sorry for this, but this bugfix was nevertheless necessary), PR [#1329](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1329) +- Always pre-compute the HF `forkHash` values if not hardcoded in the chain files, PR [#1423](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1423) + +### Maintenance + +- Removed `calaveras` ephemeral testnet, PR [#1430](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1430) +- Added browser tests to `Common`, PR [#1380](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1380) **Dependencies, CI and Docs** diff --git a/packages/common/README.md b/packages/common/README.md index ece3b17525..82c6391112 100644 --- a/packages/common/README.md +++ b/packages/common/README.md @@ -9,7 +9,7 @@ | Resources common to all EthereumJS implementations. | | --- | -Note: this `README` reflects the state of the library from `v2.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-common) for an introduction on the last preceeding release. +Note: this `README` reflects the state of the library from `v2.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-common) for an introduction on the last preceding release. # INSTALL @@ -178,6 +178,22 @@ common1.setChain('customChain1') const common1 = new Common({ chain: 'customChain1', customChains: [ myCustomChain1, myCustomChain2 ] }) ``` +It is also possible (`v2.5.0`+) to pass in a custom genesis state file (see e.g. `src/genesisStates/goerli.json` for an example on the format needed) along with the custom chain configuration: + +```typescript +import myCustomChain1 from '[PATH_TO_MY_CHAINS]/myCustomChain1.json' +import chain1GenesisState from '[PATH_TO_GENESIS_STATES]/chain1GenesisState.json' +const common = new Common({ chain: 'myCustomChain1', customChains: [ [ myCustomChain1, chain1GenesisState ] ]}) +``` + +Accessing the genesis state can be done as follows: + +```typescript +const genesisState = common.genesisState() +``` + +This now also provides direct access to custom genesis states passed into `Common` as described above. The old Common-separate `genesisStateByName()` and `genesisStateById()` functions are now `deprecated` and usage should be avoided. + ## Hardforks The `hardfork` can be set in constructor like this: @@ -214,6 +230,7 @@ library supported: - `muirGlacier` (`Hardfork.MuirGlacier`) - `berlin` (`Hardfork.Berlin`) (since `v2.2.0`) - `london` (`Hardfork.London`) (since `v2.4.0`) +- `merge` (`Hardfork.Merge`) (since `v2.5.0`, `experimental`) ### Future Hardforks @@ -254,33 +271,16 @@ The following EIPs are currently supported: - [EIP-2718](https://eips.ethereum.org/EIPS/eip-2565): Transaction Types - [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929): gas cost increases for state access opcodes - [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930): Optional accesss list tx type +- [EIP-3198](https://eips.ethereum.org/EIPS/eip-3198): Base fee Opcode - [EIP-3529](https://eips.ethereum.org/EIPS/eip-3529): Reduction in refunds - [EIP-3541](https://eips.ethereum.org/EIPS/eip-3541): Reject new contracts starting with the 0xEF byte - [EIP-3554](https://eips.ethereum.org/EIPS/eip-3554): Difficulty Bomb Delay to December 2021 (only PoW networks) +- [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675): Upgrade consensus to Proof-of-Stake (`experimental`) ## Bootstrap Nodes You can use `common.bootstrapNodes()` function to get nodes for a specific chain/network. -## Genesis States - -Network-specific genesis files are located in the `genesisStates` folder. - -Due to the large file sizes genesis states are not directly included in the `index.js` file -but have to be accessed directly, e.g.: - -```javascript -const mainnetGenesisState = require('@ethereumjs/common/dist/genesisStates/mainnet') -``` - -Or by accessing dynamically: - -```javascript -const genesisStates = require('@ethereumjs/common/dist/genesisStates') -const mainnetGenesisState = genesisStates.genesisStateByName('mainnet') -const mainnetGenesisState = genesisStates.genesisStateById(1) // alternative via network Id -``` - # EthereumJS See our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices. diff --git a/packages/common/docs/.nojekyll b/packages/common/docs/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/packages/common/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/packages/common/docs/README.md b/packages/common/docs/README.md index a816526feb..b651fa919f 100644 --- a/packages/common/docs/README.md +++ b/packages/common/docs/README.md @@ -4,8 +4,19 @@ ## Table of contents -### Modules +### Enumerations -- [genesisStates](modules/genesisstates.md) -- [index](modules/index.md) -- [types](modules/types.md) +- [Chain](enums/Chain.md) +- [ConsensusAlgorithm](enums/ConsensusAlgorithm.md) +- [ConsensusType](enums/ConsensusType.md) +- [CustomChain](enums/CustomChain.md) +- [Hardfork](enums/Hardfork.md) + +### Classes + +- [default](classes/default.md) + +### Interfaces + +- [CommonOpts](interfaces/CommonOpts.md) +- [CustomCommonOpts](interfaces/CustomCommonOpts.md) diff --git a/packages/common/docs/classes/index.default.md b/packages/common/docs/classes/default.md similarity index 64% rename from packages/common/docs/classes/index.default.md rename to packages/common/docs/classes/default.md index 5ce9e02535..c5a7682f05 100644 --- a/packages/common/docs/classes/index.default.md +++ b/packages/common/docs/classes/default.md @@ -1,99 +1,99 @@ -[@ethereumjs/common](../README.md) / [index](../modules/index.md) / default +[@ethereumjs/common](../README.md) / default # Class: default -[index](../modules/index.md).default - Common class to access chain and hardfork parameters and to provide a unified and shared view on the network and hardfork state. Use the {@link Common.custom} static constructor for creating simple custom chain {@link Common} objects (more complete custom chain setups -can be created via the main constructor and the [CommonOpts.customChains](../interfaces/index.commonopts.md#customchains) parameter). +can be created via the main constructor and the [CommonOpts.customChains](../interfaces/CommonOpts.md#customchains) parameter). ## Hierarchy - `EventEmitter` - ↳ **default** + ↳ **`default`** ## Table of contents ### Constructors -- [constructor](index.default.md#constructor) +- [constructor](default.md#constructor) ### Properties -- [DEFAULT\_HARDFORK](index.default.md#default_hardfork) -- [defaultMaxListeners](index.default.md#defaultmaxlisteners) +- [DEFAULT\_HARDFORK](default.md#default_hardfork) +- [defaultMaxListeners](default.md#defaultmaxlisteners) ### Methods -- [\_calcForkHash](index.default.md#_calcforkhash) -- [\_chooseHardfork](index.default.md#_choosehardfork) -- [\_getHardfork](index.default.md#_gethardfork) -- [\_isSupportedHardfork](index.default.md#_issupportedhardfork) -- [activeHardfork](index.default.md#activehardfork) -- [activeHardforks](index.default.md#activehardforks) -- [activeOnBlock](index.default.md#activeonblock) -- [addListener](index.default.md#addlistener) -- [bootstrapNodes](index.default.md#bootstrapnodes) -- [chainId](index.default.md#chainid) -- [chainIdBN](index.default.md#chainidbn) -- [chainName](index.default.md#chainname) -- [consensusAlgorithm](index.default.md#consensusalgorithm) -- [consensusConfig](index.default.md#consensusconfig) -- [consensusType](index.default.md#consensustype) -- [copy](index.default.md#copy) -- [dnsNetworks](index.default.md#dnsnetworks) -- [eips](index.default.md#eips) -- [emit](index.default.md#emit) -- [eventNames](index.default.md#eventnames) -- [forkHash](index.default.md#forkhash) -- [genesis](index.default.md#genesis) -- [getHardforkByBlockNumber](index.default.md#gethardforkbyblocknumber) -- [getMaxListeners](index.default.md#getmaxlisteners) -- [gteHardfork](index.default.md#gtehardfork) -- [hardfork](index.default.md#hardfork) -- [hardforkBlock](index.default.md#hardforkblock) -- [hardforkBlockBN](index.default.md#hardforkblockbn) -- [hardforkForForkHash](index.default.md#hardforkforforkhash) -- [hardforkGteHardfork](index.default.md#hardforkgtehardfork) -- [hardforkIsActiveOnBlock](index.default.md#hardforkisactiveonblock) -- [hardforkIsActiveOnChain](index.default.md#hardforkisactiveonchain) -- [hardforks](index.default.md#hardforks) -- [isActivatedEIP](index.default.md#isactivatedeip) -- [isHardforkBlock](index.default.md#ishardforkblock) -- [isNextHardforkBlock](index.default.md#isnexthardforkblock) -- [listenerCount](index.default.md#listenercount) -- [listeners](index.default.md#listeners) -- [networkId](index.default.md#networkid) -- [networkIdBN](index.default.md#networkidbn) -- [nextHardforkBlock](index.default.md#nexthardforkblock) -- [nextHardforkBlockBN](index.default.md#nexthardforkblockbn) -- [off](index.default.md#off) -- [on](index.default.md#on) -- [once](index.default.md#once) -- [param](index.default.md#param) -- [paramByBlock](index.default.md#parambyblock) -- [paramByEIP](index.default.md#parambyeip) -- [paramByHardfork](index.default.md#parambyhardfork) -- [prependListener](index.default.md#prependlistener) -- [prependOnceListener](index.default.md#prependoncelistener) -- [rawListeners](index.default.md#rawlisteners) -- [removeAllListeners](index.default.md#removealllisteners) -- [removeListener](index.default.md#removelistener) -- [setChain](index.default.md#setchain) -- [setEIPs](index.default.md#seteips) -- [setHardfork](index.default.md#sethardfork) -- [setHardforkByBlockNumber](index.default.md#sethardforkbyblocknumber) -- [setMaxListeners](index.default.md#setmaxlisteners) -- [custom](index.default.md#custom) -- [forCustomChain](index.default.md#forcustomchain) -- [isSupportedChainId](index.default.md#issupportedchainid) -- [listenerCount](index.default.md#listenercount) -- [once](index.default.md#once) +- [\_calcForkHash](default.md#_calcforkhash) +- [\_chooseHardfork](default.md#_choosehardfork) +- [\_getHardfork](default.md#_gethardfork) +- [\_isSupportedHardfork](default.md#_issupportedhardfork) +- [activeHardfork](default.md#activehardfork) +- [activeHardforks](default.md#activehardforks) +- [activeOnBlock](default.md#activeonblock) +- [addListener](default.md#addlistener) +- [bootstrapNodes](default.md#bootstrapnodes) +- [chainId](default.md#chainid) +- [chainIdBN](default.md#chainidbn) +- [chainName](default.md#chainname) +- [consensusAlgorithm](default.md#consensusalgorithm) +- [consensusConfig](default.md#consensusconfig) +- [consensusType](default.md#consensustype) +- [copy](default.md#copy) +- [dnsNetworks](default.md#dnsnetworks) +- [eips](default.md#eips) +- [emit](default.md#emit) +- [eventNames](default.md#eventnames) +- [forkHash](default.md#forkhash) +- [genesis](default.md#genesis) +- [genesisState](default.md#genesisstate) +- [getHardforkByBlockNumber](default.md#gethardforkbyblocknumber) +- [getMaxListeners](default.md#getmaxlisteners) +- [gteHardfork](default.md#gtehardfork) +- [hardfork](default.md#hardfork) +- [hardforkBlock](default.md#hardforkblock) +- [hardforkBlockBN](default.md#hardforkblockbn) +- [hardforkForForkHash](default.md#hardforkforforkhash) +- [hardforkGteHardfork](default.md#hardforkgtehardfork) +- [hardforkIsActiveOnBlock](default.md#hardforkisactiveonblock) +- [hardforkIsActiveOnChain](default.md#hardforkisactiveonchain) +- [hardforkTD](default.md#hardforktd) +- [hardforks](default.md#hardforks) +- [isActivatedEIP](default.md#isactivatedeip) +- [isHardforkBlock](default.md#ishardforkblock) +- [isNextHardforkBlock](default.md#isnexthardforkblock) +- [listenerCount](default.md#listenercount) +- [listeners](default.md#listeners) +- [networkId](default.md#networkid) +- [networkIdBN](default.md#networkidbn) +- [nextHardforkBlock](default.md#nexthardforkblock) +- [nextHardforkBlockBN](default.md#nexthardforkblockbn) +- [off](default.md#off) +- [on](default.md#on) +- [once](default.md#once) +- [param](default.md#param) +- [paramByBlock](default.md#parambyblock) +- [paramByEIP](default.md#parambyeip) +- [paramByHardfork](default.md#parambyhardfork) +- [prependListener](default.md#prependlistener) +- [prependOnceListener](default.md#prependoncelistener) +- [rawListeners](default.md#rawlisteners) +- [removeAllListeners](default.md#removealllisteners) +- [removeListener](default.md#removelistener) +- [setChain](default.md#setchain) +- [setEIPs](default.md#seteips) +- [setHardfork](default.md#sethardfork) +- [setHardforkByBlockNumber](default.md#sethardforkbyblocknumber) +- [setMaxListeners](default.md#setmaxlisteners) +- [custom](default.md#custom) +- [forCustomChain](default.md#forcustomchain) +- [isSupportedChainId](default.md#issupportedchainid) +- [listenerCount](default.md#listenercount) +- [once](default.md#once) ## Constructors @@ -105,7 +105,7 @@ can be created via the main constructor and the [CommonOpts.customChains](../int | Name | Type | | :------ | :------ | -| `opts` | [CommonOpts](../interfaces/index.commonopts.md) | +| `opts` | [`CommonOpts`](../interfaces/CommonOpts.md) | #### Overrides @@ -113,7 +113,7 @@ EventEmitter.constructor #### Defined in -[packages/common/src/index.ts:278](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L278) +[packages/common/src/index.ts:314](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L314) ## Properties @@ -123,7 +123,7 @@ EventEmitter.constructor #### Defined in -[packages/common/src/index.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L135) +[packages/common/src/index.ts:165](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L165) ___ @@ -161,7 +161,7 @@ Fork hash as hex string #### Defined in -[packages/common/src/index.ts:778](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L778) +[packages/common/src/index.ts:895](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L895) ___ @@ -176,7 +176,7 @@ Internal helper function to choose between hardfork set and hardfork provided as | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `hardfork?` | ``null`` \| `string` | `undefined` | Hardfork given to function as a parameter | -| `onlySupported` | `boolean` | true | - | +| `onlySupported` | `boolean` | `true` | - | #### Returns @@ -186,7 +186,7 @@ Hardfork chosen to be used #### Defined in -[packages/common/src/index.ts:390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L390) +[packages/common/src/index.ts:483](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L483) ___ @@ -210,7 +210,7 @@ Dictionary with hardfork params #### Defined in -[packages/common/src/index.ts:404](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L404) +[packages/common/src/index.ts:497](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L497) ___ @@ -234,7 +234,7 @@ True if hardfork is supported #### Defined in -[packages/common/src/index.ts:417](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L417) +[packages/common/src/index.ts:510](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L510) ___ @@ -248,7 +248,7 @@ Returns the latest active hardfork name for chain or block or throws if unavaila | Name | Type | Description | | :------ | :------ | :------ | -| `blockNumber?` | ``null`` \| `string` \| `number` \| `BN` \| `Buffer` | up to block if provided, otherwise for the whole chain | +| `blockNumber?` | ``null`` \| `BNLike` | up to block if provided, otherwise for the whole chain | | `opts` | `hardforkOptions` | Hardfork options (onlyActive unused) | #### Returns @@ -259,13 +259,13 @@ Hardfork name #### Defined in -[packages/common/src/index.ts:689](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L689) +[packages/common/src/index.ts:782](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L782) ___ ### activeHardforks -▸ **activeHardforks**(`blockNumber?`, `opts?`): `any`[] +▸ **activeHardforks**(`blockNumber?`, `opts?`): `Hardfork`[] Returns the active hardfork switches for the current chain @@ -273,18 +273,18 @@ Returns the active hardfork switches for the current chain | Name | Type | Description | | :------ | :------ | :------ | -| `blockNumber?` | ``null`` \| `string` \| `number` \| `BN` \| `Buffer` | up to block if provided, otherwise for the whole chain | +| `blockNumber?` | ``null`` \| `BNLike` | up to block if provided, otherwise for the whole chain | | `opts` | `hardforkOptions` | Hardfork options (onlyActive unused) | #### Returns -`any`[] +`Hardfork`[] Array with hardfork arrays #### Defined in -[packages/common/src/index.ts:670](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L670) +[packages/common/src/index.ts:763](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L763) ___ @@ -309,13 +309,13 @@ True if HF is active on block number #### Defined in -[packages/common/src/index.ts:599](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L599) +[packages/common/src/index.ts:692](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L692) ___ ### addListener -▸ **addListener**(`event`, `listener`): [default](index.default.md) +▸ **addListener**(`event`, `listener`): [`default`](default.md) #### Parameters @@ -326,7 +326,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -340,19 +340,19 @@ ___ ### bootstrapNodes -▸ **bootstrapNodes**(): `any` +▸ **bootstrapNodes**(): `BootstrapNode`[] Returns bootstrap nodes for the current chain #### Returns -`any` +`BootstrapNode`[] Dict with bootstrap nodes #### Defined in -[packages/common/src/index.ts:853](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L853) +[packages/common/src/index.ts:1012](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1012) ___ @@ -362,7 +362,7 @@ ___ Returns the Id of current chain -**`deprecated`** Please use chainIdBN() for large number support +**`deprecated`** Please use {@link Common.chainIdBN} for large number support #### Returns @@ -372,7 +372,7 @@ chain Id #### Defined in -[packages/common/src/index.ts:878](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L878) +[packages/common/src/index.ts:1037](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1037) ___ @@ -390,7 +390,7 @@ chain Id #### Defined in -[packages/common/src/index.ts:886](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L886) +[packages/common/src/index.ts:1045](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1045) ___ @@ -408,7 +408,7 @@ chain name (lower case) #### Defined in -[packages/common/src/index.ts:894](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L894) +[packages/common/src/index.ts:1053](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1053) ___ @@ -418,8 +418,11 @@ ___ Returns the concrete consensus implementation algorithm or protocol for the network -e.g. "ethash" for "pow" consensus type or -"clique" for "poa" consensus type +e.g. "ethash" for "pow" consensus type, +"clique" for "poa" consensus type or +"casper" for "pos" consensus type. + +Note: This value can update along a hardfork. #### Returns @@ -427,13 +430,13 @@ e.g. "ethash" for "pow" consensus type or #### Defined in -[packages/common/src/index.ts:937](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L937) +[packages/common/src/index.ts:1113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1113) ___ ### consensusConfig -▸ **consensusConfig**(): `any` +▸ **consensusConfig**(): `Object` Returns a dictionary with consensus configuration parameters based on the consensus algorithm @@ -444,14 +447,17 @@ the respective chain json files): ethash: - clique: period, epoch aura: - +casper: - + +Note: This value can update along a hardfork. #### Returns -`any` +`Object` #### Defined in -[packages/common/src/index.ts:952](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L952) +[packages/common/src/index.ts:1143](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1143) ___ @@ -462,47 +468,49 @@ ___ Returns the consensus type of the network Possible values: "pow"|"poa"|"pos" +Note: This value can update along a hardfork. + #### Returns `string` #### Defined in -[packages/common/src/index.ts:927](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L927) +[packages/common/src/index.ts:1088](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1088) ___ ### copy -▸ **copy**(): [default](index.default.md) +▸ **copy**(): [`default`](default.md) Returns a deep copy of this {@link Common} instance. #### Returns -[default](index.default.md) +[`default`](default.md) #### Defined in -[packages/common/src/index.ts:959](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L959) +[packages/common/src/index.ts:1164](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1164) ___ ### dnsNetworks -▸ **dnsNetworks**(): `any` +▸ **dnsNetworks**(): `string`[] Returns DNS networks for the current chain #### Returns -`any` +`string`[] Array of DNS ENR urls #### Defined in -[packages/common/src/index.ts:861](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L861) +[packages/common/src/index.ts:1020](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1020) ___ @@ -520,7 +528,7 @@ List of EIPs #### Defined in -[packages/common/src/index.ts:919](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L919) +[packages/common/src/index.ts:1078](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1078) ___ @@ -585,39 +593,65 @@ Returns an eth/64 compliant fork hash (EIP-2124) #### Defined in -[packages/common/src/index.ts:808](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L808) +[packages/common/src/index.ts:927](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L927) ___ ### genesis -▸ **genesis**(): `any` +▸ **genesis**(): `GenesisBlock` -Returns the Genesis parameters of current chain +Returns the Genesis parameters of the current chain #### Returns -`any` +`GenesisBlock` Genesis dictionary #### Defined in -[packages/common/src/index.ts:837](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L837) +[packages/common/src/index.ts:956](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L956) + +___ + +### genesisState + +▸ **genesisState**(): `GenesisState` + +Returns the Genesis state of the current chain, +both account addresses and values are provided +as hex-prefixed strings + +#### Returns + +`GenesisState` + +Genesis state + +#### Defined in + +[packages/common/src/index.ts:967](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L967) ___ ### getHardforkByBlockNumber -▸ **getHardforkByBlockNumber**(`blockNumber`): `string` +▸ **getHardforkByBlockNumber**(`blockNumber`, `td?`): `string` + +Returns the hardfork based on the block number or an optional +total difficulty (Merge HF) provided. -Returns the hardfork based on the block number provided +An optional TD takes precedence in case the corresponding HF block +is set to `null` or otherwise needs to match (if not an error +will be thrown). #### Parameters | Name | Type | | :------ | :------ | | `blockNumber` | `BNLike` | +| `td?` | `BNLike` | #### Returns @@ -627,7 +661,7 @@ The name of the HF #### Defined in -[packages/common/src/index.ts:356](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L356) +[packages/common/src/index.ts:410](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L410) ___ @@ -670,7 +704,7 @@ True if hardfork set is greater than hardfork provided #### Defined in -[packages/common/src/index.ts:642](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L642) +[packages/common/src/index.ts:735](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L735) ___ @@ -688,17 +722,17 @@ Hardfork name #### Defined in -[packages/common/src/index.ts:869](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L869) +[packages/common/src/index.ts:1028](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1028) ___ ### hardforkBlock -▸ **hardforkBlock**(`hardfork?`): `number` +▸ **hardforkBlock**(`hardfork?`): ``null`` \| `number` Returns the hardfork change block for hardfork provided or set -**`deprecated`** Please use hardforkBlockBN() for large number support +**`deprecated`** Please use {@link Common.hardforkBlockBN} for large number support #### Parameters @@ -708,19 +742,19 @@ Returns the hardfork change block for hardfork provided or set #### Returns -`number` +``null`` \| `number` -Block number +Block number or null if unscheduled #### Defined in -[packages/common/src/index.ts:704](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L704) +[packages/common/src/index.ts:797](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L797) ___ ### hardforkBlockBN -▸ **hardforkBlockBN**(`hardfork?`): `BN` +▸ **hardforkBlockBN**(`hardfork?`): ``null`` \| `BN` Returns the hardfork change block for hardfork provided or set @@ -732,13 +766,13 @@ Returns the hardfork change block for hardfork provided or set #### Returns -`BN` +``null`` \| `BN` -Block number +Block number or null if unscheduled #### Defined in -[packages/common/src/index.ts:713](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L713) +[packages/common/src/index.ts:807](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L807) ___ @@ -760,7 +794,7 @@ Array with hardfork data (name, block, forkHash) #### Defined in -[packages/common/src/index.ts:826](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L826) +[packages/common/src/index.ts:945](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L945) ___ @@ -786,7 +820,7 @@ True if HF1 gte HF2 #### Defined in -[packages/common/src/index.ts:610](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L610) +[packages/common/src/index.ts:703](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L703) ___ @@ -812,7 +846,7 @@ True if HF is active on block number #### Defined in -[packages/common/src/index.ts:578](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L578) +[packages/common/src/index.ts:671](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L671) ___ @@ -837,25 +871,49 @@ True if hardfork is active on the chain #### Defined in -[packages/common/src/index.ts:652](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L652) +[packages/common/src/index.ts:745](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L745) + +___ + +### hardforkTD + +▸ **hardforkTD**(`hardfork?`): ``null`` \| `BN` + +Returns the hardfork change total difficulty (Merge HF) for hardfork provided or set + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `hardfork?` | `string` | Hardfork name, optional if HF set | + +#### Returns + +``null`` \| `BN` + +Total difficulty or null if no set + +#### Defined in + +[packages/common/src/index.ts:821](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L821) ___ ### hardforks -▸ **hardforks**(): `any` +▸ **hardforks**(): `Hardfork`[] Returns the hardforks for current chain #### Returns -`any` +`Hardfork`[] Array with arrays of hardforks #### Defined in -[packages/common/src/index.ts:845](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L845) +[packages/common/src/index.ts:1004](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1004) ___ @@ -864,11 +922,11 @@ ___ ▸ **isActivatedEIP**(`eip`): `boolean` Checks if an EIP is activated by either being included in the EIPs -manually passed in with the [CommonOpts.eips](../interfaces/index.commonopts.md#eips) or in a +manually passed in with the [CommonOpts.eips](../interfaces/CommonOpts.md#eips) or in a hardfork currently being active Note: this method only works for EIPs being supported -by the [CommonOpts.eips](../interfaces/index.commonopts.md#eips) constructor option +by the [CommonOpts.eips](../interfaces/CommonOpts.md#eips) constructor option #### Parameters @@ -882,7 +940,7 @@ by the [CommonOpts.eips](../interfaces/index.commonopts.md#eips) constructor opt #### Defined in -[packages/common/src/index.ts:556](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L556) +[packages/common/src/index.ts:649](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L649) ___ @@ -907,7 +965,7 @@ True if blockNumber is HF block #### Defined in -[packages/common/src/index.ts:724](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L724) +[packages/common/src/index.ts:836](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L836) ___ @@ -932,7 +990,7 @@ True if blockNumber is HF block #### Defined in -[packages/common/src/index.ts:766](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L766) +[packages/common/src/index.ts:882](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L882) ___ @@ -990,7 +1048,7 @@ ___ Returns the Id of current network -**`deprecated`** Please use networkIdBN() for large number support +**`deprecated`** Please use {@link Common.networkIdBN} for large number support #### Returns @@ -1000,7 +1058,7 @@ network Id #### Defined in -[packages/common/src/index.ts:903](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L903) +[packages/common/src/index.ts:1062](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1062) ___ @@ -1018,7 +1076,7 @@ network Id #### Defined in -[packages/common/src/index.ts:911](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L911) +[packages/common/src/index.ts:1070](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L1070) ___ @@ -1028,7 +1086,7 @@ ___ Returns the change block for the next hardfork after the hardfork provided or set -**`deprecated`** Please use nextHardforkBlockBN() for large number support +**`deprecated`** Please use {@link Common.nextHardforkBlockBN} for large number support #### Parameters @@ -1044,7 +1102,7 @@ Block number or null if not available #### Defined in -[packages/common/src/index.ts:736](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L736) +[packages/common/src/index.ts:849](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L849) ___ @@ -1068,13 +1126,13 @@ Block number or null if not available #### Defined in -[packages/common/src/index.ts:746](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L746) +[packages/common/src/index.ts:859](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L859) ___ ### off -▸ **off**(`event`, `listener`): [default](index.default.md) +▸ **off**(`event`, `listener`): [`default`](default.md) #### Parameters @@ -1085,7 +1143,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1099,7 +1157,7 @@ ___ ### on -▸ **on**(`event`, `listener`): [default](index.default.md) +▸ **on**(`event`, `listener`): [`default`](default.md) #### Parameters @@ -1110,7 +1168,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1124,7 +1182,7 @@ ___ ### once -▸ **once**(`event`, `listener`): [default](index.default.md) +▸ **once**(`event`, `listener`): [`default`](default.md) #### Parameters @@ -1135,7 +1193,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1172,7 +1230,7 @@ The value requested or `null` if not found #### Defined in -[packages/common/src/index.ts:466](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L466) +[packages/common/src/index.ts:559](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L559) ___ @@ -1196,7 +1254,7 @@ Returns a parameter for the hardfork active on block number #### Defined in -[packages/common/src/index.ts:541](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L541) +[packages/common/src/index.ts:634](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L634) ___ @@ -1222,7 +1280,7 @@ The value requested or `null` if not found #### Defined in -[packages/common/src/index.ts:519](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L519) +[packages/common/src/index.ts:612](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L612) ___ @@ -1248,13 +1306,13 @@ The value requested or `null` if not found #### Defined in -[packages/common/src/index.ts:486](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L486) +[packages/common/src/index.ts:579](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L579) ___ ### prependListener -▸ **prependListener**(`event`, `listener`): [default](index.default.md) +▸ **prependListener**(`event`, `listener`): [`default`](default.md) #### Parameters @@ -1265,7 +1323,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1279,7 +1337,7 @@ ___ ### prependOnceListener -▸ **prependOnceListener**(`event`, `listener`): [default](index.default.md) +▸ **prependOnceListener**(`event`, `listener`): [`default`](default.md) #### Parameters @@ -1290,7 +1348,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1328,7 +1386,7 @@ ___ ### removeAllListeners -▸ **removeAllListeners**(`event?`): [default](index.default.md) +▸ **removeAllListeners**(`event?`): [`default`](default.md) #### Parameters @@ -1338,7 +1396,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1352,7 +1410,7 @@ ___ ### removeListener -▸ **removeListener**(`event`, `listener`): [default](index.default.md) +▸ **removeListener**(`event`, `listener`): [`default`](default.md) #### Parameters @@ -1363,7 +1421,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1395,7 +1453,7 @@ The dictionary with parameters set as chain #### Defined in -[packages/common/src/index.ts:306](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L306) +[packages/common/src/index.ts:342](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L342) ___ @@ -1409,7 +1467,7 @@ Sets the active EIPs | Name | Type | Default value | | :------ | :------ | :------ | -| `eips` | `number`[] | [] | +| `eips` | `number`[] | `[]` | #### Returns @@ -1417,7 +1475,7 @@ Sets the active EIPs #### Defined in -[packages/common/src/index.ts:432](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L432) +[packages/common/src/index.ts:525](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L525) ___ @@ -1431,7 +1489,7 @@ Sets the hardfork to get params for | Name | Type | Description | | :------ | :------ | :------ | -| `hardfork` | `string` | String identifier (e.g. 'byzantium') | +| `hardfork` | `string` | String identifier (e.g. 'byzantium') or [Hardfork](../enums/Hardfork.md) enum | #### Returns @@ -1439,21 +1497,27 @@ Sets the hardfork to get params for #### Defined in -[packages/common/src/index.ts:332](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L332) +[packages/common/src/index.ts:379](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L379) ___ ### setHardforkByBlockNumber -▸ **setHardforkByBlockNumber**(`blockNumber`): `string` +▸ **setHardforkByBlockNumber**(`blockNumber`, `td?`): `string` + +Sets a new hardfork based on the block number or an optional +total difficulty (Merge HF) provided. -Sets a new hardfork based on the block number provided +An optional TD takes precedence in case the corresponding HF block +is set to `null` or otherwise needs to match (if not an error +will be thrown). #### Parameters | Name | Type | | :------ | :------ | | `blockNumber` | `BNLike` | +| `td?` | `BNLike` | #### Returns @@ -1463,13 +1527,13 @@ The name of the HF set #### Defined in -[packages/common/src/index.ts:378](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L378) +[packages/common/src/index.ts:472](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L472) ___ ### setMaxListeners -▸ **setMaxListeners**(`n`): [default](index.default.md) +▸ **setMaxListeners**(`n`): [`default`](default.md) #### Parameters @@ -1479,7 +1543,7 @@ ___ #### Returns -[default](index.default.md) +[`default`](default.md) #### Inherited from @@ -1493,11 +1557,11 @@ ___ ### custom -▸ `Static` **custom**(`chainParamsOrName`, `opts?`): [default](index.default.md) +▸ `Static` **custom**(`chainParamsOrName`, `opts?`): [`default`](default.md) Creates a {@link Common} object for a custom chain, based on a standard one. -It uses all the [Chain](../enums/index.chain.md) parameters from the [baseChain](../interfaces/index.customcommonopts.md#basechain) option except the ones overridden +It uses all the [Chain](../enums/Chain.md) parameters from the [baseChain](../interfaces/CustomCommonOpts.md#basechain) option except the ones overridden in a provided {@link chainParamsOrName} dictionary. Some usage example: ```javascript @@ -1519,25 +1583,25 @@ the `@ethereumjs/tx` library to a Layer-2 chain). | Name | Type | Description | | :------ | :------ | :------ | -| `chainParamsOrName` | `Partial`<[Chain](../interfaces/types.chain.md)\> \| [PolygonMainnet](../enums/index.customchain.md#polygonmainnet) \| [PolygonMumbai](../enums/index.customchain.md#polygonmumbai) \| [ArbitrumRinkebyTestnet](../enums/index.customchain.md#arbitrumrinkebytestnet) \| [xDaiChain](../enums/index.customchain.md#xdaichain) | Custom parameter dict (`name` will default to `custom-chain`) or string with name of a supported custom chain | -| `opts` | [CustomCommonOpts](../interfaces/index.customcommonopts.md) | Custom chain options to set the [CustomCommonOpts.baseChain](../interfaces/index.customcommonopts.md#basechain), selected [CustomCommonOpts.hardfork](../interfaces/index.customcommonopts.md#hardfork) and others | +| `chainParamsOrName` | `Partial`<`Chain`\> \| [`CustomChain`](../enums/CustomChain.md) | Custom parameter dict (`name` will default to `custom-chain`) or string with name of a supported custom chain | +| `opts` | [`CustomCommonOpts`](../interfaces/CustomCommonOpts.md) | Custom chain options to set the [CustomCommonOpts.baseChain](../interfaces/CustomCommonOpts.md#basechain), selected [CustomCommonOpts.hardfork](../interfaces/CustomCommonOpts.md#hardfork) and others | #### Returns -[default](index.default.md) +[`default`](default.md) #### Defined in -[packages/common/src/index.ts:167](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L167) +[packages/common/src/index.ts:197](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L197) ___ ### forCustomChain -▸ `Static` **forCustomChain**(`baseChain`, `customChainParams`, `hardfork?`, `supportedHardforks?`): [default](index.default.md) +▸ `Static` **forCustomChain**(`baseChain`, `customChainParams`, `hardfork?`, `supportedHardforks?`): [`default`](default.md) Creates a {@link Common} object for a custom chain, based on a standard one. It uses all the `Chain` -params from [baseChain](../interfaces/index.customcommonopts.md#basechain) except the ones overridden in {@link customChainParams}. +params from [baseChain](../interfaces/CustomCommonOpts.md#basechain) except the ones overridden in {@link customChainParams}. **`deprecated`** Use {@link Common.custom} instead @@ -1546,17 +1610,17 @@ params from [baseChain](../interfaces/index.customcommonopts.md#basechain) excep | Name | Type | Description | | :------ | :------ | :------ | | `baseChain` | `string` \| `number` | The name (`mainnet`) or id (`1`) of a standard chain used to base the custom chain params on. | -| `customChainParams` | `Partial`<[Chain](../interfaces/types.chain.md)\> | The custom parameters of the chain. | +| `customChainParams` | `Partial`<`Chain`\> | The custom parameters of the chain. | | `hardfork?` | `string` | String identifier ('byzantium') for hardfork (optional) | | `supportedHardforks?` | `string`[] | Limit parameter returns to the given hardforks (optional) | #### Returns -[default](index.default.md) +[`default`](default.md) #### Defined in -[packages/common/src/index.ts:229](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L229) +[packages/common/src/index.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L259) ___ @@ -1564,7 +1628,7 @@ ___ ▸ `Static` **isSupportedChainId**(`chainId`): `boolean` -Static method to determine if a [chainId](index.default.md#chainid) is supported as a standard chain +Static method to determine if a {@link chainId} is supported as a standard chain #### Parameters @@ -1580,7 +1644,7 @@ boolean #### Defined in -[packages/common/src/index.ts:252](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L252) +[packages/common/src/index.ts:282](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L282) ___ @@ -1613,7 +1677,7 @@ ___ ### once -▸ `Static` **once**(`emitter`, `event`): `Promise` +▸ `Static` **once**(`emitter`, `event`): `Promise`<`any`[]\> #### Parameters @@ -1624,7 +1688,7 @@ ___ #### Returns -`Promise` +`Promise`<`any`[]\> #### Inherited from @@ -1634,7 +1698,7 @@ EventEmitter.once node_modules/@types/node/events.d.ts:13 -▸ `Static` **once**(`emitter`, `event`): `Promise` +▸ `Static` **once**(`emitter`, `event`): `Promise`<`any`[]\> #### Parameters @@ -1645,7 +1709,7 @@ node_modules/@types/node/events.d.ts:13 #### Returns -`Promise` +`Promise`<`any`[]\> #### Inherited from diff --git a/packages/common/docs/enums/Chain.md b/packages/common/docs/enums/Chain.md new file mode 100644 index 0000000000..28a39f85d3 --- /dev/null +++ b/packages/common/docs/enums/Chain.md @@ -0,0 +1,63 @@ +[@ethereumjs/common](../README.md) / Chain + +# Enumeration: Chain + +## Table of contents + +### Enumeration members + +- [Goerli](Chain.md#goerli) +- [Kovan](Chain.md#kovan) +- [Mainnet](Chain.md#mainnet) +- [Rinkeby](Chain.md#rinkeby) +- [Ropsten](Chain.md#ropsten) + +## Enumeration members + +### Goerli + +• **Goerli** = `5` + +#### Defined in + +[packages/common/src/index.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L50) + +___ + +### Kovan + +• **Kovan** = `42` + +#### Defined in + +[packages/common/src/index.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L49) + +___ + +### Mainnet + +• **Mainnet** = `1` + +#### Defined in + +[packages/common/src/index.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L46) + +___ + +### Rinkeby + +• **Rinkeby** = `4` + +#### Defined in + +[packages/common/src/index.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L48) + +___ + +### Ropsten + +• **Ropsten** = `3` + +#### Defined in + +[packages/common/src/index.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L47) diff --git a/packages/common/docs/enums/ConsensusAlgorithm.md b/packages/common/docs/enums/ConsensusAlgorithm.md new file mode 100644 index 0000000000..5dfe22e20c --- /dev/null +++ b/packages/common/docs/enums/ConsensusAlgorithm.md @@ -0,0 +1,41 @@ +[@ethereumjs/common](../README.md) / ConsensusAlgorithm + +# Enumeration: ConsensusAlgorithm + +## Table of contents + +### Enumeration members + +- [Casper](ConsensusAlgorithm.md#casper) +- [Clique](ConsensusAlgorithm.md#clique) +- [Ethash](ConsensusAlgorithm.md#ethash) + +## Enumeration members + +### Casper + +• **Casper** = `"casper"` + +#### Defined in + +[packages/common/src/index.ts:79](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L79) + +___ + +### Clique + +• **Clique** = `"clique"` + +#### Defined in + +[packages/common/src/index.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L78) + +___ + +### Ethash + +• **Ethash** = `"ethash"` + +#### Defined in + +[packages/common/src/index.ts:77](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L77) diff --git a/packages/common/docs/enums/ConsensusType.md b/packages/common/docs/enums/ConsensusType.md new file mode 100644 index 0000000000..ad16f5d7b8 --- /dev/null +++ b/packages/common/docs/enums/ConsensusType.md @@ -0,0 +1,41 @@ +[@ethereumjs/common](../README.md) / ConsensusType + +# Enumeration: ConsensusType + +## Table of contents + +### Enumeration members + +- [ProofOfAuthority](ConsensusType.md#proofofauthority) +- [ProofOfStake](ConsensusType.md#proofofstake) +- [ProofOfWork](ConsensusType.md#proofofwork) + +## Enumeration members + +### ProofOfAuthority + +• **ProofOfAuthority** = `"poa"` + +#### Defined in + +[packages/common/src/index.ts:73](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L73) + +___ + +### ProofOfStake + +• **ProofOfStake** = `"pos"` + +#### Defined in + +[packages/common/src/index.ts:71](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L71) + +___ + +### ProofOfWork + +• **ProofOfWork** = `"pow"` + +#### Defined in + +[packages/common/src/index.ts:72](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L72) diff --git a/packages/common/docs/enums/CustomChain.md b/packages/common/docs/enums/CustomChain.md new file mode 100644 index 0000000000..82d6566c64 --- /dev/null +++ b/packages/common/docs/enums/CustomChain.md @@ -0,0 +1,68 @@ +[@ethereumjs/common](../README.md) / CustomChain + +# Enumeration: CustomChain + +## Table of contents + +### Enumeration members + +- [ArbitrumRinkebyTestnet](CustomChain.md#arbitrumrinkebytestnet) +- [PolygonMainnet](CustomChain.md#polygonmainnet) +- [PolygonMumbai](CustomChain.md#polygonmumbai) +- [xDaiChain](CustomChain.md#xdaichain) + +## Enumeration members + +### ArbitrumRinkebyTestnet + +• **ArbitrumRinkebyTestnet** = `"arbitrum-rinkeby-testnet"` + +Arbitrum Rinkeby Testnet + +- [Documentation](https://developer.offchainlabs.com/docs/public_testnet) + +#### Defined in + +[packages/common/src/index.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L35) + +___ + +### PolygonMainnet + +• **PolygonMainnet** = `"polygon-mainnet"` + +Polygon (Matic) Mainnet + +- [Documentation](https://docs.matic.network/docs/develop/network-details/network) + +#### Defined in + +[packages/common/src/index.ts:21](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L21) + +___ + +### PolygonMumbai + +• **PolygonMumbai** = `"polygon-mumbai"` + +Polygon (Matic) Mumbai Testnet + +- [Documentation](https://docs.matic.network/docs/develop/network-details/network) + +#### Defined in + +[packages/common/src/index.ts:28](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L28) + +___ + +### xDaiChain + +• **xDaiChain** = `"x-dai-chain"` + +xDai EVM sidechain with a native stable token + +- [Documentation](https://www.xdaichain.com/) + +#### Defined in + +[packages/common/src/index.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L42) diff --git a/packages/common/docs/enums/Hardfork.md b/packages/common/docs/enums/Hardfork.md new file mode 100644 index 0000000000..5f58858b2b --- /dev/null +++ b/packages/common/docs/enums/Hardfork.md @@ -0,0 +1,162 @@ +[@ethereumjs/common](../README.md) / Hardfork + +# Enumeration: Hardfork + +## Table of contents + +### Enumeration members + +- [Berlin](Hardfork.md#berlin) +- [Byzantium](Hardfork.md#byzantium) +- [Chainstart](Hardfork.md#chainstart) +- [Constantinople](Hardfork.md#constantinople) +- [Dao](Hardfork.md#dao) +- [Homestead](Hardfork.md#homestead) +- [Istanbul](Hardfork.md#istanbul) +- [London](Hardfork.md#london) +- [Merge](Hardfork.md#merge) +- [MuirGlacier](Hardfork.md#muirglacier) +- [Petersburg](Hardfork.md#petersburg) +- [Shanghai](Hardfork.md#shanghai) +- [SpuriousDragon](Hardfork.md#spuriousdragon) +- [TangerineWhistle](Hardfork.md#tangerinewhistle) + +## Enumeration members + +### Berlin + +• **Berlin** = `"berlin"` + +#### Defined in + +[packages/common/src/index.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L64) + +___ + +### Byzantium + +• **Byzantium** = `"byzantium"` + +#### Defined in + +[packages/common/src/index.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L59) + +___ + +### Chainstart + +• **Chainstart** = `"chainstart"` + +#### Defined in + +[packages/common/src/index.ts:54](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L54) + +___ + +### Constantinople + +• **Constantinople** = `"constantinople"` + +#### Defined in + +[packages/common/src/index.ts:60](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L60) + +___ + +### Dao + +• **Dao** = `"dao"` + +#### Defined in + +[packages/common/src/index.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L56) + +___ + +### Homestead + +• **Homestead** = `"homestead"` + +#### Defined in + +[packages/common/src/index.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L55) + +___ + +### Istanbul + +• **Istanbul** = `"istanbul"` + +#### Defined in + +[packages/common/src/index.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L62) + +___ + +### London + +• **London** = `"london"` + +#### Defined in + +[packages/common/src/index.ts:65](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L65) + +___ + +### Merge + +• **Merge** = `"merge"` + +#### Defined in + +[packages/common/src/index.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L67) + +___ + +### MuirGlacier + +• **MuirGlacier** = `"muirGlacier"` + +#### Defined in + +[packages/common/src/index.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L63) + +___ + +### Petersburg + +• **Petersburg** = `"petersburg"` + +#### Defined in + +[packages/common/src/index.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L61) + +___ + +### Shanghai + +• **Shanghai** = `"shanghai"` + +#### Defined in + +[packages/common/src/index.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L66) + +___ + +### SpuriousDragon + +• **SpuriousDragon** = `"spuriousDragon"` + +#### Defined in + +[packages/common/src/index.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L58) + +___ + +### TangerineWhistle + +• **TangerineWhistle** = `"tangerineWhistle"` + +#### Defined in + +[packages/common/src/index.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L57) diff --git a/packages/common/docs/enums/index.chain.md b/packages/common/docs/enums/index.chain.md deleted file mode 100644 index df07da2e46..0000000000 --- a/packages/common/docs/enums/index.chain.md +++ /dev/null @@ -1,76 +0,0 @@ -[@ethereumjs/common](../README.md) / [index](../modules/index.md) / Chain - -# Enumeration: Chain - -[index](../modules/index.md).Chain - -## Table of contents - -### Enumeration members - -- [Calaveras](index.chain.md#calaveras) -- [Goerli](index.chain.md#goerli) -- [Kovan](index.chain.md#kovan) -- [Mainnet](index.chain.md#mainnet) -- [Rinkeby](index.chain.md#rinkeby) -- [Ropsten](index.chain.md#ropsten) - -## Enumeration members - -### Calaveras - -• **Calaveras** = 123 - -#### Defined in - -[packages/common/src/index.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L45) - -___ - -### Goerli - -• **Goerli** = 5 - -#### Defined in - -[packages/common/src/index.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L44) - -___ - -### Kovan - -• **Kovan** = 42 - -#### Defined in - -[packages/common/src/index.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L43) - -___ - -### Mainnet - -• **Mainnet** = 1 - -#### Defined in - -[packages/common/src/index.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L40) - -___ - -### Rinkeby - -• **Rinkeby** = 4 - -#### Defined in - -[packages/common/src/index.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L42) - -___ - -### Ropsten - -• **Ropsten** = 3 - -#### Defined in - -[packages/common/src/index.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L41) diff --git a/packages/common/docs/enums/index.customchain.md b/packages/common/docs/enums/index.customchain.md deleted file mode 100644 index ba27410a86..0000000000 --- a/packages/common/docs/enums/index.customchain.md +++ /dev/null @@ -1,70 +0,0 @@ -[@ethereumjs/common](../README.md) / [index](../modules/index.md) / CustomChain - -# Enumeration: CustomChain - -[index](../modules/index.md).CustomChain - -## Table of contents - -### Enumeration members - -- [ArbitrumRinkebyTestnet](index.customchain.md#arbitrumrinkebytestnet) -- [PolygonMainnet](index.customchain.md#polygonmainnet) -- [PolygonMumbai](index.customchain.md#polygonmumbai) -- [xDaiChain](index.customchain.md#xdaichain) - -## Enumeration members - -### ArbitrumRinkebyTestnet - -• **ArbitrumRinkebyTestnet** = "arbitrum-rinkeby-testnet" - -Arbitrum Rinkeby Testnet - -- [Documentation](https://developer.offchainlabs.com/docs/public_testnet) - -#### Defined in - -[packages/common/src/index.ts:29](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L29) - -___ - -### PolygonMainnet - -• **PolygonMainnet** = "polygon-mainnet" - -Polygon (Matic) Mainnet - -- [Documentation](https://docs.matic.network/docs/develop/network-details/network) - -#### Defined in - -[packages/common/src/index.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L15) - -___ - -### PolygonMumbai - -• **PolygonMumbai** = "polygon-mumbai" - -Polygon (Matic) Mumbai Testnet - -- [Documentation](https://docs.matic.network/docs/develop/network-details/network) - -#### Defined in - -[packages/common/src/index.ts:22](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L22) - -___ - -### xDaiChain - -• **xDaiChain** = "x-dai-chain" - -xDai EVM sidechain with a native stable token - -- [Documentation](https://www.xdaichain.com/) - -#### Defined in - -[packages/common/src/index.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L36) diff --git a/packages/common/docs/enums/index.hardfork.md b/packages/common/docs/enums/index.hardfork.md deleted file mode 100644 index 0a8ee9db5c..0000000000 --- a/packages/common/docs/enums/index.hardfork.md +++ /dev/null @@ -1,142 +0,0 @@ -[@ethereumjs/common](../README.md) / [index](../modules/index.md) / Hardfork - -# Enumeration: Hardfork - -[index](../modules/index.md).Hardfork - -## Table of contents - -### Enumeration members - -- [Berlin](index.hardfork.md#berlin) -- [Byzantium](index.hardfork.md#byzantium) -- [Chainstart](index.hardfork.md#chainstart) -- [Constantinople](index.hardfork.md#constantinople) -- [Dao](index.hardfork.md#dao) -- [Homestead](index.hardfork.md#homestead) -- [Istanbul](index.hardfork.md#istanbul) -- [London](index.hardfork.md#london) -- [MuirGlacier](index.hardfork.md#muirglacier) -- [Petersburg](index.hardfork.md#petersburg) -- [SpuriousDragon](index.hardfork.md#spuriousdragon) -- [TangerineWhistle](index.hardfork.md#tangerinewhistle) - -## Enumeration members - -### Berlin - -• **Berlin** = "berlin" - -#### Defined in - -[packages/common/src/index.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L59) - -___ - -### Byzantium - -• **Byzantium** = "byzantium" - -#### Defined in - -[packages/common/src/index.ts:54](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L54) - -___ - -### Chainstart - -• **Chainstart** = "chainstart" - -#### Defined in - -[packages/common/src/index.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L49) - -___ - -### Constantinople - -• **Constantinople** = "constantinople" - -#### Defined in - -[packages/common/src/index.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L55) - -___ - -### Dao - -• **Dao** = "dao" - -#### Defined in - -[packages/common/src/index.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L51) - -___ - -### Homestead - -• **Homestead** = "homestead" - -#### Defined in - -[packages/common/src/index.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L50) - -___ - -### Istanbul - -• **Istanbul** = "istanbul" - -#### Defined in - -[packages/common/src/index.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L57) - -___ - -### London - -• **London** = "london" - -#### Defined in - -[packages/common/src/index.ts:60](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L60) - -___ - -### MuirGlacier - -• **MuirGlacier** = "muirGlacier" - -#### Defined in - -[packages/common/src/index.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L58) - -___ - -### Petersburg - -• **Petersburg** = "petersburg" - -#### Defined in - -[packages/common/src/index.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L56) - -___ - -### SpuriousDragon - -• **SpuriousDragon** = "spuriousDragon" - -#### Defined in - -[packages/common/src/index.ts:53](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L53) - -___ - -### TangerineWhistle - -• **TangerineWhistle** = "tangerineWhistle" - -#### Defined in - -[packages/common/src/index.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L52) diff --git a/packages/common/docs/interfaces/CommonOpts.md b/packages/common/docs/interfaces/CommonOpts.md new file mode 100644 index 0000000000..d20dff36e5 --- /dev/null +++ b/packages/common/docs/interfaces/CommonOpts.md @@ -0,0 +1,120 @@ +[@ethereumjs/common](../README.md) / CommonOpts + +# Interface: CommonOpts + +Options for instantiating a {@link Common} instance. + +## Hierarchy + +- `BaseOpts` + + ↳ **`CommonOpts`** + +## Table of contents + +### Properties + +- [chain](CommonOpts.md#chain) +- [customChains](CommonOpts.md#customchains) +- [eips](CommonOpts.md#eips) +- [hardfork](CommonOpts.md#hardfork) +- [supportedHardforks](CommonOpts.md#supportedhardforks) + +## Properties + +### chain + +• **chain**: `string` \| `number` \| `object` \| `BN` + +Chain name ('mainnet'), id (1), or [Chain](../enums/Chain.md) enum, +either from a chain directly supported or a custom chain +passed in via [CommonOpts.customChains](CommonOpts.md#customchains). + +#### Defined in + +[packages/common/src/index.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L113) + +___ + +### customChains + +• `Optional` **customChains**: `Chain`[] \| [`Chain`, `GenesisState`][] + +Initialize (in addition to the supported chains) with the selected +custom chains + +Usage (directly with the respective chain intialization via the [CommonOpts.chain](CommonOpts.md#chain) option): + +Pattern 1 (without genesis state): + +```javascript +import myCustomChain1 from '[PATH_TO_MY_CHAINS]/myCustomChain1.json' +const common = new Common({ chain: 'myCustomChain1', customChains: [ myCustomChain1 ]}) +``` + +Pattern 2 (with genesis state, see {@link CommonOpts.genesisState} for format): + +```javascript +import myCustomChain1 from '[PATH_TO_MY_CHAINS]/myCustomChain1.json' +import chain1GenesisState from '[PATH_TO_GENESIS_STATES]/chain1GenesisState.json' +const common = new Common({ chain: 'myCustomChain1', customChains: [ [ myCustomChain1, chain1GenesisState ] ]}) +``` + +#### Defined in + +[packages/common/src/index.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L135) + +___ + +### eips + +• `Optional` **eips**: `number`[] + +Selected EIPs which can be activated, please use an array for instantiation +(e.g. `eips: [ 2537, ]`) + +Currently supported: + +- [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS12-381 precompiles + +#### Inherited from + +BaseOpts.eips + +#### Defined in + +[packages/common/src/index.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L101) + +___ + +### hardfork + +• `Optional` **hardfork**: `string` + +String identifier ('byzantium') for hardfork or [Hardfork](../enums/Hardfork.md) enum. + +Default: Hardfork.Istanbul + +#### Inherited from + +BaseOpts.hardfork + +#### Defined in + +[packages/common/src/index.ts:88](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L88) + +___ + +### supportedHardforks + +• `Optional` **supportedHardforks**: `string`[] + +Limit parameter returns to the given hardforks + +#### Inherited from + +BaseOpts.supportedHardforks + +#### Defined in + +[packages/common/src/index.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L92) diff --git a/packages/common/docs/interfaces/CustomCommonOpts.md b/packages/common/docs/interfaces/CustomCommonOpts.md new file mode 100644 index 0000000000..14f0130eeb --- /dev/null +++ b/packages/common/docs/interfaces/CustomCommonOpts.md @@ -0,0 +1,88 @@ +[@ethereumjs/common](../README.md) / CustomCommonOpts + +# Interface: CustomCommonOpts + +Options to be used with the {@link Common.custom} static constructor. + +## Hierarchy + +- `BaseOpts` + + ↳ **`CustomCommonOpts`** + +## Table of contents + +### Properties + +- [baseChain](CustomCommonOpts.md#basechain) +- [eips](CustomCommonOpts.md#eips) +- [hardfork](CustomCommonOpts.md#hardfork) +- [supportedHardforks](CustomCommonOpts.md#supportedhardforks) + +## Properties + +### baseChain + +• `Optional` **baseChain**: `string` \| `number` \| `BN` + +The name (`mainnet`), id (`1`), or [Chain](../enums/Chain.md) enum of +a standard chain used to base the custom chain params on. + +#### Defined in + +[packages/common/src/index.ts:146](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L146) + +___ + +### eips + +• `Optional` **eips**: `number`[] + +Selected EIPs which can be activated, please use an array for instantiation +(e.g. `eips: [ 2537, ]`) + +Currently supported: + +- [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS12-381 precompiles + +#### Inherited from + +BaseOpts.eips + +#### Defined in + +[packages/common/src/index.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L101) + +___ + +### hardfork + +• `Optional` **hardfork**: `string` + +String identifier ('byzantium') for hardfork or [Hardfork](../enums/Hardfork.md) enum. + +Default: Hardfork.Istanbul + +#### Inherited from + +BaseOpts.hardfork + +#### Defined in + +[packages/common/src/index.ts:88](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L88) + +___ + +### supportedHardforks + +• `Optional` **supportedHardforks**: `string`[] + +Limit parameter returns to the given hardforks + +#### Inherited from + +BaseOpts.supportedHardforks + +#### Defined in + +[packages/common/src/index.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L92) diff --git a/packages/common/docs/interfaces/index.commonopts.md b/packages/common/docs/interfaces/index.commonopts.md deleted file mode 100644 index 640da29aec..0000000000 --- a/packages/common/docs/interfaces/index.commonopts.md +++ /dev/null @@ -1,111 +0,0 @@ -[@ethereumjs/common](../README.md) / [index](../modules/index.md) / CommonOpts - -# Interface: CommonOpts - -[index](../modules/index.md).CommonOpts - -Options for instantiating a {@link Common} instance. - -## Hierarchy - -- `BaseOpts` - - ↳ **CommonOpts** - -## Table of contents - -### Properties - -- [chain](index.commonopts.md#chain) -- [customChains](index.commonopts.md#customchains) -- [eips](index.commonopts.md#eips) -- [hardfork](index.commonopts.md#hardfork) -- [supportedHardforks](index.commonopts.md#supportedhardforks) - -## Properties - -### chain - -• **chain**: `string` \| `number` \| `object` \| `BN` - -Chain name ('mainnet') or id (1), either from a chain directly supported -or a custom chain passed in via [CommonOpts.customChains](index.commonopts.md#customchains) - -#### Defined in - -[packages/common/src/index.ts:93](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L93) - -___ - -### customChains - -• `Optional` **customChains**: [Chain](types.chain.md)[] - -Initialize (in addition to the supported chains) with the selected -custom chains - -Usage (directly with the respective chain intialization via the [CommonOpts.chain](index.commonopts.md#chain) option): - -```javascript -import myCustomChain1 from '[PATH_TO_MY_CHAINS]/myCustomChain1.json' -const common = new Common({ chain: 'myCustomChain1', customChains: [ myCustomChain1 ]}) -``` - -#### Defined in - -[packages/common/src/index.ts:105](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L105) - -___ - -### eips - -• `Optional` **eips**: `number`[] - -Selected EIPs which can be activated, please use an array for instantiation -(e.g. `eips: [ 2537, ]`) - -Currently supported: - -- [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS12-381 precompiles - -#### Inherited from - -BaseOpts.eips - -#### Defined in - -[packages/common/src/index.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L82) - -___ - -### hardfork - -• `Optional` **hardfork**: `string` - -String identifier ('byzantium') for hardfork - -Default: `istanbul` - -#### Inherited from - -BaseOpts.hardfork - -#### Defined in - -[packages/common/src/index.ts:69](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L69) - -___ - -### supportedHardforks - -• `Optional` **supportedHardforks**: `string`[] - -Limit parameter returns to the given hardforks - -#### Inherited from - -BaseOpts.supportedHardforks - -#### Defined in - -[packages/common/src/index.ts:73](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L73) diff --git a/packages/common/docs/interfaces/index.customcommonopts.md b/packages/common/docs/interfaces/index.customcommonopts.md deleted file mode 100644 index bb602aa1bd..0000000000 --- a/packages/common/docs/interfaces/index.customcommonopts.md +++ /dev/null @@ -1,90 +0,0 @@ -[@ethereumjs/common](../README.md) / [index](../modules/index.md) / CustomCommonOpts - -# Interface: CustomCommonOpts - -[index](../modules/index.md).CustomCommonOpts - -Options to be used with the {@link Common.custom} static constructor. - -## Hierarchy - -- `BaseOpts` - - ↳ **CustomCommonOpts** - -## Table of contents - -### Properties - -- [baseChain](index.customcommonopts.md#basechain) -- [eips](index.customcommonopts.md#eips) -- [hardfork](index.customcommonopts.md#hardfork) -- [supportedHardforks](index.customcommonopts.md#supportedhardforks) - -## Properties - -### baseChain - -• `Optional` **baseChain**: `string` \| `number` \| `BN` - -The name (`mainnet`) or id (`1`) of a standard chain used to base the custom -chain params on. - -#### Defined in - -[packages/common/src/index.ts:116](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L116) - -___ - -### eips - -• `Optional` **eips**: `number`[] - -Selected EIPs which can be activated, please use an array for instantiation -(e.g. `eips: [ 2537, ]`) - -Currently supported: - -- [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS12-381 precompiles - -#### Inherited from - -BaseOpts.eips - -#### Defined in - -[packages/common/src/index.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L82) - -___ - -### hardfork - -• `Optional` **hardfork**: `string` - -String identifier ('byzantium') for hardfork - -Default: `istanbul` - -#### Inherited from - -BaseOpts.hardfork - -#### Defined in - -[packages/common/src/index.ts:69](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L69) - -___ - -### supportedHardforks - -• `Optional` **supportedHardforks**: `string`[] - -Limit parameter returns to the given hardforks - -#### Inherited from - -BaseOpts.supportedHardforks - -#### Defined in - -[packages/common/src/index.ts:73](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/index.ts#L73) diff --git a/packages/common/docs/interfaces/types.bootstrapnode.md b/packages/common/docs/interfaces/types.bootstrapnode.md deleted file mode 100644 index fd57ae5ea2..0000000000 --- a/packages/common/docs/interfaces/types.bootstrapnode.md +++ /dev/null @@ -1,87 +0,0 @@ -[@ethereumjs/common](../README.md) / [types](../modules/types.md) / BootstrapNode - -# Interface: BootstrapNode - -[types](../modules/types.md).BootstrapNode - -## Table of contents - -### Properties - -- [chainId](types.bootstrapnode.md#chainid) -- [comment](types.bootstrapnode.md#comment) -- [id](types.bootstrapnode.md#id) -- [ip](types.bootstrapnode.md#ip) -- [location](types.bootstrapnode.md#location) -- [network](types.bootstrapnode.md#network) -- [port](types.bootstrapnode.md#port) - -## Properties - -### chainId - -• `Optional` **chainId**: `number` - -#### Defined in - -[packages/common/src/types.ts:65](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L65) - -___ - -### comment - -• **comment**: `string` - -#### Defined in - -[packages/common/src/types.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L68) - -___ - -### id - -• **id**: `string` - -#### Defined in - -[packages/common/src/types.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L66) - -___ - -### ip - -• **ip**: `string` - -#### Defined in - -[packages/common/src/types.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L62) - -___ - -### location - -• **location**: `string` - -#### Defined in - -[packages/common/src/types.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L67) - -___ - -### network - -• `Optional` **network**: `string` - -#### Defined in - -[packages/common/src/types.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L64) - -___ - -### port - -• **port**: `string` \| `number` - -#### Defined in - -[packages/common/src/types.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L63) diff --git a/packages/common/docs/interfaces/types.chain.md b/packages/common/docs/interfaces/types.chain.md deleted file mode 100644 index f4b1381640..0000000000 --- a/packages/common/docs/interfaces/types.chain.md +++ /dev/null @@ -1,142 +0,0 @@ -[@ethereumjs/common](../README.md) / [types](../modules/types.md) / Chain - -# Interface: Chain - -[types](../modules/types.md).Chain - -## Table of contents - -### Properties - -- [bootstrapNodes](types.chain.md#bootstrapnodes) -- [chainId](types.chain.md#chainid) -- [comment](types.chain.md#comment) -- [consensus](types.chain.md#consensus) -- [defaultHardfork](types.chain.md#defaulthardfork) -- [dnsNetworks](types.chain.md#dnsnetworks) -- [genesis](types.chain.md#genesis) -- [hardforks](types.chain.md#hardforks) -- [name](types.chain.md#name) -- [networkId](types.chain.md#networkid) -- [url](types.chain.md#url) - -## Properties - -### bootstrapNodes - -• **bootstrapNodes**: [BootstrapNode](types.bootstrapnode.md)[] - -#### Defined in - -[packages/common/src/types.ts:27](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L27) - -___ - -### chainId - -• **chainId**: `number` \| `BN` - -#### Defined in - -[packages/common/src/types.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L19) - -___ - -### comment - -• **comment**: `string` - -#### Defined in - -[packages/common/src/types.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L23) - -___ - -### consensus - -• `Optional` **consensus**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `algorithm` | `string` | -| `clique?` | `Object` | -| `clique.epoch` | `number` | -| `clique.period` | `number` | -| `ethash?` | `any` | -| `type` | `string` | - -#### Defined in - -[packages/common/src/types.ts:30](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L30) - -___ - -### defaultHardfork - -• `Optional` **defaultHardfork**: `string` - -#### Defined in - -[packages/common/src/types.ts:22](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L22) - -___ - -### dnsNetworks - -• `Optional` **dnsNetworks**: `string`[] - -#### Defined in - -[packages/common/src/types.ts:28](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L28) - -___ - -### genesis - -• **genesis**: [GenesisBlock](types.genesisblock.md) - -#### Defined in - -[packages/common/src/types.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L25) - -___ - -### hardforks - -• **hardforks**: [Hardfork](types.hardfork.md)[] - -#### Defined in - -[packages/common/src/types.ts:26](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L26) - -___ - -### name - -• **name**: `string` - -#### Defined in - -[packages/common/src/types.ts:18](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L18) - -___ - -### networkId - -• **networkId**: `number` \| `BN` - -#### Defined in - -[packages/common/src/types.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L20) - -___ - -### url - -• **url**: `string` - -#### Defined in - -[packages/common/src/types.ts:24](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L24) diff --git a/packages/common/docs/interfaces/types.chainstype.md b/packages/common/docs/interfaces/types.chainstype.md deleted file mode 100644 index 99614d2b14..0000000000 --- a/packages/common/docs/interfaces/types.chainstype.md +++ /dev/null @@ -1,29 +0,0 @@ -[@ethereumjs/common](../README.md) / [types](../modules/types.md) / chainsType - -# Interface: chainsType - -[types](../modules/types.md).chainsType - -## Indexable - -▪ [key: `string`]: `any` - -## Table of contents - -### Properties - -- [names](types.chainstype.md#names) - -## Properties - -### names - -• **names**: `Object` - -#### Index signature - -▪ [key: `string`]: `string` - -#### Defined in - -[packages/common/src/types.ts:11](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L11) diff --git a/packages/common/docs/interfaces/types.eipstype.md b/packages/common/docs/interfaces/types.eipstype.md deleted file mode 100644 index 89d5c1441d..0000000000 --- a/packages/common/docs/interfaces/types.eipstype.md +++ /dev/null @@ -1,9 +0,0 @@ -[@ethereumjs/common](../README.md) / [types](../modules/types.md) / eipsType - -# Interface: eipsType - -[types](../modules/types.md).eipsType - -## Indexable - -▪ [key: `number`]: `any` diff --git a/packages/common/docs/interfaces/types.genesisblock.md b/packages/common/docs/interfaces/types.genesisblock.md deleted file mode 100644 index f3f2ec355c..0000000000 --- a/packages/common/docs/interfaces/types.genesisblock.md +++ /dev/null @@ -1,87 +0,0 @@ -[@ethereumjs/common](../README.md) / [types](../modules/types.md) / GenesisBlock - -# Interface: GenesisBlock - -[types](../modules/types.md).GenesisBlock - -## Table of contents - -### Properties - -- [difficulty](types.genesisblock.md#difficulty) -- [extraData](types.genesisblock.md#extradata) -- [gasLimit](types.genesisblock.md#gaslimit) -- [hash](types.genesisblock.md#hash) -- [nonce](types.genesisblock.md#nonce) -- [stateRoot](types.genesisblock.md#stateroot) -- [timestamp](types.genesisblock.md#timestamp) - -## Properties - -### difficulty - -• **difficulty**: `number` - -#### Defined in - -[packages/common/src/types.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L49) - -___ - -### extraData - -• **extraData**: `string` - -#### Defined in - -[packages/common/src/types.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L51) - -___ - -### gasLimit - -• **gasLimit**: `number` - -#### Defined in - -[packages/common/src/types.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L48) - -___ - -### hash - -• **hash**: `string` - -#### Defined in - -[packages/common/src/types.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L46) - -___ - -### nonce - -• **nonce**: `string` - -#### Defined in - -[packages/common/src/types.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L50) - -___ - -### stateRoot - -• **stateRoot**: `string` - -#### Defined in - -[packages/common/src/types.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L52) - -___ - -### timestamp - -• **timestamp**: ``null`` \| `string` - -#### Defined in - -[packages/common/src/types.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L47) diff --git a/packages/common/docs/interfaces/types.genesisstatestype.md b/packages/common/docs/interfaces/types.genesisstatestype.md deleted file mode 100644 index 5da40244b3..0000000000 --- a/packages/common/docs/interfaces/types.genesisstatestype.md +++ /dev/null @@ -1,29 +0,0 @@ -[@ethereumjs/common](../README.md) / [types](../modules/types.md) / genesisStatesType - -# Interface: genesisStatesType - -[types](../modules/types.md).genesisStatesType - -## Indexable - -▪ [key: `string`]: {} - -## Table of contents - -### Properties - -- [names](types.genesisstatestype.md#names) - -## Properties - -### names - -• **names**: `Object` - -#### Index signature - -▪ [key: `string`]: `string` - -#### Defined in - -[packages/common/src/types.ts:4](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L4) diff --git a/packages/common/docs/interfaces/types.hardfork.md b/packages/common/docs/interfaces/types.hardfork.md deleted file mode 100644 index 47cf996803..0000000000 --- a/packages/common/docs/interfaces/types.hardfork.md +++ /dev/null @@ -1,43 +0,0 @@ -[@ethereumjs/common](../README.md) / [types](../modules/types.md) / Hardfork - -# Interface: Hardfork - -[types](../modules/types.md).Hardfork - -## Table of contents - -### Properties - -- [block](types.hardfork.md#block) -- [forkHash](types.hardfork.md#forkhash) -- [name](types.hardfork.md#name) - -## Properties - -### block - -• **block**: ``null`` \| `number` - -#### Defined in - -[packages/common/src/types.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L57) - -___ - -### forkHash - -• `Optional` **forkHash**: ``null`` \| `string` - -#### Defined in - -[packages/common/src/types.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L58) - -___ - -### name - -• **name**: `string` - -#### Defined in - -[packages/common/src/types.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L56) diff --git a/packages/common/docs/modules/genesisstates.md b/packages/common/docs/modules/genesisstates.md deleted file mode 100644 index 3ad488bf82..0000000000 --- a/packages/common/docs/modules/genesisstates.md +++ /dev/null @@ -1,58 +0,0 @@ -[@ethereumjs/common](../README.md) / genesisStates - -# Module: genesisStates - -## Table of contents - -### Functions - -- [genesisStateById](genesisstates.md#genesisstatebyid) -- [genesisStateByName](genesisstates.md#genesisstatebyname) - -## Functions - -### genesisStateById - -▸ **genesisStateById**(`id`): `any` - -Returns the genesis state by network ID - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `id` | `number` | ID of the network (e.g. 1) | - -#### Returns - -`any` - -Dictionary with genesis accounts - -#### Defined in - -[packages/common/src/genesisStates/index.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/genesisStates/index.ts#L25) - -___ - -### genesisStateByName - -▸ **genesisStateByName**(`name`): `any` - -Returns the genesis state by network name - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `name` | `string` | Name of the network (e.g. 'mainnet') | - -#### Returns - -`any` - -Dictionary with genesis accounts - -#### Defined in - -[packages/common/src/genesisStates/index.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/genesisStates/index.ts#L34) diff --git a/packages/common/docs/modules/index.md b/packages/common/docs/modules/index.md deleted file mode 100644 index c3c1d2274b..0000000000 --- a/packages/common/docs/modules/index.md +++ /dev/null @@ -1,20 +0,0 @@ -[@ethereumjs/common](../README.md) / index - -# Module: index - -## Table of contents - -### Enumerations - -- [Chain](../enums/index.chain.md) -- [CustomChain](../enums/index.customchain.md) -- [Hardfork](../enums/index.hardfork.md) - -### Classes - -- [default](../classes/index.default.md) - -### Interfaces - -- [CommonOpts](../interfaces/index.commonopts.md) -- [CustomCommonOpts](../interfaces/index.customcommonopts.md) diff --git a/packages/common/docs/modules/types.md b/packages/common/docs/modules/types.md deleted file mode 100644 index cb2b6fc0ab..0000000000 --- a/packages/common/docs/modules/types.md +++ /dev/null @@ -1,15 +0,0 @@ -[@ethereumjs/common](../README.md) / types - -# Module: types - -## Table of contents - -### Interfaces - -- [BootstrapNode](../interfaces/types.bootstrapnode.md) -- [Chain](../interfaces/types.chain.md) -- [GenesisBlock](../interfaces/types.genesisblock.md) -- [Hardfork](../interfaces/types.hardfork.md) -- [chainsType](../interfaces/types.chainstype.md) -- [eipsType](../interfaces/types.eipstype.md) -- [genesisStatesType](../interfaces/types.genesisstatestype.md) diff --git a/packages/common/package.json b/packages/common/package.json index e9a48aefc5..fe33c9064f 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/common", - "version": "2.4.0", + "version": "2.5.0", "description": "Resources common to all Ethereum implementations", "license": "MIT", "keywords": [ @@ -24,12 +24,12 @@ "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "coverage": "../../config/cli/coverage.sh", "format": "ethereumjs-config-format", "format:fix": "ethereumjs-config-format-fix", - "tsc": "ethereumjs-config-ts-compile", + "tsc": "../../config/cli/ts-compile.sh", "lint": "../../config/cli/lint.sh", "lint:fix": "../../config/cli/lint-fix.sh", "tape": "tape -r ts-node/register", @@ -40,11 +40,11 @@ }, "dependencies": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.0" + "ethereumjs-util": "^7.1.1" }, "devDependencies": { "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -53,8 +53,8 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", - "typedoc": "^0.21.5", + "tape": "^5.3.1", + "typedoc": "^0.22.4", "ts-node": "^10.2.1", "typescript": "^4.4.2" }, diff --git a/packages/common/src/chains/goerli.json b/packages/common/src/chains/goerli.json index 297135ebd7..7e139a6e03 100644 --- a/packages/common/src/chains/goerli.json +++ b/packages/common/src/chains/goerli.json @@ -74,12 +74,12 @@ "forkHash": "0xb8c6299d" }, { - "name": "shanghai", + "name": "merge", "block": null, "forkash": null }, { - "name": "merge", + "name": "shanghai", "block": null, "forkash": null } diff --git a/packages/common/src/chains/kovan.json b/packages/common/src/chains/kovan.json index b33108521a..d75dc8b62b 100644 --- a/packages/common/src/chains/kovan.json +++ b/packages/common/src/chains/kovan.json @@ -71,12 +71,12 @@ "forkHash": null }, { - "name": "shanghai", + "name": "merge", "block": null, "forkash": null }, { - "name": "merge", + "name": "shanghai", "block": null, "forkash": null } diff --git a/packages/common/src/chains/mainnet.json b/packages/common/src/chains/mainnet.json index 8488ec338d..bfd2a790ab 100644 --- a/packages/common/src/chains/mainnet.json +++ b/packages/common/src/chains/mainnet.json @@ -81,12 +81,12 @@ "forkHash": "0xb715077d" }, { - "name": "shanghai", + "name": "merge", "block": null, "forkash": null }, { - "name": "merge", + "name": "shanghai", "block": null, "forkash": null } diff --git a/packages/common/src/chains/rinkeby.json b/packages/common/src/chains/rinkeby.json index 27028e1b92..ce447471be 100644 --- a/packages/common/src/chains/rinkeby.json +++ b/packages/common/src/chains/rinkeby.json @@ -74,12 +74,12 @@ "forkHash": "0x8e29f2f3" }, { - "name": "shanghai", + "name": "merge", "block": null, "forkash": null }, { - "name": "merge", + "name": "shanghai", "block": null, "forkash": null } diff --git a/packages/common/src/chains/ropsten.json b/packages/common/src/chains/ropsten.json index 6e56e47df9..c70d75eaff 100644 --- a/packages/common/src/chains/ropsten.json +++ b/packages/common/src/chains/ropsten.json @@ -76,12 +76,12 @@ "forkHash": "0x7119b6b3" }, { - "name": "shanghai", + "name": "merge", "block": null, "forkash": null }, { - "name": "merge", + "name": "shanghai", "block": null, "forkash": null } diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index 70a100bb18..df61fd0ba4 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -4,7 +4,13 @@ import { BN, BNLike, toType, TypeOutput, intToBuffer } from 'ethereumjs-util' import { _getInitializedChains } from './chains' import { hardforks as HARDFORK_CHANGES } from './hardforks' import { EIPs } from './eips' -import { Chain as IChain, GenesisState } from './types' +import { + BootstrapNode, + Chain as IChain, + GenesisBlock, + GenesisState, + Hardfork as HardforkParams, +} from './types' export enum CustomChain { /** @@ -390,35 +396,81 @@ export default class Common extends EventEmitter { } /** - * Returns the hardfork based on the block number provided + * Returns the hardfork based on the block number or an optional + * total difficulty (Merge HF) provided. + * + * An optional TD takes precedence in case the corresponding HF block + * is set to `null` or otherwise needs to match (if not an error + * will be thrown). + * * @param blockNumber + * @param td * @returns The name of the HF */ - getHardforkByBlockNumber(blockNumber: BNLike): string { + getHardforkByBlockNumber(blockNumber: BNLike, td?: BNLike): string { blockNumber = toType(blockNumber, TypeOutput.BN) + td = td ? toType(td, TypeOutput.BN) : undefined let hardfork = Hardfork.Chainstart + let minTdHF + let maxTdHF + let previousHF for (const hf of this.hardforks()) { // Skip comparison for not applied HFs if (hf.block === null) { + if (td && hf.td) { + if (td.gten(hf.td)) { + return hf.name + } + } continue } - if (blockNumber.gte(new BN(hf.block))) { - hardfork = hf.name + hardfork = hf.name as Hardfork + } + if (td && hf.td) { + if (td.gten(hf.td)) { + minTdHF = hf.name + } else { + maxTdHF = previousHF + } + } + previousHF = hf.name + } + if (td) { + let msgAdd = `block number: ${blockNumber} (-> ${hardfork}), ` + if (minTdHF) { + if (!this.hardforkGteHardfork(hardfork, minTdHF)) { + const msg = 'HF determined by block number is lower than the minimum total difficulty HF' + msgAdd += `total difficulty: ${td} (-> ${minTdHF})` + throw new Error(`${msg}: ${msgAdd}`) + } + } + if (maxTdHF) { + if (!this.hardforkGteHardfork(maxTdHF, hardfork)) { + const msg = 'Maximum HF determined by total difficulty is lower than the block number HF' + msgAdd += `total difficulty: ${td} (-> ${maxTdHF})` + throw new Error(`${msg}: ${msgAdd}`) + } } } return hardfork } /** - * Sets a new hardfork based on the block number provided + * Sets a new hardfork based on the block number or an optional + * total difficulty (Merge HF) provided. + * + * An optional TD takes precedence in case the corresponding HF block + * is set to `null` or otherwise needs to match (if not an error + * will be thrown). + * * @param blockNumber + * @param td * @returns The name of the HF set */ - setHardforkByBlockNumber(blockNumber: BNLike): string { - blockNumber = toType(blockNumber, TypeOutput.BN) - const hardfork = this.getHardforkByBlockNumber(blockNumber) + setHardforkByBlockNumber(blockNumber: BNLike, td?: BNLike): string { + const hardfork = this.getHardforkByBlockNumber(blockNumber, td) this.setHardfork(hardfork) return hardfork } @@ -708,8 +760,8 @@ export default class Common extends EventEmitter { * @param opts Hardfork options (onlyActive unused) * @return Array with hardfork arrays */ - activeHardforks(blockNumber?: BNLike | null, opts: hardforkOptions = {}): Array { - const activeHardforks = [] + activeHardforks(blockNumber?: BNLike | null, opts: hardforkOptions = {}): HardforkParams[] { + const activeHardforks: HardforkParams[] = [] const hfs = this.hardforks() for (const hf of hfs) { if (hf['block'] === null) continue @@ -761,6 +813,20 @@ export default class Common extends EventEmitter { return new BN(block) } + /** + * Returns the hardfork change total difficulty (Merge HF) for hardfork provided or set + * @param hardfork Hardfork name, optional if HF set + * @returns Total difficulty or null if no set + */ + hardforkTD(hardfork?: string | Hardfork): BN | null { + hardfork = this._chooseHardfork(hardfork, false) + const td = this._getHardfork(hardfork)['td'] + if (td === undefined || td === null) { + return null + } + return new BN(td) + } + /** * True if block number provided is the hardfork (given or set) change block * @param blockNumber Number of the block to check @@ -797,11 +863,11 @@ export default class Common extends EventEmitter { return null } // Next fork block number or null if none available - // Logic: if accumulator is still null and on the first occurence of + // Logic: if accumulator is still null and on the first occurrence of // a block greater than the current hfBlock set the accumulator, // pass on the accumulator as the final result from this time on - const nextHfBlock = this.hardforks().reduce((acc: BN, hf: any) => { - const block = new BN(hf.block) + const nextHfBlock = this.hardforks().reduce((acc: BN | null, hf: HardforkParams) => { + const block = new BN(hf.block!) return block.gt(hfBlock) && acc === null ? block : acc }, null) return nextHfBlock @@ -817,6 +883,7 @@ export default class Common extends EventEmitter { blockNumber = toType(blockNumber, TypeOutput.BN) hardfork = this._chooseHardfork(hardfork, false) const nextHardforkBlock = this.nextHardforkBlockBN(hardfork) + return nextHardforkBlock === null ? false : nextHardforkBlock.eq(blockNumber) } @@ -841,7 +908,9 @@ export default class Common extends EventEmitter { } if (hf.name === hardfork) break - prevBlock = block + if (block !== null) { + prevBlock = block + } } const inputBuffer = Buffer.concat([genesis, hfBuffer]) @@ -884,8 +953,8 @@ export default class Common extends EventEmitter { * Returns the Genesis parameters of the current chain * @returns Genesis dictionary */ - genesis(): any { - return (this._chainParams)['genesis'] + genesis(): GenesisBlock { + return this._chainParams['genesis'] } /** @@ -932,24 +1001,24 @@ export default class Common extends EventEmitter { * Returns the hardforks for current chain * @returns {Array} Array with arrays of hardforks */ - hardforks(): any { - return (this._chainParams)['hardforks'] + hardforks(): HardforkParams[] { + return this._chainParams['hardforks'] } /** * Returns bootstrap nodes for the current chain * @returns {Dictionary} Dict with bootstrap nodes */ - bootstrapNodes(): any { - return (this._chainParams)['bootstrapNodes'] + bootstrapNodes(): BootstrapNode[] { + return this._chainParams['bootstrapNodes'] } /** * Returns DNS networks for the current chain * @returns {String[]} Array of DNS ENR urls */ - dnsNetworks(): any { - return (this._chainParams)['dnsNetworks'] + dnsNetworks(): string[] { + return this._chainParams['dnsNetworks']! } /** @@ -982,7 +1051,7 @@ export default class Common extends EventEmitter { * @returns chain name (lower case) */ chainName(): string { - return (this._chainParams)['name'] + return this._chainParams['name'] } /** @@ -1029,7 +1098,7 @@ export default class Common extends EventEmitter { if (value) { return value } - return (this._chainParams)['consensus']['type'] + return this._chainParams['consensus']!['type'] } /** @@ -1054,7 +1123,7 @@ export default class Common extends EventEmitter { if (value) { return value } - return (this._chainParams)['consensus']['algorithm'] + return this._chainParams['consensus']!['algorithm'] as ConsensusAlgorithm } /** @@ -1071,7 +1140,7 @@ export default class Common extends EventEmitter { * * Note: This value can update along a hardfork. */ - consensusConfig(): any { + consensusConfig(): { [key: string]: any } { const hardfork = this.hardfork() let value @@ -1085,7 +1154,8 @@ export default class Common extends EventEmitter { if (value) { return value } - return (this._chainParams)['consensus'][this.consensusAlgorithm()] + const consensusAlgorithm = this.consensusAlgorithm() + return this._chainParams['consensus']![consensusAlgorithm as ConsensusAlgorithm] } /** diff --git a/packages/common/src/types.ts b/packages/common/src/types.ts index 627e9f200d..018923a6a2 100644 --- a/packages/common/src/types.ts +++ b/packages/common/src/types.ts @@ -1,4 +1,5 @@ import { BN } from 'ethereumjs-util' +import { ConsensusAlgorithm, ConsensusType, Hardfork as HardforkName } from '.' export interface genesisStatesType { names: { @@ -28,13 +29,14 @@ export interface Chain { dnsNetworks?: string[] // TODO: make mandatory in next breaking release consensus?: { - type: string - algorithm: string + type: ConsensusType | string + algorithm: ConsensusAlgorithm | string clique?: { period: number epoch: number } ethash?: any + casper?: any } } @@ -57,8 +59,9 @@ export interface GenesisBlock { } export interface Hardfork { - name: string + name: HardforkName | string block: number | null + td?: number forkHash?: string | null } diff --git a/packages/common/tests/customChains.spec.ts b/packages/common/tests/customChains.spec.ts index 174c8bd38d..a636a2c3df 100644 --- a/packages/common/tests/customChains.spec.ts +++ b/packages/common/tests/customChains.spec.ts @@ -161,7 +161,11 @@ tape('[Common]: Custom chains', function (t: tape.Test) { st.equal(c.chainName(), 'testnet', 'customChains, chain switched to custom chain') st.equal(c.hardforkBlock(), 4, 'customChains, chain switched to custom chain') - c = new Common({ chain: 'testnet', hardfork: Hardfork.Byzantium, customChains: [testnet] }) + c = new Common({ + chain: 'testnet', + hardfork: Hardfork.Byzantium, + customChains: [testnet], + }) st.equal(c.chainName(), 'testnet', 'customChains, chain initialized with custom chain') st.equal(c.hardforkBlock(), 4, 'customChains, chain initialized with custom chain') st.deepEqual( @@ -171,7 +175,11 @@ tape('[Common]: Custom chains', function (t: tape.Test) { ) const customChains = [testnet, testnet2, testnet3] - c = new Common({ chain: 'testnet2', hardfork: Hardfork.Istanbul, customChains }) + c = new Common({ + chain: 'testnet2', + hardfork: Hardfork.Istanbul, + customChains, + }) st.equal(c.chainName(), 'testnet2', 'customChains, chain initialized with custom chain') st.equal(c.hardforkBlock(), 10, 'customChains, chain initialized with custom chain') diff --git a/packages/common/tests/data/merge/testnetMerge.json b/packages/common/tests/data/merge/testnetMerge.json new file mode 100644 index 0000000000..2823c16c81 --- /dev/null +++ b/packages/common/tests/data/merge/testnetMerge.json @@ -0,0 +1,84 @@ +{ + "name": "testnetMerge", + "chainId": 55555, + "networkId": 55555, + "defaultHardfork": "istanbul", + "consensus": { + "type": "poa", + "algorithm": "clique", + "clique": { + "period": 15, + "epoch": 30000 + } + }, + "comment": "Private test network", + "url": "[TESTNET_URL]", + "genesis": { + "hash": "0xaa00000000000000000000000000000000000000000000000000000000000000", + "timestamp": null, + "gasLimit": 1000000, + "difficulty": 1, + "nonce": "0xbb00000000000000", + "extraData": "0xcc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xdd00000000000000000000000000000000000000000000000000000000000000" + }, + "hardforks": [ + { + "name": "chainstart", + "block": 0 + }, + { + "name": "homestead", + "block": 1 + }, + { + "name": "tangerineWhistle", + "block": 2 + }, + { + "name": "spuriousDragon", + "block": 3 + }, + { + "name": "istanbul", + "block": 8 + }, + { + "name": "muirGlacier", + "block": 10 + }, + { + "name": "berlin", + "block": 12 + }, + { + "name": "london", + "block": 14 + }, + { + "name": "merge", + "block": null, + "td": 5000 + }, + { + "name": "shanghai", + "block": null + } + ], + "bootstrapNodes": [ + { + "ip": "10.0.0.1", + "port": 30303, + "id": "11000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + }, + { + "ip": "10.0.0.2", + "port": 30303, + "id": "22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + } + ] +} diff --git a/packages/common/tests/data/merge/testnetPOS.json b/packages/common/tests/data/merge/testnetPOS.json new file mode 100644 index 0000000000..1701d87bff --- /dev/null +++ b/packages/common/tests/data/merge/testnetPOS.json @@ -0,0 +1,49 @@ +{ + "name": "testnetPOS", + "chainId": 66666, + "networkId": 66666, + "defaultHardfork": "chainstart", + "consensus": { + "type": "pos", + "algorithm": "casper", + "casper": {} + }, + "comment": "Private test network (TODO: genesis block not constructed according to POS block rules yet)", + "url": "[TESTNET_URL]", + "genesis": { + "hash": "0xaa00000000000000000000000000000000000000000000000000000000000000", + "timestamp": null, + "gasLimit": 1000000, + "difficulty": 1, + "nonce": "0xbb00000000000000", + "extraData": "0xcc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xdd00000000000000000000000000000000000000000000000000000000000000" + }, + "hardforks": [ + { + "name": "chainstart", + "block": 0, + "td": 0 + }, + { + "name": "shanghai", + "block": 5 + } + ], + "bootstrapNodes": [ + { + "ip": "10.0.0.1", + "port": 30303, + "id": "11000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + }, + { + "ip": "10.0.0.2", + "port": 30303, + "id": "22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + } + ] +} diff --git a/packages/common/tests/data/testnet2.json b/packages/common/tests/data/testnet2.json index f5b3784ee5..eaf4bbadad 100644 --- a/packages/common/tests/data/testnet2.json +++ b/packages/common/tests/data/testnet2.json @@ -4,7 +4,7 @@ "networkId": 22222, "defaultHardfork": "istanbul", "consensus": { - "type": "pos", + "type": "poa", "algorithm": "clique", "clique": { "period": 15, diff --git a/packages/common/tests/data/testnet3.json b/packages/common/tests/data/testnet3.json index b64ff275a8..26f526ea4a 100644 --- a/packages/common/tests/data/testnet3.json +++ b/packages/common/tests/data/testnet3.json @@ -4,7 +4,7 @@ "networkId": 33333, "defaultHardfork": "istanbul", "consensus": { - "type": "pos", + "type": "poa", "algorithm": "clique", "clique": { "period": 15, diff --git a/packages/common/tests/hardforks.spec.ts b/packages/common/tests/hardforks.spec.ts index 71f3e5b360..91b9d2627d 100644 --- a/packages/common/tests/hardforks.spec.ts +++ b/packages/common/tests/hardforks.spec.ts @@ -5,19 +5,19 @@ import Common, { Chain, ConsensusAlgorithm, ConsensusType, Hardfork } from '../s tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('Hardfork access', function (st: tape.Test) { const supportedHardforks = [ - 'chainstart', - 'homestead', - 'dao', - 'tangerineWhistle', - 'spuriousDragon', - 'byzantium', - 'constantinople', - 'petersburg', - 'istanbul', - 'berlin', - 'london', - 'shanghai', - 'merge', + Hardfork.Chainstart, + Hardfork.Homestead, + Hardfork.Dao, + Hardfork.Chainstart, + Hardfork.SpuriousDragon, + Hardfork.Byzantium, + Hardfork.Constantinople, + Hardfork.Petersburg, + Hardfork.Istanbul, + Hardfork.Berlin, + Hardfork.London, + Hardfork.Shanghai, + Hardfork.Merge, ] let c @@ -33,24 +33,24 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { let c = new Common({ chain: Chain.Mainnet }) let msg = 'should get HF correctly' - st.equal(c.getHardforkByBlockNumber(0), 'chainstart', msg) - st.equal(c.getHardforkByBlockNumber(1149999), 'chainstart', msg) - st.equal(c.getHardforkByBlockNumber(1150000), 'homestead', msg) - st.equal(c.getHardforkByBlockNumber(1400000), 'homestead', msg) - st.equal(c.getHardforkByBlockNumber(9200000), 'muirGlacier', msg) - st.equal(c.getHardforkByBlockNumber(12244000), 'berlin', msg) - st.equal(c.getHardforkByBlockNumber(12965000), 'london', msg) - st.equal(c.getHardforkByBlockNumber(999999999999), 'london', msg) + st.equal(c.getHardforkByBlockNumber(0), Hardfork.Chainstart, msg) + st.equal(c.getHardforkByBlockNumber(1149999), Hardfork.Chainstart, msg) + st.equal(c.getHardforkByBlockNumber(1150000), Hardfork.Homestead, msg) + st.equal(c.getHardforkByBlockNumber(1400000), Hardfork.Homestead, msg) + st.equal(c.getHardforkByBlockNumber(9200000), Hardfork.MuirGlacier, msg) + st.equal(c.getHardforkByBlockNumber(12244000), Hardfork.Berlin, msg) + st.equal(c.getHardforkByBlockNumber(12965000), Hardfork.London, msg) + st.equal(c.getHardforkByBlockNumber(999999999999), Hardfork.London, msg) msg = 'should set HF correctly' - st.equal(c.setHardforkByBlockNumber(0), 'chainstart', msg) - st.equal(c.setHardforkByBlockNumber(1149999), 'chainstart', msg) - st.equal(c.setHardforkByBlockNumber(1150000), 'homestead', msg) - st.equal(c.setHardforkByBlockNumber(1400000), 'homestead', msg) - st.equal(c.setHardforkByBlockNumber(12244000), 'berlin', msg) - st.equal(c.setHardforkByBlockNumber(12965000), 'london', msg) - st.equal(c.setHardforkByBlockNumber(999999999999), 'london', msg) + st.equal(c.setHardforkByBlockNumber(0), Hardfork.Chainstart, msg) + st.equal(c.setHardforkByBlockNumber(1149999), Hardfork.Chainstart, msg) + st.equal(c.setHardforkByBlockNumber(1150000), Hardfork.Homestead, msg) + st.equal(c.setHardforkByBlockNumber(1400000), Hardfork.Homestead, msg) + st.equal(c.setHardforkByBlockNumber(12244000), Hardfork.Berlin, msg) + st.equal(c.setHardforkByBlockNumber(12965000), Hardfork.London, msg) + st.equal(c.setHardforkByBlockNumber(999999999999), Hardfork.London, msg) c = new Common({ chain: Chain.Ropsten }) st.equal(c.setHardforkByBlockNumber(0), 'tangerineWhistle', msg) @@ -61,7 +61,7 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('setHardfork(): hardforkChanged event', function (st) { const c = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Istanbul }) c.on('hardforkChanged', (hardfork: string) => { - st.equal(hardfork, 'byzantium', 'should send correct hardforkChanged event') + st.equal(hardfork, Hardfork.Byzantium, 'should send correct hardforkChanged event') st.end() }) c.setHardfork(Hardfork.Byzantium) @@ -70,7 +70,7 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkBlock()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'should return the correct HF change block for byzantium (provided)' - st.equal(c.hardforkBlock('byzantium'), 1700000, msg) + st.equal(c.hardforkBlock(Hardfork.Byzantium), 1700000, msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'should return the correct HF change block for byzantium (set)' @@ -86,10 +86,10 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('isHardforkBlock()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'should return true for HF change block for byzantium (provided)' - st.equal(c.isHardforkBlock(1700000, 'byzantium'), true, msg) + st.equal(c.isHardforkBlock(1700000, Hardfork.Byzantium), true, msg) msg = 'should return false for another block for byzantium (provided)' - st.equal(c.isHardforkBlock(1700001, 'byzantium'), false, msg) + st.equal(c.isHardforkBlock(1700001, Hardfork.Byzantium), false, msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'should return true for HF change block for byzantium (set)' @@ -112,10 +112,10 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.equal(c.nextHardforkBlock('homestead'), 2, msg) msg = 'should return correct next HF (rinkeby: byzantium -> constantinople)' - st.equal(c.nextHardforkBlock('byzantium'), 3660663, msg) + st.equal(c.nextHardforkBlock(Hardfork.Byzantium), 3660663, msg) msg = 'should return null if next HF is not available (rinkeby: london -> shanghai)' - st.equal(c.nextHardforkBlock('london'), null, msg) + st.equal(c.nextHardforkBlock(Hardfork.London), null, msg) msg = 'should work correctly along the need to skip several forks (ropsten: chainstart -> (homestead) -> (dao) -> (tangerineWhistle) -> spuriousDragon)' @@ -136,13 +136,13 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.equal(c.isNextHardforkBlock(2, 'homestead'), true, msg) msg = 'should return true for correct next HF (rinkeby: byzantium -> constantinople)' - st.equal(c.isNextHardforkBlock(3660663, 'byzantium'), true, msg) + st.equal(c.isNextHardforkBlock(3660663, Hardfork.Byzantium), true, msg) msg = 'should return false for a block number too low (rinkeby: byzantium -> constantinople)' - st.equal(c.isNextHardforkBlock(124, 'byzantium'), false, msg) + st.equal(c.isNextHardforkBlock(124, Hardfork.Byzantium), false, msg) msg = 'should return false for a block number too high (rinkeby: byzantium -> constantinople)' - st.equal(c.isNextHardforkBlock(605948938, 'byzantium'), false, msg) + st.equal(c.isNextHardforkBlock(605948938, Hardfork.Byzantium), false, msg) st.end() }) @@ -153,7 +153,7 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.equal(c.activeHardforks().length, 11, msg) msg = 'should return the correct HF data for Ropsten' - st.equal(c.activeHardforks()[3]['name'], 'spuriousDragon', msg) + st.equal(c.activeHardforks()[3]['name'], Hardfork.SpuriousDragon, msg) msg = 'should return 3 active hardforks for Ropsten up to block 9' st.equal(c.activeHardforks(9).length, 3, msg) @@ -163,14 +163,14 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { c = new Common({ chain: Chain.Ropsten, - supportedHardforks: ['spuriousDragon', 'byzantium', 'constantinople'], + supportedHardforks: [Hardfork.SpuriousDragon, Hardfork.Byzantium, Hardfork.Constantinople], }) msg = 'should return 3 active HFs when restricted to supported HFs' st.equal(c.activeHardforks(null, { onlySupported: true }).length, 3, msg) c = new Common({ chain: Chain.Ropsten, - supportedHardforks: ['spuriousDragon', 'byzantium', 'dao'], + supportedHardforks: [Hardfork.SpuriousDragon, Hardfork.Byzantium, Hardfork.Dao], }) msg = 'should return 2 active HFs when restricted to supported HFs' st.equal(c.activeHardforks(null, { onlySupported: true }).length, 2, msg) @@ -193,21 +193,21 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('activeHardfork()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'should return correct latest active HF for Ropsten' - st.equal(c.activeHardfork(), 'london', msg) + st.equal(c.activeHardfork(), Hardfork.London, msg) msg = 'should return spuriousDragon as latest active HF for Ropsten for block 10' - st.equal(c.activeHardfork(10), 'spuriousDragon', msg) + st.equal(c.activeHardfork(10), Hardfork.SpuriousDragon, msg) c = new Common({ chain: Chain.Ropsten, - supportedHardforks: ['tangerineWhistle', 'spuriousDragon'], + supportedHardforks: [Hardfork.TangerineWhistle, Hardfork.SpuriousDragon], }) msg = 'should return spuriousDragon as latest active HF for Ropsten with limited supported HFs' - st.equal(c.activeHardfork(null, { onlySupported: true }), 'spuriousDragon', msg) + st.equal(c.activeHardfork(null, { onlySupported: true }), Hardfork.SpuriousDragon, msg) c = new Common({ chain: Chain.Rinkeby }) msg = 'should return correct latest active HF for Rinkeby' - st.equal(c.activeHardfork(), 'london', msg) + st.equal(c.activeHardfork(), Hardfork.London, msg) st.end() }) @@ -215,13 +215,13 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkIsActiveOnBlock() / activeOnBlock()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'Ropsten, byzantium (provided), 1700000 -> true' - st.equal(c.hardforkIsActiveOnBlock('byzantium', 1700000), true, msg) + st.equal(c.hardforkIsActiveOnBlock(Hardfork.Byzantium, 1700000), true, msg) msg = 'Ropsten, byzantium (provided), 1700005 -> true' - st.equal(c.hardforkIsActiveOnBlock('byzantium', 1700005), true, msg) + st.equal(c.hardforkIsActiveOnBlock(Hardfork.Byzantium, 1700005), true, msg) msg = 'Ropsten, byzantium (provided), 1699999 -> false' - st.equal(c.hardforkIsActiveOnBlock('byzantium', 1699999), false, msg) + st.equal(c.hardforkIsActiveOnBlock(Hardfork.Byzantium, 1699999), false, msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'Ropsten, byzantium (set), 1700000 -> true' @@ -259,11 +259,11 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkGteHardfork()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'Ropsten, constantinople >= byzantium (provided) -> true' - st.equal(c.hardforkGteHardfork('constantinople', 'byzantium'), true, msg) + st.equal(c.hardforkGteHardfork(Hardfork.Constantinople, Hardfork.Byzantium), true, msg) msg = 'Ropsten, dao >= chainstart (provided), onlyActive -> false' st.equal( - c.hardforkGteHardfork('dao', 'chainstart', { + c.hardforkGteHardfork(Hardfork.Dao, Hardfork.Chainstart, { onlyActive: true, }), false, @@ -271,26 +271,26 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { ) msg = 'Ropsten, byzantium >= byzantium (provided) -> true' - st.equal(c.hardforkGteHardfork('byzantium', 'byzantium'), true, msg) + st.equal(c.hardforkGteHardfork(Hardfork.Byzantium, Hardfork.Byzantium), true, msg) msg = 'Ropsten, spuriousDragon >= byzantium (provided) -> false' - st.equal(c.hardforkGteHardfork('spuriousDragon', 'byzantium'), false, msg) + st.equal(c.hardforkGteHardfork(Hardfork.SpuriousDragon, Hardfork.Byzantium), false, msg) c = new Common({ chain: Chain.Ropsten, hardfork: Hardfork.Byzantium }) msg = 'Ropsten, byzantium (set) >= spuriousDragon -> true' - st.equal(c.hardforkGteHardfork(null, 'spuriousDragon'), true, msg) + st.equal(c.hardforkGteHardfork(null, Hardfork.SpuriousDragon), true, msg) msg = 'Ropsten, byzantium (set) >= spuriousDragon -> true (alias function)' - st.equal(c.gteHardfork('spuriousDragon'), true, msg) + st.equal(c.gteHardfork(Hardfork.SpuriousDragon), true, msg) msg = 'Ropsten, byzantium (set) >= spuriousDragon, onlyActive -> true' - st.equal(c.hardforkGteHardfork(null, 'spuriousDragon', { onlyActive: true }), true, msg) + st.equal(c.hardforkGteHardfork(null, Hardfork.SpuriousDragon, { onlyActive: true }), true, msg) msg = 'Ropsten, byzantium (set) >= byzantium -> true' - st.equal(c.hardforkGteHardfork(null, 'byzantium'), true, msg) + st.equal(c.hardforkGteHardfork(null, Hardfork.Byzantium), true, msg) msg = 'Ropsten, byzantium (set) >= constantinople -> false' - st.equal(c.hardforkGteHardfork(null, 'constantinople'), false, msg) + st.equal(c.hardforkGteHardfork(null, Hardfork.Constantinople), false, msg) st.end() }) @@ -298,7 +298,7 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkGteHardfork() ropsten', function (st: tape.Test) { const c = new Common({ chain: Chain.Ropsten }) const msg = 'ropsten, spuriousDragon >= muirGlacier (provided) -> false' - st.equal(c.hardforkGteHardfork('spuriousDragon', 'muirGlacier'), false, msg) + st.equal(c.hardforkGteHardfork(Hardfork.SpuriousDragon, Hardfork.MuirGlacier), false, msg) st.end() }) @@ -306,19 +306,19 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { t.test('hardforkIsActiveOnChain()', function (st: tape.Test) { let c = new Common({ chain: Chain.Ropsten }) let msg = 'should return true for byzantium (provided) on Ropsten' - st.equal(c.hardforkIsActiveOnChain('byzantium'), true, msg) + st.equal(c.hardforkIsActiveOnChain(Hardfork.Byzantium), true, msg) msg = 'should return false for dao (provided) on Ropsten' - st.equal(c.hardforkIsActiveOnChain('dao'), false, msg) + st.equal(c.hardforkIsActiveOnChain(Hardfork.Dao), false, msg) msg = 'should return true for petersburg (provided) on Ropsten' - st.equal(c.hardforkIsActiveOnChain('petersburg'), true, msg) + st.equal(c.hardforkIsActiveOnChain(Hardfork.Petersburg), true, msg) msg = 'should return false for a non-existing HF (provided) on Ropsten' st.equal(c.hardforkIsActiveOnChain('notexistinghardfork'), false, msg) let f = function () { - c.hardforkIsActiveOnChain('spuriousDragon', { onlySupported: true }) + c.hardforkIsActiveOnChain(Hardfork.SpuriousDragon, { onlySupported: true }) } msg = 'should not throw with unsupported Hf (provided) and onlySupported set to false' st.doesNotThrow(f, /unsupported hardfork$/, msg) @@ -329,10 +329,10 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { c = new Common({ chain: Chain.Ropsten, - supportedHardforks: ['byzantium', 'constantinople'], + supportedHardforks: [Hardfork.Byzantium, Hardfork.Constantinople], }) f = function () { - c.hardforkIsActiveOnChain('spuriousDragon', { onlySupported: true }) + c.hardforkIsActiveOnChain(Hardfork.SpuriousDragon, { onlySupported: true }) } msg = 'should throw with unsupported Hf and onlySupported set to true' st.throws(f, /not set as supported in supportedHardforks$/, msg) @@ -349,7 +349,7 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.equal(c._calcForkHash('homestead'), '0x97c2c34c', msg) msg = 'should calc correctly for in-between applied HF' - st.equal(c._calcForkHash('byzantium'), '0xa00bc324', msg) + st.equal(c._calcForkHash(Hardfork.Byzantium), '0xa00bc324', msg) const chains = ['mainnet', 'ropsten', 'rinkeby', 'goerli', 'kovan'] @@ -373,11 +373,11 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { st.equal(c.forkHash(), '0xa00bc324', msg) msg = 'should provide correct forkHash for HF provided' - st.equal(c.forkHash('spuriousDragon'), '0x3edd5b10', msg) + st.equal(c.forkHash(Hardfork.SpuriousDragon), '0x3edd5b10', msg) c = new Common({ chain: Chain.Kovan }) const f = () => { - c.forkHash('london') + c.forkHash(Hardfork.London) } msg = 'should throw when called on non-applied or future HF' st.throws(f, /No fork hash calculation possible/, msg) @@ -390,7 +390,7 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) { let msg = 'should return the correct HF array for a matching forkHash' const res = c.hardforkForForkHash('0x3edd5b10') - st.equal(res.name, 'spuriousDragon', msg) + st.equal(res.name, Hardfork.SpuriousDragon, msg) msg = 'should return null for a forkHash not matching any HF' st.equal(c.hardforkForForkHash('0x12345'), null, msg) diff --git a/packages/common/tests/mergePOS.spec.ts b/packages/common/tests/mergePOS.spec.ts new file mode 100644 index 0000000000..9e092aa28c --- /dev/null +++ b/packages/common/tests/mergePOS.spec.ts @@ -0,0 +1,183 @@ +import tape from 'tape' +import Common, { Hardfork } from '../src' +import testnetMerge from './data/merge/testnetMerge.json' +import testnetPOS from './data/merge/testnetPOS.json' + +tape('[Common]: Merge/POS specific logic', function (t: tape.Test) { + t.test('hardforkTD()', function (st: tape.Test) { + const customChains = [testnetMerge] + const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + st.ok(c.hardforkTD(Hardfork.Merge)?.eqn(5000), 'should get the HF total difficulty') + + st.end() + }) + + t.test( + 'getHardforkByBlockNumber(), merge block null, with total difficulty', + function (st: tape.Test) { + const customChains = [testnetMerge] + const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + let msg = 'block number < last HF block number set, without TD set' + st.equal(c.getHardforkByBlockNumber(0), 'chainstart', msg) + msg = 'block number > last HF block number set, without TD set' + st.equal(c.getHardforkByBlockNumber(14), 'london', msg) + msg = 'block number > last HF block number set, TD set and equal' + st.equal(c.getHardforkByBlockNumber(15, 5000), 'merge', msg) + msg = 'block number > last HF block number set, TD set and higher' + st.equal(c.getHardforkByBlockNumber(15, 5001), 'merge', msg) + msg = 'block number > last HF block number set, TD set and smaller' + st.equal(c.getHardforkByBlockNumber(15, 4999), 'london', msg) + msg = 'block number < last HF block number set, TD set and smaller' + st.equal(c.getHardforkByBlockNumber(12, 4999), 'berlin', msg) + st.end() + } + ) + + t.test( + 'getHardforkByBlockNumber(), merge block set, with total difficulty', + function (st: tape.Test) { + const testnetMergeWithBlockNumber = JSON.parse(JSON.stringify(testnetMerge)) + // Set Merge block to 15 + testnetMergeWithBlockNumber['hardforks'][8]['block'] = 16 + const customChains = [testnetMergeWithBlockNumber] + const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + let msg = 'block number < last HF block number set, without TD set' + st.equal(c.getHardforkByBlockNumber(0), 'chainstart', msg) + msg = 'block number > last HF block number set, without TD set' + st.equal(c.getHardforkByBlockNumber(16), 'merge', msg) + msg = 'block number > last HF block number set, TD set and equal' + st.equal(c.getHardforkByBlockNumber(16, 5000), 'merge', msg) + msg = 'block number > last HF block number set, TD set and higher' + st.equal(c.getHardforkByBlockNumber(16, 5001), 'merge', msg) + msg = 'block number < last HF block number set, TD set and smaller' + st.equal(c.getHardforkByBlockNumber(12, 4999), 'berlin', msg) + + try { + c.getHardforkByBlockNumber(16, 4999) + } catch (e: any) { + msg = 'block number > last HF block number set, TD set and smaller (should throw)' + const eMsg = 'Maximum HF determined by total difficulty is lower than the block number HF' + st.ok(e.message.includes(eMsg), msg) + } + try { + c.getHardforkByBlockNumber(14, 5000) + } catch (e: any) { + msg = 'block number < last HF block number set, TD set and higher (should throw)' + const eMsg = 'HF determined by block number is lower than the minimum total difficulty HF' + st.ok(e.message.includes(eMsg), msg) + } + + st.end() + } + ) + + t.test( + 'getHardforkByBlockNumber(), merge block set + subsequent HF, with total difficulty', + function (st: tape.Test) { + const testnetMergeWithBlockNumber = JSON.parse(JSON.stringify(testnetMerge)) + // Set Merge block to 15 + testnetMergeWithBlockNumber['hardforks'][8]['block'] = 16 + // Set Shanghai block to 18 + testnetMergeWithBlockNumber['hardforks'][9]['block'] = 18 + const customChains = [testnetMergeWithBlockNumber] + const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + const msg = 'block number > last HF block number set, TD set and higher' + st.equal(c.getHardforkByBlockNumber(18, 5001), 'shanghai', msg) + + st.end() + } + ) + + t.test( + 'setHardforkByBlockNumber(), merge block null, with total difficulty', + function (st: tape.Test) { + const customChains = [testnetMerge] + const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + let msg = 'block number < last HF block number set, without TD set' + st.equal(c.setHardforkByBlockNumber(0), 'chainstart', msg) + msg = 'block number > last HF block number set, without TD set' + st.equal(c.setHardforkByBlockNumber(14), 'london', msg) + msg = 'block number > last HF block number set, TD set and equal' + st.equal(c.setHardforkByBlockNumber(15, 5000), 'merge', msg) + msg = 'block number > last HF block number set, TD set and higher' + st.equal(c.setHardforkByBlockNumber(15, 5001), 'merge', msg) + msg = 'block number > last HF block number set, TD set and smaller' + st.equal(c.setHardforkByBlockNumber(15, 4999), 'london', msg) + msg = 'block number < last HF block number set, TD set and smaller' + st.equal(c.setHardforkByBlockNumber(12, 4999), 'berlin', msg) + st.end() + } + ) + + t.test( + 'setHardforkByBlockNumber(), merge block set, with total difficulty', + function (st: tape.Test) { + const testnetMergeWithBlockNumber = JSON.parse(JSON.stringify(testnetMerge)) + // Set Merge block to 15 + testnetMergeWithBlockNumber['hardforks'][8]['block'] = 16 + const customChains = [testnetMergeWithBlockNumber] + const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + let msg = 'block number < last HF block number set, without TD set' + st.equal(c.setHardforkByBlockNumber(0), 'chainstart', msg) + msg = 'block number > last HF block number set, without TD set' + st.equal(c.setHardforkByBlockNumber(16), 'merge', msg) + msg = 'block number > last HF block number set, TD set and equal' + st.equal(c.setHardforkByBlockNumber(16, 5000), 'merge', msg) + msg = 'block number > last HF block number set, TD set and higher' + st.equal(c.setHardforkByBlockNumber(16, 5001), 'merge', msg) + msg = 'block number < last HF block number set, TD set and smaller' + st.equal(c.setHardforkByBlockNumber(12, 4999), 'berlin', msg) + + try { + c.setHardforkByBlockNumber(16, 4999) + } catch (e: any) { + msg = 'block number > last HF block number set, TD set and smaller (should throw)' + const eMsg = 'Maximum HF determined by total difficulty is lower than the block number HF' + st.ok(e.message.includes(eMsg), msg) + } + try { + c.setHardforkByBlockNumber(14, 5000) + } catch (e: any) { + msg = 'block number < last HF block number set, TD set and higher (should throw)' + const eMsg = 'HF determined by block number is lower than the minimum total difficulty HF' + st.ok(e.message.includes(eMsg), msg) + } + + st.end() + } + ) + + t.test( + 'setHardforkByBlockNumber(), merge block set + subsequent HF, with total difficulty', + function (st: tape.Test) { + const testnetMergeWithBlockNumber = JSON.parse(JSON.stringify(testnetMerge)) + // Set Merge block to 15 + testnetMergeWithBlockNumber['hardforks'][8]['block'] = 16 + // Set Shanghai block to 18 + testnetMergeWithBlockNumber['hardforks'][9]['block'] = 18 + const customChains = [testnetMergeWithBlockNumber] + const c = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + const msg = 'block number > last HF block number set, TD set and higher' + st.equal(c.setHardforkByBlockNumber(18, 5001), 'shanghai', msg) + + st.end() + } + ) + + t.test('Pure POS testnet', function (st: tape.Test) { + const customChains = [testnetPOS] + const c = new Common({ chain: 'testnetPOS', hardfork: Hardfork.Istanbul, customChains }) + + st.ok(c.hardforkTD(Hardfork.Chainstart)?.eqn(0), 'should get the HF total difficulty') + + const msg = 'block number > last HF block number set, TD set (0) and equal' + st.equal(c.getHardforkByBlockNumber(5, 0), 'shanghai', msg) + st.end() + }) +}) diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index e981f0fbc8..0eef9be6b4 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -1,6 +1,4 @@ { "extends": "../../config/tsconfig.json", - "compilerOptions": { - }, - "include": ["src/**/*.ts", "src/**/*.json", "tests/*.ts", "tests/*.json"], + "include": ["src/**/*.ts", "src/**/*.json", "tests/*.ts", "tests/*.json"] } diff --git a/packages/devp2p/CHANGELOG.md b/packages/devp2p/CHANGELOG.md index f3b62de32f..59997a0091 100644 --- a/packages/devp2p/CHANGELOG.md +++ b/packages/devp2p/CHANGELOG.md @@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 4.2.0 - 2021-09-24 + +### EIP-706 Snappy Compression (RLPx v5) + +This release adds support for RLPx v5 allowing for the compression of RLPx messages with the Snappy compression algorithm as defined in [EIP-706](https://eips.ethereum.org/EIPS/eip-706). If the connecting peer doesn't support v5, the connection falls back to v4 and does the communication without compressing the payload. + +See: PRs [#1399](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1399), [#1442](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1442) and [#1484](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1484) + +### Improved Per-Message Debugging + +Per-message debugging with the `debug` package has been substantially expanded and allow for a much more targeted debugging experience. + +There are new debug loggers added to: + +- Debug per specific `ETH` or `LES` message (e.g. `devp2p:eth:GET_BLOCK_HEADERS`) +- Debug per disconnect reason (e.g. `devp2p:rlpx:peer:DISCONNECT:TOO_MANY_PEERS`) +- Debug per peer IP address (e.g. `devp2p:3.209.45.79`) +- Debug per first connected peer (`DEBUG=devp2p:FIRST_PEER`) + +See: PR [#1449](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1449) + ## 4.1.0 - 2021-07-15 ### Finalized London HF Support diff --git a/packages/devp2p/README.md b/packages/devp2p/README.md index 729d537b09..20d7a3dcd5 100644 --- a/packages/devp2p/README.md +++ b/packages/devp2p/README.md @@ -10,11 +10,8 @@ This library bundles different components for lower-level peer-to-peer connectio - Distributed Peer Table (DPT) / v4 Node Discovery / DNS Discovery - RLPx Transport Protocol -- Ethereum Wire Protocol (ETH/65) -- Light Ethereum Subprotocol (LES/2) - -The library is based on [ethereumjs/node-devp2p](https://github.com/ethereumjs/node-devp2p) as well -as other sub-libraries (`node-*` named) (all outdated). +- Ethereum Wire Protocol (ETH/66) +- Light Ethereum Subprotocol (LES/4) ## Run/Build @@ -446,7 +443,7 @@ devp2p:eth:GET_BLOCK_HEADERS Send GET_BLOCK_HEADERS message to 162.55.98.224:303 devp2p:eth:BLOCK_HEADERS Received BLOCK_HEADERS message from 162.55.98.224:30303: f968dd1df968d9f90217a0af80dab03492dfc689936dc9ff272ed3743da1... +72ms ``` -### Per-Peer Debuggig +### Per-Peer Debugging There are the following ways to limit debug output to a certain peer: diff --git a/packages/devp2p/package.json b/packages/devp2p/package.json index 6a12c90021..287009064c 100644 --- a/packages/devp2p/package.json +++ b/packages/devp2p/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/devp2p", - "version": "4.1.0", + "version": "4.2.0", "description": "A JavaScript implementation of ÐΞVp2p", "license": "MIT", "keywords": [ @@ -30,7 +30,7 @@ "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "coverage": "../../config/cli/coverage.sh", "docs:build": "typedoc --options typedoc.js", @@ -43,14 +43,14 @@ "test": "npm run tape -- ./test/index.ts" }, "dependencies": { - "@ethereumjs/common": "^2.4.0", + "@ethereumjs/common": "^2.5.0", "@types/bl": "^2.1.0", "@types/k-bucket": "^5.0.0", "@types/lru-cache": "^5.1.0", "base64url": "^3.0.1", "bl": "^1.1.2", "debug": "^2.2.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "hi-base32": "^0.5.0", "inherits": "^2.0.1", "ip": "^1.1.3", @@ -65,8 +65,8 @@ "snappyjs": "^0.6.1" }, "devDependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/block": "^3.5.1", + "@ethereumjs/tx": "^3.3.1", "@types/async": "^2.4.1", "@types/chalk": "^2.2.0", "@types/debug": "^4.1.4", @@ -75,15 +75,15 @@ "@types/ms": "^0.7.30", "@types/node": "^11.13.4", "@types/secp256k1": "^4.0.1", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "async": "^2.6.0", "chalk": "^2.4.2", "eslint": "^6.8.0", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "testdouble": "^3.8.2", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "ts-node": "^10.2.1", "typescript": "^4.4.2" }, diff --git a/packages/devp2p/src/rlpx/peer.ts b/packages/devp2p/src/rlpx/peer.ts index b878c35fbc..042f175b6b 100644 --- a/packages/devp2p/src/rlpx/peer.ts +++ b/packages/devp2p/src/rlpx/peer.ts @@ -452,14 +452,12 @@ export class Peer extends EventEmitter { * @param msg */ _handleMessage(code: PREFIXES, msg: Buffer) { - const payload = rlp.decode(msg) - switch (code) { case PREFIXES.HELLO: - this._handleHello(payload) + this._handleHello(msg) break case PREFIXES.DISCONNECT: - this._handleDisconnect(payload) + this._handleDisconnect(msg) break case PREFIXES.PING: this._handlePing() @@ -536,8 +534,40 @@ export class Peer extends EventEmitter { let payload = body.slice(1) // Use snappy uncompression if peer supports DevP2P >=v5 + let compressed = false + const origPayload = payload if (this._hello?.protocolVersion && this._hello?.protocolVersion >= 5) { payload = snappy.uncompress(payload) + compressed = true + } + // Hotfix, 2021-09-21 + // For a DISCONNECT message received it is often hard to + // decide if received within or outside the scope of the + // protocol handshake (both can happen). + // + // This lead to problems with unjustifiedly applying + // the snappy compression which subsequently breaks the + // RLP decoding. + // + // This is fixed by this hotfix by re-trying with the + // respective compressed/non-compressed payload. + // + // Note: there might be a cleaner solution to apply here. + // + if (protocolName === 'Peer') { + try { + payload = rlp.decode(payload) + } catch (e: any) { + if (msgCode === PREFIXES.DISCONNECT) { + if (compressed) { + payload = rlp.decode(origPayload) + } else { + payload = rlp.decode(snappy.uncompress(payload)) + } + } else { + throw new Error(e) + } + } } protocolObj.protocol._handleMessage(msgCode, payload) } catch (err: any) { diff --git a/packages/devp2p/test/integration/dpt-simulator.ts b/packages/devp2p/test/integration/dpt-simulator.ts index 98b911749f..8da782a40a 100644 --- a/packages/devp2p/test/integration/dpt-simulator.ts +++ b/packages/devp2p/test/integration/dpt-simulator.ts @@ -7,7 +7,7 @@ async function delay(ms: number) { await new Promise((resolve) => setTimeout(resolve, ms)) } -test('DPT: new working node', async (t) => { +test('DPT: new working node', (t) => { const dpts = util.initTwoPeerDPTSetup() dpts[0].on('peer:new', function (peer: any) { @@ -17,7 +17,7 @@ test('DPT: new working node', async (t) => { }) }) -test('DPT: working node added', async (t) => { +test('DPT: working node added', (t) => { const dpts = util.initTwoPeerDPTSetup() dpts[0].on('peer:added', function () { @@ -27,7 +27,7 @@ test('DPT: working node added', async (t) => { }) }) -test('DPT: remove node', async (t) => { +test('DPT: remove node', (t) => { const dpts = util.initTwoPeerDPTSetup() async.series( @@ -59,7 +59,7 @@ test('DPT: remove node', async (t) => { ) }) -test('DPT: ban node', async (t) => { +test('DPT: ban node', (t) => { const dpts = util.initTwoPeerDPTSetup() async.series( @@ -92,7 +92,7 @@ test('DPT: ban node', async (t) => { ) }) -test('DPT: k-bucket ping', async (t) => { +test('DPT: k-bucket ping', (t) => { const dpts = util.initTwoPeerDPTSetup() async.series( @@ -127,7 +127,6 @@ test('DPT: add non-available node', async (t) => { await dpts[0].addPeer(peer).catch((e: Error) => { t.equal(e.message, 'Timeout error: ping 127.0.0.1:30307', 'should throw Timeout error') util.destroyDPTs(dpts) - t.end() }) }) @@ -159,11 +158,9 @@ test('DPT: simulate bootstrap', async (t) => { await delay(1000) util.destroyDPTs(dpts) - - t.end() }) -test('DPT: simulate acquiring peers via DNS', async (t) => { +test('DPT: simulate acquiring peers via DNS', async () => { const dpts = util.getTestDPTsWithDns(1) const mockDns = { @@ -177,5 +174,4 @@ test('DPT: simulate acquiring peers via DNS', async (t) => { await delay(400) util.destroyDPTs(dpts) - t.end() }) diff --git a/packages/devp2p/test/integration/eth-simulator.ts b/packages/devp2p/test/integration/eth-simulator.ts index 621a0f1f1b..7b022d3d4d 100644 --- a/packages/devp2p/test/integration/eth-simulator.ts +++ b/packages/devp2p/test/integration/eth-simulator.ts @@ -21,7 +21,7 @@ const status = { // FIXME: Handle unhandled promises directly process.on('unhandledRejection', () => {}) -test('ETH: send status message (successful)', async (t) => { +test('ETH: send status message (successful)', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) @@ -33,7 +33,7 @@ test('ETH: send status message (successful)', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities) }) -test('ETH: send status message (NetworkId mismatch)', async (t) => { +test('ETH: send status message (NetworkId mismatch)', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) @@ -49,7 +49,7 @@ test('ETH: send status message (NetworkId mismatch)', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities, [c1, c2]) }) -test('ETH: send status message (Genesis block mismatch)', async (t) => { +test('ETH: send status message (Genesis block mismatch)', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) const status1 = Object.assign({}, status) @@ -106,11 +106,11 @@ function sendNotAllowed( util.twoPeerMsgExchange(t, opts, cap) } -test('ETH: should use latest protocol version on default', async (t) => { +test('ETH: should use latest protocol version on default', (t) => { sendWithProtocolVersion(t, 66) }) -test('ETH -> Eth64 -> sendStatus(): should throw on non-matching latest block provided', async (t) => { +test('ETH -> Eth64 -> sendStatus(): should throw on non-matching latest block provided', (t) => { const cap = [devp2p.ETH.eth65] const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Byzantium }) const status0: any = Object.assign({}, status) @@ -127,16 +127,16 @@ test('ETH -> Eth64 -> sendStatus(): should throw on non-matching latest block pr }) }) -test('ETH: should work with allowed eth64', async (t) => { +test('ETH: should work with allowed eth64', (t) => { const cap = [devp2p.ETH.eth64] sendWithProtocolVersion(t, 64, cap) }) -test('ETH: send not-allowed eth64', async (t) => { +test('ETH: send not-allowed eth64', (t) => { sendNotAllowed(t, 64, [devp2p.ETH.eth64], ETH.MESSAGE_CODES.POOLED_TRANSACTIONS) }) -test('ETH -> Eth64 -> ForkId validation 1a)', async (t) => { +test('ETH -> Eth64 -> ForkId validation 1a)', (t) => { const opts: any = {} const cap = [devp2p.ETH.eth64] const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Byzantium }) @@ -156,26 +156,26 @@ test('ETH -> Eth64 -> ForkId validation 1a)', async (t) => { util.twoPeerMsgExchange(t, opts, cap, common) }) -test('ETH: should work with allowed eth63', async (t) => { +test('ETH: should work with allowed eth63', (t) => { const cap = [devp2p.ETH.eth63] sendWithProtocolVersion(t, 63, cap) }) -test('ETH: should work with allowed eth63', async (t) => { +test('ETH: should work with allowed eth63', (t) => { const cap = [devp2p.ETH.eth63] sendWithProtocolVersion(t, 63, cap) }) -test('ETH: work with allowed eth62', async (t) => { +test('ETH: work with allowed eth62', (t) => { const cap = [devp2p.ETH.eth62] sendWithProtocolVersion(t, 62, cap) }) -test('ETH: send not-allowed eth62', async (t) => { +test('ETH: send not-allowed eth62', (t) => { sendNotAllowed(t, 62, [devp2p.ETH.eth62], ETH.MESSAGE_CODES.GET_NODE_DATA) }) -test('ETH: send unknown message code', async (t) => { +test('ETH: send unknown message code', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) @@ -192,7 +192,7 @@ test('ETH: send unknown message code', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities) }) -test('ETH: invalid status send', async (t) => { +test('ETH: invalid status send', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) diff --git a/packages/devp2p/test/integration/les-simulator.ts b/packages/devp2p/test/integration/les-simulator.ts index df4b2fe5c2..eade18037b 100644 --- a/packages/devp2p/test/integration/les-simulator.ts +++ b/packages/devp2p/test/integration/les-simulator.ts @@ -21,7 +21,7 @@ const status = { // FIXME: Handle unhandled promises directly process.on('unhandledRejection', () => {}) -test('LES: send status message (successful)', async (t) => { +test('LES: send status message (successful)', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) @@ -33,7 +33,7 @@ test('LES: send status message (successful)', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities) }) -test('LES: send status message (modified announceType)', async (t) => { +test('LES: send status message (modified announceType)', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status0['announceType'] = 0 @@ -47,7 +47,7 @@ test('LES: send status message (modified announceType)', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities) }) -test('LES: send status message (NetworkId mismatch)', async (t) => { +test('LES: send status message (NetworkId mismatch)', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) @@ -63,7 +63,7 @@ test('LES: send status message (NetworkId mismatch)', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities, [c1, c2]) }) -test('ETH: send status message (Genesis block mismatch)', async (t) => { +test('ETH: send status message (Genesis block mismatch)', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) const status1 = Object.assign({}, status) @@ -79,7 +79,7 @@ test('ETH: send status message (Genesis block mismatch)', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities) }) -test('LES: send valid message', async (t) => { +test('LES: send valid message', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) @@ -98,7 +98,7 @@ test('LES: send valid message', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities) }) -test('LES: send unknown message code', async (t) => { +test('LES: send unknown message code', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) @@ -115,7 +115,7 @@ test('LES: send unknown message code', async (t) => { util.twoPeerMsgExchange(t, opts, capabilities) }) -test('LES: invalid status send', async (t) => { +test('LES: invalid status send', (t) => { const opts: any = {} opts.status0 = Object.assign({}, status) opts.status1 = Object.assign({}, status) diff --git a/packages/devp2p/test/integration/rlpx-simulator.ts b/packages/devp2p/test/integration/rlpx-simulator.ts index 13828d47a5..041e536a31 100644 --- a/packages/devp2p/test/integration/rlpx-simulator.ts +++ b/packages/devp2p/test/integration/rlpx-simulator.ts @@ -3,7 +3,7 @@ import test from 'tape' import * as util from './util' import { DISCONNECT_REASONS } from '../../src/rlpx/peer' -test('RLPX: add working node', async (t) => { +test('RLPX: add working node', (t) => { const rlpxs = util.initTwoPeerRLPXSetup() rlpxs[0].on('peer:added', function (peer: any) { @@ -15,7 +15,7 @@ test('RLPX: add working node', async (t) => { }) }) -test('RLPX: ban node with missing tcp port', async (t) => { +test('RLPX: ban node with missing tcp port', (t) => { const rlpxs = util.initTwoPeerRLPXSetup() rlpxs[0].on('peer:added', function () { const peer = { @@ -35,7 +35,7 @@ test('RLPX: ban node with missing tcp port', async (t) => { }) }) -test('RLPX: remove node', async (t) => { +test('RLPX: remove node', (t) => { const rlpxs = util.initTwoPeerRLPXSetup() async.series( @@ -68,7 +68,7 @@ test('RLPX: remove node', async (t) => { ) }) -test('RLPX: test peer queue / refill connections', async (t) => { +test('RLPX: test peer queue / refill connections', (t) => { const rlpxs = util.getTestRLPXs(3, 1) const peer = { address: util.localhost, udpPort: util.basePort + 1, tcpPort: util.basePort + 1 } diff --git a/packages/devp2p/tsconfig.json b/packages/devp2p/tsconfig.json index e6b0b1f99e..b33f4918dd 100644 --- a/packages/devp2p/tsconfig.json +++ b/packages/devp2p/tsconfig.json @@ -3,6 +3,6 @@ "include": ["src/**/*.ts", "test/**/*.ts", "examples/**/*.ts"], "compilerOptions": { "baseUrl": ".", - "typeRoots": ["node_modules/@types", "src/@types"], + "typeRoots": ["node_modules/@types", "src/@types"] }, } diff --git a/packages/ethash/CHANGELOG.md b/packages/ethash/CHANGELOG.md index 7e1e2e1877..66e67556c7 100644 --- a/packages/ethash/CHANGELOG.md +++ b/packages/ethash/CHANGELOG.md @@ -6,6 +6,38 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 1.1.0 - 2021-09-24 + +### PoW Ethash CPU Miner + +There is now a new simple CPU miner added to the `Ethash` package which can be used for testing purposes. + +See the following example on how to use the new `Miner` class: + +```typescript +import { Block } from '@ethereumjs/block' +import Ethash from '@ethereumjs/ethash' +import Common from '@ethereumjs/common' +import { BN } from 'ethereumjs-util' +const level = require('level-mem') + +const cacheDB = level() +const block = Block.fromBlockData({ + header: { + difficulty: new BN(100), + number: new BN(1), + }, +}) + +const e = new Ethash(cacheDB) +const miner = e.getMiner(block.header) +const solution = await miner.iterate(-1) // iterate until solution is found +``` + +### Included Source Files + +Source files from the `src` folder are now included in the distribution build, see PR [#1301](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1301). This allows for a better debugging experience in debug tools like Chrome DevTools by having working source map references to the original sources available for inspection. + ## 1.0.0 - 2020-11-24 ### New Package Name @@ -22,7 +54,7 @@ npm i @ethereumjs/ethash ### Library Promisification -The `Ethash` library has been promisified and callbacks have been removed along PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceeding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779). +The `Ethash` library has been promisified and callbacks have been removed along PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779). Old API: @@ -78,7 +110,7 @@ npm i @ethereumjs/ethash ### Library Promisification The `Ethash` library has been promisified and callbacks have been removed along -PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceeding PR +PR [#833](https://github.com/ethereumjs/ethereumjs-monorepo/pull/833) and preceding PR [#779](https://github.com/ethereumjs/ethereumjs-monorepo/pull/779). Old API: @@ -132,7 +164,7 @@ Changes from PR [#23](https://github.com/ethereumjs/ethashjs/pull/23): - Use single imports for ethereumjs-util, upgrades to v7.0.2 - Modernizes buffer init syntax -Further/preceeding dependency updates in +Further/preceding dependency updates in PR [#19](https://github.com/ethereumjs/ethashjs/pull/19), PR [#11](https://github.com/ethereumjs/ethashjs/pull/11), PR [#8](https://github.com/ethereumjs/ethashjs/pull/8) and diff --git a/packages/ethash/README.md b/packages/ethash/README.md index a2bb11eb1b..670c0880e6 100644 --- a/packages/ethash/README.md +++ b/packages/ethash/README.md @@ -9,7 +9,7 @@ | [Ethash](https://github.com/ethereum/wiki/wiki/Ethash) implementation in TypeScript. | | --- | -Note: this `README` reflects the state of the library from `v1.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethashjs) for an introduction on the last preceeding release. +Note: this `README` reflects the state of the library from `v1.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethashjs) for an introduction on the last preceding release. # INSTALL @@ -17,6 +17,8 @@ Note: this `README` reflects the state of the library from `v1.0.0` onwards. See # USAGE +## PoW Validation + ```typescript import Ethash from '@ethereumjs/ethash' import { Block } from '@ethereumjs/block' @@ -34,64 +36,35 @@ const result = await ethash.verifyPOW(validBlock) console.log(result) // => true ``` -# BROWSER - -Yep, you can [browserify](http://browserify.org/) it. - -# API - -- [`new Ethash([cacheDB])`](#newethashcachedb) -- [`ethash.verifyPOW(block)`](#ethashverifypowblock) -- [`ethash.mkcache(cacheSize, seed)`](#ethashmkcachecachesize-seed) -- [`ethash.run(val, nonce, fullsize)`](#ethashrunval-nonce-fullsize) - -### `new Ethash([cacheDB])` - -Creates a new instance of `Ethash`. - -**Parameters** - -- `cacheDB` - an instance of a levelup db which is used to store the cache(s) - -### `ethash.verifyPOW(block)` - -Verifies the POW on a block and its uncles. - -Returns a promise that resolves to a boolean. - -**Parameters** - -- `block` - the [@ethereumjs/block](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/block) to verify +### PoW Ethash CPU Miner -### `ethash.mkcache(cacheSize, seed)` +There is a simple CPU miner included within `Ethash` package which can be used for testing purposes. -Creates a cache. NOTE: this is automatically done for in - [`ethash.verifyPOW(block)`](#ethashverifypowblock) so you do not need to use this function if you are just validating blocks +See the following example on how to use the new `Miner` class: -**Parameters** - -- `cachSize` - the size of the cach -- `seed` - the seed as a `Buffer` - -### `ethash.run(val, nonce, fullsize)` - -Runs ethash on a give val/nonce pair. NOTE: you need to run [`ethash.mkcache(cacheSize, seed)`](#ethashverifypowcachesize-seed) first before using this function. - -**Parameters** - -- `val` - value to run ethash on e.g. the header hash -- `nonce` - the nonce used for this hash attempt -- `fullsize` - the fullsize of the cache. - -**Returns** - -An `Object` containing: +```typescript +import { Block } from '@ethereumjs/block' +import Ethash from '@ethereumjs/ethash' +import Common from '@ethereumjs/common' +import { BN } from 'ethereumjs-util' +const level = require('level-mem') -- `hash` - the hash of the value -- `mix` - the mis result +const cacheDB = level() +const block = Block.fromBlockData({ + header: { + difficulty: new BN(100), + number: new BN(1), + }, +}) + +const e = new Ethash(cacheDB) +const miner = e.getMiner(block.header) +const solution = await miner.iterate(-1) // iterate until solution is found +``` -# TESTS +# API -`npm run test` +See [Documentation](./docs/README.md). # LICENSE diff --git a/packages/ethash/docs/.nojekyll b/packages/ethash/docs/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/packages/ethash/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/packages/ethash/docs/README.md b/packages/ethash/docs/README.md new file mode 100644 index 0000000000..6998e4847d --- /dev/null +++ b/packages/ethash/docs/README.md @@ -0,0 +1,9 @@ +@ethereumjs/ethash + +# @ethereumjs/ethash + +## Table of contents + +### Classes + +- [default](classes/default.md) diff --git a/packages/ethash/docs/classes/default.md b/packages/ethash/docs/classes/default.md new file mode 100644 index 0000000000..c5429a6952 --- /dev/null +++ b/packages/ethash/docs/classes/default.md @@ -0,0 +1,306 @@ +[@ethereumjs/ethash](../README.md) / default + +# Class: default + +## Table of contents + +### Constructors + +- [constructor](default.md#constructor) + +### Properties + +- [cache](default.md#cache) +- [cacheDB](default.md#cachedb) +- [cacheSize](default.md#cachesize) +- [dbOpts](default.md#dbopts) +- [epoc](default.md#epoc) +- [fullSize](default.md#fullsize) +- [seed](default.md#seed) + +### Methods + +- [\_verifyPOW](default.md#_verifypow) +- [cacheHash](default.md#cachehash) +- [calcDatasetItem](default.md#calcdatasetitem) +- [getMiner](default.md#getminer) +- [headerHash](default.md#headerhash) +- [loadEpoc](default.md#loadepoc) +- [mkcache](default.md#mkcache) +- [run](default.md#run) +- [verifyPOW](default.md#verifypow) + +## Constructors + +### constructor + +• **new default**(`cacheDB?`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cacheDB?` | `LevelUp`<`AbstractLevelDOWN`<`any`, `any`\>, `AbstractIterator`<`any`, `any`\>\> | + +#### Defined in + +[index.ts:144](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L144) + +## Properties + +### cache + +• **cache**: `Buffer`[] + +#### Defined in + +[index.ts:138](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L138) + +___ + +### cacheDB + +• `Optional` **cacheDB**: `LevelUp`<`AbstractLevelDOWN`<`any`, `any`\>, `AbstractIterator`<`any`, `any`\>\> + +#### Defined in + +[index.ts:137](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L137) + +___ + +### cacheSize + +• `Optional` **cacheSize**: `number` + +#### Defined in + +[index.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L141) + +___ + +### dbOpts + +• **dbOpts**: `Object` + +#### Defined in + +[index.ts:136](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L136) + +___ + +### epoc + +• `Optional` **epoc**: `number` + +#### Defined in + +[index.ts:139](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L139) + +___ + +### fullSize + +• `Optional` **fullSize**: `number` + +#### Defined in + +[index.ts:140](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L140) + +___ + +### seed + +• `Optional` **seed**: `Buffer` + +#### Defined in + +[index.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L142) + +## Methods + +### \_verifyPOW + +▸ **_verifyPOW**(`header`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `header` | `BlockHeader` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[index.ts:319](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L319) + +___ + +### cacheHash + +▸ **cacheHash**(): `Buffer` + +#### Returns + +`Buffer` + +#### Defined in + +[index.ts:227](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L227) + +___ + +### calcDatasetItem + +▸ **calcDatasetItem**(`i`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `i` | `number` | + +#### Returns + +`Buffer` + +#### Defined in + +[index.ts:175](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L175) + +___ + +### getMiner + +▸ **getMiner**(`mineObject`): `Miner` + +Returns a `Miner` object +To mine a `BlockHeader` or `Block`, use the one-liner `await ethash.getMiner(block).mine(-1)` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `mineObject` | `BlockHeader` \| `Block` | Object to mine on, either a `BlockHeader` or a `Block` | + +#### Returns + +`Miner` + +- A miner object + +#### Defined in + +[index.ts:315](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L315) + +___ + +### headerHash + +▸ **headerHash**(`rawHeader`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `rawHeader` | `Buffer`[] | + +#### Returns + +`Buffer` + +#### Defined in + +[index.ts:231](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L231) + +___ + +### loadEpoc + +▸ **loadEpoc**(`number`): `Promise`<`void`\> + +Loads the seed and cache given a block number. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `number` | `number` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[index.ts:238](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L238) + +___ + +### mkcache + +▸ **mkcache**(`cacheSize`, `seed`): `Buffer`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `cacheSize` | `number` | +| `seed` | `Buffer` | + +#### Returns + +`Buffer`[] + +#### Defined in + +[index.ts:152](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L152) + +___ + +### run + +▸ **run**(`val`, `nonce`, `fullSize?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `val` | `Buffer` | +| `nonce` | `Buffer` | +| `fullSize?` | `number` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `hash` | `Buffer` | +| `mix` | `Buffer` | + +#### Defined in + +[index.ts:188](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L188) + +___ + +### verifyPOW + +▸ **verifyPOW**(`block`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `block` | `Block` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[index.ts:330](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L330) diff --git a/packages/ethash/package.json b/packages/ethash/package.json index 41a4b84eb5..5a9bb45d3c 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/ethash", - "version": "1.0.0", + "version": "1.1.0", "description": "An ethash implementation in JavaScript", "license": "MPL-2.0", "author": "mjbecze ", @@ -22,28 +22,30 @@ "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", "tsc": "../../config/cli/ts-compile.sh", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "lint": "../../config/cli/lint.sh", "lint:fix": "../../config/cli/lint-fix.sh", "coverage": "../../config/cli/coverage.sh", "test": "tape -r ts-node/register test/*.spec.ts", - "docs:build": "echo 'Package has no generated docs'" + "docs:build": "typedoc --options typedoc.js" }, "dependencies": { + "@ethereumjs/block": "^3.5.1", "@types/levelup": "^4.3.0", "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "miller-rabin": "^4.0.0" }, "devDependencies": { - "@ethereumjs/block": "^3.4.0", - "@types/tape": "^4.13.0", + "@ethereumjs/common": "^2.5.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "level-mem": "^5.0.1", + "typedoc": "^0.22.4", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", "typescript": "^4.4.2" }, diff --git a/packages/ethash/src/index.ts b/packages/ethash/src/index.ts index 14691754dc..5ec6e6d02a 100644 --- a/packages/ethash/src/index.ts +++ b/packages/ethash/src/index.ts @@ -11,9 +11,127 @@ import { } from './util' // eslint-disable-next-line implicit-dependencies/no-implicit import type { LevelUp } from 'levelup' -import type { Block, BlockHeader } from '@ethereumjs/block' +import { Block, BlockData, BlockHeader, HeaderData } from '@ethereumjs/block' const xor = require('buffer-xor') +type Solution = { + mixHash: Buffer + nonce: Buffer +} + +class Miner { + private blockHeader: BlockHeader + private block?: Block + private ethash: Ethash + + public solution?: Solution + + private currentNonce: BN + private headerHash?: Buffer + private stopMining: boolean + + /** + * Create a Miner object + * @param mineObject - The object to mine on, either a `BlockHeader` or a `Block` object + * @param ethash - Ethash object to use for mining + */ + + constructor(mineObject: BlockHeader | Block, ethash: Ethash) { + if (mineObject instanceof BlockHeader) { + this.blockHeader = mineObject + } else if (mineObject instanceof Block) { + this.block = mineObject + this.blockHeader = mineObject.header + } else { + throw new Error('unsupported mineObject') + } + this.currentNonce = new BN(0) + this.ethash = ethash + this.stopMining = false + } + + /** + * Stop the miner on the next iteration + */ + stop() { + this.stopMining = true + } + + /** + * Iterate `iterations` time over nonces, returns a `BlockHeader` or `Block` if a solution is found, `undefined` otherwise + * @param iterations - Number of iterations to iterate over. If `-1` is passed, the loop runs until a solution is found + * @returns - `undefined` if no solution was found within the iterations, or a `BlockHeader` or `Block` + * with valid PoW based upon what was passed in the constructor + */ + async mine(iterations: number = 0): Promise { + const solution = await this.iterate(iterations) + + if (solution) { + if (this.block) { + const data = this.block.toJSON() + data.header!.mixHash = solution.mixHash + data.header!.nonce = solution.nonce + return Block.fromBlockData(data, { common: this.block._common }) + } else { + const data = this.blockHeader.toJSON() + data.mixHash = solution.mixHash + data.nonce = solution.nonce + return BlockHeader.fromHeaderData(data, { common: this.blockHeader._common }) + } + } + } + + /** + * Iterate `iterations` times over nonces to find a valid PoW. Caches solution if one is found + * @param iterations - Number of iterations to iterate over. If `-1` is passed, the loop runs until a solution is found + * @returns - `undefined` if no solution was found, or otherwise a `Solution` object + */ + async iterate(iterations: number = 0): Promise { + if (this.solution) { + return this.solution + } + if (!this.headerHash) { + this.headerHash = this.ethash.headerHash(this.blockHeader.raw()) + } + const headerHash = this.headerHash + const { number, difficulty } = this.blockHeader + + await this.ethash.loadEpoc(number.toNumber()) + const self = this + while (iterations != 0 && !this.stopMining) { + // The promise/setTimeout construction is necessary to ensure we jump out of the event loop + // Without this, for high-difficulty blocks JS never jumps out of the Promise + const solution = await new Promise((resolve) => { + setTimeout(function () { + const nonce = self.currentNonce.toBuffer(undefined, 8) + + const a = self.ethash.run(headerHash, nonce) + const result = new BN(a.hash) + + if (TWO_POW256.div(difficulty).cmp(result) === 1) { + const solution: Solution = { + mixHash: a.mix, + nonce, + } + self.solution = solution + resolve(solution) + return + } + + self.currentNonce.iaddn(1) + iterations-- + + resolve(null) + }, 0) + }) + + if (solution) { + return solution + } + } + } +} + export default class Ethash { dbOpts: Object cacheDB?: LevelUp @@ -188,6 +306,16 @@ export default class Ethash { } } + /** + * Returns a `Miner` object + * To mine a `BlockHeader` or `Block`, use the one-liner `await ethash.getMiner(block).mine(-1)` + * @param mineObject - Object to mine on, either a `BlockHeader` or a `Block` + * @returns - A miner object + */ + getMiner(mineObject: BlockHeader | Block): Miner { + return new Miner(mineObject, this) + } + async _verifyPOW(header: BlockHeader) { const headerHash = this.headerHash(header.raw()) const { number, difficulty, mixHash, nonce } = header diff --git a/packages/ethash/test/miner.spec.ts b/packages/ethash/test/miner.spec.ts new file mode 100644 index 0000000000..fd8c4ecf7d --- /dev/null +++ b/packages/ethash/test/miner.spec.ts @@ -0,0 +1,133 @@ +import tape from 'tape' +import { Block, BlockHeader } from '@ethereumjs/block' +import Ethash from '../src' +import { BN } from 'ethereumjs-util' +import Common from '@ethereumjs/common' +const level = require('level-mem') + +const cacheDB = level() + +tape('Check if miner works as expected', async function (t) { + const e = new Ethash(cacheDB) + + const block = Block.fromBlockData({ + header: { + difficulty: new BN(100), + number: new BN(1), + }, + }) + + const invalidBlockResult = await e.verifyPOW(block) + t.ok(!invalidBlockResult, 'should be invalid') + + const miner = e.getMiner(block.header) + t.ok((await miner.iterate(1)) === undefined, 'iterations can return undefined') + + t.ok((miner as any).currentNonce.eqn(1), 'miner saves current nonce') + await miner.iterate(1) + t.ok((miner as any).currentNonce.eqn(2), 'miner succesfully iterates over nonces') + + const solution = await miner.iterate(-1) + + const validBlock = Block.fromBlockData({ + header: { + difficulty: block.header.difficulty, + number: block.header.number, + nonce: solution?.nonce, + mixHash: solution?.mixHash, + }, + }) + + const validBlockResult = await e.verifyPOW(validBlock) + t.ok(validBlockResult, 'succesfully mined block') + t.ok((miner as any).solution != undefined, 'cached the solution') + + t.end() +}) + +tape('Check if it is possible to mine Blocks and BlockHeaders', async function (t) { + const e = new Ethash(cacheDB) + + const block = Block.fromBlockData({ + header: { + difficulty: new BN(100), + number: new BN(1), + }, + }) + + const miner = e.getMiner(block.header) + const solution = await miner.mine(-1) + + t.ok(e.verifyPOW(Block.fromBlockData({ header: solution.toJSON() })), 'succesfully mined block') + + const blockMiner = e.getMiner(block) + const blockSolution = await blockMiner.mine(-1) + + t.ok(e.verifyPOW(blockSolution)) + + t.end() +}) + +tape('Check if it is possible to stop the miner', async function (t) { + const e = new Ethash(cacheDB) + + const block = Block.fromBlockData({ + header: { + difficulty: new BN(10000000000000), + number: new BN(1), + }, + }) + + const miner = e.getMiner(block.header) + setTimeout(function () { + miner.stop() + }, 1000) + const solution = await miner.iterate(-1) + t.ok(solution === undefined, 'succesfully stopped miner') + + t.end() +}) + +tape('Check if it is possible to stop the miner', async function (t) { + const e = new Ethash(cacheDB) + + const block: any = {} + + t.throws(() => { + e.getMiner(block) + }, 'miner constructor succesfully throws if no BlockHeader or Block object is passed') + + t.end() +}) + +tape('Should keep common when mining blocks or headers', async function (t) { + const e = new Ethash(cacheDB) + + const common = new Common({ chain: 'ropsten', hardfork: 'petersburg' }) + + const block = Block.fromBlockData( + { + header: { + difficulty: new BN(100), + number: new BN(1), + }, + }, + { + common, + } + ) + + const miner = e.getMiner(block.header) + const solution = await miner.mine(-1) + + t.ok(solution._common.hardfork() === 'petersburg', 'hardfork did not change') + t.ok(solution._common.chainName() === 'ropsten', 'chain name did not change') + + const blockMiner = e.getMiner(block) + const blockSolution = await blockMiner.mine(-1) + + t.ok(blockSolution._common.hardfork() === 'petersburg', 'hardfork did not change') + t.ok(blockSolution._common.chainName() === 'ropsten', 'chain name did not change') + + t.end() +}) diff --git a/packages/ethash/tsconfig.json b/packages/ethash/tsconfig.json index 35752954e2..ec77a108e2 100644 --- a/packages/ethash/tsconfig.json +++ b/packages/ethash/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../config/tsconfig.json", - "include": ["src/**/*.ts", "test/**/*.ts"], + "include": ["src/**/*.ts", "test/**/*.ts"] } diff --git a/packages/ethash/typedoc.js b/packages/ethash/typedoc.js new file mode 100644 index 0000000000..3a2ff08a84 --- /dev/null +++ b/packages/ethash/typedoc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: '../../config/typedoc.js', + entryPoints: ['src'], + out: 'docs', + exclude: ["test/**/*.ts", "examples/*.ts"], +} \ No newline at end of file diff --git a/packages/ethereum-tests b/packages/ethereum-tests index 6f41f7b617..52cb3b3e72 160000 --- a/packages/ethereum-tests +++ b/packages/ethereum-tests @@ -1 +1 @@ -Subproject commit 6f41f7b6171f6da759060db177b440030dadd5b0 +Subproject commit 52cb3b3e724d13943bd8a457ed70929f98b9b8bf diff --git a/packages/trie/CHANGELOG.md b/packages/trie/CHANGELOG.md index 2b9d3e5bc1..927bf83137 100644 --- a/packages/trie/CHANGELOG.md +++ b/packages/trie/CHANGELOG.md @@ -16,6 +16,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) - Remove use of deprecated setRoot, PR [#1376](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1376) +### Included Source Files + +Source files from the `src` folder are now included in the distribution build, see PR [#1301](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1301). This allows for a better debugging experience in debug tools like Chrome DevTools by having working source map references to the original sources available for inspection. + ## 4.2.0 - 2021-05-20 ### Changed Delete Behavior: NO Default Node Deletes diff --git a/packages/trie/package.json b/packages/trie/package.json index a36bce1353..e1e735674a 100644 --- a/packages/trie/package.json +++ b/packages/trie/package.json @@ -21,7 +21,7 @@ "scripts": { "benchmarks": "node -r ts-node/register --max-old-space-size=8024 benchmarks", "profiling": "tsc --target ES5 benchmarks/random.ts && 0x benchmarks/random.js", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", @@ -38,7 +38,7 @@ }, "dependencies": { "@types/levelup": "^4.3.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "level-mem": "^5.0.1", "level-ws": "^2.0.0", "readable-stream": "^3.6.0", @@ -49,7 +49,7 @@ "0x": "^4.9.1", "@types/benchmark": "^1.0.33", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "benchmark": "^2.1.4", "eslint": "^6.8.0", "karma": "^6.3.2", @@ -59,8 +59,8 @@ "karma-typescript": "^5.5.1", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", - "typedoc": "^0.21.5", + "tape": "^5.3.1", + "typedoc": "^0.22.4", "ts-node": "^10.2.1", "typescript": "^4.4.2" }, diff --git a/packages/trie/tsconfig.json b/packages/trie/tsconfig.json index a9b45acc8f..afab821994 100644 --- a/packages/trie/tsconfig.json +++ b/packages/trie/tsconfig.json @@ -2,8 +2,8 @@ "extends": "../../config/tsconfig.json", "compilerOptions": { "outDir": "./dist", - "lib": ["dom"] + "lib": ["dom"], }, - "include": ["src/**/*.ts", "test/*.spec.ts"], + "include": ["src/**/*.ts", "test/*.spec.ts"] } \ No newline at end of file diff --git a/packages/tx/CHANGELOG.md b/packages/tx/CHANGELOG.md index 882b90b433..71a868491d 100644 --- a/packages/tx/CHANGELOG.md +++ b/packages/tx/CHANGELOG.md @@ -6,17 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [UNRELEASED] +## 3.3.1 - 2021-09-24 -**New Features** - -**Bug Fixes and Maintenance** - -- Fix `getMessageToSign` return type for `EIP1559Transaction`, PR [#1382](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1382) - -**Dependencies, CI and Docs** - -- Clarify documentation for `gasPrice` under `FeeMarketEIP1559TxData` interface, PR [#1387](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1387) +- The hash from the `tx.hash()` method now gets cached for txs created with the `freeze` option (activated by default), PR [#1445](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1445) +- Fixed `getMessageToSign()` return type for `EIP1559Transaction`, PR [#1382](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1382) ## 3.3.0 - 2021-07-08 diff --git a/packages/tx/README.md b/packages/tx/README.md index a7fb2ec48b..5034716e11 100644 --- a/packages/tx/README.md +++ b/packages/tx/README.md @@ -9,7 +9,7 @@ | Implements schema and functions related to Ethereum's transaction. | | --- | -Note: this `README` reflects the state of the library from `v3.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-tx) for an introduction on the last preceeding release. +Note: this `README` reflects the state of the library from `v3.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-tx) for an introduction on the last preceding release. # INSTALL diff --git a/packages/tx/docs/.nojekyll b/packages/tx/docs/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/packages/tx/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/packages/tx/docs/README.md b/packages/tx/docs/README.md index 387b931181..5a57ccb88f 100644 --- a/packages/tx/docs/README.md +++ b/packages/tx/docs/README.md @@ -4,12 +4,218 @@ ## Table of contents -### Modules - -- [baseTransaction](modules/basetransaction.md) -- [eip1559Transaction](modules/eip1559transaction.md) -- [eip2930Transaction](modules/eip2930transaction.md) -- [index](modules/index.md) -- [legacyTransaction](modules/legacytransaction.md) -- [transactionFactory](modules/transactionfactory.md) -- [types](modules/types.md) +### Enumerations + +- [Capability](enums/Capability.md) + +### Classes + +- [AccessListEIP2930Transaction](classes/AccessListEIP2930Transaction.md) +- [FeeMarketEIP1559Transaction](classes/FeeMarketEIP1559Transaction.md) +- [Transaction](classes/Transaction.md) +- [TransactionFactory](classes/TransactionFactory.md) + +### Interfaces + +- [AccessListEIP2930TxData](interfaces/AccessListEIP2930TxData.md) +- [FeeMarketEIP1559TxData](interfaces/FeeMarketEIP1559TxData.md) +- [JsonTx](interfaces/JsonTx.md) +- [TxOptions](interfaces/TxOptions.md) + +### Type aliases + +- [AccessList](README.md#accesslist) +- [AccessListBuffer](README.md#accesslistbuffer) +- [AccessListBufferItem](README.md#accesslistbufferitem) +- [AccessListEIP2930ValuesArray](README.md#accesslisteip2930valuesarray) +- [AccessListItem](README.md#accesslistitem) +- [FeeMarketEIP1559ValuesArray](README.md#feemarketeip1559valuesarray) +- [TxData](README.md#txdata) +- [TxValuesArray](README.md#txvaluesarray) +- [TypedTransaction](README.md#typedtransaction) + +### Variables + +- [N\_DIV\_2](README.md#n_div_2) + +### Functions + +- [isAccessList](README.md#isaccesslist) +- [isAccessListBuffer](README.md#isaccesslistbuffer) + +## Type aliases + +### AccessList + +Ƭ **AccessList**: [`AccessListItem`](README.md#accesslistitem)[] + +#### Defined in + +[types.ts:80](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L80) + +___ + +### AccessListBuffer + +Ƭ **AccessListBuffer**: [`AccessListBufferItem`](README.md#accesslistbufferitem)[] + +#### Defined in + +[types.ts:79](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L79) + +___ + +### AccessListBufferItem + +Ƭ **AccessListBufferItem**: [`Buffer`, `Buffer`[]] + +#### Defined in + +[types.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L78) + +___ + +### AccessListEIP2930ValuesArray + +Ƭ **AccessListEIP2930ValuesArray**: [`Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, [`AccessListBuffer`](README.md#accesslistbuffer), Buffer?, Buffer?, Buffer?] + +Buffer values array for an [AccessListEIP2930Transaction](classes/AccessListEIP2930Transaction.md) + +#### Defined in + +[types.ts:208](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L208) + +___ + +### AccessListItem + +Ƭ **AccessListItem**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `address` | `PrefixedHexString` | +| `storageKeys` | `PrefixedHexString`[] | + +#### Defined in + +[types.ts:70](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L70) + +___ + +### FeeMarketEIP1559ValuesArray + +Ƭ **FeeMarketEIP1559ValuesArray**: [`Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, [`AccessListBuffer`](README.md#accesslistbuffer), Buffer?, Buffer?, Buffer?] + +Buffer values array for a [FeeMarketEIP1559Transaction](classes/FeeMarketEIP1559Transaction.md) + +#### Defined in + +[types.ts:225](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L225) + +___ + +### TxData + +Ƭ **TxData**: `Object` + +Legacy [Transaction](classes/Transaction.md) Data + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data?` | `BufferLike` | This will contain the data of the message or the init of a contract. | +| `gasLimit?` | `BNLike` | The transaction's gas limit. | +| `gasPrice?` | `BNLike` | The transaction's gas price. | +| `nonce?` | `BNLike` | The transaction's nonce. | +| `r?` | `BNLike` | EC signature parameter. | +| `s?` | `BNLike` | EC signature parameter. | +| `to?` | `AddressLike` | The transaction's the address is sent to. | +| `type?` | `BNLike` | The transaction type | +| `v?` | `BNLike` | EC recovery ID. | +| `value?` | `BNLike` | The amount of Ether sent. | + +#### Defined in + +[types.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L113) + +___ + +### TxValuesArray + +Ƭ **TxValuesArray**: `Buffer`[] + +Buffer values array for a legacy [Transaction](classes/Transaction.md) + +#### Defined in + +[types.ts:203](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L203) + +___ + +### TypedTransaction + +Ƭ **TypedTransaction**: [`Transaction`](classes/Transaction.md) \| [`AccessListEIP2930Transaction`](classes/AccessListEIP2930Transaction.md) \| [`FeeMarketEIP1559Transaction`](classes/FeeMarketEIP1559Transaction.md) + +Encompassing type for all transaction types. + +Note that this also includes legacy txs which are +referenced as [Transaction](classes/Transaction.md) for compatibility reasons. + +#### Defined in + +[types.ts:105](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L105) + +## Variables + +### N\_DIV\_2 + +• **N\_DIV\_2**: `BN` + +A const defining secp256k1n/2 + +#### Defined in + +[types.ts:270](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L270) + +## Functions + +### isAccessList + +▸ **isAccessList**(`input`): input is AccessList + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | [`AccessListBuffer`](README.md#accesslistbuffer) \| [`AccessList`](README.md#accesslist) | + +#### Returns + +input is AccessList + +#### Defined in + +[types.ts:95](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L95) + +___ + +### isAccessListBuffer + +▸ **isAccessListBuffer**(`input`): input is AccessListBuffer + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | [`AccessListBuffer`](README.md#accesslistbuffer) \| [`AccessList`](README.md#accesslist) | + +#### Returns + +input is AccessListBuffer + +#### Defined in + +[types.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L82) diff --git a/packages/tx/docs/classes/eip2930transaction.default.md b/packages/tx/docs/classes/AccessListEIP2930Transaction.md similarity index 52% rename from packages/tx/docs/classes/eip2930transaction.default.md rename to packages/tx/docs/classes/AccessListEIP2930Transaction.md index b439501319..a85d1a7028 100644 --- a/packages/tx/docs/classes/eip2930transaction.default.md +++ b/packages/tx/docs/classes/AccessListEIP2930Transaction.md @@ -1,8 +1,6 @@ -[@ethereumjs/tx](../README.md) / [eip2930Transaction](../modules/eip2930transaction.md) / default +[@ethereumjs/tx](../README.md) / AccessListEIP2930Transaction -# Class: default - -[eip2930Transaction](../modules/eip2930transaction.md).default +# Class: AccessListEIP2930Transaction Typed transaction with optional access lists @@ -11,70 +9,70 @@ Typed transaction with optional access lists ## Hierarchy -- [BaseTransaction](basetransaction.basetransaction-1.md)<[default](eip2930transaction.default.md)\> +- `BaseTransaction`<[`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md)\> - ↳ **default** + ↳ **`AccessListEIP2930Transaction`** ## Table of contents ### Constructors -- [constructor](eip2930transaction.default.md#constructor) +- [constructor](AccessListEIP2930Transaction.md#constructor) ### Properties -- [AccessListJSON](eip2930transaction.default.md#accesslistjson) -- [accessList](eip2930transaction.default.md#accesslist) -- [chainId](eip2930transaction.default.md#chainid) -- [common](eip2930transaction.default.md#common) -- [data](eip2930transaction.default.md#data) -- [gasLimit](eip2930transaction.default.md#gaslimit) -- [gasPrice](eip2930transaction.default.md#gasprice) -- [nonce](eip2930transaction.default.md#nonce) -- [r](eip2930transaction.default.md#r) -- [s](eip2930transaction.default.md#s) -- [to](eip2930transaction.default.md#to) -- [v](eip2930transaction.default.md#v) -- [value](eip2930transaction.default.md#value) +- [AccessListJSON](AccessListEIP2930Transaction.md#accesslistjson) +- [accessList](AccessListEIP2930Transaction.md#accesslist) +- [chainId](AccessListEIP2930Transaction.md#chainid) +- [common](AccessListEIP2930Transaction.md#common) +- [data](AccessListEIP2930Transaction.md#data) +- [gasLimit](AccessListEIP2930Transaction.md#gaslimit) +- [gasPrice](AccessListEIP2930Transaction.md#gasprice) +- [nonce](AccessListEIP2930Transaction.md#nonce) +- [r](AccessListEIP2930Transaction.md#r) +- [s](AccessListEIP2930Transaction.md#s) +- [to](AccessListEIP2930Transaction.md#to) +- [v](AccessListEIP2930Transaction.md#v) +- [value](AccessListEIP2930Transaction.md#value) ### Accessors -- [senderR](eip2930transaction.default.md#senderr) -- [senderS](eip2930transaction.default.md#senders) -- [transactionType](eip2930transaction.default.md#transactiontype) -- [type](eip2930transaction.default.md#type) -- [yParity](eip2930transaction.default.md#yparity) +- [senderR](AccessListEIP2930Transaction.md#senderr) +- [senderS](AccessListEIP2930Transaction.md#senders) +- [transactionType](AccessListEIP2930Transaction.md#transactiontype) +- [type](AccessListEIP2930Transaction.md#type) +- [yParity](AccessListEIP2930Transaction.md#yparity) ### Methods -- [\_processSignature](eip2930transaction.default.md#_processsignature) -- [getBaseFee](eip2930transaction.default.md#getbasefee) -- [getDataFee](eip2930transaction.default.md#getdatafee) -- [getMessageToSign](eip2930transaction.default.md#getmessagetosign) -- [getMessageToVerifySignature](eip2930transaction.default.md#getmessagetoverifysignature) -- [getSenderAddress](eip2930transaction.default.md#getsenderaddress) -- [getSenderPublicKey](eip2930transaction.default.md#getsenderpublickey) -- [getUpfrontCost](eip2930transaction.default.md#getupfrontcost) -- [hash](eip2930transaction.default.md#hash) -- [isSigned](eip2930transaction.default.md#issigned) -- [raw](eip2930transaction.default.md#raw) -- [serialize](eip2930transaction.default.md#serialize) -- [sign](eip2930transaction.default.md#sign) -- [supports](eip2930transaction.default.md#supports) -- [toCreationAddress](eip2930transaction.default.md#tocreationaddress) -- [toJSON](eip2930transaction.default.md#tojson) -- [validate](eip2930transaction.default.md#validate) -- [verifySignature](eip2930transaction.default.md#verifysignature) -- [fromRlpSerializedTx](eip2930transaction.default.md#fromrlpserializedtx) -- [fromSerializedTx](eip2930transaction.default.md#fromserializedtx) -- [fromTxData](eip2930transaction.default.md#fromtxdata) -- [fromValuesArray](eip2930transaction.default.md#fromvaluesarray) +- [\_processSignature](AccessListEIP2930Transaction.md#_processsignature) +- [getBaseFee](AccessListEIP2930Transaction.md#getbasefee) +- [getDataFee](AccessListEIP2930Transaction.md#getdatafee) +- [getMessageToSign](AccessListEIP2930Transaction.md#getmessagetosign) +- [getMessageToVerifySignature](AccessListEIP2930Transaction.md#getmessagetoverifysignature) +- [getSenderAddress](AccessListEIP2930Transaction.md#getsenderaddress) +- [getSenderPublicKey](AccessListEIP2930Transaction.md#getsenderpublickey) +- [getUpfrontCost](AccessListEIP2930Transaction.md#getupfrontcost) +- [hash](AccessListEIP2930Transaction.md#hash) +- [isSigned](AccessListEIP2930Transaction.md#issigned) +- [raw](AccessListEIP2930Transaction.md#raw) +- [serialize](AccessListEIP2930Transaction.md#serialize) +- [sign](AccessListEIP2930Transaction.md#sign) +- [supports](AccessListEIP2930Transaction.md#supports) +- [toCreationAddress](AccessListEIP2930Transaction.md#tocreationaddress) +- [toJSON](AccessListEIP2930Transaction.md#tojson) +- [validate](AccessListEIP2930Transaction.md#validate) +- [verifySignature](AccessListEIP2930Transaction.md#verifysignature) +- [fromRlpSerializedTx](AccessListEIP2930Transaction.md#fromrlpserializedtx) +- [fromSerializedTx](AccessListEIP2930Transaction.md#fromserializedtx) +- [fromTxData](AccessListEIP2930Transaction.md#fromtxdata) +- [fromValuesArray](AccessListEIP2930Transaction.md#fromvaluesarray) ## Constructors ### constructor -• **new default**(`txData`, `opts?`) +• **new AccessListEIP2930Transaction**(`txData`, `opts?`) This constructor takes the values, validates them, assigns them and freezes the object. @@ -86,22 +84,22 @@ varying data types. | Name | Type | | :------ | :------ | -| `txData` | [AccessListEIP2930TxData](../interfaces/types.accesslisteip2930txdata.md) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `txData` | [`AccessListEIP2930TxData`](../interfaces/AccessListEIP2930TxData.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[constructor](basetransaction.basetransaction-1.md#constructor) +BaseTransaction<AccessListEIP2930Transaction\>.constructor #### Defined in -[eip2930Transaction.ts:160](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L160) +[eip2930Transaction.ts:169](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L169) ## Properties ### AccessListJSON -• `Readonly` **AccessListJSON**: [AccessList](../modules/types.md#accesslist) +• `Readonly` **AccessListJSON**: [`AccessList`](../README.md#accesslist) #### Defined in @@ -111,7 +109,7 @@ ___ ### accessList -• `Readonly` **accessList**: [AccessListBuffer](../modules/types.md#accesslistbuffer) +• `Readonly` **accessList**: [`AccessListBuffer`](../README.md#accesslistbuffer) #### Defined in @@ -135,7 +133,7 @@ ___ #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[common](basetransaction.basetransaction-1.md#common) +BaseTransaction.common #### Defined in @@ -149,11 +147,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[data](basetransaction.basetransaction-1.md#data) +BaseTransaction.data #### Defined in -[baseTransaction.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L38) +[baseTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L42) ___ @@ -163,11 +161,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[gasLimit](basetransaction.basetransaction-1.md#gaslimit) +BaseTransaction.gasLimit #### Defined in -[baseTransaction.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L35) +[baseTransaction.ts:39](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L39) ___ @@ -187,11 +185,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[nonce](basetransaction.basetransaction-1.md#nonce) +BaseTransaction.nonce #### Defined in -[baseTransaction.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L34) +[baseTransaction.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L38) ___ @@ -201,11 +199,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[r](basetransaction.basetransaction-1.md#r) +BaseTransaction.r #### Defined in -[baseTransaction.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L41) +[baseTransaction.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L45) ___ @@ -215,11 +213,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[s](basetransaction.basetransaction-1.md#s) +BaseTransaction.s #### Defined in -[baseTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L42) +[baseTransaction.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L46) ___ @@ -229,11 +227,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[to](basetransaction.basetransaction-1.md#to) +BaseTransaction.to #### Defined in -[baseTransaction.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L36) +[baseTransaction.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L40) ___ @@ -243,11 +241,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[v](basetransaction.basetransaction-1.md#v) +BaseTransaction.v #### Defined in -[baseTransaction.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L40) +[baseTransaction.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L44) ___ @@ -257,11 +255,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[value](basetransaction.basetransaction-1.md#value) +BaseTransaction.value #### Defined in -[baseTransaction.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L37) +[baseTransaction.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L41) ## Accessors @@ -305,7 +303,7 @@ ___ • `get` **transactionType**(): `number` -Alias for [BaseTransaction.type](basetransaction.basetransaction-1.md#type) +Alias for {@link BaseTransaction.type} **`deprecated`** Use `type` instead @@ -315,7 +313,7 @@ Alias for [BaseTransaction.type](basetransaction.basetransaction-1.md#type) #### Defined in -[baseTransaction.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L104) +[baseTransaction.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L112) ___ @@ -333,7 +331,7 @@ Note: legacy txs will return tx type `0`. #### Defined in -[baseTransaction.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L113) +[baseTransaction.ts:121](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L121) ___ @@ -357,7 +355,7 @@ EIP-2930 alias for `v` ### \_processSignature -▸ **_processSignature**(`v`, `r`, `s`): [default](eip2930transaction.default.md) +▸ **_processSignature**(`v`, `r`, `s`): [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) #### Parameters @@ -369,7 +367,7 @@ EIP-2930 alias for `v` #### Returns -[default](eip2930transaction.default.md) +[`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) #### Overrides @@ -377,7 +375,7 @@ BaseTransaction.\_processSignature #### Defined in -[eip2930Transaction.ts:339](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L339) +[eip2930Transaction.ts:351](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L351) ___ @@ -393,11 +391,11 @@ The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee) #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[getBaseFee](basetransaction.basetransaction-1.md#getbasefee) +BaseTransaction.getBaseFee #### Defined in -[baseTransaction.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L161) +[baseTransaction.ts:169](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L169) ___ @@ -413,7 +411,7 @@ The amount of gas paid for the data in this tx #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getDataFee](basetransaction.basetransaction-1.md#getdatafee) +BaseTransaction.getDataFee #### Defined in @@ -439,7 +437,7 @@ const serializedMessage = tx.getMessageToSign(false) // use this for the HW wall | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | -| `hashMessage` | `boolean` | true | Return hashed message if set to true (default: true) | +| `hashMessage` | `boolean` | `true` | Return hashed message if set to true (default: true) | #### Returns @@ -447,11 +445,11 @@ const serializedMessage = tx.getMessageToSign(false) // use this for the HW wall #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToSign](basetransaction.basetransaction-1.md#getmessagetosign) +BaseTransaction.getMessageToSign #### Defined in -[eip2930Transaction.ts:277](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L277) +[eip2930Transaction.ts:282](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L282) ___ @@ -467,11 +465,11 @@ Computes a sha3-256 hash which can be used to verify the signature #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToVerifySignature](basetransaction.basetransaction-1.md#getmessagetoverifysignature) +BaseTransaction.getMessageToVerifySignature #### Defined in -[eip2930Transaction.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L304) +[eip2930Transaction.ts:316](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L316) ___ @@ -487,11 +485,11 @@ Returns the sender's address #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[getSenderAddress](basetransaction.basetransaction-1.md#getsenderaddress) +BaseTransaction.getSenderAddress #### Defined in -[baseTransaction.ts:249](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L249) +[baseTransaction.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L264) ___ @@ -507,11 +505,11 @@ Returns the public key of the sender #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getSenderPublicKey](basetransaction.basetransaction-1.md#getsenderpublickey) +BaseTransaction.getSenderPublicKey #### Defined in -[eip2930Transaction.ts:311](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L311) +[eip2930Transaction.ts:323](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L323) ___ @@ -527,7 +525,7 @@ The up front amount that an account must have for this transaction to be valid #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getUpfrontCost](basetransaction.basetransaction-1.md#getupfrontcost) +BaseTransaction.getUpfrontCost #### Defined in @@ -542,7 +540,7 @@ ___ Computes a sha3-256 hash of the serialized tx. This method can only be used for signed txs (it throws otherwise). -Use {@link AccessListEIP2930Transaction.getMessageToSign} to get a tx hash for the purpose of signing. +Use [AccessListEIP2930Transaction.getMessageToSign](AccessListEIP2930Transaction.md#getmessagetosign) to get a tx hash for the purpose of signing. #### Returns @@ -550,11 +548,11 @@ Use {@link AccessListEIP2930Transaction.getMessageToSign} to get a tx hash for t #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[hash](basetransaction.basetransaction-1.md#hash) +BaseTransaction.hash #### Defined in -[eip2930Transaction.ts:293](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L293) +[eip2930Transaction.ts:298](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L298) ___ @@ -568,36 +566,41 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[isSigned](basetransaction.basetransaction-1.md#issigned) +BaseTransaction.isSigned #### Defined in -[baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) +[baseTransaction.ts:231](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L231) ___ ### raw -▸ **raw**(): [AccessListEIP2930ValuesArray](../modules/types.md#accesslisteip2930valuesarray) +▸ **raw**(): [`AccessListEIP2930ValuesArray`](../README.md#accesslisteip2930valuesarray) Returns a Buffer Array of the raw Buffers of the EIP-2930 transaction, in order. Format: `[chainId, nonce, gasPrice, gasLimit, to, value, data, accessList, signatureYParity (v), signatureR (r), signatureS (s)]` -Use {@link AccessListEIP2930Transaction.serialize} to add to block data for {@link Block.fromValuesArray}. +Use [AccessListEIP2930Transaction.serialize](AccessListEIP2930Transaction.md#serialize) to add a transaction to a block +with {@link Block.fromValuesArray}. + +For an unsigned tx this method uses the empty Buffer values for the +signature parameters `v`, `r` and `s` for encoding. For an EIP-155 compliant +representation for external signing use [AccessListEIP2930Transaction.getMessageToSign](AccessListEIP2930Transaction.md#getmessagetosign). #### Returns -[AccessListEIP2930ValuesArray](../modules/types.md#accesslisteip2930valuesarray) +[`AccessListEIP2930ValuesArray`](../README.md#accesslisteip2930valuesarray) #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[raw](basetransaction.basetransaction-1.md#raw) +BaseTransaction.raw #### Defined in -[eip2930Transaction.ts:233](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L233) +[eip2930Transaction.ts:238](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L238) ___ @@ -611,7 +614,7 @@ Format: `0x01 || rlp([chainId, nonce, gasPrice, gasLimit, to, value, data, acces signatureYParity (v), signatureR (r), signatureS (s)])` Note that in contrast to the legacy tx serialization format this is not -valid RLP any more due to the raw tx type preceeding and concatenated to +valid RLP any more due to the raw tx type preceding and concatenated to the RLP encoding of the values. #### Returns @@ -620,17 +623,17 @@ the RLP encoding of the values. #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[serialize](basetransaction.basetransaction-1.md#serialize) +BaseTransaction.serialize #### Defined in -[eip2930Transaction.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L259) +[eip2930Transaction.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L264) ___ ### sign -▸ **sign**(`privateKey`): [default](eip2930transaction.default.md) +▸ **sign**(`privateKey`): [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) Signs a transaction. @@ -648,15 +651,15 @@ const signedTx = tx.sign(privateKey) #### Returns -[default](eip2930transaction.default.md) +[`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[sign](basetransaction.basetransaction-1.md#sign) +BaseTransaction.sign #### Defined in -[baseTransaction.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L267) +[baseTransaction.ts:282](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L282) ___ @@ -683,7 +686,7 @@ on all supported capabilities. | Name | Type | | :------ | :------ | -| `capability` | [Capabilities](../enums/types.capabilities.md) | +| `capability` | [`Capability`](../enums/Capability.md) | #### Returns @@ -691,11 +694,11 @@ on all supported capabilities. #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[supports](basetransaction.basetransaction-1.md#supports) +BaseTransaction.supports #### Defined in -[baseTransaction.ts:133](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L133) +[baseTransaction.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L141) ___ @@ -711,31 +714,31 @@ If the tx's `to` is to the creation address #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[toCreationAddress](basetransaction.basetransaction-1.md#tocreationaddress) +BaseTransaction.toCreationAddress #### Defined in -[baseTransaction.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L191) +[baseTransaction.ts:199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L199) ___ ### toJSON -▸ **toJSON**(): [JsonTx](../interfaces/types.jsontx.md) +▸ **toJSON**(): [`JsonTx`](../interfaces/JsonTx.md) Returns an object with the JSON representation of the transaction #### Returns -[JsonTx](../interfaces/types.jsontx.md) +[`JsonTx`](../interfaces/JsonTx.md) #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[toJSON](basetransaction.basetransaction-1.md#tojson) +BaseTransaction.toJSON #### Defined in -[eip2930Transaction.ts:365](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L365) +[eip2930Transaction.ts:377](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L377) ___ @@ -752,11 +755,11 @@ Checks if the transaction has the minimum amount of gas required #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) +BaseTransaction.validate #### Defined in -[baseTransaction.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L141) +[baseTransaction.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L149) ▸ **validate**(`stringError`): `boolean` @@ -772,11 +775,11 @@ Checks if the transaction has the minimum amount of gas required #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) +BaseTransaction.validate #### Defined in -[baseTransaction.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L142) +[baseTransaction.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L150) ▸ **validate**(`stringError`): `string`[] @@ -792,11 +795,11 @@ Checks if the transaction has the minimum amount of gas required #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) +BaseTransaction.validate #### Defined in -[baseTransaction.ts:143](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L143) +[baseTransaction.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L151) ___ @@ -812,36 +815,36 @@ Determines if the signature is valid #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[verifySignature](basetransaction.basetransaction-1.md#verifysignature) +BaseTransaction.verifySignature #### Defined in -[baseTransaction.ts:236](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L236) +[baseTransaction.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L251) ___ ### fromRlpSerializedTx -▸ `Static` **fromRlpSerializedTx**(`serialized`, `opts?`): [default](eip2930transaction.default.md) +▸ `Static` **fromRlpSerializedTx**(`serialized`, `opts?`): [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) Instantiate a transaction from the serialized tx. -(alias of {@link AccessListEIP2930Transaction.fromSerializedTx}) +(alias of [AccessListEIP2930Transaction.fromSerializedTx](AccessListEIP2930Transaction.md#fromserializedtx)) Note: This means that the Buffer should start with 0x01. **`deprecated`** this constructor alias is deprecated and will be removed -in favor of the {@link AccessListEIP2930Transaction.fromSerializedTx} constructor +in favor of the [AccessListEIP2930Transaction.fromSerializedTx](AccessListEIP2930Transaction.md#fromserializedtx) constructor #### Parameters | Name | Type | | :------ | :------ | | `serialized` | `Buffer` | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip2930transaction.default.md) +[`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) #### Defined in @@ -851,7 +854,7 @@ ___ ### fromSerializedTx -▸ `Static` **fromSerializedTx**(`serialized`, `opts?`): [default](eip2930transaction.default.md) +▸ `Static` **fromSerializedTx**(`serialized`, `opts?`): [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) Instantiate a transaction from the serialized tx. @@ -863,11 +866,11 @@ signatureYParity (v), signatureR (r), signatureS (s)])` | Name | Type | | :------ | :------ | | `serialized` | `Buffer` | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip2930transaction.default.md) +[`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) #### Defined in @@ -877,7 +880,7 @@ ___ ### fromTxData -▸ `Static` **fromTxData**(`txData`, `opts?`): [default](eip2930transaction.default.md) +▸ `Static` **fromTxData**(`txData`, `opts?`): [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) Instantiate a transaction from a data dictionary. @@ -892,12 +895,12 @@ Notes: | Name | Type | | :------ | :------ | -| `txData` | [AccessListEIP2930TxData](../interfaces/types.accesslisteip2930txdata.md) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `txData` | [`AccessListEIP2930TxData`](../interfaces/AccessListEIP2930TxData.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip2930transaction.default.md) +[`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) #### Defined in @@ -907,7 +910,7 @@ ___ ### fromValuesArray -▸ `Static` **fromValuesArray**(`values`, `opts?`): [default](eip2930transaction.default.md) +▸ `Static` **fromValuesArray**(`values`, `opts?`): [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) Create a transaction from a values array. @@ -918,12 +921,12 @@ signatureYParity (v), signatureR (r), signatureS (s)]` | Name | Type | | :------ | :------ | -| `values` | [AccessListEIP2930ValuesArray](../modules/types.md#accesslisteip2930valuesarray) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `values` | [`AccessListEIP2930ValuesArray`](../README.md#accesslisteip2930valuesarray) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip2930transaction.default.md) +[`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) #### Defined in diff --git a/packages/tx/docs/classes/eip1559transaction.default.md b/packages/tx/docs/classes/FeeMarketEIP1559Transaction.md similarity index 51% rename from packages/tx/docs/classes/eip1559transaction.default.md rename to packages/tx/docs/classes/FeeMarketEIP1559Transaction.md index becc514824..64b72e196e 100644 --- a/packages/tx/docs/classes/eip1559transaction.default.md +++ b/packages/tx/docs/classes/FeeMarketEIP1559Transaction.md @@ -1,8 +1,6 @@ -[@ethereumjs/tx](../README.md) / [eip1559Transaction](../modules/eip1559transaction.md) / default +[@ethereumjs/tx](../README.md) / FeeMarketEIP1559Transaction -# Class: default - -[eip1559Transaction](../modules/eip1559transaction.md).default +# Class: FeeMarketEIP1559Transaction Typed transaction with a new gas fee market mechanism @@ -11,71 +9,71 @@ Typed transaction with a new gas fee market mechanism ## Hierarchy -- [BaseTransaction](basetransaction.basetransaction-1.md)<[default](eip1559transaction.default.md)\> +- `BaseTransaction`<[`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md)\> - ↳ **default** + ↳ **`FeeMarketEIP1559Transaction`** ## Table of contents ### Constructors -- [constructor](eip1559transaction.default.md#constructor) +- [constructor](FeeMarketEIP1559Transaction.md#constructor) ### Properties -- [AccessListJSON](eip1559transaction.default.md#accesslistjson) -- [accessList](eip1559transaction.default.md#accesslist) -- [chainId](eip1559transaction.default.md#chainid) -- [common](eip1559transaction.default.md#common) -- [data](eip1559transaction.default.md#data) -- [gasLimit](eip1559transaction.default.md#gaslimit) -- [maxFeePerGas](eip1559transaction.default.md#maxfeepergas) -- [maxPriorityFeePerGas](eip1559transaction.default.md#maxpriorityfeepergas) -- [nonce](eip1559transaction.default.md#nonce) -- [r](eip1559transaction.default.md#r) -- [s](eip1559transaction.default.md#s) -- [to](eip1559transaction.default.md#to) -- [v](eip1559transaction.default.md#v) -- [value](eip1559transaction.default.md#value) +- [AccessListJSON](FeeMarketEIP1559Transaction.md#accesslistjson) +- [accessList](FeeMarketEIP1559Transaction.md#accesslist) +- [chainId](FeeMarketEIP1559Transaction.md#chainid) +- [common](FeeMarketEIP1559Transaction.md#common) +- [data](FeeMarketEIP1559Transaction.md#data) +- [gasLimit](FeeMarketEIP1559Transaction.md#gaslimit) +- [maxFeePerGas](FeeMarketEIP1559Transaction.md#maxfeepergas) +- [maxPriorityFeePerGas](FeeMarketEIP1559Transaction.md#maxpriorityfeepergas) +- [nonce](FeeMarketEIP1559Transaction.md#nonce) +- [r](FeeMarketEIP1559Transaction.md#r) +- [s](FeeMarketEIP1559Transaction.md#s) +- [to](FeeMarketEIP1559Transaction.md#to) +- [v](FeeMarketEIP1559Transaction.md#v) +- [value](FeeMarketEIP1559Transaction.md#value) ### Accessors -- [senderR](eip1559transaction.default.md#senderr) -- [senderS](eip1559transaction.default.md#senders) -- [transactionType](eip1559transaction.default.md#transactiontype) -- [type](eip1559transaction.default.md#type) -- [yParity](eip1559transaction.default.md#yparity) +- [senderR](FeeMarketEIP1559Transaction.md#senderr) +- [senderS](FeeMarketEIP1559Transaction.md#senders) +- [transactionType](FeeMarketEIP1559Transaction.md#transactiontype) +- [type](FeeMarketEIP1559Transaction.md#type) +- [yParity](FeeMarketEIP1559Transaction.md#yparity) ### Methods -- [\_processSignature](eip1559transaction.default.md#_processsignature) -- [getBaseFee](eip1559transaction.default.md#getbasefee) -- [getDataFee](eip1559transaction.default.md#getdatafee) -- [getMessageToSign](eip1559transaction.default.md#getmessagetosign) -- [getMessageToVerifySignature](eip1559transaction.default.md#getmessagetoverifysignature) -- [getSenderAddress](eip1559transaction.default.md#getsenderaddress) -- [getSenderPublicKey](eip1559transaction.default.md#getsenderpublickey) -- [getUpfrontCost](eip1559transaction.default.md#getupfrontcost) -- [hash](eip1559transaction.default.md#hash) -- [isSigned](eip1559transaction.default.md#issigned) -- [raw](eip1559transaction.default.md#raw) -- [serialize](eip1559transaction.default.md#serialize) -- [sign](eip1559transaction.default.md#sign) -- [supports](eip1559transaction.default.md#supports) -- [toCreationAddress](eip1559transaction.default.md#tocreationaddress) -- [toJSON](eip1559transaction.default.md#tojson) -- [validate](eip1559transaction.default.md#validate) -- [verifySignature](eip1559transaction.default.md#verifysignature) -- [fromRlpSerializedTx](eip1559transaction.default.md#fromrlpserializedtx) -- [fromSerializedTx](eip1559transaction.default.md#fromserializedtx) -- [fromTxData](eip1559transaction.default.md#fromtxdata) -- [fromValuesArray](eip1559transaction.default.md#fromvaluesarray) +- [\_processSignature](FeeMarketEIP1559Transaction.md#_processsignature) +- [getBaseFee](FeeMarketEIP1559Transaction.md#getbasefee) +- [getDataFee](FeeMarketEIP1559Transaction.md#getdatafee) +- [getMessageToSign](FeeMarketEIP1559Transaction.md#getmessagetosign) +- [getMessageToVerifySignature](FeeMarketEIP1559Transaction.md#getmessagetoverifysignature) +- [getSenderAddress](FeeMarketEIP1559Transaction.md#getsenderaddress) +- [getSenderPublicKey](FeeMarketEIP1559Transaction.md#getsenderpublickey) +- [getUpfrontCost](FeeMarketEIP1559Transaction.md#getupfrontcost) +- [hash](FeeMarketEIP1559Transaction.md#hash) +- [isSigned](FeeMarketEIP1559Transaction.md#issigned) +- [raw](FeeMarketEIP1559Transaction.md#raw) +- [serialize](FeeMarketEIP1559Transaction.md#serialize) +- [sign](FeeMarketEIP1559Transaction.md#sign) +- [supports](FeeMarketEIP1559Transaction.md#supports) +- [toCreationAddress](FeeMarketEIP1559Transaction.md#tocreationaddress) +- [toJSON](FeeMarketEIP1559Transaction.md#tojson) +- [validate](FeeMarketEIP1559Transaction.md#validate) +- [verifySignature](FeeMarketEIP1559Transaction.md#verifysignature) +- [fromRlpSerializedTx](FeeMarketEIP1559Transaction.md#fromrlpserializedtx) +- [fromSerializedTx](FeeMarketEIP1559Transaction.md#fromserializedtx) +- [fromTxData](FeeMarketEIP1559Transaction.md#fromtxdata) +- [fromValuesArray](FeeMarketEIP1559Transaction.md#fromvaluesarray) ## Constructors ### constructor -• **new default**(`txData`, `opts?`) +• **new FeeMarketEIP1559Transaction**(`txData`, `opts?`) This constructor takes the values, validates them, assigns them and freezes the object. @@ -87,22 +85,22 @@ varying data types. | Name | Type | | :------ | :------ | -| `txData` | [FeeMarketEIP1559TxData](../interfaces/types.feemarketeip1559txdata.md) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `txData` | [`FeeMarketEIP1559TxData`](../interfaces/FeeMarketEIP1559TxData.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[constructor](basetransaction.basetransaction-1.md#constructor) +BaseTransaction<FeeMarketEIP1559Transaction\>.constructor #### Defined in -[eip1559Transaction.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L172) +[eip1559Transaction.ts:181](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L181) ## Properties ### AccessListJSON -• `Readonly` **AccessListJSON**: [AccessList](../modules/types.md#accesslist) +• `Readonly` **AccessListJSON**: [`AccessList`](../README.md#accesslist) #### Defined in @@ -112,7 +110,7 @@ ___ ### accessList -• `Readonly` **accessList**: [AccessListBuffer](../modules/types.md#accesslistbuffer) +• `Readonly` **accessList**: [`AccessListBuffer`](../README.md#accesslistbuffer) #### Defined in @@ -136,7 +134,7 @@ ___ #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[common](basetransaction.basetransaction-1.md#common) +BaseTransaction.common #### Defined in @@ -150,11 +148,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[data](basetransaction.basetransaction-1.md#data) +BaseTransaction.data #### Defined in -[baseTransaction.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L38) +[baseTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L42) ___ @@ -164,11 +162,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[gasLimit](basetransaction.basetransaction-1.md#gaslimit) +BaseTransaction.gasLimit #### Defined in -[baseTransaction.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L35) +[baseTransaction.ts:39](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L39) ___ @@ -198,11 +196,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[nonce](basetransaction.basetransaction-1.md#nonce) +BaseTransaction.nonce #### Defined in -[baseTransaction.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L34) +[baseTransaction.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L38) ___ @@ -212,11 +210,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[r](basetransaction.basetransaction-1.md#r) +BaseTransaction.r #### Defined in -[baseTransaction.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L41) +[baseTransaction.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L45) ___ @@ -226,11 +224,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[s](basetransaction.basetransaction-1.md#s) +BaseTransaction.s #### Defined in -[baseTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L42) +[baseTransaction.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L46) ___ @@ -240,11 +238,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[to](basetransaction.basetransaction-1.md#to) +BaseTransaction.to #### Defined in -[baseTransaction.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L36) +[baseTransaction.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L40) ___ @@ -254,11 +252,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[v](basetransaction.basetransaction-1.md#v) +BaseTransaction.v #### Defined in -[baseTransaction.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L40) +[baseTransaction.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L44) ___ @@ -268,11 +266,11 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[value](basetransaction.basetransaction-1.md#value) +BaseTransaction.value #### Defined in -[baseTransaction.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L37) +[baseTransaction.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L41) ## Accessors @@ -316,7 +314,7 @@ ___ • `get` **transactionType**(): `number` -Alias for [BaseTransaction.type](basetransaction.basetransaction-1.md#type) +Alias for {@link BaseTransaction.type} **`deprecated`** Use `type` instead @@ -326,7 +324,7 @@ Alias for [BaseTransaction.type](basetransaction.basetransaction-1.md#type) #### Defined in -[baseTransaction.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L104) +[baseTransaction.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L112) ___ @@ -344,7 +342,7 @@ Note: legacy txs will return tx type `0`. #### Defined in -[baseTransaction.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L113) +[baseTransaction.ts:121](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L121) ___ @@ -368,7 +366,7 @@ EIP-2930 alias for `v` ### \_processSignature -▸ **_processSignature**(`v`, `r`, `s`): [default](eip1559transaction.default.md) +▸ **_processSignature**(`v`, `r`, `s`): [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) #### Parameters @@ -380,7 +378,7 @@ EIP-2930 alias for `v` #### Returns -[default](eip1559transaction.default.md) +[`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) #### Overrides @@ -388,7 +386,7 @@ BaseTransaction.\_processSignature #### Defined in -[eip1559Transaction.ts:371](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L371) +[eip1559Transaction.ts:381](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L381) ___ @@ -404,11 +402,11 @@ The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee) #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[getBaseFee](basetransaction.basetransaction-1.md#getbasefee) +BaseTransaction.getBaseFee #### Defined in -[baseTransaction.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L161) +[baseTransaction.ts:169](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L169) ___ @@ -424,7 +422,7 @@ The amount of gas paid for the data in this tx #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getDataFee](basetransaction.basetransaction-1.md#getdatafee) +BaseTransaction.getDataFee #### Defined in @@ -434,7 +432,7 @@ ___ ### getMessageToSign -▸ **getMessageToSign**(`hashMessage`): `Buffer`[] +▸ **getMessageToSign**(`hashMessage?`): `Buffer` Returns the serialized unsigned tx (hashed or raw), which can be used to sign the transaction (e.g. for sending to a hardware wallet). @@ -448,29 +446,9 @@ const serializedMessage = tx.getMessageToSign(false) // use this for the HW wall #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `hashMessage` | ``false`` | Return hashed message if set to true (default: true) | - -#### Returns - -`Buffer`[] - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToSign](basetransaction.basetransaction-1.md#getmessagetosign) - -#### Defined in - -[eip1559Transaction.ts:307](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L307) - -▸ **getMessageToSign**(`hashMessage?`): `Buffer` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hashMessage?` | ``true`` | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `hashMessage` | `boolean` | `true` | Return hashed message if set to true (default: true) | #### Returns @@ -478,11 +456,11 @@ const serializedMessage = tx.getMessageToSign(false) // use this for the HW wall #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToSign](basetransaction.basetransaction-1.md#getmessagetosign) +BaseTransaction.getMessageToSign #### Defined in -[eip1559Transaction.ts:308](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L308) +[eip1559Transaction.ts:312](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L312) ___ @@ -498,11 +476,11 @@ Computes a sha3-256 hash which can be used to verify the signature #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToVerifySignature](basetransaction.basetransaction-1.md#getmessagetoverifysignature) +BaseTransaction.getMessageToVerifySignature #### Defined in -[eip1559Transaction.ts:336](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L336) +[eip1559Transaction.ts:346](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L346) ___ @@ -518,11 +496,11 @@ Returns the sender's address #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[getSenderAddress](basetransaction.basetransaction-1.md#getsenderaddress) +BaseTransaction.getSenderAddress #### Defined in -[baseTransaction.ts:249](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L249) +[baseTransaction.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L264) ___ @@ -538,11 +516,11 @@ Returns the public key of the sender #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getSenderPublicKey](basetransaction.basetransaction-1.md#getsenderpublickey) +BaseTransaction.getSenderPublicKey #### Defined in -[eip1559Transaction.ts:343](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L343) +[eip1559Transaction.ts:353](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L353) ___ @@ -564,7 +542,7 @@ The up front amount that an account must have for this transaction to be valid #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[getUpfrontCost](basetransaction.basetransaction-1.md#getupfrontcost) +BaseTransaction.getUpfrontCost #### Defined in @@ -579,7 +557,7 @@ ___ Computes a sha3-256 hash of the serialized tx. This method can only be used for signed txs (it throws otherwise). -Use {@link FeeMarketEIP1559Transaction.getMessageToSign} to get a tx hash for the purpose of signing. +Use [FeeMarketEIP1559Transaction.getMessageToSign](FeeMarketEIP1559Transaction.md#getmessagetosign) to get a tx hash for the purpose of signing. #### Returns @@ -587,11 +565,11 @@ Use {@link FeeMarketEIP1559Transaction.getMessageToSign} to get a tx hash for th #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[hash](basetransaction.basetransaction-1.md#hash) +BaseTransaction.hash #### Defined in -[eip1559Transaction.ts:325](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L325) +[eip1559Transaction.ts:328](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L328) ___ @@ -605,36 +583,41 @@ ___ #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[isSigned](basetransaction.basetransaction-1.md#issigned) +BaseTransaction.isSigned #### Defined in -[baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) +[baseTransaction.ts:231](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L231) ___ ### raw -▸ **raw**(): [FeeMarketEIP1559ValuesArray](../modules/types.md#feemarketeip1559valuesarray) +▸ **raw**(): [`FeeMarketEIP1559ValuesArray`](../README.md#feemarketeip1559valuesarray) Returns a Buffer Array of the raw Buffers of the EIP-1559 transaction, in order. Format: `[chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gasLimit, to, value, data, accessList, signatureYParity, signatureR, signatureS]` -Use {@link FeeMarketEIP1559Transaction.serialize} to add to block data for {@link Block.fromValuesArray}. +Use [FeeMarketEIP1559Transaction.serialize](FeeMarketEIP1559Transaction.md#serialize) to add a transaction to a block +with {@link Block.fromValuesArray}. + +For an unsigned tx this method uses the empty Buffer values for the +signature parameters `v`, `r` and `s` for encoding. For an EIP-155 compliant +representation for external signing use [FeeMarketEIP1559Transaction.getMessageToSign](FeeMarketEIP1559Transaction.md#getmessagetosign). #### Returns -[FeeMarketEIP1559ValuesArray](../modules/types.md#feemarketeip1559valuesarray) +[`FeeMarketEIP1559ValuesArray`](../README.md#feemarketeip1559valuesarray) #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[raw](basetransaction.basetransaction-1.md#raw) +BaseTransaction.raw #### Defined in -[eip1559Transaction.ts:262](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L262) +[eip1559Transaction.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L267) ___ @@ -648,7 +631,7 @@ Format: `0x02 || rlp([chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gasLim accessList, signatureYParity, signatureR, signatureS])` Note that in contrast to the legacy tx serialization format this is not -valid RLP any more due to the raw tx type preceeding and concatenated to +valid RLP any more due to the raw tx type preceding and concatenated to the RLP encoding of the values. #### Returns @@ -657,17 +640,17 @@ the RLP encoding of the values. #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[serialize](basetransaction.basetransaction-1.md#serialize) +BaseTransaction.serialize #### Defined in -[eip1559Transaction.ts:289](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L289) +[eip1559Transaction.ts:294](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L294) ___ ### sign -▸ **sign**(`privateKey`): [default](eip1559transaction.default.md) +▸ **sign**(`privateKey`): [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) Signs a transaction. @@ -685,15 +668,15 @@ const signedTx = tx.sign(privateKey) #### Returns -[default](eip1559transaction.default.md) +[`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[sign](basetransaction.basetransaction-1.md#sign) +BaseTransaction.sign #### Defined in -[baseTransaction.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L267) +[baseTransaction.ts:282](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L282) ___ @@ -720,7 +703,7 @@ on all supported capabilities. | Name | Type | | :------ | :------ | -| `capability` | [Capabilities](../enums/types.capabilities.md) | +| `capability` | [`Capability`](../enums/Capability.md) | #### Returns @@ -728,11 +711,11 @@ on all supported capabilities. #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[supports](basetransaction.basetransaction-1.md#supports) +BaseTransaction.supports #### Defined in -[baseTransaction.ts:133](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L133) +[baseTransaction.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L141) ___ @@ -748,31 +731,31 @@ If the tx's `to` is to the creation address #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[toCreationAddress](basetransaction.basetransaction-1.md#tocreationaddress) +BaseTransaction.toCreationAddress #### Defined in -[baseTransaction.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L191) +[baseTransaction.ts:199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L199) ___ ### toJSON -▸ **toJSON**(): [JsonTx](../interfaces/types.jsontx.md) +▸ **toJSON**(): [`JsonTx`](../interfaces/JsonTx.md) Returns an object with the JSON representation of the transaction #### Returns -[JsonTx](../interfaces/types.jsontx.md) +[`JsonTx`](../interfaces/JsonTx.md) #### Overrides -[BaseTransaction](basetransaction.basetransaction-1.md).[toJSON](basetransaction.basetransaction-1.md#tojson) +BaseTransaction.toJSON #### Defined in -[eip1559Transaction.ts:398](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L398) +[eip1559Transaction.ts:408](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L408) ___ @@ -789,11 +772,11 @@ Checks if the transaction has the minimum amount of gas required #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) +BaseTransaction.validate #### Defined in -[baseTransaction.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L141) +[baseTransaction.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L149) ▸ **validate**(`stringError`): `boolean` @@ -809,11 +792,11 @@ Checks if the transaction has the minimum amount of gas required #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) +BaseTransaction.validate #### Defined in -[baseTransaction.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L142) +[baseTransaction.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L150) ▸ **validate**(`stringError`): `string`[] @@ -829,11 +812,11 @@ Checks if the transaction has the minimum amount of gas required #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) +BaseTransaction.validate #### Defined in -[baseTransaction.ts:143](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L143) +[baseTransaction.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L151) ___ @@ -849,36 +832,36 @@ Determines if the signature is valid #### Inherited from -[BaseTransaction](basetransaction.basetransaction-1.md).[verifySignature](basetransaction.basetransaction-1.md#verifysignature) +BaseTransaction.verifySignature #### Defined in -[baseTransaction.ts:236](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L236) +[baseTransaction.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L251) ___ ### fromRlpSerializedTx -▸ `Static` **fromRlpSerializedTx**(`serialized`, `opts?`): [default](eip1559transaction.default.md) +▸ `Static` **fromRlpSerializedTx**(`serialized`, `opts?`): [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) Instantiate a transaction from the serialized tx. -(alias of {@link FeeMarketEIP1559Transaction.fromSerializedTx}) +(alias of [FeeMarketEIP1559Transaction.fromSerializedTx](FeeMarketEIP1559Transaction.md#fromserializedtx)) Note: This means that the Buffer should start with 0x01. **`deprecated`** this constructor alias is deprecated and will be removed -in favor of the {@link FeeMarketEIP1559Transaction.fromSerializedTx} constructor +in favor of the [FeeMarketEIP1559Transaction.fromSerializedTx](FeeMarketEIP1559Transaction.md#fromserializedtx) constructor #### Parameters | Name | Type | | :------ | :------ | | `serialized` | `Buffer` | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip1559transaction.default.md) +[`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) #### Defined in @@ -888,7 +871,7 @@ ___ ### fromSerializedTx -▸ `Static` **fromSerializedTx**(`serialized`, `opts?`): [default](eip1559transaction.default.md) +▸ `Static` **fromSerializedTx**(`serialized`, `opts?`): [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) Instantiate a transaction from the serialized tx. @@ -900,11 +883,11 @@ accessList, signatureYParity, signatureR, signatureS])` | Name | Type | | :------ | :------ | | `serialized` | `Buffer` | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip1559transaction.default.md) +[`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) #### Defined in @@ -914,7 +897,7 @@ ___ ### fromTxData -▸ `Static` **fromTxData**(`txData`, `opts?`): [default](eip1559transaction.default.md) +▸ `Static` **fromTxData**(`txData`, `opts?`): [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) Instantiate a transaction from a data dictionary. @@ -929,12 +912,12 @@ Notes: | Name | Type | | :------ | :------ | -| `txData` | [FeeMarketEIP1559TxData](../interfaces/types.feemarketeip1559txdata.md) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `txData` | [`FeeMarketEIP1559TxData`](../interfaces/FeeMarketEIP1559TxData.md) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip1559transaction.default.md) +[`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) #### Defined in @@ -944,7 +927,7 @@ ___ ### fromValuesArray -▸ `Static` **fromValuesArray**(`values`, `opts?`): [default](eip1559transaction.default.md) +▸ `Static` **fromValuesArray**(`values`, `opts?`): [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) Create a transaction from a values array. @@ -955,12 +938,12 @@ accessList, signatureYParity, signatureR, signatureS]` | Name | Type | | :------ | :------ | -| `values` | [FeeMarketEIP1559ValuesArray](../modules/types.md#feemarketeip1559valuesarray) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | +| `values` | [`FeeMarketEIP1559ValuesArray`](../README.md#feemarketeip1559valuesarray) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | #### Returns -[default](eip1559transaction.default.md) +[`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) #### Defined in diff --git a/packages/tx/docs/classes/Transaction.md b/packages/tx/docs/classes/Transaction.md new file mode 100644 index 0000000000..eca6451698 --- /dev/null +++ b/packages/tx/docs/classes/Transaction.md @@ -0,0 +1,828 @@ +[@ethereumjs/tx](../README.md) / Transaction + +# Class: Transaction + +An Ethereum non-typed (legacy) transaction + +## Hierarchy + +- `BaseTransaction`<[`Transaction`](Transaction.md)\> + + ↳ **`Transaction`** + +## Table of contents + +### Constructors + +- [constructor](Transaction.md#constructor) + +### Properties + +- [common](Transaction.md#common) +- [data](Transaction.md#data) +- [gasLimit](Transaction.md#gaslimit) +- [gasPrice](Transaction.md#gasprice) +- [nonce](Transaction.md#nonce) +- [r](Transaction.md#r) +- [s](Transaction.md#s) +- [to](Transaction.md#to) +- [v](Transaction.md#v) +- [value](Transaction.md#value) + +### Accessors + +- [transactionType](Transaction.md#transactiontype) +- [type](Transaction.md#type) + +### Methods + +- [getBaseFee](Transaction.md#getbasefee) +- [getDataFee](Transaction.md#getdatafee) +- [getMessageToSign](Transaction.md#getmessagetosign) +- [getMessageToVerifySignature](Transaction.md#getmessagetoverifysignature) +- [getSenderAddress](Transaction.md#getsenderaddress) +- [getSenderPublicKey](Transaction.md#getsenderpublickey) +- [getUpfrontCost](Transaction.md#getupfrontcost) +- [hash](Transaction.md#hash) +- [isSigned](Transaction.md#issigned) +- [raw](Transaction.md#raw) +- [serialize](Transaction.md#serialize) +- [sign](Transaction.md#sign) +- [supports](Transaction.md#supports) +- [toCreationAddress](Transaction.md#tocreationaddress) +- [toJSON](Transaction.md#tojson) +- [validate](Transaction.md#validate) +- [verifySignature](Transaction.md#verifysignature) +- [fromRlpSerializedTx](Transaction.md#fromrlpserializedtx) +- [fromSerializedTx](Transaction.md#fromserializedtx) +- [fromTxData](Transaction.md#fromtxdata) +- [fromValuesArray](Transaction.md#fromvaluesarray) + +## Constructors + +### constructor + +• **new Transaction**(`txData`, `opts?`) + +This constructor takes the values, validates them, assigns them and freezes the object. + +It is not recommended to use this constructor directly. Instead use +the static factory methods to assist in creating a Transaction object from +varying data types. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txData` | [`TxData`](../README.md#txdata) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | + +#### Overrides + +BaseTransaction<Transaction\>.constructor + +#### Defined in + +[legacyTransaction.ts:102](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L102) + +## Properties + +### common + +• `Readonly` **common**: `default` + +#### Overrides + +BaseTransaction.common + +#### Defined in + +[legacyTransaction.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L23) + +___ + +### data + +• `Readonly` **data**: `Buffer` + +#### Inherited from + +BaseTransaction.data + +#### Defined in + +[baseTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L42) + +___ + +### gasLimit + +• `Readonly` **gasLimit**: `BN` + +#### Inherited from + +BaseTransaction.gasLimit + +#### Defined in + +[baseTransaction.ts:39](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L39) + +___ + +### gasPrice + +• `Readonly` **gasPrice**: `BN` + +#### Defined in + +[legacyTransaction.ts:21](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L21) + +___ + +### nonce + +• `Readonly` **nonce**: `BN` + +#### Inherited from + +BaseTransaction.nonce + +#### Defined in + +[baseTransaction.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L38) + +___ + +### r + +• `Optional` `Readonly` **r**: `BN` + +#### Inherited from + +BaseTransaction.r + +#### Defined in + +[baseTransaction.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L45) + +___ + +### s + +• `Optional` `Readonly` **s**: `BN` + +#### Inherited from + +BaseTransaction.s + +#### Defined in + +[baseTransaction.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L46) + +___ + +### to + +• `Optional` `Readonly` **to**: `Address` + +#### Inherited from + +BaseTransaction.to + +#### Defined in + +[baseTransaction.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L40) + +___ + +### v + +• `Optional` `Readonly` **v**: `BN` + +#### Inherited from + +BaseTransaction.v + +#### Defined in + +[baseTransaction.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L44) + +___ + +### value + +• `Readonly` **value**: `BN` + +#### Inherited from + +BaseTransaction.value + +#### Defined in + +[baseTransaction.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L41) + +## Accessors + +### transactionType + +• `get` **transactionType**(): `number` + +Alias for {@link BaseTransaction.type} + +**`deprecated`** Use `type` instead + +#### Returns + +`number` + +#### Defined in + +[baseTransaction.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L112) + +___ + +### type + +• `get` **type**(): `number` + +Returns the transaction type. + +Note: legacy txs will return tx type `0`. + +#### Returns + +`number` + +#### Defined in + +[baseTransaction.ts:121](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L121) + +## Methods + +### getBaseFee + +▸ **getBaseFee**(): `BN` + +The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee) + +#### Returns + +`BN` + +#### Inherited from + +BaseTransaction.getBaseFee + +#### Defined in + +[baseTransaction.ts:169](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L169) + +___ + +### getDataFee + +▸ **getDataFee**(): `BN` + +The amount of gas paid for the data in this tx + +#### Returns + +`BN` + +#### Inherited from + +BaseTransaction.getDataFee + +#### Defined in + +[baseTransaction.ts:180](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L180) + +___ + +### getMessageToSign + +▸ **getMessageToSign**(`hashMessage`): `Buffer`[] + +Returns the unsigned tx (hashed or raw), which can be used +to sign the transaction (e.g. for sending to a hardware wallet). + +Note: the raw message message format for the legacy tx is not RLP encoded +and you might need to do yourself with: + +```javascript +import { rlp } from 'ethereumjs-util' +const message = tx.getMessageToSign(false) +const serializedMessage = rlp.encode(message) // use this for the HW wallet input +``` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `hashMessage` | ``false`` | Return hashed message if set to true (default: true) | + +#### Returns + +`Buffer`[] + +#### Overrides + +BaseTransaction.getMessageToSign + +#### Defined in + +[legacyTransaction.ts:210](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L210) + +▸ **getMessageToSign**(`hashMessage?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hashMessage?` | ``true`` | + +#### Returns + +`Buffer` + +#### Overrides + +BaseTransaction.getMessageToSign + +#### Defined in + +[legacyTransaction.ts:211](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L211) + +___ + +### getMessageToVerifySignature + +▸ **getMessageToVerifySignature**(): `Buffer` + +Computes a sha3-256 hash which can be used to verify the signature + +#### Returns + +`Buffer` + +#### Overrides + +BaseTransaction.getMessageToVerifySignature + +#### Defined in + +[legacyTransaction.ts:262](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L262) + +___ + +### getSenderAddress + +▸ **getSenderAddress**(): `Address` + +Returns the sender's address + +#### Returns + +`Address` + +#### Inherited from + +BaseTransaction.getSenderAddress + +#### Defined in + +[baseTransaction.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L264) + +___ + +### getSenderPublicKey + +▸ **getSenderPublicKey**(): `Buffer` + +Returns the public key of the sender + +#### Returns + +`Buffer` + +#### Overrides + +BaseTransaction.getSenderPublicKey + +#### Defined in + +[legacyTransaction.ts:273](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L273) + +___ + +### getUpfrontCost + +▸ **getUpfrontCost**(): `BN` + +The up front amount that an account must have for this transaction to be valid + +#### Returns + +`BN` + +#### Overrides + +BaseTransaction.getUpfrontCost + +#### Defined in + +[legacyTransaction.ts:224](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L224) + +___ + +### hash + +▸ **hash**(): `Buffer` + +Computes a sha3-256 hash of the serialized tx. + +This method can only be used for signed txs (it throws otherwise). +Use [Transaction.getMessageToSign](Transaction.md#getmessagetosign) to get a tx hash for the purpose of signing. + +#### Returns + +`Buffer` + +#### Overrides + +BaseTransaction.hash + +#### Defined in + +[legacyTransaction.ts:234](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L234) + +___ + +### isSigned + +▸ **isSigned**(): `boolean` + +#### Returns + +`boolean` + +#### Inherited from + +BaseTransaction.isSigned + +#### Defined in + +[baseTransaction.ts:231](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L231) + +___ + +### raw + +▸ **raw**(): [`TxValuesArray`](../README.md#txvaluesarray) + +Returns a Buffer Array of the raw Buffers of the legacy transaction, in order. + +Format: `[nonce, gasPrice, gasLimit, to, value, data, v, r, s]` + +For legacy txs this is also the correct format to add transactions +to a block with {@link Block.fromValuesArray} (use the `serialize()` method +for typed txs). + +For an unsigned tx this method returns the empty Buffer values +for the signature parameters `v`, `r` and `s`. For an EIP-155 compliant +representation have a look at [Transaction.getMessageToSign](Transaction.md#getmessagetosign). + +#### Returns + +[`TxValuesArray`](../README.md#txvaluesarray) + +#### Overrides + +BaseTransaction.raw + +#### Defined in + +[legacyTransaction.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L149) + +___ + +### serialize + +▸ **serialize**(): `Buffer` + +Returns the serialized encoding of the legacy transaction. + +Format: `rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])` + +For an unsigned tx this method uses the empty Buffer values for the +signature parameters `v`, `r` and `s` for encoding. For an EIP-155 compliant +representation for external signing use [Transaction.getMessageToSign](Transaction.md#getmessagetosign). + +#### Returns + +`Buffer` + +#### Overrides + +BaseTransaction.serialize + +#### Defined in + +[legacyTransaction.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L172) + +___ + +### sign + +▸ **sign**(`privateKey`): [`Transaction`](Transaction.md) + +Signs a transaction. + +Note that the signed tx is returned as a new object, +use as follows: +```javascript +const signedTx = tx.sign(privateKey) +``` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `privateKey` | `Buffer` | + +#### Returns + +[`Transaction`](Transaction.md) + +#### Inherited from + +BaseTransaction.sign + +#### Defined in + +[baseTransaction.ts:282](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L282) + +___ + +### supports + +▸ **supports**(`capability`): `boolean` + +Checks if a tx type defining capability is active +on a tx, for example the EIP-1559 fee market mechanism +or the EIP-2930 access list feature. + +Note that this is different from the tx type itself, +so EIP-2930 access lists can very well be active +on an EIP-1559 tx for example. + +This method can be useful for feature checks if the +tx type is unknown (e.g. when instantiated with +the tx factory). + +See `Capabilites` in the `types` module for a reference +on all supported capabilities. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `capability` | [`Capability`](../enums/Capability.md) | + +#### Returns + +`boolean` + +#### Inherited from + +BaseTransaction.supports + +#### Defined in + +[baseTransaction.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L141) + +___ + +### toCreationAddress + +▸ **toCreationAddress**(): `boolean` + +If the tx's `to` is to the creation address + +#### Returns + +`boolean` + +#### Inherited from + +BaseTransaction.toCreationAddress + +#### Defined in + +[baseTransaction.ts:199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L199) + +___ + +### toJSON + +▸ **toJSON**(): [`JsonTx`](../interfaces/JsonTx.md) + +Returns an object with the JSON representation of the transaction. + +#### Returns + +[`JsonTx`](../interfaces/JsonTx.md) + +#### Overrides + +BaseTransaction.toJSON + +#### Defined in + +[legacyTransaction.ts:330](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L330) + +___ + +### validate + +▸ **validate**(): `boolean` + +Checks if the transaction has the minimum amount of gas required +(DataFee + TxFee + Creation Fee). + +#### Returns + +`boolean` + +#### Inherited from + +BaseTransaction.validate + +#### Defined in + +[baseTransaction.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L149) + +▸ **validate**(`stringError`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stringError` | ``false`` | + +#### Returns + +`boolean` + +#### Inherited from + +BaseTransaction.validate + +#### Defined in + +[baseTransaction.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L150) + +▸ **validate**(`stringError`): `string`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stringError` | ``true`` | + +#### Returns + +`string`[] + +#### Inherited from + +BaseTransaction.validate + +#### Defined in + +[baseTransaction.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L151) + +___ + +### verifySignature + +▸ **verifySignature**(): `boolean` + +Determines if the signature is valid + +#### Returns + +`boolean` + +#### Inherited from + +BaseTransaction.verifySignature + +#### Defined in + +[baseTransaction.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L251) + +___ + +### fromRlpSerializedTx + +▸ `Static` **fromRlpSerializedTx**(`serialized`, `opts?`): [`Transaction`](Transaction.md) + +Instantiate a transaction from the serialized tx. +(alias of [Transaction.fromSerializedTx](Transaction.md#fromserializedtx)) + +**`deprecated`** this constructor alias is deprecated and will be removed +in favor of the [Transaction.fromSerializedTx](Transaction.md#fromserializedtx) constructor + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `serialized` | `Buffer` | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | + +#### Returns + +[`Transaction`](Transaction.md) + +#### Defined in + +[legacyTransaction.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L59) + +___ + +### fromSerializedTx + +▸ `Static` **fromSerializedTx**(`serialized`, `opts?`): [`Transaction`](Transaction.md) + +Instantiate a transaction from the serialized tx. + +Format: `rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `serialized` | `Buffer` | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | + +#### Returns + +[`Transaction`](Transaction.md) + +#### Defined in + +[legacyTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L42) + +___ + +### fromTxData + +▸ `Static` **fromTxData**(`txData`, `opts?`): [`Transaction`](Transaction.md) + +Instantiate a transaction from a data dictionary. + +Format: { nonce, gasPrice, gasLimit, to, value, data, v, r, s } + +Notes: +- All parameters are optional and have some basic default values + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txData` | [`TxData`](../README.md#txdata) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | + +#### Returns + +[`Transaction`](Transaction.md) + +#### Defined in + +[legacyTransaction.ts:33](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L33) + +___ + +### fromValuesArray + +▸ `Static` **fromValuesArray**(`values`, `opts?`): [`Transaction`](Transaction.md) + +Create a transaction from a values array. + +Format: `[nonce, gasPrice, gasLimit, to, value, data, v, r, s]` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `values` | [`TxValuesArray`](../README.md#txvaluesarray) | +| `opts` | [`TxOptions`](../interfaces/TxOptions.md) | + +#### Returns + +[`Transaction`](Transaction.md) + +#### Defined in + +[legacyTransaction.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L68) diff --git a/packages/tx/docs/classes/TransactionFactory.md b/packages/tx/docs/classes/TransactionFactory.md new file mode 100644 index 0000000000..a309a8de1d --- /dev/null +++ b/packages/tx/docs/classes/TransactionFactory.md @@ -0,0 +1,110 @@ +[@ethereumjs/tx](../README.md) / TransactionFactory + +# Class: TransactionFactory + +## Table of contents + +### Methods + +- [fromBlockBodyData](TransactionFactory.md#fromblockbodydata) +- [fromSerializedData](TransactionFactory.md#fromserializeddata) +- [fromTxData](TransactionFactory.md#fromtxdata) +- [getTransactionClass](TransactionFactory.md#gettransactionclass) + +## Methods + +### fromBlockBodyData + +▸ `Static` **fromBlockBodyData**(`data`, `txOptions?`): [`TypedTransaction`](../README.md#typedtransaction) + +When decoding a BlockBody, in the transactions field, a field is either: +A Buffer (a TypedTransaction - encoded as TransactionType || rlp(TransactionPayload)) +A Buffer[] (Legacy Transaction) +This method returns the right transaction. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `Buffer` \| `Buffer`[] | A Buffer or Buffer[] | +| `txOptions` | [`TxOptions`](../interfaces/TxOptions.md) | The transaction options | + +#### Returns + +[`TypedTransaction`](../README.md#typedtransaction) + +#### Defined in + +[transactionFactory.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L83) + +___ + +### fromSerializedData + +▸ `Static` **fromSerializedData**(`data`, `txOptions?`): [`TypedTransaction`](../README.md#typedtransaction) + +This method tries to decode serialized data. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `Buffer` | The data Buffer | +| `txOptions` | [`TxOptions`](../interfaces/TxOptions.md) | The transaction options | + +#### Returns + +[`TypedTransaction`](../README.md#typedtransaction) + +#### Defined in + +[transactionFactory.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L49) + +___ + +### fromTxData + +▸ `Static` **fromTxData**(`txData`, `txOptions?`): [`TypedTransaction`](../README.md#typedtransaction) + +Create a transaction from a `txData` object + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txData` | [`TxData`](../README.md#txdata) \| [`AccessListEIP2930TxData`](../interfaces/AccessListEIP2930TxData.md) \| [`FeeMarketEIP1559TxData`](../interfaces/FeeMarketEIP1559TxData.md) | The transaction data. The `type` field will determine which transaction type is returned (if undefined, creates a legacy transaction) | +| `txOptions` | [`TxOptions`](../interfaces/TxOptions.md) | Options to pass on to the constructor of the transaction | + +#### Returns + +[`TypedTransaction`](../README.md#typedtransaction) + +#### Defined in + +[transactionFactory.ts:22](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L22) + +___ + +### getTransactionClass + +▸ `Static` **getTransactionClass**(`transactionID?`, `_common?`): typeof [`Transaction`](Transaction.md) \| typeof [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) \| typeof [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) + +This helper method allows one to retrieve the class which matches the transactionID +If transactionID is undefined, returns the legacy transaction class. + +**`deprecated`** - This method is deprecated and will be removed on the next major release + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `transactionID` | `number` | `0` | | +| `_common?` | `default` | `undefined` | This option is not used | + +#### Returns + +typeof [`Transaction`](Transaction.md) \| typeof [`AccessListEIP2930Transaction`](AccessListEIP2930Transaction.md) \| typeof [`FeeMarketEIP1559Transaction`](FeeMarketEIP1559Transaction.md) + +#### Defined in + +[transactionFactory.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L101) diff --git a/packages/tx/docs/classes/basetransaction.basetransaction-1.md b/packages/tx/docs/classes/basetransaction.basetransaction-1.md deleted file mode 100644 index c553f8f362..0000000000 --- a/packages/tx/docs/classes/basetransaction.basetransaction-1.md +++ /dev/null @@ -1,568 +0,0 @@ -[@ethereumjs/tx](../README.md) / [baseTransaction](../modules/basetransaction.md) / BaseTransaction - -# Class: BaseTransaction - -[baseTransaction](../modules/basetransaction.md).BaseTransaction - -This base class will likely be subject to further -refactoring along the introduction of additional tx types -on the Ethereum network. - -It is therefore not recommended to use directly. - -## Type parameters - -| Name | -| :------ | -| `TransactionObject` | - -## Hierarchy - -- **BaseTransaction** - - ↳ [default](eip1559transaction.default.md) - - ↳ [default](eip2930transaction.default.md) - - ↳ [default](legacytransaction.default.md) - -## Table of contents - -### Constructors - -- [constructor](basetransaction.basetransaction-1.md#constructor) - -### Properties - -- [common](basetransaction.basetransaction-1.md#common) -- [data](basetransaction.basetransaction-1.md#data) -- [gasLimit](basetransaction.basetransaction-1.md#gaslimit) -- [nonce](basetransaction.basetransaction-1.md#nonce) -- [r](basetransaction.basetransaction-1.md#r) -- [s](basetransaction.basetransaction-1.md#s) -- [to](basetransaction.basetransaction-1.md#to) -- [v](basetransaction.basetransaction-1.md#v) -- [value](basetransaction.basetransaction-1.md#value) - -### Accessors - -- [transactionType](basetransaction.basetransaction-1.md#transactiontype) -- [type](basetransaction.basetransaction-1.md#type) - -### Methods - -- [getBaseFee](basetransaction.basetransaction-1.md#getbasefee) -- [getDataFee](basetransaction.basetransaction-1.md#getdatafee) -- [getMessageToSign](basetransaction.basetransaction-1.md#getmessagetosign) -- [getMessageToVerifySignature](basetransaction.basetransaction-1.md#getmessagetoverifysignature) -- [getSenderAddress](basetransaction.basetransaction-1.md#getsenderaddress) -- [getSenderPublicKey](basetransaction.basetransaction-1.md#getsenderpublickey) -- [getUpfrontCost](basetransaction.basetransaction-1.md#getupfrontcost) -- [hash](basetransaction.basetransaction-1.md#hash) -- [isSigned](basetransaction.basetransaction-1.md#issigned) -- [raw](basetransaction.basetransaction-1.md#raw) -- [serialize](basetransaction.basetransaction-1.md#serialize) -- [sign](basetransaction.basetransaction-1.md#sign) -- [supports](basetransaction.basetransaction-1.md#supports) -- [toCreationAddress](basetransaction.basetransaction-1.md#tocreationaddress) -- [toJSON](basetransaction.basetransaction-1.md#tojson) -- [validate](basetransaction.basetransaction-1.md#validate) -- [verifySignature](basetransaction.basetransaction-1.md#verifysignature) - -## Constructors - -### constructor - -• **new BaseTransaction**(`txData`) - -#### Type parameters - -| Name | -| :------ | -| `TransactionObject` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `txData` | [TxData](../modules/types.md#txdata) \| [AccessListEIP2930TxData](../interfaces/types.accesslisteip2930txdata.md) \| [FeeMarketEIP1559TxData](../interfaces/types.feemarketeip1559txdata.md) | - -#### Defined in - -[baseTransaction.ts:69](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L69) - -## Properties - -### common - -• `Readonly` **common**: `default` - -#### Defined in - -[baseTransaction.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L44) - -___ - -### data - -• `Readonly` **data**: `Buffer` - -#### Defined in - -[baseTransaction.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L38) - -___ - -### gasLimit - -• `Readonly` **gasLimit**: `BN` - -#### Defined in - -[baseTransaction.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L35) - -___ - -### nonce - -• `Readonly` **nonce**: `BN` - -#### Defined in - -[baseTransaction.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L34) - -___ - -### r - -• `Optional` `Readonly` **r**: `BN` - -#### Defined in - -[baseTransaction.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L41) - -___ - -### s - -• `Optional` `Readonly` **s**: `BN` - -#### Defined in - -[baseTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L42) - -___ - -### to - -• `Optional` `Readonly` **to**: `Address` - -#### Defined in - -[baseTransaction.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L36) - -___ - -### v - -• `Optional` `Readonly` **v**: `BN` - -#### Defined in - -[baseTransaction.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L40) - -___ - -### value - -• `Readonly` **value**: `BN` - -#### Defined in - -[baseTransaction.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L37) - -## Accessors - -### transactionType - -• `get` **transactionType**(): `number` - -Alias for [BaseTransaction.type](basetransaction.basetransaction-1.md#type) - -**`deprecated`** Use `type` instead - -#### Returns - -`number` - -#### Defined in - -[baseTransaction.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L104) - -___ - -### type - -• `get` **type**(): `number` - -Returns the transaction type. - -Note: legacy txs will return tx type `0`. - -#### Returns - -`number` - -#### Defined in - -[baseTransaction.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L113) - -## Methods - -### getBaseFee - -▸ **getBaseFee**(): `BN` - -The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee) - -#### Returns - -`BN` - -#### Defined in - -[baseTransaction.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L161) - -___ - -### getDataFee - -▸ **getDataFee**(): `BN` - -The amount of gas paid for the data in this tx - -#### Returns - -`BN` - -#### Defined in - -[baseTransaction.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L172) - -___ - -### getMessageToSign - -▸ `Abstract` **getMessageToSign**(`hashMessage`): `Buffer` \| `Buffer`[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hashMessage` | ``false`` | - -#### Returns - -`Buffer` \| `Buffer`[] - -#### Defined in - -[baseTransaction.ts:209](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L209) - -▸ `Abstract` **getMessageToSign**(`hashMessage?`): `Buffer` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hashMessage?` | ``true`` | - -#### Returns - -`Buffer` - -#### Defined in - -[baseTransaction.ts:210](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L210) - -___ - -### getMessageToVerifySignature - -▸ `Abstract` **getMessageToVerifySignature**(): `Buffer` - -#### Returns - -`Buffer` - -#### Defined in - -[baseTransaction.ts:214](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L214) - -___ - -### getSenderAddress - -▸ **getSenderAddress**(): `Address` - -Returns the sender's address - -#### Returns - -`Address` - -#### Defined in - -[baseTransaction.ts:249](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L249) - -___ - -### getSenderPublicKey - -▸ `Abstract` **getSenderPublicKey**(): `Buffer` - -Returns the public key of the sender - -#### Returns - -`Buffer` - -#### Defined in - -[baseTransaction.ts:256](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L256) - -___ - -### getUpfrontCost - -▸ `Abstract` **getUpfrontCost**(): `BN` - -The up front amount that an account must have for this transaction to be valid - -#### Returns - -`BN` - -#### Defined in - -[baseTransaction.ts:186](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L186) - -___ - -### hash - -▸ `Abstract` **hash**(): `Buffer` - -#### Returns - -`Buffer` - -#### Defined in - -[baseTransaction.ts:212](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L212) - -___ - -### isSigned - -▸ **isSigned**(): `boolean` - -#### Returns - -`boolean` - -#### Defined in - -[baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) - -___ - -### raw - -▸ `Abstract` **raw**(): [TxValuesArray](../modules/types.md#txvaluesarray) \| [AccessListEIP2930ValuesArray](../modules/types.md#accesslisteip2930valuesarray) \| [FeeMarketEIP1559ValuesArray](../modules/types.md#feemarketeip1559valuesarray) - -Returns a Buffer Array of the raw Buffers of this transaction, in order. - -#### Returns - -[TxValuesArray](../modules/types.md#txvaluesarray) \| [AccessListEIP2930ValuesArray](../modules/types.md#accesslisteip2930valuesarray) \| [FeeMarketEIP1559ValuesArray](../modules/types.md#feemarketeip1559valuesarray) - -#### Defined in - -[baseTransaction.ts:198](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L198) - -___ - -### serialize - -▸ `Abstract` **serialize**(): `Buffer` - -Returns the encoding of the transaction. - -#### Returns - -`Buffer` - -#### Defined in - -[baseTransaction.ts:203](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L203) - -___ - -### sign - -▸ **sign**(`privateKey`): `TransactionObject` - -Signs a transaction. - -Note that the signed tx is returned as a new object, -use as follows: -```javascript -const signedTx = tx.sign(privateKey) -``` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `privateKey` | `Buffer` | - -#### Returns - -`TransactionObject` - -#### Defined in - -[baseTransaction.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L267) - -___ - -### supports - -▸ **supports**(`capability`): `boolean` - -Checks if a tx type defining capability is active -on a tx, for example the EIP-1559 fee market mechanism -or the EIP-2930 access list feature. - -Note that this is different from the tx type itself, -so EIP-2930 access lists can very well be active -on an EIP-1559 tx for example. - -This method can be useful for feature checks if the -tx type is unknown (e.g. when instantiated with -the tx factory). - -See `Capabilites` in the `types` module for a reference -on all supported capabilities. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `capability` | [Capabilities](../enums/types.capabilities.md) | - -#### Returns - -`boolean` - -#### Defined in - -[baseTransaction.ts:133](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L133) - -___ - -### toCreationAddress - -▸ **toCreationAddress**(): `boolean` - -If the tx's `to` is to the creation address - -#### Returns - -`boolean` - -#### Defined in - -[baseTransaction.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L191) - -___ - -### toJSON - -▸ `Abstract` **toJSON**(): [JsonTx](../interfaces/types.jsontx.md) - -Returns an object with the JSON representation of the transaction - -#### Returns - -[JsonTx](../interfaces/types.jsontx.md) - -#### Defined in - -[baseTransaction.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L304) - -___ - -### validate - -▸ **validate**(): `boolean` - -Checks if the transaction has the minimum amount of gas required -(DataFee + TxFee + Creation Fee). - -#### Returns - -`boolean` - -#### Defined in - -[baseTransaction.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L141) - -▸ **validate**(`stringError`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stringError` | ``false`` | - -#### Returns - -`boolean` - -#### Defined in - -[baseTransaction.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L142) - -▸ **validate**(`stringError`): `string`[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stringError` | ``true`` | - -#### Returns - -`string`[] - -#### Defined in - -[baseTransaction.ts:143](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L143) - -___ - -### verifySignature - -▸ **verifySignature**(): `boolean` - -Determines if the signature is valid - -#### Returns - -`boolean` - -#### Defined in - -[baseTransaction.ts:236](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L236) diff --git a/packages/tx/docs/classes/legacytransaction.default.md b/packages/tx/docs/classes/legacytransaction.default.md deleted file mode 100644 index 143f5a8837..0000000000 --- a/packages/tx/docs/classes/legacytransaction.default.md +++ /dev/null @@ -1,826 +0,0 @@ -[@ethereumjs/tx](../README.md) / [legacyTransaction](../modules/legacytransaction.md) / default - -# Class: default - -[legacyTransaction](../modules/legacytransaction.md).default - -An Ethereum non-typed (legacy) transaction - -## Hierarchy - -- [BaseTransaction](basetransaction.basetransaction-1.md)<[default](legacytransaction.default.md)\> - - ↳ **default** - -## Table of contents - -### Constructors - -- [constructor](legacytransaction.default.md#constructor) - -### Properties - -- [common](legacytransaction.default.md#common) -- [data](legacytransaction.default.md#data) -- [gasLimit](legacytransaction.default.md#gaslimit) -- [gasPrice](legacytransaction.default.md#gasprice) -- [nonce](legacytransaction.default.md#nonce) -- [r](legacytransaction.default.md#r) -- [s](legacytransaction.default.md#s) -- [to](legacytransaction.default.md#to) -- [v](legacytransaction.default.md#v) -- [value](legacytransaction.default.md#value) - -### Accessors - -- [transactionType](legacytransaction.default.md#transactiontype) -- [type](legacytransaction.default.md#type) - -### Methods - -- [getBaseFee](legacytransaction.default.md#getbasefee) -- [getDataFee](legacytransaction.default.md#getdatafee) -- [getMessageToSign](legacytransaction.default.md#getmessagetosign) -- [getMessageToVerifySignature](legacytransaction.default.md#getmessagetoverifysignature) -- [getSenderAddress](legacytransaction.default.md#getsenderaddress) -- [getSenderPublicKey](legacytransaction.default.md#getsenderpublickey) -- [getUpfrontCost](legacytransaction.default.md#getupfrontcost) -- [hash](legacytransaction.default.md#hash) -- [isSigned](legacytransaction.default.md#issigned) -- [raw](legacytransaction.default.md#raw) -- [serialize](legacytransaction.default.md#serialize) -- [sign](legacytransaction.default.md#sign) -- [supports](legacytransaction.default.md#supports) -- [toCreationAddress](legacytransaction.default.md#tocreationaddress) -- [toJSON](legacytransaction.default.md#tojson) -- [validate](legacytransaction.default.md#validate) -- [verifySignature](legacytransaction.default.md#verifysignature) -- [fromRlpSerializedTx](legacytransaction.default.md#fromrlpserializedtx) -- [fromSerializedTx](legacytransaction.default.md#fromserializedtx) -- [fromTxData](legacytransaction.default.md#fromtxdata) -- [fromValuesArray](legacytransaction.default.md#fromvaluesarray) - -## Constructors - -### constructor - -• **new default**(`txData`, `opts?`) - -This constructor takes the values, validates them, assigns them and freezes the object. - -It is not recommended to use this constructor directly. Instead use -the static factory methods to assist in creating a Transaction object from -varying data types. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `txData` | [TxData](../modules/types.md#txdata) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[constructor](basetransaction.basetransaction-1.md#constructor) - -#### Defined in - -[legacyTransaction.ts:93](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L93) - -## Properties - -### common - -• `Readonly` **common**: `default` - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[common](basetransaction.basetransaction-1.md#common) - -#### Defined in - -[legacyTransaction.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L23) - -___ - -### data - -• `Readonly` **data**: `Buffer` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[data](basetransaction.basetransaction-1.md#data) - -#### Defined in - -[baseTransaction.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L38) - -___ - -### gasLimit - -• `Readonly` **gasLimit**: `BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[gasLimit](basetransaction.basetransaction-1.md#gaslimit) - -#### Defined in - -[baseTransaction.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L35) - -___ - -### gasPrice - -• `Readonly` **gasPrice**: `BN` - -#### Defined in - -[legacyTransaction.ts:21](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L21) - -___ - -### nonce - -• `Readonly` **nonce**: `BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[nonce](basetransaction.basetransaction-1.md#nonce) - -#### Defined in - -[baseTransaction.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L34) - -___ - -### r - -• `Optional` `Readonly` **r**: `BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[r](basetransaction.basetransaction-1.md#r) - -#### Defined in - -[baseTransaction.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L41) - -___ - -### s - -• `Optional` `Readonly` **s**: `BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[s](basetransaction.basetransaction-1.md#s) - -#### Defined in - -[baseTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L42) - -___ - -### to - -• `Optional` `Readonly` **to**: `Address` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[to](basetransaction.basetransaction-1.md#to) - -#### Defined in - -[baseTransaction.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L36) - -___ - -### v - -• `Optional` `Readonly` **v**: `BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[v](basetransaction.basetransaction-1.md#v) - -#### Defined in - -[baseTransaction.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L40) - -___ - -### value - -• `Readonly` **value**: `BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[value](basetransaction.basetransaction-1.md#value) - -#### Defined in - -[baseTransaction.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L37) - -## Accessors - -### transactionType - -• `get` **transactionType**(): `number` - -Alias for [BaseTransaction.type](basetransaction.basetransaction-1.md#type) - -**`deprecated`** Use `type` instead - -#### Returns - -`number` - -#### Defined in - -[baseTransaction.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L104) - -___ - -### type - -• `get` **type**(): `number` - -Returns the transaction type. - -Note: legacy txs will return tx type `0`. - -#### Returns - -`number` - -#### Defined in - -[baseTransaction.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L113) - -## Methods - -### getBaseFee - -▸ **getBaseFee**(): `BN` - -The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee) - -#### Returns - -`BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[getBaseFee](basetransaction.basetransaction-1.md#getbasefee) - -#### Defined in - -[baseTransaction.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L161) - -___ - -### getDataFee - -▸ **getDataFee**(): `BN` - -The amount of gas paid for the data in this tx - -#### Returns - -`BN` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[getDataFee](basetransaction.basetransaction-1.md#getdatafee) - -#### Defined in - -[baseTransaction.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L172) - -___ - -### getMessageToSign - -▸ **getMessageToSign**(`hashMessage`): `Buffer`[] - -Returns the serialized unsigned tx (hashed or raw), which can be used -to sign the transaction (e.g. for sending to a hardware wallet). - -Note: the raw message message format for the legacy tx is not RLP encoded -and you might need to do yourself with: - -```javascript -import { rlp } from 'ethereumjs-util' -const message = tx.getMessageToSign(false) -const serializedMessage = rlp.encode(message) // use this for the HW wallet input -``` - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `hashMessage` | ``false`` | Return hashed message if set to true (default: true) | - -#### Returns - -`Buffer`[] - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToSign](basetransaction.basetransaction-1.md#getmessagetosign) - -#### Defined in - -[legacyTransaction.ts:206](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L206) - -▸ **getMessageToSign**(`hashMessage?`): `Buffer` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hashMessage?` | ``true`` | - -#### Returns - -`Buffer` - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToSign](basetransaction.basetransaction-1.md#getmessagetosign) - -#### Defined in - -[legacyTransaction.ts:207](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L207) - -___ - -### getMessageToVerifySignature - -▸ **getMessageToVerifySignature**(): `Buffer` - -Computes a sha3-256 hash which can be used to verify the signature - -#### Returns - -`Buffer` - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[getMessageToVerifySignature](basetransaction.basetransaction-1.md#getmessagetoverifysignature) - -#### Defined in - -[legacyTransaction.ts:237](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L237) - -___ - -### getSenderAddress - -▸ **getSenderAddress**(): `Address` - -Returns the sender's address - -#### Returns - -`Address` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[getSenderAddress](basetransaction.basetransaction-1.md#getsenderaddress) - -#### Defined in - -[baseTransaction.ts:249](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L249) - -___ - -### getSenderPublicKey - -▸ **getSenderPublicKey**(): `Buffer` - -Returns the public key of the sender - -#### Returns - -`Buffer` - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[getSenderPublicKey](basetransaction.basetransaction-1.md#getsenderpublickey) - -#### Defined in - -[legacyTransaction.ts:248](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L248) - -___ - -### getUpfrontCost - -▸ **getUpfrontCost**(): `BN` - -The up front amount that an account must have for this transaction to be valid - -#### Returns - -`BN` - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[getUpfrontCost](basetransaction.basetransaction-1.md#getupfrontcost) - -#### Defined in - -[legacyTransaction.ts:220](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L220) - -___ - -### hash - -▸ **hash**(): `Buffer` - -Computes a sha3-256 hash of the serialized tx. - -This method can only be used for signed txs (it throws otherwise). -Use {@link Transaction.getMessageToSign} to get a tx hash for the purpose of signing. - -#### Returns - -`Buffer` - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[hash](basetransaction.basetransaction-1.md#hash) - -#### Defined in - -[legacyTransaction.ts:230](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L230) - -___ - -### isSigned - -▸ **isSigned**(): `boolean` - -#### Returns - -`boolean` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[isSigned](basetransaction.basetransaction-1.md#issigned) - -#### Defined in - -[baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) - -___ - -### raw - -▸ **raw**(): [TxValuesArray](../modules/types.md#txvaluesarray) - -Returns a Buffer Array of the raw Buffers of the legacy transaction, in order. - -Format: `[nonce, gasPrice, gasLimit, to, value, data, v, r, s]` - -For an unsigned legacy tx this method returns the the empty Buffer values -for the signature parameters `v`, `r` and `s`. For an EIP-155 compliant -representation have a look at {@link Transaction.getMessageToSign}. - -#### Returns - -[TxValuesArray](../modules/types.md#txvaluesarray) - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[raw](basetransaction.basetransaction-1.md#raw) - -#### Defined in - -[legacyTransaction.ts:145](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L145) - -___ - -### serialize - -▸ **serialize**(): `Buffer` - -Returns the serialized encoding of the legacy transaction. - -Format: `rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])` - -For an unsigned legacy tx this method uses the empty Buffer values -for the signature parameters `v`, `r` and `s` for encoding. For an -EIP-155 compliant representation use {@link Transaction.getMessageToSign}. - -#### Returns - -`Buffer` - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[serialize](basetransaction.basetransaction-1.md#serialize) - -#### Defined in - -[legacyTransaction.ts:168](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L168) - -___ - -### sign - -▸ **sign**(`privateKey`): [default](legacytransaction.default.md) - -Signs a transaction. - -Note that the signed tx is returned as a new object, -use as follows: -```javascript -const signedTx = tx.sign(privateKey) -``` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `privateKey` | `Buffer` | - -#### Returns - -[default](legacytransaction.default.md) - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[sign](basetransaction.basetransaction-1.md#sign) - -#### Defined in - -[baseTransaction.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L267) - -___ - -### supports - -▸ **supports**(`capability`): `boolean` - -Checks if a tx type defining capability is active -on a tx, for example the EIP-1559 fee market mechanism -or the EIP-2930 access list feature. - -Note that this is different from the tx type itself, -so EIP-2930 access lists can very well be active -on an EIP-1559 tx for example. - -This method can be useful for feature checks if the -tx type is unknown (e.g. when instantiated with -the tx factory). - -See `Capabilites` in the `types` module for a reference -on all supported capabilities. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `capability` | [Capabilities](../enums/types.capabilities.md) | - -#### Returns - -`boolean` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[supports](basetransaction.basetransaction-1.md#supports) - -#### Defined in - -[baseTransaction.ts:133](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L133) - -___ - -### toCreationAddress - -▸ **toCreationAddress**(): `boolean` - -If the tx's `to` is to the creation address - -#### Returns - -`boolean` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[toCreationAddress](basetransaction.basetransaction-1.md#tocreationaddress) - -#### Defined in - -[baseTransaction.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L191) - -___ - -### toJSON - -▸ **toJSON**(): [JsonTx](../interfaces/types.jsontx.md) - -Returns an object with the JSON representation of the transaction. - -#### Returns - -[JsonTx](../interfaces/types.jsontx.md) - -#### Overrides - -[BaseTransaction](basetransaction.basetransaction-1.md).[toJSON](basetransaction.basetransaction-1.md#tojson) - -#### Defined in - -[legacyTransaction.ts:305](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L305) - -___ - -### validate - -▸ **validate**(): `boolean` - -Checks if the transaction has the minimum amount of gas required -(DataFee + TxFee + Creation Fee). - -#### Returns - -`boolean` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) - -#### Defined in - -[baseTransaction.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L141) - -▸ **validate**(`stringError`): `boolean` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stringError` | ``false`` | - -#### Returns - -`boolean` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) - -#### Defined in - -[baseTransaction.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L142) - -▸ **validate**(`stringError`): `string`[] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stringError` | ``true`` | - -#### Returns - -`string`[] - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[validate](basetransaction.basetransaction-1.md#validate) - -#### Defined in - -[baseTransaction.ts:143](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L143) - -___ - -### verifySignature - -▸ **verifySignature**(): `boolean` - -Determines if the signature is valid - -#### Returns - -`boolean` - -#### Inherited from - -[BaseTransaction](basetransaction.basetransaction-1.md).[verifySignature](basetransaction.basetransaction-1.md#verifysignature) - -#### Defined in - -[baseTransaction.ts:236](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L236) - -___ - -### fromRlpSerializedTx - -▸ `Static` **fromRlpSerializedTx**(`serialized`, `opts?`): [default](legacytransaction.default.md) - -Instantiate a transaction from the serialized tx. -(alias of {@link Transaction.fromSerializedTx}) - -**`deprecated`** this constructor alias is deprecated and will be removed -in favor of the {@link Transaction.fromSerializedTx} constructor - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `serialized` | `Buffer` | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | - -#### Returns - -[default](legacytransaction.default.md) - -#### Defined in - -[legacyTransaction.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L59) - -___ - -### fromSerializedTx - -▸ `Static` **fromSerializedTx**(`serialized`, `opts?`): [default](legacytransaction.default.md) - -Instantiate a transaction from the serialized tx. - -Format: `rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `serialized` | `Buffer` | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | - -#### Returns - -[default](legacytransaction.default.md) - -#### Defined in - -[legacyTransaction.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L42) - -___ - -### fromTxData - -▸ `Static` **fromTxData**(`txData`, `opts?`): [default](legacytransaction.default.md) - -Instantiate a transaction from a data dictionary. - -Format: { nonce, gasPrice, gasLimit, to, value, data, v, r, s } - -Notes: -- All parameters are optional and have some basic default values - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `txData` | [TxData](../modules/types.md#txdata) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | - -#### Returns - -[default](legacytransaction.default.md) - -#### Defined in - -[legacyTransaction.ts:33](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L33) - -___ - -### fromValuesArray - -▸ `Static` **fromValuesArray**(`values`, `opts?`): [default](legacytransaction.default.md) - -Create a transaction from a values array. - -Format: `[nonce, gasPrice, gasLimit, to, value, data, v, r, s]` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `values` | [TxValuesArray](../modules/types.md#txvaluesarray) | -| `opts` | [TxOptions](../interfaces/types.txoptions.md) | - -#### Returns - -[default](legacytransaction.default.md) - -#### Defined in - -[legacyTransaction.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L68) diff --git a/packages/tx/docs/classes/transactionfactory.default.md b/packages/tx/docs/classes/transactionfactory.default.md deleted file mode 100644 index c8c9899658..0000000000 --- a/packages/tx/docs/classes/transactionfactory.default.md +++ /dev/null @@ -1,112 +0,0 @@ -[@ethereumjs/tx](../README.md) / [transactionFactory](../modules/transactionfactory.md) / default - -# Class: default - -[transactionFactory](../modules/transactionfactory.md).default - -## Table of contents - -### Methods - -- [fromBlockBodyData](transactionfactory.default.md#fromblockbodydata) -- [fromSerializedData](transactionfactory.default.md#fromserializeddata) -- [fromTxData](transactionfactory.default.md#fromtxdata) -- [getTransactionClass](transactionfactory.default.md#gettransactionclass) - -## Methods - -### fromBlockBodyData - -▸ `Static` **fromBlockBodyData**(`data`, `txOptions?`): [TypedTransaction](../modules/types.md#typedtransaction) - -When decoding a BlockBody, in the transactions field, a field is either: -A Buffer (a TypedTransaction - encoded as TransactionType || rlp(TransactionPayload)) -A Buffer[] (Legacy Transaction) -This method returns the right transaction. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | `Buffer` \| `Buffer`[] | A Buffer or Buffer[] | -| `txOptions` | [TxOptions](../interfaces/types.txoptions.md) | The transaction options | - -#### Returns - -[TypedTransaction](../modules/types.md#typedtransaction) - -#### Defined in - -[transactionFactory.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L83) - -___ - -### fromSerializedData - -▸ `Static` **fromSerializedData**(`data`, `txOptions?`): [TypedTransaction](../modules/types.md#typedtransaction) - -This method tries to decode serialized data. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | `Buffer` | The data Buffer | -| `txOptions` | [TxOptions](../interfaces/types.txoptions.md) | The transaction options | - -#### Returns - -[TypedTransaction](../modules/types.md#typedtransaction) - -#### Defined in - -[transactionFactory.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L49) - -___ - -### fromTxData - -▸ `Static` **fromTxData**(`txData`, `txOptions?`): [TypedTransaction](../modules/types.md#typedtransaction) - -Create a transaction from a `txData` object - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `txData` | [TxData](../modules/types.md#txdata) \| [AccessListEIP2930TxData](../interfaces/types.accesslisteip2930txdata.md) \| [FeeMarketEIP1559TxData](../interfaces/types.feemarketeip1559txdata.md) | The transaction data. The `type` field will determine which transaction type is returned (if undefined, creates a legacy transaction) | -| `txOptions` | [TxOptions](../interfaces/types.txoptions.md) | Options to pass on to the constructor of the transaction | - -#### Returns - -[TypedTransaction](../modules/types.md#typedtransaction) - -#### Defined in - -[transactionFactory.ts:22](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L22) - -___ - -### getTransactionClass - -▸ `Static` **getTransactionClass**(`transactionID?`, `common?`): typeof [default](eip1559transaction.default.md) \| typeof [default](eip2930transaction.default.md) \| typeof [default](legacytransaction.default.md) - -This helper method allows one to retrieve the class which matches the transactionID -If transactionID is undefined, returns the legacy transaction class. - -**`deprecated`** - This method is deprecated and will be removed on the next major release - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `transactionID` | `number` | 0 | | -| `common?` | `default` | `undefined` | This option is not used | - -#### Returns - -typeof [default](eip1559transaction.default.md) \| typeof [default](eip2930transaction.default.md) \| typeof [default](legacytransaction.default.md) - -#### Defined in - -[transactionFactory.ts:102](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/transactionFactory.ts#L102) diff --git a/packages/tx/docs/enums/types.capabilities.md b/packages/tx/docs/enums/Capability.md similarity index 65% rename from packages/tx/docs/enums/types.capabilities.md rename to packages/tx/docs/enums/Capability.md index 1499b178f5..182318fe31 100644 --- a/packages/tx/docs/enums/types.capabilities.md +++ b/packages/tx/docs/enums/Capability.md @@ -1,26 +1,24 @@ -[@ethereumjs/tx](../README.md) / [types](../modules/types.md) / Capabilities +[@ethereumjs/tx](../README.md) / Capability -# Enumeration: Capabilities +# Enumeration: Capability -[types](../modules/types.md).Capabilities - -Can be used in conjunction with {@link Transaction.supports} +Can be used in conjunction with [Transaction.supports](../classes/Transaction.md#supports) to query on tx capabilities ## Table of contents ### Enumeration members -- [EIP1559FeeMarket](types.capabilities.md#eip1559feemarket) -- [EIP155ReplayProtection](types.capabilities.md#eip155replayprotection) -- [EIP2718TypedTransaction](types.capabilities.md#eip2718typedtransaction) -- [EIP2930AccessLists](types.capabilities.md#eip2930accesslists) +- [EIP1559FeeMarket](Capability.md#eip1559feemarket) +- [EIP155ReplayProtection](Capability.md#eip155replayprotection) +- [EIP2718TypedTransaction](Capability.md#eip2718typedtransaction) +- [EIP2930AccessLists](Capability.md#eip2930accesslists) ## Enumeration members ### EIP1559FeeMarket -• **EIP1559FeeMarket** = 1559 +• **EIP1559FeeMarket** = `1559` Tx supports EIP-1559 gas fee market mechansim See: [1559](https://eips.ethereum.org/EIPS/eip-1559) Fee Market EIP @@ -33,7 +31,7 @@ ___ ### EIP155ReplayProtection -• **EIP155ReplayProtection** = 155 +• **EIP155ReplayProtection** = `155` Tx supports EIP-155 replay protection See: [155](https://eips.ethereum.org/EIPS/eip-155) Replay Attack Protection EIP @@ -46,7 +44,7 @@ ___ ### EIP2718TypedTransaction -• **EIP2718TypedTransaction** = 2718 +• **EIP2718TypedTransaction** = `2718` Tx is a typed transaction as defined in EIP-2718 See: [2718](https://eips.ethereum.org/EIPS/eip-2718) Transaction Type EIP @@ -59,7 +57,7 @@ ___ ### EIP2930AccessLists -• **EIP2930AccessLists** = 2930 +• **EIP2930AccessLists** = `2930` Tx supports access list generation as defined in EIP-2930 See: [2930](https://eips.ethereum.org/EIPS/eip-2930) Access Lists EIP diff --git a/packages/tx/docs/interfaces/AccessListEIP2930TxData.md b/packages/tx/docs/interfaces/AccessListEIP2930TxData.md new file mode 100644 index 0000000000..2a1278a6fd --- /dev/null +++ b/packages/tx/docs/interfaces/AccessListEIP2930TxData.md @@ -0,0 +1,214 @@ +[@ethereumjs/tx](../README.md) / AccessListEIP2930TxData + +# Interface: AccessListEIP2930TxData + +[AccessListEIP2930Transaction](../classes/AccessListEIP2930Transaction.md) data. + +## Hierarchy + +- [`TxData`](../README.md#txdata) + + ↳ **`AccessListEIP2930TxData`** + + ↳↳ [`FeeMarketEIP1559TxData`](FeeMarketEIP1559TxData.md) + +## Table of contents + +### Properties + +- [accessList](AccessListEIP2930TxData.md#accesslist) +- [chainId](AccessListEIP2930TxData.md#chainid) +- [data](AccessListEIP2930TxData.md#data) +- [gasLimit](AccessListEIP2930TxData.md#gaslimit) +- [gasPrice](AccessListEIP2930TxData.md#gasprice) +- [nonce](AccessListEIP2930TxData.md#nonce) +- [r](AccessListEIP2930TxData.md#r) +- [s](AccessListEIP2930TxData.md#s) +- [to](AccessListEIP2930TxData.md#to) +- [type](AccessListEIP2930TxData.md#type) +- [v](AccessListEIP2930TxData.md#v) +- [value](AccessListEIP2930TxData.md#value) + +## Properties + +### accessList + +• `Optional` **accessList**: [`AccessListBuffer`](../README.md#accesslistbuffer) \| [`AccessList`](../README.md#accesslist) + +The access list which contains the addresses/storage slots which the transaction wishes to access + +#### Defined in + +[types.ts:178](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L178) + +___ + +### chainId + +• `Optional` **chainId**: `BNLike` + +The transaction's chain ID + +#### Defined in + +[types.ts:173](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L173) + +___ + +### data + +• `Optional` **data**: `BufferLike` + +This will contain the data of the message or the init of a contract. + +#### Inherited from + +TxData.data + +#### Defined in + +[types.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L142) + +___ + +### gasLimit + +• `Optional` **gasLimit**: `BNLike` + +The transaction's gas limit. + +#### Inherited from + +TxData.gasLimit + +#### Defined in + +[types.ts:127](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L127) + +___ + +### gasPrice + +• `Optional` **gasPrice**: `BNLike` + +The transaction's gas price. + +#### Inherited from + +TxData.gasPrice + +#### Defined in + +[types.ts:122](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L122) + +___ + +### nonce + +• `Optional` **nonce**: `BNLike` + +The transaction's nonce. + +#### Inherited from + +TxData.nonce + +#### Defined in + +[types.ts:117](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L117) + +___ + +### r + +• `Optional` **r**: `BNLike` + +EC signature parameter. + +#### Inherited from + +TxData.r + +#### Defined in + +[types.ts:152](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L152) + +___ + +### s + +• `Optional` **s**: `BNLike` + +EC signature parameter. + +#### Inherited from + +TxData.s + +#### Defined in + +[types.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L157) + +___ + +### to + +• `Optional` **to**: `AddressLike` + +The transaction's the address is sent to. + +#### Inherited from + +TxData.to + +#### Defined in + +[types.ts:132](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L132) + +___ + +### type + +• `Optional` **type**: `BNLike` + +The transaction type + +#### Inherited from + +TxData.type + +#### Defined in + +[types.ts:163](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L163) + +___ + +### v + +• `Optional` **v**: `BNLike` + +EC recovery ID. + +#### Inherited from + +TxData.v + +#### Defined in + +[types.ts:147](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L147) + +___ + +### value + +• `Optional` **value**: `BNLike` + +The amount of Ether sent. + +#### Inherited from + +TxData.value + +#### Defined in + +[types.ts:137](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L137) diff --git a/packages/tx/docs/interfaces/FeeMarketEIP1559TxData.md b/packages/tx/docs/interfaces/FeeMarketEIP1559TxData.md new file mode 100644 index 0000000000..0bc0af7e4e --- /dev/null +++ b/packages/tx/docs/interfaces/FeeMarketEIP1559TxData.md @@ -0,0 +1,247 @@ +[@ethereumjs/tx](../README.md) / FeeMarketEIP1559TxData + +# Interface: FeeMarketEIP1559TxData + +[FeeMarketEIP1559Transaction](../classes/FeeMarketEIP1559Transaction.md) data. + +## Hierarchy + +- [`AccessListEIP2930TxData`](AccessListEIP2930TxData.md) + + ↳ **`FeeMarketEIP1559TxData`** + +## Table of contents + +### Properties + +- [accessList](FeeMarketEIP1559TxData.md#accesslist) +- [chainId](FeeMarketEIP1559TxData.md#chainid) +- [data](FeeMarketEIP1559TxData.md#data) +- [gasLimit](FeeMarketEIP1559TxData.md#gaslimit) +- [gasPrice](FeeMarketEIP1559TxData.md#gasprice) +- [maxFeePerGas](FeeMarketEIP1559TxData.md#maxfeepergas) +- [maxPriorityFeePerGas](FeeMarketEIP1559TxData.md#maxpriorityfeepergas) +- [nonce](FeeMarketEIP1559TxData.md#nonce) +- [r](FeeMarketEIP1559TxData.md#r) +- [s](FeeMarketEIP1559TxData.md#s) +- [to](FeeMarketEIP1559TxData.md#to) +- [type](FeeMarketEIP1559TxData.md#type) +- [v](FeeMarketEIP1559TxData.md#v) +- [value](FeeMarketEIP1559TxData.md#value) + +## Properties + +### accessList + +• `Optional` **accessList**: [`AccessListBuffer`](../README.md#accesslistbuffer) \| [`AccessList`](../README.md#accesslist) + +The access list which contains the addresses/storage slots which the transaction wishes to access + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[accessList](AccessListEIP2930TxData.md#accesslist) + +#### Defined in + +[types.ts:178](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L178) + +___ + +### chainId + +• `Optional` **chainId**: `BNLike` + +The transaction's chain ID + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[chainId](AccessListEIP2930TxData.md#chainid) + +#### Defined in + +[types.ts:173](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L173) + +___ + +### data + +• `Optional` **data**: `BufferLike` + +This will contain the data of the message or the init of a contract. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[data](AccessListEIP2930TxData.md#data) + +#### Defined in + +[types.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L142) + +___ + +### gasLimit + +• `Optional` **gasLimit**: `BNLike` + +The transaction's gas limit. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[gasLimit](AccessListEIP2930TxData.md#gaslimit) + +#### Defined in + +[types.ts:127](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L127) + +___ + +### gasPrice + +• `Optional` **gasPrice**: `undefined` + +The transaction's gas price, inherited from [Transaction](../classes/Transaction.md). This property is not used for EIP1559 +transactions and should always be undefined for this specific transaction type. + +#### Overrides + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[gasPrice](AccessListEIP2930TxData.md#gasprice) + +#### Defined in + +[types.ts:189](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L189) + +___ + +### maxFeePerGas + +• `Optional` **maxFeePerGas**: `BNLike` + +The maximum total fee + +#### Defined in + +[types.ts:197](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L197) + +___ + +### maxPriorityFeePerGas + +• `Optional` **maxPriorityFeePerGas**: `BNLike` + +The maximum inclusion fee per gas (this fee is given to the miner) + +#### Defined in + +[types.ts:193](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L193) + +___ + +### nonce + +• `Optional` **nonce**: `BNLike` + +The transaction's nonce. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[nonce](AccessListEIP2930TxData.md#nonce) + +#### Defined in + +[types.ts:117](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L117) + +___ + +### r + +• `Optional` **r**: `BNLike` + +EC signature parameter. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[r](AccessListEIP2930TxData.md#r) + +#### Defined in + +[types.ts:152](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L152) + +___ + +### s + +• `Optional` **s**: `BNLike` + +EC signature parameter. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[s](AccessListEIP2930TxData.md#s) + +#### Defined in + +[types.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L157) + +___ + +### to + +• `Optional` **to**: `AddressLike` + +The transaction's the address is sent to. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[to](AccessListEIP2930TxData.md#to) + +#### Defined in + +[types.ts:132](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L132) + +___ + +### type + +• `Optional` **type**: `BNLike` + +The transaction type + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[type](AccessListEIP2930TxData.md#type) + +#### Defined in + +[types.ts:163](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L163) + +___ + +### v + +• `Optional` **v**: `BNLike` + +EC recovery ID. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[v](AccessListEIP2930TxData.md#v) + +#### Defined in + +[types.ts:147](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L147) + +___ + +### value + +• `Optional` **value**: `BNLike` + +The amount of Ether sent. + +#### Inherited from + +[AccessListEIP2930TxData](AccessListEIP2930TxData.md).[value](AccessListEIP2930TxData.md#value) + +#### Defined in + +[types.ts:137](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L137) diff --git a/packages/tx/docs/interfaces/types.jsontx.md b/packages/tx/docs/interfaces/JsonTx.md similarity index 76% rename from packages/tx/docs/interfaces/types.jsontx.md rename to packages/tx/docs/interfaces/JsonTx.md index 23d5cc3db3..97460dda12 100644 --- a/packages/tx/docs/interfaces/types.jsontx.md +++ b/packages/tx/docs/interfaces/JsonTx.md @@ -1,9 +1,7 @@ -[@ethereumjs/tx](../README.md) / [types](../modules/types.md) / JsonTx +[@ethereumjs/tx](../README.md) / JsonTx # Interface: JsonTx -[types](../modules/types.md).JsonTx - Generic interface for all tx types with a JSON representation of a transaction. @@ -15,20 +13,20 @@ and not all the values are present on all tx types ### Properties -- [accessList](types.jsontx.md#accesslist) -- [chainId](types.jsontx.md#chainid) -- [data](types.jsontx.md#data) -- [gasLimit](types.jsontx.md#gaslimit) -- [gasPrice](types.jsontx.md#gasprice) -- [maxFeePerGas](types.jsontx.md#maxfeepergas) -- [maxPriorityFeePerGas](types.jsontx.md#maxpriorityfeepergas) -- [nonce](types.jsontx.md#nonce) -- [r](types.jsontx.md#r) -- [s](types.jsontx.md#s) -- [to](types.jsontx.md#to) -- [type](types.jsontx.md#type) -- [v](types.jsontx.md#v) -- [value](types.jsontx.md#value) +- [accessList](JsonTx.md#accesslist) +- [chainId](JsonTx.md#chainid) +- [data](JsonTx.md#data) +- [gasLimit](JsonTx.md#gaslimit) +- [gasPrice](JsonTx.md#gasprice) +- [maxFeePerGas](JsonTx.md#maxfeepergas) +- [maxPriorityFeePerGas](JsonTx.md#maxpriorityfeepergas) +- [nonce](JsonTx.md#nonce) +- [r](JsonTx.md#r) +- [s](JsonTx.md#s) +- [to](JsonTx.md#to) +- [type](JsonTx.md#type) +- [v](JsonTx.md#v) +- [value](JsonTx.md#value) ## Properties @@ -38,7 +36,7 @@ and not all the values are present on all tx types #### Defined in -[types.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L259) +[types.ts:261](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L261) ___ @@ -48,7 +46,7 @@ ___ #### Defined in -[types.ts:258](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L258) +[types.ts:260](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L260) ___ @@ -58,7 +56,7 @@ ___ #### Defined in -[types.ts:253](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L253) +[types.ts:255](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L255) ___ @@ -68,7 +66,7 @@ ___ #### Defined in -[types.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L251) +[types.ts:253](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L253) ___ @@ -78,7 +76,7 @@ ___ #### Defined in -[types.ts:250](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L250) +[types.ts:252](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L252) ___ @@ -88,7 +86,7 @@ ___ #### Defined in -[types.ts:262](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L262) +[types.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L264) ___ @@ -98,7 +96,7 @@ ___ #### Defined in -[types.ts:261](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L261) +[types.ts:263](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L263) ___ @@ -108,7 +106,7 @@ ___ #### Defined in -[types.ts:249](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L249) +[types.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L251) ___ @@ -118,7 +116,7 @@ ___ #### Defined in -[types.ts:255](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L255) +[types.ts:257](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L257) ___ @@ -128,7 +126,7 @@ ___ #### Defined in -[types.ts:256](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L256) +[types.ts:258](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L258) ___ @@ -138,7 +136,7 @@ ___ #### Defined in -[types.ts:252](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L252) +[types.ts:254](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L254) ___ @@ -148,7 +146,7 @@ ___ #### Defined in -[types.ts:260](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L260) +[types.ts:262](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L262) ___ @@ -158,7 +156,7 @@ ___ #### Defined in -[types.ts:254](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L254) +[types.ts:256](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L256) ___ @@ -168,4 +166,4 @@ ___ #### Defined in -[types.ts:257](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L257) +[types.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L259) diff --git a/packages/tx/docs/interfaces/types.txoptions.md b/packages/tx/docs/interfaces/TxOptions.md similarity index 73% rename from packages/tx/docs/interfaces/types.txoptions.md rename to packages/tx/docs/interfaces/TxOptions.md index f440c7c9c2..a12d2eacd5 100644 --- a/packages/tx/docs/interfaces/types.txoptions.md +++ b/packages/tx/docs/interfaces/TxOptions.md @@ -1,17 +1,15 @@ -[@ethereumjs/tx](../README.md) / [types](../modules/types.md) / TxOptions +[@ethereumjs/tx](../README.md) / TxOptions # Interface: TxOptions -[types](../modules/types.md).TxOptions - -The options for initializing a [Transaction](../modules/index.md#transaction). +The options for initializing a [Transaction](../classes/Transaction.md). ## Table of contents ### Properties -- [common](types.txoptions.md#common) -- [freeze](types.txoptions.md#freeze) +- [common](TxOptions.md#common) +- [freeze](TxOptions.md#freeze) ## Properties @@ -40,6 +38,7 @@ ___ A transaction object by default gets frozen along initialization. This gives you strong additional security guarantees on the consistency of the tx parameters. +It also enables tx hash caching when the `hash()` method is called multiple times. If you need to deactivate the tx freeze - e.g. because you want to subclass tx and add aditional properties - it is strongly encouraged that you do the freeze yourself @@ -49,4 +48,4 @@ Default: true #### Defined in -[types.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L62) +[types.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L63) diff --git a/packages/tx/docs/interfaces/types.accesslisteip2930txdata.md b/packages/tx/docs/interfaces/types.accesslisteip2930txdata.md deleted file mode 100644 index 6d23be6ef7..0000000000 --- a/packages/tx/docs/interfaces/types.accesslisteip2930txdata.md +++ /dev/null @@ -1,216 +0,0 @@ -[@ethereumjs/tx](../README.md) / [types](../modules/types.md) / AccessListEIP2930TxData - -# Interface: AccessListEIP2930TxData - -[types](../modules/types.md).AccessListEIP2930TxData - -[AccessListEIP2930Transaction](../modules/index.md#accesslisteip2930transaction) data. - -## Hierarchy - -- [TxData](../modules/types.md#txdata) - - ↳ **AccessListEIP2930TxData** - - ↳↳ [FeeMarketEIP1559TxData](types.feemarketeip1559txdata.md) - -## Table of contents - -### Properties - -- [accessList](types.accesslisteip2930txdata.md#accesslist) -- [chainId](types.accesslisteip2930txdata.md#chainid) -- [data](types.accesslisteip2930txdata.md#data) -- [gasLimit](types.accesslisteip2930txdata.md#gaslimit) -- [gasPrice](types.accesslisteip2930txdata.md#gasprice) -- [nonce](types.accesslisteip2930txdata.md#nonce) -- [r](types.accesslisteip2930txdata.md#r) -- [s](types.accesslisteip2930txdata.md#s) -- [to](types.accesslisteip2930txdata.md#to) -- [type](types.accesslisteip2930txdata.md#type) -- [v](types.accesslisteip2930txdata.md#v) -- [value](types.accesslisteip2930txdata.md#value) - -## Properties - -### accessList - -• `Optional` **accessList**: [AccessListBuffer](../modules/types.md#accesslistbuffer) \| [AccessList](../modules/types.md#accesslist) - -The access list which contains the addresses/storage slots which the transaction wishes to access - -#### Defined in - -[types.ts:177](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L177) - -___ - -### chainId - -• `Optional` **chainId**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction's chain ID - -#### Defined in - -[types.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L172) - -___ - -### data - -• `Optional` **data**: `string` \| `number` \| `BN` \| `Buffer` \| `number`[] \| `Uint8Array` \| `TransformableToBuffer` - -This will contain the data of the message or the init of a contract. - -#### Inherited from - -TxData.data - -#### Defined in - -[types.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L141) - -___ - -### gasLimit - -• `Optional` **gasLimit**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction's gas limit. - -#### Inherited from - -TxData.gasLimit - -#### Defined in - -[types.ts:126](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L126) - -___ - -### gasPrice - -• `Optional` **gasPrice**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction's gas price. - -#### Inherited from - -TxData.gasPrice - -#### Defined in - -[types.ts:121](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L121) - -___ - -### nonce - -• `Optional` **nonce**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction's nonce. - -#### Inherited from - -TxData.nonce - -#### Defined in - -[types.ts:116](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L116) - -___ - -### r - -• `Optional` **r**: `string` \| `number` \| `BN` \| `Buffer` - -EC signature parameter. - -#### Inherited from - -TxData.r - -#### Defined in - -[types.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L151) - -___ - -### s - -• `Optional` **s**: `string` \| `number` \| `BN` \| `Buffer` - -EC signature parameter. - -#### Inherited from - -TxData.s - -#### Defined in - -[types.ts:156](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L156) - -___ - -### to - -• `Optional` **to**: `string` \| `Address` \| `Buffer` - -The transaction's the address is sent to. - -#### Inherited from - -TxData.to - -#### Defined in - -[types.ts:131](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L131) - -___ - -### type - -• `Optional` **type**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction type - -#### Inherited from - -TxData.type - -#### Defined in - -[types.ts:162](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L162) - -___ - -### v - -• `Optional` **v**: `string` \| `number` \| `BN` \| `Buffer` - -EC recovery ID. - -#### Inherited from - -TxData.v - -#### Defined in - -[types.ts:146](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L146) - -___ - -### value - -• `Optional` **value**: `string` \| `number` \| `BN` \| `Buffer` - -The amount of Ether sent. - -#### Inherited from - -TxData.value - -#### Defined in - -[types.ts:136](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L136) diff --git a/packages/tx/docs/interfaces/types.feemarketeip1559txdata.md b/packages/tx/docs/interfaces/types.feemarketeip1559txdata.md deleted file mode 100644 index 53f76eeb83..0000000000 --- a/packages/tx/docs/interfaces/types.feemarketeip1559txdata.md +++ /dev/null @@ -1,248 +0,0 @@ -[@ethereumjs/tx](../README.md) / [types](../modules/types.md) / FeeMarketEIP1559TxData - -# Interface: FeeMarketEIP1559TxData - -[types](../modules/types.md).FeeMarketEIP1559TxData - -[FeeMarketEIP1559Transaction](../modules/index.md#feemarketeip1559transaction) data. - -## Hierarchy - -- [AccessListEIP2930TxData](types.accesslisteip2930txdata.md) - - ↳ **FeeMarketEIP1559TxData** - -## Table of contents - -### Properties - -- [accessList](types.feemarketeip1559txdata.md#accesslist) -- [chainId](types.feemarketeip1559txdata.md#chainid) -- [data](types.feemarketeip1559txdata.md#data) -- [gasLimit](types.feemarketeip1559txdata.md#gaslimit) -- [gasPrice](types.feemarketeip1559txdata.md#gasprice) -- [maxFeePerGas](types.feemarketeip1559txdata.md#maxfeepergas) -- [maxPriorityFeePerGas](types.feemarketeip1559txdata.md#maxpriorityfeepergas) -- [nonce](types.feemarketeip1559txdata.md#nonce) -- [r](types.feemarketeip1559txdata.md#r) -- [s](types.feemarketeip1559txdata.md#s) -- [to](types.feemarketeip1559txdata.md#to) -- [type](types.feemarketeip1559txdata.md#type) -- [v](types.feemarketeip1559txdata.md#v) -- [value](types.feemarketeip1559txdata.md#value) - -## Properties - -### accessList - -• `Optional` **accessList**: [AccessListBuffer](../modules/types.md#accesslistbuffer) \| [AccessList](../modules/types.md#accesslist) - -The access list which contains the addresses/storage slots which the transaction wishes to access - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[accessList](types.accesslisteip2930txdata.md#accesslist) - -#### Defined in - -[types.ts:177](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L177) - -___ - -### chainId - -• `Optional` **chainId**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction's chain ID - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[chainId](types.accesslisteip2930txdata.md#chainid) - -#### Defined in - -[types.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L172) - -___ - -### data - -• `Optional` **data**: `string` \| `number` \| `BN` \| `Buffer` \| `number`[] \| `Uint8Array` \| `TransformableToBuffer` - -This will contain the data of the message or the init of a contract. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[data](types.accesslisteip2930txdata.md#data) - -#### Defined in - -[types.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L141) - -___ - -### gasLimit - -• `Optional` **gasLimit**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction's gas limit. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[gasLimit](types.accesslisteip2930txdata.md#gaslimit) - -#### Defined in - -[types.ts:126](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L126) - -___ - -### gasPrice - -• `Optional` **gasPrice**: `undefined` - -The transaction's gas price. - -#### Overrides - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[gasPrice](types.accesslisteip2930txdata.md#gasprice) - -#### Defined in - -[types.ts:187](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L187) - -___ - -### maxFeePerGas - -• `Optional` **maxFeePerGas**: `string` \| `number` \| `BN` \| `Buffer` - -The maximum total fee - -#### Defined in - -[types.ts:195](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L195) - -___ - -### maxPriorityFeePerGas - -• `Optional` **maxPriorityFeePerGas**: `string` \| `number` \| `BN` \| `Buffer` - -The maximum inclusion fee per gas (this fee is given to the miner) - -#### Defined in - -[types.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L191) - -___ - -### nonce - -• `Optional` **nonce**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction's nonce. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[nonce](types.accesslisteip2930txdata.md#nonce) - -#### Defined in - -[types.ts:116](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L116) - -___ - -### r - -• `Optional` **r**: `string` \| `number` \| `BN` \| `Buffer` - -EC signature parameter. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[r](types.accesslisteip2930txdata.md#r) - -#### Defined in - -[types.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L151) - -___ - -### s - -• `Optional` **s**: `string` \| `number` \| `BN` \| `Buffer` - -EC signature parameter. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[s](types.accesslisteip2930txdata.md#s) - -#### Defined in - -[types.ts:156](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L156) - -___ - -### to - -• `Optional` **to**: `string` \| `Address` \| `Buffer` - -The transaction's the address is sent to. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[to](types.accesslisteip2930txdata.md#to) - -#### Defined in - -[types.ts:131](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L131) - -___ - -### type - -• `Optional` **type**: `string` \| `number` \| `BN` \| `Buffer` - -The transaction type - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[type](types.accesslisteip2930txdata.md#type) - -#### Defined in - -[types.ts:162](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L162) - -___ - -### v - -• `Optional` **v**: `string` \| `number` \| `BN` \| `Buffer` - -EC recovery ID. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[v](types.accesslisteip2930txdata.md#v) - -#### Defined in - -[types.ts:146](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L146) - -___ - -### value - -• `Optional` **value**: `string` \| `number` \| `BN` \| `Buffer` - -The amount of Ether sent. - -#### Inherited from - -[AccessListEIP2930TxData](types.accesslisteip2930txdata.md).[value](types.accesslisteip2930txdata.md#value) - -#### Defined in - -[types.ts:136](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L136) diff --git a/packages/tx/docs/modules/basetransaction.md b/packages/tx/docs/modules/basetransaction.md deleted file mode 100644 index e1775ee9c3..0000000000 --- a/packages/tx/docs/modules/basetransaction.md +++ /dev/null @@ -1,9 +0,0 @@ -[@ethereumjs/tx](../README.md) / baseTransaction - -# Module: baseTransaction - -## Table of contents - -### Classes - -- [BaseTransaction](../classes/basetransaction.basetransaction-1.md) diff --git a/packages/tx/docs/modules/eip1559transaction.md b/packages/tx/docs/modules/eip1559transaction.md deleted file mode 100644 index 294053c029..0000000000 --- a/packages/tx/docs/modules/eip1559transaction.md +++ /dev/null @@ -1,9 +0,0 @@ -[@ethereumjs/tx](../README.md) / eip1559Transaction - -# Module: eip1559Transaction - -## Table of contents - -### Classes - -- [default](../classes/eip1559transaction.default.md) diff --git a/packages/tx/docs/modules/eip2930transaction.md b/packages/tx/docs/modules/eip2930transaction.md deleted file mode 100644 index 1967b9356e..0000000000 --- a/packages/tx/docs/modules/eip2930transaction.md +++ /dev/null @@ -1,9 +0,0 @@ -[@ethereumjs/tx](../README.md) / eip2930Transaction - -# Module: eip2930Transaction - -## Table of contents - -### Classes - -- [default](../classes/eip2930transaction.default.md) diff --git a/packages/tx/docs/modules/index.md b/packages/tx/docs/modules/index.md deleted file mode 100644 index a670e5fa63..0000000000 --- a/packages/tx/docs/modules/index.md +++ /dev/null @@ -1,155 +0,0 @@ -[@ethereumjs/tx](../README.md) / index - -# Module: index - -## Table of contents - -### References - -- [AccessList](index.md#accesslist) -- [AccessListBuffer](index.md#accesslistbuffer) -- [AccessListBufferItem](index.md#accesslistbufferitem) -- [AccessListEIP2930Transaction](index.md#accesslisteip2930transaction) -- [AccessListEIP2930TxData](index.md#accesslisteip2930txdata) -- [AccessListEIP2930ValuesArray](index.md#accesslisteip2930valuesarray) -- [AccessListItem](index.md#accesslistitem) -- [Capabilities](index.md#capabilities) -- [FeeMarketEIP1559Transaction](index.md#feemarketeip1559transaction) -- [FeeMarketEIP1559TxData](index.md#feemarketeip1559txdata) -- [FeeMarketEIP1559ValuesArray](index.md#feemarketeip1559valuesarray) -- [JsonTx](index.md#jsontx) -- [N\_DIV\_2](index.md#n_div_2) -- [Transaction](index.md#transaction) -- [TransactionFactory](index.md#transactionfactory) -- [TxData](index.md#txdata) -- [TxOptions](index.md#txoptions) -- [TxValuesArray](index.md#txvaluesarray) -- [TypedTransaction](index.md#typedtransaction) -- [isAccessList](index.md#isaccesslist) -- [isAccessListBuffer](index.md#isaccesslistbuffer) - -## References - -### AccessList - -Re-exports: [AccessList](types.md#accesslist) - -___ - -### AccessListBuffer - -Re-exports: [AccessListBuffer](types.md#accesslistbuffer) - -___ - -### AccessListBufferItem - -Re-exports: [AccessListBufferItem](types.md#accesslistbufferitem) - -___ - -### AccessListEIP2930Transaction - -Renames and exports: [default](../classes/eip2930transaction.default.md) - -___ - -### AccessListEIP2930TxData - -Re-exports: [AccessListEIP2930TxData](../interfaces/types.accesslisteip2930txdata.md) - -___ - -### AccessListEIP2930ValuesArray - -Re-exports: [AccessListEIP2930ValuesArray](types.md#accesslisteip2930valuesarray) - -___ - -### AccessListItem - -Re-exports: [AccessListItem](types.md#accesslistitem) - -___ - -### Capabilities - -Re-exports: [Capabilities](../enums/types.capabilities.md) - -___ - -### FeeMarketEIP1559Transaction - -Renames and exports: [default](../classes/eip1559transaction.default.md) - -___ - -### FeeMarketEIP1559TxData - -Re-exports: [FeeMarketEIP1559TxData](../interfaces/types.feemarketeip1559txdata.md) - -___ - -### FeeMarketEIP1559ValuesArray - -Re-exports: [FeeMarketEIP1559ValuesArray](types.md#feemarketeip1559valuesarray) - -___ - -### JsonTx - -Re-exports: [JsonTx](../interfaces/types.jsontx.md) - -___ - -### N\_DIV\_2 - -Re-exports: [N\_DIV\_2](types.md#n_div_2) - -___ - -### Transaction - -Renames and exports: [default](../classes/legacytransaction.default.md) - -___ - -### TransactionFactory - -Renames and exports: [default](../classes/transactionfactory.default.md) - -___ - -### TxData - -Re-exports: [TxData](types.md#txdata) - -___ - -### TxOptions - -Re-exports: [TxOptions](../interfaces/types.txoptions.md) - -___ - -### TxValuesArray - -Re-exports: [TxValuesArray](types.md#txvaluesarray) - -___ - -### TypedTransaction - -Re-exports: [TypedTransaction](types.md#typedtransaction) - -___ - -### isAccessList - -Re-exports: [isAccessList](types.md#isaccesslist) - -___ - -### isAccessListBuffer - -Re-exports: [isAccessListBuffer](types.md#isaccesslistbuffer) diff --git a/packages/tx/docs/modules/legacytransaction.md b/packages/tx/docs/modules/legacytransaction.md deleted file mode 100644 index 37b7812942..0000000000 --- a/packages/tx/docs/modules/legacytransaction.md +++ /dev/null @@ -1,9 +0,0 @@ -[@ethereumjs/tx](../README.md) / legacyTransaction - -# Module: legacyTransaction - -## Table of contents - -### Classes - -- [default](../classes/legacytransaction.default.md) diff --git a/packages/tx/docs/modules/transactionfactory.md b/packages/tx/docs/modules/transactionfactory.md deleted file mode 100644 index 6908813a5d..0000000000 --- a/packages/tx/docs/modules/transactionfactory.md +++ /dev/null @@ -1,9 +0,0 @@ -[@ethereumjs/tx](../README.md) / transactionFactory - -# Module: transactionFactory - -## Table of contents - -### Classes - -- [default](../classes/transactionfactory.default.md) diff --git a/packages/tx/docs/modules/types.md b/packages/tx/docs/modules/types.md deleted file mode 100644 index 0bb09f6f9e..0000000000 --- a/packages/tx/docs/modules/types.md +++ /dev/null @@ -1,214 +0,0 @@ -[@ethereumjs/tx](../README.md) / types - -# Module: types - -## Table of contents - -### Enumerations - -- [Capabilities](../enums/types.capabilities.md) - -### Interfaces - -- [AccessListEIP2930TxData](../interfaces/types.accesslisteip2930txdata.md) -- [FeeMarketEIP1559TxData](../interfaces/types.feemarketeip1559txdata.md) -- [JsonTx](../interfaces/types.jsontx.md) -- [TxOptions](../interfaces/types.txoptions.md) - -### Type aliases - -- [AccessList](types.md#accesslist) -- [AccessListBuffer](types.md#accesslistbuffer) -- [AccessListBufferItem](types.md#accesslistbufferitem) -- [AccessListEIP2930ValuesArray](types.md#accesslisteip2930valuesarray) -- [AccessListItem](types.md#accesslistitem) -- [FeeMarketEIP1559ValuesArray](types.md#feemarketeip1559valuesarray) -- [TxData](types.md#txdata) -- [TxValuesArray](types.md#txvaluesarray) -- [TypedTransaction](types.md#typedtransaction) - -### Variables - -- [N\_DIV\_2](types.md#n_div_2) - -### Functions - -- [isAccessList](types.md#isaccesslist) -- [isAccessListBuffer](types.md#isaccesslistbuffer) - -## Type aliases - -### AccessList - -Ƭ **AccessList**: [AccessListItem](types.md#accesslistitem)[] - -#### Defined in - -[types.ts:79](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L79) - -___ - -### AccessListBuffer - -Ƭ **AccessListBuffer**: [AccessListBufferItem](types.md#accesslistbufferitem)[] - -#### Defined in - -[types.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L78) - -___ - -### AccessListBufferItem - -Ƭ **AccessListBufferItem**: [`Buffer`, `Buffer`[]] - -#### Defined in - -[types.ts:77](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L77) - -___ - -### AccessListEIP2930ValuesArray - -Ƭ **AccessListEIP2930ValuesArray**: [`Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, [AccessListBuffer](types.md#accesslistbuffer), Buffer?, Buffer?, Buffer?] - -Buffer values array for an [AccessListEIP2930Transaction](index.md#accesslisteip2930transaction) - -#### Defined in - -[types.ts:206](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L206) - -___ - -### AccessListItem - -Ƭ **AccessListItem**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `address` | `PrefixedHexString` | -| `storageKeys` | `PrefixedHexString`[] | - -#### Defined in - -[types.ts:69](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L69) - -___ - -### FeeMarketEIP1559ValuesArray - -Ƭ **FeeMarketEIP1559ValuesArray**: [`Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, `Buffer`, [AccessListBuffer](types.md#accesslistbuffer), Buffer?, Buffer?, Buffer?] - -Buffer values array for a [FeeMarketEIP1559Transaction](index.md#feemarketeip1559transaction) - -#### Defined in - -[types.ts:223](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L223) - -___ - -### TxData - -Ƭ **TxData**: `Object` - -Legacy [Transaction](index.md#transaction) Data - -#### Type declaration - -| Name | Type | Description | -| :------ | :------ | :------ | -| `data?` | `BufferLike` | This will contain the data of the message or the init of a contract. | -| `gasLimit?` | `BNLike` | The transaction's gas limit. | -| `gasPrice?` | `BNLike` | The transaction's gas price. | -| `nonce?` | `BNLike` | The transaction's nonce. | -| `r?` | `BNLike` | EC signature parameter. | -| `s?` | `BNLike` | EC signature parameter. | -| `to?` | `AddressLike` | The transaction's the address is sent to. | -| `type?` | `BNLike` | The transaction type | -| `v?` | `BNLike` | EC recovery ID. | -| `value?` | `BNLike` | The amount of Ether sent. | - -#### Defined in - -[types.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L112) - -___ - -### TxValuesArray - -Ƭ **TxValuesArray**: `Buffer`[] - -Buffer values array for a legacy [Transaction](index.md#transaction) - -#### Defined in - -[types.ts:201](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L201) - -___ - -### TypedTransaction - -Ƭ **TypedTransaction**: [default](../classes/legacytransaction.default.md) \| [default](../classes/eip2930transaction.default.md) \| [default](../classes/eip1559transaction.default.md) - -Encompassing type for all transaction types. - -Note that this also includes legacy txs which are -referenced as [Transaction](index.md#transaction) for compatibility reasons. - -#### Defined in - -[types.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L104) - -## Variables - -### N\_DIV\_2 - -• `Const` **N\_DIV\_2**: `BN` - -A const defining secp256k1n/2 - -#### Defined in - -[types.ts:268](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L268) - -## Functions - -### isAccessList - -▸ **isAccessList**(`input`): input is AccessList - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `input` | [AccessListBuffer](types.md#accesslistbuffer) \| [AccessList](types.md#accesslist) | - -#### Returns - -input is AccessList - -#### Defined in - -[types.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L94) - -___ - -### isAccessListBuffer - -▸ **isAccessListBuffer**(`input`): input is AccessListBuffer - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `input` | [AccessListBuffer](types.md#accesslistbuffer) \| [AccessList](types.md#accesslist) | - -#### Returns - -input is AccessListBuffer - -#### Defined in - -[types.ts:81](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/types.ts#L81) diff --git a/packages/tx/package.json b/packages/tx/package.json index 7a262004fe..5e9627ea9e 100644 --- a/packages/tx/package.json +++ b/packages/tx/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/tx", - "version": "3.3.0", + "version": "3.3.1", "description": "A simple module for creating, manipulating and signing Ethereum transactions", "license": "MPL-2.0", "author": "mjbecze ", @@ -20,7 +20,7 @@ "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "coverage": "../../config/cli/coverage.sh", "docs:build": "typedoc --options typedoc.js", @@ -34,13 +34,13 @@ "test:browser": "karma start karma.conf.js" }, "dependencies": { - "@ethereumjs/common": "^2.4.0", - "ethereumjs-util": "^7.1.0" + "@ethereumjs/common": "^2.5.0", + "ethereumjs-util": "^7.1.1" }, "devDependencies": { "@types/minimist": "^1.2.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", @@ -51,8 +51,8 @@ "node-dir": "^0.1.16", "nyc": "^14.0.0", "prettier": "^2.0.5", - "tape": "^4.10.1", - "typedoc": "^0.21.5", + "tape": "^5.3.1", + "typedoc": "^0.22.4", "ts-node": "^10.2.1", "typescript": "^4.4.2" }, diff --git a/packages/tx/src/eip1559Transaction.ts b/packages/tx/src/eip1559Transaction.ts index 2e03dfbd4b..4828ae2b3d 100644 --- a/packages/tx/src/eip1559Transaction.ts +++ b/packages/tx/src/eip1559Transaction.ts @@ -288,7 +288,7 @@ export default class FeeMarketEIP1559Transaction extends BaseTransaction [1, 3] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `any`[] | +| `key` | `string` | +| `allowEmpty?` | `boolean` | + +#### Returns + +`any`[] + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L63) + +___ + +### hashPersonalMessage + +▸ `Const` **hashPersonalMessage**(`message`): `Buffer` + +Returns the keccak-256 hash of `message`, prefixed with the header used by the `eth_sign` RPC call. +The output of this function can be fed into `ecsign` to produce the same signature as the `eth_sign` +call for a given `message`, or fed to `ecrecover` along with a signature to recover the public key +used to produce the signature. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `message` | `Buffer` | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/signature.ts:196](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L196) + +___ + +### importPublic + +▸ `Const` **importPublic**(`publicKey`): `Buffer` + +Converts a public key to the Ethereum format. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `publicKey` | `Buffer` | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/account.ts:293](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L293) + +___ + +### intToBuffer + +▸ **intToBuffer**(`i`): `Buffer` + +**`description`** Converts an `Number` to a `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `i` | `number` | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L25) + +___ + +### intToHex + +▸ **intToHex**(`i`): `string` + +**`description`** Converts a `Number` into a hex `String` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `i` | `number` | + +#### Returns + +`string` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L20) + +___ + +### isHexPrefixed + +▸ **isHexPrefixed**(`str`): `boolean` + +**`description`** Returns a `Boolean` on whether or not the a `String` starts with '0x' + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `str` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:5](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L5) + +___ + +### isHexString + +▸ **isHexString**(`value`, `length?`): `boolean` + +**`description`** check if string is hex string of specific length + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `string` | +| `length?` | `number` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L68) + +___ + +### isValidAddress + +▸ `Const` **isValidAddress**(`hexAddress`): `boolean` + +Checks if the address is a valid. Accepts checksummed addresses too. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hexAddress` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/account.ts:129](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L129) + +___ + +### isValidChecksumAddress + +▸ `Const` **isValidChecksumAddress**(`hexAddress`, `eip1191ChainId?`): `boolean` + +Checks if the address is a valid checksummed address. + +See toChecksumAddress' documentation for details about the eip1191ChainId parameter. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hexAddress` | `string` | +| `eip1191ChainId?` | [`BNLike`](README.md#bnlike) | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/account.ts:180](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L180) + +___ + +### isValidPrivate + +▸ `Const` **isValidPrivate**(`privateKey`): `boolean` + +Checks if the private key satisfies the rules of the curve secp256k1. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `privateKey` | `Buffer` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/account.ts:231](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L231) + +___ + +### isValidPublic + +▸ `Const` **isValidPublic**(`publicKey`, `sanitize?`): `boolean` + +Checks if the public key satisfies the rules of the curve secp256k1 +and the requirements of Ethereum. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `publicKey` | `Buffer` | `undefined` | The two points of an uncompressed key, unless sanitize is enabled | +| `sanitize` | `boolean` | `false` | Accept public keys in other formats | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/account.ts:241](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L241) + +___ + +### isValidSignature + +▸ `Const` **isValidSignature**(`v`, `r`, `s`, `homesteadOrLater?`, `chainId?`): `boolean` + +Validate a ECDSA signature. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `v` | [`BNLike`](README.md#bnlike) | `undefined` | - | +| `r` | `Buffer` | `undefined` | - | +| `s` | `Buffer` | `undefined` | - | +| `homesteadOrLater` | `boolean` | `true` | Indicates whether this is being used on either the homestead hardfork or a later one | +| `chainId?` | [`BNLike`](README.md#bnlike) | `undefined` | - | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/signature.ts:155](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L155) + +___ + +### isZeroAddress + +▸ `Const` **isZeroAddress**(`hexAddress`): `boolean` + +Checks if a given address is the zero address. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hexAddress` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/util/src/account.ts:313](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L313) + +___ + +### keccak + +▸ `Const` **keccak**(`a`, `bits?`): `Buffer` + +Creates Keccak hash of a Buffer input + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `a` | `Buffer` | `undefined` | The input data (Buffer) | +| `bits` | `number` | `256` | (number = 256) The Keccak width | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:12](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L12) + +___ + +### keccak256 + +▸ `Const` **keccak256**(`a`): `Buffer` + +Creates Keccak-256 hash of the input, alias for keccak(a, 256). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `Buffer` | The input data (Buffer) | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L37) + +___ + +### keccakFromArray + +▸ `Const` **keccakFromArray**(`a`, `bits?`): `Buffer` + +Creates Keccak hash of a number array input + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `a` | `number`[] | `undefined` | The input data (number[]) | +| `bits` | `number` | `256` | (number = 256) The Keccak width | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L67) + +___ + +### keccakFromHexString + +▸ `Const` **keccakFromHexString**(`a`, `bits?`): `Buffer` + +Creates Keccak hash of an 0x-prefixed string input + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `a` | `string` | `undefined` | The input data (String) | +| `bits` | `number` | `256` | (number = 256) The Keccak width | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L57) + +___ + +### keccakFromString + +▸ `Const` **keccakFromString**(`a`, `bits?`): `Buffer` + +Creates Keccak hash of a utf-8 string input + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `a` | `string` | `undefined` | The input data (String) | +| `bits` | `number` | `256` | (number = 256) The Keccak width | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L46) + +___ + +### padToEven + +▸ **padToEven**(`value`): `string` + +**`description`** Pads a `String` to have an even length + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L15) + +___ + +### privateToAddress + +▸ `Const` **privateToAddress**(`privateKey`): `Buffer` + +Returns the ethereum address of a given private key. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `privateKey` | `Buffer` | A private key must be 256 bits wide | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/account.ts:286](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L286) + +___ + +### privateToPublic + +▸ `Const` **privateToPublic**(`privateKey`): `Buffer` + +Returns the ethereum public key of a given private key. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `privateKey` | `Buffer` | A private key must be 256 bits wide | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/account.ts:276](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L276) + +___ + +### pubToAddress + +▸ `Const` **pubToAddress**(`pubKey`, `sanitize?`): `Buffer` + +Returns the ethereum address of a given public key. +Accepts "Ethereum public keys" and SEC1 encoded keys. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `pubKey` | `Buffer` | `undefined` | The two points of an uncompressed key, unless sanitize is enabled | +| `sanitize` | `boolean` | `false` | Accept public keys in other formats | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/account.ts:261](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L261) + +___ + +### publicToAddress + +▸ `Const` **publicToAddress**(`pubKey`, `sanitize?`): `Buffer` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `pubKey` | `Buffer` | `undefined` | +| `sanitize` | `boolean` | `false` | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/account.ts:270](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L270) + +___ + +### ripemd160 + +▸ `Const` **ripemd160**(`a`, `padded`): `Buffer` + +Creates RIPEMD160 hash of a Buffer input. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `Buffer` | The input data (Buffer) | +| `padded` | `boolean` | Whether it should be padded to 256 bits or not | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:128](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L128) + +___ + +### ripemd160FromArray + +▸ `Const` **ripemd160FromArray**(`a`, `padded`): `Buffer` + +Creates RIPEMD160 hash of a number[] input. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `number`[] | The input data (number[]) | +| `padded` | `boolean` | Whether it should be padded to 256 bits or not | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:148](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L148) + +___ + +### ripemd160FromString + +▸ `Const` **ripemd160FromString**(`a`, `padded`): `Buffer` + +Creates RIPEMD160 hash of a string input. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `string` | The input data (String) | +| `padded` | `boolean` | Whether it should be padded to 256 bits or not | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:138](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L138) + +___ + +### rlphash + +▸ `Const` **rlphash**(`a`): `Buffer` + +Creates SHA-3 hash of the RLP encoded version of the input. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | [`Input`](modules/rlp.md#input) | The input data | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L157) + +___ + +### setLengthLeft + +▸ `Const` **setLengthLeft**(`msg`, `length`): `Buffer` + +Left Pads a `Buffer` with leading zeros till it has `length` bytes. +Or it truncates the beginning if it exceeds. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `msg` | `Buffer` | the value to pad (Buffer) | +| `length` | `number` | the number of bytes the output should be | + +#### Returns + +`Buffer` + +(Buffer) + +#### Defined in + +[packages/util/src/bytes.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L46) + +___ + +### setLengthRight + +▸ `Const` **setLengthRight**(`msg`, `length`): `Buffer` + +Right Pads a `Buffer` with trailing zeros till it has `length` bytes. +it truncates the end if it exceeds. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `msg` | `Buffer` | the value to pad (Buffer) | +| `length` | `number` | the number of bytes the output should be | + +#### Returns + +`Buffer` + +(Buffer) + +#### Defined in + +[packages/util/src/bytes.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L58) + +___ + +### sha256 + +▸ `Const` **sha256**(`a`): `Buffer` + +Creates SHA256 hash of a Buffer input. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `Buffer` | The input data (Buffer) | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L85) + +___ + +### sha256FromArray + +▸ `Const` **sha256FromArray**(`a`): `Buffer` + +Creates SHA256 hash of a number[] input. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `number`[] | The input data (number[]) | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:103](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L103) + +___ + +### sha256FromString + +▸ `Const` **sha256FromString**(`a`): `Buffer` + +Creates SHA256 hash of a string input. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `string` | The input data (string) | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/hash.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L94) + +___ + +### stripHexPrefix + +▸ **stripHexPrefix**(`str`): `string` + +**`description`** Removes '0x' from a given `String` if present + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `str` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:10](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L10) + +___ + +### toAscii + +▸ **toAscii**(`hex`): `string` + +**`description`** Should be called to get ascii from it's hex representation + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hex` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L48) + +___ + +### toBuffer + +▸ `Const` **toBuffer**(`v`): `Buffer` + +Attempts to turn a value into a `Buffer`. +Inputs supported: `Buffer`, `String` (hex-prefixed), `Number`, null/undefined, `BN` and other objects +with a `toArray()` or `toBuffer()` method. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `v` | [`ToBufferInputTypes`](README.md#tobufferinputtypes) | the value | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/bytes.ts:126](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L126) + +___ + +### toChecksumAddress + +▸ `Const` **toChecksumAddress**(`hexAddress`, `eip1191ChainId?`): `string` + +Returns a checksummed address. + +If an eip1191ChainId is provided, the chainId will be included in the checksum calculation. This +has the effect of checksummed addresses for one chain having invalid checksums for others. +For more details see [EIP-1191](https://eips.ethereum.org/EIPS/eip-1191). + +WARNING: Checksums with and without the chainId will differ and the EIP-1191 checksum is not +backwards compatible to the original widely adopted checksum format standard introduced in +[EIP-55](https://eips.ethereum.org/EIPS/eip-55), so this will break in existing applications. +Usage of this EIP is therefore discouraged unless you have a very targeted use case. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hexAddress` | `string` | +| `eip1191ChainId?` | [`BNLike`](README.md#bnlike) | + +#### Returns + +`string` + +#### Defined in + +[packages/util/src/account.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L151) + +___ + +### toCompactSig + +▸ `Const` **toCompactSig**(`v`, `r`, `s`, `chainId?`): `string` + +Convert signature parameters into the format of Compact Signature Representation (EIP-2098). + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `v` | [`BNLike`](README.md#bnlike) | +| `r` | `Buffer` | +| `s` | `Buffer` | +| `chainId?` | [`BNLike`](README.md#bnlike) | + +#### Returns + +`string` + +Signature + +#### Defined in + +[packages/util/src/signature.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L99) + +___ + +### toRpcSig + +▸ `Const` **toRpcSig**(`v`, `r`, `s`, `chainId?`): `string` + +Convert signature parameters into the format of `eth_sign` RPC method. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `v` | [`BNLike`](README.md#bnlike) | +| `r` | `Buffer` | +| `s` | `Buffer` | +| `chainId?` | [`BNLike`](README.md#bnlike) | + +#### Returns + +`string` + +Signature + +#### Defined in + +[packages/util/src/signature.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L85) + +___ + +### toType + +▸ **toType**<`T`\>(`input`, `outputType`): ``null`` + +Convert an input to a specified type. +Input of null/undefined returns null/undefined regardless of the output type. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends [`TypeOutput`](enums/TypeOutput.md) | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `input` | ``null`` | value to convert | +| `outputType` | `T` | type to output | + +#### Returns + +``null`` + +#### Defined in + +[packages/util/src/types.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L99) + +▸ **toType**<`T`\>(`input`, `outputType`): `undefined` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends [`TypeOutput`](enums/TypeOutput.md) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `undefined` | +| `outputType` | `T` | + +#### Returns + +`undefined` + +#### Defined in + +[packages/util/src/types.ts:100](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L100) + +▸ **toType**<`T`\>(`input`, `outputType`): [`TypeOutputReturnType`](README.md#typeoutputreturntype)[`T`] + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends [`TypeOutput`](enums/TypeOutput.md) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | [`ToBufferInputTypes`](README.md#tobufferinputtypes) | +| `outputType` | `T` | + +#### Returns + +[`TypeOutputReturnType`](README.md#typeoutputreturntype)[`T`] + +#### Defined in + +[packages/util/src/types.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L101) + +___ + +### toUnsigned + +▸ `Const` **toUnsigned**(`num`): `Buffer` + +Converts a `BN` to an unsigned integer and returns it as a `Buffer`. Assumes 256-bit numbers. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `num` | [`BN`](classes/BN.md) | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/bytes.ts:198](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L198) + +___ + +### toUtf8 + +▸ **toUtf8**(`hex`): `string` + +**`description`** Should be called to get utf8 from it's hex representation + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hex` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/util/src/@types/ethjs-util/index.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L43) + +___ + +### unpadArray + +▸ `Const` **unpadArray**(`a`): `number`[] + +Trims leading zeros from an `Array` (of numbers). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `number`[] | (number[]) | + +#### Returns + +`number`[] + +(number[]) + +#### Defined in + +[packages/util/src/bytes.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L92) + +___ + +### unpadBuffer + +▸ `Const` **unpadBuffer**(`a`): `Buffer` + +Trims leading zeros from a `Buffer`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `Buffer` | (Buffer) | + +#### Returns + +`Buffer` + +(Buffer) + +#### Defined in + +[packages/util/src/bytes.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L82) + +___ + +### unpadHexString + +▸ `Const` **unpadHexString**(`a`): `string` + +Trims leading zeros from a hex-prefixed `String`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `a` | `string` | (String) | + +#### Returns + +`string` + +(String) + +#### Defined in + +[packages/util/src/bytes.ts:102](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L102) + +___ + +### zeroAddress + +▸ `Const` **zeroAddress**(): `string` + +Returns the zero address. + +#### Returns + +`string` + +#### Defined in + +[packages/util/src/account.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L304) + +___ + +### zeros + +▸ `Const` **zeros**(`bytes`): `Buffer` + +Returns a buffer filled with 0s. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bytes` | `number` | the number of bytes the buffer should be | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/util/src/bytes.ts:10](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L10) diff --git a/packages/util/docs/classes/account.account-1.md b/packages/util/docs/classes/Account.md similarity index 70% rename from packages/util/docs/classes/account.account-1.md rename to packages/util/docs/classes/Account.md index 27aa265b0c..c46b7b7916 100644 --- a/packages/util/docs/classes/account.account-1.md +++ b/packages/util/docs/classes/Account.md @@ -1,31 +1,29 @@ -[ethereumjs-util](../README.md) / [account](../modules/account.md) / Account +[ethereumjs-util](../README.md) / Account # Class: Account -[account](../modules/account.md).Account - ## Table of contents ### Constructors -- [constructor](account.account-1.md#constructor) +- [constructor](Account.md#constructor) ### Properties -- [balance](account.account-1.md#balance) -- [codeHash](account.account-1.md#codehash) -- [nonce](account.account-1.md#nonce) -- [stateRoot](account.account-1.md#stateroot) +- [balance](Account.md#balance) +- [codeHash](Account.md#codehash) +- [nonce](Account.md#nonce) +- [stateRoot](Account.md#stateroot) ### Methods -- [isContract](account.account-1.md#iscontract) -- [isEmpty](account.account-1.md#isempty) -- [raw](account.account-1.md#raw) -- [serialize](account.account-1.md#serialize) -- [fromAccountData](account.account-1.md#fromaccountdata) -- [fromRlpSerializedAccount](account.account-1.md#fromrlpserializedaccount) -- [fromValuesArray](account.account-1.md#fromvaluesarray) +- [isContract](Account.md#iscontract) +- [isEmpty](Account.md#isempty) +- [raw](Account.md#raw) +- [serialize](Account.md#serialize) +- [fromAccountData](Account.md#fromaccountdata) +- [fromRlpSerializedAccount](Account.md#fromrlpserializedaccount) +- [fromValuesArray](Account.md#fromvaluesarray) ## Constructors @@ -40,20 +38,20 @@ Use the static factory methods to assist in creating an Account from varying dat | Name | Type | | :------ | :------ | -| `nonce` | [BN](externals.bn-1.md) | -| `balance` | [BN](externals.bn-1.md) | +| `nonce` | [`BN`](BN.md) | +| `balance` | [`BN`](BN.md) | | `stateRoot` | `Buffer` | | `codeHash` | `Buffer` | #### Defined in -[packages/util/src/account.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L55) +[packages/util/src/account.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L61) ## Properties ### balance -• **balance**: [BN](externals.bn-1.md) +• **balance**: [`BN`](BN.md) #### Defined in @@ -73,7 +71,7 @@ ___ ### nonce -• **nonce**: [BN](externals.bn-1.md) +• **nonce**: [`BN`](BN.md) #### Defined in @@ -159,17 +157,17 @@ ___ ### fromAccountData -▸ `Static` **fromAccountData**(`accountData`): [Account](account.account-1.md) +▸ `Static` **fromAccountData**(`accountData`): [`Account`](Account.md) #### Parameters | Name | Type | | :------ | :------ | -| `accountData` | [AccountData](../interfaces/account.accountdata.md) | +| `accountData` | [`AccountData`](../interfaces/AccountData.md) | #### Returns -[Account](account.account-1.md) +[`Account`](Account.md) #### Defined in @@ -179,7 +177,7 @@ ___ ### fromRlpSerializedAccount -▸ `Static` **fromRlpSerializedAccount**(`serialized`): [Account](account.account-1.md) +▸ `Static` **fromRlpSerializedAccount**(`serialized`): [`Account`](Account.md) #### Parameters @@ -189,7 +187,7 @@ ___ #### Returns -[Account](account.account-1.md) +[`Account`](Account.md) #### Defined in @@ -199,7 +197,7 @@ ___ ### fromValuesArray -▸ `Static` **fromValuesArray**(`values`): [Account](account.account-1.md) +▸ `Static` **fromValuesArray**(`values`): [`Account`](Account.md) #### Parameters @@ -209,7 +207,7 @@ ___ #### Returns -[Account](account.account-1.md) +[`Account`](Account.md) #### Defined in diff --git a/packages/util/docs/classes/address.address-1.md b/packages/util/docs/classes/Address.md similarity index 68% rename from packages/util/docs/classes/address.address-1.md rename to packages/util/docs/classes/Address.md index aa497c92e9..b23d569c8f 100644 --- a/packages/util/docs/classes/address.address-1.md +++ b/packages/util/docs/classes/Address.md @@ -1,32 +1,30 @@ -[ethereumjs-util](../README.md) / [address](../modules/address.md) / Address +[ethereumjs-util](../README.md) / Address # Class: Address -[address](../modules/address.md).Address - ## Table of contents ### Constructors -- [constructor](address.address-1.md#constructor) +- [constructor](Address.md#constructor) ### Properties -- [buf](address.address-1.md#buf) +- [buf](Address.md#buf) ### Methods -- [equals](address.address-1.md#equals) -- [isPrecompileOrSystemAddress](address.address-1.md#isprecompileorsystemaddress) -- [isZero](address.address-1.md#iszero) -- [toBuffer](address.address-1.md#tobuffer) -- [toString](address.address-1.md#tostring) -- [fromPrivateKey](address.address-1.md#fromprivatekey) -- [fromPublicKey](address.address-1.md#frompublickey) -- [fromString](address.address-1.md#fromstring) -- [generate](address.address-1.md#generate) -- [generate2](address.address-1.md#generate2) -- [zero](address.address-1.md#zero) +- [equals](Address.md#equals) +- [isPrecompileOrSystemAddress](Address.md#isprecompileorsystemaddress) +- [isZero](Address.md#iszero) +- [toBuffer](Address.md#tobuffer) +- [toString](Address.md#tostring) +- [fromPrivateKey](Address.md#fromprivatekey) +- [fromPublicKey](Address.md#frompublickey) +- [fromString](Address.md#fromstring) +- [generate](Address.md#generate) +- [generate2](Address.md#generate2) +- [zero](Address.md#zero) ## Constructors @@ -42,7 +40,7 @@ #### Defined in -[packages/util/src/address.ts:13](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/address.ts#L13) +[packages/util/src/address.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/address.ts#L15) ## Properties @@ -66,7 +64,7 @@ Is address equal to another. | Name | Type | | :------ | :------ | -| `address` | [Address](address.address-1.md) | +| `address` | [`Address`](Address.md) | #### Returns @@ -145,7 +143,7 @@ ___ ### fromPrivateKey -▸ `Static` **fromPrivateKey**(`privateKey`): [Address](address.address-1.md) +▸ `Static` **fromPrivateKey**(`privateKey`): [`Address`](Address.md) Returns an address for a given private key. @@ -157,7 +155,7 @@ Returns an address for a given private key. #### Returns -[Address](address.address-1.md) +[`Address`](Address.md) #### Defined in @@ -167,7 +165,7 @@ ___ ### fromPublicKey -▸ `Static` **fromPublicKey**(`pubKey`): [Address](address.address-1.md) +▸ `Static` **fromPublicKey**(`pubKey`): [`Address`](Address.md) Returns an address for a given public key. @@ -179,7 +177,7 @@ Returns an address for a given public key. #### Returns -[Address](address.address-1.md) +[`Address`](Address.md) #### Defined in @@ -189,7 +187,7 @@ ___ ### fromString -▸ `Static` **fromString**(`str`): [Address](address.address-1.md) +▸ `Static` **fromString**(`str`): [`Address`](Address.md) Returns an Address object from a hex-encoded string. @@ -201,7 +199,7 @@ Returns an Address object from a hex-encoded string. #### Returns -[Address](address.address-1.md) +[`Address`](Address.md) #### Defined in @@ -211,7 +209,7 @@ ___ ### generate -▸ `Static` **generate**(`from`, `nonce`): [Address](address.address-1.md) +▸ `Static` **generate**(`from`, `nonce`): [`Address`](Address.md) Generates an address for a newly created contract. @@ -219,12 +217,12 @@ Generates an address for a newly created contract. | Name | Type | Description | | :------ | :------ | :------ | -| `from` | [Address](address.address-1.md) | The address which is creating this new address | -| `nonce` | [BN](externals.bn-1.md) | The nonce of the from account | +| `from` | [`Address`](Address.md) | The address which is creating this new address | +| `nonce` | [`BN`](BN.md) | The nonce of the from account | #### Returns -[Address](address.address-1.md) +[`Address`](Address.md) #### Defined in @@ -234,7 +232,7 @@ ___ ### generate2 -▸ `Static` **generate2**(`from`, `salt`, `initCode`): [Address](address.address-1.md) +▸ `Static` **generate2**(`from`, `salt`, `initCode`): [`Address`](Address.md) Generates an address for a contract created using CREATE2. @@ -242,13 +240,13 @@ Generates an address for a contract created using CREATE2. | Name | Type | Description | | :------ | :------ | :------ | -| `from` | [Address](address.address-1.md) | The address which is creating this new address | +| `from` | [`Address`](Address.md) | The address which is creating this new address | | `salt` | `Buffer` | A salt | | `initCode` | `Buffer` | The init code of the contract being created | #### Returns -[Address](address.address-1.md) +[`Address`](Address.md) #### Defined in @@ -258,13 +256,13 @@ ___ ### zero -▸ `Static` **zero**(): [Address](address.address-1.md) +▸ `Static` **zero**(): [`Address`](Address.md) Returns the zero address. #### Returns -[Address](address.address-1.md) +[`Address`](Address.md) #### Defined in diff --git a/packages/util/docs/classes/externals.bn-1.md b/packages/util/docs/classes/BN.md similarity index 66% rename from packages/util/docs/classes/externals.bn-1.md rename to packages/util/docs/classes/BN.md index 0404b594ce..cd75cbabdb 100644 --- a/packages/util/docs/classes/externals.bn-1.md +++ b/packages/util/docs/classes/BN.md @@ -1,117 +1,115 @@ -[ethereumjs-util](../README.md) / [externals](../modules/externals.md) / BN +[ethereumjs-util](../README.md) / BN # Class: BN -[externals](../modules/externals.md).BN - [`BN`](https://github.com/indutny/bn.js) ## Table of contents ### Constructors -- [constructor](externals.bn-1.md#constructor) +- [constructor](BN.md#constructor) ### Properties -- [BN](externals.bn-1.md#bn) -- [wordSize](externals.bn-1.md#wordsize) +- [BN](BN.md#bn) +- [wordSize](BN.md#wordsize) ### Methods -- [abs](externals.bn-1.md#abs) -- [add](externals.bn-1.md#add) -- [addn](externals.bn-1.md#addn) -- [and](externals.bn-1.md#and) -- [andln](externals.bn-1.md#andln) -- [bincn](externals.bn-1.md#bincn) -- [bitLength](externals.bn-1.md#bitlength) -- [byteLength](externals.bn-1.md#bytelength) -- [clone](externals.bn-1.md#clone) -- [cmp](externals.bn-1.md#cmp) -- [cmpn](externals.bn-1.md#cmpn) -- [div](externals.bn-1.md#div) -- [divRound](externals.bn-1.md#divround) -- [divn](externals.bn-1.md#divn) -- [egcd](externals.bn-1.md#egcd) -- [eq](externals.bn-1.md#eq) -- [eqn](externals.bn-1.md#eqn) -- [fromTwos](externals.bn-1.md#fromtwos) -- [gcd](externals.bn-1.md#gcd) -- [gt](externals.bn-1.md#gt) -- [gte](externals.bn-1.md#gte) -- [gten](externals.bn-1.md#gten) -- [gtn](externals.bn-1.md#gtn) -- [iabs](externals.bn-1.md#iabs) -- [iadd](externals.bn-1.md#iadd) -- [iaddn](externals.bn-1.md#iaddn) -- [iand](externals.bn-1.md#iand) -- [idivn](externals.bn-1.md#idivn) -- [imaskn](externals.bn-1.md#imaskn) -- [imul](externals.bn-1.md#imul) -- [imuln](externals.bn-1.md#imuln) -- [ineg](externals.bn-1.md#ineg) -- [inotn](externals.bn-1.md#inotn) -- [invm](externals.bn-1.md#invm) -- [ior](externals.bn-1.md#ior) -- [isEven](externals.bn-1.md#iseven) -- [isNeg](externals.bn-1.md#isneg) -- [isOdd](externals.bn-1.md#isodd) -- [isZero](externals.bn-1.md#iszero) -- [ishln](externals.bn-1.md#ishln) -- [ishrn](externals.bn-1.md#ishrn) -- [isqr](externals.bn-1.md#isqr) -- [isub](externals.bn-1.md#isub) -- [isubn](externals.bn-1.md#isubn) -- [iuand](externals.bn-1.md#iuand) -- [iuor](externals.bn-1.md#iuor) -- [iushln](externals.bn-1.md#iushln) -- [iushrn](externals.bn-1.md#iushrn) -- [iuxor](externals.bn-1.md#iuxor) -- [ixor](externals.bn-1.md#ixor) -- [lt](externals.bn-1.md#lt) -- [lte](externals.bn-1.md#lte) -- [lten](externals.bn-1.md#lten) -- [ltn](externals.bn-1.md#ltn) -- [maskn](externals.bn-1.md#maskn) -- [mod](externals.bn-1.md#mod) -- [modn](externals.bn-1.md#modn) -- [modrn](externals.bn-1.md#modrn) -- [mul](externals.bn-1.md#mul) -- [muln](externals.bn-1.md#muln) -- [neg](externals.bn-1.md#neg) -- [notn](externals.bn-1.md#notn) -- [or](externals.bn-1.md#or) -- [pow](externals.bn-1.md#pow) -- [setn](externals.bn-1.md#setn) -- [shln](externals.bn-1.md#shln) -- [shrn](externals.bn-1.md#shrn) -- [sqr](externals.bn-1.md#sqr) -- [sub](externals.bn-1.md#sub) -- [subn](externals.bn-1.md#subn) -- [testn](externals.bn-1.md#testn) -- [toArray](externals.bn-1.md#toarray) -- [toArrayLike](externals.bn-1.md#toarraylike) -- [toBuffer](externals.bn-1.md#tobuffer) -- [toJSON](externals.bn-1.md#tojson) -- [toNumber](externals.bn-1.md#tonumber) -- [toRed](externals.bn-1.md#tored) -- [toString](externals.bn-1.md#tostring) -- [toTwos](externals.bn-1.md#totwos) -- [uand](externals.bn-1.md#uand) -- [ucmp](externals.bn-1.md#ucmp) -- [umod](externals.bn-1.md#umod) -- [uor](externals.bn-1.md#uor) -- [ushln](externals.bn-1.md#ushln) -- [ushrn](externals.bn-1.md#ushrn) -- [uxor](externals.bn-1.md#uxor) -- [xor](externals.bn-1.md#xor) -- [zeroBits](externals.bn-1.md#zerobits) -- [isBN](externals.bn-1.md#isbn) -- [max](externals.bn-1.md#max) -- [min](externals.bn-1.md#min) -- [mont](externals.bn-1.md#mont) -- [red](externals.bn-1.md#red) +- [abs](BN.md#abs) +- [add](BN.md#add) +- [addn](BN.md#addn) +- [and](BN.md#and) +- [andln](BN.md#andln) +- [bincn](BN.md#bincn) +- [bitLength](BN.md#bitlength) +- [byteLength](BN.md#bytelength) +- [clone](BN.md#clone) +- [cmp](BN.md#cmp) +- [cmpn](BN.md#cmpn) +- [div](BN.md#div) +- [divRound](BN.md#divround) +- [divn](BN.md#divn) +- [egcd](BN.md#egcd) +- [eq](BN.md#eq) +- [eqn](BN.md#eqn) +- [fromTwos](BN.md#fromtwos) +- [gcd](BN.md#gcd) +- [gt](BN.md#gt) +- [gte](BN.md#gte) +- [gten](BN.md#gten) +- [gtn](BN.md#gtn) +- [iabs](BN.md#iabs) +- [iadd](BN.md#iadd) +- [iaddn](BN.md#iaddn) +- [iand](BN.md#iand) +- [idivn](BN.md#idivn) +- [imaskn](BN.md#imaskn) +- [imul](BN.md#imul) +- [imuln](BN.md#imuln) +- [ineg](BN.md#ineg) +- [inotn](BN.md#inotn) +- [invm](BN.md#invm) +- [ior](BN.md#ior) +- [isEven](BN.md#iseven) +- [isNeg](BN.md#isneg) +- [isOdd](BN.md#isodd) +- [isZero](BN.md#iszero) +- [ishln](BN.md#ishln) +- [ishrn](BN.md#ishrn) +- [isqr](BN.md#isqr) +- [isub](BN.md#isub) +- [isubn](BN.md#isubn) +- [iuand](BN.md#iuand) +- [iuor](BN.md#iuor) +- [iushln](BN.md#iushln) +- [iushrn](BN.md#iushrn) +- [iuxor](BN.md#iuxor) +- [ixor](BN.md#ixor) +- [lt](BN.md#lt) +- [lte](BN.md#lte) +- [lten](BN.md#lten) +- [ltn](BN.md#ltn) +- [maskn](BN.md#maskn) +- [mod](BN.md#mod) +- [modn](BN.md#modn) +- [modrn](BN.md#modrn) +- [mul](BN.md#mul) +- [muln](BN.md#muln) +- [neg](BN.md#neg) +- [notn](BN.md#notn) +- [or](BN.md#or) +- [pow](BN.md#pow) +- [setn](BN.md#setn) +- [shln](BN.md#shln) +- [shrn](BN.md#shrn) +- [sqr](BN.md#sqr) +- [sub](BN.md#sub) +- [subn](BN.md#subn) +- [testn](BN.md#testn) +- [toArray](BN.md#toarray) +- [toArrayLike](BN.md#toarraylike) +- [toBuffer](BN.md#tobuffer) +- [toJSON](BN.md#tojson) +- [toNumber](BN.md#tonumber) +- [toRed](BN.md#tored) +- [toString](BN.md#tostring) +- [toTwos](BN.md#totwos) +- [uand](BN.md#uand) +- [ucmp](BN.md#ucmp) +- [umod](BN.md#umod) +- [uor](BN.md#uor) +- [ushln](BN.md#ushln) +- [ushrn](BN.md#ushrn) +- [uxor](BN.md#uxor) +- [xor](BN.md#xor) +- [zeroBits](BN.md#zerobits) +- [isBN](BN.md#isbn) +- [max](BN.md#max) +- [min](BN.md#min) +- [mont](BN.md#mont) +- [red](BN.md#red) ## Constructors @@ -123,13 +121,13 @@ | Name | Type | | :------ | :------ | -| `number` | `string` \| `number` \| `Buffer` \| [BN](externals.bn-1.md) \| `Uint8Array` \| `number`[] | +| `number` | `string` \| `number` \| [`BN`](BN.md) \| `Buffer` \| `Uint8Array` \| `number`[] | | `base?` | `number` \| ``"hex"`` | -| `endian?` | ``"le"`` \| ``"be"`` | +| `endian?` | [`Endianness`](../modules/BN.md#endianness) | #### Defined in -node_modules/@types/bn.js/index.d.ts:30 +node_modules/@types/bn.js/index.d.ts:32 • **new BN**(`number`, `endian?`) @@ -137,18 +135,18 @@ node_modules/@types/bn.js/index.d.ts:30 | Name | Type | | :------ | :------ | -| `number` | `string` \| `number` \| `Buffer` \| [BN](externals.bn-1.md) \| `Uint8Array` \| `number`[] | -| `endian?` | ``"le"`` \| ``"be"`` | +| `number` | `string` \| `number` \| [`BN`](BN.md) \| `Buffer` \| `Uint8Array` \| `number`[] | +| `endian?` | [`Endianness`](../modules/BN.md#endianness) | #### Defined in -node_modules/@types/bn.js/index.d.ts:36 +node_modules/@types/bn.js/index.d.ts:37 ## Properties ### BN -▪ `Static` **BN**: typeof [BN](externals.bn-1.md) +▪ `Static` **BN**: typeof [`BN`](BN.md) #### Defined in @@ -168,13 +166,13 @@ node_modules/@types/bn.js/index.d.ts:30 ### abs -▸ **abs**(): [BN](externals.bn-1.md) +▸ **abs**(): [`BN`](BN.md) **`description`** absolute value #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -184,7 +182,7 @@ ___ ### add -▸ **add**(`b`): [BN](externals.bn-1.md) +▸ **add**(`b`): [`BN`](BN.md) **`description`** addition @@ -192,11 +190,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -206,7 +204,7 @@ ___ ### addn -▸ **addn**(`b`): [BN](externals.bn-1.md) +▸ **addn**(`b`): [`BN`](BN.md) **`description`** addition @@ -218,7 +216,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -228,7 +226,7 @@ ___ ### and -▸ **and**(`b`): [BN](externals.bn-1.md) +▸ **and**(`b`): [`BN`](BN.md) **`description`** and @@ -236,11 +234,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -250,7 +248,7 @@ ___ ### andln -▸ **andln**(`b`): [BN](externals.bn-1.md) +▸ **andln**(`b`): [`BN`](BN.md) **`description`** and (NOTE: `andln` is going to be replaced with `andn` in future) @@ -262,7 +260,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -272,7 +270,7 @@ ___ ### bincn -▸ **bincn**(`b`): [BN](externals.bn-1.md) +▸ **bincn**(`b`): [`BN`](BN.md) **`description`** add `1 << b` to the number @@ -284,7 +282,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -326,13 +324,13 @@ ___ ### clone -▸ **clone**(): [BN](externals.bn-1.md) +▸ **clone**(): [`BN`](BN.md) **`description`** clone number #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -350,7 +348,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -386,7 +384,7 @@ ___ ### div -▸ **div**(`b`): [BN](externals.bn-1.md) +▸ **div**(`b`): [`BN`](BN.md) **`description`** divide @@ -394,11 +392,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -408,7 +406,7 @@ ___ ### divRound -▸ **divRound**(`b`): [BN](externals.bn-1.md) +▸ **divRound**(`b`): [`BN`](BN.md) **`description`** rounded division @@ -416,11 +414,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -430,7 +428,7 @@ ___ ### divn -▸ **divn**(`b`): [BN](externals.bn-1.md) +▸ **divn**(`b`): [`BN`](BN.md) **`description`** divide @@ -442,7 +440,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -460,7 +458,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -468,9 +466,9 @@ ___ | Name | Type | | :------ | :------ | -| `a` | [BN](externals.bn-1.md) | -| `b` | [BN](externals.bn-1.md) | -| `gcd` | [BN](externals.bn-1.md) | +| `a` | [`BN`](BN.md) | +| `b` | [`BN`](BN.md) | +| `gcd` | [`BN`](BN.md) | #### Defined in @@ -488,7 +486,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -524,7 +522,7 @@ ___ ### fromTwos -▸ **fromTwos**(`width`): [BN](externals.bn-1.md) +▸ **fromTwos**(`width`): [`BN`](BN.md) **`description`** convert from two's complement representation, where width is the bit width @@ -536,7 +534,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -546,7 +544,7 @@ ___ ### gcd -▸ **gcd**(`b`): [BN](externals.bn-1.md) +▸ **gcd**(`b`): [`BN`](BN.md) **`description`** GCD @@ -554,11 +552,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -576,7 +574,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -598,7 +596,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -656,13 +654,13 @@ ___ ### iabs -▸ **iabs**(): [BN](externals.bn-1.md) +▸ **iabs**(): [`BN`](BN.md) **`description`** absolute value #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -672,7 +670,7 @@ ___ ### iadd -▸ **iadd**(`b`): [BN](externals.bn-1.md) +▸ **iadd**(`b`): [`BN`](BN.md) **`description`** addition @@ -680,11 +678,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -694,7 +692,7 @@ ___ ### iaddn -▸ **iaddn**(`b`): [BN](externals.bn-1.md) +▸ **iaddn**(`b`): [`BN`](BN.md) **`description`** addition @@ -706,7 +704,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -716,7 +714,7 @@ ___ ### iand -▸ **iand**(`b`): [BN](externals.bn-1.md) +▸ **iand**(`b`): [`BN`](BN.md) **`description`** and @@ -724,11 +722,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -738,7 +736,7 @@ ___ ### idivn -▸ **idivn**(`b`): [BN](externals.bn-1.md) +▸ **idivn**(`b`): [`BN`](BN.md) **`description`** divide @@ -750,7 +748,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -760,7 +758,7 @@ ___ ### imaskn -▸ **imaskn**(`b`): [BN](externals.bn-1.md) +▸ **imaskn**(`b`): [`BN`](BN.md) **`description`** clear bits with indexes higher or equal to `b` @@ -772,7 +770,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -782,7 +780,7 @@ ___ ### imul -▸ **imul**(`b`): [BN](externals.bn-1.md) +▸ **imul**(`b`): [`BN`](BN.md) **`description`** multiply @@ -790,11 +788,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -804,7 +802,7 @@ ___ ### imuln -▸ **imuln**(`b`): [BN](externals.bn-1.md) +▸ **imuln**(`b`): [`BN`](BN.md) **`description`** multiply @@ -816,7 +814,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -826,13 +824,13 @@ ___ ### ineg -▸ **ineg**(): [BN](externals.bn-1.md) +▸ **ineg**(): [`BN`](BN.md) **`description`** negate sign #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -842,7 +840,7 @@ ___ ### inotn -▸ **inotn**(`w`): [BN](externals.bn-1.md) +▸ **inotn**(`w`): [`BN`](BN.md) **`description`** not (for the width specified by `w`) @@ -854,7 +852,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -864,7 +862,7 @@ ___ ### invm -▸ **invm**(`b`): [BN](externals.bn-1.md) +▸ **invm**(`b`): [`BN`](BN.md) **`description`** inverse `a` modulo `b` @@ -872,11 +870,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -886,7 +884,7 @@ ___ ### ior -▸ **ior**(`b`): [BN](externals.bn-1.md) +▸ **ior**(`b`): [`BN`](BN.md) **`description`** or @@ -894,11 +892,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -972,7 +970,7 @@ ___ ### ishln -▸ **ishln**(`b`): [BN](externals.bn-1.md) +▸ **ishln**(`b`): [`BN`](BN.md) **`description`** shift left @@ -984,7 +982,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -994,7 +992,7 @@ ___ ### ishrn -▸ **ishrn**(`b`): [BN](externals.bn-1.md) +▸ **ishrn**(`b`): [`BN`](BN.md) **`description`** shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) @@ -1006,7 +1004,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1016,13 +1014,13 @@ ___ ### isqr -▸ **isqr**(): [BN](externals.bn-1.md) +▸ **isqr**(): [`BN`](BN.md) **`description`** square #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1032,7 +1030,7 @@ ___ ### isub -▸ **isub**(`b`): [BN](externals.bn-1.md) +▸ **isub**(`b`): [`BN`](BN.md) **`description`** subtraction @@ -1040,11 +1038,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1054,7 +1052,7 @@ ___ ### isubn -▸ **isubn**(`b`): [BN](externals.bn-1.md) +▸ **isubn**(`b`): [`BN`](BN.md) **`description`** subtraction @@ -1066,7 +1064,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1076,7 +1074,7 @@ ___ ### iuand -▸ **iuand**(`b`): [BN](externals.bn-1.md) +▸ **iuand**(`b`): [`BN`](BN.md) **`description`** and @@ -1084,11 +1082,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1098,7 +1096,7 @@ ___ ### iuor -▸ **iuor**(`b`): [BN](externals.bn-1.md) +▸ **iuor**(`b`): [`BN`](BN.md) **`description`** or @@ -1106,11 +1104,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1120,7 +1118,7 @@ ___ ### iushln -▸ **iushln**(`b`): [BN](externals.bn-1.md) +▸ **iushln**(`b`): [`BN`](BN.md) **`description`** shift left @@ -1132,7 +1130,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1142,7 +1140,7 @@ ___ ### iushrn -▸ **iushrn**(`b`): [BN](externals.bn-1.md) +▸ **iushrn**(`b`): [`BN`](BN.md) **`description`** shift right @@ -1154,7 +1152,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1164,7 +1162,7 @@ ___ ### iuxor -▸ **iuxor**(`b`): [BN](externals.bn-1.md) +▸ **iuxor**(`b`): [`BN`](BN.md) **`description`** xor @@ -1172,11 +1170,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1186,7 +1184,7 @@ ___ ### ixor -▸ **ixor**(`b`): [BN](externals.bn-1.md) +▸ **ixor**(`b`): [`BN`](BN.md) **`description`** xor @@ -1194,11 +1192,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1216,7 +1214,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -1238,7 +1236,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -1296,7 +1294,7 @@ ___ ### maskn -▸ **maskn**(`b`): [BN](externals.bn-1.md) +▸ **maskn**(`b`): [`BN`](BN.md) **`description`** clear bits with indexes higher or equal to `b` @@ -1308,7 +1306,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1318,7 +1316,7 @@ ___ ### mod -▸ **mod**(`b`): [BN](externals.bn-1.md) +▸ **mod**(`b`): [`BN`](BN.md) **`description`** reduct @@ -1326,11 +1324,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1386,7 +1384,7 @@ ___ ### mul -▸ **mul**(`b`): [BN](externals.bn-1.md) +▸ **mul**(`b`): [`BN`](BN.md) **`description`** multiply @@ -1394,11 +1392,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1408,7 +1406,7 @@ ___ ### muln -▸ **muln**(`b`): [BN](externals.bn-1.md) +▸ **muln**(`b`): [`BN`](BN.md) **`description`** multiply @@ -1420,7 +1418,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1430,13 +1428,13 @@ ___ ### neg -▸ **neg**(): [BN](externals.bn-1.md) +▸ **neg**(): [`BN`](BN.md) **`description`** negate sign #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1446,7 +1444,7 @@ ___ ### notn -▸ **notn**(`w`): [BN](externals.bn-1.md) +▸ **notn**(`w`): [`BN`](BN.md) **`description`** not (for the width specified by `w`) @@ -1458,7 +1456,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1468,7 +1466,7 @@ ___ ### or -▸ **or**(`b`): [BN](externals.bn-1.md) +▸ **or**(`b`): [`BN`](BN.md) **`description`** or @@ -1476,11 +1474,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1490,7 +1488,7 @@ ___ ### pow -▸ **pow**(`b`): [BN](externals.bn-1.md) +▸ **pow**(`b`): [`BN`](BN.md) **`description`** raise `a` to the power of `b` @@ -1498,11 +1496,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1512,7 +1510,7 @@ ___ ### setn -▸ **setn**(`b`): [BN](externals.bn-1.md) +▸ **setn**(`b`): [`BN`](BN.md) **`description`** set specified bit to 1 @@ -1524,7 +1522,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1534,7 +1532,7 @@ ___ ### shln -▸ **shln**(`b`): [BN](externals.bn-1.md) +▸ **shln**(`b`): [`BN`](BN.md) **`description`** shift left @@ -1546,7 +1544,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1556,7 +1554,7 @@ ___ ### shrn -▸ **shrn**(`b`): [BN](externals.bn-1.md) +▸ **shrn**(`b`): [`BN`](BN.md) **`description`** shift right @@ -1568,7 +1566,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1578,13 +1576,13 @@ ___ ### sqr -▸ **sqr**(): [BN](externals.bn-1.md) +▸ **sqr**(): [`BN`](BN.md) **`description`** square #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1594,7 +1592,7 @@ ___ ### sub -▸ **sub**(`b`): [BN](externals.bn-1.md) +▸ **sub**(`b`): [`BN`](BN.md) **`description`** subtraction @@ -1602,11 +1600,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1616,7 +1614,7 @@ ___ ### subn -▸ **subn**(`b`): [BN](externals.bn-1.md) +▸ **subn**(`b`): [`BN`](BN.md) **`description`** subtraction @@ -1628,7 +1626,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1668,7 +1666,7 @@ ___ | Name | Type | | :------ | :------ | -| `endian?` | ``"le"`` \| ``"be"`` | +| `endian?` | [`Endianness`](../modules/BN.md#endianness) | | `length?` | `number` | #### Returns @@ -1694,17 +1692,17 @@ ___ | `ArrayType` | `Object` | - | | `ArrayType.poolSize` | `number` | This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified. | | `ArrayType.prototype` | `Buffer` | - | -| `ArrayType.alloc` | | - | -| `ArrayType.allocUnsafe` | | - | -| `ArrayType.allocUnsafeSlow` | | - | -| `ArrayType.byteLength` | | - | -| `ArrayType.compare` | | - | -| `ArrayType.concat` | | - | -| `ArrayType.from` | | - | -| `ArrayType.isBuffer` | | - | -| `ArrayType.isEncoding` | | - | -| `ArrayType.of` | | - | -| `endian?` | ``"le"`` \| ``"be"`` | - | +| `ArrayType.alloc` | (`size`: `number`, `fill?`: `string` \| `number` \| `Buffer`, `encoding?`: `BufferEncoding`) => `Buffer` | - | +| `ArrayType.allocUnsafe` | (`size`: `number`) => `Buffer` | - | +| `ArrayType.allocUnsafeSlow` | (`size`: `number`) => `Buffer` | - | +| `ArrayType.byteLength` | (`string`: `string` \| `ArrayBuffer` \| `SharedArrayBuffer` \| `TypedArray` \| `DataView`, `encoding?`: `BufferEncoding`) => `number` | - | +| `ArrayType.compare` | (`buf1`: `Uint8Array`, `buf2`: `Uint8Array`) => `number` | - | +| `ArrayType.concat` | (`list`: readonly `Uint8Array`[], `totalLength?`: `number`) => `Buffer` | - | +| `ArrayType.from` | (`arrayBuffer`: `ArrayBuffer` \| `SharedArrayBuffer`, `byteOffset?`: `number`, `length?`: `number`) => `Buffer`(`data`: readonly `number`[]) => `Buffer`(`data`: `Uint8Array`) => `Buffer`(`obj`: { `valueOf`: () => `string` \| `object` } \| { `[toPrimitive]`: (`hint`: ``"string"``) => `string` }, `byteOffset?`: `number`, `length?`: `number`) => `Buffer`(`str`: `string`, `encoding?`: `BufferEncoding`) => `Buffer` | - | +| `ArrayType.isBuffer` | (`obj`: `any`) => obj is Buffer | - | +| `ArrayType.isEncoding` | (`encoding`: `string`) => encoding is BufferEncoding | - | +| `ArrayType.of` | (...`items`: `number`[]) => `Buffer` | - | +| `endian?` | [`Endianness`](../modules/BN.md#endianness) | - | | `length?` | `number` | - | #### Returns @@ -1722,7 +1720,7 @@ node_modules/@types/bn.js/index.d.ts:95 | Name | Type | | :------ | :------ | | `ArrayType` | `any`[] | -| `endian?` | ``"le"`` \| ``"be"`` | +| `endian?` | [`Endianness`](../modules/BN.md#endianness) | | `length?` | `number` | #### Returns @@ -1745,7 +1743,7 @@ ___ | Name | Type | | :------ | :------ | -| `endian?` | ``"le"`` \| ``"be"`` | +| `endian?` | [`Endianness`](../modules/BN.md#endianness) | | `length?` | `number` | #### Returns @@ -1800,7 +1798,7 @@ ___ | Name | Type | | :------ | :------ | -| `reductionContext` | [ReductionContext](../interfaces/externals.bn.reductioncontext.md) | +| `reductionContext` | [`ReductionContext`](../interfaces/BN.ReductionContext.md) | #### Returns @@ -1837,7 +1835,7 @@ ___ ### toTwos -▸ **toTwos**(`width`): [BN](externals.bn-1.md) +▸ **toTwos**(`width`): [`BN`](BN.md) **`description`** convert to two's complement representation, where width is bit width @@ -1849,7 +1847,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1859,7 +1857,7 @@ ___ ### uand -▸ **uand**(`b`): [BN](externals.bn-1.md) +▸ **uand**(`b`): [`BN`](BN.md) **`description`** and @@ -1867,11 +1865,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1889,7 +1887,7 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns @@ -1903,7 +1901,7 @@ ___ ### umod -▸ **umod**(`b`): [BN](externals.bn-1.md) +▸ **umod**(`b`): [`BN`](BN.md) **`description`** reduct @@ -1911,11 +1909,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1925,7 +1923,7 @@ ___ ### uor -▸ **uor**(`b`): [BN](externals.bn-1.md) +▸ **uor**(`b`): [`BN`](BN.md) **`description`** or @@ -1933,11 +1931,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1947,7 +1945,7 @@ ___ ### ushln -▸ **ushln**(`b`): [BN](externals.bn-1.md) +▸ **ushln**(`b`): [`BN`](BN.md) **`description`** shift left @@ -1959,7 +1957,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1969,7 +1967,7 @@ ___ ### ushrn -▸ **ushrn**(`b`): [BN](externals.bn-1.md) +▸ **ushrn**(`b`): [`BN`](BN.md) **`description`** shift right @@ -1981,7 +1979,7 @@ ___ #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -1991,7 +1989,7 @@ ___ ### uxor -▸ **uxor**(`b`): [BN](externals.bn-1.md) +▸ **uxor**(`b`): [`BN`](BN.md) **`description`** xor @@ -1999,11 +1997,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -2013,7 +2011,7 @@ ___ ### xor -▸ **xor**(`b`): [BN](externals.bn-1.md) +▸ **xor**(`b`): [`BN`](BN.md) **`description`** xor @@ -2021,11 +2019,11 @@ ___ | Name | Type | | :------ | :------ | -| `b` | [BN](externals.bn-1.md) | +| `b` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -2073,7 +2071,7 @@ ___ ### max -▸ `Static` **max**(`left`, `right`): [BN](externals.bn-1.md) +▸ `Static` **max**(`left`, `right`): [`BN`](BN.md) **`description`** returns the maximum of 2 BN instances. @@ -2081,12 +2079,12 @@ ___ | Name | Type | | :------ | :------ | -| `left` | [BN](externals.bn-1.md) | -| `right` | [BN](externals.bn-1.md) | +| `left` | [`BN`](BN.md) | +| `right` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -2096,7 +2094,7 @@ ___ ### min -▸ `Static` **min**(`left`, `right`): [BN](externals.bn-1.md) +▸ `Static` **min**(`left`, `right`): [`BN`](BN.md) **`description`** returns the minimum of 2 BN instances. @@ -2104,12 +2102,12 @@ ___ | Name | Type | | :------ | :------ | -| `left` | [BN](externals.bn-1.md) | -| `right` | [BN](externals.bn-1.md) | +| `left` | [`BN`](BN.md) | +| `right` | [`BN`](BN.md) | #### Returns -[BN](externals.bn-1.md) +[`BN`](BN.md) #### Defined in @@ -2119,7 +2117,7 @@ ___ ### mont -▸ `Static` **mont**(`num`): [ReductionContext](../interfaces/externals.bn.reductioncontext.md) +▸ `Static` **mont**(`num`): [`ReductionContext`](../interfaces/BN.ReductionContext.md) **`description`** create a reduction context with the Montgomery trick. @@ -2127,11 +2125,11 @@ ___ | Name | Type | | :------ | :------ | -| `num` | [BN](externals.bn-1.md) | +| `num` | [`BN`](BN.md) | #### Returns -[ReductionContext](../interfaces/externals.bn.reductioncontext.md) +[`ReductionContext`](../interfaces/BN.ReductionContext.md) #### Defined in @@ -2141,7 +2139,7 @@ ___ ### red -▸ `Static` **red**(`reductionContext`): [ReductionContext](../interfaces/externals.bn.reductioncontext.md) +▸ `Static` **red**(`reductionContext`): [`ReductionContext`](../interfaces/BN.ReductionContext.md) **`description`** create a reduction context @@ -2149,11 +2147,11 @@ ___ | Name | Type | | :------ | :------ | -| `reductionContext` | [BN](externals.bn-1.md) \| ``"k256"`` \| ``"p224"`` \| ``"p192"`` \| ``"p25519"`` | +| `reductionContext` | [`BN`](BN.md) \| [`IPrimeName`](../modules/BN.md#iprimename) | #### Returns -[ReductionContext](../interfaces/externals.bn.reductioncontext.md) +[`ReductionContext`](../interfaces/BN.ReductionContext.md) #### Defined in diff --git a/packages/util/docs/enums/types.typeoutput.md b/packages/util/docs/enums/TypeOutput.md similarity index 67% rename from packages/util/docs/enums/types.typeoutput.md rename to packages/util/docs/enums/TypeOutput.md index d4ae93d9b4..a34787a02a 100644 --- a/packages/util/docs/enums/types.typeoutput.md +++ b/packages/util/docs/enums/TypeOutput.md @@ -1,25 +1,23 @@ -[ethereumjs-util](../README.md) / [types](../modules/types.md) / TypeOutput +[ethereumjs-util](../README.md) / TypeOutput # Enumeration: TypeOutput -[types](../modules/types.md).TypeOutput - Type output options ## Table of contents ### Enumeration members -- [BN](types.typeoutput.md#bn) -- [Buffer](types.typeoutput.md#buffer) -- [Number](types.typeoutput.md#number) -- [PrefixedHexString](types.typeoutput.md#prefixedhexstring) +- [BN](TypeOutput.md#bn) +- [Buffer](TypeOutput.md#buffer) +- [Number](TypeOutput.md#number) +- [PrefixedHexString](TypeOutput.md#prefixedhexstring) ## Enumeration members ### BN -• **BN** = 1 +• **BN** = `1` #### Defined in @@ -29,7 +27,7 @@ ___ ### Buffer -• **Buffer** = 2 +• **Buffer** = `2` #### Defined in @@ -39,7 +37,7 @@ ___ ### Number -• **Number** = 0 +• **Number** = `0` #### Defined in @@ -49,7 +47,7 @@ ___ ### PrefixedHexString -• **PrefixedHexString** = 3 +• **PrefixedHexString** = `3` #### Defined in diff --git a/packages/util/docs/interfaces/AccountData.md b/packages/util/docs/interfaces/AccountData.md new file mode 100644 index 0000000000..9da02196de --- /dev/null +++ b/packages/util/docs/interfaces/AccountData.md @@ -0,0 +1,52 @@ +[ethereumjs-util](../README.md) / AccountData + +# Interface: AccountData + +## Table of contents + +### Properties + +- [balance](AccountData.md#balance) +- [codeHash](AccountData.md#codehash) +- [nonce](AccountData.md#nonce) +- [stateRoot](AccountData.md#stateroot) + +## Properties + +### balance + +• `Optional` **balance**: [`BNLike`](../README.md#bnlike) + +#### Defined in + +[packages/util/src/account.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L19) + +___ + +### codeHash + +• `Optional` **codeHash**: [`BufferLike`](../README.md#bufferlike) + +#### Defined in + +[packages/util/src/account.ts:21](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L21) + +___ + +### nonce + +• `Optional` **nonce**: [`BNLike`](../README.md#bnlike) + +#### Defined in + +[packages/util/src/account.ts:18](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L18) + +___ + +### stateRoot + +• `Optional` **stateRoot**: [`BufferLike`](../README.md#bufferlike) + +#### Defined in + +[packages/util/src/account.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L20) diff --git a/packages/util/docs/interfaces/BN.MPrime.md b/packages/util/docs/interfaces/BN.MPrime.md new file mode 100644 index 0000000000..f4685909b6 --- /dev/null +++ b/packages/util/docs/interfaces/BN.MPrime.md @@ -0,0 +1,54 @@ +[ethereumjs-util](../README.md) / [BN](../modules/BN.md) / MPrime + +# Interface: MPrime + +[BN](../modules/BN.md).MPrime + +## Table of contents + +### Properties + +- [k](BN.MPrime.md#k) +- [n](BN.MPrime.md#n) +- [name](BN.MPrime.md#name) +- [p](BN.MPrime.md#p) + +## Properties + +### k + +• **k**: [`BN`](../classes/BN.md) + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:18 + +___ + +### n + +• **n**: `number` + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:17 + +___ + +### name + +• **name**: `string` + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:15 + +___ + +### p + +• **p**: [`BN`](../classes/BN.md) + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:16 diff --git a/packages/util/docs/interfaces/BN.ReductionContext.md b/packages/util/docs/interfaces/BN.ReductionContext.md new file mode 100644 index 0000000000..c761759ba5 --- /dev/null +++ b/packages/util/docs/interfaces/BN.ReductionContext.md @@ -0,0 +1,36 @@ +[ethereumjs-util](../README.md) / [BN](../modules/BN.md) / ReductionContext + +# Interface: ReductionContext + +[BN](../modules/BN.md).ReductionContext + +## Indexable + +▪ [key: `string`]: `any` + +## Table of contents + +### Properties + +- [m](BN.ReductionContext.md#m) +- [prime](BN.ReductionContext.md#prime) + +## Properties + +### m + +• **m**: `number` + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:22 + +___ + +### prime + +• **prime**: [`MPrime`](BN.MPrime.md) + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:23 diff --git a/packages/util/docs/interfaces/signature.ecdsasignature.md b/packages/util/docs/interfaces/ECDSASignature.md similarity index 71% rename from packages/util/docs/interfaces/signature.ecdsasignature.md rename to packages/util/docs/interfaces/ECDSASignature.md index 918c137aea..75532ea8a7 100644 --- a/packages/util/docs/interfaces/signature.ecdsasignature.md +++ b/packages/util/docs/interfaces/ECDSASignature.md @@ -1,16 +1,14 @@ -[ethereumjs-util](../README.md) / [signature](../modules/signature.md) / ECDSASignature +[ethereumjs-util](../README.md) / ECDSASignature # Interface: ECDSASignature -[signature](../modules/signature.md).ECDSASignature - ## Table of contents ### Properties -- [r](signature.ecdsasignature.md#r) -- [s](signature.ecdsasignature.md#s) -- [v](signature.ecdsasignature.md#v) +- [r](ECDSASignature.md#r) +- [s](ECDSASignature.md#s) +- [v](ECDSASignature.md#v) ## Properties diff --git a/packages/util/docs/interfaces/signature.ecdsasignaturebuffer.md b/packages/util/docs/interfaces/ECDSASignatureBuffer.md similarity index 69% rename from packages/util/docs/interfaces/signature.ecdsasignaturebuffer.md rename to packages/util/docs/interfaces/ECDSASignatureBuffer.md index 8f98890ee8..7cf2ebf168 100644 --- a/packages/util/docs/interfaces/signature.ecdsasignaturebuffer.md +++ b/packages/util/docs/interfaces/ECDSASignatureBuffer.md @@ -1,16 +1,14 @@ -[ethereumjs-util](../README.md) / [signature](../modules/signature.md) / ECDSASignatureBuffer +[ethereumjs-util](../README.md) / ECDSASignatureBuffer # Interface: ECDSASignatureBuffer -[signature](../modules/signature.md).ECDSASignatureBuffer - ## Table of contents ### Properties -- [r](signature.ecdsasignaturebuffer.md#r) -- [s](signature.ecdsasignaturebuffer.md#s) -- [v](signature.ecdsasignaturebuffer.md#v) +- [r](ECDSASignatureBuffer.md#r) +- [s](ECDSASignatureBuffer.md#s) +- [v](ECDSASignatureBuffer.md#v) ## Properties diff --git a/packages/util/docs/interfaces/types.transformabletoarray.md b/packages/util/docs/interfaces/TransformableToArray.md similarity index 68% rename from packages/util/docs/interfaces/types.transformabletoarray.md rename to packages/util/docs/interfaces/TransformableToArray.md index ffffae4bc6..f02da58436 100644 --- a/packages/util/docs/interfaces/types.transformabletoarray.md +++ b/packages/util/docs/interfaces/TransformableToArray.md @@ -1,15 +1,13 @@ -[ethereumjs-util](../README.md) / [types](../modules/types.md) / TransformableToArray +[ethereumjs-util](../README.md) / TransformableToArray # Interface: TransformableToArray -[types](../modules/types.md).TransformableToArray - ## Table of contents ### Methods -- [toArray](types.transformabletoarray.md#toarray) -- [toBuffer](types.transformabletoarray.md#tobuffer) +- [toArray](TransformableToArray.md#toarray) +- [toBuffer](TransformableToArray.md#tobuffer) ## Methods diff --git a/packages/util/docs/interfaces/types.transformabletobuffer.md b/packages/util/docs/interfaces/TransformableToBuffer.md similarity index 68% rename from packages/util/docs/interfaces/types.transformabletobuffer.md rename to packages/util/docs/interfaces/TransformableToBuffer.md index 16abad4f2f..4c7001ad13 100644 --- a/packages/util/docs/interfaces/types.transformabletobuffer.md +++ b/packages/util/docs/interfaces/TransformableToBuffer.md @@ -1,15 +1,13 @@ -[ethereumjs-util](../README.md) / [types](../modules/types.md) / TransformableToBuffer +[ethereumjs-util](../README.md) / TransformableToBuffer # Interface: TransformableToBuffer -[types](../modules/types.md).TransformableToBuffer - ## Table of contents ### Methods -- [toArray](types.transformabletobuffer.md#toarray) -- [toBuffer](types.transformabletobuffer.md#tobuffer) +- [toArray](TransformableToBuffer.md#toarray) +- [toBuffer](TransformableToBuffer.md#tobuffer) ## Methods diff --git a/packages/util/docs/interfaces/account.accountdata.md b/packages/util/docs/interfaces/account.accountdata.md deleted file mode 100644 index 30c9e9eac7..0000000000 --- a/packages/util/docs/interfaces/account.accountdata.md +++ /dev/null @@ -1,54 +0,0 @@ -[ethereumjs-util](../README.md) / [account](../modules/account.md) / AccountData - -# Interface: AccountData - -[account](../modules/account.md).AccountData - -## Table of contents - -### Properties - -- [balance](account.accountdata.md#balance) -- [codeHash](account.accountdata.md#codehash) -- [nonce](account.accountdata.md#nonce) -- [stateRoot](account.accountdata.md#stateroot) - -## Properties - -### balance - -• `Optional` **balance**: `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) - -#### Defined in - -[packages/util/src/account.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L19) - -___ - -### codeHash - -• `Optional` **codeHash**: `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| `number`[] \| [TransformableToBuffer](types.transformabletobuffer.md) - -#### Defined in - -[packages/util/src/account.ts:21](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L21) - -___ - -### nonce - -• `Optional` **nonce**: `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) - -#### Defined in - -[packages/util/src/account.ts:18](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L18) - -___ - -### stateRoot - -• `Optional` **stateRoot**: `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| `number`[] \| [TransformableToBuffer](types.transformabletobuffer.md) - -#### Defined in - -[packages/util/src/account.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L20) diff --git a/packages/util/docs/interfaces/externals.bn.mprime.md b/packages/util/docs/interfaces/externals.bn.mprime.md deleted file mode 100644 index a9454e3c47..0000000000 --- a/packages/util/docs/interfaces/externals.bn.mprime.md +++ /dev/null @@ -1,54 +0,0 @@ -[ethereumjs-util](../README.md) / [externals](../modules/externals.md) / [BN](../modules/externals.bn.md) / MPrime - -# Interface: MPrime - -[externals](../modules/externals.md).[BN](../modules/externals.bn.md).MPrime - -## Table of contents - -### Properties - -- [k](externals.bn.mprime.md#k) -- [n](externals.bn.mprime.md#n) -- [name](externals.bn.mprime.md#name) -- [p](externals.bn.mprime.md#p) - -## Properties - -### k - -• **k**: [BN](../classes/externals.bn-1.md) - -#### Defined in - -node_modules/@types/bn.js/index.d.ts:18 - -___ - -### n - -• **n**: `number` - -#### Defined in - -node_modules/@types/bn.js/index.d.ts:17 - -___ - -### name - -• **name**: `string` - -#### Defined in - -node_modules/@types/bn.js/index.d.ts:15 - -___ - -### p - -• **p**: [BN](../classes/externals.bn-1.md) - -#### Defined in - -node_modules/@types/bn.js/index.d.ts:16 diff --git a/packages/util/docs/interfaces/externals.bn.reductioncontext.md b/packages/util/docs/interfaces/externals.bn.reductioncontext.md deleted file mode 100644 index b54263cbed..0000000000 --- a/packages/util/docs/interfaces/externals.bn.reductioncontext.md +++ /dev/null @@ -1,36 +0,0 @@ -[ethereumjs-util](../README.md) / [externals](../modules/externals.md) / [BN](../modules/externals.bn.md) / ReductionContext - -# Interface: ReductionContext - -[externals](../modules/externals.md).[BN](../modules/externals.bn.md).ReductionContext - -## Indexable - -▪ [key: `string`]: `any` - -## Table of contents - -### Properties - -- [m](externals.bn.reductioncontext.md#m) -- [prime](externals.bn.reductioncontext.md#prime) - -## Properties - -### m - -• **m**: `number` - -#### Defined in - -node_modules/@types/bn.js/index.d.ts:22 - -___ - -### prime - -• **prime**: [MPrime](externals.bn.mprime.md) - -#### Defined in - -node_modules/@types/bn.js/index.d.ts:23 diff --git a/packages/util/docs/interfaces/externals.rlp.decoded.md b/packages/util/docs/interfaces/externals.rlp.decoded.md deleted file mode 100644 index ef3b0faf79..0000000000 --- a/packages/util/docs/interfaces/externals.rlp.decoded.md +++ /dev/null @@ -1,32 +0,0 @@ -[ethereumjs-util](../README.md) / [externals](../modules/externals.md) / [rlp](../modules/externals.rlp.md) / Decoded - -# Interface: Decoded - -[externals](../modules/externals.md).[rlp](../modules/externals.rlp.md).Decoded - -## Table of contents - -### Properties - -- [data](externals.rlp.decoded.md#data) -- [remainder](externals.rlp.decoded.md#remainder) - -## Properties - -### data - -• **data**: `Buffer` \| `Buffer`[] - -#### Defined in - -node_modules/rlp/dist/types.d.ts:7 - -___ - -### remainder - -• **remainder**: `Buffer` - -#### Defined in - -node_modules/rlp/dist/types.d.ts:8 diff --git a/packages/util/docs/interfaces/externals.rlp.list.md b/packages/util/docs/interfaces/externals.rlp.list.md deleted file mode 100644 index 2063b59cdb..0000000000 --- a/packages/util/docs/interfaces/externals.rlp.list.md +++ /dev/null @@ -1,1138 +0,0 @@ -[ethereumjs-util](../README.md) / [externals](../modules/externals.md) / [rlp](../modules/externals.rlp.md) / List - -# Interface: List - -[externals](../modules/externals.md).[rlp](../modules/externals.rlp.md).List - -## Hierarchy - -- `Array`<[Input](../modules/externals.rlp.md#input)\> - - ↳ **List** - -## Table of contents - -### Properties - -- [lastIndex](externals.rlp.list.md#lastindex) -- [lastItem](externals.rlp.list.md#lastitem) -- [length](externals.rlp.list.md#length) - -### Methods - -- [[Symbol.iterator]](externals.rlp.list.md#[symbol.iterator]) -- [[Symbol.unscopables]](externals.rlp.list.md#[symbol.unscopables]) -- [concat](externals.rlp.list.md#concat) -- [copyWithin](externals.rlp.list.md#copywithin) -- [entries](externals.rlp.list.md#entries) -- [every](externals.rlp.list.md#every) -- [fill](externals.rlp.list.md#fill) -- [filter](externals.rlp.list.md#filter) -- [find](externals.rlp.list.md#find) -- [findIndex](externals.rlp.list.md#findindex) -- [forEach](externals.rlp.list.md#foreach) -- [includes](externals.rlp.list.md#includes) -- [indexOf](externals.rlp.list.md#indexof) -- [join](externals.rlp.list.md#join) -- [keys](externals.rlp.list.md#keys) -- [lastIndexOf](externals.rlp.list.md#lastindexof) -- [map](externals.rlp.list.md#map) -- [pop](externals.rlp.list.md#pop) -- [push](externals.rlp.list.md#push) -- [reduce](externals.rlp.list.md#reduce) -- [reduceRight](externals.rlp.list.md#reduceright) -- [reverse](externals.rlp.list.md#reverse) -- [shift](externals.rlp.list.md#shift) -- [slice](externals.rlp.list.md#slice) -- [some](externals.rlp.list.md#some) -- [sort](externals.rlp.list.md#sort) -- [splice](externals.rlp.list.md#splice) -- [toLocaleString](externals.rlp.list.md#tolocalestring) -- [toString](externals.rlp.list.md#tostring) -- [turn](externals.rlp.list.md#turn) -- [unshift](externals.rlp.list.md#unshift) -- [values](externals.rlp.list.md#values) - -## Properties - -### lastIndex - -• `Readonly` **lastIndex**: `number` - -#### Inherited from - -Array.lastIndex - -#### Defined in - -node_modules/@types/core-js/index.d.ts:88 - -___ - -### lastItem - -• **lastItem**: [Input](../modules/externals.rlp.md#input) - -#### Inherited from - -Array.lastItem - -#### Defined in - -node_modules/@types/core-js/index.d.ts:87 - -___ - -### length - -• **length**: `number` - -Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - -#### Inherited from - -Array.length - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1215 - -## Methods - -### [Symbol.iterator] - -▸ **[Symbol.iterator]**(): `IterableIterator`<[Input](../modules/externals.rlp.md#input)\> - -Iterator - -#### Returns - -`IterableIterator`<[Input](../modules/externals.rlp.md#input)\> - -#### Inherited from - -Array.\_\_@iterator - -#### Defined in - -node_modules/typescript/lib/lib.es2015.iterable.d.ts:60 - -___ - -### [Symbol.unscopables] - -▸ **[Symbol.unscopables]**(): `Object` - -Returns an object whose properties have the value 'true' -when they will be absent when used in a 'with' statement. - -#### Returns - -`Object` - -| Name | Type | -| :------ | :------ | -| `copyWithin` | `boolean` | -| `entries` | `boolean` | -| `fill` | `boolean` | -| `find` | `boolean` | -| `findIndex` | `boolean` | -| `keys` | `boolean` | -| `values` | `boolean` | - -#### Inherited from - -Array.\_\_@unscopables - -#### Defined in - -node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:94 - -___ - -### concat - -▸ **concat**(...`items`): [Input](../modules/externals.rlp.md#input)[] - -Combines two or more arrays. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `...items` | `ConcatArray`<[Input](../modules/externals.rlp.md#input)\>[] | Additional items to add to the end of array1. | - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.concat - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1237 - -▸ **concat**(...`items`): [Input](../modules/externals.rlp.md#input)[] - -Combines two or more arrays. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `...items` | (``null`` \| `string` \| `number` \| `bigint` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| [List](externals.rlp.list.md) \| `ConcatArray`<[Input](../modules/externals.rlp.md#input)\>)[] | Additional items to add to the end of array1. | - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.concat - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1242 - -___ - -### copyWithin - -▸ **copyWithin**(`target`, `start`, `end?`): [List](externals.rlp.list.md) - -Returns the this object after copying a section of the array identified by start and end -to the same array starting at position target - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `target` | `number` | If target is negative, it is treated as length+target where length is the length of the array. | -| `start` | `number` | If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. | -| `end?` | `number` | If not specified, length of the this object is used as its default value. | - -#### Returns - -[List](externals.rlp.list.md) - -#### Inherited from - -Array.copyWithin - -#### Defined in - -node_modules/typescript/lib/lib.es2015.core.d.ts:64 - -___ - -### entries - -▸ **entries**(): `IterableIterator`<[`number`, [Input](../modules/externals.rlp.md#input)]\> - -Returns an iterable of key, value pairs for every entry in the array - -#### Returns - -`IterableIterator`<[`number`, [Input](../modules/externals.rlp.md#input)]\> - -#### Inherited from - -Array.entries - -#### Defined in - -node_modules/typescript/lib/lib.es2015.iterable.d.ts:65 - -___ - -### every - -▸ **every**(`callbackfn`, `thisArg?`): `boolean` - -Determines whether all the members of an array satisfy the specified test. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `unknown` | A function that accepts up to three arguments. The every method calls the callbackfn function for each element in the array until the callbackfn returns a value which is coercible to the Boolean value false, or until the end of the array. | -| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | - -#### Returns - -`boolean` - -#### Inherited from - -Array.every - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1310 - -___ - -### fill - -▸ **fill**(`value`, `start?`, `end?`): [List](externals.rlp.list.md) - -Returns the this object after filling the section identified by start and end with value - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `value` | [Input](../modules/externals.rlp.md#input) | value to fill array section with | -| `start?` | `number` | index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. | -| `end?` | `number` | index to stop filling the array at. If end is negative, it is treated as length+end. | - -#### Returns - -[List](externals.rlp.list.md) - -#### Inherited from - -Array.fill - -#### Defined in - -node_modules/typescript/lib/lib.es2015.core.d.ts:53 - -___ - -### filter - -▸ **filter**(`callbackfn`, `thisArg?`): `S`[] - -Returns the elements of an array that meet the condition specified in a callback function. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `S` | `S`: [Input](../modules/externals.rlp.md#input) | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => value is S | A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. | -| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | - -#### Returns - -`S`[] - -#### Inherited from - -Array.filter - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1337 - -▸ **filter**(`callbackfn`, `thisArg?`): [Input](../modules/externals.rlp.md#input)[] - -Returns the elements of an array that meet the condition specified in a callback function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `unknown` | A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. | -| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.filter - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1343 - -___ - -### find - -▸ **find**(`predicate`, `thisArg?`): `undefined` \| `S` - -Returns the value of the first element in the array where predicate is true, and undefined -otherwise. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `S` | `S`: [Input](../modules/externals.rlp.md#input) | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `predicate` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `obj`: [Input](../modules/externals.rlp.md#input)[]) => value is S | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. | -| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | - -#### Returns - -`undefined` \| `S` - -#### Inherited from - -Array.find - -#### Defined in - -node_modules/typescript/lib/lib.es2015.core.d.ts:31 - -▸ **find**(`predicate`, `thisArg?`): `undefined` \| ``null`` \| `string` \| `number` \| `bigint` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| [List](externals.rlp.list.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `predicate` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `obj`: [Input](../modules/externals.rlp.md#input)[]) => `unknown` | -| `thisArg?` | `any` | - -#### Returns - -`undefined` \| ``null`` \| `string` \| `number` \| `bigint` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| [List](externals.rlp.list.md) - -#### Inherited from - -Array.find - -#### Defined in - -node_modules/typescript/lib/lib.es2015.core.d.ts:32 - -___ - -### findIndex - -▸ **findIndex**(`predicate`, `thisArg?`): `number` - -Returns the index of the first element in the array where predicate is true, and -1 -otherwise. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `predicate` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `obj`: [Input](../modules/externals.rlp.md#input)[]) => `unknown` | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. | -| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | - -#### Returns - -`number` - -#### Inherited from - -Array.findIndex - -#### Defined in - -node_modules/typescript/lib/lib.es2015.core.d.ts:43 - -___ - -### forEach - -▸ **forEach**(`callbackfn`, `thisArg?`): `void` - -Performs the specified action for each element in an array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `void` | A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. | -| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | - -#### Returns - -`void` - -#### Inherited from - -Array.forEach - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1325 - -___ - -### includes - -▸ **includes**(`searchElement`, `fromIndex?`): `boolean` - -Determines whether an array includes a certain element, returning true or false as appropriate. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `searchElement` | [Input](../modules/externals.rlp.md#input) | The element to search for. | -| `fromIndex?` | `number` | The position in this array at which to begin searching for searchElement. | - -#### Returns - -`boolean` - -#### Inherited from - -Array.includes - -#### Defined in - -node_modules/typescript/lib/lib.es2016.array.include.d.ts:27 - -___ - -### indexOf - -▸ **indexOf**(`searchElement`, `fromIndex?`): `number` - -Returns the index of the first occurrence of a value in an array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `searchElement` | [Input](../modules/externals.rlp.md#input) | The value to locate in the array. | -| `fromIndex?` | `number` | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | - -#### Returns - -`number` - -#### Inherited from - -Array.indexOf - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1295 - -___ - -### join - -▸ **join**(`separator?`): `string` - -Adds all the elements of an array separated by the specified separator string. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `separator?` | `string` | A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. | - -#### Returns - -`string` - -#### Inherited from - -Array.join - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1247 - -___ - -### keys - -▸ **keys**(): `IterableIterator` - -Returns an iterable of keys in the array - -#### Returns - -`IterableIterator` - -#### Inherited from - -Array.keys - -#### Defined in - -node_modules/typescript/lib/lib.es2015.iterable.d.ts:70 - -___ - -### lastIndexOf - -▸ **lastIndexOf**(`searchElement`, `fromIndex?`): `number` - -Returns the index of the last occurrence of a specified value in an array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `searchElement` | [Input](../modules/externals.rlp.md#input) | The value to locate in the array. | -| `fromIndex?` | `number` | The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. | - -#### Returns - -`number` - -#### Inherited from - -Array.lastIndexOf - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1301 - -___ - -### map - -▸ **map**(`callbackfn`, `thisArg?`): `U`[] - -Calls a defined callback function on each element of an array, and returns an array that contains the results. - -#### Type parameters - -| Name | -| :------ | -| `U` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `U` | A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. | -| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | - -#### Returns - -`U`[] - -#### Inherited from - -Array.map - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1331 - -___ - -### pop - -▸ **pop**(): `undefined` \| ``null`` \| `string` \| `number` \| `bigint` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| [List](externals.rlp.list.md) - -Removes the last element from an array and returns it. - -#### Returns - -`undefined` \| ``null`` \| `string` \| `number` \| `bigint` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| [List](externals.rlp.list.md) - -#### Inherited from - -Array.pop - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1227 - -___ - -### push - -▸ **push**(...`items`): `number` - -Appends new elements to an array, and returns the new length of the array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `...items` | [Input](../modules/externals.rlp.md#input)[] | New elements of the Array. | - -#### Returns - -`number` - -#### Inherited from - -Array.push - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1232 - -___ - -### reduce - -▸ **reduce**(`callbackfn`): [Input](../modules/externals.rlp.md#input) - -Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`previousValue`: [Input](../modules/externals.rlp.md#input), `currentValue`: [Input](../modules/externals.rlp.md#input), `currentIndex`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => [Input](../modules/externals.rlp.md#input) | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | - -#### Returns - -[Input](../modules/externals.rlp.md#input) - -#### Inherited from - -Array.reduce - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1349 - -▸ **reduce**(`callbackfn`, `initialValue`): [Input](../modules/externals.rlp.md#input) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `callbackfn` | (`previousValue`: [Input](../modules/externals.rlp.md#input), `currentValue`: [Input](../modules/externals.rlp.md#input), `currentIndex`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => [Input](../modules/externals.rlp.md#input) | -| `initialValue` | [Input](../modules/externals.rlp.md#input) | - -#### Returns - -[Input](../modules/externals.rlp.md#input) - -#### Inherited from - -Array.reduce - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1350 - -▸ **reduce**(`callbackfn`, `initialValue`): `U` - -Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - -#### Type parameters - -| Name | -| :------ | -| `U` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`previousValue`: `U`, `currentValue`: [Input](../modules/externals.rlp.md#input), `currentIndex`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `U` | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | -| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | - -#### Returns - -`U` - -#### Inherited from - -Array.reduce - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1356 - -___ - -### reduceRight - -▸ **reduceRight**(`callbackfn`): [Input](../modules/externals.rlp.md#input) - -Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`previousValue`: [Input](../modules/externals.rlp.md#input), `currentValue`: [Input](../modules/externals.rlp.md#input), `currentIndex`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => [Input](../modules/externals.rlp.md#input) | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | - -#### Returns - -[Input](../modules/externals.rlp.md#input) - -#### Inherited from - -Array.reduceRight - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1362 - -▸ **reduceRight**(`callbackfn`, `initialValue`): [Input](../modules/externals.rlp.md#input) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `callbackfn` | (`previousValue`: [Input](../modules/externals.rlp.md#input), `currentValue`: [Input](../modules/externals.rlp.md#input), `currentIndex`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => [Input](../modules/externals.rlp.md#input) | -| `initialValue` | [Input](../modules/externals.rlp.md#input) | - -#### Returns - -[Input](../modules/externals.rlp.md#input) - -#### Inherited from - -Array.reduceRight - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1363 - -▸ **reduceRight**(`callbackfn`, `initialValue`): `U` - -Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - -#### Type parameters - -| Name | -| :------ | -| `U` | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`previousValue`: `U`, `currentValue`: [Input](../modules/externals.rlp.md#input), `currentIndex`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `U` | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | -| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | - -#### Returns - -`U` - -#### Inherited from - -Array.reduceRight - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1369 - -___ - -### reverse - -▸ **reverse**(): [Input](../modules/externals.rlp.md#input)[] - -Reverses the elements in an Array. - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.reverse - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1251 - -___ - -### shift - -▸ **shift**(): `undefined` \| ``null`` \| `string` \| `number` \| `bigint` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| [List](externals.rlp.list.md) - -Removes the first element from an array and returns it. - -#### Returns - -`undefined` \| ``null`` \| `string` \| `number` \| `bigint` \| `Buffer` \| [BN](../classes/externals.bn-1.md) \| `Uint8Array` \| [List](externals.rlp.list.md) - -#### Inherited from - -Array.shift - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1255 - -___ - -### slice - -▸ **slice**(`start?`, `end?`): [Input](../modules/externals.rlp.md#input)[] - -Returns a section of an array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `start?` | `number` | The beginning of the specified portion of the array. | -| `end?` | `number` | The end of the specified portion of the array. This is exclusive of the element at the index 'end'. | - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.slice - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1261 - -___ - -### some - -▸ **some**(`callbackfn`, `thisArg?`): `boolean` - -Determines whether the specified callback function returns true for any element of an array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `callbackfn` | (`value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `unknown` | A function that accepts up to three arguments. The some method calls the callbackfn function for each element in the array until the callbackfn returns a value which is coercible to the Boolean value true, or until the end of the array. | -| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | - -#### Returns - -`boolean` - -#### Inherited from - -Array.some - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1319 - -___ - -### sort - -▸ **sort**(`compareFn?`): [List](externals.rlp.list.md) - -Sorts an array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `compareFn?` | (`a`: [Input](../modules/externals.rlp.md#input), `b`: [Input](../modules/externals.rlp.md#input)) => `number` | Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` | - -#### Returns - -[List](externals.rlp.list.md) - -#### Inherited from - -Array.sort - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1271 - -___ - -### splice - -▸ **splice**(`start`, `deleteCount?`): [Input](../modules/externals.rlp.md#input)[] - -Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `start` | `number` | The zero-based location in the array from which to start removing elements. | -| `deleteCount?` | `number` | The number of elements to remove. | - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.splice - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1277 - -▸ **splice**(`start`, `deleteCount`, ...`items`): [Input](../modules/externals.rlp.md#input)[] - -Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `start` | `number` | The zero-based location in the array from which to start removing elements. | -| `deleteCount` | `number` | The number of elements to remove. | -| `...items` | [Input](../modules/externals.rlp.md#input)[] | Elements to insert into the array in place of the deleted elements. | - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.splice - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1284 - -___ - -### toLocaleString - -▸ **toLocaleString**(): `string` - -Returns a string representation of an array. The elements are converted to string using their toLocalString methods. - -#### Returns - -`string` - -#### Inherited from - -Array.toLocaleString - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1223 - -___ - -### toString - -▸ **toString**(): `string` - -Returns a string representation of an array. - -#### Returns - -`string` - -#### Inherited from - -Array.toString - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1219 - -___ - -### turn - -▸ **turn**(`callbackfn`, `memo?`): `U` - -Non-standard. - -#### Type parameters - -| Name | -| :------ | -| `U` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `callbackfn` | (`memo`: `U`, `value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `void` | -| `memo?` | `U` | - -#### Returns - -`U` - -#### Inherited from - -Array.turn - -#### Defined in - -node_modules/@types/core-js/index.d.ts:413 - -▸ **turn**(`callbackfn`, `memo?`): [Input](../modules/externals.rlp.md#input)[] - -Non-standard. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `callbackfn` | (`memo`: [Input](../modules/externals.rlp.md#input)[], `value`: [Input](../modules/externals.rlp.md#input), `index`: `number`, `array`: [Input](../modules/externals.rlp.md#input)[]) => `void` | -| `memo?` | [Input](../modules/externals.rlp.md#input)[] | - -#### Returns - -[Input](../modules/externals.rlp.md#input)[] - -#### Inherited from - -Array.turn - -#### Defined in - -node_modules/@types/core-js/index.d.ts:418 - -___ - -### unshift - -▸ **unshift**(...`items`): `number` - -Inserts new elements at the start of an array. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `...items` | [Input](../modules/externals.rlp.md#input)[] | Elements to insert at the start of the Array. | - -#### Returns - -`number` - -#### Inherited from - -Array.unshift - -#### Defined in - -node_modules/typescript/lib/lib.es5.d.ts:1289 - -___ - -### values - -▸ **values**(): `IterableIterator`<[Input](../modules/externals.rlp.md#input)\> - -Returns an iterable of values in the array - -#### Returns - -`IterableIterator`<[Input](../modules/externals.rlp.md#input)\> - -#### Inherited from - -Array.values - -#### Defined in - -node_modules/typescript/lib/lib.es2015.iterable.d.ts:75 diff --git a/packages/util/docs/interfaces/rlp.Decoded.md b/packages/util/docs/interfaces/rlp.Decoded.md new file mode 100644 index 0000000000..5710221d7f --- /dev/null +++ b/packages/util/docs/interfaces/rlp.Decoded.md @@ -0,0 +1,32 @@ +[ethereumjs-util](../README.md) / [rlp](../modules/rlp.md) / Decoded + +# Interface: Decoded + +[rlp](../modules/rlp.md).Decoded + +## Table of contents + +### Properties + +- [data](rlp.Decoded.md#data) +- [remainder](rlp.Decoded.md#remainder) + +## Properties + +### data + +• **data**: `Buffer` \| `Buffer`[] + +#### Defined in + +node_modules/rlp/dist/types.d.ts:7 + +___ + +### remainder + +• **remainder**: `Buffer` + +#### Defined in + +node_modules/rlp/dist/types.d.ts:8 diff --git a/packages/util/docs/interfaces/rlp.List.md b/packages/util/docs/interfaces/rlp.List.md new file mode 100644 index 0000000000..55f7578b4d --- /dev/null +++ b/packages/util/docs/interfaces/rlp.List.md @@ -0,0 +1,1179 @@ +[ethereumjs-util](../README.md) / [rlp](../modules/rlp.md) / List + +# Interface: List + +[rlp](../modules/rlp.md).List + +## Hierarchy + +- `Array`<[`Input`](../modules/rlp.md#input)\> + + ↳ **`List`** + +## Table of contents + +### Properties + +- [lastIndex](rlp.List.md#lastindex) +- [lastItem](rlp.List.md#lastitem) +- [length](rlp.List.md#length) + +### Methods + +- [[iterator]](rlp.List.md#[iterator]) +- [[unscopables]](rlp.List.md#[unscopables]) +- [concat](rlp.List.md#concat) +- [copyWithin](rlp.List.md#copywithin) +- [entries](rlp.List.md#entries) +- [every](rlp.List.md#every) +- [fill](rlp.List.md#fill) +- [filter](rlp.List.md#filter) +- [find](rlp.List.md#find) +- [findIndex](rlp.List.md#findindex) +- [forEach](rlp.List.md#foreach) +- [includes](rlp.List.md#includes) +- [indexOf](rlp.List.md#indexof) +- [join](rlp.List.md#join) +- [keys](rlp.List.md#keys) +- [lastIndexOf](rlp.List.md#lastindexof) +- [map](rlp.List.md#map) +- [pop](rlp.List.md#pop) +- [push](rlp.List.md#push) +- [reduce](rlp.List.md#reduce) +- [reduceRight](rlp.List.md#reduceright) +- [reverse](rlp.List.md#reverse) +- [shift](rlp.List.md#shift) +- [slice](rlp.List.md#slice) +- [some](rlp.List.md#some) +- [sort](rlp.List.md#sort) +- [splice](rlp.List.md#splice) +- [toLocaleString](rlp.List.md#tolocalestring) +- [toString](rlp.List.md#tostring) +- [turn](rlp.List.md#turn) +- [unshift](rlp.List.md#unshift) +- [values](rlp.List.md#values) + +## Properties + +### lastIndex + +• `Readonly` **lastIndex**: `number` + +#### Inherited from + +Array.lastIndex + +#### Defined in + +node_modules/@types/core-js/index.d.ts:88 + +___ + +### lastItem + +• **lastItem**: [`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.lastItem + +#### Defined in + +node_modules/@types/core-js/index.d.ts:87 + +___ + +### length + +• **length**: `number` + +Gets or sets the length of the array. This is a number one higher than the highest index in the array. + +#### Inherited from + +Array.length + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1224 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`Input`](../modules/rlp.md#input)\> + +Iterator + +#### Returns + +`IterableIterator`<[`Input`](../modules/rlp.md#input)\> + +#### Inherited from + +Array.\_\_@iterator@81 + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:60 + +___ + +### [unscopables] + +▸ **[unscopables]**(): `Object` + +Returns an object whose properties have the value 'true' +when they will be absent when used in a 'with' statement. + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `copyWithin` | `boolean` | +| `entries` | `boolean` | +| `fill` | `boolean` | +| `find` | `boolean` | +| `findIndex` | `boolean` | +| `keys` | `boolean` | +| `values` | `boolean` | + +#### Inherited from + +Array.\_\_@unscopables@105 + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:99 + +___ + +### concat + +▸ **concat**(...`items`): [`Input`](../modules/rlp.md#input)[] + +Combines two or more arrays. +This method returns a new array without modifying any existing arrays. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...items` | `ConcatArray`<[`Input`](../modules/rlp.md#input)\>[] | Additional arrays and/or items to add to the end of the array. | + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +#### Inherited from + +Array.concat + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1248 + +▸ **concat**(...`items`): [`Input`](../modules/rlp.md#input)[] + +Combines two or more arrays. +This method returns a new array without modifying any existing arrays. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...items` | ([`Input`](../modules/rlp.md#input) \| `ConcatArray`<[`Input`](../modules/rlp.md#input)\>)[] | Additional arrays and/or items to add to the end of the array. | + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +#### Inherited from + +Array.concat + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1254 + +___ + +### copyWithin + +▸ **copyWithin**(`target`, `start`, `end?`): [`List`](rlp.List.md) + +Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `target` | `number` | If target is negative, it is treated as length+target where length is the length of the array. | +| `start` | `number` | If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. | +| `end?` | `number` | If not specified, length of the this object is used as its default value. | + +#### Returns + +[`List`](rlp.List.md) + +#### Inherited from + +Array.copyWithin + +#### Defined in + +node_modules/typescript/lib/lib.es2015.core.d.ts:64 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`number`, [`Input`](../modules/rlp.md#input)]\> + +Returns an iterable of key, value pairs for every entry in the array + +#### Returns + +`IterableIterator`<[`number`, [`Input`](../modules/rlp.md#input)]\> + +#### Inherited from + +Array.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:65 + +___ + +### every + +▸ **every**<`S`\>(`predicate`, `thisArg?`): this is S[] + +Determines whether all the members of an array satisfy the specified test. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `S` | extends [`Input`](../modules/rlp.md#input) | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => value is S | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +this is S[] + +#### Inherited from + +Array.every + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1331 + +▸ **every**(`predicate`, `thisArg?`): `boolean` + +Determines whether all the members of an array satisfy the specified test. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `unknown` | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`boolean` + +#### Inherited from + +Array.every + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1340 + +___ + +### fill + +▸ **fill**(`value`, `start?`, `end?`): [`List`](rlp.List.md) + +Changes all array elements from `start` to `end` index to a static `value` and returns the modified array + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `value` | [`Input`](../modules/rlp.md#input) | value to fill array section with | +| `start?` | `number` | index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. | +| `end?` | `number` | index to stop filling the array at. If end is negative, it is treated as length+end. | + +#### Returns + +[`List`](rlp.List.md) + +#### Inherited from + +Array.fill + +#### Defined in + +node_modules/typescript/lib/lib.es2015.core.d.ts:53 + +___ + +### filter + +▸ **filter**<`S`\>(`predicate`, `thisArg?`): `S`[] + +Returns the elements of an array that meet the condition specified in a callback function. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `S` | extends [`Input`](../modules/rlp.md#input) | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => value is S | A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`S`[] + +#### Inherited from + +Array.filter + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1367 + +▸ **filter**(`predicate`, `thisArg?`): [`Input`](../modules/rlp.md#input)[] + +Returns the elements of an array that meet the condition specified in a callback function. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `unknown` | A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +#### Inherited from + +Array.filter + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1373 + +___ + +### find + +▸ **find**<`S`\>(`predicate`, `thisArg?`): `undefined` \| `S` + +Returns the value of the first element in the array where predicate is true, and undefined +otherwise. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `S` | extends [`Input`](../modules/rlp.md#input) | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `obj`: [`Input`](../modules/rlp.md#input)[]) => value is S | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. | +| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +#### Returns + +`undefined` \| `S` + +#### Inherited from + +Array.find + +#### Defined in + +node_modules/typescript/lib/lib.es2015.core.d.ts:31 + +▸ **find**(`predicate`, `thisArg?`): `undefined` \| [`Input`](../modules/rlp.md#input) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `obj`: [`Input`](../modules/rlp.md#input)[]) => `unknown` | +| `thisArg?` | `any` | + +#### Returns + +`undefined` \| [`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.find + +#### Defined in + +node_modules/typescript/lib/lib.es2015.core.d.ts:32 + +___ + +### findIndex + +▸ **findIndex**(`predicate`, `thisArg?`): `number` + +Returns the index of the first element in the array where predicate is true, and -1 +otherwise. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `obj`: [`Input`](../modules/rlp.md#input)[]) => `unknown` | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. | +| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +#### Returns + +`number` + +#### Inherited from + +Array.findIndex + +#### Defined in + +node_modules/typescript/lib/lib.es2015.core.d.ts:43 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Performs the specified action for each element in an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `void` | A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`void` + +#### Inherited from + +Array.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1355 + +___ + +### includes + +▸ **includes**(`searchElement`, `fromIndex?`): `boolean` + +Determines whether an array includes a certain element, returning true or false as appropriate. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `searchElement` | [`Input`](../modules/rlp.md#input) | The element to search for. | +| `fromIndex?` | `number` | The position in this array at which to begin searching for searchElement. | + +#### Returns + +`boolean` + +#### Inherited from + +Array.includes + +#### Defined in + +node_modules/typescript/lib/lib.es2016.array.include.d.ts:27 + +___ + +### indexOf + +▸ **indexOf**(`searchElement`, `fromIndex?`): `number` + +Returns the index of the first occurrence of a value in an array, or -1 if it is not present. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `searchElement` | [`Input`](../modules/rlp.md#input) | The value to locate in the array. | +| `fromIndex?` | `number` | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | + +#### Returns + +`number` + +#### Inherited from + +Array.indexOf + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1316 + +___ + +### join + +▸ **join**(`separator?`): `string` + +Adds all the elements of an array into a string, separated by the specified separator string. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `separator?` | `string` | A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma. | + +#### Returns + +`string` + +#### Inherited from + +Array.join + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1259 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`number`\> + +Returns an iterable of keys in the array + +#### Returns + +`IterableIterator`<`number`\> + +#### Inherited from + +Array.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:70 + +___ + +### lastIndexOf + +▸ **lastIndexOf**(`searchElement`, `fromIndex?`): `number` + +Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `searchElement` | [`Input`](../modules/rlp.md#input) | The value to locate in the array. | +| `fromIndex?` | `number` | The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array. | + +#### Returns + +`number` + +#### Inherited from + +Array.lastIndexOf + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1322 + +___ + +### map + +▸ **map**<`U`\>(`callbackfn`, `thisArg?`): `U`[] + +Calls a defined callback function on each element of an array, and returns an array that contains the results. + +#### Type parameters + +| Name | +| :------ | +| `U` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `U` | A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`U`[] + +#### Inherited from + +Array.map + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1361 + +___ + +### pop + +▸ **pop**(): `undefined` \| [`Input`](../modules/rlp.md#input) + +Removes the last element from an array and returns it. +If the array is empty, undefined is returned and the array is not modified. + +#### Returns + +`undefined` \| [`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.pop + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1237 + +___ + +### push + +▸ **push**(...`items`): `number` + +Appends new elements to the end of an array, and returns the new length of the array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...items` | [`Input`](../modules/rlp.md#input)[] | New elements to add to the array. | + +#### Returns + +`number` + +#### Inherited from + +Array.push + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1242 + +___ + +### reduce + +▸ **reduce**(`callbackfn`): [`Input`](../modules/rlp.md#input) + +Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: [`Input`](../modules/rlp.md#input), `currentValue`: [`Input`](../modules/rlp.md#input), `currentIndex`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => [`Input`](../modules/rlp.md#input) | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | + +#### Returns + +[`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.reduce + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1379 + +▸ **reduce**(`callbackfn`, `initialValue`): [`Input`](../modules/rlp.md#input) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`previousValue`: [`Input`](../modules/rlp.md#input), `currentValue`: [`Input`](../modules/rlp.md#input), `currentIndex`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => [`Input`](../modules/rlp.md#input) | +| `initialValue` | [`Input`](../modules/rlp.md#input) | + +#### Returns + +[`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.reduce + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1380 + +▸ **reduce**<`U`\>(`callbackfn`, `initialValue`): `U` + +Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + +#### Type parameters + +| Name | +| :------ | +| `U` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: `U`, `currentValue`: [`Input`](../modules/rlp.md#input), `currentIndex`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `U` | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | +| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +#### Returns + +`U` + +#### Inherited from + +Array.reduce + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1386 + +___ + +### reduceRight + +▸ **reduceRight**(`callbackfn`): [`Input`](../modules/rlp.md#input) + +Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: [`Input`](../modules/rlp.md#input), `currentValue`: [`Input`](../modules/rlp.md#input), `currentIndex`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => [`Input`](../modules/rlp.md#input) | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | + +#### Returns + +[`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.reduceRight + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1392 + +▸ **reduceRight**(`callbackfn`, `initialValue`): [`Input`](../modules/rlp.md#input) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`previousValue`: [`Input`](../modules/rlp.md#input), `currentValue`: [`Input`](../modules/rlp.md#input), `currentIndex`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => [`Input`](../modules/rlp.md#input) | +| `initialValue` | [`Input`](../modules/rlp.md#input) | + +#### Returns + +[`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.reduceRight + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1393 + +▸ **reduceRight**<`U`\>(`callbackfn`, `initialValue`): `U` + +Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + +#### Type parameters + +| Name | +| :------ | +| `U` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: `U`, `currentValue`: [`Input`](../modules/rlp.md#input), `currentIndex`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `U` | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | +| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +#### Returns + +`U` + +#### Inherited from + +Array.reduceRight + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1399 + +___ + +### reverse + +▸ **reverse**(): [`Input`](../modules/rlp.md#input)[] + +Reverses the elements in an array in place. +This method mutates the array and returns a reference to the same array. + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +#### Inherited from + +Array.reverse + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1264 + +___ + +### shift + +▸ **shift**(): `undefined` \| [`Input`](../modules/rlp.md#input) + +Removes the first element from an array and returns it. +If the array is empty, undefined is returned and the array is not modified. + +#### Returns + +`undefined` \| [`Input`](../modules/rlp.md#input) + +#### Inherited from + +Array.shift + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1269 + +___ + +### slice + +▸ **slice**(`start?`, `end?`): [`Input`](../modules/rlp.md#input)[] + +Returns a copy of a section of an array. +For both start and end, a negative index can be used to indicate an offset from the end of the array. +For example, -2 refers to the second to last element of the array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `start?` | `number` | The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0. | +| `end?` | `number` | The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array. | + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +#### Inherited from + +Array.slice + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1279 + +___ + +### some + +▸ **some**(`predicate`, `thisArg?`): `boolean` + +Determines whether the specified callback function returns true for any element of an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `unknown` | A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`boolean` + +#### Inherited from + +Array.some + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1349 + +___ + +### sort + +▸ **sort**(`compareFn?`): [`List`](rlp.List.md) + +Sorts an array in place. +This method mutates the array and returns a reference to the same array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `compareFn?` | (`a`: [`Input`](../modules/rlp.md#input), `b`: [`Input`](../modules/rlp.md#input)) => `number` | Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` | + +#### Returns + +[`List`](rlp.List.md) + +#### Inherited from + +Array.sort + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1290 + +___ + +### splice + +▸ **splice**(`start`, `deleteCount?`): [`Input`](../modules/rlp.md#input)[] + +Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `start` | `number` | The zero-based location in the array from which to start removing elements. | +| `deleteCount?` | `number` | The number of elements to remove. | + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +An array containing the elements that were deleted. + +#### Inherited from + +Array.splice + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1297 + +▸ **splice**(`start`, `deleteCount`, ...`items`): [`Input`](../modules/rlp.md#input)[] + +Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `start` | `number` | The zero-based location in the array from which to start removing elements. | +| `deleteCount` | `number` | The number of elements to remove. | +| `...items` | [`Input`](../modules/rlp.md#input)[] | Elements to insert into the array in place of the deleted elements. | + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +An array containing the elements that were deleted. + +#### Inherited from + +Array.splice + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1305 + +___ + +### toLocaleString + +▸ **toLocaleString**(): `string` + +Returns a string representation of an array. The elements are converted to string using their toLocaleString methods. + +#### Returns + +`string` + +#### Inherited from + +Array.toLocaleString + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1232 + +___ + +### toString + +▸ **toString**(): `string` + +Returns a string representation of an array. + +#### Returns + +`string` + +#### Inherited from + +Array.toString + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1228 + +___ + +### turn + +▸ **turn**<`U`\>(`callbackfn`, `memo?`): `U` + +Non-standard. + +#### Type parameters + +| Name | +| :------ | +| `U` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`memo`: `U`, `value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `void` | +| `memo?` | `U` | + +#### Returns + +`U` + +#### Inherited from + +Array.turn + +#### Defined in + +node_modules/@types/core-js/index.d.ts:413 + +▸ **turn**(`callbackfn`, `memo?`): [`Input`](../modules/rlp.md#input)[] + +Non-standard. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`memo`: [`Input`](../modules/rlp.md#input)[], `value`: [`Input`](../modules/rlp.md#input), `index`: `number`, `array`: [`Input`](../modules/rlp.md#input)[]) => `void` | +| `memo?` | [`Input`](../modules/rlp.md#input)[] | + +#### Returns + +[`Input`](../modules/rlp.md#input)[] + +#### Inherited from + +Array.turn + +#### Defined in + +node_modules/@types/core-js/index.d.ts:418 + +___ + +### unshift + +▸ **unshift**(...`items`): `number` + +Inserts new elements at the start of an array, and returns the new length of the array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...items` | [`Input`](../modules/rlp.md#input)[] | Elements to insert at the start of the array. | + +#### Returns + +`number` + +#### Inherited from + +Array.unshift + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1310 + +___ + +### values + +▸ **values**(): `IterableIterator`<[`Input`](../modules/rlp.md#input)\> + +Returns an iterable of values in the array + +#### Returns + +`IterableIterator`<[`Input`](../modules/rlp.md#input)\> + +#### Inherited from + +Array.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:75 diff --git a/packages/util/docs/modules/externals.bn.md b/packages/util/docs/modules/BN.md similarity index 57% rename from packages/util/docs/modules/externals.bn.md rename to packages/util/docs/modules/BN.md index 85a7e6b3a6..b833154f52 100644 --- a/packages/util/docs/modules/externals.bn.md +++ b/packages/util/docs/modules/BN.md @@ -1,22 +1,20 @@ -[ethereumjs-util](../README.md) / [externals](externals.md) / BN +[ethereumjs-util](../README.md) / BN # Namespace: BN -[externals](externals.md).BN - [`BN`](https://github.com/indutny/bn.js) ## Table of contents ### Interfaces -- [MPrime](../interfaces/externals.bn.mprime.md) -- [ReductionContext](../interfaces/externals.bn.reductioncontext.md) +- [MPrime](../interfaces/BN.MPrime.md) +- [ReductionContext](../interfaces/BN.ReductionContext.md) ### Type aliases -- [Endianness](externals.bn.md#endianness) -- [IPrimeName](externals.bn.md#iprimename) +- [Endianness](BN.md#endianness) +- [IPrimeName](BN.md#iprimename) ## Type aliases diff --git a/packages/util/docs/modules/_types_ethjs_util.md b/packages/util/docs/modules/_types_ethjs_util.md deleted file mode 100644 index b569e7e5e6..0000000000 --- a/packages/util/docs/modules/_types_ethjs_util.md +++ /dev/null @@ -1,315 +0,0 @@ -[ethereumjs-util](../README.md) / @types/ethjs-util - -# Module: @types/ethjs-util - -## Table of contents - -### Functions - -- [arrayContainsArray](_types_ethjs_util.md#arraycontainsarray) -- [fromAscii](_types_ethjs_util.md#fromascii) -- [fromUtf8](_types_ethjs_util.md#fromutf8) -- [getBinarySize](_types_ethjs_util.md#getbinarysize) -- [getKeys](_types_ethjs_util.md#getkeys) -- [intToBuffer](_types_ethjs_util.md#inttobuffer) -- [intToHex](_types_ethjs_util.md#inttohex) -- [isHexPrefixed](_types_ethjs_util.md#ishexprefixed) -- [isHexString](_types_ethjs_util.md#ishexstring) -- [padToEven](_types_ethjs_util.md#padtoeven) -- [stripHexPrefix](_types_ethjs_util.md#striphexprefix) -- [toAscii](_types_ethjs_util.md#toascii) -- [toUtf8](_types_ethjs_util.md#toutf8) - -## Functions - -### arrayContainsArray - -▸ **arrayContainsArray**(`superset`, `subset`, `some?`): `boolean` - -**`description`** Returns TRUE if the first specified array contains all elements - from the second one. FALSE otherwise. If `some` is true, will - return true if first specified array contain some elements of - the second. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `superset` | `any`[] | -| `subset` | `any`[] | -| `some?` | `boolean` | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L38) - -___ - -### fromAscii - -▸ **fromAscii**(`stringValue`): `string` - -**`description`** Should be called to get hex representation (prefixed by 0x) of ascii string - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stringValue` | `string` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L58) - -___ - -### fromUtf8 - -▸ **fromUtf8**(`stringValue`): `string` - -**`description`** Should be called to get hex representation (prefixed by 0x) of utf8 string - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stringValue` | `string` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:53](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L53) - -___ - -### getBinarySize - -▸ **getBinarySize**(`str`): `number` - -**`description`** Get the binary size of a string - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `str` | `string` | - -#### Returns - -`number` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:30](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L30) - -___ - -### getKeys - -▸ **getKeys**(`params`, `key`, `allowEmpty?`): `any`[] - -**`description`** getKeys([{a: 1, b: 2}, {a: 3, b: 4}], 'a') => [1, 3] - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `params` | `any`[] | -| `key` | `string` | -| `allowEmpty?` | `boolean` | - -#### Returns - -`any`[] - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L63) - -___ - -### intToBuffer - -▸ **intToBuffer**(`i`): `Buffer` - -**`description`** Converts an `Number` to a `Buffer` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `i` | `number` | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L25) - -___ - -### intToHex - -▸ **intToHex**(`i`): `string` - -**`description`** Converts a `Number` into a hex `String` - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `i` | `number` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L20) - -___ - -### isHexPrefixed - -▸ **isHexPrefixed**(`str`): `boolean` - -**`description`** Returns a `Boolean` on whether or not the a `String` starts with '0x' - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `str` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:5](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L5) - -___ - -### isHexString - -▸ **isHexString**(`value`, `length?`): `boolean` - -**`description`** check if string is hex string of specific length - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `value` | `string` | -| `length?` | `number` | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L68) - -___ - -### padToEven - -▸ **padToEven**(`value`): `string` - -**`description`** Pads a `String` to have an even length - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `value` | `string` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L15) - -___ - -### stripHexPrefix - -▸ **stripHexPrefix**(`str`): `string` - -**`description`** Removes '0x' from a given `String` if present - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `str` | `string` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:10](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L10) - -___ - -### toAscii - -▸ **toAscii**(`hex`): `string` - -**`description`** Should be called to get ascii from it's hex representation - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hex` | `string` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L48) - -___ - -### toUtf8 - -▸ **toUtf8**(`hex`): `string` - -**`description`** Should be called to get utf8 from it's hex representation - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hex` | `string` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/@types/ethjs-util/index.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/@types/ethjs-util/index.ts#L43) diff --git a/packages/util/docs/modules/account.md b/packages/util/docs/modules/account.md deleted file mode 100644 index 7e361a17c9..0000000000 --- a/packages/util/docs/modules/account.md +++ /dev/null @@ -1,349 +0,0 @@ -[ethereumjs-util](../README.md) / account - -# Module: account - -## Table of contents - -### Classes - -- [Account](../classes/account.account-1.md) - -### Interfaces - -- [AccountData](../interfaces/account.accountdata.md) - -### Functions - -- [generateAddress](account.md#generateaddress) -- [generateAddress2](account.md#generateaddress2) -- [importPublic](account.md#importpublic) -- [isValidAddress](account.md#isvalidaddress) -- [isValidChecksumAddress](account.md#isvalidchecksumaddress) -- [isValidPrivate](account.md#isvalidprivate) -- [isValidPublic](account.md#isvalidpublic) -- [isZeroAddress](account.md#iszeroaddress) -- [privateToAddress](account.md#privatetoaddress) -- [privateToPublic](account.md#privatetopublic) -- [pubToAddress](account.md#pubtoaddress) -- [publicToAddress](account.md#publictoaddress) -- [toChecksumAddress](account.md#tochecksumaddress) -- [zeroAddress](account.md#zeroaddress) - -## Functions - -### generateAddress - -▸ `Const` **generateAddress**(`from`, `nonce`): `Buffer` - -Generates an address of a newly created contract. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `from` | `Buffer` | The address which is creating this new address | -| `nonce` | `Buffer` | The nonce of the from account | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/account.ts:190](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L190) - -___ - -### generateAddress2 - -▸ `Const` **generateAddress2**(`from`, `salt`, `initCode`): `Buffer` - -Generates an address for a contract created using CREATE2. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `from` | `Buffer` | The address which is creating this new address | -| `salt` | `Buffer` | A salt | -| `initCode` | `Buffer` | The init code of the contract being created | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/account.ts:211](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L211) - -___ - -### importPublic - -▸ `Const` **importPublic**(`publicKey`): `Buffer` - -Converts a public key to the Ethereum format. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `publicKey` | `Buffer` | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/account.ts:291](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L291) - -___ - -### isValidAddress - -▸ `Const` **isValidAddress**(`hexAddress`): `boolean` - -Checks if the address is a valid. Accepts checksummed addresses too. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hexAddress` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/account.ts:129](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L129) - -___ - -### isValidChecksumAddress - -▸ `Const` **isValidChecksumAddress**(`hexAddress`, `eip1191ChainId?`): `boolean` - -Checks if the address is a valid checksummed address. - -See toChecksumAddress' documentation for details about the eip1191ChainId parameter. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hexAddress` | `string` | -| `eip1191ChainId?` | `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/account.ts:178](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L178) - -___ - -### isValidPrivate - -▸ `Const` **isValidPrivate**(`privateKey`): `boolean` - -Checks if the private key satisfies the rules of the curve secp256k1. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `privateKey` | `Buffer` | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/account.ts:229](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L229) - -___ - -### isValidPublic - -▸ `Const` **isValidPublic**(`publicKey`, `sanitize?`): `boolean` - -Checks if the public key satisfies the rules of the curve secp256k1 -and the requirements of Ethereum. - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `publicKey` | `Buffer` | `undefined` | The two points of an uncompressed key, unless sanitize is enabled | -| `sanitize` | `boolean` | false | Accept public keys in other formats | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/account.ts:239](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L239) - -___ - -### isZeroAddress - -▸ `Const` **isZeroAddress**(`hexAddress`): `boolean` - -Checks if a given address is the zero address. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hexAddress` | `string` | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/account.ts:311](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L311) - -___ - -### privateToAddress - -▸ `Const` **privateToAddress**(`privateKey`): `Buffer` - -Returns the ethereum address of a given private key. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `privateKey` | `Buffer` | A private key must be 256 bits wide | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/account.ts:284](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L284) - -___ - -### privateToPublic - -▸ `Const` **privateToPublic**(`privateKey`): `Buffer` - -Returns the ethereum public key of a given private key. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `privateKey` | `Buffer` | A private key must be 256 bits wide | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/account.ts:274](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L274) - -___ - -### pubToAddress - -▸ `Const` **pubToAddress**(`pubKey`, `sanitize?`): `Buffer` - -Returns the ethereum address of a given public key. -Accepts "Ethereum public keys" and SEC1 encoded keys. - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `pubKey` | `Buffer` | `undefined` | The two points of an uncompressed key, unless sanitize is enabled | -| `sanitize` | `boolean` | false | Accept public keys in other formats | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/account.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L259) - -___ - -### publicToAddress - -▸ `Const` **publicToAddress**(`pubKey`, `sanitize?`): `Buffer` - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `pubKey` | `Buffer` | `undefined` | -| `sanitize` | `boolean` | false | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/account.ts:268](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L268) - -___ - -### toChecksumAddress - -▸ `Const` **toChecksumAddress**(`hexAddress`, `eip1191ChainId?`): `string` - -Returns a checksummed address. - -If a eip1191ChainId is provided, the chainId will be included in the checksum calculation. This -has the effect of checksummed addresses for one chain having invalid checksums for others. -For more details see [EIP-1191](https://eips.ethereum.org/EIPS/eip-1191). - -WARNING: Checksums with and without the chainId will differ. As of 2019-06-26, the most commonly -used variation in Ethereum was without the chainId. This may change in the future. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `hexAddress` | `string` | -| `eip1191ChainId?` | `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/account.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L149) - -___ - -### zeroAddress - -▸ `Const` **zeroAddress**(): `string` - -Returns the zero address. - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/account.ts:302](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/account.ts#L302) diff --git a/packages/util/docs/modules/address.md b/packages/util/docs/modules/address.md deleted file mode 100644 index 7afc2aec6b..0000000000 --- a/packages/util/docs/modules/address.md +++ /dev/null @@ -1,9 +0,0 @@ -[ethereumjs-util](../README.md) / address - -# Module: address - -## Table of contents - -### Classes - -- [Address](../classes/address.address-1.md) diff --git a/packages/util/docs/modules/bytes.md b/packages/util/docs/modules/bytes.md deleted file mode 100644 index c93073792e..0000000000 --- a/packages/util/docs/modules/bytes.md +++ /dev/null @@ -1,341 +0,0 @@ -[ethereumjs-util](../README.md) / bytes - -# Module: bytes - -## Table of contents - -### Type aliases - -- [ToBufferInputTypes](bytes.md#tobufferinputtypes) - -### Functions - -- [addHexPrefix](bytes.md#addhexprefix) -- [baToJSON](bytes.md#batojson) -- [bufferToHex](bytes.md#buffertohex) -- [bufferToInt](bytes.md#buffertoint) -- [fromSigned](bytes.md#fromsigned) -- [setLengthLeft](bytes.md#setlengthleft) -- [setLengthRight](bytes.md#setlengthright) -- [toBuffer](bytes.md#tobuffer) -- [toUnsigned](bytes.md#tounsigned) -- [unpadArray](bytes.md#unpadarray) -- [unpadBuffer](bytes.md#unpadbuffer) -- [unpadHexString](bytes.md#unpadhexstring) -- [zeros](bytes.md#zeros) - -## Type aliases - -### ToBufferInputTypes - -Ƭ **ToBufferInputTypes**: [PrefixedHexString](types.md#prefixedhexstring) \| `number` \| [BN](../classes/externals.bn-1.md) \| `Buffer` \| `Uint8Array` \| `number`[] \| [TransformableToArray](../interfaces/types.transformabletoarray.md) \| [TransformableToBuffer](../interfaces/types.transformabletobuffer.md) \| ``null`` \| `undefined` - -#### Defined in - -[packages/util/src/bytes.ts:108](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L108) - -## Functions - -### addHexPrefix - -▸ `Const` **addHexPrefix**(`str`): `string` - -Adds "0x" to a given `String` if it does not already start with "0x". - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `str` | `string` | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/bytes.ts:205](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L205) - -___ - -### baToJSON - -▸ `Const` **baToJSON**(`ba`): `any` - -Converts a `Buffer` or `Array` to JSON. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `ba` | `any` | (Buffer\|Array) | - -#### Returns - -`any` - -(Array|String|null) - -#### Defined in - -[packages/util/src/bytes.ts:218](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L218) - -___ - -### bufferToHex - -▸ `Const` **bufferToHex**(`buf`): `string` - -Converts a `Buffer` into a `0x`-prefixed hex `String`. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buf` | `Buffer` | `Buffer` object to convert | - -#### Returns - -`string` - -#### Defined in - -[packages/util/src/bytes.ts:181](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L181) - -___ - -### bufferToInt - -▸ `Const` **bufferToInt**(`buf`): `number` - -Converts a `Buffer` to a `Number`. - -**`throws`** If the input number exceeds 53 bits. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buf` | `Buffer` | `Buffer` object to convert | - -#### Returns - -`number` - -#### Defined in - -[packages/util/src/bytes.ts:173](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L173) - -___ - -### fromSigned - -▸ `Const` **fromSigned**(`num`): [BN](../classes/externals.bn-1.md) - -Interprets a `Buffer` as a signed integer and returns a `BN`. Assumes 256-bit numbers. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `num` | `Buffer` | Signed integer value | - -#### Returns - -[BN](../classes/externals.bn-1.md) - -#### Defined in - -[packages/util/src/bytes.ts:190](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L190) - -___ - -### setLengthLeft - -▸ `Const` **setLengthLeft**(`msg`, `length`): `Buffer` - -Left Pads a `Buffer` with leading zeros till it has `length` bytes. -Or it truncates the beginning if it exceeds. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `msg` | `Buffer` | the value to pad (Buffer) | -| `length` | `number` | the number of bytes the output should be | - -#### Returns - -`Buffer` - -(Buffer) - -#### Defined in - -[packages/util/src/bytes.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L46) - -___ - -### setLengthRight - -▸ `Const` **setLengthRight**(`msg`, `length`): `Buffer` - -Right Pads a `Buffer` with trailing zeros till it has `length` bytes. -it truncates the end if it exceeds. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `msg` | `Buffer` | the value to pad (Buffer) | -| `length` | `number` | the number of bytes the output should be | - -#### Returns - -`Buffer` - -(Buffer) - -#### Defined in - -[packages/util/src/bytes.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L58) - -___ - -### toBuffer - -▸ `Const` **toBuffer**(`v`): `Buffer` - -Attempts to turn a value into a `Buffer`. -Inputs supported: `Buffer`, `String` (hex-prefixed), `Number`, null/undefined, `BN` and other objects -with a `toArray()` or `toBuffer()` method. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `v` | [ToBufferInputTypes](bytes.md#tobufferinputtypes) | the value | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/bytes.ts:126](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L126) - -___ - -### toUnsigned - -▸ `Const` **toUnsigned**(`num`): `Buffer` - -Converts a `BN` to an unsigned integer and returns it as a `Buffer`. Assumes 256-bit numbers. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `num` | [BN](../classes/externals.bn-1.md) | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/bytes.ts:198](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L198) - -___ - -### unpadArray - -▸ `Const` **unpadArray**(`a`): `number`[] - -Trims leading zeros from an `Array` (of numbers). - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `number`[] | (number[]) | - -#### Returns - -`number`[] - -(number[]) - -#### Defined in - -[packages/util/src/bytes.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L92) - -___ - -### unpadBuffer - -▸ `Const` **unpadBuffer**(`a`): `Buffer` - -Trims leading zeros from a `Buffer`. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `Buffer` | (Buffer) | - -#### Returns - -`Buffer` - -(Buffer) - -#### Defined in - -[packages/util/src/bytes.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L82) - -___ - -### unpadHexString - -▸ `Const` **unpadHexString**(`a`): `string` - -Trims leading zeros from a hex-prefixed `String`. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `string` | (String) | - -#### Returns - -`string` - -(String) - -#### Defined in - -[packages/util/src/bytes.ts:102](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L102) - -___ - -### zeros - -▸ `Const` **zeros**(`bytes`): `Buffer` - -Returns a buffer filled with 0s. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `bytes` | `number` | the number of bytes the buffer should be | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/bytes.ts:10](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L10) diff --git a/packages/util/docs/modules/constants.md b/packages/util/docs/modules/constants.md deleted file mode 100644 index 343afbad86..0000000000 --- a/packages/util/docs/modules/constants.md +++ /dev/null @@ -1,112 +0,0 @@ -[ethereumjs-util](../README.md) / constants - -# Module: constants - -## Table of contents - -### Variables - -- [KECCAK256\_NULL](constants.md#keccak256_null) -- [KECCAK256\_NULL\_S](constants.md#keccak256_null_s) -- [KECCAK256\_RLP](constants.md#keccak256_rlp) -- [KECCAK256\_RLP\_ARRAY](constants.md#keccak256_rlp_array) -- [KECCAK256\_RLP\_ARRAY\_S](constants.md#keccak256_rlp_array_s) -- [KECCAK256\_RLP\_S](constants.md#keccak256_rlp_s) -- [MAX\_INTEGER](constants.md#max_integer) -- [TWO\_POW256](constants.md#two_pow256) - -## Variables - -### KECCAK256\_NULL - -• `Const` **KECCAK256\_NULL**: `Buffer` - -Keccak-256 hash of null - -#### Defined in - -[packages/util/src/constants.ts:29](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L29) - -___ - -### KECCAK256\_NULL\_S - -• `Const` **KECCAK256\_NULL\_S**: `string` = 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' - -Keccak-256 hash of null - -#### Defined in - -[packages/util/src/constants.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L23) - -___ - -### KECCAK256\_RLP - -• `Const` **KECCAK256\_RLP**: `Buffer` - -Keccak-256 hash of the RLP of null - -#### Defined in - -[packages/util/src/constants.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L51) - -___ - -### KECCAK256\_RLP\_ARRAY - -• `Const` **KECCAK256\_RLP\_ARRAY**: `Buffer` - -Keccak-256 of an RLP of an empty array - -#### Defined in - -[packages/util/src/constants.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L40) - -___ - -### KECCAK256\_RLP\_ARRAY\_S - -• `Const` **KECCAK256\_RLP\_ARRAY\_S**: `string` = '1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347' - -Keccak-256 of an RLP of an empty array - -#### Defined in - -[packages/util/src/constants.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L34) - -___ - -### KECCAK256\_RLP\_S - -• `Const` **KECCAK256\_RLP\_S**: `string` = '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421' - -Keccak-256 hash of the RLP of null - -#### Defined in - -[packages/util/src/constants.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L45) - -___ - -### MAX\_INTEGER - -• `Const` **MAX\_INTEGER**: [BN](../classes/externals.bn-1.md) - -The max integer that this VM can handle - -#### Defined in - -[packages/util/src/constants.ts:7](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L7) - -___ - -### TWO\_POW256 - -• `Const` **TWO\_POW256**: [BN](../classes/externals.bn-1.md) - -2^256 - -#### Defined in - -[packages/util/src/constants.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/constants.ts#L15) diff --git a/packages/util/docs/modules/externals.md b/packages/util/docs/modules/externals.md deleted file mode 100644 index 850bbc9034..0000000000 --- a/packages/util/docs/modules/externals.md +++ /dev/null @@ -1,17 +0,0 @@ -[ethereumjs-util](../README.md) / externals - -# Module: externals - -Re-exports commonly used modules: -* Exports [`BN`](https://github.com/indutny/bn.js), [`rlp`](https://github.com/ethereumjs/rlp). - -## Table of contents - -### Namespaces - -- [BN](externals.bn.md) -- [rlp](externals.rlp.md) - -### Classes - -- [BN](../classes/externals.bn-1.md) diff --git a/packages/util/docs/modules/hash.md b/packages/util/docs/modules/hash.md deleted file mode 100644 index dcf96008f0..0000000000 --- a/packages/util/docs/modules/hash.md +++ /dev/null @@ -1,291 +0,0 @@ -[ethereumjs-util](../README.md) / hash - -# Module: hash - -## Table of contents - -### Functions - -- [keccak](hash.md#keccak) -- [keccak256](hash.md#keccak256) -- [keccakFromArray](hash.md#keccakfromarray) -- [keccakFromHexString](hash.md#keccakfromhexstring) -- [keccakFromString](hash.md#keccakfromstring) -- [ripemd160](hash.md#ripemd160) -- [ripemd160FromArray](hash.md#ripemd160fromarray) -- [ripemd160FromString](hash.md#ripemd160fromstring) -- [rlphash](hash.md#rlphash) -- [sha256](hash.md#sha256) -- [sha256FromArray](hash.md#sha256fromarray) -- [sha256FromString](hash.md#sha256fromstring) - -## Functions - -### keccak - -▸ `Const` **keccak**(`a`, `bits?`): `Buffer` - -Creates Keccak hash of a Buffer input - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `a` | `Buffer` | `undefined` | The input data (Buffer) | -| `bits` | `number` | 256 | (number = 256) The Keccak width | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:12](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L12) - -___ - -### keccak256 - -▸ `Const` **keccak256**(`a`): `Buffer` - -Creates Keccak-256 hash of the input, alias for keccak(a, 256). - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `Buffer` | The input data (Buffer) | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L37) - -___ - -### keccakFromArray - -▸ `Const` **keccakFromArray**(`a`, `bits?`): `Buffer` - -Creates Keccak hash of a number array input - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `a` | `number`[] | `undefined` | The input data (number[]) | -| `bits` | `number` | 256 | (number = 256) The Keccak width | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L67) - -___ - -### keccakFromHexString - -▸ `Const` **keccakFromHexString**(`a`, `bits?`): `Buffer` - -Creates Keccak hash of an 0x-prefixed string input - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `a` | `string` | `undefined` | The input data (String) | -| `bits` | `number` | 256 | (number = 256) The Keccak width | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L57) - -___ - -### keccakFromString - -▸ `Const` **keccakFromString**(`a`, `bits?`): `Buffer` - -Creates Keccak hash of a utf-8 string input - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `a` | `string` | `undefined` | The input data (String) | -| `bits` | `number` | 256 | (number = 256) The Keccak width | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L46) - -___ - -### ripemd160 - -▸ `Const` **ripemd160**(`a`, `padded`): `Buffer` - -Creates RIPEMD160 hash of a Buffer input. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `Buffer` | The input data (Buffer) | -| `padded` | `boolean` | Whether it should be padded to 256 bits or not | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:128](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L128) - -___ - -### ripemd160FromArray - -▸ `Const` **ripemd160FromArray**(`a`, `padded`): `Buffer` - -Creates RIPEMD160 hash of a number[] input. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `number`[] | The input data (number[]) | -| `padded` | `boolean` | Whether it should be padded to 256 bits or not | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:148](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L148) - -___ - -### ripemd160FromString - -▸ `Const` **ripemd160FromString**(`a`, `padded`): `Buffer` - -Creates RIPEMD160 hash of a string input. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `string` | The input data (String) | -| `padded` | `boolean` | Whether it should be padded to 256 bits or not | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:138](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L138) - -___ - -### rlphash - -▸ `Const` **rlphash**(`a`): `Buffer` - -Creates SHA-3 hash of the RLP encoded version of the input. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | [Input](externals.rlp.md#input) | The input data | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L157) - -___ - -### sha256 - -▸ `Const` **sha256**(`a`): `Buffer` - -Creates SHA256 hash of a Buffer input. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `Buffer` | The input data (Buffer) | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L85) - -___ - -### sha256FromArray - -▸ `Const` **sha256FromArray**(`a`): `Buffer` - -Creates SHA256 hash of a number[] input. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `number`[] | The input data (number[]) | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:103](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L103) - -___ - -### sha256FromString - -▸ `Const` **sha256FromString**(`a`): `Buffer` - -Creates SHA256 hash of a string input. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `a` | `string` | The input data (string) | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/hash.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/hash.ts#L94) diff --git a/packages/util/docs/modules/helpers.md b/packages/util/docs/modules/helpers.md deleted file mode 100644 index 795ec56ff8..0000000000 --- a/packages/util/docs/modules/helpers.md +++ /dev/null @@ -1,100 +0,0 @@ -[ethereumjs-util](../README.md) / helpers - -# Module: helpers - -## Table of contents - -### Functions - -- [assertIsArray](helpers.md#assertisarray) -- [assertIsBuffer](helpers.md#assertisbuffer) -- [assertIsHexString](helpers.md#assertishexstring) -- [assertIsString](helpers.md#assertisstring) - -## Functions - -### assertIsArray - -▸ `Const` **assertIsArray**(`input`): `void` - -Throws if input is not an array - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `input` | `number`[] | value to check | - -#### Returns - -`void` - -#### Defined in - -[packages/util/src/helpers.ts:29](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/helpers.ts#L29) - -___ - -### assertIsBuffer - -▸ `Const` **assertIsBuffer**(`input`): `void` - -Throws if input is not a buffer - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `input` | `Buffer` | value to check | - -#### Returns - -`void` - -#### Defined in - -[packages/util/src/helpers.ts:18](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/helpers.ts#L18) - -___ - -### assertIsHexString - -▸ `Const` **assertIsHexString**(`input`): `void` - -Throws if a string is not hex prefixed - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `input` | `string` | string to check hex prefix of | - -#### Returns - -`void` - -#### Defined in - -[packages/util/src/helpers.ts:7](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/helpers.ts#L7) - -___ - -### assertIsString - -▸ `Const` **assertIsString**(`input`): `void` - -Throws if input is not a string - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `input` | `string` | value to check | - -#### Returns - -`void` - -#### Defined in - -[packages/util/src/helpers.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/helpers.ts#L40) diff --git a/packages/util/docs/modules/object.md b/packages/util/docs/modules/object.md deleted file mode 100644 index d43b576aab..0000000000 --- a/packages/util/docs/modules/object.md +++ /dev/null @@ -1,35 +0,0 @@ -[ethereumjs-util](../README.md) / object - -# Module: object - -## Table of contents - -### Functions - -- [defineProperties](object.md#defineproperties) - -## Functions - -### defineProperties - -▸ `Const` **defineProperties**(`self`, `fields`, `data?`): `void` - -Defines properties on a `Object`. It make the assumption that underlying data is binary. - -**`deprecated`** - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `self` | `any` | the `Object` to define properties on | -| `fields` | `any` | an array fields to define. Fields can contain: * `name` - the name of the properties * `length` - the number of bytes the field can have * `allowLess` - if the field can be less than the length * `allowEmpty` | -| `data?` | `any` | data to be validated against the definitions | - -#### Returns - -`void` - -#### Defined in - -[packages/util/src/object.ts:17](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/object.ts#L17) diff --git a/packages/util/docs/modules/externals.rlp.md b/packages/util/docs/modules/rlp.md similarity index 70% rename from packages/util/docs/modules/externals.rlp.md rename to packages/util/docs/modules/rlp.md index 6289c1fd06..c96203954c 100644 --- a/packages/util/docs/modules/externals.rlp.md +++ b/packages/util/docs/modules/rlp.md @@ -1,33 +1,31 @@ -[ethereumjs-util](../README.md) / [externals](externals.md) / rlp +[ethereumjs-util](../README.md) / rlp # Namespace: rlp -[externals](externals.md).rlp - [`rlp`](https://github.com/ethereumjs/rlp) ## Table of contents ### Interfaces -- [Decoded](../interfaces/externals.rlp.decoded.md) -- [List](../interfaces/externals.rlp.list.md) +- [Decoded](../interfaces/rlp.Decoded.md) +- [List](../interfaces/rlp.List.md) ### Type aliases -- [Input](externals.rlp.md#input) +- [Input](rlp.md#input) ### Functions -- [decode](externals.rlp.md#decode) -- [encode](externals.rlp.md#encode) -- [getLength](externals.rlp.md#getlength) +- [decode](rlp.md#decode) +- [encode](rlp.md#encode) +- [getLength](rlp.md#getlength) ## Type aliases ### Input -Ƭ **Input**: `Buffer` \| `string` \| `number` \| `bigint` \| `Uint8Array` \| [BN](../classes/externals.bn-1.md) \| [List](../interfaces/externals.rlp.list.md) \| ``null`` +Ƭ **Input**: `Buffer` \| `string` \| `number` \| `bigint` \| `Uint8Array` \| [`BN`](../classes/BN.md) \| [`List`](../interfaces/rlp.List.md) \| ``null`` #### Defined in @@ -75,18 +73,18 @@ node_modules/rlp/dist/index.d.ts:17 node_modules/rlp/dist/index.d.ts:18 -▸ **decode**(`input`, `stream?`): `Buffer`[] \| `Buffer` \| [Decoded](../interfaces/externals.rlp.decoded.md) +▸ **decode**(`input`, `stream?`): `Buffer`[] \| `Buffer` \| [`Decoded`](../interfaces/rlp.Decoded.md) #### Parameters | Name | Type | | :------ | :------ | -| `input` | [Input](externals.rlp.md#input) | +| `input` | [`Input`](rlp.md#input) | | `stream?` | `boolean` | #### Returns -`Buffer`[] \| `Buffer` \| [Decoded](../interfaces/externals.rlp.decoded.md) +`Buffer`[] \| `Buffer` \| [`Decoded`](../interfaces/rlp.Decoded.md) #### Defined in @@ -105,7 +103,7 @@ This function takes in a data, convert it to buffer if not, and a length for rec | Name | Type | Description | | :------ | :------ | :------ | -| `input` | [Input](externals.rlp.md#input) | will be converted to buffer | +| `input` | [`Input`](rlp.md#input) | will be converted to buffer | #### Returns @@ -129,7 +127,7 @@ Get the length of the RLP input | Name | Type | | :------ | :------ | -| `input` | [Input](externals.rlp.md#input) | +| `input` | [`Input`](rlp.md#input) | #### Returns diff --git a/packages/util/docs/modules/signature.md b/packages/util/docs/modules/signature.md deleted file mode 100644 index a043f2355f..0000000000 --- a/packages/util/docs/modules/signature.md +++ /dev/null @@ -1,218 +0,0 @@ -[ethereumjs-util](../README.md) / signature - -# Module: signature - -## Table of contents - -### Interfaces - -- [ECDSASignature](../interfaces/signature.ecdsasignature.md) -- [ECDSASignatureBuffer](../interfaces/signature.ecdsasignaturebuffer.md) - -### Functions - -- [ecrecover](signature.md#ecrecover) -- [ecsign](signature.md#ecsign) -- [fromRpcSig](signature.md#fromrpcsig) -- [hashPersonalMessage](signature.md#hashpersonalmessage) -- [isValidSignature](signature.md#isvalidsignature) -- [toCompactSig](signature.md#tocompactsig) -- [toRpcSig](signature.md#torpcsig) - -## Functions - -### ecrecover - -▸ `Const` **ecrecover**(`msgHash`, `v`, `r`, `s`, `chainId?`): `Buffer` - -ECDSA public key recovery from signature. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msgHash` | `Buffer` | -| `v` | [BNLike](types.md#bnlike) | -| `r` | `Buffer` | -| `s` | `Buffer` | -| `chainId?` | `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) | - -#### Returns - -`Buffer` - -Recovered public key - -#### Defined in - -[packages/util/src/signature.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L66) - -___ - -### ecsign - -▸ **ecsign**(`msgHash`, `privateKey`, `chainId?`): [ECDSASignature](../interfaces/signature.ecdsasignature.md) - -Returns the ECDSA signature of a message hash. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msgHash` | `Buffer` | -| `privateKey` | `Buffer` | -| `chainId?` | `number` | - -#### Returns - -[ECDSASignature](../interfaces/signature.ecdsasignature.md) - -#### Defined in - -[packages/util/src/signature.ts:24](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L24) - -▸ **ecsign**(`msgHash`, `privateKey`, `chainId`): [ECDSASignatureBuffer](../interfaces/signature.ecdsasignaturebuffer.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `msgHash` | `Buffer` | -| `privateKey` | `Buffer` | -| `chainId` | [BNLike](types.md#bnlike) | - -#### Returns - -[ECDSASignatureBuffer](../interfaces/signature.ecdsasignaturebuffer.md) - -#### Defined in - -[packages/util/src/signature.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L25) - -___ - -### fromRpcSig - -▸ `Const` **fromRpcSig**(`sig`): [ECDSASignature](../interfaces/signature.ecdsasignature.md) - -Convert signature format of the `eth_sign` RPC method to signature parameters -NOTE: all because of a bug in geth: https://github.com/ethereum/go-ethereum/issues/2053 - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `sig` | `string` | - -#### Returns - -[ECDSASignature](../interfaces/signature.ecdsasignature.md) - -#### Defined in - -[packages/util/src/signature.ts:120](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L120) - -___ - -### hashPersonalMessage - -▸ `Const` **hashPersonalMessage**(`message`): `Buffer` - -Returns the keccak-256 hash of `message`, prefixed with the header used by the `eth_sign` RPC call. -The output of this function can be fed into `ecsign` to produce the same signature as the `eth_sign` -call for a given `message`, or fed to `ecrecover` along with a signature to recover the public key -used to produce the signature. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `message` | `Buffer` | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/signature.ts:197](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L197) - -___ - -### isValidSignature - -▸ `Const` **isValidSignature**(`v`, `r`, `s`, `homesteadOrLater?`, `chainId?`): `boolean` - -Validate a ECDSA signature. - -#### Parameters - -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `v` | [BNLike](types.md#bnlike) | `undefined` | - | -| `r` | `Buffer` | `undefined` | - | -| `s` | `Buffer` | `undefined` | - | -| `homesteadOrLater` | `boolean` | true | Indicates whether this is being used on either the homestead hardfork or a later one | -| `chainId?` | `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) | `undefined` | - | - -#### Returns - -`boolean` - -#### Defined in - -[packages/util/src/signature.ts:156](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L156) - -___ - -### toCompactSig - -▸ `Const` **toCompactSig**(`v`, `r`, `s`, `chainId?`): `string` - -Convert signature parameters into the format of Compact Signature Representation (EIP-2098). - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `v` | [BNLike](types.md#bnlike) | -| `r` | `Buffer` | -| `s` | `Buffer` | -| `chainId?` | `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) | - -#### Returns - -`string` - -Signature - -#### Defined in - -[packages/util/src/signature.ts:100](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L100) - -___ - -### toRpcSig - -▸ `Const` **toRpcSig**(`v`, `r`, `s`, `chainId?`): `string` - -Convert signature parameters into the format of `eth_sign` RPC method. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `v` | [BNLike](types.md#bnlike) | -| `r` | `Buffer` | -| `s` | `Buffer` | -| `chainId?` | `string` \| `number` \| `Buffer` \| [BN](../classes/externals.bn-1.md) | - -#### Returns - -`string` - -Signature - -#### Defined in - -[packages/util/src/signature.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/signature.ts#L86) diff --git a/packages/util/docs/modules/types.md b/packages/util/docs/modules/types.md deleted file mode 100644 index ba02c31dbe..0000000000 --- a/packages/util/docs/modules/types.md +++ /dev/null @@ -1,189 +0,0 @@ -[ethereumjs-util](../README.md) / types - -# Module: types - -## Table of contents - -### Enumerations - -- [TypeOutput](../enums/types.typeoutput.md) - -### Interfaces - -- [TransformableToArray](../interfaces/types.transformabletoarray.md) -- [TransformableToBuffer](../interfaces/types.transformabletobuffer.md) - -### Type aliases - -- [AddressLike](types.md#addresslike) -- [BNLike](types.md#bnlike) -- [BufferLike](types.md#bufferlike) -- [PrefixedHexString](types.md#prefixedhexstring) -- [TypeOutputReturnType](types.md#typeoutputreturntype) - -### Functions - -- [bnToHex](types.md#bntohex) -- [bnToRlp](types.md#bntorlp) -- [bnToUnpaddedBuffer](types.md#bntounpaddedbuffer) -- [toType](types.md#totype) - -## Type aliases - -### AddressLike - -Ƭ **AddressLike**: [Address](../classes/address.address-1.md) \| `Buffer` \| [PrefixedHexString](types.md#prefixedhexstring) - -A type that represents an Address-like value. -To convert to address, use `new Address(toBuffer(value))` - -#### Defined in - -[packages/util/src/types.ts:32](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L32) - -___ - -### BNLike - -Ƭ **BNLike**: [BN](../classes/externals.bn-1.md) \| [PrefixedHexString](types.md#prefixedhexstring) \| `number` \| `Buffer` - -#### Defined in - -[packages/util/src/types.ts:9](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L9) - -___ - -### BufferLike - -Ƭ **BufferLike**: `Buffer` \| `Uint8Array` \| `number`[] \| `number` \| [BN](../classes/externals.bn-1.md) \| [TransformableToBuffer](../interfaces/types.transformabletobuffer.md) \| [PrefixedHexString](types.md#prefixedhexstring) - -#### Defined in - -[packages/util/src/types.ts:14](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L14) - -___ - -### PrefixedHexString - -Ƭ **PrefixedHexString**: `string` - -#### Defined in - -[packages/util/src/types.ts:26](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L26) - -___ - -### TypeOutputReturnType - -Ƭ **TypeOutputReturnType**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `0` | `number` | -| `1` | [BN](../classes/externals.bn-1.md) | -| `2` | `Buffer` | -| `3` | [PrefixedHexString](types.md#prefixedhexstring) | - -#### Defined in - -[packages/util/src/types.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L86) - -## Functions - -### bnToHex - -▸ **bnToHex**(`value`): [PrefixedHexString](types.md#prefixedhexstring) - -Convert BN to 0x-prefixed hex string. - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `value` | [BN](../classes/externals.bn-1.md) | - -#### Returns - -[PrefixedHexString](types.md#prefixedhexstring) - -#### Defined in - -[packages/util/src/types.ts:53](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L53) - -___ - -### bnToRlp - -▸ **bnToRlp**(`value`): `Buffer` - -Deprecated alias for [bnToUnpaddedBuffer](types.md#bntounpaddedbuffer) - -**`deprecated`** - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `value` | [BN](../classes/externals.bn-1.md) | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/types.ts:72](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L72) - -___ - -### bnToUnpaddedBuffer - -▸ **bnToUnpaddedBuffer**(`value`): `Buffer` - -Convert value from BN to an unpadded Buffer -(useful for RLP transport) - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `value` | [BN](../classes/externals.bn-1.md) | value to convert | - -#### Returns - -`Buffer` - -#### Defined in - -[packages/util/src/types.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L62) - -___ - -### toType - -▸ **toType**(`input`, `outputType`): [TypeOutputReturnType](types.md#typeoutputreturntype)[`T`] - -Convert an input to a specified type - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `T` | `T`: [TypeOutput](../enums/types.typeoutput.md) | - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `input` | [ToBufferInputTypes](bytes.md#tobufferinputtypes) | value to convert | -| `outputType` | `T` | type to output | - -#### Returns - -[TypeOutputReturnType](types.md#typeoutputreturntype)[`T`] - -#### Defined in - -[packages/util/src/types.ts:98](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/types.ts#L98) diff --git a/packages/util/package.json b/packages/util/package.json index 55ca2243cf..ec35aa086e 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "ethereumjs-util", - "version": "7.1.0", + "version": "7.1.1", "description": "A collection of utility functions for Ethereum", "license": "MPL-2.0", "author": "mjbecze ", @@ -23,7 +23,7 @@ "build": "npm run build:node && npm run build:browser", "build:node": "../../config/cli/ts-build.sh node", "build:browser": "../../config/cli/ts-build.sh browser", - "prepublishOnly": "npm run clean && npm run build && npm run test", + "prepublishOnly": "../../config/cli/prepublish.sh", "clean": "../../config/cli/clean-package.sh", "coverage": "../../config/cli/coverage.sh", "docs:build": "npx typedoc --options typedoc.js", @@ -46,7 +46,7 @@ "@types/assert": "^1.5.4", "@types/node": "^11.13.4", "@types/secp256k1": "^4.0.1", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "eslint": "^6.8.0", "karma": "^6.3.2", "karma-chrome-launcher": "^3.1.0", diff --git a/packages/util/src/account.ts b/packages/util/src/account.ts index c8298477a4..bb25c8af75 100644 --- a/packages/util/src/account.ts +++ b/packages/util/src/account.ts @@ -139,12 +139,14 @@ export const isValidAddress = function (hexAddress: string): boolean { /** * Returns a checksummed address. * - * If a eip1191ChainId is provided, the chainId will be included in the checksum calculation. This + * If an eip1191ChainId is provided, the chainId will be included in the checksum calculation. This * has the effect of checksummed addresses for one chain having invalid checksums for others. * For more details see [EIP-1191](https://eips.ethereum.org/EIPS/eip-1191). * - * WARNING: Checksums with and without the chainId will differ. As of 2019-06-26, the most commonly - * used variation in Ethereum was without the chainId. This may change in the future. + * WARNING: Checksums with and without the chainId will differ and the EIP-1191 checksum is not + * backwards compatible to the original widely adopted checksum format standard introduced in + * [EIP-55](https://eips.ethereum.org/EIPS/eip-55), so this will break in existing applications. + * Usage of this EIP is therefore discouraged unless you have a very targeted use case. */ export const toChecksumAddress = function (hexAddress: string, eip1191ChainId?: BNLike): string { assertIsHexString(hexAddress) diff --git a/packages/util/src/signature.ts b/packages/util/src/signature.ts index 4cfca40e7d..4c4a0ddddf 100644 --- a/packages/util/src/signature.ts +++ b/packages/util/src/signature.ts @@ -20,7 +20,6 @@ export interface ECDSASignatureBuffer { /** * Returns the ECDSA signature of a message hash. */ -/* eslint-disable no-redeclare */ export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId?: number): ECDSASignature export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: BNLike): ECDSASignatureBuffer export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: any): any { @@ -40,7 +39,7 @@ export function ecsign(msgHash: Buffer, privateKey: Buffer, chainId: any): any { return { r, s, v } } - const chainIdBN = toType(chainId, TypeOutput.BN) + const chainIdBN = toType(chainId as BNLike, TypeOutput.BN) const v = chainIdBN.muln(2).addn(35).addn(recovery).toArrayLike(Buffer) return { r, s, v } } diff --git a/packages/util/src/types.ts b/packages/util/src/types.ts index 897bd4c68c..4b7e4d7713 100644 --- a/packages/util/src/types.ts +++ b/packages/util/src/types.ts @@ -91,14 +91,28 @@ export type TypeOutputReturnType = { } /** - * Convert an input to a specified type + * Convert an input to a specified type. + * Input of null/undefined returns null/undefined regardless of the output type. * @param input value to convert * @param outputType type to output */ +export function toType(input: null, outputType: T): null +export function toType(input: undefined, outputType: T): undefined export function toType( input: ToBufferInputTypes, outputType: T -): TypeOutputReturnType[T] { +): TypeOutputReturnType[T] +export function toType( + input: ToBufferInputTypes, + outputType: T +): TypeOutputReturnType[T] | undefined | null { + if (input === null) { + return null + } + if (input === undefined) { + return undefined + } + if (typeof input === 'string' && !isHexString(input)) { throw new Error(`A string must be provided with a 0x-prefix, given: ${input}`) } else if (typeof input === 'number' && !Number.isSafeInteger(input)) { @@ -107,23 +121,23 @@ export function toType( ) } - input = toBuffer(input) + const output = toBuffer(input) if (outputType === TypeOutput.Buffer) { - return input as any + return output as TypeOutputReturnType[T] } else if (outputType === TypeOutput.BN) { - return new BN(input) as any + return new BN(output) as TypeOutputReturnType[T] } else if (outputType === TypeOutput.Number) { - const bn = new BN(input) + const bn = new BN(output) const max = new BN(Number.MAX_SAFE_INTEGER.toString()) if (bn.gt(max)) { throw new Error( 'The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)' ) } - return bn.toNumber() as any + return bn.toNumber() as TypeOutputReturnType[T] } else { // outputType === TypeOutput.PrefixedHexString - return `0x${input.toString('hex')}` as any + return `0x${output.toString('hex')}` as TypeOutputReturnType[T] } } diff --git a/packages/util/test/types.spec.ts b/packages/util/test/types.spec.ts index d964fa7e34..eb9d31d2c2 100644 --- a/packages/util/test/types.spec.ts +++ b/packages/util/test/types.spec.ts @@ -12,6 +12,17 @@ import { } from '../src' tape('toType', function (t) { + t.test('from null and undefined', function (st) { + st.equal(toType(null, TypeOutput.Number), null) + st.equal(toType(null, TypeOutput.BN), null) + st.equal(toType(null, TypeOutput.Buffer), null) + st.equal(toType(null, TypeOutput.PrefixedHexString), null) + st.equal(toType(undefined, TypeOutput.Number), undefined) + st.equal(toType(undefined, TypeOutput.BN), undefined) + st.equal(toType(undefined, TypeOutput.Buffer), undefined) + st.equal(toType(undefined, TypeOutput.PrefixedHexString), undefined) + st.end() + }) t.test('from Number', function (st) { const num = 1000 st.test('should convert to Number', function (st) { diff --git a/packages/vm/CHANGELOG.md b/packages/vm/CHANGELOG.md index 3757698033..4da5499354 100644 --- a/packages/vm/CHANGELOG.md +++ b/packages/vm/CHANGELOG.md @@ -6,7 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [UNRELEASED] +## 5.5.3 - 2021-09-24 + +- Fixed a consensus-relevant bug in the Blake2B precompile (see [EIP-152](https://eips.ethereum.org/EIPS/eip-152)) with messages with a length >= 5 (thanks @jochem-brouwer for the great analysis and quick fix on this! ❤️), PR [#1486](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1486) +- Improved support for custom chain genesis states in `StateManager.generateCanonicalGenesis()` (see `Common` v2.5.0 release for the corresponding functionality), PR [#1409](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1409) +- Fixed `VM.copy()` to also copy the `blockchain` and `common` objects, PR [#1444](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1444) + +And, also worth to note: we are not susceptible to the IDENTITY precompile bug which caused a minority fork in August 2021, see PR [#1436](https://github.com/ethereumjs/ethereumjs-monorepo/pull/1436) and - again - thanks @jochem-brouwer for the quick analysis! 😃 **New Features** @@ -93,7 +99,7 @@ const common = new Common({ chain: 'mainnet', hardfork: 'berlin', eips: [ 3529 ] #### EIP-1559: Gas Fee Market -The VM can now run `EIP-1559` compatible blocks (introduced with the `@ethereumjs/block` `v3.3.0` release) with `VM.runBlocks()` as well as `EIP-1559` txs with type `2` (introduced along the `@ethereumjs/tx` `v3.2.0` release), which can now be passed to `VM.runTx()` as the tx to be executed. Block and tx validation is happening accordingly and the gas calculation takes the new gas fee market parameters from the block (`baseFeePerGas`) and the tx(s) (`maxFeePerGas` and `maxPriorityFeePerGas` instead of a `gasPrice`) into account. +The VM can now run `EIP-1559` compatible blocks (introduced with the `@ethereumjs/block` `v3.3.0` release) with `VM.runBlock()` as well as `EIP-1559` txs with type `2` (introduced along the `@ethereumjs/tx` `v3.2.0` release), which can now be passed to `VM.runTx()` as the tx to be executed. Block and tx validation is happening accordingly and the gas calculation takes the new gas fee market parameters from the block (`baseFeePerGas`) and the tx(s) (`maxFeePerGas` and `maxPriorityFeePerGas` instead of a `gasPrice`) into account. #### EIP-3198: BASEFEE Opcode diff --git a/packages/vm/developer.md b/packages/vm/DEVELOPER.md similarity index 100% rename from packages/vm/developer.md rename to packages/vm/DEVELOPER.md diff --git a/packages/vm/README.md b/packages/vm/README.md index 0964d295fc..3449c8e0ad 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -9,7 +9,7 @@ | TypeScript implementation of the Ethereum VM. | | --- | -Note: this `README` reflects the state of the library from `v5.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-vm) for an introduction on the last preceeding release. +Note: this `README` reflects the state of the library from `v5.0.0` onwards. See `README` from the [standalone repository](https://github.com/ethereumjs/ethereumjs-vm) for an introduction on the last preceding release. # INSTALL @@ -296,7 +296,7 @@ The opFns for `CREATE`, `CALL`, and `CALLCODE` call back up to `runCall`. # DEVELOPMENT -Developer documentation - currently mainly with information on testing and debugging - can be found [here](./developer.md). +Developer documentation - currently mainly with information on testing and debugging - can be found [here](./DEVELOPER.md). # EthereumJS diff --git a/packages/vm/package.json b/packages/vm/package.json index bb295a9651..c9d00858b9 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/vm", - "version": "5.5.2", + "version": "5.5.3", "description": "An Ethereum VM implementation", "license": "MPL-2.0", "author": "mjbecze ", @@ -23,7 +23,7 @@ "build:benchmarks": "npm run build && tsc -p tsconfig.benchmarks.json", "benchmarks": "node --max-old-space-size=4096 ./benchmarks/run.js benchmarks mainnetBlocks:10", "profiling": "0x ./benchmarks/run.js profiling", - "prepublishOnly": "npm run clean && npm run build && npm run test:buildIntegrity", + "prepublishOnly": "../../config/cli/prepublish.sh && npm run test:buildIntegrity", "clean": "../../config/cli/clean-package.sh", "coverage": "nyc npm run coverage:test && nyc report --reporter=lcov", "coverage:test": "npm run tape -- './tests/api/**/*.spec.ts' && npm run tester -- --state", @@ -48,15 +48,15 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", + "@ethereumjs/block": "^3.5.1", + "@ethereumjs/blockchain": "^5.4.2", + "@ethereumjs/common": "^2.5.0", + "@ethereumjs/tx": "^3.3.1", "merkle-patricia-tree": "^4.2.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^2.2.0", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.1", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "rustbn.js": "~0.2.0", @@ -67,7 +67,7 @@ "@types/core-js": "^2.5.0", "@types/lru-cache": "^5.1.0", "@types/node": "^11.13.4", - "@types/tape": "^4.13.0", + "@types/tape": "^4.13.2", "benchmark": "^2.1.4", "eslint": "^6.8.0", "karma": "^6.3.2", @@ -84,9 +84,9 @@ "rlp": "^2.2.4", "standard": "^10.0.0", "tap-spec": "^5.0.0", - "tape": "^4.10.1", + "tape": "^5.3.1", "ts-node": "^10.2.1", - "typedoc": "^0.21.5", + "typedoc": "^0.22.4", "typescript": "^4.4.2" }, "contributors": [ diff --git a/packages/vm/src/evm/precompiles/09-blake2f.ts b/packages/vm/src/evm/precompiles/09-blake2f.ts index c0dcf9242e..075fd61670 100644 --- a/packages/vm/src/evm/precompiles/09-blake2f.ts +++ b/packages/vm/src/evm/precompiles/09-blake2f.ts @@ -5,7 +5,7 @@ import { VmError, ERROR } from '../../exceptions' const assert = require('assert') // The following blake2 code has been taken from (license: Creative Commons CC0): -// https://github.com/dcposch/blakejs/blob/410c640d0f08d3b26904c6d1ab3d81df3619d282/blake2s.js +// https://github.com/dcposch/blakejs/blob/410c640d0f08d3b26904c6d1ab3d81df3619d282/blake2b.js // The modifications include: // - Avoiding the use of context in F // - F accepts number of rounds as parameter @@ -43,11 +43,6 @@ function ADD64AC(v: Uint32Array, a: number, b0: number, b1: number) { v[a + 1] = o1 } -// Little-endian byte access -function B2B_GET32(arr: Uint32Array, i: number) { - return arr[i] ^ (arr[i + 1] << 8) ^ (arr[i + 2] << 16) ^ (arr[i + 3] << 24) -} - // G Mixing function // The ROTRs are inlined for speed function B2B_G( @@ -138,13 +133,6 @@ export function F(h: Uint32Array, m: Uint32Array, t: Uint32Array, f: boolean, ro v[29] = ~v[29] } - // message words - const mw = new Uint32Array(32) - // get little-endian words - for (i = 0; i < 32; i++) { - mw[i] = B2B_GET32(m, 4 * i) - } - // twelve rounds of mixing // uncomment the DebugPrint calls to log the computation // and match the RFC sample documentation @@ -152,14 +140,14 @@ export function F(h: Uint32Array, m: Uint32Array, t: Uint32Array, f: boolean, ro for (i = 0; i < rounds; i++) { // util.debugPrint(' (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64) const ri = (i % 10) * 16 - B2B_G(v, mw, 0, 8, 16, 24, SIGMA82[ri + 0], SIGMA82[ri + 1]) - B2B_G(v, mw, 2, 10, 18, 26, SIGMA82[ri + 2], SIGMA82[ri + 3]) - B2B_G(v, mw, 4, 12, 20, 28, SIGMA82[ri + 4], SIGMA82[ri + 5]) - B2B_G(v, mw, 6, 14, 22, 30, SIGMA82[ri + 6], SIGMA82[ri + 7]) - B2B_G(v, mw, 0, 10, 20, 30, SIGMA82[ri + 8], SIGMA82[ri + 9]) - B2B_G(v, mw, 2, 12, 22, 24, SIGMA82[ri + 10], SIGMA82[ri + 11]) - B2B_G(v, mw, 4, 14, 16, 26, SIGMA82[ri + 12], SIGMA82[ri + 13]) - B2B_G(v, mw, 6, 8, 18, 28, SIGMA82[ri + 14], SIGMA82[ri + 15]) + B2B_G(v, m, 0, 8, 16, 24, SIGMA82[ri + 0], SIGMA82[ri + 1]) + B2B_G(v, m, 2, 10, 18, 26, SIGMA82[ri + 2], SIGMA82[ri + 3]) + B2B_G(v, m, 4, 12, 20, 28, SIGMA82[ri + 4], SIGMA82[ri + 5]) + B2B_G(v, m, 6, 14, 22, 30, SIGMA82[ri + 6], SIGMA82[ri + 7]) + B2B_G(v, m, 0, 10, 20, 30, SIGMA82[ri + 8], SIGMA82[ri + 9]) + B2B_G(v, m, 2, 12, 22, 24, SIGMA82[ri + 10], SIGMA82[ri + 11]) + B2B_G(v, m, 4, 14, 16, 26, SIGMA82[ri + 12], SIGMA82[ri + 13]) + B2B_G(v, m, 6, 8, 18, 28, SIGMA82[ri + 14], SIGMA82[ri + 15]) } for (i = 0; i < 16; i++) { diff --git a/packages/vm/src/index.ts b/packages/vm/src/index.ts index b097886d1b..1948ae4619 100644 --- a/packages/vm/src/index.ts +++ b/packages/vm/src/index.ts @@ -1,5 +1,5 @@ import { SecureTrie as Trie } from 'merkle-patricia-tree' -import { Account, Address } from 'ethereumjs-util' +import { Account, Address, BNLike } from 'ethereumjs-util' import Blockchain from '@ethereumjs/blockchain' import Common, { Chain } from '@ethereumjs/common' import { StateManager, DefaultStateManager } from './state/index' @@ -105,6 +105,17 @@ export interface VMOpts { * Default: `false` */ hardforkByBlockNumber?: boolean + /** + * Select the HF by total difficulty (Merge HF) + * + * This option is a superset of `hardforkByBlockNumber` (so only use one of both options) + * and determines the HF by both the block number and the TD. + * + * Since the TD is only a threshold the block number will in doubt take precedence (imagine + * e.g. both Merge and Shanghai HF blocks set and the block number from the block provided + * pointing to a Shanghai block: this will lead to set the HF as Shanghai and not the Merge). + */ + hardforkByTD?: BNLike } /** @@ -130,6 +141,7 @@ export default class VM extends AsyncEventEmitter { protected readonly _allowUnlimitedContractSize: boolean protected _opcodes: OpcodeList protected readonly _hardforkByBlockNumber: boolean + protected readonly _hardforkByTD?: BNLike /** * Cached emit() function, not for public usage @@ -233,7 +245,14 @@ export default class VM extends AsyncEventEmitter { this._allowUnlimitedContractSize = opts.allowUnlimitedContractSize ?? false + if (opts.hardforkByBlockNumber !== undefined && opts.hardforkByTD !== undefined) { + throw new Error( + `The hardforkByBlockNumber and hardforkByTD options can't be used in conjunction` + ) + } + this._hardforkByBlockNumber = opts.hardforkByBlockNumber ?? false + this._hardforkByTD = opts.hardforkByTD if (this._common.isActivatedEIP(2537)) { if (isBrowser()) { @@ -386,8 +405,8 @@ export default class VM extends AsyncEventEmitter { copy(): VM { return new VM({ stateManager: this.stateManager.copy(), - blockchain: this.blockchain, - common: this._common, + blockchain: this.blockchain.copy(), + common: this._common.copy(), }) } } diff --git a/packages/vm/src/runBlock.ts b/packages/vm/src/runBlock.ts index 1893836fb4..62d8d05962 100644 --- a/packages/vm/src/runBlock.ts +++ b/packages/vm/src/runBlock.ts @@ -114,8 +114,8 @@ export default async function runBlock(this: VM, opts: RunBlockOpts): Promise { const root = this._common.genesis().stateRoot - return await this._trie.checkRoot(root) + return await this._trie.checkRoot(toBuffer(root)) } /** diff --git a/packages/vm/tests/api/index.spec.ts b/packages/vm/tests/api/index.spec.ts index 31f0c339ed..82252c52bc 100644 --- a/packages/vm/tests/api/index.spec.ts +++ b/packages/vm/tests/api/index.spec.ts @@ -8,6 +8,7 @@ import { isRunningInKarma } from '../util' import { setupVM } from './utils' import testnet from './testdata/testnet.json' import testnet2 from './testdata/testnet2.json' +import testnetMerge from './testdata/testnetMerge.json' // explicitly import util and buffer, // needed for karma-typescript bundling @@ -129,7 +130,34 @@ tape('VM -> common (chain, HFs, EIPs)', (t) => { ) }) -tape('VM -> state (deprecated), blockchain', (t) => { +tape('VM -> hardforkByBlockNumber, hardforkByTD, state (deprecated), blockchain', (t) => { + t.test('hardforkByBlockNumber, hardforkByTD', async (st) => { + const customChains = [testnetMerge] + const common = new Common({ chain: 'testnetMerge', hardfork: Hardfork.Istanbul, customChains }) + + let vm = await VM.create({ common, hardforkByBlockNumber: true }) + st.equal((vm as any)._hardforkByBlockNumber, true, 'should set hardforkByBlockNumber option') + + vm = await VM.create({ common, hardforkByTD: 5001 }) + st.equal((vm as any)._hardforkByTD, 5001, 'should set hardforkByTD option') + + try { + await VM.create({ common, hardforkByBlockNumber: true, hardforkByTD: 3000 }) + st.fail('should not reach this') + } catch (e: any) { + const msg = + 'should throw if hardforkByBlockNumber and hardforkByTD options are used in conjunction' + st.ok( + e.message.includes( + `The hardforkByBlockNumber and hardforkByTD options can't be used in conjunction` + ), + msg + ) + } + + st.end() + }) + t.test('should work with trie (state) provided', async (st) => { const trie = new Trie() const vm = new VM({ state: trie, activatePrecompiles: true }) diff --git a/packages/vm/tests/api/istanbul/eip-152.spec.ts b/packages/vm/tests/api/istanbul/eip-152.spec.ts index c620f4f81a..aa7a607ede 100644 --- a/packages/vm/tests/api/istanbul/eip-152.spec.ts +++ b/packages/vm/tests/api/istanbul/eip-152.spec.ts @@ -69,6 +69,13 @@ const testCases = [ '6d2ce9e534d50e18ff866ae92d70cceba79bbcd14c63819fe48752c8aca87a4bb7dcc230d22a4047f0486cfcfb50a17b24b2899eb8fca370f22240adb5170189', name: 'vector 8', }, + { + input: + '0000000c48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5d182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b61626364650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000001', + expected: + 'f3e89a60ec4b0b1854744984e421d22b82f181bd4601fb9b1726b2662da61c29dff09e75814acb2639fd79e56616e55fc135f8476f0302b3dc8d44e082eb83a8', + name: 'vector 9', + }, ] tape('Istanbul: EIP-152', (t) => { diff --git a/packages/vm/tests/api/runBlock.spec.ts b/packages/vm/tests/api/runBlock.spec.ts index 4fb3d63c8e..dc7ea0d71a 100644 --- a/packages/vm/tests/api/runBlock.spec.ts +++ b/packages/vm/tests/api/runBlock.spec.ts @@ -21,7 +21,7 @@ const testData = require('./testdata/blockchain.json') const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) tape('runBlock() -> successful API parameter usage', async (t) => { - async function simpleRun(vm: VM) { + async function simpleRun(vm: VM, st: tape.Test) { const genesisRlp = testData.genesisRLP const genesis = Block.fromRLPSerializedBlock(genesisRlp) @@ -31,7 +31,7 @@ tape('runBlock() -> successful API parameter usage', async (t) => { //@ts-ignore await setupPreConditions(vm.stateManager._trie, testData) - t.ok( + st.ok( //@ts-ignore vm.stateManager._trie.root.equals(genesis.header.stateRoot), 'genesis state root should match calculated state root' @@ -44,14 +44,14 @@ tape('runBlock() -> successful API parameter usage', async (t) => { skipBlockValidation: true, }) - t.equal( + st.equal( res.results[0].gasUsed.toString('hex'), '5208', 'actual gas used should equal blockHeader gasUsed' ) } - async function uncleRun(vm: VM) { + async function uncleRun(vm: VM, st: tape.Test) { const testData = require('./testdata/uncleData.json') //@ts-ignore @@ -90,45 +90,41 @@ tape('runBlock() -> successful API parameter usage', async (t) => { ) ).balance.toString('hex') - t.equals( + st.equals( `0x${uncleReward}`, testData.postState['0xb94f5374fce5ed0000000097c15331677e6ebf0b'].balance, 'calculated balance should equal postState balance' ) } - t.test('PoW block, unmodified options', async (t) => { + t.test('PoW block, unmodified options', async (st) => { const vm = setupVM() - await simpleRun(vm) - t.end() + await simpleRun(vm, st) }) - t.test('Uncle blocks, compute uncle rewards', async (t) => { + t.test('Uncle blocks, compute uncle rewards', async (st) => { const vm = setupVM() - await uncleRun(vm) - t.end() + await uncleRun(vm, st) }) t.test( 'PoW block, Common custom chain (Common.forCustomChain() static constructor)', - async (t) => { + async (st) => { const customChainParams = { name: 'custom', chainId: 123, networkId: 678 } const common = Common.forCustomChain('mainnet', customChainParams, 'berlin') const vm = setupVM({ common }) - await simpleRun(vm) - t.end() + await simpleRun(vm, st) } ) - t.test('PoW block, Common custom chain (Common customChains constructor option)', async (t) => { + t.test('PoW block, Common custom chain (Common customChains constructor option)', async (st) => { const customChains = [testnet] const common = new Common({ chain: 'testnet', hardfork: Hardfork.Berlin, customChains }) const vm = setupVM({ common }) - await simpleRun(vm) - t.end() + await simpleRun(vm, st) }) - t.test('hardforkByBlockNumber option', async (t) => { + t.test('hardforkByBlockNumber option', async (st) => { const common1 = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.MuirGlacier, @@ -178,22 +174,21 @@ tape('runBlock() -> successful API parameter usage', async (t) => { skipBlockValidation: true, generate: true, }) - t.ok( + st.ok( txResultChainstart.results[0].gasUsed.toNumber() == 21000 + 68 * 3 + 3 + 50, 'tx charged right gas on chainstart hard fork' ) - t.ok( + st.ok( txResultMuirGlacier.results[0].gasUsed.toNumber() == 21000 + 32000 + 16 * 3 + 3 + 800, 'tx charged right gas on muir glacier hard fork' ) - t.end() }) }) tape('runBlock() -> API parameter usage/data errors', async (t) => { const vm = new VM({ common }) - t.test('should fail when runTx fails', async (st) => { + t.test('should fail when runTx fails', async (t) => { const blockRlp = testData.blocks[0].rlp const block = Block.fromRLPSerializedBlock(blockRlp) @@ -203,8 +198,6 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { .runBlock({ block, skipBlockValidation: true }) .then(() => t.fail('should have returned error')) .catch((e) => t.ok(e.message.includes("sender doesn't have enough funds to send tx"))) - - st.end() }) t.test('should fail when block gas limit higher than 2^63-1', async (t) => { @@ -220,8 +213,6 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { .runBlock({ block }) .then(() => t.fail('should have returned error')) .catch((e) => t.ok(e.message.includes('Invalid block'))) - - t.end() }) t.test('should fail when block validation fails', async (t) => { @@ -237,8 +228,6 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { .runBlock({ block }) .then(() => t.fail('should have returned error')) .catch((e) => t.ok(e.message.includes('test'))) - - t.end() }) t.test('should fail when tx gas limit higher than block gas limit', async (t) => { @@ -260,8 +249,6 @@ tape('runBlock() -> API parameter usage/data errors', async (t) => { .runBlock({ block, skipBlockValidation: true }) .then(() => t.fail('should have returned error')) .catch((e) => t.ok(e.message.includes('higher gas limit'))) - - t.end() }) }) @@ -317,8 +304,6 @@ tape('runBlock() -> runtime behavior', async (t) => { const msg = 'should transfer balance from DAO children to the Refund DAO account in the DAO fork' t.ok(DAORefundAccount.balance.eq(new BN(Buffer.from('7777', 'hex'))), msg) - - t.end() }) t.test('should allocate to correct clique beneficiary', async (t) => { @@ -365,7 +350,6 @@ tape('runBlock() -> runtime behavior', async (t) => { await vm.runBlock({ block, skipNonce: true, skipBlockValidation: true, generate: true }) const account = await vm.stateManager.getAccount(signer.address) t.ok(account.balance.eqn(42000), 'beneficiary balance should equal the cost of the txs') - t.end() }) }) @@ -411,8 +395,6 @@ tape('should correctly reflect generated fields', async (t) => { t.ok(results.block.header.receiptTrie.equals(KECCAK256_RLP)) t.ok(results.block.header.transactionsTrie.equals(KECCAK256_RLP)) t.ok(results.block.header.gasUsed.eqn(0)) - - t.end() }) async function runWithHf(hardfork: string) { @@ -448,13 +430,11 @@ tape('runBlock() -> API return values', async (t) => { Buffer.from('4477e2cfaf9fd2eed4f74426798b55d140f6a9612da33413c4745f57d7a97fcc', 'hex'), 'should return correct pre-Byzantium receipt format' ) - - t.end() }) }) tape('runBlock() -> tx types', async (t) => { - async function simpleRun(vm: VM, transactions: TypedTransaction[]) { + async function simpleRun(vm: VM, transactions: TypedTransaction[], st: tape.Test) { const common = vm._common const blockRlp = testData.blocks[0].rlp @@ -477,7 +457,7 @@ tape('runBlock() -> tx types', async (t) => { generate: true, }) - t.ok( + st.ok( res.gasUsed.eq( res.receipts .map((r) => r.gasUsed) @@ -487,7 +467,7 @@ tape('runBlock() -> tx types', async (t) => { ) } - t.test('legacy tx', async (t) => { + t.test('legacy tx', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) const vm = setupVM({ common }) @@ -500,11 +480,10 @@ tape('runBlock() -> tx types', async (t) => { return address } - await simpleRun(vm, [tx]) - t.end() + await simpleRun(vm, [tx], st) }) - t.test('access list tx', async (t) => { + t.test('access list tx', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Berlin }) const vm = setupVM({ common }) @@ -520,11 +499,10 @@ tape('runBlock() -> tx types', async (t) => { return address } - await simpleRun(vm, [tx]) - t.end() + await simpleRun(vm, [tx], st) }) - t.test('fee market tx', async (t) => { + t.test('fee market tx', async (st) => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) const vm = setupVM({ common }) @@ -540,7 +518,6 @@ tape('runBlock() -> tx types', async (t) => { return address } - await simpleRun(vm, [tx]) - t.end() + await simpleRun(vm, [tx], st) }) }) diff --git a/packages/vm/tests/api/runBlockchain.spec.ts b/packages/vm/tests/api/runBlockchain.spec.ts index c161cf531c..b3ef2bb304 100644 --- a/packages/vm/tests/api/runBlockchain.spec.ts +++ b/packages/vm/tests/api/runBlockchain.spec.ts @@ -20,7 +20,6 @@ tape('runBlockchain', (t) => { const vm = setupVM({ common }) st.doesNotThrow(async function () { await vm.runBlockchain() - st.end() }) }) @@ -28,7 +27,6 @@ tape('runBlockchain', (t) => { const vm = setupVM({ common }) st.doesNotThrow(async function () { await vm.runBlockchain() - st.end() }) }) diff --git a/packages/vm/tests/api/runTx.spec.ts b/packages/vm/tests/api/runTx.spec.ts index b59a0247cd..1b1dc0673e 100644 --- a/packages/vm/tests/api/runTx.spec.ts +++ b/packages/vm/tests/api/runTx.spec.ts @@ -24,7 +24,7 @@ const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) common.setMaxListeners(100) tape('runTx() -> successful API parameter usage', async (t) => { - async function simpleRun(vm: VM, msg: string) { + async function simpleRun(vm: VM, msg: string, st: tape.Test) { for (const txType of TRANSACTION_TYPES) { const tx = getTransaction(vm._common, txType.type, true) @@ -33,20 +33,20 @@ tape('runTx() -> successful API parameter usage', async (t) => { await vm.stateManager.putAccount(caller, acc) const res = await vm.runTx({ tx }) - t.true(res.gasUsed.gt(new BN(0)), `${msg} (${txType.name})`) + st.true(res.gasUsed.gt(new BN(0)), `${msg} (${txType.name})`) } } - t.test('simple run (unmodified options)', async (t) => { + t.test('simple run (unmodified options)', async (st) => { let common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.London }) let vm = new VM({ common }) - await simpleRun(vm, 'mainnet (PoW), london HF, default SM - should run without errors') + await simpleRun(vm, 'mainnet (PoW), london HF, default SM - should run without errors', st) common = new Common({ chain: Chain.Rinkeby, hardfork: Hardfork.London }) vm = new VM({ common }) - await simpleRun(vm, 'rinkeby (PoA), london HF, default SM - should run without errors') + await simpleRun(vm, 'rinkeby (PoA), london HF, default SM - should run without errors', st) - t.end() + st.end() }) t.test('should use passed in blockGasUsed to generate tx receipt', async (t) => { diff --git a/packages/vm/tests/api/testdata/testnetMerge.json b/packages/vm/tests/api/testdata/testnetMerge.json new file mode 100644 index 0000000000..2823c16c81 --- /dev/null +++ b/packages/vm/tests/api/testdata/testnetMerge.json @@ -0,0 +1,84 @@ +{ + "name": "testnetMerge", + "chainId": 55555, + "networkId": 55555, + "defaultHardfork": "istanbul", + "consensus": { + "type": "poa", + "algorithm": "clique", + "clique": { + "period": 15, + "epoch": 30000 + } + }, + "comment": "Private test network", + "url": "[TESTNET_URL]", + "genesis": { + "hash": "0xaa00000000000000000000000000000000000000000000000000000000000000", + "timestamp": null, + "gasLimit": 1000000, + "difficulty": 1, + "nonce": "0xbb00000000000000", + "extraData": "0xcc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xdd00000000000000000000000000000000000000000000000000000000000000" + }, + "hardforks": [ + { + "name": "chainstart", + "block": 0 + }, + { + "name": "homestead", + "block": 1 + }, + { + "name": "tangerineWhistle", + "block": 2 + }, + { + "name": "spuriousDragon", + "block": 3 + }, + { + "name": "istanbul", + "block": 8 + }, + { + "name": "muirGlacier", + "block": 10 + }, + { + "name": "berlin", + "block": 12 + }, + { + "name": "london", + "block": 14 + }, + { + "name": "merge", + "block": null, + "td": 5000 + }, + { + "name": "shanghai", + "block": null + } + ], + "bootstrapNodes": [ + { + "ip": "10.0.0.1", + "port": 30303, + "id": "11000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + }, + { + "ip": "10.0.0.2", + "port": 30303, + "id": "22000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "location": "", + "comment": "" + } + ] +} diff --git a/packages/vm/tests/config.ts b/packages/vm/tests/config.ts index 25f96374e6..9d886d9243 100644 --- a/packages/vm/tests/config.ts +++ b/packages/vm/tests/config.ts @@ -362,7 +362,7 @@ const expectedTestsFull: any = { Petersburg: 10397, Istanbul: 10715, MuirGlacier: 10715, - Berlin: 13156, + Berlin: 13065, ByzantiumToConstantinopleFixAt5: 0, EIP158ToByzantiumAt5: 0, FrontierToHomesteadAt5: 0, diff --git a/packages/vm/tests/util.ts b/packages/vm/tests/util.ts index f0dec011dd..c97a9d4eda 100644 --- a/packages/vm/tests/util.ts +++ b/packages/vm/tests/util.ts @@ -388,9 +388,9 @@ export function getDAOCommon(activationBlock: number) { const editedForks = [] // explicitly edit the "dao" block number: for (const fork of forks) { - if (fork.name == 'dao') { + if (fork.name == Hardfork.Dao) { editedForks.push({ - name: 'dao', + name: Hardfork.Dao, forkHash: fork.forkHash, block: activationBlock, }) @@ -403,7 +403,7 @@ export function getDAOCommon(activationBlock: number) { { hardforks: editedForks, }, - 'dao' + Hardfork.Dao ) return DAOCommon } diff --git a/packages/vm/tsconfig.json b/packages/vm/tsconfig.json index fe647b7d90..4ea13e1eb2 100644 --- a/packages/vm/tsconfig.json +++ b/packages/vm/tsconfig.json @@ -1,4 +1,4 @@ { "extends": "../../config/tsconfig.json", - "include": ["src/**/*.ts", "src/**/*.json", "tests/**/*.ts", ], + "include": ["src/**/*.ts", "src/**/*.json", "tests/**/*.ts"] } \ No newline at end of file diff --git a/scripts/e2e-inject-resolutions.js b/scripts/e2e-inject-resolutions.js index e364690169..fd5854b0f6 100644 --- a/scripts/e2e-inject-resolutions.js +++ b/scripts/e2e-inject-resolutions.js @@ -1,5 +1,6 @@ /* - This script sets hardhat-core's ethereumjs dependencies to the versions created from the e2e-resolutions.js script. + * This script sets hardhat-core's ethereumjs dependencies + * to the versions created from the e2e-resolutions.js script. */ const fs = require('fs') @@ -23,14 +24,32 @@ fs.writeFileSync( ) /* - workaround: yarn is picking up @types/node 16.x - that the ci is running on, so use resolutions to pin - the hardhat version so types don't mismatch on build + * resolutions workaround notes: + * + * `@types/node`: + * yarn is picking up @types/node v16.x that the ci is running on, + * so pin the hardhat version to the ethereumjs version + * so types match on build. + * + * `@types/bn.js`: + * helped fix this error (this can be solved by issue #1200): + * ``` + * The inferred type of 'rpcNewBlockTagObjectWithNumber' cannot be + * named without a reference to 'ethereumjs-util/node_modules/@types/bn.js'. + * This is likely not portable. A type annotation is necessary. + * ``` */ const rootPackageJsonLocation = `${process.cwd()}/hardhat/package.json` const rootPackageJson = require(rootPackageJsonLocation) -const newRootPackageJson = { ...rootPackageJson, resolutions: { '@types/node': '^10.17.24' } } +const newRootPackageJson = { + ...rootPackageJson, + resolutions: { + ...rootPackageJson.resolutions, + '@types/node': '^10.17.24', + '@types/bn.js': '^5.1.0' + } +} fs.writeFileSync( rootPackageJsonLocation, diff --git a/scripts/e2e-publish.sh b/scripts/e2e-publish.sh index 0496c9cbcd..2214839e00 100755 --- a/scripts/e2e-publish.sh +++ b/scripts/e2e-publish.sh @@ -45,6 +45,9 @@ npm version minor \ git config user.email "someone@example.com" git config user.name "someone" +# Clear prepublish script (no need to run clean/build/test) +cp /dev/null config/cli/prepublish.sh + # Publish to e2e tag npm publish \ --dist-tag e2e \