hardhat 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js +7 -3
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.js +10 -6
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/chain-descriptors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/chain-descriptors.js +38 -0
- package/dist/src/internal/builtin-plugins/network-manager/chain-descriptors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/network.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/network.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/http-provider.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/http-provider.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/http-provider.js +5 -4
- package/dist/src/internal/builtin-plugins/network-manager/http-provider.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js +2 -6
- package/dist/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +5 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/index.d.ts +3 -2
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/index.js +50 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-wrapper.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-wrapper.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-wrapper.js +1 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-wrapper.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.js +1 -0
- package/dist/src/internal/builtin-plugins/solidity/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts +2 -0
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.js.map +1 -1
- package/dist/src/internal/cli/main.d.ts +1 -0
- package/dist/src/internal/cli/main.d.ts.map +1 -1
- package/dist/src/internal/cli/main.js +36 -1
- package/dist/src/internal/cli/main.js.map +1 -1
- package/dist/src/internal/core/configuration-variables.d.ts.map +1 -1
- package/dist/src/internal/core/configuration-variables.js +1 -1
- package/dist/src/internal/core/configuration-variables.js.map +1 -1
- package/dist/src/internal/core/global-options.js +2 -2
- package/dist/src/internal/core/global-options.js.map +1 -1
- package/dist/src/internal/core/hook-manager.js +1 -1
- package/dist/src/internal/core/hook-manager.js.map +1 -1
- package/dist/src/internal/core/user-interruptions.d.ts.map +1 -1
- package/dist/src/internal/core/user-interruptions.js +1 -1
- package/dist/src/internal/core/user-interruptions.js.map +1 -1
- package/dist/src/types/artifacts.d.ts +3 -2
- package/dist/src/types/artifacts.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +12 -3
- package/src/internal/builtin-plugins/coverage/coverage-manager.ts +12 -6
- package/src/internal/builtin-plugins/network-manager/chain-descriptors.ts +38 -0
- package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/hook-handlers/network.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/http-provider.ts +6 -3
- package/src/internal/builtin-plugins/network-manager/request-handlers/handlers/accounts/local-accounts.ts +9 -9
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +5 -1
- package/src/internal/builtin-plugins/solidity/build-system/compiler/index.ts +73 -3
- package/src/internal/builtin-plugins/solidity/build-system/compiler/solcjs-wrapper.ts +2 -0
- package/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.ts +1 -1
- package/src/internal/builtin-plugins/solidity/config.ts +1 -0
- package/src/internal/builtin-plugins/solidity/type-extensions.ts +2 -0
- package/src/internal/builtin-plugins/solidity-test/config.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/stack-trace-solidity-errors.ts +2 -1
- package/src/internal/cli/main.ts +60 -1
- package/src/internal/core/configuration-variables.ts +1 -2
- package/src/internal/core/global-options.ts +2 -2
- package/src/internal/core/hook-manager.ts +1 -1
- package/src/internal/core/user-interruptions.ts +1 -2
- package/src/types/artifacts.ts +3 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.d.ts +0 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.js +0 -32
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/access-list.d.ts +0 -10
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/access-list.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/access-list.js +0 -9
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/access-list.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/address.d.ts +0 -4
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/address.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/address.js +0 -16
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/address.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/any.d.ts +0 -3
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/any.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/any.js +0 -3
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/any.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.d.ts +0 -14
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.js +0 -15
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/data.d.ts +0 -3
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/data.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/data.js +0 -9
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/data.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/hash.d.ts +0 -3
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/hash.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/hash.js +0 -13
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/hash.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/quantity.d.ts +0 -3
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/quantity.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/quantity.js +0 -8
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/quantity.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/rpc-parity.d.ts +0 -3
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/rpc-parity.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/rpc-parity.js +0 -15
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/rpc-parity.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/tx-request.d.ts +0 -29
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/tx-request.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/tx-request.js +0 -25
- package/dist/src/internal/builtin-plugins/network-manager/rpc/types/tx-request.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/utils.d.ts +0 -3
- package/dist/src/internal/builtin-plugins/network-manager/rpc/utils.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/utils.js +0 -7
- package/dist/src/internal/builtin-plugins/network-manager/rpc/utils.js.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/validate-params.d.ts +0 -5
- package/dist/src/internal/builtin-plugins/network-manager/rpc/validate-params.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/rpc/validate-params.js +0 -40
- package/dist/src/internal/builtin-plugins/network-manager/rpc/validate-params.js.map +0 -1
- package/dist/src/internal/core/async-mutex.d.ts +0 -18
- package/dist/src/internal/core/async-mutex.d.ts.map +0 -1
- package/dist/src/internal/core/async-mutex.js +0 -47
- package/dist/src/internal/core/async-mutex.js.map +0 -1
- package/src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.ts +0 -35
- package/src/internal/builtin-plugins/network-manager/rpc/types/access-list.ts +0 -20
- package/src/internal/builtin-plugins/network-manager/rpc/types/address.ts +0 -25
- package/src/internal/builtin-plugins/network-manager/rpc/types/any.ts +0 -5
- package/src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.ts +0 -31
- package/src/internal/builtin-plugins/network-manager/rpc/types/data.ts +0 -15
- package/src/internal/builtin-plugins/network-manager/rpc/types/hash.ts +0 -21
- package/src/internal/builtin-plugins/network-manager/rpc/types/quantity.ts +0 -14
- package/src/internal/builtin-plugins/network-manager/rpc/types/rpc-parity.ts +0 -24
- package/src/internal/builtin-plugins/network-manager/rpc/types/tx-request.ts +0 -53
- package/src/internal/builtin-plugins/network-manager/rpc/utils.ts +0 -9
- package/src/internal/builtin-plugins/network-manager/rpc/validate-params.ts +0 -62
- package/src/internal/core/async-mutex.ts +0 -51
|
@@ -25,6 +25,7 @@ import path from "node:path";
|
|
|
25
25
|
|
|
26
26
|
import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
|
|
27
27
|
import { exists } from "@nomicfoundation/hardhat-utils/fs";
|
|
28
|
+
import { AsyncMutex } from "@nomicfoundation/hardhat-utils/synchronization";
|
|
28
29
|
import { analyze } from "@nomicfoundation/solidity-analyzer";
|
|
29
30
|
|
|
30
31
|
import {
|
|
@@ -32,7 +33,6 @@ import {
|
|
|
32
33
|
RootResolutionErrorType,
|
|
33
34
|
} from "../../../../../types/solidity/errors.js";
|
|
34
35
|
import { ResolvedFileType } from "../../../../../types/solidity/resolved-file.js";
|
|
35
|
-
import { AsyncMutex } from "../../../../core/async-mutex.js";
|
|
36
36
|
|
|
37
37
|
import { parseNpmDirectImport } from "./npm-module-parsing.js";
|
|
38
38
|
import {
|
|
@@ -13,6 +13,7 @@ declare module "../../../types/config.js" {
|
|
|
13
13
|
export interface SolcUserConfig {
|
|
14
14
|
version: string;
|
|
15
15
|
settings?: any;
|
|
16
|
+
path?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export interface SingleVersionSolcUserConfig extends SolcUserConfig {
|
|
@@ -54,6 +55,7 @@ declare module "../../../types/config.js" {
|
|
|
54
55
|
export interface SolcConfig {
|
|
55
56
|
version: string;
|
|
56
57
|
settings: any;
|
|
58
|
+
path?: string;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
export interface SolidityBuildProfileConfig {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SolidityStackTraceEntry } from "../network-manager/edr/stack-traces/solidity-stack-trace.js";
|
|
2
2
|
|
|
3
|
-
import { panicErrorCodeToMessage } from "
|
|
3
|
+
import { panicErrorCodeToMessage } from "@nomicfoundation/hardhat-utils/panic-errors";
|
|
4
|
+
|
|
4
5
|
import { StackTraceEntryType } from "../network-manager/edr/stack-traces/solidity-stack-trace.js";
|
|
5
6
|
|
|
6
7
|
export function getMessageFromLastStackTraceEntry(
|
package/src/internal/cli/main.ts
CHANGED
|
@@ -5,13 +5,20 @@ import type {
|
|
|
5
5
|
import type { HardhatRuntimeEnvironment } from "../../types/hre.js";
|
|
6
6
|
import type { Task, TaskArguments } from "../../types/tasks.js";
|
|
7
7
|
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
|
|
8
10
|
import {
|
|
9
11
|
HardhatError,
|
|
10
12
|
assertHardhatInvariant,
|
|
11
13
|
} from "@nomicfoundation/hardhat-errors";
|
|
12
14
|
import { isCi } from "@nomicfoundation/hardhat-utils/ci";
|
|
13
15
|
import { ensureError } from "@nomicfoundation/hardhat-utils/error";
|
|
14
|
-
import {
|
|
16
|
+
import { getRealPath } from "@nomicfoundation/hardhat-utils/fs";
|
|
17
|
+
import {
|
|
18
|
+
findClosestPackageJson,
|
|
19
|
+
findDependencyPackageJson,
|
|
20
|
+
readClosestPackageJson,
|
|
21
|
+
} from "@nomicfoundation/hardhat-utils/package";
|
|
15
22
|
import { kebabToCamelCase } from "@nomicfoundation/hardhat-utils/string";
|
|
16
23
|
import debug from "debug";
|
|
17
24
|
import { register } from "tsx/esm/api";
|
|
@@ -49,6 +56,7 @@ export interface MainOptions {
|
|
|
49
56
|
print?: (message: string) => void;
|
|
50
57
|
registerTsx?: boolean;
|
|
51
58
|
rethrowErrors?: true;
|
|
59
|
+
allowNonlocalHardhatInstallation?: true;
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
export async function main(
|
|
@@ -92,6 +100,15 @@ export async function main(
|
|
|
92
100
|
builtinGlobalOptions.configPath,
|
|
93
101
|
);
|
|
94
102
|
|
|
103
|
+
if (
|
|
104
|
+
options.allowNonlocalHardhatInstallation !== true &&
|
|
105
|
+
!(await isHardhatInstalledLocallyOrLinked(configPath, log))
|
|
106
|
+
) {
|
|
107
|
+
throw new HardhatError(
|
|
108
|
+
HardhatError.ERRORS.CORE.GENERAL.NON_LOCAL_INSTALLATION,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
95
112
|
setCliHardhatConfigPath(configPath);
|
|
96
113
|
|
|
97
114
|
const projectRoot = await resolveProjectRoot(configPath);
|
|
@@ -682,3 +699,45 @@ npm pkg set type="module"
|
|
|
682
699
|
|
|
683
700
|
return false;
|
|
684
701
|
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Returns true if Hardhat is installed locally or linked from its repository,
|
|
705
|
+
* by looking for it using the node module resolution logic.
|
|
706
|
+
*
|
|
707
|
+
* If a config file is provided, we start looking for it from there. Otherwise,
|
|
708
|
+
* we use the current working directory.
|
|
709
|
+
*/
|
|
710
|
+
async function isHardhatInstalledLocallyOrLinked(
|
|
711
|
+
configPath: string,
|
|
712
|
+
log: debug.Debugger,
|
|
713
|
+
) {
|
|
714
|
+
try {
|
|
715
|
+
// Based on Node.js resolution algorithm find the real path
|
|
716
|
+
// of the project's version of Hardhat
|
|
717
|
+
const realPathToResolvedPackageJson = await findDependencyPackageJson(
|
|
718
|
+
configPath ?? process.cwd(),
|
|
719
|
+
"hardhat",
|
|
720
|
+
);
|
|
721
|
+
|
|
722
|
+
// Find the executing code's Hardhat Package.json
|
|
723
|
+
const thisPackageJson = await findClosestPackageJson(
|
|
724
|
+
fileURLToPath(import.meta.url),
|
|
725
|
+
);
|
|
726
|
+
|
|
727
|
+
// We need to get the realpaths here, as hardhat may be linked and
|
|
728
|
+
// running with `node --preserve-symlinks`
|
|
729
|
+
const isLocalOrLinked =
|
|
730
|
+
realPathToResolvedPackageJson === (await getRealPath(thisPackageJson));
|
|
731
|
+
|
|
732
|
+
if (!isLocalOrLinked) {
|
|
733
|
+
log("Determined that Hardhat is not installed locally/linked");
|
|
734
|
+
log(` resolved package.json: ${realPathToResolvedPackageJson}`);
|
|
735
|
+
log(` current package.json: ${thisPackageJson}`);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
return isLocalOrLinked;
|
|
739
|
+
} catch (error) {
|
|
740
|
+
log("Error during installed locally/linked test", error);
|
|
741
|
+
return false;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
HardhatError,
|
|
10
10
|
} from "@nomicfoundation/hardhat-errors";
|
|
11
11
|
import { normalizeHexString } from "@nomicfoundation/hardhat-utils/hex";
|
|
12
|
-
|
|
13
|
-
import { AsyncMutex } from "./async-mutex.js";
|
|
12
|
+
import { AsyncMutex } from "@nomicfoundation/hardhat-utils/synchronization";
|
|
14
13
|
|
|
15
14
|
export const CONFIGURATION_VARIABLE_MARKER = "{variable}";
|
|
16
15
|
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
import type { HardhatPlugin } from "../../types/plugins.js";
|
|
11
11
|
|
|
12
12
|
import { HardhatError } from "@nomicfoundation/hardhat-errors";
|
|
13
|
-
import {
|
|
13
|
+
import { getEnvVariableNameFromGlobalOption } from "@nomicfoundation/hardhat-utils/env";
|
|
14
14
|
|
|
15
15
|
import { ArgumentType } from "../../types/arguments.js";
|
|
16
16
|
|
|
@@ -168,7 +168,7 @@ export function resolveGlobalOptions(
|
|
|
168
168
|
if (value !== undefined) {
|
|
169
169
|
parsedValue = value;
|
|
170
170
|
} else {
|
|
171
|
-
value = process.env[
|
|
171
|
+
value = process.env[getEnvVariableNameFromGlobalOption(name)];
|
|
172
172
|
if (value !== undefined) {
|
|
173
173
|
// if the value is provided via an env var, it needs to be parsed
|
|
174
174
|
parsedValue = parseArgumentValue(value, option.type, name);
|
|
@@ -13,8 +13,8 @@ import type { HardhatPlugin } from "../../types/plugins.js";
|
|
|
13
13
|
import type { LastParameter, Return } from "../../types/utils.js";
|
|
14
14
|
|
|
15
15
|
import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
|
|
16
|
+
import { AsyncMutex } from "@nomicfoundation/hardhat-utils/synchronization";
|
|
16
17
|
|
|
17
|
-
import { AsyncMutex } from "./async-mutex.js";
|
|
18
18
|
import { detectPluginNpmDependencyProblems } from "./plugins/detect-plugin-npm-dependency-problems.js";
|
|
19
19
|
|
|
20
20
|
export class HookManagerImplementation implements HookManager {
|
|
@@ -2,8 +2,7 @@ import type { HookContext, HookManager } from "../../types/hooks.js";
|
|
|
2
2
|
import type { UserInterruptionManager } from "../../types/user-interruptions.js";
|
|
3
3
|
|
|
4
4
|
import { assertHardhatInvariant } from "@nomicfoundation/hardhat-errors";
|
|
5
|
-
|
|
6
|
-
import { AsyncMutex } from "./async-mutex.js";
|
|
5
|
+
import { AsyncMutex } from "@nomicfoundation/hardhat-utils/synchronization";
|
|
7
6
|
|
|
8
7
|
export class UserInterruptionManagerImplementation
|
|
9
8
|
implements UserInterruptionManager
|
package/src/types/artifacts.ts
CHANGED
|
@@ -96,7 +96,7 @@ export interface ArtifactManager {
|
|
|
96
96
|
getAllBuildInfoIds(): Promise<ReadonlySet<string>>;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
* Returns the absolute path to the given build info, or undefined if it
|
|
99
|
+
* Returns the absolute path to the given build info, or `undefined` if it
|
|
100
100
|
* doesn't exist.
|
|
101
101
|
*
|
|
102
102
|
* @param buildInfoId The id of an existing build info.
|
|
@@ -107,7 +107,8 @@ export interface ArtifactManager {
|
|
|
107
107
|
* Returns the absolute path to the output of the given build info,
|
|
108
108
|
* if present.
|
|
109
109
|
*
|
|
110
|
-
* Note that the build info may exist, but it's output may not.
|
|
110
|
+
* Note that the build info may exist, but it's output may not. In that case,
|
|
111
|
+
* this function returns `undefined`.
|
|
111
112
|
*
|
|
112
113
|
* @param buildInfoId The id of an existing build info.
|
|
113
114
|
*/
|
package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panic-errors.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQjE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { numberToHexString } from "@nomicfoundation/hardhat-utils/hex";
|
|
2
|
-
export function panicErrorCodeToMessage(errorCode) {
|
|
3
|
-
const reason = panicErrorCodeToReason(errorCode);
|
|
4
|
-
if (reason !== undefined) {
|
|
5
|
-
return `reverted with panic code ${numberToHexString(errorCode)} (${reason})`;
|
|
6
|
-
}
|
|
7
|
-
return `reverted with unknown panic code ${numberToHexString(errorCode)}`;
|
|
8
|
-
}
|
|
9
|
-
function panicErrorCodeToReason(errorCode) {
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- we are only covering some of the integer range
|
|
11
|
-
switch (errorCode) {
|
|
12
|
-
case 0x1n:
|
|
13
|
-
return "Assertion error";
|
|
14
|
-
case 0x11n:
|
|
15
|
-
return "Arithmetic operation overflowed outside of an unchecked block";
|
|
16
|
-
case 0x12n:
|
|
17
|
-
return "Division or modulo division by zero";
|
|
18
|
-
case 0x21n:
|
|
19
|
-
return "Tried to convert a value into an enum, but the value was too big or negative";
|
|
20
|
-
case 0x22n:
|
|
21
|
-
return "Incorrectly encoded storage byte array";
|
|
22
|
-
case 0x31n:
|
|
23
|
-
return ".pop() was called on an empty array";
|
|
24
|
-
case 0x32n:
|
|
25
|
-
return "Array accessed at an out-of-bounds or negative index";
|
|
26
|
-
case 0x41n:
|
|
27
|
-
return "Too much memory was allocated, or an array was created that is too large";
|
|
28
|
-
case 0x51n:
|
|
29
|
-
return "Called a zero-initialized variable of internal function type";
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=panic-errors.js.map
|
package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panic-errors.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/edr/stack-traces/panic-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACvD,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAEjD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,4BAA4B,iBAAiB,CAAC,SAAS,CAAC,KAAK,MAAM,GAAG,CAAC;IAChF,CAAC;IAED,OAAO,oCAAoC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;AAC5E,CAAC;AAED,SAAS,sBAAsB,CAAC,SAAiB;IAC/C,4HAA4H;IAC5H,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,iBAAiB,CAAC;QAC3B,KAAK,KAAK;YACR,OAAO,+DAA+D,CAAC;QACzE,KAAK,KAAK;YACR,OAAO,qCAAqC,CAAC;QAC/C,KAAK,KAAK;YACR,OAAO,8EAA8E,CAAC;QACxF,KAAK,KAAK;YACR,OAAO,wCAAwC,CAAC;QAClD,KAAK,KAAK;YACR,OAAO,qCAAqC,CAAC;QAC/C,KAAK,KAAK;YACR,OAAO,sDAAsD,CAAC;QAChE,KAAK,KAAK;YACR,OAAO,0EAA0E,CAAC;QACpF,KAAK,KAAK;YACR,OAAO,8DAA8D,CAAC;IAC1E,CAAC;AACH,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ZodType } from "zod";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
declare const rpcAccessListTuple: ZodType<{
|
|
4
|
-
address: Uint8Array;
|
|
5
|
-
storageKeys: Uint8Array[] | null;
|
|
6
|
-
}>;
|
|
7
|
-
export type RpcAccessListTuple = z.infer<typeof rpcAccessListTuple>;
|
|
8
|
-
export declare const rpcAccessList: ZodType<RpcAccessListTuple[]>;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=access-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/access-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,kBAAkB,EAAE,OAAO,CAAC;IAChC,OAAO,EAAE,UAAU,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;CAClC,CAGC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAC3B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { rpcData } from "./data.js";
|
|
3
|
-
const nullable = (schema) => schema.nullable();
|
|
4
|
-
const rpcAccessListTuple = z.object({
|
|
5
|
-
address: rpcData,
|
|
6
|
-
storageKeys: nullable(z.array(rpcData)),
|
|
7
|
-
});
|
|
8
|
-
export const rpcAccessList = z.array(rpcAccessListTuple);
|
|
9
|
-
//# sourceMappingURL=access-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access-list.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/access-list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,QAAQ,GAAG,CAAyB,MAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;AAE1E,MAAM,kBAAkB,GAGnB,CAAC,CAAC,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;CACxC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,aAAa,GACxB,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/address.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AASnC,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,UAAU,CAS0B,CAAC;AAEtE,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,UAAU,GAAG,IAAI,CAIvD,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { isAddress } from "@nomicfoundation/hardhat-utils/eth";
|
|
2
|
-
import { hexStringToBytes } from "@nomicfoundation/hardhat-utils/hex";
|
|
3
|
-
import { conditionalUnionType } from "@nomicfoundation/hardhat-zod-utils";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
const ADDRESS_LENGTH_BYTES = 20;
|
|
6
|
-
export const rpcAddress = conditionalUnionType([
|
|
7
|
-
[
|
|
8
|
-
(data) => Buffer.isBuffer(data) && data.length === ADDRESS_LENGTH_BYTES,
|
|
9
|
-
z.instanceof(Uint8Array),
|
|
10
|
-
],
|
|
11
|
-
[isAddress, z.string()],
|
|
12
|
-
], "Expected a Buffer with correct length or a valid RPC address string").transform((v) => (typeof v === "string" ? hexStringToBytes(v) : v));
|
|
13
|
-
export const nullableRpcAddress = rpcAddress
|
|
14
|
-
.or(z.null())
|
|
15
|
-
.describe("Expected a Buffer with correct length, a valid RPC address string, or the null value");
|
|
16
|
-
//# sourceMappingURL=address.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/address.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAwB,oBAAoB,CACjE;IACE;QACE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,oBAAoB;QACvE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;KACzB;IACD,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CACxB,EACD,qEAAqE,CACtE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAA+B,UAAU;KACrE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;KACZ,QAAQ,CACP,sFAAsF,CACvF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"any.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/any.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAInC,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,GAAG,CAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"any.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/any.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,MAAM,GAAiB,CAAC,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ZodType } from "zod";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
declare const rpcAuthorizationListTuple: ZodType<{
|
|
4
|
-
chainId: bigint;
|
|
5
|
-
address: Uint8Array;
|
|
6
|
-
nonce: bigint;
|
|
7
|
-
yParity: Uint8Array;
|
|
8
|
-
r: Uint8Array;
|
|
9
|
-
s: Uint8Array;
|
|
10
|
-
}>;
|
|
11
|
-
export type RpcAuthorizationListTuple = z.infer<typeof rpcAuthorizationListTuple>;
|
|
12
|
-
export declare const rpcAuthorizationList: ZodType<RpcAuthorizationListTuple[]>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=authorization-list.d.ts.map
|
package/dist/src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEnC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,QAAA,MAAM,yBAAyB,EAAE,OAAO,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,UAAU,CAAC;IACpB,CAAC,EAAE,UAAU,CAAC;IACd,CAAC,EAAE,UAAU,CAAC;CACf,CAOC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,yBAAyB,EAAE,CAClC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { rpcAddress } from "./address.js";
|
|
3
|
-
import { rpcHash } from "./hash.js";
|
|
4
|
-
import { rpcQuantity } from "./quantity.js";
|
|
5
|
-
import { rpcParity } from "./rpc-parity.js";
|
|
6
|
-
const rpcAuthorizationListTuple = z.object({
|
|
7
|
-
chainId: rpcQuantity,
|
|
8
|
-
address: rpcAddress,
|
|
9
|
-
nonce: rpcQuantity,
|
|
10
|
-
yParity: rpcParity,
|
|
11
|
-
r: rpcHash,
|
|
12
|
-
s: rpcHash,
|
|
13
|
-
});
|
|
14
|
-
export const rpcAuthorizationList = z.array(rpcAuthorizationListTuple);
|
|
15
|
-
//# sourceMappingURL=authorization-list.js.map
|
package/dist/src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-list.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/authorization-list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,yBAAyB,GAO1B,CAAC,CAAC,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,UAAU;IACnB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,SAAS;IAClB,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,OAAO;CACX,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAQnC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,UAAU,CAM6B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { hexStringToBytes } from "@nomicfoundation/hardhat-utils/hex";
|
|
2
|
-
import { conditionalUnionType } from "@nomicfoundation/hardhat-zod-utils";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { isRpcDataString } from "../utils.js";
|
|
5
|
-
export const rpcData = conditionalUnionType([
|
|
6
|
-
[Buffer.isBuffer, z.instanceof(Uint8Array)],
|
|
7
|
-
[isRpcDataString, z.string()],
|
|
8
|
-
], "Expected a Buffer or a valid RPC data string").transform((v) => (typeof v === "string" ? hexStringToBytes(v) : v));
|
|
9
|
-
//# sourceMappingURL=data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/data.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,OAAO,GAAwB,oBAAoB,CAC9D;IACE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAC9B,EACD,8CAA8C,CAC/C,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AASnC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,UAAU,CAWvC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isHash } from "@nomicfoundation/hardhat-utils/eth";
|
|
2
|
-
import { hexStringToBytes } from "@nomicfoundation/hardhat-utils/hex";
|
|
3
|
-
import { conditionalUnionType } from "@nomicfoundation/hardhat-zod-utils";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
const HASH_LENGTH_BYTES = 32;
|
|
6
|
-
export const rpcHash = conditionalUnionType([
|
|
7
|
-
[
|
|
8
|
-
(data) => Buffer.isBuffer(data) && data.length === HASH_LENGTH_BYTES,
|
|
9
|
-
z.instanceof(Uint8Array),
|
|
10
|
-
],
|
|
11
|
-
[isHash, z.string()],
|
|
12
|
-
], "Expected a Buffer with the correct length or a valid RPC hash string").transform((v) => typeof v === "string" ? Buffer.from(hexStringToBytes(v)) : v);
|
|
13
|
-
//# sourceMappingURL=hash.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/hash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAwB,oBAAoB,CAC9D;IACE;QACE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,iBAAiB;QACpE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;KACzB;IACD,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CACrB,EACD,sEAAsE,CACvE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAChB,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC7D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quantity.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/quantity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAOnC,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,MAAM,CAMmB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { conditionalUnionType } from "@nomicfoundation/hardhat-zod-utils";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { isRpcQuantityString } from "../utils.js";
|
|
4
|
-
export const rpcQuantity = conditionalUnionType([
|
|
5
|
-
[(data) => typeof data === "bigint", z.bigint()],
|
|
6
|
-
[isRpcQuantityString, z.string()],
|
|
7
|
-
], "Expected a bigint or a valid RPC quantity string").transform((v) => (typeof v === "string" ? BigInt(v) : v));
|
|
8
|
-
//# sourceMappingURL=quantity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quantity.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/quantity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,MAAM,WAAW,GAAoB,oBAAoB,CAC9D;IACE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAChD,CAAC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAClC,EACD,kDAAkD,CACnD,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-parity.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/rpc-parity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAQnC,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAWrC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { hexStringToBytes } from "@nomicfoundation/hardhat-utils/hex";
|
|
2
|
-
import { conditionalUnionType } from "@nomicfoundation/hardhat-zod-utils";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
const PARITY_LENGTH_BYTES = 1;
|
|
5
|
-
export const rpcParity = conditionalUnionType([
|
|
6
|
-
[
|
|
7
|
-
(data) => Buffer.isBuffer(data) && data.length === PARITY_LENGTH_BYTES,
|
|
8
|
-
z.instanceof(Uint8Array),
|
|
9
|
-
],
|
|
10
|
-
[isRpcParityString, z.string()],
|
|
11
|
-
], "Expected a Buffer or valid parity string").transform((v) => typeof v === "string" ? Buffer.from(hexStringToBytes(v)) : v);
|
|
12
|
-
function isRpcParityString(u) {
|
|
13
|
-
return typeof u === "string" && u.match(/^0x[0-9a-fA-F]{1,2}$/) !== null;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=rpc-parity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-parity.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/rpc-parity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,MAAM,CAAC,MAAM,SAAS,GAAoB,oBAAoB,CAC5D;IACE;QACE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,mBAAmB;QACtE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;KACzB;IACD,CAAC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAChC,EACD,0CAA0C,CAC3C,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAChB,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC7D,CAAC;AAEF,SAAS,iBAAiB,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;AAC3E,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ZodType } from "zod";
|
|
2
|
-
export interface RpcTransactionRequest {
|
|
3
|
-
from: Uint8Array;
|
|
4
|
-
to?: Uint8Array | null;
|
|
5
|
-
gas?: bigint;
|
|
6
|
-
gasPrice?: bigint;
|
|
7
|
-
value?: bigint;
|
|
8
|
-
nonce?: bigint;
|
|
9
|
-
data?: Uint8Array;
|
|
10
|
-
accessList?: Array<{
|
|
11
|
-
address: Uint8Array;
|
|
12
|
-
storageKeys: Uint8Array[] | null;
|
|
13
|
-
}>;
|
|
14
|
-
chainId?: bigint;
|
|
15
|
-
maxFeePerGas?: bigint;
|
|
16
|
-
maxPriorityFeePerGas?: bigint;
|
|
17
|
-
blobs?: Uint8Array[];
|
|
18
|
-
blobVersionedHashes?: Uint8Array[];
|
|
19
|
-
authorizationList?: Array<{
|
|
20
|
-
chainId: bigint;
|
|
21
|
-
address: Uint8Array;
|
|
22
|
-
nonce: bigint;
|
|
23
|
-
yParity: Uint8Array;
|
|
24
|
-
r: Uint8Array;
|
|
25
|
-
s: Uint8Array;
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
28
|
-
export declare const rpcTransactionRequest: ZodType<RpcTransactionRequest>;
|
|
29
|
-
//# sourceMappingURL=tx-request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tx-request.d.ts","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/tx-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAanC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC;IACnC,iBAAiB,CAAC,EAAE,KAAK,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,UAAU,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,UAAU,CAAC;QACpB,CAAC,EAAE,UAAU,CAAC;QACd,CAAC,EAAE,UAAU,CAAC;KACf,CAAC,CAAC;CACJ;AAED,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,CAe/D,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { rpcAccessList } from "./access-list.js";
|
|
3
|
-
import { nullableRpcAddress, rpcAddress } from "./address.js";
|
|
4
|
-
import { rpcAuthorizationList } from "./authorization-list.js";
|
|
5
|
-
import { rpcData } from "./data.js";
|
|
6
|
-
import { rpcHash } from "./hash.js";
|
|
7
|
-
import { rpcQuantity } from "./quantity.js";
|
|
8
|
-
const optional = (schema) => schema.optional();
|
|
9
|
-
export const rpcTransactionRequest = z.object({
|
|
10
|
-
from: rpcAddress,
|
|
11
|
-
to: optional(nullableRpcAddress),
|
|
12
|
-
gas: optional(rpcQuantity),
|
|
13
|
-
gasPrice: optional(rpcQuantity),
|
|
14
|
-
value: optional(rpcQuantity),
|
|
15
|
-
nonce: optional(rpcQuantity),
|
|
16
|
-
data: optional(rpcData),
|
|
17
|
-
accessList: optional(rpcAccessList),
|
|
18
|
-
chainId: optional(rpcQuantity),
|
|
19
|
-
maxFeePerGas: optional(rpcQuantity),
|
|
20
|
-
maxPriorityFeePerGas: optional(rpcQuantity),
|
|
21
|
-
blobs: optional(z.array(rpcData)),
|
|
22
|
-
blobVersionedHashes: optional(z.array(rpcHash)),
|
|
23
|
-
authorizationList: optional(rpcAuthorizationList),
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=tx-request.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tx-request.js","sourceRoot":"","sources":["../../../../../../../src/internal/builtin-plugins/network-manager/rpc/types/tx-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,QAAQ,GAAG,CAAyB,MAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;AA0B1E,MAAM,CAAC,MAAM,qBAAqB,GAAmC,CAAC,CAAC,MAAM,CAAC;IAC5E,IAAI,EAAE,UAAU;IAChB,EAAE,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IAChC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC/B,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC5B,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC5B,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;IACvB,UAAU,EAAE,QAAQ,CAAC,aAAa,CAAC;IACnC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC9B,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC;IACnC,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAAC;IAC3C,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/C,iBAAiB,EAAE,QAAQ,CAAC,oBAAoB,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/network-manager/rpc/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAI3D;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAEvD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export function isRpcQuantityString(u) {
|
|
2
|
-
return (typeof u === "string" && /^0x(?:0|(?:[1-9a-fA-F][0-9a-fA-F]*))$/.test(u));
|
|
3
|
-
}
|
|
4
|
-
export function isRpcDataString(u) {
|
|
5
|
-
return typeof u === "string" && /^0x(?:[0-9a-fA-F]{2})*$/.test(u);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/network-manager/rpc/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CAAC,CAAU;IAC5C,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ,IAAI,uCAAuC,CAAC,IAAI,CAAC,CAAC,CAAC,CACzE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,CAAU;IACxC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ZodType } from "zod";
|
|
2
|
-
export declare function validateParams<TypesT extends ReadonlyArray<ZodType<any>>>(params: any[], ...types: TypesT): {
|
|
3
|
-
[i in keyof TypesT]: TypesT[i] extends ZodType<infer TypeT> ? TypeT : never;
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=validate-params.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-params.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/network-manager/rpc/validate-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAInC,wBAAgB,cAAc,CAAC,MAAM,SAAS,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EACvE,MAAM,EAAE,GAAG,EAAE,EACb,GAAG,KAAK,EAAE,MAAM,GACf;KACA,CAAC,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK;CAC5E,CAoDA"}
|