@nucypher/taco 0.7.0-alpha.6 → 0.7.0-alpha.8
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/context/context.js +25 -2
- package/dist/cjs/conditions/context/context.js.map +1 -1
- package/dist/cjs/conditions/schemas/context-variable.d.ts +15 -15
- package/dist/cjs/conditions/schemas/contract.d.ts +31 -31
- package/dist/cjs/conditions/schemas/json-api.d.ts +15 -15
- package/dist/cjs/conditions/schemas/json-rpc.d.ts +19 -19
- package/dist/cjs/conditions/schemas/json.d.ts +14 -14
- package/dist/cjs/conditions/schemas/return-value-test.d.ts +22 -22
- package/dist/cjs/conditions/schemas/rpc.d.ts +17 -17
- package/dist/cjs/conditions/schemas/sequential.d.ts +2 -0
- package/dist/cjs/conditions/schemas/sequential.js +9 -8
- package/dist/cjs/conditions/schemas/sequential.js.map +1 -1
- package/dist/cjs/conditions/schemas/time.d.ts +16 -16
- package/dist/cjs/conditions/schemas/utils.js +2 -0
- package/dist/cjs/conditions/schemas/utils.js.map +1 -1
- package/dist/cjs/conditions/schemas/variable-operation.d.ts +15 -15
- package/dist/cjs/conditions/schemas/variable-operation.js +16 -0
- package/dist/cjs/conditions/schemas/variable-operation.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/sign.js +15 -10
- package/dist/cjs/sign.js.map +1 -1
- package/dist/es/conditions/context/context.js +25 -2
- package/dist/es/conditions/context/context.js.map +1 -1
- package/dist/es/conditions/schemas/context-variable.d.ts +15 -15
- package/dist/es/conditions/schemas/contract.d.ts +31 -31
- package/dist/es/conditions/schemas/json-api.d.ts +15 -15
- package/dist/es/conditions/schemas/json-rpc.d.ts +19 -19
- package/dist/es/conditions/schemas/json.d.ts +14 -14
- package/dist/es/conditions/schemas/return-value-test.d.ts +22 -22
- package/dist/es/conditions/schemas/rpc.d.ts +17 -17
- package/dist/es/conditions/schemas/sequential.d.ts +2 -0
- package/dist/es/conditions/schemas/sequential.js +2 -2
- package/dist/es/conditions/schemas/sequential.js.map +1 -1
- package/dist/es/conditions/schemas/time.d.ts +16 -16
- package/dist/es/conditions/schemas/utils.js +2 -0
- package/dist/es/conditions/schemas/utils.js.map +1 -1
- package/dist/es/conditions/schemas/variable-operation.d.ts +15 -15
- package/dist/es/conditions/schemas/variable-operation.js +16 -0
- package/dist/es/conditions/schemas/variable-operation.js.map +1 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/sign.js +15 -10
- package/dist/es/sign.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.es.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequential.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/sequential.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAGxB,wDAAoD;AAEpD,qCAAkE;AAClE,yCAAmD;AACnD,iDAAyD;AACzD,mCAA6C;AAC7C,6DAAqE;
|
|
1
|
+
{"version":3,"file":"sequential.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/sequential.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAGxB,wDAAoD;AAEpD,qCAAkE;AAClE,yCAAmD;AACnD,iDAAyD;AACzD,mCAA6C;AAC7C,6DAAqE;AAE9D,MAAM,kCAAkC,GAAG,CAChD,SAAyB,EACf,EAAE;IACZ,MAAM,kBAAkB,GAAa,EAAE,CAAC;IACxC,IAAI,SAAS,CAAC,aAAa,KAAK,+BAAuB,EAAE,CAAC;QACxD,KAAK,MAAM,QAAQ,IAAI,SAAS,CAAC,kBAAkB,EAAE,CAAC;YACpD,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC1C,kBAAkB,CAAC,IAAI,CACrB,GAAG,IAAA,0CAAkC,EAAC,QAAQ,CAAC,SAAS,CAA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ACN,OAAO,EAAE,0BAAiB;IAC1B,SAAS,EAAE,0BAAkB;IAC7B,UAAU,EAAE,kDAA6B,CAAC,QAAQ,CAChD,mFAAmF,CACpF;CACF,CAAC;KACD,QAAQ,CACP,yFAAyF,CAC1F,CACJ,CAAC;AAIW,QAAA,yBAAyB,GAAgB,4BAAmB;KACtE,MAAM,CAAC;IACN,aAAa,EAAE,OAAC;SACb,OAAO,CAAC,+BAAuB,CAAC;SAChC,OAAO,CAAC,+BAAuB,CAAC;IACnC,kBAAkB,EAAE,OAAC,CAAC,KAAK,CAAC,+BAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;CACpE,CAAC;KACD,MAAM,CACL,CAAC,SAAS,EAAE,EAAE,CAAC,IAAA,gCAAc,EAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAC3C;IACE,OAAO,EAAE,yDAAyD;IAClE,IAAI,EAAE,CAAC,oBAAoB,CAAC;CAC7B,CACF;KACA,MAAM,CACL,CAAC,SAAS,EAAE,EAAE;IACZ,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,EACD;IACE,OAAO,EAAE,0CAA0C;IACnD,IAAI,EAAE,CAAC,oBAAoB,CAAC;CAC7B,CACF,CAAC"}
|
|
@@ -9,25 +9,25 @@ export declare const timeConditionSchema: z.ZodObject<{
|
|
|
9
9
|
index: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
11
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"]>;
|
|
12
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str", "fromJson", "toJson", "fromHex", "toHex", "keccak"]>;
|
|
13
13
|
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
operation: "float" | "
|
|
15
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
16
16
|
value?: any;
|
|
17
17
|
}, {
|
|
18
|
-
operation: "float" | "
|
|
18
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
19
19
|
value?: any;
|
|
20
20
|
}>, {
|
|
21
|
-
operation: "float" | "
|
|
21
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
22
22
|
value?: any;
|
|
23
23
|
}, {
|
|
24
|
-
operation: "float" | "
|
|
24
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
25
25
|
value?: any;
|
|
26
26
|
}>, {
|
|
27
|
-
operation: "float" | "
|
|
27
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
28
28
|
value?: any;
|
|
29
29
|
}, {
|
|
30
|
-
operation: "float" | "
|
|
30
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
31
31
|
value?: any;
|
|
32
32
|
}>, "many">>;
|
|
33
33
|
} & {
|
|
@@ -37,7 +37,7 @@ export declare const timeConditionSchema: z.ZodObject<{
|
|
|
37
37
|
value?: any;
|
|
38
38
|
index?: number | undefined;
|
|
39
39
|
operations?: {
|
|
40
|
-
operation: "float" | "
|
|
40
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
41
41
|
value?: any;
|
|
42
42
|
}[] | undefined;
|
|
43
43
|
}, {
|
|
@@ -45,7 +45,7 @@ export declare const timeConditionSchema: z.ZodObject<{
|
|
|
45
45
|
value?: any;
|
|
46
46
|
index?: number | undefined;
|
|
47
47
|
operations?: {
|
|
48
|
-
operation: "float" | "
|
|
48
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
49
49
|
value?: any;
|
|
50
50
|
}[] | undefined;
|
|
51
51
|
}>, {
|
|
@@ -53,7 +53,7 @@ export declare const timeConditionSchema: z.ZodObject<{
|
|
|
53
53
|
value?: any;
|
|
54
54
|
index?: number | undefined;
|
|
55
55
|
operations?: {
|
|
56
|
-
operation: "float" | "
|
|
56
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
57
57
|
value?: any;
|
|
58
58
|
}[] | undefined;
|
|
59
59
|
}, {
|
|
@@ -61,34 +61,34 @@ export declare const timeConditionSchema: z.ZodObject<{
|
|
|
61
61
|
value?: any;
|
|
62
62
|
index?: number | undefined;
|
|
63
63
|
operations?: {
|
|
64
|
-
operation: "float" | "
|
|
64
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
65
65
|
value?: any;
|
|
66
66
|
}[] | undefined;
|
|
67
67
|
}>;
|
|
68
68
|
}, "strip", z.ZodTypeAny, {
|
|
69
69
|
conditionType: "time";
|
|
70
|
+
chain: number;
|
|
71
|
+
method: "blocktime";
|
|
70
72
|
returnValueTest: {
|
|
71
73
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
72
74
|
value?: any;
|
|
73
75
|
index?: number | undefined;
|
|
74
76
|
operations?: {
|
|
75
|
-
operation: "float" | "
|
|
77
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
76
78
|
value?: any;
|
|
77
79
|
}[] | undefined;
|
|
78
80
|
};
|
|
79
|
-
chain: number;
|
|
80
|
-
method: "blocktime";
|
|
81
81
|
}, {
|
|
82
|
+
chain: number;
|
|
82
83
|
returnValueTest: {
|
|
83
84
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
84
85
|
value?: any;
|
|
85
86
|
index?: number | undefined;
|
|
86
87
|
operations?: {
|
|
87
|
-
operation: "float" | "
|
|
88
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
88
89
|
value?: any;
|
|
89
90
|
}[] | undefined;
|
|
90
91
|
};
|
|
91
|
-
chain: number;
|
|
92
92
|
conditionType?: "time" | undefined;
|
|
93
93
|
method?: "blocktime" | undefined;
|
|
94
94
|
}>;
|
|
@@ -7,6 +7,7 @@ const context_variable_1 = require("./context-variable");
|
|
|
7
7
|
const contract_1 = require("./contract");
|
|
8
8
|
const ecdsa_1 = require("./ecdsa");
|
|
9
9
|
const if_then_else_1 = require("./if-then-else");
|
|
10
|
+
const json_1 = require("./json");
|
|
10
11
|
const json_api_1 = require("./json-api");
|
|
11
12
|
const json_rpc_1 = require("./json-rpc");
|
|
12
13
|
const jwt_1 = require("./jwt");
|
|
@@ -20,6 +21,7 @@ exports.anyConditionSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
|
20
21
|
context_variable_1.contextVariableConditionSchema,
|
|
21
22
|
contract_1.contractConditionSchema,
|
|
22
23
|
ecdsa_1.ecdsaConditionSchema,
|
|
24
|
+
json_1.jsonConditionSchema,
|
|
23
25
|
json_api_1.jsonApiConditionSchema,
|
|
24
26
|
json_rpc_1.jsonRpcConditionSchema,
|
|
25
27
|
jwt_1.jwtConditionSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/utils.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,8DAAgE;AAEhE,yDAAoE;AACpE,yCAAqD;AACrD,mCAA+C;AAC/C,iDAA2D;AAC3D,yCAAoD;AACpD,yCAAoD;AACpD,+BAA2C;AAC3C,+BAA2C;AAC3C,6CAAyD;AACzD,uCAGmB;AACnB,iCAA6C;AAEhC,QAAA,kBAAkB,GAAgB,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACzD,OAAC,CAAC,KAAK,CAAC;IACN,wBAAkB;IAClB,0BAAmB;IACnB,iDAA8B;IAC9B,kCAAuB;IACvB,4BAAoB;IACpB,iCAAsB;IACtB,iCAAsB;IACtB,wBAAkB;IAClB,+CAAqC;IACrC,kDAAwC;IACxC,4CAAuB;IACvB,sCAAyB;IACzB,wCAAyB;CAC1B,CAAC,CACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/utils.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,8DAAgE;AAEhE,yDAAoE;AACpE,yCAAqD;AACrD,mCAA+C;AAC/C,iDAA2D;AAC3D,iCAA6C;AAC7C,yCAAoD;AACpD,yCAAoD;AACpD,+BAA2C;AAC3C,+BAA2C;AAC3C,6CAAyD;AACzD,uCAGmB;AACnB,iCAA6C;AAEhC,QAAA,kBAAkB,GAAgB,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACzD,OAAC,CAAC,KAAK,CAAC;IACN,wBAAkB;IAClB,0BAAmB;IACnB,iDAA8B;IAC9B,kCAAuB;IACvB,4BAAoB;IACpB,0BAAmB;IACnB,iCAAsB;IACtB,iCAAsB;IACtB,wBAAkB;IAClB,+CAAqC;IACrC,kDAAwC;IACxC,4CAAuB;IACvB,sCAAyB;IACzB,wCAAyB;CAC1B,CAAC,CACH,CAAC"}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const OPERATOR_FUNCTIONS: readonly ["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"];
|
|
2
|
+
export declare const OPERATOR_FUNCTIONS: readonly ["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str", "fromJson", "toJson", "fromHex", "toHex", "keccak"];
|
|
3
3
|
export declare const UNARY_OPERATOR_FUNCTIONS: string[];
|
|
4
4
|
export declare const variableOperationSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
5
|
-
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
5
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str", "fromJson", "toJson", "fromHex", "toHex", "keccak"]>;
|
|
6
6
|
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
operation: "float" | "
|
|
8
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
9
9
|
value?: any;
|
|
10
10
|
}, {
|
|
11
|
-
operation: "float" | "
|
|
11
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
12
12
|
value?: any;
|
|
13
13
|
}>, {
|
|
14
|
-
operation: "float" | "
|
|
14
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
15
15
|
value?: any;
|
|
16
16
|
}, {
|
|
17
|
-
operation: "float" | "
|
|
17
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
18
18
|
value?: any;
|
|
19
19
|
}>, {
|
|
20
|
-
operation: "float" | "
|
|
20
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
21
21
|
value?: any;
|
|
22
22
|
}, {
|
|
23
|
-
operation: "float" | "
|
|
23
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
24
24
|
value?: any;
|
|
25
25
|
}>;
|
|
26
26
|
export declare const MAX_VARIABLE_OPERATIONS = 5;
|
|
27
27
|
export declare const variableOperationsArraySchema: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
28
|
-
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
28
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str", "fromJson", "toJson", "fromHex", "toHex", "keccak"]>;
|
|
29
29
|
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
30
30
|
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
operation: "float" | "
|
|
31
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
32
32
|
value?: any;
|
|
33
33
|
}, {
|
|
34
|
-
operation: "float" | "
|
|
34
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
35
35
|
value?: any;
|
|
36
36
|
}>, {
|
|
37
|
-
operation: "float" | "
|
|
37
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
38
38
|
value?: any;
|
|
39
39
|
}, {
|
|
40
|
-
operation: "float" | "
|
|
40
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
41
41
|
value?: any;
|
|
42
42
|
}>, {
|
|
43
|
-
operation: "float" | "
|
|
43
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
44
44
|
value?: any;
|
|
45
45
|
}, {
|
|
46
|
-
operation: "float" | "
|
|
46
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
47
47
|
value?: any;
|
|
48
48
|
}>, "many">>;
|
|
@@ -27,6 +27,14 @@ exports.OPERATOR_FUNCTIONS = [
|
|
|
27
27
|
'float',
|
|
28
28
|
'int',
|
|
29
29
|
'str',
|
|
30
|
+
// JSON conversion
|
|
31
|
+
'fromJson',
|
|
32
|
+
'toJson',
|
|
33
|
+
// hex conversion
|
|
34
|
+
'fromHex',
|
|
35
|
+
'toHex',
|
|
36
|
+
// hashing
|
|
37
|
+
'keccak',
|
|
30
38
|
];
|
|
31
39
|
exports.UNARY_OPERATOR_FUNCTIONS = [
|
|
32
40
|
'abs',
|
|
@@ -44,6 +52,14 @@ exports.UNARY_OPERATOR_FUNCTIONS = [
|
|
|
44
52
|
'float',
|
|
45
53
|
'int',
|
|
46
54
|
'str',
|
|
55
|
+
// JSON conversion
|
|
56
|
+
'fromJson',
|
|
57
|
+
'toJson',
|
|
58
|
+
// hex conversion
|
|
59
|
+
'fromHex',
|
|
60
|
+
'toHex',
|
|
61
|
+
// hashing
|
|
62
|
+
'keccak',
|
|
47
63
|
];
|
|
48
64
|
exports.variableOperationSchema = zod_1.z
|
|
49
65
|
.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-operation.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/variable-operation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,uCAAsD;AAEzC,QAAA,kBAAkB,GAAG;IAChC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,OAAO;IACP,0CAA0C;IAC1C,KAAK;IACL,KAAK;IACL,MAAM;IACN,UAAU;IACV,OAAO;IACP,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IACL,KAAK;
|
|
1
|
+
{"version":3,"file":"variable-operation.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/variable-operation.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,uCAAsD;AAEzC,QAAA,kBAAkB,GAAG;IAChC,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,OAAO;IACP,0CAA0C;IAC1C,KAAK;IACL,KAAK;IACL,MAAM;IACN,UAAU;IACV,OAAO;IACP,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IACL,KAAK;IACL,kBAAkB;IAClB,UAAU;IACV,QAAQ;IACR,iBAAiB;IACjB,SAAS;IACT,OAAO;IACP,UAAU;IACV,QAAQ;CACA,CAAC;AAEE,QAAA,wBAAwB,GAAG;IACtC,KAAK;IACL,KAAK;IACL,MAAM;IACN,UAAU;IACV,OAAO;IACP,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IACL,KAAK;IACL,kBAAkB;IAClB,UAAU;IACV,QAAQ;IACR,iBAAiB;IACjB,SAAS;IACT,OAAO;IACP,UAAU;IACV,QAAQ;CACT,CAAC;AAEW,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,CAAC;IACN,SAAS,EAAE,OAAC,CAAC,IAAI,CAAC,0BAAkB,CAAC;IACrC,KAAK,EAAE,mCAAyB,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,IACE,gCAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QACjD,IAAI,CAAC,KAAK,KAAK,SAAS,EACxB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EAAE,sCAAsC;IAC/C,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CACF;KACA,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,IACE,CAAC,gCAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QAClD,IAAI,CAAC,KAAK,KAAK,SAAS,EACxB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EAAE,qCAAqC;IAC9C,IAAI,EAAE,CAAC,OAAO,CAAC;CAChB,CACF;KACA,QAAQ,CAAC,2DAA2D,CAAC,CAAC;AAE5D,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAE5B,QAAA,6BAA6B,GAAG,OAAC;KAC3C,KAAK,CAAC,+BAAuB,CAAC;KAC9B,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,+BAAuB,CAAC;KAC5B,QAAQ,EAAE;KACV,QAAQ,CAAC,uDAAuD,CAAC,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DkgPublicKey, ThresholdMessageKit } from '@nucypher/nucypher-core';
|
|
2
|
-
export { Domain, domains, fromBytes, getPorterUris, initialize, toBytes, toHexString, } from '@nucypher/shared';
|
|
2
|
+
export { Domain, PackedUserOperationToSign, UserOperationToSign, domains, fromBytes, getPorterUris, initialize, toBytes, toHexString, } from '@nucypher/shared';
|
|
3
3
|
export * as conditions from './conditions';
|
|
4
4
|
export { SignResult, TacoSignature, setSigningCohortConditions, signUserOp, } from './sign';
|
|
5
5
|
export { decrypt, encrypt, encryptWithPublicKey } from './taco';
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA4E;AAAnE,6GAAA,YAAY,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AAC1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA4E;AAAnE,6GAAA,YAAY,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AAC1C,2CAU0B;AANxB,iGAAA,OAAO,OAAA;AACP,mGAAA,SAAS,OAAA;AACT,uGAAA,aAAa,OAAA;AACb,oGAAA,UAAU,OAAA;AACV,iGAAA,OAAO,OAAA;AACP,qGAAA,WAAW,OAAA;AAGb,2DAA2C;AAE3C,+BAKgB;AAFd,kHAAA,0BAA0B,OAAA;AAC1B,kGAAA,UAAU,OAAA;AAEZ,+BAAgE;AAAvD,+FAAA,OAAO,OAAA;AAAE,+FAAA,OAAO,OAAA;AAAE,4GAAA,oBAAoB,OAAA"}
|
package/dist/cjs/sign.js
CHANGED
|
@@ -8,16 +8,21 @@ const ethers_1 = require("ethers");
|
|
|
8
8
|
const condition_expr_1 = require("./conditions/condition-expr");
|
|
9
9
|
const ERR_INSUFFICIENT_SIGNATURES = (errors) => `Threshold of signatures not met; TACo signing failed with errors: ${JSON.stringify(errors)}`;
|
|
10
10
|
const ERR_MISMATCHED_HASHES = (hashToSignatures) => `Threshold of signatures not met; multiple mismatched hashes found: ${JSON.stringify(Object.fromEntries(hashToSignatures.entries()))}`;
|
|
11
|
-
function aggregateSignatures(
|
|
12
|
-
// Aggregate hex signatures by concatenating them; being careful to
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
function aggregateSignatures(signatures, threshold) {
|
|
12
|
+
// Aggregate hex signatures by concatenating them; being careful to sort
|
|
13
|
+
// and remove the '0x' prefix from each signature except the first one.
|
|
14
|
+
// sort by signer address
|
|
15
|
+
const sortedSignatures = [...signatures]
|
|
16
|
+
.sort((a, b) => a.signerAddress
|
|
17
|
+
.toLowerCase()
|
|
18
|
+
.localeCompare(b.signerAddress.toLowerCase()))
|
|
19
|
+
.map((sig) => sig.signature);
|
|
20
|
+
const thresholdSignatures = sortedSignatures.slice(0, threshold);
|
|
21
|
+
if (thresholdSignatures.length === 1) {
|
|
22
|
+
return thresholdSignatures[0];
|
|
18
23
|
}
|
|
19
24
|
// Concatenate signatures
|
|
20
|
-
const allBytes =
|
|
25
|
+
const allBytes = thresholdSignatures.flatMap((sig) => Array.from((0, shared_1.fromHexString)(sig)));
|
|
21
26
|
return `0x${(0, shared_1.toHexString)(new Uint8Array(allBytes))}`;
|
|
22
27
|
}
|
|
23
28
|
async function makeSigningRequests(cohortId, chainId, signers, userOp, aaVersion, conditionContext) {
|
|
@@ -72,7 +77,7 @@ async function signUserOp(provider, domain, cohortId, chainId, userOp, aaVersion
|
|
|
72
77
|
throw new Error(ERR_INSUFFICIENT_SIGNATURES(errors));
|
|
73
78
|
}
|
|
74
79
|
const signaturesToAggregate = collectSignatures(encryptedResponses, sharedSecrets, threshold);
|
|
75
|
-
const aggregatedSignature = aggregateSignatures(signaturesToAggregate, threshold);
|
|
80
|
+
const aggregatedSignature = aggregateSignatures(Object.values(signaturesToAggregate), threshold);
|
|
76
81
|
return {
|
|
77
82
|
messageHash: Object.values(signaturesToAggregate)[0].messageHash,
|
|
78
83
|
aggregatedSignature,
|
|
@@ -124,7 +129,7 @@ function collectSignatures(encryptedResponses, sharedSecrets, threshold) {
|
|
|
124
129
|
}
|
|
125
130
|
// Insufficient signatures for a message hash to meet the threshold
|
|
126
131
|
if (!signaturesToAggregate) {
|
|
127
|
-
//we have multiple hashes, which means we have mismatched hashes from different nodes
|
|
132
|
+
// we have multiple hashes, which means we have mismatched hashes from different nodes
|
|
128
133
|
// we don't really expect this to happen (other than some malicious nodes)
|
|
129
134
|
console.error('Porter returned mismatched message hashes:', hashToSignatures);
|
|
130
135
|
throw new Error(ERR_MISMATCHED_HASHES(hashToSignatures));
|
package/dist/cjs/sign.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign.js","sourceRoot":"","sources":["../../src/sign.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"sign.js","sourceRoot":"","sources":["../../src/sign.ts"],"names":[],"mappings":";;AA4JA,gCA8DC;AAED,gEAsBC;AAlPD,2DAQiC;AACjC,6CAa0B;AAC1B,mCAAgC;AAGhC,gEAAkE;AAGlE,MAAM,2BAA2B,GAAG,CAAC,MAAe,EAAE,EAAE,CACtD,qEAAqE,IAAI,CAAC,SAAS,CACjF,MAAM,CACP,EAAE,CAAC;AACN,MAAM,qBAAqB,GAAG,CAC5B,gBAAyE,EACzE,EAAE,CACF,sEAAsE,IAAI,CAAC,SAAS,CAClF,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAC/C,EAAE,CAAC;AAcN,SAAS,mBAAmB,CAC1B,UAA2B,EAC3B,SAAiB;IAEjB,wEAAwE;IACxE,wEAAwE;IAExE,yBAAyB;IACzB,MAAM,gBAAgB,GAAG,CAAC,GAAG,UAAU,CAAC;SACrC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,aAAa;SACZ,WAAW,EAAE;SACb,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAChD;SACA,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAE/B,MAAM,mBAAm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,CAAC;QACD,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IACzD,CAAC;IAED,uCAAuC;IACvC,IAAI,qBAAqB,GAAG,SAAS,CAAC;IACtC,KAAK,MAAM,UAAU,IAAI,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC;QACnD,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;YAChD,qBAAqB,GAAG,UAAU,CAAC;YACnC,MAAM;QACR,CAAC;IACH,CAAC;IAED,mEAAmE;IACnE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,sFAAsF;QACtF,6EAA6E;QAC7E,OAAO,CAAC,KAAK,CACX,4CAA4C,EAC5C,gBAAgB,CACjB,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { toJSON } from '../../utils';
|
|
|
6
6
|
import { ConditionExpression } from '../condition-expr';
|
|
7
7
|
import { CONTEXT_PARAM_FULL_MATCH_REGEXP, CONTEXT_PARAM_PREFIX, CONTEXT_PARAM_REGEXP, USER_ADDRESS_PARAMS, } from '../const';
|
|
8
8
|
import { SIGNING_CONDITION_OBJECT_CONTEXT_VAR } from '../schemas/signing';
|
|
9
|
+
import { SequentialConditionType, } from '../sequential';
|
|
9
10
|
const ERR_RESERVED_PARAM = (key) => `Cannot use reserved parameter name ${key} as custom parameter`;
|
|
10
11
|
const ERR_INVALID_CUSTOM_PARAM = (key) => `Custom parameter ${key} must start with ${CONTEXT_PARAM_PREFIX}`;
|
|
11
12
|
const ERR_AUTH_PROVIDER_REQUIRED = (key) => `No matching authentication provider to satisfy ${key} context variable in condition`;
|
|
@@ -133,10 +134,22 @@ export class ConditionContext {
|
|
|
133
134
|
}
|
|
134
135
|
else if (typeof value === 'object') {
|
|
135
136
|
// dictionary (Record<string, T> - complex object eg. Condition, ConditionVariable, ReturnValueTest etc.)
|
|
137
|
+
// Collect internally-defined variable names from sequential conditions
|
|
138
|
+
// These are scoped within the condition and should not be required as external context
|
|
139
|
+
const internalContextVariablesFromConditionVariables = new Set();
|
|
140
|
+
if ('conditionType' in value &&
|
|
141
|
+
value.conditionType === SequentialConditionType) {
|
|
142
|
+
value.conditionVariables.forEach((variable) => {
|
|
143
|
+
internalContextVariablesFromConditionVariables.add(`:${variable.varName}`);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
// iterate through all entries
|
|
136
147
|
for (const [, entry] of Object.entries(value)) {
|
|
137
148
|
const contextVarsForValue = this.findContextParameter(entry);
|
|
138
149
|
contextVarsForValue.forEach((contextVar) => {
|
|
139
|
-
|
|
150
|
+
if (!internalContextVariablesFromConditionVariables.has(contextVar)) {
|
|
151
|
+
includedContextVars.add(contextVar);
|
|
152
|
+
}
|
|
140
153
|
});
|
|
141
154
|
}
|
|
142
155
|
}
|
|
@@ -145,11 +158,21 @@ export class ConditionContext {
|
|
|
145
158
|
static findContextParameters(condition) {
|
|
146
159
|
// find all the context variables we need
|
|
147
160
|
const requestedParameters = new Set();
|
|
161
|
+
// Collect internally-defined variable names from sequential conditions
|
|
162
|
+
// These are scoped within the condition and should not be required as external context
|
|
163
|
+
const internalContextVariablesFromConditionVariables = new Set();
|
|
164
|
+
if ('conditionType' in condition &&
|
|
165
|
+
condition.conditionType === SequentialConditionType) {
|
|
166
|
+
condition.conditionVariables.forEach((variable) => {
|
|
167
|
+
internalContextVariablesFromConditionVariables.add(`:${variable.varName}`);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
148
170
|
// iterate through all properties in ConditionProps
|
|
149
171
|
const properties = Object.keys(condition);
|
|
150
172
|
properties.forEach((prop) => {
|
|
151
173
|
this.findContextParameter(condition[prop]).forEach((contextVar) => {
|
|
152
|
-
if (!AUTOMATICALLY_INJECTED_CONTEXT_PARAMS.includes(contextVar)
|
|
174
|
+
if (!AUTOMATICALLY_INJECTED_CONTEXT_PARAMS.includes(contextVar) &&
|
|
175
|
+
!internalContextVariablesFromConditionVariables.has(contextVar)) {
|
|
153
176
|
requestedParameters.add(contextVar);
|
|
154
177
|
}
|
|
155
178
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/conditions/context/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAGL,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/conditions/context/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAGL,mBAAmB,EACnB,mBAAmB,EACnB,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,+BAA+B,EAC/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AChB,OAAe;QAEf,yDAAyD;QACzD,MAAM,kBAAkB,GACtB,MAAM,uBAAuB,CAAC,0BAA0B,CACtD,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,CACR,CAAC;QAEJ,0CAA0C;QAC1C,MAAM,mBAAmB,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QAE1E,MAAM,eAAe,GAAG,IAAI,cAAc,CAAC,mBAAmB,CAAC,CAAC;QAChE,MAAM,aAAa,GACjB,mBAAmB,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;QAC1D,OAAO,IAAI,gBAAgB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;CACF"}
|
|
@@ -7,25 +7,25 @@ export declare const contextVariableConditionSchema: z.ZodObject<{} & {
|
|
|
7
7
|
index: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
|
|
9
9
|
operations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
10
|
-
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str"]>;
|
|
10
|
+
operation: z.ZodEnum<["+=", "-=", "*=", "/=", "%=", "index", "round", "abs", "avg", "ceil", "ethToWei", "floor", "len", "max", "min", "sum", "weiToEth", "bool", "float", "int", "str", "fromJson", "toJson", "fromHex", "toHex", "keccak"]>;
|
|
11
11
|
value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
operation: "float" | "
|
|
13
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
14
14
|
value?: any;
|
|
15
15
|
}, {
|
|
16
|
-
operation: "float" | "
|
|
16
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
17
17
|
value?: any;
|
|
18
18
|
}>, {
|
|
19
|
-
operation: "float" | "
|
|
19
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
20
20
|
value?: any;
|
|
21
21
|
}, {
|
|
22
|
-
operation: "float" | "
|
|
22
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
23
23
|
value?: any;
|
|
24
24
|
}>, {
|
|
25
|
-
operation: "float" | "
|
|
25
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
26
26
|
value?: any;
|
|
27
27
|
}, {
|
|
28
|
-
operation: "float" | "
|
|
28
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
29
29
|
value?: any;
|
|
30
30
|
}>, "many">>;
|
|
31
31
|
} & {
|
|
@@ -35,7 +35,7 @@ export declare const contextVariableConditionSchema: z.ZodObject<{} & {
|
|
|
35
35
|
value?: any;
|
|
36
36
|
index?: number | undefined;
|
|
37
37
|
operations?: {
|
|
38
|
-
operation: "float" | "
|
|
38
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
39
39
|
value?: any;
|
|
40
40
|
}[] | undefined;
|
|
41
41
|
}, {
|
|
@@ -43,7 +43,7 @@ export declare const contextVariableConditionSchema: z.ZodObject<{} & {
|
|
|
43
43
|
value?: any;
|
|
44
44
|
index?: number | undefined;
|
|
45
45
|
operations?: {
|
|
46
|
-
operation: "float" | "
|
|
46
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
47
47
|
value?: any;
|
|
48
48
|
}[] | undefined;
|
|
49
49
|
}>, {
|
|
@@ -51,7 +51,7 @@ export declare const contextVariableConditionSchema: z.ZodObject<{} & {
|
|
|
51
51
|
value?: any;
|
|
52
52
|
index?: number | undefined;
|
|
53
53
|
operations?: {
|
|
54
|
-
operation: "float" | "
|
|
54
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
55
55
|
value?: any;
|
|
56
56
|
}[] | undefined;
|
|
57
57
|
}, {
|
|
@@ -59,33 +59,33 @@ export declare const contextVariableConditionSchema: z.ZodObject<{} & {
|
|
|
59
59
|
value?: any;
|
|
60
60
|
index?: number | undefined;
|
|
61
61
|
operations?: {
|
|
62
|
-
operation: "float" | "
|
|
62
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
63
63
|
value?: any;
|
|
64
64
|
}[] | undefined;
|
|
65
65
|
}>;
|
|
66
66
|
}, "strict", z.ZodTypeAny, {
|
|
67
67
|
conditionType: "context-variable";
|
|
68
|
+
contextVariable: string;
|
|
68
69
|
returnValueTest: {
|
|
69
70
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
70
71
|
value?: any;
|
|
71
72
|
index?: number | undefined;
|
|
72
73
|
operations?: {
|
|
73
|
-
operation: "float" | "
|
|
74
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
74
75
|
value?: any;
|
|
75
76
|
}[] | undefined;
|
|
76
77
|
};
|
|
77
|
-
contextVariable: string;
|
|
78
78
|
}, {
|
|
79
79
|
conditionType: "context-variable";
|
|
80
|
+
contextVariable: string;
|
|
80
81
|
returnValueTest: {
|
|
81
82
|
comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
|
|
82
83
|
value?: any;
|
|
83
84
|
index?: number | undefined;
|
|
84
85
|
operations?: {
|
|
85
|
-
operation: "float" | "
|
|
86
|
+
operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str" | "fromJson" | "toJson" | "fromHex" | "toHex" | "keccak";
|
|
86
87
|
value?: any;
|
|
87
88
|
}[] | undefined;
|
|
88
89
|
};
|
|
89
|
-
contextVariable: string;
|
|
90
90
|
}>;
|
|
91
91
|
export type ContextVariableConditionProps = z.infer<typeof contextVariableConditionSchema>;
|