@acala-network/chopsticks 0.8.0-6 → 0.8.0
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.
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.rpc = exports.name = void 0;
|
|
7
|
-
const zod_1 =
|
|
4
|
+
const zod_1 = require("zod");
|
|
8
5
|
const shared_1 = require("../../rpc/shared");
|
|
9
6
|
const decoder_1 = require("../../utils/decoder");
|
|
10
7
|
const generate_html_diff_1 = require("../../utils/generate-html-diff");
|
|
11
|
-
const zHex = zod_1.
|
|
12
|
-
const zHash = zod_1.
|
|
13
|
-
const zParaId = zod_1.
|
|
14
|
-
const schema = zod_1.
|
|
15
|
-
raw: zod_1.
|
|
16
|
-
html: zod_1.
|
|
8
|
+
const zHex = zod_1.z.custom((val) => /^0x\w+$/.test(val));
|
|
9
|
+
const zHash = zod_1.z.string().length(66).and(zHex);
|
|
10
|
+
const zParaId = zod_1.z.string().regex(/^\d+$/).transform(Number);
|
|
11
|
+
const schema = zod_1.z.object({
|
|
12
|
+
raw: zod_1.z.boolean().optional(),
|
|
13
|
+
html: zod_1.z.boolean().optional(),
|
|
17
14
|
extrinsic: zHex
|
|
18
|
-
.or(zod_1.
|
|
15
|
+
.or(zod_1.z.object({
|
|
19
16
|
call: zHex,
|
|
20
17
|
address: zHex,
|
|
21
18
|
}))
|
|
22
19
|
.optional(),
|
|
23
|
-
hrmp: zod_1.
|
|
24
|
-
.record(zParaId, zod_1.
|
|
25
|
-
.array(zod_1.
|
|
26
|
-
sentAt: zod_1.
|
|
20
|
+
hrmp: zod_1.z
|
|
21
|
+
.record(zParaId, zod_1.z
|
|
22
|
+
.array(zod_1.z.object({
|
|
23
|
+
sentAt: zod_1.z.number(),
|
|
27
24
|
data: zHex,
|
|
28
25
|
}))
|
|
29
26
|
.min(1))
|
|
30
27
|
.optional(),
|
|
31
|
-
dmp: zod_1.
|
|
32
|
-
.array(zod_1.
|
|
33
|
-
sentAt: zod_1.
|
|
28
|
+
dmp: zod_1.z
|
|
29
|
+
.array(zod_1.z.object({
|
|
30
|
+
sentAt: zod_1.z.number(),
|
|
34
31
|
msg: zHex,
|
|
35
32
|
}))
|
|
36
33
|
.min(1)
|
|
37
34
|
.optional(),
|
|
38
|
-
ump: zod_1.
|
|
35
|
+
ump: zod_1.z.record(zParaId, zod_1.z.array(zHex).min(1)).optional(),
|
|
39
36
|
at: zHash.optional(),
|
|
40
37
|
});
|
|
41
38
|
// custom rpc name (optional). e.g. dryRun will be called as dev_dryRun
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rpc = void 0;
|
|
4
|
+
const shared_1 = require("../../rpc/shared");
|
|
5
|
+
const logger_1 = require("../../logger");
|
|
6
|
+
const rpc = async (context, [runtimeLogLevel]) => {
|
|
7
|
+
logger_1.defaultLogger.debug({ runtimeLogLevel }, 'dev_setRuntimeLogLevel');
|
|
8
|
+
if (typeof runtimeLogLevel !== 'number') {
|
|
9
|
+
throw new shared_1.ResponseError(1, `Invalid runtimeLogLevel ${runtimeLogLevel}`);
|
|
10
|
+
}
|
|
11
|
+
context.chain.runtimeLogLevel = runtimeLogLevel;
|
|
12
|
+
};
|
|
13
|
+
exports.rpc = rpc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks",
|
|
3
|
-
"version": "0.8.0
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"author": "Bryan Chen <xlchen1291@gmail.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": "./chopsticks.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dev:moonbeam": "cd ../..; ts-node-dev --transpile-only --inspect -r tsconfig-paths/register --notify=false packages/chopsticks/src/cli.ts -- --config=configs/moonbeam.yml"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@acala-network/chopsticks-core": "0.8.0
|
|
19
|
+
"@acala-network/chopsticks-core": "0.8.0",
|
|
20
20
|
"@pnpm/npm-conf": "^2.2.2",
|
|
21
21
|
"@polkadot/api": "^10.9.1",
|
|
22
22
|
"axios": "^1.5.0",
|
|
@@ -57,6 +57,5 @@
|
|
|
57
57
|
"default": "./lib/*.js"
|
|
58
58
|
},
|
|
59
59
|
"./package.json": "./package.json"
|
|
60
|
-
}
|
|
61
|
-
"stableVersion": "0.7.3"
|
|
60
|
+
}
|
|
62
61
|
}
|