@nucypher/taco 0.7.0-alpha.3 → 0.7.0-alpha.5

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.
Files changed (80) hide show
  1. package/dist/cjs/conditions/condition.d.ts +1 -0
  2. package/dist/cjs/conditions/condition.js +4 -3
  3. package/dist/cjs/conditions/condition.js.map +1 -1
  4. package/dist/cjs/conditions/predefined/address-allowlist.d.ts +11 -0
  5. package/dist/cjs/conditions/predefined/address-allowlist.js +31 -0
  6. package/dist/cjs/conditions/predefined/address-allowlist.js.map +1 -0
  7. package/dist/cjs/conditions/predefined/index.d.ts +1 -0
  8. package/dist/cjs/conditions/predefined/index.js +2 -1
  9. package/dist/cjs/conditions/predefined/index.js.map +1 -1
  10. package/dist/cjs/conditions/schemas/address-allowlist.d.ts +3 -0
  11. package/dist/cjs/conditions/schemas/address-allowlist.js +11 -0
  12. package/dist/cjs/conditions/schemas/address-allowlist.js.map +1 -0
  13. package/dist/cjs/conditions/schemas/context-variable.d.ts +46 -0
  14. package/dist/cjs/conditions/schemas/contract.d.ts +54 -0
  15. package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -0
  16. package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js +3 -0
  17. package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
  18. package/dist/cjs/conditions/schemas/json-api.d.ts +54 -0
  19. package/dist/cjs/conditions/schemas/json-rpc.d.ts +54 -0
  20. package/dist/cjs/conditions/schemas/json.d.ts +46 -0
  21. package/dist/cjs/conditions/schemas/return-value-test.d.ts +76 -0
  22. package/dist/cjs/conditions/schemas/return-value-test.js +2 -0
  23. package/dist/cjs/conditions/schemas/return-value-test.js.map +1 -1
  24. package/dist/cjs/conditions/schemas/rpc.d.ts +46 -0
  25. package/dist/cjs/conditions/schemas/sequential.js +6 -2
  26. package/dist/cjs/conditions/schemas/sequential.js.map +1 -1
  27. package/dist/cjs/conditions/schemas/time.d.ts +46 -0
  28. package/dist/cjs/conditions/schemas/utils.js +0 -2
  29. package/dist/cjs/conditions/schemas/utils.js.map +1 -1
  30. package/dist/cjs/conditions/schemas/variable-operation.d.ts +48 -0
  31. package/dist/cjs/conditions/schemas/variable-operation.js +81 -0
  32. package/dist/cjs/conditions/schemas/variable-operation.js.map +1 -0
  33. package/dist/cjs/index.d.ts +2 -2
  34. package/dist/cjs/index.js.map +1 -1
  35. package/dist/cjs/sign.d.ts +7 -2
  36. package/dist/cjs/sign.js +86 -46
  37. package/dist/cjs/sign.js.map +1 -1
  38. package/dist/cjs/types.d.ts +1 -1
  39. package/dist/es/conditions/condition.d.ts +1 -0
  40. package/dist/es/conditions/condition.js +1 -1
  41. package/dist/es/conditions/condition.js.map +1 -1
  42. package/dist/es/conditions/predefined/address-allowlist.d.ts +11 -0
  43. package/dist/es/conditions/predefined/address-allowlist.js +27 -0
  44. package/dist/es/conditions/predefined/address-allowlist.js.map +1 -0
  45. package/dist/es/conditions/predefined/index.d.ts +1 -0
  46. package/dist/es/conditions/predefined/index.js +1 -0
  47. package/dist/es/conditions/predefined/index.js.map +1 -1
  48. package/dist/es/conditions/schemas/address-allowlist.d.ts +3 -0
  49. package/dist/es/conditions/schemas/address-allowlist.js +8 -0
  50. package/dist/es/conditions/schemas/address-allowlist.js.map +1 -0
  51. package/dist/es/conditions/schemas/context-variable.d.ts +46 -0
  52. package/dist/es/conditions/schemas/contract.d.ts +54 -0
  53. package/dist/es/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -0
  54. package/dist/es/conditions/schemas/export-for-zod-doc-gen.js +3 -0
  55. package/dist/es/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
  56. package/dist/es/conditions/schemas/json-api.d.ts +54 -0
  57. package/dist/es/conditions/schemas/json-rpc.d.ts +54 -0
  58. package/dist/es/conditions/schemas/json.d.ts +46 -0
  59. package/dist/es/conditions/schemas/return-value-test.d.ts +76 -0
  60. package/dist/es/conditions/schemas/return-value-test.js +2 -0
  61. package/dist/es/conditions/schemas/return-value-test.js.map +1 -1
  62. package/dist/es/conditions/schemas/rpc.d.ts +46 -0
  63. package/dist/es/conditions/schemas/sequential.js +6 -2
  64. package/dist/es/conditions/schemas/sequential.js.map +1 -1
  65. package/dist/es/conditions/schemas/time.d.ts +46 -0
  66. package/dist/es/conditions/schemas/utils.js +0 -2
  67. package/dist/es/conditions/schemas/utils.js.map +1 -1
  68. package/dist/es/conditions/schemas/variable-operation.d.ts +48 -0
  69. package/dist/es/conditions/schemas/variable-operation.js +78 -0
  70. package/dist/es/conditions/schemas/variable-operation.js.map +1 -0
  71. package/dist/es/index.d.ts +2 -2
  72. package/dist/es/index.js +1 -1
  73. package/dist/es/index.js.map +1 -1
  74. package/dist/es/sign.d.ts +7 -2
  75. package/dist/es/sign.js +87 -47
  76. package/dist/es/sign.js.map +1 -1
  77. package/dist/es/types.d.ts +1 -1
  78. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  79. package/dist/tsconfig.es.tsbuildinfo +1 -1
  80. package/package.json +4 -4
@@ -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>;
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.blockchainReturnValueTestSchema = exports.returnValueTestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const context_1 = require("./context");
6
+ const variable_operation_1 = require("./variable-operation");
6
7
  const returnValueTestBaseSchema = zod_1.z.object({
7
8
  index: zod_1.z.number().int().nonnegative().optional(),
8
9
  comparator: zod_1.z.enum(['==', '>', '<', '>=', '<=', '!=', 'in', '!in']),
10
+ operations: variable_operation_1.variableOperationsArraySchema.describe('Optional operations to perform on the obtained result before comparison'),
9
11
  });
10
12
  const requireNonEmptyArrayIfComparatorIsIn = (data) => {
11
13
  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,6BAAwB;AAExB,uCAGmB;AAEnB,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAChD,UAAU,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;CACpE,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;AAEW,QAAA,qBAAqB,GAAG,yBAAyB;KAC3D,MAAM,CAAC;IACN,KAAK,EAAE,mCAAyB;CACjC,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC;KACrE,QAAQ,CACP,8FAA8F,CAC/F,CAAC;AAES,QAAA,+BAA+B,GAAG,yBAAyB;KACrE,MAAM,CAAC;IACN,KAAK,EAAE,6CAAmC;CAC3C,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"return-value-test.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/return-value-test.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,uCAGmB;AACnB,6DAAqE;AAErE,MAAM,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAChD,UAAU,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACnE,UAAU,EAAE,kDAA6B,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;AAEW,QAAA,qBAAqB,GAAG,yBAAyB;KAC3D,MAAM,CAAC;IACN,KAAK,EAAE,mCAAyB;CACjC,CAAC;KACD,MAAM,CAAC,oCAAoC,EAAE,uBAAuB,CAAC;KACrE,QAAQ,CACP,8FAA8F,CAC/F,CAAC;AAES,QAAA,+BAA+B,GAAG,yBAAyB;KACrE,MAAM,CAAC;IACN,KAAK,EAAE,6CAAmC;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";
@@ -7,6 +7,7 @@ const common_1 = require("./common");
7
7
  const compound_1 = require("./compound");
8
8
  const if_then_else_1 = require("./if-then-else");
9
9
  const utils_1 = require("./utils");
10
+ const variable_operation_1 = require("./variable-operation");
10
11
  const getAllNestedConditionVariableNames = (condition) => {
11
12
  const conditionVariables = [];
12
13
  if (condition.conditionType === exports.SequentialConditionType) {
@@ -35,10 +36,13 @@ const noDuplicateVarNames = (condition) => {
35
36
  return duplicates.length === 0;
36
37
  };
37
38
  exports.SequentialConditionType = 'sequential';
38
- exports.conditionVariableSchema = zod_1.z.lazy(() => zod_1.z.object({
39
+ exports.conditionVariableSchema = zod_1.z.lazy(() => zod_1.z
40
+ .object({
39
41
  varName: common_1.plainStringSchema,
40
42
  condition: utils_1.anyConditionSchema,
41
- }));
43
+ operations: variable_operation_1.variableOperationsArraySchema.describe('Optional operations to perform on the obtained condition result before storing it'),
44
+ })
45
+ .describe('Executes a condition and stores the result as a variable within a sequential condition.'));
42
46
  exports.sequentialConditionSchema = common_1.baseConditionSchema
43
47
  .extend({
44
48
  conditionType: zod_1.z
@@ -1 +1 @@
1
- {"version":3,"file":"sequential.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/sequential.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;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S,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CACnC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,CACrD,CAAC;IACF,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;AACjC,CAAC,CAAC;AAEW,QAAA,uBAAuB,GAAG,YAAY,CAAC;AAEvC,QAAA,uBAAuB,GAAgB,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC9D,OAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,0BAAiB;IAC1B,SAAS,EAAE,0BAAkB;CAC9B,CAAC,CACH,CAAC;AAGW,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,CAAC,CAAC;CACnE,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"}
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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odNumber>;
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: "time";
@@ -33,6 +71,10 @@ export declare const timeConditionSchema: 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: "blocktime";
@@ -41,6 +83,10 @@ export declare const timeConditionSchema: 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
  chain: number;
46
92
  conditionType?: "time" | undefined;
@@ -7,7 +7,6 @@ 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");
11
10
  const json_api_1 = require("./json-api");
12
11
  const json_rpc_1 = require("./json-rpc");
13
12
  const jwt_1 = require("./jwt");
@@ -21,7 +20,6 @@ exports.anyConditionSchema = zod_1.z.lazy(() => zod_1.z.union([
21
20
  context_variable_1.contextVariableConditionSchema,
22
21
  contract_1.contractConditionSchema,
23
22
  ecdsa_1.ecdsaConditionSchema,
24
- json_1.jsonConditionSchema,
25
23
  json_api_1.jsonApiConditionSchema,
26
24
  json_rpc_1.jsonRpcConditionSchema,
27
25
  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,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
+ {"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"}
@@ -0,0 +1,48 @@
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"];
3
+ export declare const UNARY_OPERATOR_FUNCTIONS: string[];
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"]>;
6
+ value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
9
+ value?: any;
10
+ }, {
11
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
12
+ value?: any;
13
+ }>, {
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
+ export declare const MAX_VARIABLE_OPERATIONS = 5;
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"]>;
29
+ value: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
32
+ value?: any;
33
+ }, {
34
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
35
+ value?: any;
36
+ }>, {
37
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
38
+ value?: any;
39
+ }, {
40
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
41
+ value?: any;
42
+ }>, {
43
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
44
+ value?: any;
45
+ }, {
46
+ operation: "float" | "+=" | "-=" | "*=" | "/=" | "%=" | "index" | "round" | "abs" | "avg" | "ceil" | "ethToWei" | "floor" | "len" | "max" | "min" | "sum" | "weiToEth" | "bool" | "int" | "str";
47
+ value?: any;
48
+ }>, "many">>;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.variableOperationsArraySchema = exports.MAX_VARIABLE_OPERATIONS = exports.variableOperationSchema = exports.UNARY_OPERATOR_FUNCTIONS = exports.OPERATOR_FUNCTIONS = void 0;
4
+ const zod_1 = require("zod");
5
+ const context_1 = require("./context");
6
+ exports.OPERATOR_FUNCTIONS = [
7
+ '+=',
8
+ '-=',
9
+ '*=',
10
+ '/=',
11
+ '%=',
12
+ 'index',
13
+ 'round',
14
+ // operations that don't require 2nd value
15
+ 'abs',
16
+ 'avg',
17
+ 'ceil',
18
+ 'ethToWei',
19
+ 'floor',
20
+ 'len',
21
+ 'max',
22
+ 'min',
23
+ 'sum',
24
+ 'weiToEth',
25
+ // casting
26
+ 'bool',
27
+ 'float',
28
+ 'int',
29
+ 'str',
30
+ ];
31
+ exports.UNARY_OPERATOR_FUNCTIONS = [
32
+ 'abs',
33
+ 'avg',
34
+ 'ceil',
35
+ 'ethToWei',
36
+ 'floor',
37
+ 'len',
38
+ 'max',
39
+ 'min',
40
+ 'sum',
41
+ 'weiToEth',
42
+ // casting
43
+ 'bool',
44
+ 'float',
45
+ 'int',
46
+ 'str',
47
+ ];
48
+ exports.variableOperationSchema = zod_1.z
49
+ .object({
50
+ operation: zod_1.z.enum(exports.OPERATOR_FUNCTIONS),
51
+ value: context_1.paramOrContextParamSchema.optional(),
52
+ })
53
+ .refine((data) => {
54
+ if (exports.UNARY_OPERATOR_FUNCTIONS.includes(data.operation) &&
55
+ data.value !== undefined) {
56
+ return false;
57
+ }
58
+ return true;
59
+ }, {
60
+ message: 'Value not allowed for this operation',
61
+ path: ['value'],
62
+ })
63
+ .refine((data) => {
64
+ if (!exports.UNARY_OPERATOR_FUNCTIONS.includes(data.operation) &&
65
+ data.value === undefined) {
66
+ return false;
67
+ }
68
+ return true;
69
+ }, {
70
+ message: 'Value must be defined for operation',
71
+ path: ['value'],
72
+ })
73
+ .describe('An operation that can be performed on an obtained result.');
74
+ exports.MAX_VARIABLE_OPERATIONS = 5;
75
+ exports.variableOperationsArraySchema = zod_1.z
76
+ .array(exports.variableOperationSchema)
77
+ .min(1)
78
+ .max(exports.MAX_VARIABLE_OPERATIONS)
79
+ .optional()
80
+ .describe('Optional operations to perform on the obtained result');
81
+ //# sourceMappingURL=variable-operation.js.map
@@ -0,0 +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;CACG,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;CACN,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,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