@nucypher/taco 0.7.0-alpha.3 → 0.7.0-alpha.4
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/conditions/condition.d.ts +1 -0
- package/dist/cjs/conditions/condition.js +4 -3
- package/dist/cjs/conditions/condition.js.map +1 -1
- package/dist/cjs/conditions/predefined/address-allowlist.d.ts +11 -0
- package/dist/cjs/conditions/predefined/address-allowlist.js +31 -0
- package/dist/cjs/conditions/predefined/address-allowlist.js.map +1 -0
- package/dist/cjs/conditions/predefined/index.d.ts +1 -0
- package/dist/cjs/conditions/predefined/index.js +2 -1
- package/dist/cjs/conditions/predefined/index.js.map +1 -1
- package/dist/cjs/conditions/schemas/address-allowlist.d.ts +3 -0
- package/dist/cjs/conditions/schemas/address-allowlist.js +11 -0
- package/dist/cjs/conditions/schemas/address-allowlist.js.map +1 -0
- package/dist/cjs/conditions/schemas/context-variable.d.ts +46 -0
- package/dist/cjs/conditions/schemas/contract.d.ts +54 -0
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -0
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js +3 -0
- package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
- package/dist/cjs/conditions/schemas/json-api.d.ts +54 -0
- package/dist/cjs/conditions/schemas/json-rpc.d.ts +54 -0
- package/dist/cjs/conditions/schemas/json.d.ts +46 -0
- package/dist/cjs/conditions/schemas/return-value-test.d.ts +76 -0
- package/dist/cjs/conditions/schemas/return-value-test.js +2 -0
- package/dist/cjs/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/cjs/conditions/schemas/rpc.d.ts +46 -0
- package/dist/cjs/conditions/schemas/sequential.js +6 -2
- package/dist/cjs/conditions/schemas/sequential.js.map +1 -1
- package/dist/cjs/conditions/schemas/time.d.ts +46 -0
- package/dist/cjs/conditions/schemas/utils.js +0 -2
- package/dist/cjs/conditions/schemas/utils.js.map +1 -1
- package/dist/cjs/conditions/schemas/variable-operation.d.ts +48 -0
- package/dist/cjs/conditions/schemas/variable-operation.js +81 -0
- package/dist/cjs/conditions/schemas/variable-operation.js.map +1 -0
- package/dist/cjs/sign.d.ts +2 -2
- package/dist/cjs/sign.js +73 -38
- package/dist/cjs/sign.js.map +1 -1
- package/dist/cjs/types.d.ts +1 -1
- package/dist/es/conditions/condition.d.ts +1 -0
- package/dist/es/conditions/condition.js +1 -1
- package/dist/es/conditions/condition.js.map +1 -1
- package/dist/es/conditions/predefined/address-allowlist.d.ts +11 -0
- package/dist/es/conditions/predefined/address-allowlist.js +27 -0
- package/dist/es/conditions/predefined/address-allowlist.js.map +1 -0
- package/dist/es/conditions/predefined/index.d.ts +1 -0
- package/dist/es/conditions/predefined/index.js +1 -0
- package/dist/es/conditions/predefined/index.js.map +1 -1
- package/dist/es/conditions/schemas/address-allowlist.d.ts +3 -0
- package/dist/es/conditions/schemas/address-allowlist.js +8 -0
- package/dist/es/conditions/schemas/address-allowlist.js.map +1 -0
- package/dist/es/conditions/schemas/context-variable.d.ts +46 -0
- package/dist/es/conditions/schemas/contract.d.ts +54 -0
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -0
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.js +3 -0
- package/dist/es/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
- package/dist/es/conditions/schemas/json-api.d.ts +54 -0
- package/dist/es/conditions/schemas/json-rpc.d.ts +54 -0
- package/dist/es/conditions/schemas/json.d.ts +46 -0
- package/dist/es/conditions/schemas/return-value-test.d.ts +76 -0
- package/dist/es/conditions/schemas/return-value-test.js +2 -0
- package/dist/es/conditions/schemas/return-value-test.js.map +1 -1
- package/dist/es/conditions/schemas/rpc.d.ts +46 -0
- package/dist/es/conditions/schemas/sequential.js +6 -2
- package/dist/es/conditions/schemas/sequential.js.map +1 -1
- package/dist/es/conditions/schemas/time.d.ts +46 -0
- package/dist/es/conditions/schemas/utils.js +0 -2
- package/dist/es/conditions/schemas/utils.js.map +1 -1
- package/dist/es/conditions/schemas/variable-operation.d.ts +48 -0
- package/dist/es/conditions/schemas/variable-operation.js +78 -0
- package/dist/es/conditions/schemas/variable-operation.js.map +1 -0
- package/dist/es/sign.d.ts +2 -2
- package/dist/es/sign.js +74 -39
- package/dist/es/sign.js.map +1 -1
- package/dist/es/types.d.ts +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.es.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -10,24 +10,62 @@ export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
10
10
|
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
11
11
|
index: z.ZodOptional<z.ZodNumber>;
|
|
12
12
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
13
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
14
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
15
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
18
|
+
value?: any;
|
|
19
|
+
}, {
|
|
20
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
21
|
+
value?: any;
|
|
22
|
+
}>, {
|
|
23
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
24
|
+
value?: any;
|
|
25
|
+
}, {
|
|
26
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
27
|
+
value?: any;
|
|
28
|
+
}>, {
|
|
29
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
30
|
+
value?: any;
|
|
31
|
+
}, {
|
|
32
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
33
|
+
value?: any;
|
|
34
|
+
}>, "many">>;
|
|
13
35
|
} & {
|
|
14
36
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
15
37
|
}, "strip", z.ZodTypeAny, {
|
|
16
38
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
17
39
|
value?: any;
|
|
18
40
|
index?: number | undefined;
|
|
41
|
+
operations?: {
|
|
42
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
43
|
+
value?: any;
|
|
44
|
+
}[] | undefined;
|
|
19
45
|
}, {
|
|
20
46
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
21
47
|
value?: any;
|
|
22
48
|
index?: number | undefined;
|
|
49
|
+
operations?: {
|
|
50
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
51
|
+
value?: any;
|
|
52
|
+
}[] | undefined;
|
|
23
53
|
}>, {
|
|
24
54
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
25
55
|
value?: any;
|
|
26
56
|
index?: number | undefined;
|
|
57
|
+
operations?: {
|
|
58
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
59
|
+
value?: any;
|
|
60
|
+
}[] | undefined;
|
|
27
61
|
}, {
|
|
28
62
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
29
63
|
value?: any;
|
|
30
64
|
index?: number | undefined;
|
|
65
|
+
operations?: {
|
|
66
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
67
|
+
value?: any;
|
|
68
|
+
}[] | undefined;
|
|
31
69
|
}>;
|
|
32
70
|
}, "strip", z.ZodTypeAny, {
|
|
33
71
|
conditionType: "json-api";
|
|
@@ -35,6 +73,10 @@ export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
35
73
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
36
74
|
value?: any;
|
|
37
75
|
index?: number | undefined;
|
|
76
|
+
operations?: {
|
|
77
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
78
|
+
value?: any;
|
|
79
|
+
}[] | undefined;
|
|
38
80
|
};
|
|
39
81
|
endpoint: string;
|
|
40
82
|
parameters?: Record<string, unknown> | undefined;
|
|
@@ -46,6 +88,10 @@ export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
46
88
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
47
89
|
value?: any;
|
|
48
90
|
index?: number | undefined;
|
|
91
|
+
operations?: {
|
|
92
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
93
|
+
value?: any;
|
|
94
|
+
}[] | undefined;
|
|
49
95
|
};
|
|
50
96
|
endpoint: string;
|
|
51
97
|
conditionType?: "json-api" | undefined;
|
|
@@ -59,6 +105,10 @@ export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
59
105
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
60
106
|
value?: any;
|
|
61
107
|
index?: number | undefined;
|
|
108
|
+
operations?: {
|
|
109
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
110
|
+
value?: any;
|
|
111
|
+
}[] | undefined;
|
|
62
112
|
};
|
|
63
113
|
endpoint: string;
|
|
64
114
|
parameters?: Record<string, unknown> | undefined;
|
|
@@ -70,6 +120,10 @@ export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
70
120
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
71
121
|
value?: any;
|
|
72
122
|
index?: number | undefined;
|
|
123
|
+
operations?: {
|
|
124
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
125
|
+
value?: any;
|
|
126
|
+
}[] | undefined;
|
|
73
127
|
};
|
|
74
128
|
endpoint: string;
|
|
75
129
|
conditionType?: "json-api" | undefined;
|
|
@@ -11,24 +11,62 @@ export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
11
11
|
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
12
12
|
index: z.ZodOptional<z.ZodNumber>;
|
|
13
13
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
14
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
15
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
16
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
19
|
+
value?: any;
|
|
20
|
+
}, {
|
|
21
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
22
|
+
value?: any;
|
|
23
|
+
}>, {
|
|
24
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
25
|
+
value?: any;
|
|
26
|
+
}, {
|
|
27
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
28
|
+
value?: any;
|
|
29
|
+
}>, {
|
|
30
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
31
|
+
value?: any;
|
|
32
|
+
}, {
|
|
33
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
34
|
+
value?: any;
|
|
35
|
+
}>, "many">>;
|
|
14
36
|
} & {
|
|
15
37
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
16
38
|
}, "strip", z.ZodTypeAny, {
|
|
17
39
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
18
40
|
value?: any;
|
|
19
41
|
index?: number | undefined;
|
|
42
|
+
operations?: {
|
|
43
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
44
|
+
value?: any;
|
|
45
|
+
}[] | undefined;
|
|
20
46
|
}, {
|
|
21
47
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
22
48
|
value?: any;
|
|
23
49
|
index?: number | undefined;
|
|
50
|
+
operations?: {
|
|
51
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
52
|
+
value?: any;
|
|
53
|
+
}[] | undefined;
|
|
24
54
|
}>, {
|
|
25
55
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
26
56
|
value?: any;
|
|
27
57
|
index?: number | undefined;
|
|
58
|
+
operations?: {
|
|
59
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
60
|
+
value?: any;
|
|
61
|
+
}[] | undefined;
|
|
28
62
|
}, {
|
|
29
63
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
30
64
|
value?: any;
|
|
31
65
|
index?: number | undefined;
|
|
66
|
+
operations?: {
|
|
67
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
68
|
+
value?: any;
|
|
69
|
+
}[] | undefined;
|
|
32
70
|
}>;
|
|
33
71
|
}, "strip", z.ZodTypeAny, {
|
|
34
72
|
conditionType: "json-rpc";
|
|
@@ -36,6 +74,10 @@ export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
36
74
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
37
75
|
value?: any;
|
|
38
76
|
index?: number | undefined;
|
|
77
|
+
operations?: {
|
|
78
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
79
|
+
value?: any;
|
|
80
|
+
}[] | undefined;
|
|
39
81
|
};
|
|
40
82
|
method: string;
|
|
41
83
|
endpoint: string;
|
|
@@ -48,6 +90,10 @@ export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
48
90
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
49
91
|
value?: any;
|
|
50
92
|
index?: number | undefined;
|
|
93
|
+
operations?: {
|
|
94
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
95
|
+
value?: any;
|
|
96
|
+
}[] | undefined;
|
|
51
97
|
};
|
|
52
98
|
method: string;
|
|
53
99
|
endpoint: string;
|
|
@@ -62,6 +108,10 @@ export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
62
108
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
63
109
|
value?: any;
|
|
64
110
|
index?: number | undefined;
|
|
111
|
+
operations?: {
|
|
112
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
113
|
+
value?: any;
|
|
114
|
+
}[] | undefined;
|
|
65
115
|
};
|
|
66
116
|
method: string;
|
|
67
117
|
endpoint: string;
|
|
@@ -74,6 +124,10 @@ export declare const jsonRpcConditionSchema: z.ZodEffects<z.ZodObject<{} & {
|
|
|
74
124
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
75
125
|
value?: any;
|
|
76
126
|
index?: number | undefined;
|
|
127
|
+
operations?: {
|
|
128
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
129
|
+
value?: any;
|
|
130
|
+
}[] | undefined;
|
|
77
131
|
};
|
|
78
132
|
method: string;
|
|
79
133
|
endpoint: string;
|
|
@@ -7,24 +7,62 @@ export declare const jsonConditionSchema: z.ZodObject<{} & {
|
|
|
7
7
|
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
8
8
|
index: z.ZodOptional<z.ZodNumber>;
|
|
9
9
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
10
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
11
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
12
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
15
|
+
value?: any;
|
|
16
|
+
}, {
|
|
17
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
18
|
+
value?: any;
|
|
19
|
+
}>, {
|
|
20
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
21
|
+
value?: any;
|
|
22
|
+
}, {
|
|
23
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
24
|
+
value?: any;
|
|
25
|
+
}>, {
|
|
26
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
27
|
+
value?: any;
|
|
28
|
+
}, {
|
|
29
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
30
|
+
value?: any;
|
|
31
|
+
}>, "many">>;
|
|
10
32
|
} & {
|
|
11
33
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
12
34
|
}, "strip", z.ZodTypeAny, {
|
|
13
35
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
14
36
|
value?: any;
|
|
15
37
|
index?: number | undefined;
|
|
38
|
+
operations?: {
|
|
39
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
40
|
+
value?: any;
|
|
41
|
+
}[] | undefined;
|
|
16
42
|
}, {
|
|
17
43
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
18
44
|
value?: any;
|
|
19
45
|
index?: number | undefined;
|
|
46
|
+
operations?: {
|
|
47
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
48
|
+
value?: any;
|
|
49
|
+
}[] | undefined;
|
|
20
50
|
}>, {
|
|
21
51
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
22
52
|
value?: any;
|
|
23
53
|
index?: number | undefined;
|
|
54
|
+
operations?: {
|
|
55
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
56
|
+
value?: any;
|
|
57
|
+
}[] | undefined;
|
|
24
58
|
}, {
|
|
25
59
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
26
60
|
value?: any;
|
|
27
61
|
index?: number | undefined;
|
|
62
|
+
operations?: {
|
|
63
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
64
|
+
value?: any;
|
|
65
|
+
}[] | undefined;
|
|
28
66
|
}>;
|
|
29
67
|
}, "strip", z.ZodTypeAny, {
|
|
30
68
|
conditionType: "json";
|
|
@@ -33,6 +71,10 @@ export declare const jsonConditionSchema: z.ZodObject<{} & {
|
|
|
33
71
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
34
72
|
value?: any;
|
|
35
73
|
index?: number | undefined;
|
|
74
|
+
operations?: {
|
|
75
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
76
|
+
value?: any;
|
|
77
|
+
}[] | undefined;
|
|
36
78
|
};
|
|
37
79
|
query?: string | undefined;
|
|
38
80
|
}, {
|
|
@@ -41,6 +83,10 @@ export declare const jsonConditionSchema: z.ZodObject<{} & {
|
|
|
41
83
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
42
84
|
value?: any;
|
|
43
85
|
index?: number | undefined;
|
|
86
|
+
operations?: {
|
|
87
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
88
|
+
value?: any;
|
|
89
|
+
}[] | undefined;
|
|
44
90
|
};
|
|
45
91
|
conditionType?: "json" | undefined;
|
|
46
92
|
query?: string | undefined;
|
|
@@ -2,46 +2,122 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const returnValueTestSchema: z.ZodEffects<z.ZodObject<{
|
|
3
3
|
index: z.ZodOptional<z.ZodNumber>;
|
|
4
4
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
5
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
6
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
7
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
10
|
+
value?: any;
|
|
11
|
+
}, {
|
|
12
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
13
|
+
value?: any;
|
|
14
|
+
}>, {
|
|
15
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
16
|
+
value?: any;
|
|
17
|
+
}, {
|
|
18
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
19
|
+
value?: any;
|
|
20
|
+
}>, {
|
|
21
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
22
|
+
value?: any;
|
|
23
|
+
}, {
|
|
24
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
25
|
+
value?: any;
|
|
26
|
+
}>, "many">>;
|
|
5
27
|
} & {
|
|
6
28
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
7
29
|
}, "strip", z.ZodTypeAny, {
|
|
8
30
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
9
31
|
value?: any;
|
|
10
32
|
index?: number | undefined;
|
|
33
|
+
operations?: {
|
|
34
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
35
|
+
value?: any;
|
|
36
|
+
}[] | undefined;
|
|
11
37
|
}, {
|
|
12
38
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
13
39
|
value?: any;
|
|
14
40
|
index?: number | undefined;
|
|
41
|
+
operations?: {
|
|
42
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
43
|
+
value?: any;
|
|
44
|
+
}[] | undefined;
|
|
15
45
|
}>, {
|
|
16
46
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
17
47
|
value?: any;
|
|
18
48
|
index?: number | undefined;
|
|
49
|
+
operations?: {
|
|
50
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
51
|
+
value?: any;
|
|
52
|
+
}[] | undefined;
|
|
19
53
|
}, {
|
|
20
54
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
21
55
|
value?: any;
|
|
22
56
|
index?: number | undefined;
|
|
57
|
+
operations?: {
|
|
58
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
59
|
+
value?: any;
|
|
60
|
+
}[] | undefined;
|
|
23
61
|
}>;
|
|
24
62
|
export declare const blockchainReturnValueTestSchema: z.ZodEffects<z.ZodObject<{
|
|
25
63
|
index: z.ZodOptional<z.ZodNumber>;
|
|
26
64
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
65
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
66
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
67
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
70
|
+
value?: any;
|
|
71
|
+
}, {
|
|
72
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
73
|
+
value?: any;
|
|
74
|
+
}>, {
|
|
75
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
76
|
+
value?: any;
|
|
77
|
+
}, {
|
|
78
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
79
|
+
value?: any;
|
|
80
|
+
}>, {
|
|
81
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
82
|
+
value?: any;
|
|
83
|
+
}, {
|
|
84
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
85
|
+
value?: any;
|
|
86
|
+
}>, "many">>;
|
|
27
87
|
} & {
|
|
28
88
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
29
89
|
}, "strip", z.ZodTypeAny, {
|
|
30
90
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
31
91
|
value?: any;
|
|
32
92
|
index?: number | undefined;
|
|
93
|
+
operations?: {
|
|
94
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
95
|
+
value?: any;
|
|
96
|
+
}[] | undefined;
|
|
33
97
|
}, {
|
|
34
98
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
35
99
|
value?: any;
|
|
36
100
|
index?: number | undefined;
|
|
101
|
+
operations?: {
|
|
102
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
103
|
+
value?: any;
|
|
104
|
+
}[] | undefined;
|
|
37
105
|
}>, {
|
|
38
106
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
39
107
|
value?: any;
|
|
40
108
|
index?: number | undefined;
|
|
109
|
+
operations?: {
|
|
110
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
111
|
+
value?: any;
|
|
112
|
+
}[] | undefined;
|
|
41
113
|
}, {
|
|
42
114
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
43
115
|
value?: any;
|
|
44
116
|
index?: number | undefined;
|
|
117
|
+
operations?: {
|
|
118
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
119
|
+
value?: any;
|
|
120
|
+
}[] | undefined;
|
|
45
121
|
}>;
|
|
46
122
|
export type ReturnValueTestProps = z.infer<typeof returnValueTestSchema>;
|
|
47
123
|
export type BlockchainReturnValueTestProps = z.infer<typeof blockchainReturnValueTestSchema>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { blockchainParamOrContextParamSchema, paramOrContextParamSchema, } from './context';
|
|
3
|
+
import { variableOperationsArraySchema } from './variable-operation';
|
|
3
4
|
const returnValueTestBaseSchema = z.object({
|
|
4
5
|
index: z.number().int().nonnegative().optional(),
|
|
5
6
|
comparator: z.enum(['==', '>', '<', '>=', '<=', '!=', 'in', '!in']),
|
|
7
|
+
operations: variableOperationsArraySchema.describe('Optional operations to perform on the obtained result before comparison'),
|
|
6
8
|
});
|
|
7
9
|
const requireNonEmptyArrayIfComparatorIsIn = (data) => {
|
|
8
10
|
if (data.comparator === 'in' || data.comparator === '!in') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"return-value-test.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/return-value-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mCAAmC,EACnC,yBAAyB,GAC1B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"return-value-test.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/return-value-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mCAAmC,EACnC,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAChD,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACnE,UAAU,EAAE,6BAA6B,CAAC,QAAQ,CAChD,yEAAyE,CAC1E;CACF,CAAC,CAAC;AAEH,MAAM,oCAAoC,GAAG,CAAC,IAI7C,EAAW,EAAE;IACZ,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;QAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG;IAC9B,OAAO,EAAE,iEAAiE;IAC1E,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB;KAC3D,MAAM,CAAC;IACN,KAAK,EAAE,yBAAyB;CACjC,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC;KACrE,QAAQ,CACP,8FAA8F,CAC/F,CAAC;AAEJ,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAyB;KACrE,MAAM,CAAC;IACN,KAAK,EAAE,mCAAmC;CAC3C,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC,CAAC"}
|
|
@@ -8,24 +8,62 @@ export declare const rpcConditionSchema: z.ZodObject<{} & {
|
|
|
8
8
|
returnValueTest: z.ZodEffects<z.ZodObject<{
|
|
9
9
|
index: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
11
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
12
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
13
|
+
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
16
|
+
value?: any;
|
|
17
|
+
}, {
|
|
18
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
19
|
+
value?: any;
|
|
20
|
+
}>, {
|
|
21
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
22
|
+
value?: any;
|
|
23
|
+
}, {
|
|
24
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
25
|
+
value?: any;
|
|
26
|
+
}>, {
|
|
27
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
28
|
+
value?: any;
|
|
29
|
+
}, {
|
|
30
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
31
|
+
value?: any;
|
|
32
|
+
}>, "many">>;
|
|
11
33
|
} & {
|
|
12
34
|
value: z.ZodType<any, z.ZodTypeDef, any>;
|
|
13
35
|
}, "strip", z.ZodTypeAny, {
|
|
14
36
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
15
37
|
value?: any;
|
|
16
38
|
index?: number | undefined;
|
|
39
|
+
operations?: {
|
|
40
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
41
|
+
value?: any;
|
|
42
|
+
}[] | undefined;
|
|
17
43
|
}, {
|
|
18
44
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
19
45
|
value?: any;
|
|
20
46
|
index?: number | undefined;
|
|
47
|
+
operations?: {
|
|
48
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
49
|
+
value?: any;
|
|
50
|
+
}[] | undefined;
|
|
21
51
|
}>, {
|
|
22
52
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
23
53
|
value?: any;
|
|
24
54
|
index?: number | undefined;
|
|
55
|
+
operations?: {
|
|
56
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
57
|
+
value?: any;
|
|
58
|
+
}[] | undefined;
|
|
25
59
|
}, {
|
|
26
60
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
27
61
|
value?: any;
|
|
28
62
|
index?: number | undefined;
|
|
63
|
+
operations?: {
|
|
64
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
65
|
+
value?: any;
|
|
66
|
+
}[] | undefined;
|
|
29
67
|
}>;
|
|
30
68
|
}, "strip", z.ZodTypeAny, {
|
|
31
69
|
conditionType: "rpc";
|
|
@@ -33,6 +71,10 @@ export declare const rpcConditionSchema: z.ZodObject<{} & {
|
|
|
33
71
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
34
72
|
value?: any;
|
|
35
73
|
index?: number | undefined;
|
|
74
|
+
operations?: {
|
|
75
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
76
|
+
value?: any;
|
|
77
|
+
}[] | undefined;
|
|
36
78
|
};
|
|
37
79
|
chain: number;
|
|
38
80
|
method: "eth_getBalance";
|
|
@@ -42,6 +84,10 @@ export declare const rpcConditionSchema: z.ZodObject<{} & {
|
|
|
42
84
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
43
85
|
value?: any;
|
|
44
86
|
index?: number | undefined;
|
|
87
|
+
operations?: {
|
|
88
|
+
operation: "float" | "index" | "+=" | "-=" | "*=" | "/=" | "%=" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
|
|
89
|
+
value?: any;
|
|
90
|
+
}[] | undefined;
|
|
45
91
|
};
|
|
46
92
|
chain: number;
|
|
47
93
|
method: "eth_getBalance";
|
|
@@ -4,6 +4,7 @@ import { baseConditionSchema, plainStringSchema } from './common';
|
|
|
4
4
|
import { CompoundConditionType } from './compound';
|
|
5
5
|
import { IfThenElseConditionType } from './if-then-else';
|
|
6
6
|
import { anyConditionSchema } from './utils';
|
|
7
|
+
import { variableOperationsArraySchema } from './variable-operation';
|
|
7
8
|
const getAllNestedConditionVariableNames = (condition) => {
|
|
8
9
|
const conditionVariables = [];
|
|
9
10
|
if (condition.conditionType === SequentialConditionType) {
|
|
@@ -32,10 +33,13 @@ const noDuplicateVarNames = (condition) => {
|
|
|
32
33
|
return duplicates.length === 0;
|
|
33
34
|
};
|
|
34
35
|
export const SequentialConditionType = 'sequential';
|
|
35
|
-
export const conditionVariableSchema = z.lazy(() => z
|
|
36
|
+
export const conditionVariableSchema = z.lazy(() => z
|
|
37
|
+
.object({
|
|
36
38
|
varName: plainStringSchema,
|
|
37
39
|
condition: anyConditionSchema,
|
|
38
|
-
|
|
40
|
+
operations: variableOperationsArraySchema.describe('Optional operations to perform on the obtained condition result before storing it'),
|
|
41
|
+
})
|
|
42
|
+
.describe('Executes a condition and stores the result as a variable within a sequential condition.'));
|
|
39
43
|
export const sequentialConditionSchema = baseConditionSchema
|
|
40
44
|
.extend({
|
|
41
45
|
conditionType: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequential.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/sequential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"sequential.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/sequential.ts"],"names":[],"mappings":"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"}
|