@acala-network/chopsticks 0.12.2 → 0.13.1
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/dist/cjs/cli.js +19 -8
- package/dist/cjs/context.d.ts +3 -3
- package/dist/cjs/logger.d.ts +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/plugins/trace-transaction/utils.d.ts +0 -1
- package/dist/cjs/schema/index.d.ts +2 -6
- package/dist/cjs/setup-with-server.d.ts +3 -3
- package/dist/esm/cli.js +19 -8
- package/dist/esm/context.d.ts +3 -3
- package/dist/esm/logger.d.ts +1 -1
- package/dist/esm/plugins/trace-transaction/utils.d.ts +0 -1
- package/dist/esm/schema/index.d.ts +2 -6
- package/dist/esm/setup-with-server.d.ts +3 -3
- package/package.json +14 -16
package/dist/cjs/cli.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _dotenv = require("dotenv");
|
|
6
6
|
const _helpers = require("yargs/helpers");
|
|
7
|
+
const _zod = require("zod");
|
|
7
8
|
const _lodash = /*#__PURE__*/ _interop_require_default(require("lodash"));
|
|
8
9
|
const _yargs = /*#__PURE__*/ _interop_require_default(require("yargs"));
|
|
9
10
|
const _chopstickscore = require("@acala-network/chopsticks-core");
|
|
@@ -17,14 +18,24 @@ function _interop_require_default(obj) {
|
|
|
17
18
|
}
|
|
18
19
|
(0, _dotenv.config)();
|
|
19
20
|
const processArgv = async (argv)=>{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
try {
|
|
22
|
+
if (argv.unsafeRpcMethods) {
|
|
23
|
+
await (0, _index1.loadRpcMethodsByScripts)(argv.unsafeRpcMethods);
|
|
24
|
+
}
|
|
25
|
+
if (argv.config) {
|
|
26
|
+
Object.assign(argv, _lodash.default.defaults(argv, await (0, _index.fetchConfig)(argv.config)));
|
|
27
|
+
}
|
|
28
|
+
if (_chopstickscore.environment.PORT) {
|
|
29
|
+
argv.port = Number(_chopstickscore.environment.PORT);
|
|
30
|
+
}
|
|
31
|
+
} catch (error) {
|
|
32
|
+
if (error instanceof _zod.z.ZodError) {
|
|
33
|
+
throw new Error('Bad argv', {
|
|
34
|
+
cause: error.flatten().fieldErrors
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
28
39
|
}
|
|
29
40
|
};
|
|
30
41
|
const commands = (0, _yargs.default)((0, _helpers.hideBin)(process.argv)).scriptName('chopsticks').middleware(processArgv, false).command('*', 'Dev mode, fork off a chain', (yargs)=>yargs.config('config', 'Path to config file with default options', ()=>({})).options((0, _index.getYargsOptions)(_index.configSchema.shape)), async (argv)=>{
|
package/dist/cjs/context.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export declare const setupContext: (argv: Config, overrideParent?: boolean) => P
|
|
|
7
7
|
fetchStorageWorker: {
|
|
8
8
|
worker: import("comlink").Remote<{
|
|
9
9
|
startFetch: (options: {
|
|
10
|
-
block?:
|
|
11
|
-
endpoint?: string | string[]
|
|
12
|
-
dbPath?: string
|
|
10
|
+
block?: number | string | null;
|
|
11
|
+
endpoint?: string | string[];
|
|
12
|
+
dbPath?: string;
|
|
13
13
|
config: import("./utils/fetch-storages.js").FetchStorageConfig;
|
|
14
14
|
}) => Promise<void>;
|
|
15
15
|
}>;
|
package/dist/cjs/logger.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
export { defaultLogger, truncate } from '@acala-network/chopsticks-core';
|
|
3
3
|
export declare const spinnerFrames: string[];
|
|
4
|
-
export declare const apiFetching: _.
|
|
4
|
+
export declare const apiFetching: _.DebouncedFuncLeading<() => void>;
|
package/dist/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type": "commonjs"}
|
|
1
|
+
{ "type": "commonjs" }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BuildBlockMode } from '@acala-network/chopsticks-core';
|
|
2
|
+
import { Options } from 'yargs';
|
|
2
3
|
import { ZodNativeEnum, ZodRawShape, ZodTypeAny, z } from 'zod';
|
|
3
4
|
export declare const zHex: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
4
5
|
export declare const zHash: z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
@@ -147,11 +148,6 @@ export declare const configSchema: z.ZodObject<{
|
|
|
147
148
|
}>;
|
|
148
149
|
export type Config = z.infer<typeof configSchema>;
|
|
149
150
|
export declare const getYargsOptions: (zodShape: ZodRawShape) => {
|
|
150
|
-
[x: string]:
|
|
151
|
-
demandOption: boolean;
|
|
152
|
-
description: any;
|
|
153
|
-
type: any;
|
|
154
|
-
choices: any;
|
|
155
|
-
};
|
|
151
|
+
[x: string]: Options;
|
|
156
152
|
};
|
|
157
153
|
export declare const fetchConfig: (path: string) => Promise<Config>;
|
|
@@ -6,9 +6,9 @@ export declare const setupWithServer: (argv: Config) => Promise<{
|
|
|
6
6
|
fetchStorageWorker: {
|
|
7
7
|
worker: import("comlink").Remote<{
|
|
8
8
|
startFetch: (options: {
|
|
9
|
-
block?:
|
|
10
|
-
endpoint?: string | string[]
|
|
11
|
-
dbPath?: string
|
|
9
|
+
block?: number | string | null;
|
|
10
|
+
endpoint?: string | string[];
|
|
11
|
+
dbPath?: string;
|
|
12
12
|
config: import("./utils/fetch-storages.js").FetchStorageConfig;
|
|
13
13
|
}) => Promise<void>;
|
|
14
14
|
}>;
|
package/dist/esm/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { config as dotenvConfig } from 'dotenv';
|
|
2
2
|
import { hideBin } from 'yargs/helpers';
|
|
3
|
+
import { z } from 'zod';
|
|
3
4
|
import _ from 'lodash';
|
|
4
5
|
import yargs from 'yargs';
|
|
5
6
|
import { connectParachains, connectVertical, environment } from '@acala-network/chopsticks-core';
|
|
@@ -8,14 +9,24 @@ import { loadRpcMethodsByScripts, pluginExtendCli } from './plugins/index.js';
|
|
|
8
9
|
import { setupWithServer } from './index.js';
|
|
9
10
|
dotenvConfig();
|
|
10
11
|
const processArgv = async (argv)=>{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
try {
|
|
13
|
+
if (argv.unsafeRpcMethods) {
|
|
14
|
+
await loadRpcMethodsByScripts(argv.unsafeRpcMethods);
|
|
15
|
+
}
|
|
16
|
+
if (argv.config) {
|
|
17
|
+
Object.assign(argv, _.defaults(argv, await fetchConfig(argv.config)));
|
|
18
|
+
}
|
|
19
|
+
if (environment.PORT) {
|
|
20
|
+
argv.port = Number(environment.PORT);
|
|
21
|
+
}
|
|
22
|
+
} catch (error) {
|
|
23
|
+
if (error instanceof z.ZodError) {
|
|
24
|
+
throw new Error('Bad argv', {
|
|
25
|
+
cause: error.flatten().fieldErrors
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
19
30
|
}
|
|
20
31
|
};
|
|
21
32
|
const commands = yargs(hideBin(process.argv)).scriptName('chopsticks').middleware(processArgv, false).command('*', 'Dev mode, fork off a chain', (yargs)=>yargs.config('config', 'Path to config file with default options', ()=>({})).options(getYargsOptions(configSchema.shape)), async (argv)=>{
|
package/dist/esm/context.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export declare const setupContext: (argv: Config, overrideParent?: boolean) => P
|
|
|
7
7
|
fetchStorageWorker: {
|
|
8
8
|
worker: import("comlink").Remote<{
|
|
9
9
|
startFetch: (options: {
|
|
10
|
-
block?:
|
|
11
|
-
endpoint?: string | string[]
|
|
12
|
-
dbPath?: string
|
|
10
|
+
block?: number | string | null;
|
|
11
|
+
endpoint?: string | string[];
|
|
12
|
+
dbPath?: string;
|
|
13
13
|
config: import("./utils/fetch-storages.js").FetchStorageConfig;
|
|
14
14
|
}) => Promise<void>;
|
|
15
15
|
}>;
|
package/dist/esm/logger.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
export { defaultLogger, truncate } from '@acala-network/chopsticks-core';
|
|
3
3
|
export declare const spinnerFrames: string[];
|
|
4
|
-
export declare const apiFetching: _.
|
|
4
|
+
export declare const apiFetching: _.DebouncedFuncLeading<() => void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BuildBlockMode } from '@acala-network/chopsticks-core';
|
|
2
|
+
import { Options } from 'yargs';
|
|
2
3
|
import { ZodNativeEnum, ZodRawShape, ZodTypeAny, z } from 'zod';
|
|
3
4
|
export declare const zHex: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
4
5
|
export declare const zHash: z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
@@ -147,11 +148,6 @@ export declare const configSchema: z.ZodObject<{
|
|
|
147
148
|
}>;
|
|
148
149
|
export type Config = z.infer<typeof configSchema>;
|
|
149
150
|
export declare const getYargsOptions: (zodShape: ZodRawShape) => {
|
|
150
|
-
[x: string]:
|
|
151
|
-
demandOption: boolean;
|
|
152
|
-
description: any;
|
|
153
|
-
type: any;
|
|
154
|
-
choices: any;
|
|
155
|
-
};
|
|
151
|
+
[x: string]: Options;
|
|
156
152
|
};
|
|
157
153
|
export declare const fetchConfig: (path: string) => Promise<Config>;
|
|
@@ -6,9 +6,9 @@ export declare const setupWithServer: (argv: Config) => Promise<{
|
|
|
6
6
|
fetchStorageWorker: {
|
|
7
7
|
worker: import("comlink").Remote<{
|
|
8
8
|
startFetch: (options: {
|
|
9
|
-
block?:
|
|
10
|
-
endpoint?: string | string[]
|
|
11
|
-
dbPath?: string
|
|
9
|
+
block?: number | string | null;
|
|
10
|
+
endpoint?: string | string[];
|
|
11
|
+
dbPath?: string;
|
|
12
12
|
config: import("./utils/fetch-storages.js").FetchStorageConfig;
|
|
13
13
|
}) => Promise<void>;
|
|
14
14
|
}>;
|
package/package.json
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": "./chopsticks.cjs",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
10
|
-
"build": "yarn clean &&
|
|
11
|
-
"build:cjs": "swc ./src --config-file ../../.cjsswcrc -d dist/cjs --copy-files && tsc -p tsconfig.json --declarationDir dist/cjs && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
12
|
-
"build:esm": "swc ./src --config-file ../../.esmswcrc -d dist/esm --copy-files && tsc -p tsconfig.json --declarationDir dist/esm",
|
|
10
|
+
"build": "yarn clean && ../../package-build.sh",
|
|
13
11
|
"docs:prep": "typedoc",
|
|
14
12
|
"depcheck": "npx depcheck --ignore-patterns='*.test.ts'"
|
|
15
13
|
},
|
|
16
14
|
"dependencies": {
|
|
17
|
-
"@acala-network/chopsticks-core": "0.
|
|
18
|
-
"@acala-network/chopsticks-db": "0.
|
|
15
|
+
"@acala-network/chopsticks-core": "0.13.1",
|
|
16
|
+
"@acala-network/chopsticks-db": "0.13.1",
|
|
19
17
|
"@pnpm/npm-conf": "^2.2.2",
|
|
20
|
-
"@polkadot/api": "^
|
|
21
|
-
"@polkadot/api-augment": "^
|
|
22
|
-
"@polkadot/rpc-provider": "^
|
|
23
|
-
"@polkadot/types": "^
|
|
18
|
+
"@polkadot/api": "^12.1.1",
|
|
19
|
+
"@polkadot/api-augment": "^12.1.1",
|
|
20
|
+
"@polkadot/rpc-provider": "^12.1.1",
|
|
21
|
+
"@polkadot/types": "^12.1.1",
|
|
24
22
|
"@polkadot/util": "^12.6.2",
|
|
25
23
|
"@polkadot/util-crypto": "^12.6.2",
|
|
26
24
|
"axios": "^1.6.8",
|
|
@@ -30,20 +28,20 @@
|
|
|
30
28
|
"js-yaml": "^4.1.0",
|
|
31
29
|
"jsondiffpatch": "^0.5.0",
|
|
32
30
|
"lodash": "^4.17.21",
|
|
33
|
-
"ws": "^8.
|
|
31
|
+
"ws": "^8.17.1",
|
|
34
32
|
"yargs": "^17.7.2",
|
|
35
33
|
"zod": "^3.22.4"
|
|
36
34
|
},
|
|
37
35
|
"devDependencies": {
|
|
38
|
-
"@swc/cli": "0.
|
|
39
|
-
"@swc/core": "^1.
|
|
36
|
+
"@swc/cli": "0.4.0",
|
|
37
|
+
"@swc/core": "^1.6.7",
|
|
40
38
|
"@types/global-agent": "^2.1.3",
|
|
41
39
|
"@types/js-yaml": "^4.0.9",
|
|
42
|
-
"@types/lodash": "^4.17.
|
|
43
|
-
"@types/node": "^20.
|
|
40
|
+
"@types/lodash": "^4.17.6",
|
|
41
|
+
"@types/node": "^20.14.9",
|
|
44
42
|
"@types/ws": "^8.5.10",
|
|
45
43
|
"@types/yargs": "^17.0.32",
|
|
46
|
-
"typescript": "^5.
|
|
44
|
+
"typescript": "^5.5.3"
|
|
47
45
|
},
|
|
48
46
|
"files": [
|
|
49
47
|
"dist/esm/**",
|