@seljs/checker 1.5.0-beta.14 → 1.5.0-beta.64
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/footprint/analyze-footprint.cjs +143 -0
- package/dist/footprint/analyze-footprint.d.cts +16 -0
- package/dist/footprint/analyze-footprint.d.mts +16 -0
- package/dist/footprint/analyze-footprint.mjs +143 -0
- package/dist/footprint/index.cjs +2 -0
- package/dist/footprint/index.d.cts +2 -0
- package/dist/footprint/index.d.mts +2 -0
- package/dist/footprint/index.mjs +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +3 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +11 -11
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
const require_value_wrappers = require("../environment/value-wrappers.cjs");
|
|
2
|
+
const require_hydrate = require("../environment/hydrate.cjs");
|
|
3
|
+
const require_ast_utils = require("../utils/ast-utils.cjs");
|
|
4
|
+
let _seljs_common = require("@seljs/common");
|
|
5
|
+
let viem = require("viem");
|
|
6
|
+
//#region src/footprint/analyze-footprint.ts
|
|
7
|
+
/**
|
|
8
|
+
* Builtins that read chain state, keyed `<receiverType>.<name>`.
|
|
9
|
+
* Mirrors the runtime special case for native balance lookups.
|
|
10
|
+
*/
|
|
11
|
+
const CHAIN_STATE_FUNCTIONS = /* @__PURE__ */ new Set(["sol_address.balance"]);
|
|
12
|
+
const compareStrings = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
13
|
+
const normalizeType = (type) => type.replace(/\s+/g, "");
|
|
14
|
+
const toFootprintMethod = (method) => ({
|
|
15
|
+
name: method.name,
|
|
16
|
+
selector: (0, viem.toFunctionSelector)(method.abi),
|
|
17
|
+
signature: (0, viem.toFunctionSignature)(method.abi),
|
|
18
|
+
abi: method.abi
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Maps a resolved cel-js declaration to the schema method it was registered
|
|
22
|
+
* from. Matches either the primary or the CEL literal overload, taking the
|
|
23
|
+
* first schema method in registration order.
|
|
24
|
+
*/
|
|
25
|
+
const findSchemaMethod = (contract, decl) => {
|
|
26
|
+
const declTypes = decl.argTypes.map((t) => normalizeType(t.name));
|
|
27
|
+
return contract.methods.find((m) => m.name === decl.name && m.params.length === declTypes.length && (m.params.every((p, i) => normalizeType(p.type) === declTypes[i]) || m.params.every((p, i) => normalizeType(require_value_wrappers.toCelLiteralType(p.type) ?? p.type) === declTypes[i])));
|
|
28
|
+
};
|
|
29
|
+
const typeCheck = (parsed) => {
|
|
30
|
+
let error;
|
|
31
|
+
try {
|
|
32
|
+
const result = parsed.check();
|
|
33
|
+
if (result.valid) return;
|
|
34
|
+
error = result.error;
|
|
35
|
+
} catch (err) {
|
|
36
|
+
error = err;
|
|
37
|
+
}
|
|
38
|
+
const message = error instanceof Error ? error.message : "Type check failed";
|
|
39
|
+
throw new _seljs_common.SELTypeCheckError(message, { cause: error });
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Statically determines every contract method, chain-state builtin, and
|
|
43
|
+
* context variable an expression can reference, including untaken ternary
|
|
44
|
+
* branches and comprehension bodies.
|
|
45
|
+
*
|
|
46
|
+
* @param expression SEL expression to analyze.
|
|
47
|
+
* @param schema Schema the expression is checked against.
|
|
48
|
+
* @throws {SELParseError} If the expression cannot be parsed.
|
|
49
|
+
* @throws {SELTypeCheckError} If the expression does not type-check, or a
|
|
50
|
+
* contract call cannot be attributed statically.
|
|
51
|
+
*/
|
|
52
|
+
const analyzeFootprint = (expression, schema) => {
|
|
53
|
+
const env = require_hydrate.createCheckerEnvironment(schema);
|
|
54
|
+
let parsed;
|
|
55
|
+
try {
|
|
56
|
+
parsed = env.parse(expression);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
59
|
+
throw new _seljs_common.SELParseError(message, { cause: error });
|
|
60
|
+
}
|
|
61
|
+
typeCheck(parsed);
|
|
62
|
+
const contractsByType = new Map(schema.contracts.map((c) => [(0, _seljs_common.contractTypeName)(c.name), c]));
|
|
63
|
+
const variableNames = new Set(schema.variables.map((v) => v.name));
|
|
64
|
+
const methods = /* @__PURE__ */ new Map();
|
|
65
|
+
const builtins = /* @__PURE__ */ new Set();
|
|
66
|
+
const variables = /* @__PURE__ */ new Set();
|
|
67
|
+
const record = (contract, method) => {
|
|
68
|
+
const entry = toFootprintMethod(method);
|
|
69
|
+
let byContract = methods.get(contract);
|
|
70
|
+
if (!byContract) {
|
|
71
|
+
byContract = /* @__PURE__ */ new Map();
|
|
72
|
+
methods.set(contract, byContract);
|
|
73
|
+
}
|
|
74
|
+
byContract.set(entry.selector, entry);
|
|
75
|
+
};
|
|
76
|
+
const recordContractCall = (contract, node, receiverType) => {
|
|
77
|
+
const [name] = node.args;
|
|
78
|
+
const argTypes = node.argTypes ?? [];
|
|
79
|
+
if (argTypes.some((t) => t.hasDynType)) {
|
|
80
|
+
for (const m of contract.methods) if (m.name === name && m.params.length === argTypes.length) record(contract, m);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const decl = node.candidates?.findFunction(argTypes, receiverType);
|
|
84
|
+
const method = decl ? findSchemaMethod(contract, decl) : void 0;
|
|
85
|
+
if (!method) throw new _seljs_common.SELTypeCheckError(`Cannot resolve contract method '${contract.name}.${name}'`);
|
|
86
|
+
record(contract, method);
|
|
87
|
+
};
|
|
88
|
+
const visit = (node, bound) => {
|
|
89
|
+
if (node.op === "id") {
|
|
90
|
+
if (variableNames.has(node.args) && !bound.has(node.args)) variables.add(node.args);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (node.op !== "rcall") {
|
|
94
|
+
for (const child of require_ast_utils.collectChildren(node)) visit(child, bound);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const [name, receiver, args] = node.args;
|
|
98
|
+
const checked = node;
|
|
99
|
+
if (!checked.candidates) {
|
|
100
|
+
visitMacro(checked, bound);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const receiverType = receiver.checkedType;
|
|
104
|
+
if (!receiverType) throw new _seljs_common.SELTypeCheckError(`Receiver of '${name}' was not type-checked`);
|
|
105
|
+
const contract = contractsByType.get(receiverType.unwrappedType.name);
|
|
106
|
+
if (contract) recordContractCall(contract, checked, receiverType.unwrappedType);
|
|
107
|
+
else if (receiverType.unwrappedType.kind === "dyn") for (const decl of checked.candidates.declarations) {
|
|
108
|
+
const receiverName = decl.receiverType?.name ?? "";
|
|
109
|
+
if (contractsByType.has(receiverName)) throw new _seljs_common.SELTypeCheckError(`Cannot statically attribute '${name}' on a dyn receiver to a contract`);
|
|
110
|
+
if (CHAIN_STATE_FUNCTIONS.has(`${receiverName}.${decl.name}`)) builtins.add(`${receiverName}.${decl.name}`);
|
|
111
|
+
}
|
|
112
|
+
else if (CHAIN_STATE_FUNCTIONS.has(`${receiverType.unwrappedType.name}.${name}`)) builtins.add(`${receiverType.unwrappedType.name}.${name}`);
|
|
113
|
+
visit(receiver, bound);
|
|
114
|
+
for (const arg of args) visit(arg, bound);
|
|
115
|
+
};
|
|
116
|
+
const visitMacro = (node, bound) => {
|
|
117
|
+
const [name, receiver, args] = node.args;
|
|
118
|
+
const [binder, ...rest] = args;
|
|
119
|
+
const isBind = name === "bind" && receiver.op === "id" && receiver.args === "cel";
|
|
120
|
+
if (binder?.op !== "id" || !(args.length === 2 || args.length === 3 && (isBind || name === "map"))) throw new _seljs_common.SELTypeCheckError(`Unexpected macro shape for '${name}'`);
|
|
121
|
+
const inner = new Set(bound).add(binder.args);
|
|
122
|
+
if (isBind) {
|
|
123
|
+
const [value, body] = rest;
|
|
124
|
+
visit(value, bound);
|
|
125
|
+
visit(body, inner);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
visit(receiver, bound);
|
|
129
|
+
for (const arg of rest) visit(arg, inner);
|
|
130
|
+
};
|
|
131
|
+
visit(parsed.ast, /* @__PURE__ */ new Set());
|
|
132
|
+
return {
|
|
133
|
+
contracts: [...methods.entries()].map(([contract, byContract]) => ({
|
|
134
|
+
name: contract.name,
|
|
135
|
+
address: contract.address,
|
|
136
|
+
methods: [...byContract.values()].sort((a, b) => compareStrings(a.signature, b.signature))
|
|
137
|
+
})).sort((a, b) => compareStrings(a.name, b.name)),
|
|
138
|
+
builtins: [...builtins].sort(compareStrings),
|
|
139
|
+
variables: [...variables].sort(compareStrings)
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
exports.analyzeFootprint = analyzeFootprint;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FootprintResult, SELSchema } from "@seljs/schema";
|
|
2
|
+
//#region src/footprint/analyze-footprint.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Statically determines every contract method, chain-state builtin, and
|
|
5
|
+
* context variable an expression can reference, including untaken ternary
|
|
6
|
+
* branches and comprehension bodies.
|
|
7
|
+
*
|
|
8
|
+
* @param expression SEL expression to analyze.
|
|
9
|
+
* @param schema Schema the expression is checked against.
|
|
10
|
+
* @throws {SELParseError} If the expression cannot be parsed.
|
|
11
|
+
* @throws {SELTypeCheckError} If the expression does not type-check, or a
|
|
12
|
+
* contract call cannot be attributed statically.
|
|
13
|
+
*/
|
|
14
|
+
declare const analyzeFootprint: (expression: string, schema: SELSchema) => FootprintResult;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { analyzeFootprint };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FootprintResult, SELSchema } from "@seljs/schema";
|
|
2
|
+
//#region src/footprint/analyze-footprint.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Statically determines every contract method, chain-state builtin, and
|
|
5
|
+
* context variable an expression can reference, including untaken ternary
|
|
6
|
+
* branches and comprehension bodies.
|
|
7
|
+
*
|
|
8
|
+
* @param expression SEL expression to analyze.
|
|
9
|
+
* @param schema Schema the expression is checked against.
|
|
10
|
+
* @throws {SELParseError} If the expression cannot be parsed.
|
|
11
|
+
* @throws {SELTypeCheckError} If the expression does not type-check, or a
|
|
12
|
+
* contract call cannot be attributed statically.
|
|
13
|
+
*/
|
|
14
|
+
declare const analyzeFootprint: (expression: string, schema: SELSchema) => FootprintResult;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { analyzeFootprint };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { toCelLiteralType } from "../environment/value-wrappers.mjs";
|
|
2
|
+
import { createCheckerEnvironment } from "../environment/hydrate.mjs";
|
|
3
|
+
import { collectChildren } from "../utils/ast-utils.mjs";
|
|
4
|
+
import { SELParseError, SELTypeCheckError, contractTypeName } from "@seljs/common";
|
|
5
|
+
import { toFunctionSelector, toFunctionSignature } from "viem";
|
|
6
|
+
//#region src/footprint/analyze-footprint.ts
|
|
7
|
+
/**
|
|
8
|
+
* Builtins that read chain state, keyed `<receiverType>.<name>`.
|
|
9
|
+
* Mirrors the runtime special case for native balance lookups.
|
|
10
|
+
*/
|
|
11
|
+
const CHAIN_STATE_FUNCTIONS = /* @__PURE__ */ new Set(["sol_address.balance"]);
|
|
12
|
+
const compareStrings = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
13
|
+
const normalizeType = (type) => type.replace(/\s+/g, "");
|
|
14
|
+
const toFootprintMethod = (method) => ({
|
|
15
|
+
name: method.name,
|
|
16
|
+
selector: toFunctionSelector(method.abi),
|
|
17
|
+
signature: toFunctionSignature(method.abi),
|
|
18
|
+
abi: method.abi
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Maps a resolved cel-js declaration to the schema method it was registered
|
|
22
|
+
* from. Matches either the primary or the CEL literal overload, taking the
|
|
23
|
+
* first schema method in registration order.
|
|
24
|
+
*/
|
|
25
|
+
const findSchemaMethod = (contract, decl) => {
|
|
26
|
+
const declTypes = decl.argTypes.map((t) => normalizeType(t.name));
|
|
27
|
+
return contract.methods.find((m) => m.name === decl.name && m.params.length === declTypes.length && (m.params.every((p, i) => normalizeType(p.type) === declTypes[i]) || m.params.every((p, i) => normalizeType(toCelLiteralType(p.type) ?? p.type) === declTypes[i])));
|
|
28
|
+
};
|
|
29
|
+
const typeCheck = (parsed) => {
|
|
30
|
+
let error;
|
|
31
|
+
try {
|
|
32
|
+
const result = parsed.check();
|
|
33
|
+
if (result.valid) return;
|
|
34
|
+
error = result.error;
|
|
35
|
+
} catch (err) {
|
|
36
|
+
error = err;
|
|
37
|
+
}
|
|
38
|
+
const message = error instanceof Error ? error.message : "Type check failed";
|
|
39
|
+
throw new SELTypeCheckError(message, { cause: error });
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Statically determines every contract method, chain-state builtin, and
|
|
43
|
+
* context variable an expression can reference, including untaken ternary
|
|
44
|
+
* branches and comprehension bodies.
|
|
45
|
+
*
|
|
46
|
+
* @param expression SEL expression to analyze.
|
|
47
|
+
* @param schema Schema the expression is checked against.
|
|
48
|
+
* @throws {SELParseError} If the expression cannot be parsed.
|
|
49
|
+
* @throws {SELTypeCheckError} If the expression does not type-check, or a
|
|
50
|
+
* contract call cannot be attributed statically.
|
|
51
|
+
*/
|
|
52
|
+
const analyzeFootprint = (expression, schema) => {
|
|
53
|
+
const env = createCheckerEnvironment(schema);
|
|
54
|
+
let parsed;
|
|
55
|
+
try {
|
|
56
|
+
parsed = env.parse(expression);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
59
|
+
throw new SELParseError(message, { cause: error });
|
|
60
|
+
}
|
|
61
|
+
typeCheck(parsed);
|
|
62
|
+
const contractsByType = new Map(schema.contracts.map((c) => [contractTypeName(c.name), c]));
|
|
63
|
+
const variableNames = new Set(schema.variables.map((v) => v.name));
|
|
64
|
+
const methods = /* @__PURE__ */ new Map();
|
|
65
|
+
const builtins = /* @__PURE__ */ new Set();
|
|
66
|
+
const variables = /* @__PURE__ */ new Set();
|
|
67
|
+
const record = (contract, method) => {
|
|
68
|
+
const entry = toFootprintMethod(method);
|
|
69
|
+
let byContract = methods.get(contract);
|
|
70
|
+
if (!byContract) {
|
|
71
|
+
byContract = /* @__PURE__ */ new Map();
|
|
72
|
+
methods.set(contract, byContract);
|
|
73
|
+
}
|
|
74
|
+
byContract.set(entry.selector, entry);
|
|
75
|
+
};
|
|
76
|
+
const recordContractCall = (contract, node, receiverType) => {
|
|
77
|
+
const [name] = node.args;
|
|
78
|
+
const argTypes = node.argTypes ?? [];
|
|
79
|
+
if (argTypes.some((t) => t.hasDynType)) {
|
|
80
|
+
for (const m of contract.methods) if (m.name === name && m.params.length === argTypes.length) record(contract, m);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const decl = node.candidates?.findFunction(argTypes, receiverType);
|
|
84
|
+
const method = decl ? findSchemaMethod(contract, decl) : void 0;
|
|
85
|
+
if (!method) throw new SELTypeCheckError(`Cannot resolve contract method '${contract.name}.${name}'`);
|
|
86
|
+
record(contract, method);
|
|
87
|
+
};
|
|
88
|
+
const visit = (node, bound) => {
|
|
89
|
+
if (node.op === "id") {
|
|
90
|
+
if (variableNames.has(node.args) && !bound.has(node.args)) variables.add(node.args);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (node.op !== "rcall") {
|
|
94
|
+
for (const child of collectChildren(node)) visit(child, bound);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const [name, receiver, args] = node.args;
|
|
98
|
+
const checked = node;
|
|
99
|
+
if (!checked.candidates) {
|
|
100
|
+
visitMacro(checked, bound);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const receiverType = receiver.checkedType;
|
|
104
|
+
if (!receiverType) throw new SELTypeCheckError(`Receiver of '${name}' was not type-checked`);
|
|
105
|
+
const contract = contractsByType.get(receiverType.unwrappedType.name);
|
|
106
|
+
if (contract) recordContractCall(contract, checked, receiverType.unwrappedType);
|
|
107
|
+
else if (receiverType.unwrappedType.kind === "dyn") for (const decl of checked.candidates.declarations) {
|
|
108
|
+
const receiverName = decl.receiverType?.name ?? "";
|
|
109
|
+
if (contractsByType.has(receiverName)) throw new SELTypeCheckError(`Cannot statically attribute '${name}' on a dyn receiver to a contract`);
|
|
110
|
+
if (CHAIN_STATE_FUNCTIONS.has(`${receiverName}.${decl.name}`)) builtins.add(`${receiverName}.${decl.name}`);
|
|
111
|
+
}
|
|
112
|
+
else if (CHAIN_STATE_FUNCTIONS.has(`${receiverType.unwrappedType.name}.${name}`)) builtins.add(`${receiverType.unwrappedType.name}.${name}`);
|
|
113
|
+
visit(receiver, bound);
|
|
114
|
+
for (const arg of args) visit(arg, bound);
|
|
115
|
+
};
|
|
116
|
+
const visitMacro = (node, bound) => {
|
|
117
|
+
const [name, receiver, args] = node.args;
|
|
118
|
+
const [binder, ...rest] = args;
|
|
119
|
+
const isBind = name === "bind" && receiver.op === "id" && receiver.args === "cel";
|
|
120
|
+
if (binder?.op !== "id" || !(args.length === 2 || args.length === 3 && (isBind || name === "map"))) throw new SELTypeCheckError(`Unexpected macro shape for '${name}'`);
|
|
121
|
+
const inner = new Set(bound).add(binder.args);
|
|
122
|
+
if (isBind) {
|
|
123
|
+
const [value, body] = rest;
|
|
124
|
+
visit(value, bound);
|
|
125
|
+
visit(body, inner);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
visit(receiver, bound);
|
|
129
|
+
for (const arg of rest) visit(arg, inner);
|
|
130
|
+
};
|
|
131
|
+
visit(parsed.ast, /* @__PURE__ */ new Set());
|
|
132
|
+
return {
|
|
133
|
+
contracts: [...methods.entries()].map(([contract, byContract]) => ({
|
|
134
|
+
name: contract.name,
|
|
135
|
+
address: contract.address,
|
|
136
|
+
methods: [...byContract.values()].sort((a, b) => compareStrings(a.signature, b.signature))
|
|
137
|
+
})).sort((a, b) => compareStrings(a.name, b.name)),
|
|
138
|
+
builtins: [...builtins].sort(compareStrings),
|
|
139
|
+
variables: [...variables].sort(compareStrings)
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
export { analyzeFootprint };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { analyzeFootprint } from "./analyze-footprint.mjs";
|
package/dist/index.cjs
CHANGED
|
@@ -11,10 +11,13 @@ require("./rules/index.cjs");
|
|
|
11
11
|
const require_checker = require("./checker/checker.cjs");
|
|
12
12
|
require("./checker/index.cjs");
|
|
13
13
|
require("./environment/index.cjs");
|
|
14
|
+
const require_analyze_footprint = require("./footprint/analyze-footprint.cjs");
|
|
15
|
+
require("./footprint/index.cjs");
|
|
14
16
|
exports.COMPREHENSION_MACROS = require_constants.COMPREHENSION_MACROS;
|
|
15
17
|
exports.CelCodecRegistry = require_codec_registry.CelCodecRegistry;
|
|
16
18
|
exports.SCALAR_WRAPPER_FUNCTIONS = require_constants.SCALAR_WRAPPER_FUNCTIONS;
|
|
17
19
|
exports.SELChecker = require_checker.SELChecker;
|
|
20
|
+
exports.analyzeFootprint = require_analyze_footprint.analyzeFootprint;
|
|
18
21
|
exports.createBaseEnvironment = require_hydrate.createBaseEnvironment;
|
|
19
22
|
exports.createCheckerEnvironment = require_hydrate.createCheckerEnvironment;
|
|
20
23
|
exports.createRuntimeEnvironment = require_hydrate.createRuntimeEnvironment;
|
package/dist/index.d.cts
CHANGED
|
@@ -11,4 +11,6 @@ import { CelLimits, ContractCallHandler, RuntimeEnvironmentResult, createBaseEnv
|
|
|
11
11
|
import { registerSolidityTypes } from "./environment/register-types.cjs";
|
|
12
12
|
import { StructInfo, toCelLiteralType, wrapStructValue, wrapValueForSel } from "./environment/value-wrappers.cjs";
|
|
13
13
|
import "./environment/index.cjs";
|
|
14
|
-
|
|
14
|
+
import { analyzeFootprint } from "./footprint/analyze-footprint.cjs";
|
|
15
|
+
import "./footprint/index.cjs";
|
|
16
|
+
export { COMPREHENSION_MACROS, CelCodecRegistry, CelCodecRegistryOptions, CelLimits, CompletionItem, ContractCallHandler, RuleContext, RuleSeverity, RuleTier, RunRulesOptions, RuntimeEnvironmentResult, SCALAR_WRAPPER_FUNCTIONS, SELChecker, SELCheckerOptions, SELDiagnostic, SELRule, StructCodecDescriptor, StructInfo, analyzeFootprint, createBaseEnvironment, createCheckerEnvironment, createRuntimeEnvironment, isTypeCompatible, registerSolidityTypes, rules, runRules, toCelLiteralType, wrapStructValue, wrapValueForSel };
|
package/dist/index.d.mts
CHANGED
|
@@ -11,4 +11,6 @@ import { CelLimits, ContractCallHandler, RuntimeEnvironmentResult, createBaseEnv
|
|
|
11
11
|
import { registerSolidityTypes } from "./environment/register-types.mjs";
|
|
12
12
|
import { StructInfo, toCelLiteralType, wrapStructValue, wrapValueForSel } from "./environment/value-wrappers.mjs";
|
|
13
13
|
import "./environment/index.mjs";
|
|
14
|
-
|
|
14
|
+
import { analyzeFootprint } from "./footprint/analyze-footprint.mjs";
|
|
15
|
+
import "./footprint/index.mjs";
|
|
16
|
+
export { COMPREHENSION_MACROS, CelCodecRegistry, CelCodecRegistryOptions, CelLimits, CompletionItem, ContractCallHandler, RuleContext, RuleSeverity, RuleTier, RunRulesOptions, RuntimeEnvironmentResult, SCALAR_WRAPPER_FUNCTIONS, SELChecker, SELCheckerOptions, SELDiagnostic, SELRule, StructCodecDescriptor, StructInfo, analyzeFootprint, createBaseEnvironment, createCheckerEnvironment, createRuntimeEnvironment, isTypeCompatible, registerSolidityTypes, rules, runRules, toCelLiteralType, wrapStructValue, wrapValueForSel };
|
package/dist/index.mjs
CHANGED
|
@@ -10,4 +10,6 @@ import "./rules/index.mjs";
|
|
|
10
10
|
import { SELChecker } from "./checker/checker.mjs";
|
|
11
11
|
import "./checker/index.mjs";
|
|
12
12
|
import "./environment/index.mjs";
|
|
13
|
-
|
|
13
|
+
import { analyzeFootprint } from "./footprint/analyze-footprint.mjs";
|
|
14
|
+
import "./footprint/index.mjs";
|
|
15
|
+
export { COMPREHENSION_MACROS, CelCodecRegistry, SCALAR_WRAPPER_FUNCTIONS, SELChecker, analyzeFootprint, createBaseEnvironment, createCheckerEnvironment, createRuntimeEnvironment, isTypeCompatible, registerSolidityTypes, rules, runRules, toCelLiteralType, wrapStructValue, wrapValueForSel };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seljs/checker",
|
|
3
|
-
"version": "1.5.0-beta.
|
|
3
|
+
"version": "1.5.0-beta.64",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/abinnovision/seljs"
|
|
6
6
|
},
|
|
@@ -49,24 +49,24 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@marcbachmann/cel-js": "^
|
|
53
|
-
"@seljs/common": "1.5.0-beta.
|
|
54
|
-
"@seljs/schema": "1.
|
|
55
|
-
"@seljs/types": "1.5.0-beta.
|
|
52
|
+
"@marcbachmann/cel-js": "^8.0.0",
|
|
53
|
+
"@seljs/common": "1.5.0-beta.64",
|
|
54
|
+
"@seljs/schema": "1.5.0-beta.64",
|
|
55
|
+
"@seljs/types": "1.5.0-beta.64",
|
|
56
56
|
"debug": "^4.4.3",
|
|
57
|
-
"viem": "^2.
|
|
57
|
+
"viem": "^2.57.16"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@abinnovision/eslint-config-base": "^3.
|
|
60
|
+
"@abinnovision/eslint-config-base": "^3.4.2",
|
|
61
61
|
"@abinnovision/prettier-config": "^2.2.0",
|
|
62
62
|
"@seljs-internal/tsconfig": "^0.0.0",
|
|
63
63
|
"@types/debug": "^4.1.13",
|
|
64
|
-
"eslint": "^9.
|
|
64
|
+
"eslint": "^10.9.1",
|
|
65
65
|
"prettier": "^3.9.6",
|
|
66
66
|
"tsdown": "^0.22.14",
|
|
67
67
|
"typescript": "^6.0.3",
|
|
68
|
-
"vitest": "^4.1.
|
|
69
|
-
"zod": "^4.
|
|
68
|
+
"vitest": "^4.1.11",
|
|
69
|
+
"zod": "^4.6.6"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"zod": "^4.0.0"
|
|
@@ -75,4 +75,4 @@
|
|
|
75
75
|
"npm": true,
|
|
76
76
|
"npmAccess": "public"
|
|
77
77
|
}
|
|
78
|
-
}
|
|
78
|
+
}
|